pax_global_header00006660000000000000000000000064151777027500014525gustar00rootroot0000000000000052 comment=3bcf137430129286d342d559a1b5ca266850a1fc chibicc-1.0.24/000077500000000000000000000000001517770275000131755ustar00rootroot00000000000000chibicc-1.0.24/.devcontainer.json000077500000000000000000000004671517770275000166410ustar00rootroot00000000000000{ "build": { "dockerfile": "Dockerfile" }, "customizations": { "vscode": { "extensions": [ "ms-vscode.cpptools", "ms-vscode.cpptools-extension-pack", "ms-vscode.cpptools-themes", "ms-vscode.makefile-tools", "ms-azuretools.vscode-docker" ] } } } chibicc-1.0.24/.gitignore000077500000000000000000000006141517770275000151710ustar00rootroot00000000000000**/*~ **/\#* **/*.o **/*.s **/a.out **/*.exe .vscode /tmp* /thirdparty /chibicc /test/*.exe /stage2 /build /cmake-build-debug .venv/ pyproject.toml uv.lock **/*.py build.log compare.txt **/*.diff AGENTS.md /.continue gdb_help.txt .cache/ **/*.log **/*.env /.github /.specify out/ /.opencode conftest.zend compile_commands.json .gdbinit vgcore.* .codex **/*.S .codegraph check_constant_folding.shchibicc-1.0.24/CMakeLists.txt000066400000000000000000000005621517770275000157400ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.22.1) install(PROGRAMS ${Boost_LIBRARIES} DESTINATION ~/install/lib) set(CMAKE_CXX_STANDARD 20) project(chibicc) FIND_PACKAGE(Boost 1.48 COMPONENTS REQUIRED) INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} ) file(GLOB SOURCE "*.h" "*.c" "include/*.h") add_executable(chibicc ./main.c ${SOURCE} ${Boost_LIBRARIES})chibicc-1.0.24/Dockerfile000077500000000000000000000016441517770275000151770ustar00rootroot00000000000000FROM ubuntu:20.04 RUN \ apt-get update && \ apt-get upgrade -y && \ apt-get install -y build-essential # dependencies for thirdparty cpython RUN \ sed -i 's/# deb-src http:\/\/archive.ubuntu.com\/ubuntu\/ focal-updates universe/deb-src http:\/\/archive.ubuntu.com\/ubuntu\/ focal-updates universe/' /etc/apt/sources.list && \ apt-get update && \ DEBIAN_FRONTEND="noninteractive" apt-get build-dep -y python3.9 # dependencies for thirdparty git RUN \ DEBIAN_FRONTEND="noninteractive" apt-get install -y gettext libcurl4-openssl-dev libexpat-dev libssl-dev tclsh zlib1g-dev # dependencies for thirdparty libpng RUN \ apt-get install -y zlib1g-dev # dependencies for thirdparty sqlite RUN \ DEBIAN_FRONTEND="noninteractive" apt-get install -y tcl-dev tclsh zlib1g-dev # dependencies for thirdparty tinycc RUN \ DEBIAN_FRONTEND="noninteractive" apt-get install -y texinfo git ADD . /opt/chibicc WORKDIR /opt/chibicc chibicc-1.0.24/ISSUES.md000066400000000000000000000147211517770275000145370ustar00rootroot00000000000000# issues List all issues found and fixed ## issues and pull requests fixed - Add dockerfile #23 pull request from 0xc0 - Issue #30 from ludocode - Typecheck void type expressions in return and assignment #41 pull request from StrongerXi - Binary add segfaults when at least 1 arg is non-numeric, and both are non-pointer types #42 pull request from StrongerXi - It's UB to have a call to va_start without a corresponding call to va_end #51 pull request from camel-cdr - Fix bug in codegen.c if (ty->size == 4) instead of if (ty->size == 12) #52 pull request from mtsamis - difficulty in understanding priorities. #54 pull request from ihsinme - Fixed bug in preprocessor process extraneous tokens. #95 pull request from memleaker - Hashmap: Do not insert duplicate keys #98 pull request from boki1 - issue #65 assembler error on larger than 32-bit bitfields from GabrielRavier - issue #28 bitfield validation from zamfofex - issue #48 asan issues with memcmp from math4tots - issue #36 assertion when using empty structs from edubart - issue #31 Anonymously named bitfield member segfaults compiler from Anonymously named bitfield member segfaults compiler fixed by zamfofex - issue #45 When anonymous union field is specified by designator, compiler crashe from vain0x fixed by zamfofex - issue #80 Size of string is wrong from tyfkda - issue #72 Internal error when initializing array of long with string literals from GabrielRavier - issue #47 postfix tails on compound literals from vain0x - issue #62 Nested designators error from sanxiyn - issue #37 Using goto inside statement expressions gives an error from edubart - issue #63 Function type parameter without identifier errs from sanxiyn - issue #69 Internal error on long double initializer from GabrielRavier - issue #71 Codegen error on _Atomic long double operation assignments from GabrielRavier - Fix atomic fetch operations #101 pull request from chjj - issue #107 string intialized by function-like failed during compilation - issue #108 if a macro ends a line and the next line starts by "#ifdef" the "#" is not recognized starting from beginning of the line. - issue #109 managing #warning as preprocess instruction - issue #110 union initialized by "input_control_param_t it = { .id = p_input, .time.i_val = 1};" failed due to comma. - issue #113 depending where is _Atomic parsing failed ./issues/issue113.c:7: char *_Atomic str; /**< Current value (if character string) */ ^ expected ',' - issue #116 (issue #110 at rui314/chibicc) token incorrectly splitted into two tokens the first one considered wrongly as number ./issues/issue116.c:26: make_dh(1024_160); ^ expected ',' - issue #117 parsing failed if a generic argument in macro starts by a number example ...(void))fromtype##2obj_decode... in this case chibicc considers wrongly 2 as a number. - issue #118 issues/issue118.c:1: NID_sha_224 ^ parse.c: in primary : error: undefined variable - issue #119 caused by _Complex attribute /usr/include/x86_64-linux-gnu/bits/cmathcalls.h:55: __MATHCALL (cacos, (_Mdouble_complex_ __z)); ^ expected ',' - issue #120 in VLC static_assert function outside a function caused an issue with chibicc issues/issue120.c:30: static_assert(AOUT_CHANIDX_MAX == AOUT_CHAN_MAX, "channel count mismatch"); ^ tokenize.c: in skip : expected ',' - issue #121 in VLC static_assert function with sizeof or offsetof caused an issue with chibicc: ./include/stddef.h:11: #define offsetof(type, member) ((size_t)&(((type *)0)->member)) ^ tokenize.c: in skip : expected ',' - issue #122 in util_linux compilation it fails during assembly "file number less than 0" when #line generates negative number - issue #123 in util_linux compilation fails with regex when a local variable in arguments it's used for another argument. extern int regexec(..., size_t __nmatch,... regmatch_t __pmatch[_Restrict_arr_ _REGEX_NELTS(__nmatch)],... - issue #124 some macro defined after their used caused issue with chibicc. gcc allows it. - issue #125 extended assembly not managed yet. First taken in account of extended assembly (basic one only one operand) - issue #126 old C style with declaration argument type after the function parameters and before the beginning of the function body : size_t strlcpy(dst, src, siz) char *dst; const char *src; size_t siz; {... strlcpy.c:44:2: error: char *dst; ^ tokenize.c: in skip : expected '{' - issue #127 incorrect fix for old C style that cause issue later during linkage. - issue #128 union initialized by an expression failed : issues/issue127.c:49: union sockaddr_u localaddr = lfdi->remoteaddr; ^ tokenize.c: in skip : expected ',' - issue #131 (ISS-131) parsing issue when trying to compile nginx project caused by fix #121 - issue #133 with old C style function declaration using comma to declare same type of variable : test/example.c:89: Byte *compr, *uncompr; ^ tokenize.c: in skip : expected ';' - issue #134 (ISS-134) with parameter expression during zlib project due to bug in func_params2. - issue #136 (ISS-136) zlib project error with unknown extension: main.c : in get_file_type : unknown file extension: libz.so.1.2.12 - issue #139 (ISS-139) extended assembly compiling but execution doesn't return the correct result. - issue #142 (ISS-142) Preprocessor fail with nested macros. First temporary fix. - adding install in makefile (#PR24 from rurban). - Adding ND_MOD in is_const_expr(#issue 134 from matthewsot). - Fixing incorrect small struct passing in 5th argument position (issue #127 from sgraham). - ISS-140 fixing compiling chibicc with chibicc tests failed with trying to parse the object.o file instead of linking only.chibicc-1.0.24/LICENSE000077500000000000000000000020531517770275000142050ustar00rootroot00000000000000MIT License Copyright (c) 2019 Rui Ueyama Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. chibicc-1.0.24/Makefile000077500000000000000000000116341517770275000146450ustar00rootroot00000000000000# The installation prefix PREFIX=/usr/local GCC_VERSION!=gcc -dumpversion CC=gcc CFLAGS =-std=c11 -g -fno-common -Wall -Wno-switch -DPREFIX=\"$(PREFIX)\" -DGCC_VERSION=\"$(GCC_VERSION)\" CFLAGS_DIAG= -std=c11 -g -mavx2 CFLAGS_SPE = -g -fomit-frame-pointer -O3 -mavx2 LDFLAGS = -lcrypto TEST_JOBS ?= TEST_TIMEOUT ?= 30 OBJECT=chibicc OBJECTLIB=libchibicc SRCS=$(wildcard *.c) OBJS=$(SRCS:.c=.o) TEST_SRCS=$(wildcard test/*.c) TESTS=$(TEST_SRCS:.c=.exe) ISSUES_SRCS=$(wildcard issues/*.c) TESTS_SPE = $(TESTS:test/%=test_spe/%) #PNG=$(TEST_SRCS:.c=.tmp) #PNG2=$(ISSUES_SRCS:.c=.tmp) # Stage 1 $(OBJECT): $(OBJS) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(OBJS): $(OBJECT).h test/%.exe: $(OBJECT) test/%.c ./$(OBJECT) $(CFLAGS_DIAG) -Iinclude -Itest -c -o test/$*.o test/$*.c $(CC) -pthread -o $@ test/$*.o -xc test/common -lm $(LDFLAGS) # dot -Tpng test/$*.dot -o diagram/$*.png || echo $*.dot failed test: $(TESTS) TEST_JOBS="$(TEST_JOBS)" TEST_TIMEOUT="$(TEST_TIMEOUT)" ./test/run_tests.sh $(addprefix ./,$^) test/driver.sh ./$(OBJECT) test_spe/%.exe: $(OBJECT) test/%.c mkdir -p test_spe ./$(OBJECT) $(CFLAGS_DIAG) $(CFLAGS_SPE) -Iinclude -Itest \ -c -o test_spe/$*.o test/$*.c $(CC) -pthread -o $@ test_spe/$*.o -xc test/common -lm $(LDFLAGS) test_spe: $(TESTS_SPE) TEST_JOBS="$(TEST_JOBS)" TEST_TIMEOUT="$(TEST_TIMEOUT)" ./test/run_tests.sh $(addprefix ./,$^) # #for managing dot diagram # test-png: $(TESTS) test-all: test test-stage2 # Stage 2 stage2/$(OBJECT): $(OBJS:%=stage2/%) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) stage2/%.o: $(OBJECT) %.c mkdir -p stage2/test ./chibicc -c -o $(@D)/$*.o $*.c stage2/test/%.exe: stage2/$(OBJECT) test/%.c mkdir -p stage2/test ./stage2/$(OBJECT) -Iinclude -Itest -c -o stage2/test/$*.o test/$*.c $(CC) -pthread -o $@ stage2/test/$*.o -xc test/common $(LDFLAGS) test-stage2: $(TESTS:test/%=stage2/test/%) TEST_JOBS="$(TEST_JOBS)" TEST_TIMEOUT="$(TEST_TIMEOUT)" ./test/run_tests.sh $(addprefix ./,$^) test/driver.sh ./stage2/$(OBJECT) projects-all: projects projects-oth lxc vlc git memcached cpython openssl projects-oth: sqlite vim nmap curl projects: zlib util-linux nginx curl: cd ../curl && make clean && CC=chibicc CFLAGS="-std=c11 -g" ./configure --with-openssl && make -j4 && make -j4 test zlib: cd ../zlib && make clean && CC=chibicc CFLAGS="-fPIC -std=c11 -g" ./configure && make && make test nmap: cd ../nmap && make clean && CC=chibicc CFLAGS="-fPIC -std=c11 -g" LIBS="-ldbus-1 -latomic -libverbs -lrdmacm" ./configure --with-dbus && make -j4 && make check openssl: cd ../openssl && make clean && CC=chibicc CFLAGS="-std=c11 -g -O0" ./Configure linux-x86_64 --debug enable-fips enable-legacy && make -j4 && HARNESS_JOBS=1 make test util-linux: cd ../util-linux && make clean && CC=chibicc CFLAGS="-fPIC -std=c11 -g" ./configure && make -j4 && make check-programs && cd tests && ./run.sh nginx: cd ../nginx && make clean && CC=chibicc CFLAGS="-fPIC -std=c11" ./auto/configure --with-http_ssl_module && make -j4 vim: cd ../vim && make clean && CC=chibicc CFLAGS="-fPIC -std=c11 -g" ./configure && make -j2 && make test lxc: cd ../lxc && rm -rf build && CC=gcc \ meson setup build && cd build && sudo cp /usr/bin/gcc /usr/bin/gcc_backup && \ sudo cp /usr/local/bin/chibicc /usr/bin/gcc && meson compile && sudo cp /usr/bin/gcc_backup /usr/bin/gcc vlc: cd ../vlc && make clean && CC=chibicc CFLAGS="-fPIC -std=c11 -g" ./configure \ --disable-lua --disable-xcb --disable-qt --disable-alsa --disable-sse --host x86_64-linux-gnu && \ make -j4 all cpython: cd ../cpython && CC=chibicc CFLAGS="-std=c11 -O3 -g" ./configure \ --build=x86_64-pc-linux-gnu && make clean && make -j2 && make test git: cd ../git && CC=chibicc CFLAGS="-fPIC -std=c11 -g" ./configure && make && make test memcached: cd ../memcached && make clean && CC=chibicc CFLAGS="-fPIC -std=c11 -g" ./configure && make -j4 && make test openssh-portable: cd ../openssh-portable && make clean && CC=chibicc CFLAGS="-std=c11 -g" ./configure && make -j4 && make tests sqlite: cd ../sqlite && CC=chibicc CFLAGS="-fPIC -std=c11 -g" ./configure && make clean && make -j2 && make test php-src: cd ../php-src && CC=chibicc CFLAGS="-fPIC -std=c11 -g" ./buildconf && ./configure && make clean && make -j2 && make test # Misc. libchibicc: $(OBJECT) $(OBJECTLIB).so CFLAGS +=-fPIC libchibicc.so: $(OBJS) $(CC) $(CFLAGS) -o $@ $^ -shared clean: rm -rf $(OBJECT) tmp* *.zend $(TESTS) issues/*.s issues/*.exe issues/*.dot test/*.s test/*.exe test_spe/*.exe stage2 diagram/*.png test/*.dot $(OBJECTLIB) find * -type f '(' -name '*~' -o -name '*.o' ')' -exec rm {} ';' install: $(OBJECT) install -v -D -m 755 -t $(PREFIX)/bin/ $(OBJECT) install -v -D -m 644 -t $(PREFIX)/include/x86_64-linux-gnu/chibicc/ include/* uninstall: rm -f $(PREFIX)/bin/chibicc rm -f $(PREFIX)/include/x86_64-linux-gnu/chibicc/* .PHONY: test clean test-stage2 libchibicc projects projects-all projects-oth test-all install uninstall test_spe chibicc-1.0.24/README.md000077500000000000000000000536071517770275000144720ustar00rootroot00000000000000# chibicc: A Small C Compiler from Rui Ueyama This project has been forked from https://github.com/rui314/chibicc I want to play with it and to add some other options like choosing other linker than default ld. It's for learning purposes too, to try to understand existing code and to extend it. Using PVS.studio to find some potential issues and fix them. Trying to work on issues and pull requests done in the original repository. ## usage ./chibicc --help or ./chibicc -h chibicc is a C compiler based on chibicc created by Rui Ueyama. See original project https://github.com/rui314/chibicc for more information this chibicc contains only some differences for now like new parameters chibicc usage : --help or -h print the help --version or -v print the version of chibicc -cc1 run the cc1 function needs -cc1-input (-cc1-output optional) parameter -fuse-ld to specify other linker than ld used by default -x Specify the language of the following input files. Permissible languages include: c assembler none 'none' means revert to the default behavior of guessing the language based on the file's extension. -S generate assembly file -o path to output executable if omitted a.out generated -c path to source to compile -Xlinker Pass on to the linker. -Wl, Pass comma-separated on to the linker. -z Pass on to the linker. -soname Pass -soname on to the linker. --version-script Pass --version-script to the linker. -I Pass path to the include directories -L Pass path to the lib directories -D define macro example -DM13 -U undefine macro example -UM13 -s to strip all symbols during linkage phasis -M -MD -MP -MMD -MF -MT -MQ compiler write a list of input files to stdout in a format that "make" command can read. This feature is used to automate file dependency management -fpic or -fPIC Generate position-independent code (PIC) -fno-pic disables the generation of position-independent code with relative address references -pie Create a dynamically linked position independent -fpie Create a dynamically linked position independent -fPIE Create a dynamically linked position independent -fcommon is the default if not specified, it's mainly useful to enable legacy code to link without errors -fno-common specifies that the compiler places uninitialized global variables in the BSS section of the object file. -static pass to the linker to link a program statically -pthread pass to the linker to link with lpthread library -shared pass to the linker to produce a shared object which can then be linked with other objects to form an executable. -hashmap-test to test the hashmap function -idirafter apply to lookup for both the #include "file" and #include directives. -### to dump all commands executed by chibicc -debug to dump all commands executed by chibicc in a log file in /tmp/chibicc.log -E Stop after the preprocessing stage; do not run the compiler proper. The output is in the form of preprocessed source code, which is sent to the standard output. Input files that don’t require preprocessing are ignored. -rpath Add a directory to the runtime library search path this parameter is passed to the linker. This is used when linking an ELF executable with shared objects. All -rpath arguments are concatenated and passed to the runtime linker, which uses them to locate shared objects at runtime. The -rpath option is also used when locating shared objects which are needed by shared objects explicitly included in the link. -dumpmachine it's required by some projects returns x86_64-linux-gnu -dotfile generates a file with .dot extension that can be visualized using graphviz package -dM Print macro definitions in -E mode instead of normal output -print print all tokens in a log file in /tmp/chibicc.log -A print Abstract Syntax Tree in a log file in /tmp/chibicc.log -msse enabling sse support -mno-sse disabling sse support -msse2 enabling sse2 support -mno-sse2 disabling sse2 support -msse3 enabling sse3 support -mno-sse3 disabling sse3 support -msse4 enabling sse4 support -mno-sse4 disabling sse4 support -msse4.1 enabling sse4.1 support -mcrc32 enabling crc32 instruction support -nostdlib Do not use the standard system startup files or libraries when linking -nostdinc Do not use the standard system header files when compiling -std=c99 generates an error on implicit function declaration (without -std only a warning is emitted) -std=c11 generates an error on implicit function declaration (without -std only a warning is emitted) -mmmx enabling mmx instructions -mno-mmx disabling mmx instructions -mavx enabling avx instructions -mavx2 enabling avx2 instructions -print-search-dirs prints minimal information on install dir. -Werror any warning is sent as an error and stops the compile -f-omit-frame-pointer omits frame pointer and uses rsp-relative addressing. Minimal stack usage -f-no-omit-frame-pointer always keeps frame pointer (default) -g enabling debug symbols -O0 disabling optimization -O or -O1 enabling optimization level 1 -O2 enabling optimization level 2 -O3 enabling optimization level 3 chibicc [ -o ] ## compile To compile chibicc with make : make To compile chibicc with cmake you need to install boost library. Then you can compile it with cmake : cmake -S . -B ./build cd build make ## Examples Note that probably you need to define the include parameter and lib parameter to be able to execute these examples outside the chibicc directory. If you forgot you will have similar error message : /usr/include/stdio.h:33: #include ^ stddef.h: cannot open file: No such file or directory To solve it, add the include and lib parameter like below assuming that we are in the parent chibicc directory : chibicc pointerofpointers.c -I./chibicc/include -L./chibicc/lib printing the help ./chibicc --help ./chibicc -h printing the version ./chibicc --version ./chibicc -v compiling and generating an executable ./chibicc -o ./test/hello ./test/hello.c specifying another linker than the default one here lld : ./chibicc -o ./test/hello ./test/hello.c -fuse-ld ld.lld specifying another linker than the default one here mold (https://github.com/rui314/mold) ./chibicc -o ./test/hello ./test/hello.c -fuse-ld mold generating assembly file ./chibicc -S ./test/hello.c generating a.out file if no parameter -o provided ./chibicc ./test/hello.c generating the object only : it generates the pointerofpointers.o ./chibicc -c pointerofpointers.c -I./chibicc/include -L./chibicc/lib generating executable from objects : ./chibicc pointerofpointers.o -o pointersofpointers defining condition at compile time : ./chibicc -o ./test/mydefine ./test/define.c -DM13 -I../include -L../lib ./test/mydefine 3 undefining condition at compile time : ./chibicc -o ./test/mydefine ./test/define.c -UM13 -I../include -L../lib ./test/mydefine 4 By default the symbol tables is populated: chibicc -o ./test/mydefine ./test/define.c objdump -t ./test/mydefine ./test/mydefine: file format elf64-x86-64 SYMBOL TABLE: 0000000000000000 l df *ABS* 0000000000000000 crt1.o 0000000000400320 l O .note.ABI-tag 0000000000000020 \_\_abi_tag 0000000000000000 l df *ABS* 0000000000000000 crtstuff.c Stripping symbol tables during linkage phasis adding -s parameter : ./chibicc -o ./test/mydefine ./test/define.c -s objdump -t ./test/mydefine ./test/mydefine: file format elf64-x86-64 SYMBOL TABLE: no symbols other way to generate assembly file ./chibicc ./test/define.c -cc1 -cc1-input ./test/define.c -cc1-output mydefine.s generating dependencies in std output : ./chibicc ./test/define.c -M define.o: \ ./test/define.c \ /usr/include/stdio.h \ /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \ /usr/include/features.h \ generating dependencies in a output file with ".d" extension and generating executable a.out : ./chibicc ./test/define.c -MD ls *.d define.d ## options always passed to the linker it means that if you don't use the ld linker or ld.lld probably some options should be conditionned depending your linker lld-link: warning: ignoring unknown argument '-o' lld-link: warning: ignoring unknown argument '-m' lld-link: warning: ignoring unknown argument '-L/usr/lib/gcc/x86_64-linux-gnu/9' lld-link: warning: ignoring unknown argument '-L/usr/lib/x86_64-linux-gnu' lld-link: warning: ignoring unknown argument '-L/usr/lib64' lld-link: warning: ignoring unknown argument '-L/lib64' lld-link: warning: ignoring unknown argument '-L/usr/lib/x86_64-linux-gnu' lld-link: warning: ignoring unknown argument '-L/usr/lib/x86_64-pc-linux-gnu' lld-link: warning: ignoring unknown argument '-L/usr/lib/x86_64-redhat-linux' lld-link: warning: ignoring unknown argument '-L/usr/lib' lld-link: warning: ignoring unknown argument '-L/lib' lld-link: warning: ignoring unknown argument '-dynamic-linker' lld-link: warning: ignoring unknown argument '-lc' lld-link: warning: ignoring unknown argument '-lgcc' lld-link: warning: ignoring unknown argument '--as-needed' lld-link: warning: ignoring unknown argument '-lgcc_s' lld-link: warning: ignoring unknown argument '--no-as-needed' ## options ignored List of options ignored : "-P" "-Wall" "-Wextra" "-Wpedantic" "-Wno-switch" "-Wno-clobbered" "-Wduplicated-cond" "-Wno-unused-variable" "-Wno-unused-parameter" "-Wno-sign-compare" "-Wno-format-y2k" "-Wno-uninitialized" "-Wmissing-prototypes" "-Wmissing-declarations" "-Wredundant-decls" "-Winit-self" "-fno-math-errno" "-fno-rounding-math" "-fno-signaling-nans" "-fcx-limited-range" "-funsafe-math-optimizations" "-funroll-loops" "-ffreestanding" "-funwind-tables" "-fno-stack-protector" "-fno-strict-aliasing" "-m64" "-m32" "--whole-archive" "--no-whole-archive" "-fsigned-char" "-Bsymbolic" "-pedantic" "-pedantic-errors" "-nostdinc" "-mno-red-zone" "-fvisibility=default" "-fvisibility=hidden" "-Wsign-compare" "-Wundef" "-Wpointer-arith" "-Wvolatile-register-var" "-Wformat" "-Wformat-security" "-Wduplicated-branches" "-Wbad-function-cast" "-Wwrite-strings" "-Wlogical-op" "-Wshadow=local" "-Wmultistatement-macros" "-fstack-protector" "-fstack-protector-strong" "-fstack-clash-protection" "-fdiagnostics-show-option" "-fasynchronous-unwind-tables" "-fexceptions" "-fprofile-arcs" "-ftest-coverage" "-w" "--param=ssp-buffer-size=4" "-fno-lto" "-fprofile-arcs" "-ftest-coverage" "-ffat-lto-objects" "-static-libstdc++" "-static-libgcc" "-pipe" "-Wno-missing-declarations" "-mindirect-branch-register" "-fno-fast-math" "-fno-strict-overflow" "-fexcess-precision=standard" "-Wno-shadow" "-mpku" "-mshstk" "-mlwp" "-mrtm" "-mserialize" "-mtsxldtrk" "-muintr" "-mwbnoinvd" "-mrdpid" "-mfsgsbase" "-mavx..." "-m3dnow" "-Wno-unreachable-code" "-flax-vector-conversions" "-W..." ## Dockerfile and devcontainer Adding dockerfile suggested by 0xc0 https://github.com/0xc0/chibicc/tree/new To build : docker build -t chibicc . Adding also a devcontainer for those that want to use visual code inside a container (needs vs code extension remote-containers). ## Examples of C projects compiled successfully using chibicc tcc : tcc compiler (https://github.com/LuaDist/tcc.git) chibicc -o tcc tcc.c -DTCC_TARGET_X86_64 -O2 -g -Wall -Wno-pointer-sign -lm -ldl chibicc -o libtcc1.o -c lib/libtcc1.c -O2 -Wall ar rcs libtcc1.a libtcc1.o chibicc -o libtcc.o -c libtcc.c -DTCC_TARGET_X86_64 -O2 -g -Wall -Wno-pointer-sign ar rcs libtcc.a libtcc.o ./texi2pod.pl tcc-doc.texi tcc.pod pod2man --section=1 --center=" " --release=" " tcc.pod > tcc.1 chibicc -o libtcc_test tests/libtcc_test.c libtcc.a -I. -O2 -g -Wall -Wno-pointer-sign -lm -ldl for some projects you need to define CC=chibicc before executing ./configure. curl : https://github.com/curl/curl.git autoreconf -fi CC=chibicc CFLAGS=-fpic LDFLAGS=-fpic ./configure --with-openssl make make[2]: Entering directory ... CC libcurl_la-altsvc.lo CC libcurl_la-amigaos.lo ... CC ../lib/curl_multibyte.o CC ../lib/version_win32.o CC ../lib/dynbuf.o CCLD curl make test TESTDONE: 1855 tests were considered during 3598 seconds. TESTDONE: 1574 tests out of 1574 reported OK: 100% openssh-portable : https://github.com/openssh/openssh-portable.git autoreconf -fi CC=chibicc ./configure make luajit: https://github.com/LuaJIT/LuaJIT.git CC=chibicc make git: https://github.com/git/git.git autoreconf -fi CC=chibicc CFLAGS=-fPIC ./configure make make test util-linux : https://github.com/util-linux/util-linux.git ./autogen.sh CC=chibicc CFLAGS=-fPIC ./configure make //to check if the compiled programs by chibicc work : make check-programs cd tests run.sh --------------------------------------------------------------------- All 341 tests PASSED --------------------------------------------------------------------- nginx: https://github.com/nginx/nginx.git CC=chibicc CFLAGS=-fPIC ./auto/configure --with-http_ssl_module make zlib: https://github.com/madler/zlib.git CC=chibicc CFLAGS="-fPIC" ./configure make make test ... *** zlib test OK *** ... *** zlib shared test OK *** ... *** zlib 64-bit test OK *** vim: https://github.com/vim/vim.git CC=chibicc CFLAGS="-fPIC" ./configure make make test libwepb: https://github.com/webmproject/libwebp.git CC=chibicc CFLAGS="-fpic" LDFLAGS="-fpic -lpng -ljpeg" cmake -S . -B ./build cd build cmake --build . ~/libwebp/build$ ./img2webp -version WebP Encoder version: 1.3.2 WebP Mux version: 1.3.2 libsharpyuv: 0.4.0 [no output file specified] [0 frames, 0 bytes]. memcached: https://github.com/memcached/memcached.git autoreconf -fi CC=chibicc CFLAGS=-fpic LDFLAGS=-fpic ./configure make make test All tests successful. Files=113, Tests=180224, 224 wallclock secs (19.91 usr 1.86 sys + 49.12 cusr 22.93 csys = 93.82 CPU) Result: PASS nmap : https://github.com/nmap/nmap CC=chibicc ./configure --with-dbus make make check Testing nmap_dns Testing nmap_dns finished without errors Ran 292 tests. 0 failures. vlc : https://github.com/videolan/vlc.git autoreconf -fiv ./bootstrap CC=chibicc CFLAGS="-fPIC -std=c11" ./configure --disable-lua --disable-xcb --disable-qt --disable-alsa --disable-sse --host x86_64-linux-gnu make all sqlite : https://github.com/sqlite/sqlite.git CC=chibicc CFLAGS="-std=c11" ./configure make all make test FAILED: All-Debug test/walsetlk.test (0) 14:13 bld(10/10) fuzz(54/54) tcl(2470/2470) f1 ETC 00:00 1 failures: FAILED: All-Debug test/walsetlk.test php-src: https://github.com/php/php-src.git CC=chibicc CFLAGS="-fPIC -std=c11" ./buildconf && ./configure && make clean && make && make test Number of tests : 21533 15498 Tests skipped : 6035 ( 28.0%) -------- Tests warned : 3 ( 0.0%) ( 0.0%) Tests failed : 0 ( 0.0%) ( 0.0%) Expected fail : 8 ( 0.0%) ( 0.1%) Tests passed : 15487 ( 71.9%) ( 99.9%) openssl : https://github.com/openssl/openssl.git CC=chibicc ./Configure make make test postgres: https://github.com/postgres/postgres.git (in case of bad network use git clone --filter=blob:none --depth=1 https://github.com/postgres/postgres.git --branch master) CC=chibicc CFLAGS="-g -std=c11" ./configure --host x86_64-linux-gnu make make check # (test process exited with exit code 2) 1..229 # All 229 tests passed. ## meson to be able to use meson with chibicc (meson hack is to do the meson configure using gcc and rename gcc to gcc_old chibicc to gcc and meson compile will call chibicc). lxc: https://github.com/lxc/lxc.git CC=chibicc CFLAGS="-fpic" meson build && cd build && meson compile ## Limits Some C projects doesn't compile for now or crash after being compiled with chibicc. It helps to find some bugs and to try to fix them! cpython: git clone https://github.com/python/cpython.git CC=chibicc CFLAGS="-std=c11" ./configure --host=x86_64-pc-linux-gnu make && make test some tests failed test_recursion_limit (test.test_marshal.BugsTestCase.test_recursion_limit) ... Fatal Python error: Segmentation fault test_repr_deep (test.test_userlist.UserListTest.test_repr_deep) ... Fatal Python error: Segmentation fault 25 tests skipped 3 tests skipped (resource denied) 6 re-run tests 5 tests failed: test.test_gdb.test_pretty_print test_call test_ctypes test_faulthandler test_frame_pointer_unwind 467 tests OK. Total duration: 32 min 1 sec Total tests: run=47,875 failures=3,170 skipped=2,621 Total test files: run=503/500 failed=5 skipped=25 resource_denied=3 rerun=6 ## features added - some extended assembly syntax taken in account (only when on macro body they are failing) - adding basic support on int128 (probably some operations are still not supported) - adding vector management and scalar promotion to vector - alignment attributes supported (like GNUC level 4) - some basic optimization - some basic debug information (dwarf information) - adding support on __m256 avx2 ## TODO - trying to pass GNUC from 4 to higher compatibility level - trying to compile other C projects from source to see what is missing or which bug we have with chibicc. - trying to fix issue with postgres tests - trying to rewrite extended assembly to be more robust - trying to improve chibicc by reporting tests from slimcc to see what is missing/need to be fixed. ## issues and pull requests fixed ## known issues git 2 tests failed vim: compile OK, tests OK except 1. cpython : compile OK, some tests KO sqlite: compile OK, tests OK (except 1) ## projects compiled successfully with chibicc util-linux : compile OK, tests OK nginx: compile OK zlib: compile OK, tests OK nmap: compile OK, tests OK openssh-portable : compile OK, tests OK vlc: compile OK memcached : compile OK, tests OK php-src : compile OK, tests OK openssl: compile OK, tests OK postgres execution : compile OK, tests OK ## debug To debug with gdb don't forget to use the set follow-fork-mode child because chibicc creates a child job. gdb ./chibicc (gdb) set follow-fork-mode child (gdb) r issues/issue116.c -o issues/issue116 Starting program: /home/stormalf/ubuntu/chibicc/chibicc issues/issue116.c -o issues/issue116 [Attaching after process 174090 fork to child process 174091] [New inferior 2 (process 174091)] [Detaching after fork from parent process 174090] [Inferior 1 (process 174090) detached] process 174091 is executing new program: /home/stormalf/ubuntu/chibicc/chibicc [Switching to process 174091] Thread 2.1 "chibicc" hit Breakpoint 1, 0x0000000000432726 in parse () at parse.c:3703 3703 return "UNREACHABLE"; // Atomic e ## diagram Example of diagram generated with -dotfile parameter : ![diagram](https://github.com/stormalf/chibicc/blob/main/asm.png) ## release notes 1.0.24 Passing GNUC from 3 to 4. Adding const, volatile, restrict support from slimcc/fuhsnn. Fixing issue ISS-195 prockill due to leakage attributes. Managing pragma pack. Fixing issue with attributes and alignment. Fixing issue with some edge cases initializer. Fixing some float comparisons issues with NaN. Fixing alignof issue and managing asm name. Fixing issue with string char array members initialization. Fixing issue with unicode characters. Managing anonymous enums. Fixing issue with extended assembly and &x in input. Fixing issue with extended assembly and macro expansion. Fixing issue with builtin_prefetch found during openssl compile. Managing \__atomic_is_lock_free. Adding \__builtin_offsetof and __has_builtin. Adding \__builtin_rotateleftxx. Fixing issue with attribute after typenames. Fixing issue with attribute hiding. Fixing issue with vlc compile undefined functions (ISS-206). Reversing changes on is_function that causes side effect on cpython compile. Fixing issue with unicode x\u0000y. Fixing warning sent wrongly during tokenization. Reversing openssl changed that caused side effects on cpython. Deleting preprocess3 that caused side effect in openssl parsing. Fixing issue with openssl and undefined reference. Adding some builtin xxx256. Fixing issue with __m256 not managed correctly (sometimes dealt as __int128) found during openssl tests that fixed also lots of postgres tests. Fixing remaining postgres tests and openssl tests. ## old release notes chibicc-1.0.24/RELEASE_NOTES.md000066400000000000000000000533221517770275000155540ustar00rootroot00000000000000# Release notes This document contains all release notes delivered. Only the current one is on the README.md ## old release notes 1.0.0 Initial version 1.0.1 adding --version -v option and fixing the -cc1 parameter that caused segmentation fault if other mandatory parameters are missing. trying to document cc1 and x options and adding a max length control parameter. Adding documentation for other parameters too. 1.0.2 fixing issue with cc1 parameter only -cc1-input parameter is mandatory. Finishing parameters documentation. 1.0.3 trying to add some sanitizing functions and check if arguments have valid allowed characters (probably too strict!). 1.0.4 Fixing the output directory for dependencies "xxx.d" when -MD option is set, the output "xxx.d" file is generated in the current directory if no -o parameter defined or in the directory defined by -o parameter (issue #30). Adding Dockerfile and a devcontainer for those who want to play with that (issue #23). Typecheck void type expressions in return and assignment (issue #41). Binary add segfaults when at least 1 arg is non-numeric, and both are non-pointer types (issue #42). It's UB to have a call to va_start without a corresponding call to va_end (issue #51). Fix bug in codegen.c (issue #52). fix issue in main.c (issue #54). Fixed bug in preprocessor process extraneous tokens (issue #95). Hashmap: Do not insert duplicate keys (issue #98). 1.0.5 Fixing assembler error on larger than 32-bit bitfields (issue #65) by GabrielRavier. Fixing bitfield validation by zamfofex (issue #28). Replacing memcmp by strncmp (issue #48) by math4tots. Fixing empty structs as one-byte object (issue #36) by edubart. 1.0.6 Anonymously named bitfield member segfaults compiler (issue #31). Fixing anonymous union field (issue #45) by zamfofex. Fixing wrong size of string initialized by braces (issue #80) by zamfofex. 1.0.7 Internal error when initializing array of long with string literals (issue #72) by GabrielRavier. Fixing postfix tails on compound literals (issue #47) by zamfofex. Trying to fix nested designators error(issue #62). Fixing Using goto inside statement expressions gives an error (issue #37) by zamfofex. Fixing function type parameter without identifier errs (issue #63) by zamfofex. 1.0.8 Internal error on long double initializer (issue #69). Codegen error on atomic long double operation assignments (issue #71). Fix atomic fetch operations (issue #101) by chjj. Adding -soname < arg > and -rpath < dir > parameters (needed to be able to compile curl from source). Soname is used to create a symbolic link and rpath is passed to the linker. Testing chibicc with some C projects (compiling fine tcc, curl). 1.0.9 Adding pthread and pedantic to omitted parameters list. Added -fno-pic parameter. Adding ignored parameter: m32, nostdinc. Adding -dumpmachine parameter. Fixing issue with \_\_has_attribute(diagnose_if). Adding lots of attributes that can be applied to function (for now ignored them) : "\_\_attribute\_\_((noreturn))", "\_\_attribute\_\_((returns_twice))", "\_\_attribute\_\_((noinline))", "\_\_attribute\_\_((always_inline))", "\_\_attribute\_\_((flatten))", "\_\_attribute\_\_((pure))", "\_\_attribute\_\_((nothrow))", "\_\_attribute\_\_((sentinel))", "\_\_attribute\_\_((format))", "\_\_attribute\_\_((format_arg))", "\_\_attribute\_\_((no_instrument_function))", "\_\_attribute\_\_((section))", "\_\_attribute\_\_((constructor))", "\_\_attribute\_\_((destructor))", "\_\_attribute\_\_((used))", "\_\_attribute\_\_((unused))", "\_\_attribute\_\_((deprecated))", "\_\_attribute\_\_((weak))", "\_\_attribute\_\_((alias))", "\_\_attribute\_\_((malloc))", "\_\_attribute\_\_((warn_unused_result))", "\_\_attribute\_\_((nonnull))", "\_\_attribute\_\_((externally_visible))", "\_\_attribute\_\_((visibility(\"default\")))", "\_\_attribute\_\_((visibility(\"hidden\")))", "\_\_attribute\_\_((visibility(\"protected\")))", "\_\_attribute\_\_((visibility(\"internal\")))" 1.0.10 Fixing issue about string initialized by function-like (issue #107). Fixing issue when a macro ends a line and the next line starts by "#ifdef" the "#" is not recognized starting from beginning of the line (issue #108). Managing \#warning as preprocessor instruction (issue #109). Fixing issue with union initializer when comma found like "input_control_param_t it = { .id = p_input, .time.i_val = 1};" (issue #110) and input_control_param_t it = { .id = p_input,} (issue #113). Removing fix for issue 106 (caused other issues with VLC when trying to compile). 1.0.11 Fixing issue #113 about \_Atomic when it's placed after the type. Fixing other issue like issue #108 sometimes some #ifdef are not recognized if a macro ends the previous line and the next line starting by a preprocessing instruction. Managing differently -soname and adding option -z, and --version-script. Adding -debug option to write commands in /tmp/chibicc.log (later I'll add some debugs info/values on this file to help to fix bugs). Adding 2 functions in stdatomic.h needed by VLC atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) that returns false for now and atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) that returns false too. Managing .lo files (libtool object). Adding generic path for Fix 'gcc library path is not found' on some platforms #108 by [Stardust8502](https://github.com/Stardust8502/chibicc). 1.0.12 Adding -dotfile parameter that generates a xxx.dot file that we can visualized using graphviz package by [hdewig100](https://github.com/hedwig100/chibicc). Adding in error message chibicc file name and function when a message error is displayed to help for debugging. Adding in Makefile the way to create shared library libchibicc.so. Fixing issue #116 with 1024_160 splitted wrongly in two tokens. Fixing issue #117 with number after generic parameter like "fromtype##2obj_decode". Fixing issue #118 same as 117, to allow some identifiers to start by number when they are generics. Linking lpthread if -pthread is passed. Ignoring -z and -Bsymbolic. Fixing the issue with linkage need to add current directory to the path before the others (probably it's a security issue because it means that for compiling the objects library found in the current path will be taken in priority!) Fixing issue #119 about cmathcalls. Removing fix for #119 caused an infinite loop and fixing it by adding _Complex as attribute like _Atomic. 1.0.13 Adding other projects compiled successfully with chibicc. Adding some information in debug file like all tokens generated by tokenize function. Fixing some issues found with vlc static_assert function outside a function(#120 and #121). Adding -no-whole-archive and -whole-archive as ignored parameters. Fixing issue with #line that generates negative numbers that caused assembly issue. Fixing issue with argument used twice in regexec function that caused "undefined variable". 1.0.14 Removing sanitizing functions, causing issue during git compile. Fixing issue caused by fix issue 120. Fixing issue with -I \. Fixing also the preprocess when some macros are defined after they are used, gcc allows it. For now the temporary fix manages only macro with empty body that they are used before their definition. Fixing issue #126 about old C style skipping for now the extra tokens. Fixing issue #128 about union initialized by an expression. Fixing a basic extended assembly #125 (partially) for now only something like \__asm\__("bswapl %0" : "=r" (val) : "0" (val)); works (a lot of work to forecast to add other assembly possibilities step by step). Fixing #127(#126) more securely (ignoring was not enough causing issue during linkage). Fixing a mistake on removing the fix for issue #121 that caused an infinite loop. 1.0.15 -fsigned-char parameter is mandatory for util-linux project. Removed by mistake in the previous version. Re-added it! Removing lots of conditions created for debug purposes that causes now infinite loop! 1.0.16 Fixing issue #133 with old C style function declaration when using comma separator for same variable type parameter declaration. Fixing also issue #136 (ISS-136) zlib project error with unknown extension. Fixing issue #134 (ISS-134) with parameter expression during zlib project. Fixing issue #131 (ISS-131) parsing issue when trying to compile nginx project caused by fix #121. Adding some projects to test in Makefile because sometimes some fixes cause side effects! 1.0.17 Fixing ISS-129 need to manage output other than "=r". Fixing ISS-139 extended assembly compiling but execution doesn't return the correct result. Fixing temporary ISS-142 caused by join_adjacent_string_literals function. 1.0.18 adding install and uninstall in makefile (#PR24 from rurban). Adding ND_MOD in is_const_expr(#issue 134 from matthewsot). Fixing incorrect small struct passing in 5th argument position (issue #127 from sgraham). Fixing ISS-140 compiling chibicc with chibicc tests failed with trying to parse the object.o file instead of linking only. Fixing some issues with extended assembly (ISS-141) and reformating some but still have one issue with ASSERT used after assembly inline in some case (see ./issues/assign1.c) 1.0.19 fixing extended assembly issue when a register is already used in the template, the variable should be stored in another register available. 1.0.20 Fixing ISS-143 extended assembly doesn't manage well input with r. Removing assign1.c test doesn't work with gcc. Fixing ISS-144 compiling util-linux failed with expression returning void is not supported. Fixing ISS-145 compiling util-linux failed with invalid initalizer2. Fixing ISS-147 compiling util-linux failed with undefined variable __BYTE_ORDER__. Fixing ISS-148 compiling VLC failed with storage class specifier not allowed caused by static_assert function. Fixing also some issues with extended assembly not working in some cases. Fixing issue with extended assembly in string_replace that truncates the null terminated character and causing during nginx compile failure due to incorrect character. Generating "nop" instruction each time we found the memory barrier : __asm__ volatile ("" ::: "memory"). Compiling successfully some projects like curl, nginx, zlib, util-linux, openssl, openssh-portable. But some tests failed for util-linux, openssl and curl that means that probably we have some bugs somewhere. Fixing ISS-152 extended assembly __asm__ __volatile__ ("rep; nop" ::: "memory"). Fixing ISS-150 fix on issue 40 caused other failures during VLC compilation. Fixing ISS-151 compiling neovim failed in struct_initializer2. Fixing ISS-153 -fomit-frame-pointer, -funwind-tables caused failure during neovim compilation. Adding -dM option to print the macro definition (it's not exactly the same result given by gcc) needed for compile neovim project. 1.0.21 fixing missing information on README (about help and ignored options). Fixing ISS-149 some extended assembly not taken in account (arrays). Fixing ISS-153 extended assembly giving different results when compiling with gcc or with chibicc. Fixing ISS-154 Extended assembly compiled with chibicc failed with ASSERT and works fine without assert function. Ignoring some parameters like -fvisibility=default or -flto=8. 1.0.22 Fixing ISS-149 some extended assembly not taken in account during libwebp compilation. Fixing ISS-156 fpie/pie/-fPIE not recognized by chibicc. Adding other parameters in ignored list. Fixing ISS-157 about union empty initializer like "union string_value lval = {}, rval = {};". Fixing ISS-158 during neovim compilation failure with not a struct nor a union. Fixing ISS-160 memcached compilation failed with IOV_MAX undefined (adding __GNU__ macro). Fixing ISS-161 trying to compile memcached failed with incorrect offset or not managed yet. Fixing ISS-163 during postgres compile failure with "invalid pointer dereference". Fixing ISS-162 during postgres compile failure with __typeof not recognized. Adding macro __INTEL_COMPILER. Adding include path to gcc that has many includes needed for some projects (adding in chibicc/include some of them like emmintrin.h, omp.h...). Adding some builtin void functions like _builtin_ia32_emms. Fixing ISS-165 during postgres compile failure due to staticAssertDecl function. Fixing ISS-166 during postgres compile segmentation fault (caused by VLA type in sizeof function). Fixing ISS-167 during postgres compile failure with bad register. Fixing ISS-168 during postgres compile failure with expected an expression due to incorrect previous fix(ISS-121). Adding by default to the linker "-allow-multiple-definition". Fixing issue with tgmath.h and ignoring .rsp files. Adding -dumpversion support provided by Urs Janssen. Added Xcode SDK path (from MarcusJohnson91). Fixing issue on extract_path function that caused corrupt malloc (ISS-170). Adding -ignore-assert to ignore static assertions (not managed at compile time now). Merge pull request #64 from arbruijn/multiple-funFix function declarations with shared return type. Fix assembler error on large files #119 by @rurban. Integrating many fixes from @n0tknowing. Adding CMakeLists.txt and using BOOST library to generate chibicc (from @Seeingu). Removing fix about old C style that causes other issue, it means that old C style doesn't compile anymore with chibicc. 1.0.22.1 Fix for nginx execution core dumped (issue #171). And moving issue138.c component from test folder to issues folder because it fails even after compiled with gcc. 1.0.22.2 Reintroducing partial Old C style function declarations management (issue ISS-172 postgres doesn't compile anymore with 1.0.22 or higher due to old C style not supported anymore). Now it's possible to compile postgres with chibicc (but still a segmentation fault at execution time). The support of old C style function is partial for the moment. 1.0.22.3 Fixing some issues with extended assembly (managing diffrently depending letters used =r, =m, =q, =a, =b, =c, =d). Adding -print parameter to print all tokens in /tmp/chibicc.log file to help for debugging. Reformatting error messages. Adding color codes to error messages. 1.0.22.4 Fixing some issues with extended assembly (new test cases), adding r11 and r10 registers and adding "D" and "S" support for input and output. Removing -fsanitize=cfi not supported by gcc. Adding core dump and segfault handler to have useful information when a segfault occurs. Adding debug information for linker. Changing the order of extra linker parameters because if the specific path defined for a project is not the first one, it seems that the linker doesn't find the libraries (#ISS-173). Adding support for `chibicc -xc -E -v -` to print the include directories. Ignoring two other attributes for compatibility with GCC : \__attribute__((fallthrough)) and \__attribute__((nonnull(1))). Adding a trick to fix the issue with lxc project in the README.md and Makefile. Adding some test cases for builtin functions to test with chibicc for later. Adding macro \__builtin_choose_expr in stddef.h to fix issue found in the lxc project. Adding warning messages in purple like gcc. Fixing issue with extended assembly when atomic_sync_bool_compare_and_swap. Taking in account in extended assembly (-value) to negate the value. Adding builtin function __sync_fetch_and_add and __sync_fetch_and_sub. Adding other builtin_functions like gcc. Adding print AST with option -A (from @cosmopolitan). 1.0.22.5 Improvement: diagnose overflow in integer constant expression #96 from @pmor13. Fixing issue with old C style (K&R) when parameters order don't correspond to parameter definition. Adding \__LINE__ in parse.c in all error_tok messages. Removing \__builtin_memcpy \__builtin_memset macro from preprocess.c that causes segmentation fault on zlib project. Adding other tests from @cosmopolitan. Reporting some fixes from 1.0.23 to this version. Fixing last issue with curl due to sizeof_int and sizeof_long not taken in account (adding them in stddef.h). Fixing issue with semun (ISS-146). Fixing issue with \__builtin_clz that gives incorrect result. And adding \__builtin_ctzl and \__builtin_clzl. Adding __builtin_isnan (ISS-175) and __builtin_inff. Fixing issue with lock not correctly managed in extended assembly (ISS-174). Fxing other issues with extended assembly and adding several tests. Adding \__builtin_bswapxx (16, 32, 64). Experimenting the stddef.h from gcc and managing some issues with offsetof. Fixing issue with assembly (issue155.c). Fixing issue with vim (due to math.h) and merging some improvements from 1.0.23_vim tree. 1.0.22.6 fixing cmake issue. 1.0.22.7 Fixing issue with named operand on assembly. Fixing issue with struct union found during vlc compile. Reporting fix for c-testsuite 152, 162 and 205. Fixing constructor and destructor. Fixing bug on preprocess that skipped some attributes. Ignoring some other gcc attributes like nonnull. Fixing c-testsuite 213. Fixing issue 36 with empty struct. Fixing c-testsuite 204. Fixing issue 166 struct with VLA. Fixing issue with semun. 1.0.22.8 Fixing ISS-188 on old C style (K&R) parameter omitted by mistake. Reporting some fixes from 1.0.23 to 1.0.22.8. Fixing ISS-186 with lscpu tests (util-linux). 1.0.23 Reporting fixes from 1.0.22.9_dev (like implicit function declaration, -std=c11 -std=c99...). Fixing issue with \__atomic_load_n during linking of nmap. Fixing issue with vim (due to a mistake in ND_ASSIGN). Adding vector implementation (with TY_VECTOR type) in progress (basic operations seems to work fine issues with mixed non-vectors/vectors or multiple vectors parameters). Adding some builtin_ia32_xxxx (like builtin_ia32_emms...). Fixing issue with cvtpi2ps. Adding cvtps2pi builtin. Adding lots of builtin_ia32_xxxx. Reintroducing int128 management (from experimental_int128 branch). Allowing some bitwise operations for vectors of int. Fixing issue with compound literals and vectors. Adding scalar to vector promotion. Adding some missing declaration in math.h (found during postgres compile with -std=c11 that sends error on implicit function declaration). Renaming branch 1.0.22.9 to 1.0.23. 1.0.23.1 Removing old fix on issue166 that causes side effect. Adding ND_POS for unary +. Adding new type for long long TY_LLONG. Fixing umull_overflow. Fixing issue with weak not printed for extern global variables. Adding lots of functions declarations on math.h needed for some projects. Ignoring few arguments. Fixing issue166. Fixing issue with external TLS (from @fuhsnn). Fixing temp issue with __cpuid_count (extended assembly not managed well this case) by adding my own cpuid.h. Adding some atomic_xx_n functions missing. Removing fix on VLC undefined references that causes issue with util-linux and fixing static inline references when they are referenced by address. 1.0.23.2 Managing -Werror (reporting from @fuhsnn/slimcc). Adding decay array/vla to pointer in ND_COND, ND_COMMA. Merging pull request from @Superstart64 removing hard-coding on includes and Makefile. Managing builtin_memcpy and builtin_memset. Fixing issue on some bitfield operations (bitfield2 testcase). Ignoring -pedantic-errors and all warnings that starts with -W. Adding llrint in math.h. Ignoring gnu attribute \__noescape\__ and \__common\__. Ignoring some arguments found during ruby compile. Reporting fix from @fuhsnn/slimcc da9d04c077357ac39f80acf2b9d6b5a47cd50cfc to fix setjmp issue. Adding some missing builtin_ia32_xxx from pmmintrin.h. Fixing issue with vfork (ISS-196). Adding other builtin_ia32_phxxx from tmmintrin.h.m and immintrin.h. Adding lots of missing builtin from smmintrin.h. Fixing old release notes typo. Adding -mcrc32 in managed argument. Fixing issue with undefined reference when static function used as initializer for a struct's field (ISS-197). Adding some atomic functions missing. Reversing change commit 92f079c that causes issue with curl test 1452 and refixing issue ISS-199. Refixing issue ISS-200 vim test failed (due to commit 76786d4). 1.0.23.3 Forbiding two arguments that cause failure with g++ when compiling vlc (-Werror=invalid-command-line-argument and -Werror=unknown-warning-option). Temporary fix for -A that causes infinite loop (ISS-194). Fixing attributes found in struct member. Updating GNUC from 2 to 3. Reporting commit 11d0bff from slimcc (new_inc_dec) and removing commit 2e138bb. Adding builtin_prefetch found with memcached (ISS-202). Reporting partial commit 32dbd2b from slimcc(initializer2). Reporting commit 6478f56 from slimcc (Change eval_double to long double, fix narrowing cast). Fixing issue with variadic and double/float/int mixed struct. Fixing assembly issue found at VIM (after a git pull). Adding enum_extensibility attribute support found during ruby compile. Adding some builtin functions found during ruby compile. Managing two forms of builtin_shuffle. Reporting commit ac2296c from slimcc and eb2bb49 from s311354 (issue 154 from rui314/chibicc). Reporting commit 2654b20 from slimcc (about global variables and removing scan_globals). Reporting commit 577a4f8 from slimcc (local stack alignment). Fixing -S that doesn't take in account the output directory. Fixing issue with alignment. Fixing issue with cpython tests (due to vfork hack using the parent frame). Fixing issue with popcount found during cpython tests. Fixing issue with segfault on cpython (ISS-204 partially). Fixing issue with variadic (function6.c). Adding FPCLASSIFY builtin from cosmopolitan. Adding builtin signbit from cosmopolitan. Optimizing the alloca_size to be used only when necessary to reduce the stack size consumption. Fixing also a bug in atomics found during cpython tests. Adding -fomit-frame-pointer and -fno-omit-frame-pointer support. Implementing basic tail call optimization. Implementing basic debug information (dwarf). Reviewing builtins to avoid register cloberring that solves the memcached issue with binary-extstore.t test. Fixing issue on extended_asm with wrong usage of snprintf that causes offset truncation.chibicc-1.0.24/asm.png000066400000000000000000001710221517770275000144660ustar00rootroot00000000000000PNG  IHDR][.(bKGD IDATxw\W?." 4E0`BcbMAch$'<)555J ETAoKY:Kk_3sY̝sϽ#"`0 `0 `0:u*ʶ`0 `0 `0z,`0 `0 `0 2 `0 `0 F'"P@,EEE(..Fmm- ]ޖPTTT|>===|BOOPUUUu0())Aqq1Q^^*nii)jjjCMMD"ttt hhh(H$x)jkkQRR*hƥvH$ mmmz`t53zLCMM JKKQYYzbFe. h{]?ԄP(RWW**,hHYY4%Q5%3Uw{{@ v^EzLеiii@^^=z| ''yyy(**BII b:cccFFF033 `kk ===P555#!;;wi`aс>SSSFFF0559lmmann';=J#77O}B<}O>I74(UUUhiiAMM tuue~ׇz!3zL3C~~> 8)**(**j6@hx<с:{u}OO>066 } ܧOaa!QVV TVV*2@t _6uBPٗmQW!Jܺu {.Ґ4qijjrAN.𩧧eHvQ9) G G QRRe!//;;;puut!$ ӑdܻwks>3Baັ1,,,,h}}}hkksJ8f6IGHG>}ʵ5i+,,Ǐ[C"`kk [[[١_~pvv 2AAA233rQ999\!;;%%%ʩ@WWM>jhhp3===n$nv!! ۾> nfӧO!HPXXi4CeU\\,3`PSԐ SSSs-KKKXYYZfg`5Dff&233C0+5JH]]].)otDCpv~*fޯ1u౬k/EKKKX[[̌ 0Eaa!dee!;;ɓFe{oe7!'sOiJ:aJfKml211w422 D^κ.tEtt4^$$$$ -- bB\RMUTT ##iiiiiiHIIAyy9x<lmmgggxxx 6SQQ8 11 uwF~7i366V2nq] ggg 4^^^pvv뒗ܽ{<@FFױ7u:::J*AD(((vd$>|D߾}q;;;888ޞMw&0g]a13:"%%iii\'33YYYD"~&O>*@t_NNχ)aii ۗI;;;eF';;)))HMMYYY܀dYк}RmpА4HX_ofgg+kkkXXXpXkkk^iiiǮtŸ~:._h\rx\4#=n$KQ#}ЋGRR!aii /// >dkv \t QQQ͛7QSScccqoirO\Ljǭ[$ǣZZZ6l ___G&ZJJJw"%%0`ثLw'wn.>(Tx^`簾JAmm-rrr 6IKe[YYޞG{{{8::ޞ 4vs)H}nS卂u?x뿨qXSRyA״4 $$ϟGAAttt ___`044Ty]2\~qqqDxx8rss{!CzA)++Õ+Wv@smNNNŸ}6vwu;|}}eN dtZddd )) qqqupmH$r4vvvprr3u^Z|Cif;w@,C NNN30p@7L[ѣz~(]N:̌'''Ki0CUU8?uE_>AW)))|3-- ,r FHvzʼW&&&rKٙMggg <t%"DGG8z(ݻMMM5 cǎE@@ 88aaa(**K/aȑlC9r˗ADpwwڜ{pl Cpp0BBB ॗ^”)Sݻ> @ 2]]]777aTWWݻHHH>>gӚ oooxyy 5s`/>wM)))ALL PQQ-ܸYla HLLJLLģG<[B^^^􄧧'IRUUׯs{A"@]]NNN$%{_J}3))  :M.(tr /9r>=^z%L0Çgk:X,Fll,Ν;Ç#!!FFFx/ϯu333q>|)S0uT@&v{cǎ=O6׬VJKK(!" 2@zO>:n7Ζi`h .]Btt4),,P( wwwny. ϐGbb"^XnƁ%<==eX<>9qjjjЧOxzzbذa4h\]]ѯ_?d "񈍍ELL rrr/m]~͛7akk)S`a٬r$=='Nqecx뭷зo_e'7$ BCCm6=zژ>Gűcp &L1cepy 445555j^x =?CVo XH?~ǎCZZ1qD.cffl3=۷os%%% /@(DS\\ӧOs%%%2dƍ???(2TWW#::FTTB!ƍ@L2E/Z7n @>>>t)H$9%C\t&L@hСlDaa!-_̌6l@6 YYYb $###矩FfutO_~,,,h#(..^y!Gi&*((Py?z7Ett4-Z 8>fϤ RYYIO 255%dooO~))&MD{?MII -] w7'%%&MDhΜ9T\\lZGqɓ'ѣGZ٦1-Sںu+yzzׯoTYYlZς?X7͛4c  CAAAl6QSSC'N@RUU%===zwѣG6]b:pyxxrpp't1 y14h @}v[t%KZp!urF>#RQQ3fӧOmIWW)>>^0:'N 988еkהmL'---244/233mn魷"HD/t٬Q= N_:u*x<4h޽ʔmarrro%sssRSSŋmVݻw#Cg yիWi$ ʊ6nؑ]=zDCW{+ctqBBBԔ>EG, -^[t m';;IMMeQ^^N~!ijj }wZP l2RWW'333ھ}{(30g0CWܾ}{'8qK`tJߨo߾JAAAe$7ّ*͛7OqC^dddҥKI]]LMMi$zԿ0`f$2?F6l}366͛G}%HD4tP/ٲ1114o}HOO B7n)m鿔*/I$ѐ!Cܹs -KDD΍͘1;1cdPSux<244@i}57m$Skkki4|p!@@fff4qDڸq#sJ׶7vUV+v_LRER]]M;w$sss266?S64ǃh_W _>eAAm޼H__ޞfΜI7nh֖D,Fb 8YALׯ9;;Svvv,mׯ ŋ͍Њ+ZU%>|rJHH *(('OHf`S,ӪUH ի)99*++)''_ ]76gGhk5zmTTӌ3ѣGOo& w>iĈdllD"s璚:uJuvW%'' 7oREEݻw^}U@+Wlx<mڴI4Eii)ǣ@EԚ5j(ھ};s7hXNJll,׆.\d+WAm-W5kp4UmٶJSL!777icիWiРANׯWJ6(QZZJF/^rzKZ}m?ޢg&fͥǏӷ~Khɭ /%66ICC֯__ rgxi@ȑ#dllLb*~:Zzu#^}URQQo>|HJ~!xz>>h :x` .$t̙zg̘e'6=[?QKKЬYouv{F&ePTTD-"8qbXuӦMM /*~/ϟO~'Φ2 ''''э7hذa$ /hM]kkkiȑ4p@ئNKI>VVVӜ9str%߿?YXX4[ʓJ3g|O>/ϟOAAAq^֐D?M85Cj:vZD-v+C$:z)((eD2,'L@:::ޙTUUѤIHOOΞ=кR6/B]]TTTͰJDDdffF-^R RSS_oAd0ܹ022aϳeb7b#88iiim۶A"Xv "&9r#((H1C6'vfm ,,,uVlٲr7СC˽)www궩l[xرcjjj˵.Ĕ)S  ;;;^,Y˗ǏL>-io팶sNk:t(ܐӧOhm' -- 'O\|g7n[mm8y$͛Y'xiftC޽{k.9rDu1W_v +W B}ŲePPP!;Z _`y&>C磠}BBB駟6S_PP9s`Μ9OZ"033Ï?xd޽"pٹIΆ#F)Ν;'… :H$իADXn]}ظq#>vlXr%v mmK^B8p֘={v8tvڅ}Sj~yAG}:Mq1\p?s5 FPP~?mmm9UUUسgtYYYѣzlS?K.ٳ["f}ZZZvV/^s!??_nu۷^^^[M]c+|>GKh+ǡCVǣGi&[e8mϯ*zUTTo>XYYaǎطo_Ƿvm>|8lmmgφ*N:vјɓ'c֬YXf\;LeŋڵksN >O>m-m?l2߿{쁱1 cǎ n-|>7n[E/FFFXn޼yx瑗{{6ۊqQPUUO?bܸq3g΄*6mn<+++={~~~033ٳ~:t_8p`u `̙y䍺:vڅ(8qBuI$YsmSŽ"`~1_> /ήİaðj*|W(--yLk||< @DAZZ^yK6mjjj:\G[ۖ 6lС ҎOGli+&LD"ip9;Y|ǨBrr2k׶ێQFq1СCPSS VG{&~[!u*.\(sdCF[n׮]\vɓ'{i9Yz5޽c?`gg===̝;k֬ݻwaÆv3oD ̚5 .rrruaɒ%xWP[[l39D{⭷|ǧUe̜98p@w߅D"_ (//Ǐ?ئ̶^g[ؾ};RRRwu<cǎ+W 55\i/;FW'O`„ =ztgu}]Q޽{0`܍k@[[[|9s&9_~377VMW#-##kj8::ٳի?4yg\4DMz"с%RSSr~Xvt65D(7oԩS駟"$$ݶ'''W^BP bbqg/x{{c(++QQQ!юx`ڴiKws2 z\QKg4ZCsʔ)sεۖu0Fw={`XhVX"((|/lڴIfr[1cҥK8r-jqb@D"Ǐqq 6Ue2331c =z۶mkH$ܹsq1xW̞=ׯ_oE7ŋa``#55[nwiu ^;w9XqUI(2 Ǐץn }􁻻{(Z^^H˽*#GˣFqF޼y0zzee-83g@KK +Wl2-5f"5455<˰!"hhh>t75z#444ӧ (6m.9R\\l6MZlf̘D,YD1mi;wDII 455M-:u* ))IY}}}nٛΆ3666dOw*%>Lٳ 3CJx_{)N}Xb5qqqI)zT8??Ck5D"Q3m9 +e*|q}_QH`< ֲܴc 0;w9mmjjjo>DFF6ZDD۽zSw YYY2_0 vtL[v{鿬l ij=8e o733Sʕ+ &n ٳG jjjAD틌lVåϞxgҥK? СC;t殳-2Dwk׮w$--{@VVV,`~e… QUUެ*{{{DEEu{FAWiZ|Kn @۷op5lݺUX|9 eH^zɷ޹s[n/e6ň#p)hhh`ٲe^0j(899СC:ka&Mڟä~rSx<}D[mnժU={̲̋%66Uon/QޝׯtܿFFFm~> MMMoɓ'ahh{Nfئﮜ9sM]Qw aaagw^x`:AΠ ly_WW^^^-LuEhs!88VVV.\(a)ӧO;Ο?`n;!//ݽmŻ ]]eեH$9rƍk=(-- /[?GRR?%s$nܸԦ}dDK,K.\~P`` >#Gѣ5Srr25kϧ+VPbb"UVVRaa!baaA|>Y;r"&777zZ?3HwޥBG_0_XXHJ?3Ǐiǎ!Ss޽ƍr- xxx<> kjߩS 2$ ]t۷~OB<<_a˗H$SN)>;vZRQQQX@??Pgeey{{w+HNN&3339rB3O8@***g)N;uVxaÆt%" '>O۶m|݂gǣ})R0`;i"Maa!W>bx RUU-[(^+R]]M-"C(Keՙ(n+>Pqq߾};o4w7!> G_~eK7t%"裏HMMeBbbbHOO͛zUUUiQ\\L#F KKKzBH$7ߐ M<>|͛7iСIGQxL{/L l'zI7PmmR`0eeeϧ3f49\9sBCCfHHH oooDsi>*Hh$ ѣc%sUӧM8***^?C",X@bX3Oii)5LLL(!!AivӀHWWn?^AEE}g$ G bCyt%'zm7ߐH$"ww&_2`dN:E֤eG /ǣ zMb0JӐ!C(..E=K]p! B_:f)s֦f_~ oN>|H3f 4i$MX,~tuuo߾t!eh'UUUߒ6vӛoI$hƌ֝dti***h߾}G<,,,裏>G)۴VP,]"Hرc4qDdhhH˗/xe` XL!!!4sLRSS#MMM7o^T>}{8p  7776HVilll/8}ۃR.]D&PH .rSMMV"MMMׯ/_6l;vE)//75 Bz7(==]fuIII ###?>0g0CoYH$p-^,,, ˗SXXX 43ta;w.Ӈ+}ǽ&VRZZJw^x%ݻ6KȠ7Ҙ1cHUUB!7lB+:D"Ç>|8Ν9s@]]gtDPl۶ ǎ9VXny&6l؀?5kϟ+++esvڅ;wܣ68q<+W@$aȐ!E@@FUUUe!TTT .. ŋ!Hӧc077Wrׅ?|III8x ASSÇG@@ea͛ AHH"""P]x0 IDAT] wwwL< mҨ@HH8q999033&Ld@?~+Wpk׮A]]>}:N ===ySR$ N>m۶ӧ|4hPgUh)))طov܉L7Ĵiz\?99[l={PZZ)S_رc!m^ǎÎ; ;;;̟? ,S(YYY8wBCCqy@OOF˜1csͭ"C~!.. ŕ+WPYYcƌرclS ?a>RSSq9… x 0zh瞃+Met3p5DDD ,, (// H٦v9b1._#44Ѩ#0j(x{{o߾6 FLL .\0$$$ǨQ  iV]뒕;wǃ`oo^z ӦMСCQe')) Ç̛7 ,͓;8toߎK.AGGSLi0~ny ?Ç#$$0uTa̘1,s-sqA]]C 'eb$''#::$%%A,Ғ{0W|r~9rH*T]q!>|߇ &L3j'x"qYܹsfffx1m45 |>_f* 9r˗cbرAhy Hp5#88.]@ q0m4Ewk$ n߾ u0Iѣq R\\$#!! ~:JJJz6e?.LD"Arr2bbb8LHH@mm- WWW8;; NNNP 9SPP$&&r>yMASSIecv>,⺾x>o߆D"9<==1l0xyyaС6DA׆ѣF\\`С/X JKKʕ++ƍ@>H$PWW7Hҿ888Ύ-3ͨw")) HJJBII puu2]RXXPHMMÀQ]OOO899ո}6pʕzӋ0fnQxemATTyll,jjj`ddooo 4WܸqQQQիWQZZ ---1;v,\\\mnwAbb"n޼ɍedd@",--Nѯ_?XZZ@Wл " ##iiiHw|Se?OtI'RV T(2dCPn}G"2DlQ{EZ{'iӒIN^+/䜜+\}Ɗ;w 77`nn hhС)an[n[/RwYV񨮮kNB} <==9Q'J"))IL?JKKڵVŏEii)5f&GEE!== Q7H ڦB >>NLLLDMM b?)vIڲۭΝ;/fffڵ+[Hee%qmHĠZhGxx8(//Ǖ+W4]rr2CˆJ```WTHKKCll8(B.[nb0` ܽ{Wfܹst>>>󃟟|||о}{͍g렪 FJJ d$%%!99pºCŗ ?^2spo|3mjjj5'B///>>>/о}{Yc***BFFQSRR q{;;:7A*ֺΝ;{nZI___wWWWq#Jl --M~NNNgֺdj4i%]kS*ո(qT*С:t@򂻻da ++ HOOGVV8#-- DL2WvJOOGhye. ۷'Ѿ}{Inn.2334-..[(RWQQP DFo777xyy'nnnpvv5S6OII PXXo~~x.^dgff"??_=\\\$2|}}/^Tq2qKqόAT"55:%렇 GGG$>ZIUUX( u1++ bKj{zzdꢟDfEN 먫X7>Rx󨒒z)Wfggs8YKϔ|L;ZrܹsG#y)۵k8::^5 ƺd666: YZZ*TVVEEE(((@QQQXX(v ^lE0"뢙.Jz\ff666/Z&AޚA-eOAAX~2HDbW\\,>2%;Q/ke:fb򐞞dddmUVV2333;;[ O06 = xA:vvv077x?33:'(BY]eee(++Cee%JJJP]]|ASP(\BG8O|||`kkۤ=kg3PYYz@NN5L }#3338::B.ruumi >A=|T*uz2\grpp3<==Vd070}+,,DZZrrrB-((Q'$&e F-`mm-Z6*q um6BQ!%l/cj+$A777 e4̤!##CWVV 4rDg)d ?k˸3f:>2f8?zp ͛7RVPP{~kŜ`ee+W4^d3fc̠?k˸3f:>2f8?z 33Bf֬Y#On3.-2.OtU3k֬_777ܹs k &O L6ݻ"bx?k˸3f:>2f8?:pU͓O>(_uu5&OlĈXk쌑#GBо҇9̙cܠ3.-2.&OtUѣGkpd2BBBн{w "c̙35VW]]S9"ƌ?k˸?c#cS']kQ(={nĉL&C޽ѩS' b8?k˸3f:>2f8?qҵ &ں5554i&Lfffxꩧ$12.-ϘȘiTIZkt8r<%f3f@uusJR&pgm֖qgtp}dp~㤫ӧOpr9Of5f888r <FŘqpgm֖qgtp}d4q~e㤫#G;'0"ڙcL&㆔\Y[埵e\3\3Mj8骅Bi`nn333DDDUX+>%cIc埵e\Y[116mR0sLamСC5j\\\$12.-ϘȘiT˥: //@ii)());ڵkuoEee%򐗗rP} ̄sb333Ikj ??())gSTVVSN8|X΅vNNNpvvL&0V/R"TTT\,󵕕);w ,--5dprrzaoosssyLJBaa!jjjP\\JFSW\\:%llll/OBhX %EOwD$ uaΝbfffptt9`eekkkc|LFFD$uRVVhܽ{IIIHLLDbb">>񁷷7ѥKkNocmGEE\1Q߂'΅PTnaa[[[IT$k=qg~gL***L*,,D~~> QXX(>'\VV&&o ` =ptt 7773%EEE@vv6E?WUUqV?]\\e}h5Iל={.]Bdd$nܸ8T*~~~b]vVBLL 1j(qd g+"''b-%%Րd@pp0z聰0<h߾.|2Ο?7o͛ˊFWV--D-_8%z 2'$D!!!ѣzpC.EXddd˸vnݺ۷oI|||о}{u=3$ |r{ %%%ҚJOOGjj*RSS q+u.][n۷/w(Q555HMMERRLdff"==YYYHOOGaa~u:88'lqf899ՙ'$JwbT*5y![TT$^d (eeeШ+zX& 􄧧'ŤЗyyy?3e͛Q\\ c@xx8/STUU㯿˗q%ѵkWk׮ҥXS5d1 $ \Ν;#,, aaa6lBBBvV"''o?# Riiiš%&k'۷oWWWTJsc紴4񹴴4ddd `+++ B.]йs&}̴pXeee!66V$NLL'f&Ho߾N2QgJ2X`7$//OL@kKH ?'''{ B2600:uBPP/wІ 11wAll\MNNFRRC\. zxxh Fq؟u |! ] 猵BhPPСCqbB+r* OƁpAܸq666ǠAx:8s Ξ=ӧO;wƘ1c0vX 6GLD\\~7#FhՋ`޽ؾ};= L:/F^ȕ+WqFEHH{1<ӧI݋{"%%={6Ν ???Clqi9sOFtt4jjj`kk[|уpkrssqu\v ׮]q-TWW}%ܤ.n6"BLL Ο?/>n޼*( t !!!v={j WUU{9n޼H$$$ ;Y$PQQ+W… 8<.\ &DP7CBB*uج ĥ!,,Laaa~=`ZIׄ^7nDuu5fΜ~ :4Iܼy?6n܈J̘1/Ru`lشi֬YÇǂ 0~x ̷v999__#::CŒ%K0qD>le|z*v9s'4e2pEر[lANNFgy=X1Jk׮᯿鰰@hh(~w Hee%"##q5\pOƭ[Rйsg1 ;l0nqԩS8wdχ%o߾ѣaii)uH H\xϟ 5߿?ߊg믿zy5TWWGѫW/:tڐdDFFb>-- fffѣ  &ںb?N˗qIj,+5rH899Ijp:r'ODee%*=aaa|13m%%%v횸ɓ' #""ЧOH9998qN:ӧOP(ܹX/CCCѽ{wXiiib&pFDDF)\Pqq1-]Ϗ;2$Rhǎԭ[7R(Rvva8?-Y222ɤEFF?N2 @gϞ:$4zҒ<<JtB-#GPUUPoF~~~Ԯ];Zz5UTTHJSSSC7o&ruu~/Zup]5jr7o%''KRr%1brZhJGyy9XϏ*//:V%++}]oO?q;;PNВ%KTRR"uxʢm۶ٳŅd2n uuzw\\\hS||VJR?cǒiՔ$uy摇]K/DkJf0tz7O>i֬Y{n*--5FOԩS ͘1BQTTD/&\N#G|WdccCtii~Grss#ooo:~Z>LdggG˗/bKKK~r9 8CLvv6}ԵkW@~~~ꫯ9!8@O=999L&|6oܦ!>>Qǎ y{{… ѣ|%DQQ/4uTrpp LFqR?Yf0ZbEGGKk?ГO>ICָIכ7oRΝӓ:dCjΝ;RԩSRcRJJJhdffF׿RZ4iʕ+9b^ LFSLTCjS\BaaadccCk׮mSuٳ4k,"GGGz̙3moSQQAM<Օ^u{ԡ jT***#G\.'OOOZt);w̤<̙CdeeE3f̠?Uմ4裏;/%&&Jc233i4tPdCPK۷lmmi|2h4a277 6HIHMM=z+>|XpZ/%B$Kݺu#'''ڶmYUUUBqQQQ!Ծ}o߾Cׯ> 4araRɡwyڵkGfff4n8ڳgk1hR uؑVq uz'HP3-^]&uX$&&|M"\N?0_z{$]wM4o<ÀT*{$hڵR#$ ݻut &'''3fLS*Ν#777ׯuqi޽{AǏSxx8d2z̙3RĘjڽ{7׏d2MRRR&q=diiI>>>zyu?~H^poZc/2z֖<<bbLoRRR_$kkkELbcciر @{1]AhРA͹sʰIh Ĉ!555n:z yyyј1ch͚5hY\\L4Yt>˗/́SNdff˗/'sss zSSUUEΝ;Svvʝ`ݦ._L/Y]W^%{{{5kzj2رc:NֶKKK 1mիWiرHvvv4bK}.]Pnnch*^zщ'r܆G퇐ڔ)S1bk K&+M8.\s|+zzK9׭[wXG[ah&RI?#yxxF9p.T尵R:q#}gF=}%''k}mϞ=;֭[\޽z… SOQ@@YYY3?N_uMݏHz駟mc^z{znΐ99s 2 MR%]KJJ[n4p@~y[o%gGEEջݴiH.LT^^Nwܡ~d2k׮>'cƌi0#4cƌ:߹sƏO={$']U*=cE=)yW֖n޼i㴔rnu.m۶m$hǎyvOJJ y{{ȑ# 2g!;4݄ ?}ĉstU4h^{~mSϝ;G4eJKKl7o) F~~~4dȐ9 <++FMfff[o5ffddPvmݺBcЯJdnnNG> z;wj`@x~ʔ)bϾ)Sd|`\EO<d2z饗Zdq尥R)))L&'JL.}СC߾};R{?ŋ2`z?{RIK.%BAݺu***(##9"_SSkyR(_Rzz:Mݻw'33:6" r%իY[[ӪULjhdd$ۗhʕk\7FTgPSNtn/rvv6z;JO>.]u .7o.\Xoښ @R;ԭ[z/XMF}UWWD.hܹ?)~:r zTLf2x`ۿ hĉԥK*,,4:u/)Jdffi//|}},5t[ yoc$]՗4s[lP$;;;5jT뫸o\/u9lTRRRO>*TKKKq~Һ}~WSSCcƌi~{C'vϟ_k׮ԩS<7lHUUXiԩ&FޞHoߖ,OR:c0tB<YXXЦMt0ILO>o/:x Z ܦMZJ&lmmQ U~~>?Pzcn+ѽ O\NW^54j(ׯG[R;ϟO[l1xGm١C>nPN@#~)7:moooPvƴ'N x:vUm,%%_~ؓ@u&L O͘1^F+55Ue9>m巩}?|ΣG/^.]D4bĈӘaKk*~ ݻw%)}>;t!doo5-s-ZoiVwMSSטzoNCI.k\#¹?~i̘1S{%ssszg~Sm\7O]KꌙЕJL[n.|(|pttŋ 7bΜ9 CϞ=ѣZgСɩ8s΅7~7ܸqWرcѱcz~ N^zaժUX\Ç?d2AՒʝoTTʀ3.]?F9f[cʔ)>|A3gMi&̝;]Jƴ ,,ksǏoj:y퍏>ȠчjFK(h+K_}IC}Έu-..͛p&OBCCqa\t /{B9lIT***0~xXXXĉ :z m3Fw}Ř4iNׯJ¤IAP4k?uVZZrC6s>|893gHg^rSNżywB8tuSSKc0t%ɰb |Xh1c?JXx@DXbk%%%Xf ~f|Ñ;w.~V۹s':taÆ8-ܥW_ƍaoo駟Fii)9bc׮]Í7 ={6r9݋Ο?,?^]$%%!==n{?󚷷7 && KKK,Xɷş~)gHNyyy/,Z/6o KKFן NW~74a[O7m??? 2ԗ^zaÆ o pS~_*~3e˖ƍ7tz٨4u?!ܹ;h+6OOO<سgQm߾AAA0`トTTT`mڴI,S?R]]k׮a077W_}&!i`kk[5;;;ogӧOGII :dc5Uii)VZ_;w:Ѿ} 4O~O=Ǝ,!44Q-**ž={+_~}_GX8iJ=%"]VY|I=A%RIKKW_}+V Wm}ڵk ~\\m۶6lm>-- Ю]F U %33o&}YL bccyfL8ضmO???  T*V\ (++_|5;oJhC1"<&| oeN*7nСC6,u[L?駟}c:' ƬYN^7BΝm*="KmnX:in==x Zb8yxc)aKhk.XYYg::=-2ʱ]]]cc̆4}h~ͩѣG㡇7|Ө}yn^{ 111pюuVL<~~~F;n6%Msc֭ =隚 OOOE7n@ll,x 絝 l0 IDATٳw^:u*rss1sL\z.\ڵq|oocAjjaDzz:Jx+r^{ 7n:k HIIحURR|}}vG}NNNx"+mS@)%%SL={~f'''fq&<'lch~~~HLL4ʱիڵ+ܤE/N<_9瞻R}_~:kmnX8in=]z5fϞ-"2C ڵkRR/nGrhT.]AZ}Je)Jñj*bҤI(//׺]7u?ސJKK1j(t۶m6sC]tюyei i 9>|8{ҵHնqFVcJ QQQR(>|8oߎ7xJvjp;;;KP*XlVZw}WoːZ;5Gaa!z!XYܝ;wWН mU~~QO0uT[hƍZg9~?cǎO}ٵkW: FVzXMQTTR;u?ڔ`Μ9X~=^~e3XdAjJmJX>i猉#GLji- IY뇔Tr~+KI|Ấ>fy1eDFF^кСC3zO5554iyzhtn+ggg]WVVfn6.ur M']===UWWc۶m8}t)D$~zk#|.,^駟ЫW/xhܩYh8 /_.>t7EZZ moFEn݊;wٳ6m6Mcee+Wo63uu^1bD_`*$uzꫯ"""G|ppp-[ _} sիWcȐ!޽{i1$nCrhT u&$脙TVVΝ;7ڰat邍7j5xP({!ۡ!꽾,Xرc7ܹstnJ +r}xWbf ~T\\\`eeeDKJJjeN*{QٿtYYY1c&N( R?t1i$ǏѣGݻc׮]T*?[Ͼ їRO?m`kkKJo>ˡRsZT;vD׮]q9jfǎpssC=vvvؽ{7lmm_ysXl.]T﷓߾}~-&O,l~;?tY#S>o>XZZ6)(//wmyCݻvmOh֭DDtI@m6JMM O?,,,(44***4իdkkslqf̘vdff6׹s]~h4ÇӔ)S mٲu~С;?N[fRO>!>\իW M8Q~ Էo_RTZѥM={,YYYԩS)==rrrhP(СC /ϟ'te)T*ݛ{1C!"Pھ}{~~>҉'nAhΜ9>VcV~7[`6/Zx瞓:q_ e9l T***( Ν+u(DD$sssر#޽rssRSSiڵ@;wԺŋѱߺu+vi}7$sssz7TYYI)))a|JJJ_S.W333uVߴiV8{ƾpn*ٳ̈́ 6fma4իWL:Dt%"6lM6M3`: RINKҀ}P(ޞhʕuNbmmm5gԨQ ƧYF|}N?zkdcHmڵdggGeeez}ߖ^z޿.^EO?P(חJ|sQ@Ƀ>(>h "jZz3f 988 >N:?N/^Lݺu3ȑ#$h˖-ơ|Nv5W?׺_|X]tit|ߦ N\9}Is)ѽD~PP_j0,Z(%%EPaKi{ndp5 meS(|2͜9Ғ,,,LJ&MDO}vvvㅆ?|" .ЬYחޞ/UVV6knj<}ӖؑPK,!;;;1MF&Grl[u9(,,]Ґ!C>AϾ{,\nB``ߞ5B~~>/bٲeRc0СV\)U¤3uTܼysXL<vZ߶$!!/K}-]k׮CIccҥ_0i$ù/n[K_ƺu믿bرRØIl2l۶MrCc***Bxx8ĉ IX[Q\\ѣG#!!.\ߒ++̙3AAA-flʕ$K,|`/apv؁>HPZUV!)) _|ԡFxcܮ'|G}<'u8ҥK矷+K|g1c}Q|RØcٲe%I;RpܸqC83 4hpqݾPmC2~wCDž ҒV^-u(FQPP@&&T[SVVF{KJb 3gH ڵkI&ջƨ L&}-I !##&L@fffn:i4n[KER4n8JNN:$ƌF믿Jʊ-[F*6oL...Bj5]O?49;;ӝ;w yEnn.uЁFA555Rc4G!333Z~ԡIB{ԡjJ}Qruud}'B+VHJر\\\[ntEavEԡC믿Io9ZC/tBoj{'={vRlڴIR)F!v-***.^j8tx_}(--}܏nU?n\0p@ahh(6oTm38 :v(9P(W^%%%rԪIm~6R,X@hii#F KjÅ0667nFWXX(>ѭ[7P(ؾ};wIbE [ljZC[իW_۷zzz^jmZyfO B!T*xEZZܥ5Z-o.RbzdѵkWiqÆ yJӅB1*nܹ:u*N6"[o R)&N)k wC]N?N: '''^oFN<)t",,,7|Ӧn'`'zͲUPҎ9sӧyLT' ###ahh(^yqeKkrˣoTXX(;#;;;oǏ{;w)S333#F-ӪGoܸ!-Z$lllB +V`KFrr+ "DǎżyDTTTciCW]vΝ; KKK ~ ҥ033ׯf-11QM%yƊe˖~ B! / ~QVV֘'tB<1g%ߪnnخ^*b&nm&,,,X|9wRvv?h׮pttd{m턯_z52?ggg-f̘!ܹ#wYNTTTBo7|# \\\Tnߍ7ʕ+P*@CfԠũS˅ZZZW\R]bPYY)N:%ϟ/aii)޸qC۶m3f̐С>^Zl2O ]]]P(D޽ł yՐ!v!nݺ Xk׊$Klo8L)))'NVVV055F_~ cKRTT$N8!,Y"~i/'''1k,/JPUU%.^(-[& w.^}UeNB*v)fϞ-\]]#|IxbqiXB4'OᅬӧOwޘ={6Ə===KUee%vލիW%K0rHKkRSStR*f͚J%wiիyfƜ9s`dd$wi"""b l۶ ۷ĉ1m4xzz]ZVUUC!88w.f̘yq[񈊊p18p@bb"___rJM 1118s Ξ=g"11J{СCr"qho}bbbp=zǏG^^ лwoF.].ZX\pAzDGGCV~~~2d`cc#w-VYYΝ;'PTVVRׯLLL.{!,, 8}jvvvrj5$( 899'6t|KIIATT6#""Z +++)߿?`ll,wBWt_6mB||<0a9{n +** {֭[qUa1cu&wy^yy9oߎǎ1f]vrಲ~l۶ FiӦ1oN>M6a@=CbmCnn.N8wƝ;w쌿o2e z!wmFII .^gQUUSSS)uwwGϞ=:]6Irr2\rQQQ()).\\\ЫW/eQ\\K.… GTTbccQ^^mmm899 O<z8::c*''HHH@LL [nAD+-dPJ[RGGG8::ޞ-HHH@bb.###PTpssпrՅa˖-ضmRSSѩS' 6 ÇѩS'K|$}aHJJBǎ1fL0R6)==?3n݊/BOOO=g}-2@XX8}!,, 2d&LѣGsGTUUc׮] Abb" 0`aݻ7 .8v;+W@>} 00ٳe+,,իW.x111(..tNNNٳ'z=zH;۷+++ oFbb"]8)hw 5F,BGGG +CTT"""($%% `cc)upp@accÓML $%%ƍHHH5FMvڵEE6NWW]vBXM]Z2 ))Ij?QZZ pwwڨUC߿Ǚ3gPYY J#44T,66 ^^^>|8///if222~۷Bnn.O}гg񻓕h\t aaa Cbb"O?40hРfَnB$%%!>>񈍍~NJJfvvv=t{{{ؠsΰlv Aqq1222۷o#)) oߖnݒBotUyܣGg Dׯ_h~NNNvI}h XXXpC(//GVV&%%HJJBrr2RSSQ^^}&loV*''FWjY lmmkQKKKX[[~9w233}Vo5NRUo2~FѲB?+((sp9={ϟGaa!777i@ںQ; 눌Dtt4]ro߾RH3-ZFxxt3g 99йsg]^WXX(߼y#77  j|||x͛7*^|C3 ]tAΝacc++&-PQQt$''#%%nݒB8iSN۷۷5v?Û7o ?Q}VVV`aa333%QCnn.rsssrrpdee!-- wAff&QTT$_GG*J׺v*o8ruJKKq֭`I+P*RjaakkktQ111gKyyyϯgnn.p]K!kff&rssk|y [Ɔ*Ր۷o#%%oߖMMKKCee>,,,ЩS'XZZY6YAtBI377wAFF.5?y{fmm-ٶg[vgjZC󈌌۷QQQa涶ԩann:zzzM3ݓΘ 999FNNrrrK4â`kk+nnnpuu%uPZZ4Htt4"##W;wF7sss}) ***ήHIIqƮcǎpvv"jުpuIk.+̔с5:u$hB+333(7133Ƕ\sP_UU|TVVJ;ddd 33SOKK * NNNprr3zgggm$eeeHMMEFFܹS+pBzz: Ee]]]0116LLL׀?~?_QYYZU?,((@EEQ^^{eee(((@YY^M[ϖ-D #''{eeeI}&B^^:dӓBR_9055Rq<`ddT똴>JYIItܫi㗲2K}RQQ***+8jgjkkL 4aMs+92jZju˫q_]@V1)&oӫ1/ ??Oig/Ag )XϯkNjA kVVV̻jj]jIo߾,)0<4Wv011Um/[-JJJBjjj߹{5;UCyT*Ir>V&JMM~ﳲj4WV?ZACцfffJڂ!jPG5Z477V號 H;@; X666~۷oJfEonKKDGTGD+,,@V#77W:QWzߣ#whC$M ]hLHкgii5'4EEE5O9qQNkNo[~"F3Xz{<4gXFJDDDԜDDDDDDDDDD +QbJDDDDDDDDDԀ5 DDDDDDDDDD +QbJDDDDDDDDDԀ5 DDDDDDDDDD +QbJDDDDDDDDDԀ5 DDDDDDDDDD +QbJDDDDDDDDDԀ5 DDDDDDDDDD +QbJDDDDDDDDDԀ5 DDDDDDDDDD +QbJDDDDDDDDDԀ5 DDDDDDDDDD +QbJDDDDDDDDDԀ5 DDDDDDDDDD +QbJDDDDDDDDDԀ5 m """jK2bJΉ;88`׮]rIDD#i׮]׿Z-= K)J̜9eC`JDDDԄLMM˗/CQ㵘gBÇ7uyDDF?"jHTUUz-//Te#DDDDMl5FE &4QEDD?"j~SOAKK1tm5qAP$T*UQ[y0aB"JS ]dqI# wɱ?"jyIB`̘12VDЕHFG0( \E쏈mmm?:::҂?:v(wYhРA :2WDDDm#i񨨨@UU&M$w9Tr@DDDTUU!??(,,DYYEEEnPD~w^8::bCvj-o``}}}@ SSShiiĤq xCnn. kOeee5@KK 333 BίBԪ#77(--E^^Zaa!PTTRÇKKm FFFrOB """Sii)l!??G~~b)4Csإсa``ccc&&&ulff 顭sDD-QJJ 㑒d"%%)))B^^l}&&&033T*lll`ccJ{{{899C >~:RRR*T 77 >mmmְJJt'''5>fJDDDVNNRRRddddΝ;@VVS*BvZZZ055R)Ѿ}{Ϫ\]d >{ք*Jl+**PTT$-((30_kX+++XZZB:݈ieddҥKGll,'eAΝaggJKKKDԗU4?~B͕FjLOO$M_=۱cG8;; ݻ7z cccyIUU(!667nܐͥvٹsgؠCRԴO@cFvڵk}6^Inn.j˼puuЕZ;w !!}6Q=oߖ.333tܹVXN:cǎ VVV6999R]W 999ֿ 0[nptt; "jpN8K.!,, )))nݺgϞRٳgO899I>폪,`8::P*ѣ內~Zl?~gϞEXX\BE 45GuNU6KKKqu\vMj׮]CLL a``^z 󃵵c1t%""歰шGBBch׮]akk[c4RG{{ѥ#5'4۷oK9,--(=]]] Q$˗qa=zOFqq1Я_?xyyO>ӧ.RRR8,, Ɂ ???<֭ܥPRRGJWBPC:ЧOxxx@GGGrEV#&&Fۼr ???ߟ뇡+5HJJBtt4.]DGGڵk4[npqq+u.]H`|47nܨ񈎎F\\j5aggR68;;$ZsaصkaiiApuuFs >|ơC1(XEnn.>={ $$֭GK<0qY>}gΜ'PUU#((AAAܹe6w ] ! .HHC[[pww;`+//G||<"##GTTnݺ 73OD˗~ pwwG`` F OOO˓Eee%N8 %%ݺuÔ)S/N+//޽{BP9r$.Q999ػw/BBBp'Ĵi0vX^QV7DDDpi?^ YsssOOOx{{wpss+چ#** QQQx".\XjǀЯ_wQuظq#;\r={ԩS1vXt]!.^m۶aƍ{.yL>5x[N]{g1yd}0p@Kk2FQQq%\t N­[Ю];Hyzzr3wW_}(..ƈ#0c 2?Zcǎaݺuصklll0w\aGXr%lkkkL83gD׮].EW_!""?>mcJDDD ƍ }p[n~~~ԩeR ݼرcB0x``ĈСeՐ>6l)̙Yfy ͛7g!88FFF7oΝ KԩSp .y21:tp}y˒CW"""ztW^Ů]pcذa2dХKKVHH9rDwEE ѣGcѰL"jJKKcٲe077… K//+W9/__|n޼c2d-Z]Vr%|صky|pss,90t%""u6l؀͛7PT5j1x`αFMî] ̄}Ŕ)S0a(#&uA̜9w[oqf#JOOǢEߣeQ3SYYXl駟" @ZSN\_˗/okBDDDG%&McǢ_~UBFYY=m۶aP3f OwMII }]YƍΝ;]Vq̘1111O0k,n 7ɚ|86l؀4Z 󃣣#֮]2$V&11}Mi&O \'Ξ=x71rH]lDUU._y1pmBJ/2^ J\R GQ-YYYϰfcΜ96mT*ܥ=H]ヒW_}+cpF.]`ǎS8{,ƌ+++o ۨ˗c…7o/_ΰUfBX .o/߸ `ҥXj[oa֬Y0224+Vo)>#L>#7;4zjddBP#%%BBBj|Ej-s5ܽ{s(--UןS(uAuEL:]v1c`ڵ~zQ P(߿]?[=zxMԄ8s ^uzzzi&48JUVƍ7nf͚!C 11IODGxx8Ǝ1c $$AZbZZ'~ﻮs>𽏢k׮8s :v999 j/_5kn\|󃹹9 舉'"""z|C cΜ9fAQVTT$f̘! 5jHMMm\"QFwAoV֭[1~ߧqE@3gμϝ;':tPyZ-~m-y+JKKEFF8x>W{'-}qOLL#FXhiiwX@QRR"_.Ə/zO}Bo8҄xꩧY( f͚.O.ʕ+Ezzw8ypqqZZZb׮]|C۱cP*?oh)CW""6,%%Exzz;m۶V\С lR.\P֭}bG}Z*Jxzz ߮shubٲeBT ]ENNND(--}6r /Y cԨQI7>}ZBV׹Lffiii5O?!ăIIIBT mmm]B^x4Ha``PgFGff033gnorbƌc|cX|.0t%""jRSSpqqׯ_}B4Ljbb"/Jh߾\]kllP*O>\ٳgk':u]~z%GzC9r033Ç-&o8rHQO>Dz>WT8zh !G}$ڵk'n޼)[ Ը^z%akk+mCW IDATͽ]ޏP*}EO}TjZO 45^msA1btuuq1tM7h4EAAAug֭CUU܀ {US 57<$$$&&& PգqYkBD׻ヒ^x~~~S6lP6l/\'_һ Je˖] 5k׮_|Ѩ7k.CII ơ]q(JZ 'Ođ#Gu]r`JDD}qKKKˑŋի={_.IG={K/SH'9s#G~GKxyyaӦMذav)w9D̄իz2Pcʔ)P* A^^^.\;w`Ĉ5o~")) 066#}Fu7nD^`hh<زec̙3?? VjY6mڄΝ;#00QC}~}\76m$kJ ]ژ4^q{Zwi]fMWTbͰy.СCزe  ]&Mos#}.]  8ZZZصk.K'{ٺu+벱?JKKumذAk~0atttzj?wEpp0ܹPt'Nl;O0EEEؿ֭[1yd(sv W^qr]L<;vhu'D1 +]J-F_ouw۶mfΜk׮{G}ߟ/Yر#PYY7>gaѢE(++Cll,z OOO,YDjxwPK!fի4hP_rW?MVk'Յ',--ɓ'?w9}4~Gprr?~/.\+ѣ^뢦STT7n`РAM.1l0 <__~.ߐz)͛MЕ /tuu.hiijSҲOq=:w {n=*~'$$`̘15kǿ%EϞ=vZ9?qa˒xxxcǎ "jF`kkd=z4LMMqEDGGv Xq'>SRR /`׮]Xn]~Ǝ سgOGonuQ5ZBw l޼/|CV61055zj\FFFAuI9s / ** oFhFRẉcޯB֘~aȑ;*S3޽{e&33ZQۖۤ}>^|E188t OT*|޽;>F=emm M6M9rrrd]44}uS.+++J~/.&CW""6FR֭[rz!11 u^5sLhkk_~yP*T l޼gΜ5BKKjG "jFT*4?wSь۴iq9?2O7X`A}?{6Ս=SRRmoe4W6:s9s&ʰm6hkkK;88|cs***Z]dJDDHIIҽ{wϟGBBBl۶ IvCCC|W^ѣ/^y6..| ƍ={>ك;ǧL>7ߔP>o6&MTk۷ޟXۇ] 5#~z_~pqq;w0qD5 fff5i~"((8r:aӧOضmԺ{cqt)36667l͵]~ᇈݻRf&CW""6矇-]c/T*1|pܹ999PHKKW_}7x#|}__h,XX`Q^^T|wx߷aÆ:/YpssC~;w6-[࣏>­[PVV[naشilnVQQŋcPTrCDqA7zN  qC' .] X`+˗/_Gbb"JKKɓ'ҥK={6Vhh(RSS뢦bM.{_… о}(Z'|c Aݛl^&#ٱcP(b֭r" N:=/]$&M$t"􄮮AAA̙3ʪ>}g͚%:tpCCCɓ۷Veeeuz{{7oW׿^^!seu׋C.]]]]add$#-[&o|Madd$.;we˖&]ozzBVK?N?!D} /P3(+_PZZ*o.E݅011nٳg gg&[5oV&[gsk?_Ý;wNz}o,BR󟍾&T!c"""k޼yXv-v܉{NrKbؼyt "ƍ(CWWWr!ݺu Xt)͛'w9Э[7̜9˖-5kbccѭ[7iHsz""6>ĉ1z^FOTTT`֬YXx1+Dt_~)_] Ü9s`cc^{MRbɒ%+w9233h"[-pp+Q&+pB>-# 7rOX|90m4,]rF-={0o<$''^… ƔkbժU000~ӧCKKKЕNjj*8Gȑ#Ȁ) !C aݻw.]ɓ'qQ;wprr gyrJDT'N`8p<<N|'2RCհa!;;;KuRSSǏ+33SǎӱctQ]tI}ш#:AAA fQ\\ 6())INRTTx%&&jȐ!-_G@ƍ… 5mڴ}*))I7nT}}%&&jtnF۶mSrrRRR$I<.\ &|Jgrua߿_҉',iСRhhBBB4h q*++egg+++KǎS^^F5dEFF*&&FcƌСCecccpݻW>3]pAJLLw߭cTKTUU/ԶmgT5o}Tu̞UAA:Ni+ @ RPP'///yyy륹Yeee*++SaaUXX章@EEEjnnb588Tw!!!߿?W*;wNw6ѐ!C4rH9R#FlߩLǏÇu!:tH!C &Pjkkӑ#GLN...>|F#G*::Z±mmm:w233M˃R3fymu QQyyy sΩ޴|򒯯<==M?UrK{YP\ŋ; K.NvܬGj+ͪ2;m5]`0U666rvv6Gߞ{-P@/d1íT\^v|x'u.Z;~tsy9QOWPPw[v| HArUR2U7+رCw}: GZ$(](](](](](](](](](](](](](](](](](](](](](](](](](](](](](](]l,fR]]x555Ng!!!JNNDL?+ *9rDF}٦ M8F`,/p=f^hٳoP"d0~{*y{{3p@>}`&˙ p鮻͕WzՂ nl(fC `sU[[kii̙3op"B ` `0(::Z @*@ `NNN2elmm;m- 9PXȜ9si[[[MfD́B&N(VVV?~- E `!>}iyY8fϞmZb`0(11‰P4ay{{Kn[8nХKTSS6F=Z[lQhh I#yxx\-h4Z:@Oܬlٳ3UQQk>(88X0`"""4p@YY%&XN =СC믕mגsIDATLeggEVVV7򒧧,WWW  W^?ٱbS{YJC***JÇWll"""d0,R7#JWޮ}?WZZ߯zy{{+&&FQQQRddBCCegghmm_NǏWFF233GVU\\^(]A۷oWJJnݪ2+..NqqqUXXc^Qkkӵw^iϞ=*//WHH&O)S(..r﫪J1114i&O#FX:5iooѣG-[ԩSpBEEEY:"ЛPiڵ\EFFj={gxfwI_^6lPaabcctR%&&2(]ͫLo?Qף>zlooWjj?i ҥKh"988X:SQO]]VZ+WQ/c=&OOOKGZJ֭^y͝;G n.֭ӲeTWWgyFK.cuϟK/kjȐ!ZzƍgX@O PTTO .߯\秷~[ӄ Oz}\ٳGWcukڶm~zEEE)==ұZկ~ӧkΜ9JOOWllc(WVV4n8}ᇖt{6p=h֬Yڲey-Zґz,???}zꩧ4c jٲet[ikkӜ9scܹSǏtFoŋZ/- (]@k֭ھ};=jooג%K{ґn5]@f_^~бe0:BBBW]]e`0h̘1s}v9NA(屭zw5zhyxxM#Fի^o[x^~e=:xY 8v옖.]^xAs>^ttFi=^xA]suuhԔ)SbŊ.ڵk%IWvvVG$%$$h4h4I퓋/^g}cz!=Ê׉'3f'ԩS5o^xq9sjjj~|'34UW}}dmmm~W7n'+[:s|}}M$ooo=zTO?V\_JOOWLL駟v@ JJJ.I:snVȑ#D;wԁ4jԨ2tQRR=zWzl[LW+)55UY WIՠATPP/_^ WIڱcllloK6lؠk(___*##ô@1$_Әy*--5 +VP||&Lp]`IY*֮]z$-X@#GTddJJJm۶k%%ӶV'Oɓ'e04lذky'ԧOY(]@W[[T͛7ﺍ1oz92z:WWW걾V$SAA kъPii̙u'%%EۯxEI6nܨ{ڴiQjjvi~mIRSS5 o+Izd4%I? zKoJKKUQQw}Wﯧ~{>>pe3fhӦM?^{$j޽k={VFQ8q^|E[E6o|z售WXd6oެSNqn999кu4{lK,/ze˖T󎥣T~h>}+|}}c_VQQvڥ>@lll,6X^uuu5jk.Y[[[:RUVVh~-NX^NNNڴi8KZ:NU__iӦޞ+{`W5k,9::jŊԫ466*11QYYYڽ{\]]- v(]@3m4555ijnn믿RfPUUӧJMMհa, (]@4w\h…:q6n(777KN8544(55U111t[ z3g*--MǏרQw^KG֮]1cSp+FC)<<\&L/~ [:VPPP'֢E{nұnz>>>JIIѦM+,,Lo,[׊+4tPh׮]Zj- (]Mcڴiҽޫ>|n*hhBSS֬Yzgu1M0T5k(33SM4I#Gc^:)%%E[nչsYfi6l# +Ԥ/R7o֖-[t9999iر?~ƏZ:u!ٳG{ÇڪhM4ISLш#deuB pN<4iϞ=:w$԰a`W9ZZZTXXg̙3Vff222T^^.+++EDD(..NǏW\\7+*,,TFFӧ,I׀-yxxKӧ%I...Vss${YFUTT\Pqq *IrrrHEFF*::ZnnnyQPS{{tYٳJrUWWQ /]Y9;;Tv|||(88Xޖ|t3Z(](]l$}hKd"JVIENDB`chibicc-1.0.24/chibicc.h000077500000000000000000001013011517770275000147310ustar00rootroot00000000000000#define _POSIX_C_SOURCE 200809L #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define SET_CTX(ctx) \ do { \ (ctx)->filename = __FILE__; \ (ctx)->funcname = __func__; \ (ctx)->line_no = __LINE__ + 1; \ } while (0) #define LIBDIR "/usr/local" #define ROUNDUP(X, K) (((X) + (K) - 1) & -(K)) #define ROUNDDOWN(X, K) ((X) & -(K)) #ifndef __has_attribute #define __has_attribute(x) __GCC4_has_attribute_##x #endif #define MAX(x, y) ((x) < (y) ? (y) : (x)) #define MIN(x, y) ((x) < (y) ? (x) : (y)) #ifndef __GNUC__ #define __attribute__(x) #endif #define PRODUCT "chibicc" #define VERSION "1.0.24" #define MAXLEN 1001 #define DEFAULT_TARGET_MACHINE "x86_64-linux-gnu" #define MAX_BUILTIN_ARGS 8 #define MAX_WEAK 20 #define STR_HELPER(x) #x #define STR(x) STR_HELPER(x) #define HELP PRODUCT " is a C compiler based on " PRODUCT " created by Rui Ueyama.\n \ See original project https://github.com/rui314/chibicc for more information\n \ this " PRODUCT " contains only some differences for now like new parameters\n" #define USAGE PRODUCT " usage :\n \ --help or -h print the help\n \ --version or -v print the version of " PRODUCT "\n \ -cc1 run the cc1 function needs -cc1-input (-cc1-output optional) parameter \n \ -fuse-ld to specify other linker than ld used by default \n \ -x Specify the language of the following input files.\n \ Permissible languages include: c assembler none\n \ 'none' means revert to the default behavior of\n \ guessing the language based on the file's extension.\n \ -S generate assembly file \n \ -o path to output executable if omitted a.out generated\n \ -c path to source to compile \n \ -Xlinker Pass on to the linker.\n \ -Wl, Pass comma-separated on to the linker.\n \ -z Pass on to the linker. \n \ -soname Pass -soname on to the linker. \n \ --version-script Pass --version-script to the linker.\n \ -I Pass path to the include directories \n \ -L Pass path to the lib directories \n \ -D define macro example -DM13 \n \ -U undefine macro example -UM13\n \ -s to strip all symbols during linkage phasis \n \ -M -MD -MP -MMD -MF -MT -MQ compiler write a list of input files to \n \ stdout in a format that \"make\" command can read. This feature is\n \ used to automate file dependency management\n \ -fpic or -fPIC Generate position-independent code (PIC)\n \ -fno-pic disables the generation of position-independent code with relative address references\n \ -pie Create a dynamically linked position independent \n \ -fpie Create a dynamically linked position independent\n \ -fPIE Create a dynamically linked position independent\n \ -fcommon is the default if not specified, it's mainly useful to enable legacy code to link without errors\n \ -fno-common specifies that the compiler places uninitialized global variables in the BSS section of the object file.\n \ -static pass to the linker to link a program statically\n \ -pthread pass to the linker to link with lpthread library \n \ -shared pass to the linker to produce a shared object which can then be linked with other objects to form an executable.\n \ -hashmap-test to test the hashmap function \n \ -idirafter apply to lookup for both the #include \"file\" and #include directives.\n \ -### to dump all commands executed by chibicc \n \ -debug to dump all commands executed by chibicc in a log file in /tmp/chibicc.log\n \ -E Stop after the preprocessing stage; do not run the compiler proper. \n \ The output is in the form of preprocessed source code, which is sent to the standard output.\n \ Input files that don’t require preprocessing are ignored.\n \ -rpath Add a directory to the runtime library search path this parameter is passed to the linker. \n \ This is used when linking an ELF executable with shared objects.\n \ All -rpath arguments are concatenated and passed to the runtime linker,\n \ which uses them to locate shared objects at runtime. \n \ The -rpath option is also used when locating shared objects \n \ which are needed by shared objects explicitly included in the link. \n \ -dumpmachine it's required by some projects returns x86_64-linux-gnu\n \ -dotfile generates a file with .dot extension that can be visualized using graphviz package \n \ -dM Print macro definitions in -E mode instead of normal output\n \ -print print all tokens in a log file in /tmp/chibicc.log \n \ -A print Abstract Syntax Tree in a log file in /tmp/chibicc.log \n \ -msse enabling sse support \n \ -mno-sse disabling sse support \n \ -msse2 enabling sse2 support \n \ -mno-sse2 disabling sse2 support \n \ -msse3 enabling sse3 support \n\ -mno-sse3 disabling sse3 support \n \ -msse4 enabling sse4 support \n \ -mno-sse4 disabling sse4 support \n \ -msse4.1 enabling sse4.1 support \n \ -mcrc32 enabling crc32 instruction support \n \ -nostdlib Do not use the standard system startup files or libraries when linking \n \ -nostdinc Do not use the standard system header files when compiling \n \ -std=c99 generates an error on implicit function declaration (without -std only a warning is emitted) \n \ -std=c11 generates an error on implicit function declaration (without -std only a warning is emitted) \n \ -mmmx enabling mmx instructions \n \ -mno-mmx disabling mmx instructions \n \ -mavx enabling avx instructions \n \ -mavx2 enabling avx2 instructions \n \ -print-search-dirs prints minimal information on install dir. \n \ -Werror any warning is sent as an error and stops the compile \n \ -f-omit-frame-pointer omits frame pointer and uses rsp-relative addressing. Minimal stack usage \n \ -f-no-omit-frame-pointer always keeps frame pointer (default) \n \ -g enabling debug symbols \n \ -O0 disabling optimization \n \ -O or -O1 enabling optimization level 1 \n \ -O2 enabling optimization level 2 \n \ -O3 enabling optimization level 3 \n \ chibicc [ -o ] \n" typedef struct Type Type; typedef struct Node Node; typedef struct Member Member; typedef struct DebugTypedef DebugTypedef; typedef struct Relocation Relocation; typedef struct Hideset Hideset; typedef struct { const char *filename; const char *funcname; int line_no; } Context; typedef Context Context; struct FpClassify { Node *node; int args[5]; }; typedef struct FpClassify FpClassify; // // strings.c // typedef struct { char **data; int capacity; int len; } StringArray; void strarray_push(StringArray *arr, char *s); char *format(const char *fmt, ...) __attribute__((format(printf, 1, 2))); // // tokenize.c // // Token typedef enum { TK_IDENT, // Identifiers TK_PUNCT, // Punctuators TK_KEYWORD, // Keywords TK_STR, // String literals TK_NUM, // Numeric literals TK_PP_NUM, // Preprocessing numbers TK_EOF, // End-of-file markers } TokenKind; typedef struct { char *name; unsigned int file_no; char *contents; // For #line directive char *display_name; int line_delta; } File; // Token type typedef struct Token Token; struct Token { TokenKind kind; // Token kind Token *next; // Next token int64_t val; // If kind is TK_NUM, its value long double fval; // If kind is TK_NUM, its value char *loc; // Token location int len; // Token length Type *ty; // Used if TK_NUM or TK_STR char *str; // String literal contents including terminating '\0' File *file; // Source location char *filename; // Filename int line_no; // Line number int line_delta; // Line number int pack_align; // Active #pragma pack value (0 means default) bool at_bol; // True if this token is at beginning of line bool has_space; // True if this token follows a space character Hideset *hideset; // For macro expansion Token *origin; // If this is expanded from a macro, the original token }; noreturn void error(char *fmt, ...) __attribute__((format(printf, 1, 2))); noreturn void error_at(char *loc, char *fmt, ...) __attribute__((format(printf, 2, 3))); noreturn void error_tok(Token *tok, char *fmt, ...) __attribute__((format(printf, 2, 3))); void warn_tok(Token *tok, char *fmt, ...) __attribute__((format(printf, 2, 3))); bool equal(Token *tok, const char *op); Token *skip(Token *tok, char *op, Context *ctx); bool consume(Token **rest, Token *tok, char *str); void convert_pp_tokens(Token *tok); File **get_input_files(void); File *new_file(char *name, unsigned int file_no, char *contents); Token *tokenize_string_literal(Token *tok, Type *basety); Token *tokenize(File *file); Token *tokenize_file(char *filename); void convert_universal_chars(char *p); bool startswith(char *p, char *q); #define unreachable() \ error("internal error at %s:%d", __FILE__, __LINE__) // // preprocess.c // char *search_include_paths(char *filename); void init_macros(void); void define_macro(char *name, char *buf); void undef_macro(char *name); Token *preprocess(Token *tok, bool isReadLine); void define_typedefs(void); void print_all_macros(void); // // parse.c // // This struct represents a variable initializer. Since initializers // can be nested (e.g. `int x[2][2] = {{1, 2}, {3, 4}}`), this struct // is a tree data structure. typedef struct Initializer Initializer; struct Initializer { Initializer *next; Type *ty; Token *tok; bool is_flexible; // If it's not an aggregate type and has an initializer, // `expr` has an initialization expression. Node *expr; // If it's an initializer for an aggregate type (e.g. array or struct), // `children` has initializers for its children. Initializer **children; // Only one member can be initialized for a union. // `mem` is used to clarify which member is initialized. Member *mem; }; // Variable or function typedef struct Obj Obj; struct Obj { Obj *next; char *name; // Variable name char *funcname; // function name char *alias_name; // alias name for function when weak attribute Type *ty; // Type Token *tok; // representative token bool is_local; // local or global/function bool is_compound_lit; //to handle compound literals int align; // alignment // Local variable int offset; char *ptr; int order; int nbparm; // Global variable or function bool is_function; bool is_definition; bool is_static; bool is_extern; // Global variable bool is_tentative; bool is_tls; char *init_data; Relocation *rel; // Function //from COSMOPOLITAN adding is_weak char *section; bool is_weak; bool is_externally_visible; char *visibility; char *asmname; bool is_inline; int min_vector_width; //from COSMOPOLITAN adding is_aligned, is_noreturn, is_destructor, is_constructor, is_ms_abi, is_no_instrument_function, is_force_align_arg_pointer, is_no_caller_saved_registers bool is_aligned; bool is_noreturn; bool is_constructor; bool is_destructor; int destructor_priority; int constructor_priority; bool is_ms_abi; bool is_no_instrument_function; bool is_force_align_arg_pointer; bool is_no_caller_saved_registers; // Function calls vfork returns twice unsafe with stack frames Obj *params; Node *body; Obj *locals; Obj *va_area; Obj *alloca_bottom; int stack_size; int overflow_arg_area; bool pass_by_stack; int stack_offset; int stack_align; // Static inline function bool is_live; bool is_root; StringArray refs; //for dwarf int file_no; // Index or number to identify the source file int line_no; // Line number where the variable or function is defined bool is_prototyped; // Whether the function is prototyped or not Initializer *init; bool is_address_used; bool is_param; char *cleanup_name; bool force_frame_pointer; Type *vla_ty; }; // Global variable can be initialized either by a constant expression // or a pointer to another global variable. This struct represents the // latter. typedef struct Relocation Relocation; struct Relocation { Relocation *next; int offset; char **label; long addend; }; // AST node typedef enum { ND_NULL_EXPR, // Do nothing ND_ADD, // + ND_SUB, // - ND_MUL, // * ND_DIV, // / ND_NEG, // unary - ND_MOD, // % ND_BITAND, // & ND_BITOR, // | ND_BITXOR, // ^ ND_SHL, // << ND_SHR, // >> ND_EQ, // == ND_NE, // != ND_LT, // < ND_LE, // <= ND_ASSIGN, // = ND_COND, // ?: ND_COMMA, // , ND_MEMBER, // . (struct member access) ND_ADDR, // unary & ND_DEREF, // unary * ND_NOT, // ! ND_BITNOT, // ~ ND_LOGAND, // && ND_LOGOR, // || ND_RETURN, // "return" ND_IF, // "if" ND_FOR, // "for" or "while" ND_DO, // "do" ND_SWITCH, // "switch" ND_CASE, // "case" ND_BLOCK, // { ... } ND_GOTO, // "goto" ND_GOTO_EXPR, // "goto" labels-as-values ND_LABEL, // Labeled statement ND_LABEL_VAL, // [GNU] Labels-as-values ND_FUNCALL, // Function call ND_EXPR_STMT, // Expression statement ND_STMT_EXPR, // Statement expression ND_VAR, // Variable ND_VLA_PTR, // VLA designator ND_NUM, // Integer ND_CAST, // Type cast ND_MEMZERO, // Zero-clear a stack variable ND_ASM, // "asm" ND_CAS, // Atomic compare-and-swap ND_EXCH, // Atomic exchange ND_CAS_N, //atomic compare-and-swap with value ND_EXCH_N, // Atomic exchange with value ND_CMPEXCH, ND_CMPEXCH_N, ND_LOAD, // Atomic load to pointer ND_LOAD_N, // Atomic load to result ND_STORE, // Atomic store to pointer ND_STORE_N, // Atomic store to result ND_TESTANDSET, // Sync lock test and set ND_TESTANDSETA, // Atomic lock test and set ND_CLEAR, // Atomic clear ND_RELEASE, // Atomic lock release ND_FETCHADD, // Atomic fetch and add ND_FETCHSUB, // Atomic fetch and sub ND_FETCHXOR, // Atomic fetch and xor ND_FETCHAND, // Atomic fetch and and ND_FETCHOR, // Atomic fetch and or ND_SUBFETCH, // Atomic sub and fetch ND_SYNC, //atomic synchronize ND_MEMBARRIER, // atomic thread/signal fence ND_BUILTIN_MEMCPY, //builtin memcpy ND_BUILTIN_MEMSET, //builtin memset ND_BUILTIN_CLZ, //builtin clz ND_BUILTIN_CLZL, //builtin clzl ND_BUILTIN_CLZLL, //builtin clzll ND_BUILTIN_CTZ, //builtin ctz ND_BUILTIN_CTZL, //builtin ctzl ND_BUILTIN_CTZLL, //builtin ctzll ND_POPCOUNT, //builtin popcount ND_EXPECT, //builtin expect ND_ABORT, //builtin abort ND_RETURN_ADDR, //builtin return address ND_BUILTIN_ADD_OVERFLOW, //builtin add overflow ND_BUILTIN_SUB_OVERFLOW, //builtin sub overflow ND_BUILTIN_MUL_OVERFLOW, //builtin mul overflow ND_UNREACHABLE, //builtin unreachable ND_ALLOC, //builtin alloca ND_BUILTIN_INFF, //builtin inff ND_BUILTIN_INF, //builtin inf ND_BUILTIN_NAN, //builtin nan ND_BUILTIN_NANF, //builtin nanf ND_BUILTIN_NANL, //builtin nanl ND_BUILTIN_ISNAN, //builtin isnan ND_BUILTIN_HUGE_VALL, //builtin huge vall ND_BUILTIN_HUGE_VALF, //builtin huge valf ND_BUILTIN_HUGE_VAL, //builtin huge val ND_BUILTIN_BSWAP16, //builtin bswap16 ND_BUILTIN_BSWAP32, //builtin bswap32 ND_BUILTIN_BSWAP64, //builtin bswap64, ND_BUILTIN_FRAME_ADDRESS, // builtin frame address ND_EMMS, ND_SFENCE, ND_LFENCE, ND_MFENCE, ND_PAUSE, ND_STMXCSR, ND_CVTPI2PS, ND_CVTPS2PI, ND_CLFLUSH, ND_VECINITV2SI, ND_VECEXTV2SI, ND_PACKSSWB, ND_PACKSSDW, ND_PACKUSWB, ND_PUNPCKHBW, ND_PUNPCKHWD, ND_PUNPCKHDQ, ND_PUNPCKLBW, ND_PUNPCKLWD, ND_PUNPCKLDQ, ND_PADDB, ND_PADDW, ND_PADDD, ND_PADDQ, ND_PADDSB, ND_PADDSW, ND_PADDUSB, ND_PADDUSW, ND_PSUBB, ND_PSUBW, ND_PSUBD, ND_PSUBQ, ND_PSUBSB, ND_PSUBSW, ND_PSUBUSB, ND_PSUBUSW, ND_PMADDWD, ND_PMULHW, ND_PMULLW, ND_PSLLW, ND_PSLLWI, ND_PSLLD, ND_PSLLDI, ND_PSLLQ, ND_PSLLQI, ND_PSRAW, ND_PSRAWI, ND_PSRAD, ND_PSRADI, ND_PSRLW, ND_PSRLWI, ND_PSRLD, ND_PSRLDI, ND_PSRLQ, ND_PSRLQI, ND_PAND, ND_PANDN, ND_POR, ND_PXOR, ND_PCMPEQB, ND_PCMPGTB, ND_PCMPEQW, ND_PCMPGTW, ND_PCMPEQD, ND_PCMPGTD, ND_VECINITV4HI, ND_VECINITV8QI, ND_ADDSS, ND_SUBSS, ND_MULSS, ND_DIVSS, ND_SQRTSS, ND_RCPSS, ND_RSQRTSS, ND_SQRTPS, ND_MINSS, ND_MAXSS, ND_RCPPS, ND_RSQRTPS, ND_MINPS, ND_MAXPS, ND_ANDPS, ND_ANDNPS, ND_ORPS, ND_XORPS, ND_CMPEQSS, ND_CMPLTSS, ND_CMPLESS, ND_MOVSS, ND_CMPNEQSS, ND_CMPNLTSS, ND_CMPNLESS, ND_CMPORDSS, ND_CMPUNORDSS, ND_CMPEQPS, ND_CMPLTPS, ND_CMPLEPS, ND_CMPGTPS, ND_CMPGEPS, ND_CMPNEQPS, ND_CMPNLTPS, ND_CMPNLEPS, ND_CMPNGTPS, ND_CMPNGEPS, ND_CMPORDPS, ND_CMPUNORDPS, ND_COMIEQ, ND_COMILT, ND_COMILE, ND_COMIGT, ND_COMIGE, ND_COMINEQ, ND_UCOMIEQ, ND_UCOMILT, ND_UCOMILE, ND_UCOMIGT, ND_UCOMIGE, ND_UCOMINEQ, ND_CVTSS2SI, ND_CVTSS2SI64, ND_CVTTSS2SI, ND_CVTTSS2SI64, ND_CVTTPS2PI, ND_CVTSI2SS, ND_CVTSI642SS, ND_MOVLHPS, ND_MOVHLPS, ND_UNPCKHPS, ND_UNPCKLPS, ND_LOADHPS, ND_STOREHPS, ND_LOADLPS, ND_STORELPS, ND_MOVMSKPS, ND_LDMXCSR, ND_SHUFPS, ND_SHUFFLE, ND_PMAXSW, ND_PMAXUB, ND_PMINSW, ND_PMINUB, ND_PMOVMSKB, ND_PMULHUW, ND_MASKMOVQ, ND_PAVGB, ND_PAVGW, ND_PSADBW, ND_MOVNTQ, ND_MOVNTPS, ND_SHUFPD, ND_VECEXTV4SI, ND_ADDSD, ND_SUBSD, ND_MULSD, ND_DIVSD, ND_SQRTPD, ND_MOVSD, ND_SQRTSD, ND_MINPD, ND_MINSD, ND_MAXPD, ND_MAXSD, ND_ANDPD, ND_ANDNPD, ND_ORPD, ND_XORPD, ND_CMPEQPD, ND_CMPLTPD, ND_CMPLEPD, ND_CMPGTPD, ND_CMPGEPD, ND_CMPNEQPD, ND_CMPNLTPD, ND_CMPNLEPD, ND_CMPNGTPD, ND_CMPNGEPD, ND_CMPORDPD, ND_CMPUNORDPD, ND_CMPEQSD, ND_CMPLTSD, ND_CMPLESD, ND_CMPNEQSD, ND_CMPNLTSD, ND_CMPNLESD, ND_CMPORDSD, ND_CMPUNORDSD, ND_COMISDEQ, ND_COMISDLT, ND_COMISDLE, ND_COMISDGT, ND_COMISDGE, ND_COMISDNEQ, ND_UCOMISDEQ, ND_UCOMISDLT, ND_UCOMISDLE, ND_UCOMISDGT, ND_UCOMISDGE, ND_UCOMISDNEQ, ND_MOVQ128, ND_CVTDQ2PD, ND_CVTDQ2PS, ND_CVTPD2DQ, ND_CVTPD2PI, ND_CVTPD2PS, ND_CVTTPD2DQ, ND_CVTTPD2PI, ND_CVTPI2PD, ND_CVTPS2DQ, ND_CVTTPS2DQ, ND_CVTPS2PD, ND_CVTSD2SI, ND_CVTSD2SI64, ND_CVTTSD2SI, ND_CVTTSD2SI64, ND_CVTSD2SS, ND_CVTSI2SD, ND_CVTSI642SD, ND_CVTSS2SD, ND_UNPCKHPD, ND_UNPCKLPD, ND_LOADHPD, ND_LOADLPD, ND_MOVMSKPD, ND_PACKSSWB128, ND_PACKSSDW128, ND_PACKUSWB128, ND_PUNPCKHBW128, ND_PUNPCKHWD128, ND_PUNPCKHDQ128, ND_PUNPCKHQDQ128, ND_PUNPCKLBW128, ND_PUNPCKLWD128, ND_PUNPCKLDQ128, ND_PUNPCKLQDQ128, ND_PADDSB128, ND_PADDSW128, ND_PADDUSB128, ND_PADDUSW128, ND_PSUBSB128, ND_PSUBSW128, ND_PSUBUSB128, ND_PSUBUSW128, ND_PMADDWD128, ND_PMULHW128, ND_PMULUDQ, ND_PMULUDQ128, ND_PSLLWI128, ND_PSLLDI128, ND_PSLLQI128, ND_PSRAWI128, ND_PSRADI128, ND_PSRLWI128, ND_PSRLDI128, ND_PSRLQI128, ND_PSLLW128, ND_PSLLD128, ND_PSLLQ128, ND_PSRAW128, ND_PSRAD128, ND_PSRLW128, ND_PSRLD128, ND_PSRLQ128, ND_PANDN128, ND_PMAXSW128, ND_PMAXUB128, ND_PMINSW128, ND_PMINUB128, ND_PMOVMSKB128, ND_PMULHUW128, ND_MASKMOVDQU, ND_PAVGB128, ND_PAVGW128, ND_PSADBW128, ND_MOVNTI, ND_MOVNTI64, ND_MOVNTDQ, ND_MOVNTPD, ND_POPCOUNTL, ND_POPCOUNTLL, ND_PARITY, ND_PARITYL, ND_PARITYLL, ND_UADD_OVERFLOW, ND_UADDL_OVERFLOW, ND_UADDLL_OVERFLOW, ND_UMUL_OVERFLOW, ND_UMULL_OVERFLOW, ND_UMULLL_OVERFLOW, ND_POS, ND_MWAIT, ND_MONITOR, ND_ADDSUBPS, ND_HADDPS, ND_HSUBPS, ND_MOVSHDUP, ND_MOVSLDUP, ND_ADDSUBPD, ND_HADDPD, ND_HSUBPD, ND_LDDQU, ND_PHADDW128, ND_PHADDD128, ND_PHADDSW128, ND_PHADDW, ND_PHADDD, ND_PHADDSW, ND_PHSUBW128, ND_PHSUBD128, ND_PHSUBSW128, ND_PHSUBW, ND_PHSUBD, ND_PHSUBSW, ND_PMADDUBSW128, ND_PMADDUBSW, ND_PMULHRSW128, ND_PMULHRSW, ND_PSHUFB128, ND_PSHUFB, ND_PSIGNB128, ND_PSIGNW128, ND_PSIGND128, ND_PSIGNB, ND_PSIGNW, ND_PSIGND, ND_PABSB128, ND_PABSW128, ND_PABSD128, ND_PABSB, ND_PABSW, ND_PABSD, ND_PTESTZ128, ND_PTESTC128, ND_PTESTNZC128, ND_PBLENDVB128, ND_BLENDVPS, ND_BLENDVPD, ND_PMINSB128, ND_PMAXSB128, ND_PMINUW128, ND_PMAXUW128, ND_PMINSD128, ND_PMAXSD128, ND_PMINUD128, ND_PMAXUD128, ND_PMULDQ128, ND_PHMINPOSUW128, ND_PMOVSXBD128, ND_PMOVSXWD128, ND_PMOVSXBQ128, ND_PMOVSXDQ128, ND_PMOVSXWQ128, ND_PMOVSXBW128, ND_PMOVZXBD128, ND_PMOVZXWD128, ND_PMOVZXBQ128, ND_PMOVZXBW128, ND_PMOVZXDQ128, ND_PMOVZXWQ128, ND_PACKUSDW128, ND_MOVNTDQA, ND_CRC32QI, ND_CRC32HI, ND_CRC32SI, ND_CRC32DI, ND_PSHUFD, ND_FETCHNAND, ND_ADD_AND_FETCH, ND_SUB_AND_FETCH, ND_BOOL_CAS, ND_PREFETCH, ND_RDTSC, ND_READEFLAGS_U64, ND_RDSSPQ, ND_SAVEPREVSSP, ND_SETSSBSY, ND_SLWPCB, ND_RDPKRU, ND_XBEGIN, ND_XEND, ND_SERIALIZE, ND_XSUSLDTRK, ND_XRESLDTRK, ND_CLUI, ND_STUI, ND_TESTUI, ND_WBNOINVD, ND_XTEST, ND_WBINVD, ND_RDPID, ND_RDFSBASE32, ND_RDFSBASE64, ND_RDGSBASE32, ND_RDGSBASE64, ND_VZEROALL, ND_VZEROUPPER, ND_FEMMS, ND_BSRSI, ND_RDPMC, ND_RDTSCP, ND_ROLQI, ND_ROLHI, ND_RORQI, ND_RORHI, ND_BSRDI, ND_WRITEEFLAGS_U64, ND_INCSSPQ, ND_RSTORSSP, ND_WRSSD, ND_WRSSQ, ND_WRUSSD, ND_WRUSSQ, ND_CLRSSBSY, ND_SBB_U32, ND_ADDCARRYX_U32, ND_SBB_U64, ND_ADDCARRYX_U64, ND_TZCNT_U16, ND_BEXTR_U32, ND_ADDFETCH, ND_ORFETCH, ND_ANDFETCH, ND_XORFETCH, ND_NANDFETCH, ND_FPCLASSIFY, // floating point classify ND_ISUNORDERED, ND_SIGNBIT, ND_SIGNBITF, ND_SIGNBITL, ND_ATOMIC_IS_LOCK_FREE, //builtin atomic is lock free ND_PSUBUSB256, ND_PCMPGTB256_MASK, ND_PSHUFB256, ND_PBLENDVB256, ND_PSRLDQI256, ND_PSLLDQI256, ND_VINSERTF128_SI256, ND_SI256_SI, ND_SI_SI256, ND_PALIGNR256, ND_VPERM2I128_SI256, ND_PBLENDD256, ND_VEXTRACTF128_SI256, ND_VECEXTV16QI, ND_VECEXTV8HI, ND_ANDNOTSI256, ND_VECEXTV2DI, ND_PMULHUW256, ND_PD256_PD, ND_PS256_PS, ND_PSRLQI256, ND_PSLLQI256, ND_PERMDI256, ND_PSLLDI256, ND_PSRLDI256, ND_PSRADI256, } NodeKind; // AST node type struct Node { NodeKind kind; // Node kind Node *next; // Next node Type *ty; // Type, e.g. int or pointer to int Token *tok; // Representative token Node *lhs; // Left-hand side Node *rhs; // Right-hand side // "if" or "for" statement Node *cond; Node *then; Node *els; Node *init; Node *inc; // "break" and "continue" labels char *brk_label; char *cont_label; // Block or statement expression Node *body; // Struct member access Member *member; // Function call Type *func_ty; Node *args; bool pass_by_stack; int stack_offset; // Offset for stack-passed arguments during function calls bool realign_stack; Obj *ret_buffer; // Goto or labeled statement, or labels-as-values char *label; char *unique_label; Node *goto_next; // Switch Node *case_next; Node *default_case; // Case long begin; long end; // "asm" string literal char *asm_str; char memorder; // Atomic compare-and-swap Node *cas_addr; Node *cas_old; Node *cas_new; //compare and exchange Node *cas_ptr; Node *cas_expected; Node *cas_desired; Node *cas_weak; Node *cas_success; Node *cas_failure; //for builtin memcpy Node *builtin_dest; Node *builtin_src; Node *builtin_size; Node *builtin_val; Node *builtin_args[MAX_BUILTIN_ARGS]; int builtin_nargs; // Atomic op= operators Obj *atomic_addr; Node *atomic_expr; // Atomic fetch operation bool atomic_fetch; // Variable Obj *var; // Numeric literal int64_t val; long double fval; FpClassify *fpc; // for dot diagram int unique_number; bool is_scalar_promoted; bool is_tail; }; typedef struct { Obj *var; Type *type_def; Type *enum_ty; int enum_val; } VarScope; Node *new_cast(Node *expr, Type *ty); int64_t const_expr(Token **rest, Token *tok); Obj *parse(Token *tok); VarScope *find_var(Token *tok); Obj *find_func(char *name); //from COSMOPOLITAN adding function ConsumeStringLiteral char *ConsumeStringLiteral(Token **rest, Token *tok) ; int64_t eval(Node *node); bool equal_tok(Token *a, Token *b); extern bool opt_fbuiltin; // // type.c // typedef enum { TY_VOID, TY_BOOL, TY_CHAR, TY_SHORT, TY_INT, TY_LONG, TY_FLOAT, TY_DOUBLE, TY_LDOUBLE, TY_ENUM, TY_PTR, TY_FUNC, TY_ARRAY, TY_VLA, // variable-length array TY_STRUCT, TY_UNION, TY_VECTOR, TY_INT128, TY_LLONG, } TypeKind; struct Type { TypeKind kind; int64_t size; // sizeof() value int align; // alignment bool is_unsigned; // unsigned or signed bool is_atomic; // true if _Atomic //from COSMOPOLITAN adding is_const, is_restrict, is_volatile bool is_const; // const bool is_restrict; // restrict bool is_volatile; // volatile //from COSMOPOLITAN adding is_ms_abi, is_static bool is_ms_abi; // microsoft abi bool is_static; // for array parameter pointer bool is_pointer; // true if it's a pointer Type *pointertype; // store the pointer type int, char... Type *origin; // for type compatibility check Type *decl_next; // forward declarations Token *tag; // Pointer-to or array-of type. We intentionally use the same member // to represent pointer/array duality in C. // // In many contexts in which a pointer is expected, we examine this // member instead of "kind" member to determine whether a type is a // pointer or not. That means in many contexts "array of T" is // naturally handled as if it were "pointer to T", as required by // the C spec. Type *base; // Declaration Token *name; Token *name_pos; Obj *param_var; // placeholder var for function parameter (used by VLA sizes) // Array int64_t array_len; //from COSMOPOLITAN adding vector_size int vector_size; // Variable-length array Node *vla_len; // # of elements Obj *vla_size; // sizeof() value Type *vla_param_ty; // original VLA type before array→pointer decay in func params // Struct Member *members; bool is_flexible; bool is_packed; bool has_vla; //from COSMOPOLITAN adding is_aligned bool is_aligned; bool is_weak; char *visibility; bool is_inline; int min_vector_width; bool is_compound_lit; // Flag to indicate if this type is a compound literal // Function type Type *return_ty; Type *params; bool is_variadic; bool is_oldstyle; Type *next; char *alias_name; // alias name for function when weak attribute char *section; bool is_constructor; bool is_destructor; int destructor_priority; int constructor_priority; bool is_vector; Token *tag_name; // struct/union/enum tag name }; struct DebugTypedef { DebugTypedef *next; char *name; Type *ty; }; // Struct member struct Member { Member *next; Type *ty; Token *tok; // for error message Token *name; int idx; // Natural alignment of the member's type (i.e. before any packing rules). int align; // Explicit requested alignment from attributes (_Alignas / __attribute__((aligned))). // This is a minimum alignment request and may override packing. int attr_align; int offset; // Bitfield bool is_bitfield; int bit_offset; int bit_width; }; extern Type *ty_void; extern Type *ty_void_ptr; extern Type *ty_bool; extern Type *ty_char; extern Type *ty_short; extern Type *ty_int; extern Type *ty_long; extern Type *ty_llong; extern Type *ty_uchar; extern Type *ty_ushort; extern Type *ty_uint; extern Type *ty_ulong; extern Type *ty_ullong; extern Type *ty_float; extern Type *ty_double; extern Type *ty_ldouble; extern Type *ty_int128; extern Type *ty_uint128; bool is_integer(Type *ty); bool is_flonum(Type *ty); bool is_numeric(Type *ty); bool is_builtin_canonical_type(Type *ty); bool is_compatible(Type *t1, Type *t2); bool is_compatible2(Type *t1, Type *t2); Type *copy_type(Type *ty); Type *pointer_to(Type *base); Type *func_type(Type *return_ty); Type *array_of(Type *base, int64_t size); Type *vector_of(Type *base, int64_t size); Type *vla_of(Type *base, Node *expr); Type *enum_type(void); Type *struct_type(void); void add_type(Node *node); bool is_bitfield(Node *node); bool is_array(Type *ty); Type *new_qualified_type(Type *ty); Type *unqual(Type *ty); bool is_vector(Type *ty); bool is_int128(Type *ty); bool is_pointer(Type *ty); bool is_const_expr(Node *node); bool contains_label(Node *node); extern DebugTypedef *debug_typedefs; char *nodekind2str(NodeKind kind); // // printast.c // void print_ast(FILE *, Obj *); // // debug.c // char *tokenkind2str(TokenKind kind); void print_debug_tokens(char *currentfilename, char *function, Token *tok); void emit_debug_info(Obj *prog); // // codegen.c // void codegen(Obj *prog, FILE *out); int align_to(int n, int align); char *reg_ax(int sz); char *reg_bx(int sz); char *reg_cx(int sz); char *reg_dx(int sz); char *reg_di(int sz); char *reg_si(int sz); char *reg_r8w(int sz); char *reg_r9w(int sz); char *reg_r10w(int sz); char *reg_r11w(int sz); char *reg_r12w(int sz); char *reg_r13w(int sz); char *reg_r14w(int sz); char *reg_r15w(int sz); void assign_lvar_offsets(Obj *prog); int add_register_used(char *regist); void clear_register_used(); char *register32_to_64(char *regist); char *register16_to_64(char *regist); char *register8_to_64(char *regist); char *register_available(); char *specific_register_available(char *regist); bool check_register_used(char *regist); void check_register_in_template(char *template); void pushreg(const char *arg); void gen_fpclassify(FpClassify *); void println(char *fmt, ...); int get_align(Obj *var); bool is_omit_fp(Obj *fn); extern bool dont_reuse_stack; // // unicode.c // int encode_utf8(char *buf, uint32_t c); uint32_t decode_utf8(char **new_pos, char *p); bool is_ident1(uint32_t c); bool is_ident2(uint32_t c); int display_width(char *p, int len); // // hashmap.c // typedef struct { char *key; int keylen; void *val; } HashEntry; typedef struct { HashEntry *buckets; int capacity; int used; } HashMap; void *hashmap_get(HashMap *map, char *key); void *hashmap_get2(HashMap *map, char *key, int keylen); void hashmap_put(HashMap *map, char *key, void *val); void hashmap_put2(HashMap *map, char *key, int keylen, void *val); void hashmap_delete(HashMap *map, char *key); void hashmap_delete2(HashMap *map, char *key, int keylen); void hashmap_test(void); // // main.c // typedef enum { // ISO modes STD_C89, STD_C99, STD_C11, STD_C17, STD_C23, // GNU modes STD_GNU89, STD_GNU99, STD_GNU11, STD_GNU17, STD_GNU23, } Standard; bool file_exists(char *path); void dump_machine(void); void dump_version(void); bool startsWith(const char *restrict string, const char *restrict prefix); extern StringArray include_paths; extern bool opt_fpic; extern bool opt_fpie; extern bool opt_shared; extern bool opt_fcommon; extern char *base_file; extern char *dot_file; extern char *opt_o; extern char *replace_extn(char *tmpl, char *extn); extern FILE *dotf; extern FILE *f; extern bool isDotfile; extern bool isDebug; extern bool printTokens; extern bool isPrintMacro; extern char *extract_filename(char *tmpl); extern char *extract_path(char *tmpl); extern bool opt_sse; extern bool opt_sse2; extern bool opt_sse3; extern bool opt_sse4; extern bool opt_mmx; extern bool opt_crc32; extern bool opt_g; extern FILE *open_file(char *path); extern FILE *ofile; extern Standard current_std; extern char *weak_symbols[MAX_WEAK]; extern int weak_count; extern bool opt_implicit; extern bool opt_werror; extern bool opt_optimize; extern bool opt_optimize_level1; extern bool opt_optimize_level2; extern bool opt_optimize_level3; extern bool opt_omit_frame_pointer; extern bool opt_avx2; extern bool opt_avx; // // extended_asm.c // char *extended_asm(Node *node, Token **rest, Token *tok, Obj *locals); void output_asm(Node *node, Token **rest, Token *tok, Obj *locals); void input_asm(Node *node, Token **rest, Token *tok, Obj *locals); char *subst_asm(char *template, char *output_str, char *input_str); char *string_replace(char *str, char *oldstr, char *newstr); char *generate_input_asm(char *input_str); bool check_template(char *template); int search_output_index(char c); char *int_to_string(int i); void update_offset(char *funcname, Obj *locals); char *load_variable(int order); char *generate_output_asm(char *output_str); char *opcode(int size); char *update_register_size(char *reg, int size); char *retrieve_output_index_str(char letter); int retrieve_output_index_from_letter(char letter); char *retrieveVariableNumber(int index); char *generate_input_for_output(void); char *generate_return_rax(Token *retval); chibicc-1.0.24/codegen.c000077500000000000000000006752671517770275000147770ustar00rootroot00000000000000#include "chibicc.h" #define GP_MAX 6 #define FP_MAX 8 static FILE *output_file; static int depth; static char *argreg8[] = {"%dil", "%sil", "%dl", "%cl", "%r8b", "%r9b"}; static char *argreg16[] = {"%di", "%si", "%dx", "%cx", "%r8w", "%r9w"}; static char *argreg32[] = {"%edi", "%esi", "%edx", "%ecx", "%r8d", "%r9d"}; static char *argreg64[] = {"%rdi", "%rsi", "%rdx", "%rcx", "%r8", "%r9"}; static char *newargreg8[] = {"%cl", "%dl", "%al", "%sil", "%dil", "%r8b", "%r9b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"}; static char *newargreg16[] = {"%cx", "%dx", "%ax", "%si", "%di", "%r8w", "%r9w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"}; static char *newargreg32[] = {"%ecx","%edx","%eax","%esi","%edi","%r8d", "%r9d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"}; static char *newargreg64[] = {"%rcx","%rdx","%rax","%rsi","%rdi","%r8", "%r9", "%r11", "%r12", "%r13", "%r14", "%r15"}; static char *registerUsed[] = {"free", "free", "free", "free", "free", "free", "free", "free", "free", "free", "free", "free"}; extern int64_t eval(Node *node); static Obj *current_fn; static char *lvar_ptr; bool dont_reuse_stack = false; extern bool opt_omit_frame_pointer; extern bool opt_fbuiltin; extern bool opt_optimize_level3; static void gen_expr(Node *node); static void gen_stmt(Node *node); static void print_offset(Obj *prog); int get_align(Obj *var) { int align = var->align; if (((var->ty->kind == TY_ARRAY || var->ty->kind == TY_STRUCT || var->ty->kind == TY_UNION) && var->ty->size >= 16) || is_vector(var->ty) || var->ty->kind == TY_INT128) align = MAX(16, align); return align; } static int cmp_ctor(const void *a, const void *b); static void emit_constructors(void); static void emit_destructors(void); static int vec_use_ymm(Type *ty); static int last_loc_line = -1; static int last_loc_file = -1; typedef struct CtorFunc { char *name; int priority; } CtorFunc; static CtorFunc *constructors[256]; static int constructor_cnt = 0; static CtorFunc *destructors[256]; static int destructor_cnt = 0; struct { int *data; int capacity; int depth; int bottom; } static tmp_stack; static char *sym(Obj *var) { return var->asmname ? var->asmname : var->name; } __attribute__((format(printf, 1, 2))) void println(char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(output_file, fmt, ap); va_end(ap); fprintf(output_file, "\n"); } static int count(void) { static int i = 1; return i++; } bool is_omit_fp(Obj *fn) { if (!opt_omit_frame_pointer) return false; if (fn->force_frame_pointer) return false; // ABI: The x86-64 System V ABI requires the stack to be 16-byte aligned before a call. // When omitting the frame pointer, %rsp is '8 mod 16' relative to entry. // chibicc's current local variable placement logic misaligns variables that need // 16-byte alignment in omit-fp mode. We must preserve the frame pointer for these cases // to ensure pointers passed to external assembly (like OpenSSL's movdqa) are correct. for (Obj *var = fn->locals; var; var = var->next) { if (get_align(var) > 8) return false; } for (Obj *var = fn->params; var; var = var->next) { if (get_align(var) > 8) return false; } if (fn->stack_align > 16) return false; return true; } static int push_tmpstack(void) { if (tmp_stack.depth == tmp_stack.capacity) { tmp_stack.capacity += 4; tmp_stack.data = realloc(tmp_stack.data, sizeof(int) * tmp_stack.capacity); } int offset; if (!dont_reuse_stack) { int bottom = current_fn->stack_size + (tmp_stack.depth + 1) * 8; tmp_stack.bottom = MAX(tmp_stack.bottom, bottom); offset = -bottom; } else { tmp_stack.bottom += 8; offset = -tmp_stack.bottom; } tmp_stack.data[tmp_stack.depth] = offset; tmp_stack.depth++; return offset; } static int pop_tmpstack(void) { tmp_stack.depth--; return tmp_stack.data[tmp_stack.depth]; } static int push_tmp(void) { if (is_omit_fp(current_fn)) { println(" push %%rax"); depth++; return 0; } int offset = push_tmpstack(); println(" mov %%rax, %d(%s)", offset, lvar_ptr); return offset; } static void pop_tmp(char *arg) { if (is_omit_fp(current_fn)) { println(" pop %s", arg); depth--; return; } int offset = pop_tmpstack(); println(" mov %d(%s), %s", offset, lvar_ptr, arg); } static void push_tmpf(void) { if (is_omit_fp(current_fn)) { println(" sub $16, %%rsp"); println(" movsd %%xmm0, 8(%%rsp)"); depth += 2; return; } int offset = push_tmpstack(); println(" movsd %%xmm0, %d(%s)", offset, lvar_ptr); } static void pop_tmpf(int reg) { if (is_omit_fp(current_fn)) { println(" movsd 8(%%rsp), %%xmm%d", reg); println(" add $16, %%rsp"); depth -= 2; return; } int offset = pop_tmpstack(); println(" movsd %d(%s), %%xmm%d", offset, lvar_ptr, reg); } static void push(void) { println(" push %%rax"); //temp hack for issue with openssl need to think about replacing push/pop by what gcc is doing //println(" mov %%rax, %%rdx"); depth++; } static void pop(char *arg) { println(" pop %s", arg); depth--; } static void pushf(void) { println(" sub $8, %%rsp"); println(" movsd %%xmm0, (%%rsp)"); depth++; } static void popf(int reg) { println(" movsd (%%rsp), %%xmm%d", reg); println(" add $8, %%rsp"); depth--; } static void pushld(void) { println(" sub $16, %%rsp"); println(" fstpt (%%rsp)"); depth += 2; } static void popld(void) { println(" fldt (%%rsp)"); println(" add $16, %%rsp"); depth -= 2; } static void pushv(void) { println(" sub $16, %%rsp"); println(" movdqu %%xmm0, (%%rsp)"); depth += 2; } static void popv(int reg) { println(" movdqu (%%rsp), %%xmm%d", reg); println(" add $16, %%rsp"); depth -= 2; } static void push_vec(Type *ty) { if (vec_use_ymm(ty)) { println(" sub $32, %%rsp"); println(" vmovdqu %%ymm0, (%%rsp)"); depth += 4; return; } pushv(); } static void pop_vec(Type *ty, int reg) { if (vec_use_ymm(ty)) { println(" vmovdqu (%%rsp), %%ymm%d", reg); println(" add $32, %%rsp"); depth -= 4; return; } popv(reg); } void pushx(void) { println(" push %%rdx"); println(" push %%rax"); depth++; depth++; } void popx(char *a, char *b) { println(" pop %s", a); println(" pop %s", b); depth--; depth--; } static void pushx_tmp(void) { if (is_omit_fp(current_fn)) { println(" push %%rdx"); println(" push %%rax"); depth += 2; return; } int off_rdx = push_tmpstack(); println(" mov %%rdx, %d(%s)", off_rdx, lvar_ptr); int off_rax = push_tmpstack(); println(" mov %%rax, %d(%s)", off_rax, lvar_ptr); } static void popx_tmp(char *a, char *b) { if (is_omit_fp(current_fn)) { println(" pop %s", a); println(" pop %s", b); depth -= 2; return; } int off_rax = pop_tmpstack(); println(" mov %d(%s), %s", off_rax, lvar_ptr, a); int off_rdx = pop_tmpstack(); println(" mov %d(%s), %s", off_rdx, lvar_ptr, b); } static void push_xmm(int x) { println(" sub $16, %%rsp"); println(" movdqu %%xmm%d, (%%rsp)", x); depth += 2; } static void pop_xmm(int x) { println(" movdqu (%%rsp), %%xmm%d", x); println(" add $16, %%rsp"); depth -= 2; } static void push_ymm(int x) { println(" sub $32, %%rsp"); println(" vmovdqu %%ymm%d, (%%rsp)", x); depth += 4; } static void pop_ymm(int x) { println(" vmovdqu (%%rsp), %%ymm%d", x); println(" add $32, %%rsp"); depth -= 4; } // Round up `n` to the nearest multiple of `align`. For instance, // align_to(5, 8) returns 8 and align_to(11, 8) returns 16. int align_to(int n, int align) { return ((n + align - 1) / align) * align; } static void print_visibility(Obj *obj) { if (obj->visibility) { if (!strcmp(obj->visibility, "hidden")) { println(" .hidden\t%s", sym(obj)); } else if (!strcmp(obj->visibility, "protected")) { println(" .protected %s", sym(obj)); } } if (obj->is_static) { println(" .local\t%s", sym(obj)); } else { println(" .globl\t%s", sym(obj)); } } char *reg_dx(int sz) { switch (sz) { case 1: return "%dl"; case 2: return "%dx"; case 4: return "%edx"; case 8: return "%rdx"; } return "%rdx"; } char *reg_di(int sz) { switch (sz) { case 1: return "%dil"; case 2: return "%di"; case 4: return "%edi"; case 8: return "%rdi"; } return "%rdi"; } char *reg_si(int sz) { switch (sz) { case 1: return "%sil"; case 2: return "%si"; case 4: return "%esi"; case 8: return "%rsi"; } return "%rsi"; } char *reg_r8w(int sz) { switch (sz) { case 1: return "%r8b"; case 2: return "%r8w"; case 4: return "%r8d"; case 8: return "%r8"; } return "%r8"; } char *reg_r9w(int sz) { switch (sz) { case 1: return "%r9b"; case 2: return "%r9w"; case 4: return "%r9d"; case 8: return "%r9"; } return "%r9"; } char *reg_r10w(int sz) { switch (sz) { case 1: return "%r10b"; case 2: return "%r10w"; case 4: return "%r10d"; case 8: return "%r10"; } return "%r10"; } char *reg_r11w(int sz) { switch (sz) { case 1: return "%r11b"; case 2: return "%r11w"; case 4: return "%r11d"; case 8: return "%r11"; } return "%r11"; } char *reg_r12w(int sz) { switch (sz) { case 1: return "%r12b"; case 2: return "%r12w"; case 4: return "%r12d"; case 8: return "%r12"; } return "%r12"; } char *reg_r13w(int sz) { switch (sz) { case 1: return "%r13b"; case 2: return "%r13w"; case 4: return "%r13d"; case 8: return "%r13"; } return "%r13"; } char *reg_r14w(int sz) { switch (sz) { case 1: return "%r14b"; case 2: return "%r14w"; case 4: return "%r14d"; case 8: return "%r14"; } return "%r14"; } char *reg_r15w(int sz) { switch (sz) { case 1: return "%r15b"; case 2: return "%r15w"; case 4: return "%r15d"; case 8: return "%r15"; } return "%r15"; } char *reg_bx(int sz) { switch (sz) { case 1: return "%bl"; case 2: return "%bx"; case 4: return "%ebx"; case 8: return "%rbx"; } return "%rbx"; } char *reg_cx(int sz) { switch (sz) { case 1: return "%cl"; case 2: return "%cx"; case 4: return "%ecx"; case 8: return "%rcx"; } return "%rcx"; } char *reg_ax(int sz) { switch (sz) { case 1: return "%al"; case 2: return "%ax"; case 4: return "%eax"; case 8: return "%rax"; } return "%rax"; } // Compute the absolute address of a given node. // It's an error if a given node does not reside in memory. static void gen_addr(Node *node) { switch (node->kind) { case ND_VAR: // Variable-length array, which is always local. if (node->var->ty->kind == TY_VLA) { if (!node->var->ptr) error("%s:%d: error: in gen_addr : VLA pointer is null", __FILE__, __LINE__); if (is_omit_fp(current_fn)) println(" mov %d(%%rsp), %%rax", node->var->offset + current_fn->stack_size + depth * 8); else println(" mov %d(%s), %%rax", node->var->offset, node->var->ptr); return; } // Local variable if (node->var->is_local) { if (!node->var->ptr) error("%s:%d: error: in gen_addr : VLA pointer is null", __FILE__, __LINE__); if (is_omit_fp(current_fn)) println(" lea %d(%%rsp), %%rax", node->var->offset + current_fn->stack_size + depth * 8); else println(" lea %d(%s), %%rax", node->var->offset, node->var->ptr); return; } if (opt_fpic) { // Thread-local variable if (node->var->is_tls) { println(" data16 lea \"%s\"@tlsgd(%%rip), %%rdi", sym(node->var)); println(" .value 0x6666"); println(" rex64"); println(" call __tls_get_addr@PLT"); return; } // Function or global variable println(" mov \"%s\"@GOTPCREL(%%rip), %%rax", sym(node->var)); return; } // Thread-local variable if (node->var->is_tls) { println(" mov %%fs:0, %%rax"); if (node->var->is_definition) println(" add $\"%s\"@tpoff, %%rax", sym(node->var)); else println(" add %s@gottpoff(%%rip), %%rax", sym(node->var)); return; } // Here, we generate an absolute address of a function or a global // variable. Even though they exist at a certain address at runtime, // their addresses are not known at link-time for the following // two reasons. // // - Address randomization: Executables are loaded to memory as a // whole but it is not known what address they are loaded to. // Therefore, at link-time, relative address in the same // exectuable (i.e. the distance between two functions in the // same executable) is known, but the absolute address is not // known. // // - Dynamic linking: Dynamic shared objects (DSOs) or .so files // are loaded to memory alongside an executable at runtime and // linked by the runtime loader in memory. We know nothing // about addresses of global stuff that may be defined by DSOs // until the runtime relocation is complete. // // In order to deal with the former case, we use RIP-relative // addressing, denoted by `(%rip)`. For the latter, we obtain an // address of a stuff that may be in a shared object file from the // Global Offset Table using `@GOTPCREL(%rip)` notation. // Function if (node->ty->kind == TY_FUNC) { if (node->var->is_definition) println(" lea \"%s\"(%%rip), %%rax", sym(node->var)); else println(" mov \"%s\"@GOTPCREL(%%rip), %%rax", sym(node->var)); return; } // Global variable println(" lea \"%s\"(%%rip), %%rax", sym(node->var)); return; case ND_DEREF: gen_expr(node->lhs); return; case ND_COMMA: gen_expr(node->lhs); gen_addr(node->rhs); return; case ND_MEMBER: //fix from @fuhsnn on some issues with members switch(node->lhs->kind) { case ND_FUNCALL: if (!node->lhs->ret_buffer) break; case ND_ASSIGN: case ND_COND: case ND_STMT_EXPR: if (node->lhs->ty->kind != TY_STRUCT && node->lhs->ty->kind != TY_UNION) break; gen_expr(node->lhs); println(" add $%d, %%rax", node->member->offset); return; default: gen_addr(node->lhs); println(" add $%d, %%rax", node->member->offset); return; } case ND_FUNCALL: if (node->ret_buffer) { gen_expr(node); return; } break; case ND_ASSIGN: case ND_COND: if (node->ty->kind == TY_STRUCT || node->ty->kind == TY_UNION ) { gen_expr(node); return; } break; case ND_VLA_PTR: if (is_omit_fp(current_fn)) println(" lea %d(%%rsp), %%rax", node->var->offset + current_fn->stack_size + depth * 8); else println(" lea %d(%s), %%rax", node->var->offset, node->var->ptr); return; case ND_ADD: case ND_SUB: case ND_MUL: case ND_DIV: case ND_BITXOR: case ND_BITAND: case ND_BITOR: if (is_vector(node->lhs->ty) || (node->rhs && is_vector(node->rhs->ty))) { gen_expr(node->lhs); gen_expr(node->rhs); return; } return; case ND_CAST: if (is_vector(node->ty)) { gen_expr(node); return; } return; } error_tok(node->tok, "%s:%d not an lvalue %d", __FILE__, __LINE__, node->kind); } // Copy n bytes from the source address in %rax to the destination in dst_reg. static void gen_mem_copy(const char *dst_reg, int n) { int i = 0; while (n >= 8) { println(" movq %d(%%rax), %%r10", i); println(" movq %%r10, %d(%s)", i, dst_reg); n -= 8; i += 8; } while (n >= 4) { println(" movl %d(%%rax), %%r10d", i); println(" movl %%r10d, %d(%s)", i, dst_reg); n -= 4; i += 4; } while (n >= 2) { println(" movw %d(%%rax), %%r10w", i); println(" movw %%r10w, %d(%s)", i, dst_reg); n -= 2; i += 2; } while (n >= 1) { println(" movb %d(%%rax), %%r10b", i); println(" movb %%r10b, %d(%s)", i, dst_reg); --n; ++i; } } // Copy n bytes from %rax to dst_reg + offset static void gen_mem_copy_with_offset(const char *dst_reg, int offset, int n) { int i = 0; while (n >= 8) { println(" movq %d(%%rax), %%r10", i); println(" movq %%r10, %d(%s)", offset + i, dst_reg); n -= 8; i += 8; } while (n >= 4) { println(" movl %d(%%rax), %%r10d", i); println(" movl %%r10d, %d(%s)", offset + i, dst_reg); n -= 4; i += 4; } while (n >= 2) { println(" movw %d(%%rax), %%r10w", i); println(" movw %%r10w, %d(%s)", offset + i, dst_reg); n -= 2; i += 2; } while (n >= 1) { println(" movb %d(%%rax), %%r10b", i); println(" movb %%r10b, %d(%s)", offset + i, dst_reg); --n; ++i; } } // Zero n bytes starting from offset bytes off %rbp. static void gen_mem_zero(int offset, int n) { int i = offset; if (is_omit_fp(current_fn)) i += current_fn->stack_size + depth * 8; while (n >= 8) { if (is_omit_fp(current_fn)) println(" movq $0, %d(%%rsp)", i); else println(" movq $0, %d(%s)", i, lvar_ptr); n -= 8; i += 8; } while (n >= 4) { if (is_omit_fp(current_fn)) println(" movl $0, %d(%%rsp)", i); else println(" movl $0, %d(%s)", i, lvar_ptr); n -= 4; i += 4; } while (n >= 2) { if (is_omit_fp(current_fn)) println(" movw $0, %d(%%rsp)", i); else println(" movw $0, %d(%s)", i, lvar_ptr); n -= 2; i += 2; } while (n >= 1) { if (is_omit_fp(current_fn)) println(" movb $0, %d(%%rsp)", i); else println(" movb $0, %d(%s)", i, lvar_ptr); --n; ++i; } } static int vec_use_ymm(Type *ty) { return ty->size > 16; } // Load a value from where %rax is pointing to. static void load(Type *ty) { if (!ty) error("%s:%d: error: in load : ty is null!", __FILE__, __LINE__); switch (ty->kind) { case TY_VECTOR: { if (vec_use_ymm(ty)) { if (ty->align < 32) { if (ty->base->kind == TY_FLOAT || ty->base->kind == TY_DOUBLE) println(" vmovups (%%rax), %%ymm0"); else println(" vmovdqu (%%rax), %%ymm0"); } else { if (ty->base->kind == TY_FLOAT || ty->base->kind == TY_DOUBLE) println(" vmovaps (%%rax), %%ymm0"); else println(" vmovdqa (%%rax), %%ymm0"); } } else { if (ty->align < 16) { if (ty->base->kind == TY_FLOAT || ty->base->kind == TY_DOUBLE) println(" vmovups (%%rax), %%xmm0"); else println(" vmovdqu (%%rax), %%xmm0"); } else { if (ty->base->kind == TY_FLOAT || ty->base->kind == TY_DOUBLE) println(" vmovaps (%%rax), %%xmm0"); else println(" vmovdqa (%%rax), %%xmm0"); } } return; } case TY_ARRAY: case TY_STRUCT: case TY_UNION: case TY_FUNC: case TY_VLA: // If it is an array, do not attempt to load a value to the // register because in general we can't load an entire array to a // register. As a result, the result of an evaluation of an array // becomes not the array itself but the address of the array. // This is where "array is automatically converted to a pointer to // the first element of the array in C" occurs. return; case TY_FLOAT: println(" movss (%%rax), %%xmm0"); return; case TY_DOUBLE: println(" movsd (%%rax), %%xmm0"); return; case TY_LDOUBLE: println(" fldt (%%rax)"); return; case TY_INT128: println(" mov 8(%%rax), %%rdx"); // Load upper 64 bits into RDX println(" mov (%%rax), %%rax"); // Load lower 64 bits into RAX return; } char *insn = ty->is_unsigned ? "movz" : "movs"; // When we load a char or a short value to a register, we always // extend them to the size of int, so we can assume the lower half of // a register always contains a valid value. The upper half of a // register for char, short and int may contain garbage. When we load // a long value to a register, it simply occupies the entire register. if (ty->size == 1) println(" %sbl (%%rax), %%eax", insn); else if (ty->size == 2) println(" %swl (%%rax), %%eax", insn); else if (ty->size == 4) { if (ty->is_unsigned) println(" movl (%%rax), %%eax"); else println(" movsxd (%%rax), %%rax"); } else println(" mov (%%rax), %%rax"); } // Store %rax to an address that the stack top is pointing to. static void store(Type *ty) { if (!ty) error("%s:%d: in store : ty is null!", __FILE__, __LINE__); pop_tmp("%rdi"); switch (ty->kind) { case TY_VECTOR: if (vec_use_ymm(ty)) { if (ty->align < 32) { if (ty->base->kind == TY_FLOAT || ty->base->kind == TY_DOUBLE) println(" vmovups %%ymm0, (%%rdi)"); else println(" vmovdqu %%ymm0, (%%rdi)"); } else { if (ty->base->kind == TY_FLOAT || ty->base->kind == TY_DOUBLE) println(" vmovaps %%ymm0, (%%rdi)"); else println(" vmovdqa %%ymm0, (%%rdi)"); } } else { if (ty->align < 16) { if (ty->base->kind == TY_FLOAT || ty->base->kind == TY_DOUBLE) println(" vmovups %%xmm0, (%%rdi)"); else println(" vmovdqu %%xmm0, (%%rdi)"); } else { if (ty->base->kind == TY_FLOAT || ty->base->kind == TY_DOUBLE) println(" vmovaps %%xmm0, (%%rdi)"); else println(" vmovdqa %%xmm0, (%%rdi)"); } } return; case TY_STRUCT: case TY_UNION: gen_mem_copy("%rdi", ty->size); println(" mov %%rdi, %%rax"); return; case TY_FLOAT: println(" movss %%xmm0, (%%rdi)"); return; case TY_DOUBLE: println(" movsd %%xmm0, (%%rdi)"); return; case TY_LDOUBLE: println(" fld %%st(0)"); println(" fstpt (%%rdi)"); return; case TY_INT128: println(" mov %%rax, (%%rdi)"); println(" mov %%rdx, 8(%%rdi)"); return; } if (ty->size == 1) println(" mov %%al, (%%rdi)"); else if (ty->size == 2) println(" mov %%ax, (%%rdi)"); else if (ty->size == 4) println(" mov %%eax, (%%rdi)"); else println(" mov %%rax, (%%rdi)"); } static void cmp_zero(Type *ty) { if (!ty) error("%s:%d: in cmp_zero : ty is null!", __FILE__, __LINE__); switch (ty->kind) { case TY_FLOAT: println(" xorps %%xmm1, %%xmm1"); println(" ucomiss %%xmm1, %%xmm0"); return; case TY_DOUBLE: println(" xorpd %%xmm1, %%xmm1"); println(" ucomisd %%xmm1, %%xmm0"); return; case TY_LDOUBLE: println(" fldz"); println(" fucomip"); println(" fstp %%st(0)"); return; case TY_INT128: println(" mov %%rax, %%r11"); println(" or %%rdx, %%r11"); return; } if (is_integer(ty) && ty->size <= 4) println(" cmp $0, %%eax"); else println(" cmp $0, %%rax"); } #define REDZONE(X) \ "sub\t$16,%rsp\n" \ "\t" X "\n" \ "\tadd\t$16,%rsp" #define i8i128 "movsbq\t%al,%rax\n\tcqto" #define i16i128 "movswq\t%ax,%rax\n\tcqto" #define i32i128 "cltq\n\tcqto" #define i64i128 "cqto" #define u8i128 "movzbq\t%al,%rax\n\txor\t%edx,%edx" #define u16i128 "movzwq\t%ax,%rax\n\txor\t%edx,%edx" #define u32i128 "mov\t%eax,%eax\n\txor\t%edx,%edx" #define u64i128 "xor\t%edx,%edx" #define i128f32 "mov\t%rax,%rdi\n\tmov\t%rdx,%rsi\n\tcall\t__floattisf" #define i128f64 "mov\t%rax,%rdi\n\tmov\t%rdx,%rsi\n\tcall\t__floattidf" #define i128f80 "mov\t%rax,%rdi\n\tmov\t%rdx,%rsi\n\tcall\t__floattixf" #define u128f32 "mov\t%rax,%rdi\n\tmov\t%rdx,%rsi\n\tcall\t__floatuntisf" #define u128f64 "mov\t%rax,%rdi\n\tmov\t%rdx,%rsi\n\tcall\t__floatuntidf" #define u128f80 "mov\t%rax,%rdi\n\tmov\t%rdx,%rsi\n\tcall\t__floatuntixf" #define f32i128 "call\t__fixsfti" #define f64i128 "call\t__fixdfti" #define f80i128 REDZONE("fstpt\t(%rsp)\n\tcall\t__fixxfti") #define f32u128 "call\t__fixunssfti" #define f64u128 "call\t__fixunsdfti" #define f80u128 REDZONE("fstpt\t(%rsp)\n\tcall\t__fixunsxfti") enum { I8, I16, I32, I64, U8, U16, U32, U64, F32, F64, F80, I128, U128, }; static int getTypeId(Type *ty) { if (!ty) return I32; switch (ty->kind) { case TY_CHAR: return ty->is_unsigned ? U8 : I8; case TY_SHORT: return ty->is_unsigned ? U16 : I16; case TY_INT: return ty->is_unsigned ? U32 : I32; case TY_LONG: case TY_LLONG: return ty->is_unsigned ? U64 : I64; case TY_INT128: return ty->is_unsigned ? U128 : I128; case TY_FLOAT: return F32; case TY_DOUBLE: return F64; case TY_LDOUBLE: return F80; } return U64; } // The table for type casts static char i32i8[] = "movsbl %al, %eax"; static char i32u8[] = "movzbl %al, %eax"; static char i32i16[] = "movswl %ax, %eax"; static char i32u16[] = "movzwl %ax, %eax"; static char i32f32[] = "cvtsi2ssl %eax, %xmm0"; static char i32i64[] = "movslq %eax, %rax"; static char i32f64[] = "cvtsi2sdl %eax, %xmm0"; static char i32f80[] = "mov %eax, -4(%rsp); fildl -4(%rsp)"; static char u32f32[] = "mov %eax, %eax; cvtsi2ssq %rax, %xmm0"; static char u32i64[] = "mov %eax, %eax"; static char u32f64[] = "mov %eax, %eax; cvtsi2sdq %rax, %xmm0"; static char u32f80[] = "mov %eax, %eax; mov %rax, -8(%rsp); fildll -8(%rsp)"; static char i64f32[] = "cvtsi2ssq %rax, %xmm0"; static char i64f64[] = "cvtsi2sdq %rax, %xmm0"; static char i64f80[] = "movq %rax, -8(%rsp); fildll -8(%rsp)"; static char u64f32[] = "test %rax,%rax; js 1f; pxor %xmm0,%xmm0; cvtsi2ss %rax,%xmm0; jmp 2f; " "1: mov %rax,%rdi; and $1,%eax; pxor %xmm0,%xmm0; shr %rdi; " "or %rax,%rdi; cvtsi2ss %rdi,%xmm0; addss %xmm0,%xmm0; 2:"; static char u64f64[] = "test %rax,%rax; js 1f; pxor %xmm0,%xmm0; cvtsi2sd %rax,%xmm0; jmp 2f; " "1: mov %rax,%rdi; and $1,%eax; pxor %xmm0,%xmm0; shr %rdi; " "or %rax,%rdi; cvtsi2sd %rdi,%xmm0; addsd %xmm0,%xmm0; 2:"; static char u64f80[] = "mov %rax, -8(%rsp); fildq -8(%rsp); test %rax, %rax; jns 1f;" "mov $1602224128, %eax; mov %eax, -4(%rsp); fadds -4(%rsp); 1:"; static char f32i8[] = "cvttss2sil %xmm0, %eax; movsbl %al, %eax"; static char f32u8[] = "cvttss2sil %xmm0, %eax; movzbl %al, %eax"; static char f32i16[] = "cvttss2sil %xmm0, %eax; movswl %ax, %eax"; static char f32u16[] = "cvttss2sil %xmm0, %eax; movzwl %ax, %eax"; static char f32i32[] = "cvttss2sil %xmm0, %eax"; static char f32u32[] = "cvttss2siq %xmm0, %rax"; static char f32i64[] = "cvttss2siq %xmm0, %rax"; static char f32u64[] = "cvttss2siq %xmm0, %rcx; movq %rcx, %rdx; movl $0x5F000000, %eax; " "movd %eax, %xmm1; subss %xmm1, %xmm0; cvttss2siq %xmm0, %rax; " "sarq $63, %rdx; andq %rdx, %rax; orq %rcx, %rax;"; static char f32f64[] = "cvtss2sd %xmm0, %xmm0"; static char f32f80[] = "movss %xmm0, -4(%rsp); flds -4(%rsp)"; static char f64i8[] = "cvttsd2sil %xmm0, %eax; movsbl %al, %eax"; static char f64u8[] = "cvttsd2sil %xmm0, %eax; movzbl %al, %eax"; static char f64i16[] = "cvttsd2sil %xmm0, %eax; movswl %ax, %eax"; static char f64u16[] = "cvttsd2sil %xmm0, %eax; movzwl %ax, %eax"; static char f64i32[] = "cvttsd2sil %xmm0, %eax"; static char f64u32[] = "cvttsd2siq %xmm0, %rax"; static char f64i64[] = "cvttsd2siq %xmm0, %rax"; static char f64u64[] = "cvttsd2siq %xmm0, %rcx; movq %rcx, %rdx; mov $0x43e0000000000000, %rax; " "movq %rax, %xmm1; subsd %xmm1, %xmm0; cvttsd2siq %xmm0, %rax; " "sarq $63, %rdx; andq %rdx, %rax; orq %rcx, %rax"; static char f64f32[] = "cvtsd2ss %xmm0, %xmm0"; static char f64f80[] = "movsd %xmm0, -8(%rsp); fldl -8(%rsp)"; #define FROM_F80_1 \ "fnstcw -10(%rsp); movzwl -10(%rsp), %eax; or $12, %ah; " \ "mov %ax, -12(%rsp); fldcw -12(%rsp); " #define FROM_F80_2 " -24(%rsp); fldcw -10(%rsp); " static char f80i8[] = FROM_F80_1 "fistps" FROM_F80_2 "movsbl -24(%rsp), %eax"; static char f80u8[] = FROM_F80_1 "fistps" FROM_F80_2 "movzbl -24(%rsp), %eax"; static char f80i16[] = FROM_F80_1 "fistps" FROM_F80_2 "movzbl -24(%rsp), %eax"; static char f80u16[] = FROM_F80_1 "fistpl" FROM_F80_2 "movswl -24(%rsp), %eax"; static char f80i32[] = FROM_F80_1 "fistpl" FROM_F80_2 "mov -24(%rsp), %eax"; static char f80u32[] = FROM_F80_1 "fistpl" FROM_F80_2 "mov -24(%rsp), %eax"; static char f80i64[] = FROM_F80_1 "fistpq" FROM_F80_2 "mov -24(%rsp), %rax"; static char f80u64[] = "movl $0x5f000000, -4(%rsp); flds -4(%rsp); fucomi %st(1), %st; setbe %al;" "fldz; fcmovbe %st(1), %st; fstp %st(1); fsubrp %st, %st(1); fnstcw -12(%rsp);" "movzwl -12(%rsp), %ecx; orl $3072, %ecx; movw %cx, -10(%rsp); fldcw -10(%rsp);" "fistpll -8(%rsp); fldcw -12(%rsp); shlq $63, %rax; xorq -8(%rsp), %rax;"; static char f80f32[] = "fstps -8(%rsp); movss -8(%rsp), %xmm0"; static char f80f64[] = "fstpl -8(%rsp); movsd -8(%rsp), %xmm0"; static const char *const cast_table[13][13] = /* clang-format off */ { // i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 f80 i128 u128 {NULL, NULL, NULL, i32i64, i32u8, i32u16, NULL, i32i64, i32f32, i32f64, i32f80, i32i128, i32i128}, // i8 {i32i8, NULL, NULL, i32i64, i32u8, i32u16, NULL, i32i64, i32f32, i32f64, i32f80, i32i128, i32i128}, // i16 {i32i8, i32i16, NULL, i32i64, i32u8, i32u16, NULL, i32i64, i32f32, i32f64, i32f80, i32i128, i32i128}, // i32 {i32i8, i32i16, NULL, NULL, i32u8, i32u16, NULL, NULL, i64f32, i64f64, i64f80, i64i128, i64i128}, // i64 {i32i8, NULL, NULL, i32i64, NULL, NULL, NULL, i32i64, i32f32, i32f64, i32f80, i32i128, i32i128}, // u8 {i32i8, i32i16, NULL, i32i64, i32u8, NULL, NULL, i32i64, i32f32, i32f64, i32f80, i32i128, i32i128}, // u16 {i32i8, i32i16, NULL, u32i64, i32u8, i32u16, NULL, u32i64, u32f32, u32f64, u32f80, u32i128, u32i128}, // u32 {i32i8, i32i16, NULL, NULL, i32u8, i32u16, NULL, NULL, u64f32, u64f64, u64f80, u64i128, u64i128}, // u64 {f32i8, f32i16, f32i32, f32i64, f32u8, f32u16, f32u32, f32u64, NULL, f32f64, f32f80, f32i128, f32u128}, // f32 {f64i8, f64i16, f64i32, f64i64, f64u8, f64u16, f64u32, f64u64, f64f32, NULL, f64f80, f64i128, f64u128}, // f64 {f80i8, f80i16, f80i32, f80i64, f80u8, f80u16, f80u32, f80u64, f80f32, f80f64, NULL, f80i128, f80u128}, // f80 {i32i8, i32i16, NULL, NULL, i32u8, i32u16, NULL, NULL, i128f32, i128f64, i128f80, NULL, NULL }, // i128 {i32i8, i32i16, NULL, NULL, i32u8, i32u16, NULL, NULL, u128f32, u128f64, u128f80, NULL, NULL }, // u128 } /* clang-format on */; static void cast(Type *from, Type *to) { if (!to) error("%s:%d: in cast : to type is null!", __FILE__, __LINE__); if (!from) from = copy_type(to); if (to->kind == TY_VOID) return; if (to->kind == TY_BOOL) { cmp_zero(from); if (is_flonum(from)) { println(" setne %%al"); println(" setp %%dl"); println(" or %%dl, %%al"); } else { println(" setne %%al"); } println(" movzx %%al, %%eax"); return; } if (is_vector(from) ||is_vector(to)) return; int t1 = getTypeId(from); int t2 = getTypeId(to); if (cast_table[t1][t2]) println(" %s", cast_table[t1][t2]); } // Returns true if 'ty' is or contains a pointer (recursively) static bool has_pointer(Type *ty) { if (!ty) return false; switch (ty->kind) { case TY_PTR: return true; case TY_VECTOR: case TY_ARRAY: return has_pointer(ty->base); case TY_STRUCT: case TY_UNION: { for (Member *mem = ty->members; mem; mem = mem->next) { if (has_pointer(mem->ty)) return true; } return false; } default: return false; } } // Structs or unions equal or smaller than 16 bytes are passed // using up to two registers. // // If the first 8 bytes contains only floating-point type members, // they are passed in an XMM register. Otherwise, they are passed // in a general-purpose register. // // If a struct/union is larger than 8 bytes, the same rule is // applied to the the next 8 byte chunk. // // This function returns true if `ty` has only floating-point // members in its byte range [lo, hi). static bool has_flonum(Type *ty, int lo, int hi, int offset) { if (ty->is_variadic && (ty->kind == TY_STRUCT || ty->kind == TY_UNION)) return false; if (ty->kind == TY_STRUCT || ty->kind == TY_UNION) { for (Member *mem = ty->members; mem; mem = mem->next) { int tmpoffset = offset + mem->offset; if ((tmpoffset + mem->ty->size) <= lo) continue; if (hi <= tmpoffset) break; if (!has_flonum(mem->ty, lo, hi, tmpoffset)) return false; } return true; } if (ty->kind == TY_ARRAY) { for (int i = 0; i < ty->array_len; i++) { int tmpoffset = offset + ty->base->size * i; if ((tmpoffset + ty->base->size) <= lo) continue; if (hi <= tmpoffset) break; if (!has_flonum(ty->base, lo, hi, tmpoffset)) return false; } return true; } if (ty->kind == TY_VECTOR) return true; return ty->kind == TY_FLOAT || ty->kind == TY_DOUBLE; } static bool has_flonum1(Type *ty) { return has_flonum(ty, 0, 8, 0); } static bool has_flonum2(Type *ty) { return has_flonum(ty, 8, 16, 0); } static bool has_longdouble(Type *ty) { if (!ty) return false; if (ty->kind == TY_LDOUBLE) return true; if (ty->kind != TY_STRUCT && ty->kind != TY_UNION) return false; for (Member *mem = ty->members; mem; mem = mem->next) { if (has_longdouble(mem->ty)) return true; } return false; } static bool pass_by_reg(Type *ty, int gp, int fp) { if (ty->size > 16) return false; if (has_longdouble(ty)) return false; int fp_inc = has_flonum1(ty) + (ty->size > 8 && has_flonum2(ty)); int gp_inc = !has_flonum1(ty) + (ty->size > 8 && !has_flonum2(ty)); if (fp_inc && (fp + fp_inc > FP_MAX)) return false; if (gp_inc && (gp + gp_inc > GP_MAX)) return false; if (ty->is_variadic && !has_flonum1(ty) && !has_pointer(ty)) return false; return true; } static void push_struct(Node *arg) { Type *ty = arg->ty; int min_align = has_longdouble(ty) ? 16 : 8; int align = MAX(ty->align, min_align); if (arg->pass_by_stack && arg->stack_offset >= 0) { gen_mem_copy_with_offset("%rsp", arg->stack_offset, ty->size); } else { int size = align_to(ty->size, align); println(" sub $%d, %%rsp", size); depth += size / 8; gen_mem_copy("%rsp", ty->size); } } static void push_args2(Node *args, bool first_pass) { if (!args) return; push_args2(args->next, first_pass); if (first_pass != args->pass_by_stack) return; gen_expr(args); if (first_pass) { switch (args->ty->kind) { case TY_STRUCT: case TY_UNION: if (args->ty->size == 0) return; push_struct(args); break; case TY_FLOAT: println(" movss %%xmm0, %d(%%rsp)", args->stack_offset); break; case TY_DOUBLE: println(" movsd %%xmm0, %d(%%rsp)", args->stack_offset); break; case TY_VECTOR: if (vec_use_ymm(args->ty)) println(" vmovdqu %%ymm0, %d(%%rsp)", args->stack_offset); else println(" movdqu %%xmm0, %d(%%rsp)", args->stack_offset); break; case TY_LDOUBLE: println(" fstpt %d(%%rsp)", args->stack_offset); break; case TY_INT128: println(" mov %%rax, %d(%%rsp)", args->stack_offset); println(" mov %%rdx, %d(%%rsp)", args->stack_offset + 8); break; default: println(" mov %%rax, %d(%%rsp)", args->stack_offset); } } else { switch (args->ty->kind) { case TY_STRUCT: case TY_UNION: if (args->ty->size == 0) return; push_struct(args); break; case TY_VECTOR: push_vec(args->ty); break; case TY_FLOAT: case TY_DOUBLE: pushf(); break; case TY_LDOUBLE: println(" sub $16, %%rsp"); println(" fstpt (%%rsp)"); depth += 2; break; case TY_INT128: pushx(); break; default: push(); } } } // Calculate stack offsets for stack-passed arguments taking in account the alignment static void calculate_stack_offsets(Node *args, int *stack_offset, int *max_align) { for (Node *arg = args; arg; arg = arg->next) { if (!arg->pass_by_stack) { arg->stack_offset = -1; continue; } Type *ty = arg->ty; int align = MAX(ty->align, 8); *max_align = MAX(*max_align, align); *stack_offset = align_to(*stack_offset, align); arg->stack_offset = *stack_offset; int arg_size = align_to(ty->size, 8); // At least 8 bytes on stack *stack_offset += arg_size; } } // Load function call arguments. Arguments are already evaluated and // stored to the stack as local variables. What we need to do in this // function is to load them to registers or push them to the stack as // specified by the x86-64 psABI. Here is what the spec says: // // - Up to 6 arguments of integral type are passed using RDI, RSI, // RDX, RCX, R8 and R9. // // - Up to 8 arguments of floating-point type are passed using XMM0 to // XMM7. // // - If all registers of an appropriate type are already used, push an // argument to the stack in the right-to-left order. // // - Each argument passed on the stack takes 8 bytes, and the end of // the argument area must be aligned to a 16 byte boundary. // // - If a function is variadic, set the number of floating-point type // arguments to RAX. static int push_args(Node *node) { int gp = 0, fp = 0; // If the return type is a large struct/union, the caller passes // a pointer to a buffer as if it were the first argument. if (node->ret_buffer && node->ty->size > 16) gp++; // Load as many arguments to the registers as possible. for (Node *arg = node->args; arg; arg = arg->next) { Type *ty = arg->ty; if (!ty) error("%s:%d: in push_args : type is null!", __FILE__, __LINE__); switch (ty->kind) { case TY_STRUCT: case TY_UNION: if (ty->size == 0) continue; if (pass_by_reg(ty, gp, fp) ) { fp += has_flonum1(ty) + (ty->size > 8 && has_flonum2(ty)); gp += !has_flonum1(ty) + (ty->size > 8 && !has_flonum2(ty)); } else { arg->pass_by_stack = true; } break; case TY_VECTOR: case TY_FLOAT: case TY_DOUBLE: if (fp++ >= FP_MAX) { arg->pass_by_stack = true; } break; case TY_LDOUBLE: arg->pass_by_stack = true; break; case TY_INT128: if (gp + 1 >= GP_MAX) { arg->pass_by_stack = true; } else { gp += 2; } break; default: if (gp++ >= GP_MAX) { arg->pass_by_stack = true; } } } int stack_offset = 0; int max_align = 16; calculate_stack_offsets(node->args, &stack_offset, &max_align); int total_stack_bytes = stack_offset; int stack_units = (total_stack_bytes + 7) / 8; if ((depth + stack_units) % 2 != 0) { stack_units++; } if (stack_units > 0) { println(" sub $%d, %%rsp", stack_units * 8); depth += stack_units; } if (max_align > 16) { println(" and $-%d, %%rsp", max_align); } push_args2(node->args, true); // stack pass push_args2(node->args, false); // reg pass // If the return type is a large struct/union, the caller passes // a pointer to a buffer as if it were the first argument. if (node->ret_buffer && node->ty->size > 16) { println(" lea %d(%s), %%rax", node->ret_buffer->offset, node->ret_buffer->ptr); push(); } return stack_units; } static void copy_ret_buffer(Obj *var) { Type *ty = var->ty; if (!ty) error("%s:%d: in copy_ret_buffer : type is null!", __FILE__, __LINE__); int gp = 0, fp = 0; if (has_flonum1(ty)) { int offset = var->offset; if (is_omit_fp(current_fn)) offset += current_fn->stack_size + depth * 8; // Allow sizes 4, 8, 12, and 16 for floating-point types assert(ty->size == 4 || ty->size == 8 || ty->size == 12 || ty->size == 16); if (ty->size == 4) { println(" movss %%xmm0, %d(%s)", offset, var->ptr); } else if (ty->size == 8) { println(" movsd %%xmm0, %d(%s)", offset, var->ptr); } else if (ty->size == 12 || ty->size == 16) { println(" movsd %%xmm0, %d(%s)", offset, var->ptr); if (ty->size == 12) { println(" movss %%xmm1, %d(%s)", offset + 8, var->ptr); } else if (ty->size == 16) { println(" movsd %%xmm1, %d(%s)", offset + 8, var->ptr); } } fp++; } else { int offset = var->offset; if (is_omit_fp(current_fn)) offset += current_fn->stack_size + depth * 8; // **Change 1: Handle the first 8 bytes for integer types (up to 64 bits)** for (int i = 0; i < MIN(8, ty->size); i++) { println(" mov %%al, %d(%s)", offset + i, var->ptr); println(" shr $8, %%rax"); } gp++; } if (ty->size > 8) { int offset = var->offset; if (is_omit_fp(current_fn)) offset += current_fn->stack_size + depth * 8; if (has_flonum2(ty)) { assert(ty->size == 12 || ty->size == 16); if (ty->size == 12) println(" movss %%xmm%d, %d(%s)", fp, offset + 8, var->ptr); else println(" movsd %%xmm%d, %d(%s)", fp, offset + 8, var->ptr); } else { char *reg1 = (gp == 0) ? "%al" : "%dl"; char *reg2 = (gp == 0) ? "%rax" : "%rdx"; for (int i = 8; i < MIN(16, ty->size); i++) { println(" mov %s, %d(%s)", reg1, offset + i, var->ptr); println(" shr $8, %s", reg2); } } } } static void copy_struct_reg(void) { Type *ty = current_fn->ty->return_ty; if (!ty) error("%s:%d: in copy_struct_reg : type is null!", __FILE__, __LINE__); int gp = 0, fp = 0; println(" mov %%rax, %%rdi"); if (has_flonum(ty, 0, 8, 0)) { assert(ty->size == 4 || 8 <= ty->size); if (ty->size == 4) println(" movss (%%rdi), %%xmm0"); else println(" movsd (%%rdi), %%xmm0"); fp++; } else { println(" mov $0, %%rax"); for (int i = MIN(8, ty->size) - 1; i >= 0; i--) { println(" shl $8, %%rax"); println(" mov %d(%%rdi), %%al", i); } gp++; } if (ty->size > 8) { if (has_flonum(ty, 8, 16, 0)) { assert(ty->size == 12 || ty->size == 16); if (ty->size == 12) println(" movss 8(%%rdi), %%xmm%d", fp); else println(" movsd 8(%%rdi), %%xmm%d", fp); } else { char *reg1 = (gp == 0) ? "%al" : "%dl"; char *reg2 = (gp == 0) ? "%rax" : "%rdx"; println(" mov $0, %s", reg2); for (int i = MIN(16, ty->size) - 1; i >= 8; i--) { println(" shl $8, %s", reg2); println(" mov %d(%%rdi), %s", i, reg1); } } } } static void copy_struct_mem(void) { Type *ty = current_fn->ty->return_ty; if (!ty) error("%s:%d: in copy_struct_mem : type is null!", __FILE__, __LINE__); Obj *var = current_fn->params; if (is_omit_fp(current_fn)) println(" mov %d(%%rsp), %%rdi", var->offset + current_fn->stack_size + depth * 8); else println(" mov %d(%s), %%rdi", var->offset, var->ptr); gen_mem_copy("%rdi", ty->size); //from @fuhsnn Copy returned-by-stack aggregate's pointer to rax println(" mov %%rdi, %%rax"); } static void builtin_alloca(Node *node) { // Align the resulting pointer, not just the size. int align = node->val > 16 ? node->val : 16; if (!current_fn->alloca_bottom) { // new_rsp = (rsp - size) & -align; return new_rsp println(" mov %%rsp, %%rax"); println(" sub %%rdi, %%rax"); println(" and $-%d, %%rax", align); println(" mov %%rax, %%rsp"); return; } // Shift the temporary area by delta, where: // new_bottom = (old_bottom - size) & -align // delta = old_bottom - new_bottom println(" mov %d(%s), %%rax", current_fn->alloca_bottom->offset, current_fn->alloca_bottom->ptr); // old_bottom println(" mov %%rax, %%rcx"); println(" sub %%rsp, %%rcx"); // tmp_size println(" mov %%rax, %%rdx"); println(" sub %%rdi, %%rdx"); println(" and $-%d, %%rdx", align); // new_bottom println(" mov %%rax, %%rsi"); println(" sub %%rdx, %%rsi"); // delta println(" mov %%rsp, %%r8"); // old_rsp (src) println(" sub %%rsi, %%rsp"); // new_rsp println(" mov %%rsp, %%r9"); // new_rsp (dst) println("1:"); println(" cmp $0, %%rcx"); println(" je 2f"); println(" mov (%%r8), %%r10b"); println(" mov %%r10b, (%%r9)"); println(" inc %%r8"); println(" inc %%r9"); println(" dec %%rcx"); println(" jmp 1b"); println("2:"); // Move alloca_bottom pointer and return new_bottom in rax println(" mov %%rdx, %d(%s)", current_fn->alloca_bottom->offset, current_fn->alloca_bottom->ptr); println(" mov %%rdx, %%rax"); } //from cosmopolitan static void HandleAtomicArithmetic(Node *node, const char *op, bool return_new) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->ty->size == 16) { println(" mov %%rax, %%r10"); // val low println(" mov %%rdx, %%r11"); // val high pop_tmp("%rdi"); // addr println(" mov (%%rdi), %%rax"); // old low println(" mov 8(%%rdi), %%rdx"); // old high println("1:"); println(" mov %%rax, %%rbx"); println(" mov %%rdx, %%rcx"); println(" %s %%r10, %%rbx", op); println(" %s %%r11, %%rcx", op); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); if (return_new) { println(" mov %%rbx, %%rax"); println(" mov %%rcx, %%rdx"); } return; } pop_tmp("%r11"); println(" mov %s, %s", reg_ax(node->ty->size), reg_si(node->ty->size)); println(" mov (%%r11), %s", reg_ax(node->ty->size)); println("1: mov %s, %s", reg_ax(node->ty->size), reg_dx(node->ty->size)); println(" mov %s, %s", reg_ax(node->ty->size), reg_di(node->ty->size)); println(" %s %s, %s", op, reg_si(node->ty->size), reg_dx(node->ty->size)); println(" lock cmpxchg %s, (%%r11)", reg_dx(node->ty->size)); println(" jnz 1b"); if (return_new) println(" mov %s, %s", reg_dx(node->ty->size), reg_ax(node->ty->size)); else println(" mov %s, %s", reg_di(node->ty->size), reg_ax(node->ty->size)); } static void gen_memset(Node *node) { if (opt_fbuiltin) { gen_expr(node->builtin_dest); push_tmp(); gen_expr(node->builtin_val); push_tmp(); gen_expr(node->builtin_size); push_tmp(); pop_tmp("%rcx"); pop_tmp("%rsi"); pop_tmp("%rdi"); println(" mov %%rdi, %%r10"); println(" mov %%sil, %%al"); println(" cld"); println(" rep stosb"); println(" mov %%r10, %%rax"); } } static void gen_memcpy(Node *node) { if (opt_fbuiltin) { gen_expr(node->builtin_dest); push_tmp(); gen_expr(node->builtin_src); push_tmp(); gen_expr(node->builtin_size); println(" mov %%rax, %%rcx"); pop_tmp("%rsi"); pop_tmp("%rdi"); println(" mov %%rdi, %%rax"); println(" cld"); println(" rep movsb"); return; } } static void gen_int128_op(Node *node) { if (node->rhs) { gen_expr(node->rhs); pushx_tmp(); } gen_expr(node->lhs); if (node->rhs) popx_tmp("%rdi", "%rsi"); switch (node->kind) { case ND_ADD: println(" add %%rdi, %%rax"); println(" adc %%rsi, %%rdx"); break; case ND_SUB: println(" sub %%rdi, %%rax"); println(" sbb %%rsi, %%rdx"); break; case ND_MUL: println(" imul %%rdi, %%rdx"); println(" imul %%rax, %%rsi"); println(" add %%rdx, %%rsi"); println(" mul %%rdi"); println(" add %%rsi, %%rdx"); break; case ND_DIV: case ND_MOD: println(" mov %%rsi, %%rcx"); println(" mov %%rdx, %%rsi"); println(" mov %%rdi, %%rdx"); println(" mov %%rax, %%rdi"); if (node->kind == ND_DIV) { if (node->ty->is_unsigned) { println(" call __udivti3"); } else { println(" call __divti3"); } } else { if (node->ty->is_unsigned) { println(" call __umodti3"); } else { println(" call __modti3"); } } break; case ND_NEG: println(" neg %%rax"); println(" adc $0, %%rdx"); println(" neg %%rdx"); break; case ND_BITNOT: println(" not %%rax"); println(" not %%rdx"); break; case ND_BITAND: println(" and %%rdi, %%rax"); println(" and %%rsi, %%rdx"); break; case ND_BITOR: println(" or %%rdi, %%rax"); println(" or %%rsi, %%rdx"); break; case ND_BITXOR: println(" xor %%rdi, %%rax"); println(" xor %%rsi, %%rdx"); break; case ND_EQ: println(" mov %%rax, %%r10"); // Move lower 64 bits of lhs to r8 println(" mov %%rdx, %%r11"); // Move upper 64 bits of lhs to r9 println(" xor %%r10, %%rdi"); // Compare lower 64 bits of lhs and rhs println(" xor %%r11, %%rsi"); // Compare upper 64 bits of lhs and rhs println(" or %%rsi, %%rdi"); // Combine the results println(" sete %%al"); // Set AL if the result is zero (equal) println(" movzx %%al, %%eax"); // Zero extend AL to EAX break; case ND_NE: println(" xor %%rax, %%rdi"); println(" xor %%rdx, %%rsi"); println(" or %%rsi, %%rdi"); println(" setne %%al"); println(" movzb %%al, %%rax"); // Zero-extend al to rax to ensure the whole rax is correctly set break; case ND_LT: if (node->lhs->ty->is_unsigned) { println(" cmp %%rdi, %%rax"); println(" mov %%rdx, %%rax"); println(" sbb %%rsi, %%rax"); println(" setc %%al"); println(" movzb %%al, %%rax"); // Zero-extend al to rax to ensure the whole rax is correctly set } else { println(" cmp %%rdi, %%rax"); println(" mov %%rdx, %%rax"); println(" sbb %%rsi, %%rax"); println(" setl %%al"); println(" movzb %%al, %%rax"); // Zero-extend al to rax to ensure the whole rax is correctly set } break; case ND_LE: if (node->lhs->ty->is_unsigned) { println(" cmp %%rax, %%rdi"); println(" sbb %%rdx, %%rsi"); println(" setnc %%al"); println(" movzb %%al, %%rax"); // Zero-extend al to rax to ensure the whole rax is correctly set } else { println(" cmp %%rax, %%rdi"); println(" sbb %%rdx, %%rsi"); println(" setge %%al"); println(" movzb %%al, %%rax"); // Zero-extend al to rax to ensure the whole rax is correctly set } break; case ND_SHL: println(" mov %%rdi, %%rcx"); println(" shld %%cl, %%rax, %%rdx"); println(" shl %%cl, %%rax"); println(" xor %%edi, %%edi"); println(" and $64, %%cl"); println(" cmovne %%rax, %%rdx"); println(" cmovne %%rdi, %%rax"); break; case ND_SHR: { int c = count(); // Move shift amount to CL register println(" mov %%rdi, %%rcx"); if (node->lhs->ty->is_unsigned) { // Handle unsigned 128-bit shift right println(" cmp $64, %%rcx"); println(" jae .Lshift_gt64_unsigned_%d", c); // Common shift logic for shifts within 64 bits println(" shrd %%cl, %%rdx, %%rax"); // Shift right double println(" shr %%cl, %%rdx"); // Logical shift of upper 64 bits println(" jmp .Lshift_done_%d", c); // Handle shifts greater than 63 bits println(".Lshift_gt64_unsigned_%d:", c); println(" sub $64, %%rcx"); // Adjust shift amount println(" mov %%rdx, %%rax"); // Move high bits to low println(" shr %%cl, %%rax"); // Logical shift remaining bits in %%rax println(" xor %%rdx, %%rdx"); // Clear %%rdx (upper 64 bits) } else { // Handle signed 128-bit shift right (arithmetic) println(" cmp $64, %%rcx"); println(" jae .Lshift_gt64_signed_%d", c); // Common shift logic for shifts within 64 bits println(" shrd %%cl, %%rdx, %%rax"); // Shift right double println(" sar %%cl, %%rdx"); // Arithmetic shift of upper 64 bits println(" jmp .Lshift_done_%d", c); // Handle shifts greater than 63 bits println(".Lshift_gt64_signed_%d:", c); println(" sub $64, %%rcx"); // Adjust shift amount println(" mov %%rdx, %%rax"); // Move high bits to low println(" sar %%cl, %%rax"); // Arithmetic shift remaining bits in %%rax println(" sar $63, %%rdx"); // Sign extend %%rdx to fill with sign bit } println(".Lshift_done_%d:", c); break; } default: error_tok(node->tok,"%s:%d: error: in gen_int128_op : unsupported int128 operation %d", __FILE__, __LINE__, node->kind); } } static void scalar_to_xmm(Type *vec_ty, const char *xmm_reg) { switch (vec_ty->base->kind) { case TY_INT: println(" movd %%eax, %s", xmm_reg); println(" pshufd $0x0, %s, %s", xmm_reg, xmm_reg); break; case TY_LLONG: case TY_LONG: println(" movq %%rax, %s", xmm_reg); println(" movddup %s, %s", xmm_reg, xmm_reg); break; case TY_FLOAT: println(" shufps $0x00, %s, %s", xmm_reg, xmm_reg); break; case TY_DOUBLE: println(" shufpd $0x00, %s, %s", xmm_reg, xmm_reg); break; default: error("%s:%d: error: in scalar_to_xmm : unsupported vector base type for scalar promotion %d", __FILE__, __LINE__, vec_ty->base->kind); } } static void gen_vector_op(Node *node) { Type *vec_ty = node->lhs->ty; if (vec_ty->kind == TY_PTR && vec_ty->base->kind == TY_VECTOR) vec_ty = vec_ty->base; if (vec_ty->kind != TY_VECTOR) error_tok(node->tok, "%s:%d: error: in gen_vector_op : lhs is not a vector", __FILE__, __LINE__); bool use_ymm = vec_use_ymm(vec_ty); if (node->rhs) { gen_expr(node->rhs); if (node->rhs->is_scalar_promoted) { scalar_to_xmm(node->rhs->ty, "%xmm0"); if (use_ymm) { println(" vxorps %%ymm1, %%ymm1, %%ymm1"); println(" vinsertf128 $0, %%xmm0, %%ymm1, %%ymm1"); println(" vinsertf128 $1, %%xmm0, %%ymm1, %%ymm0"); } } if (use_ymm) push_ymm(0); else push_xmm(0); } if (node->lhs) { gen_expr(node->lhs); if (node->lhs->is_scalar_promoted) { scalar_to_xmm(node->lhs->ty, "%xmm0"); if (use_ymm) { println(" vxorps %%ymm1, %%ymm1, %%ymm1"); println(" vinsertf128 $0, %%xmm0, %%ymm1, %%ymm1"); println(" vinsertf128 $1, %%xmm0, %%ymm1, %%ymm0"); } } } if (node->rhs) { if (use_ymm) pop_ymm(1); else pop_xmm(1); } switch (node->kind) { case ND_ADD: case ND_SUB: case ND_MUL: break; case ND_EQ: case ND_NE: case ND_LT: case ND_LE: break; case ND_BITXOR: case ND_BITAND: case ND_BITOR: case ND_BITNOT: break; case ND_DIV: if (is_integer(node->lhs->ty->base)) error_tok(node->tok, "%s:%d: error: in gen_vector_op : integer vector division not supported", __FILE__, __LINE__); break; case ND_NEG: //gen_expr(node->lhs); // materialize operand in %xmm0 break; default: error_tok(node->tok, "%s:%d: error: in gen_vector_op : unsupported vector operation %d", __FILE__, __LINE__, node->kind); } switch (vec_ty->base->kind) { case TY_FLOAT: switch (node->kind) { case ND_ADD: if (use_ymm) println(" vaddps %%ymm1, %%ymm0, %%ymm0"); else println(" addps %%xmm1, %%xmm0"); break; case ND_SUB: if (use_ymm) println(" vsubps %%ymm1, %%ymm0, %%ymm0"); else println(" subps %%xmm1, %%xmm0"); break; case ND_MUL: if (use_ymm) println(" vmulps %%ymm1, %%ymm0, %%ymm0"); else println(" mulps %%xmm1, %%xmm0"); break; case ND_DIV: if (use_ymm) println(" vdivps %%ymm1, %%ymm0, %%ymm0"); else println(" divps %%xmm1, %%xmm0"); break; case ND_BITXOR: if (use_ymm) println(" vpxor %%ymm1, %%ymm0, %%ymm0"); else println(" pxor %%xmm1, %%xmm0"); break; case ND_BITAND: if (use_ymm) println(" vpand %%ymm1, %%ymm0, %%ymm0"); else println(" pand %%xmm1, %%xmm0"); break; case ND_BITOR: if (use_ymm) println(" vpor %%ymm1, %%ymm0, %%ymm0"); else println(" por %%xmm1, %%xmm0"); break; case ND_NEG: if (use_ymm) { println(" vxorps %%ymm1, %%ymm1, %%ymm1"); println(" vsubps %%ymm0, %%ymm1, %%ymm1"); println(" vmovaps %%ymm1, %%ymm0"); } else { println(" xorps %%xmm1, %%xmm1"); println(" subps %%xmm0, %%xmm1"); println(" movaps %%xmm1, %%xmm0"); } break; default: error_tok(node->tok, "%s:%d: error: unsupported float vector operation", __FILE__, __LINE__); } break; case TY_DOUBLE: switch (node->kind) { case ND_ADD: if (use_ymm) println(" vaddpd %%ymm1, %%ymm0, %%ymm0"); else println(" addpd %%xmm1, %%xmm0"); break; case ND_SUB: if (use_ymm) println(" vsubpd %%ymm1, %%ymm0, %%ymm0"); else println(" subpd %%xmm1, %%xmm0"); break; case ND_MUL: if (use_ymm) println(" vmulpd %%ymm1, %%ymm0, %%ymm0"); else println(" mulpd %%xmm1, %%xmm0"); break; case ND_DIV: if (use_ymm) println(" vdivpd %%ymm1, %%ymm0, %%ymm0"); else println(" divpd %%xmm1, %%xmm0"); break; case ND_BITXOR: if (use_ymm) println(" vpxor %%ymm1, %%ymm0, %%ymm0"); else println(" pxor %%xmm1, %%xmm0"); break; case ND_BITAND: if (use_ymm) println(" vpand %%ymm1, %%ymm0, %%ymm0"); else println(" pand %%xmm1, %%xmm0"); break; case ND_BITOR: if (use_ymm) println(" vpor %%ymm1, %%ymm0, %%ymm0"); else println(" por %%xmm1, %%xmm0"); break; case ND_NEG: if (use_ymm) { println(" vxorpd %%ymm1, %%ymm1, %%ymm1"); println(" vsubpd %%ymm0, %%ymm1, %%ymm1"); println(" vmovapd %%ymm1, %%ymm0"); } else { println(" xorpd %%xmm1, %%xmm1"); println(" subpd %%xmm0, %%xmm1"); println(" movapd %%xmm1, %%xmm0"); } break; default: error_tok(node->tok, "%s:%d: error: unsupported double vector operation", __FILE__, __LINE__); } break; case TY_CHAR: switch (node->kind) { case ND_ADD: if (use_ymm) println(" vpaddb %%ymm1, %%ymm0, %%ymm0"); else println(" paddb %%xmm1, %%xmm0"); break; case ND_SUB: if (use_ymm) println(" vpsubb %%ymm1, %%ymm0, %%ymm0"); else println(" psubb %%xmm1, %%xmm0"); break; case ND_BITXOR: if (use_ymm) println(" vpxor %%ymm1, %%ymm0, %%ymm0"); else println(" pxor %%xmm1, %%xmm0"); break; case ND_BITAND: if (use_ymm) println(" vpand %%ymm1, %%ymm0, %%ymm0"); else println(" pand %%xmm1, %%xmm0"); break; case ND_BITOR: if (use_ymm) println(" vpor %%ymm1, %%ymm0, %%ymm0"); else println(" por %%xmm1, %%xmm0"); break; case ND_NEG: if (use_ymm) { println(" vpxor %%ymm2, %%ymm2, %%ymm2"); println(" vpsubb %%ymm0, %%ymm2, %%ymm0"); } else { println(" pxor %%xmm2, %%xmm2"); println(" psubb %%xmm0, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_BITNOT: if (use_ymm) { println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" pcmpeqd %%xmm2, %%xmm2"); println(" pxor %%xmm2, %%xmm0"); } break; case ND_EQ: if (use_ymm) println(" vpcmpeqb %%ymm1, %%ymm0, %%ymm0"); else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpeqb %%xmm1, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_NE: if (use_ymm) { println(" vpcmpeqb %%ymm1, %%ymm0, %%ymm0"); println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpeqb %%xmm1, %%xmm2"); println(" pcmpeqd %%xmm3, %%xmm3"); println(" pxor %%xmm3, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_LT: if (use_ymm) { println(" vpcmpgtb %%ymm0, %%ymm1, %%ymm0"); } else { println(" movdqu %%xmm1, %%xmm2"); println(" pcmpgtb %%xmm0, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_LE: if (use_ymm) { println(" vpcmpgtb %%ymm1, %%ymm0, %%ymm0"); println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpgtb %%xmm1, %%xmm2"); println(" pcmpeqd %%xmm3, %%xmm3"); println(" pxor %%xmm3, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; default: error_tok(node->tok, "%s:%d: error: char vector operation not supported", __FILE__, __LINE__); } break; case TY_SHORT: switch (node->kind) { case ND_ADD: if (use_ymm) println(" vpaddw %%ymm1, %%ymm0, %%ymm0"); else println(" paddw %%xmm1, %%xmm0"); break; case ND_SUB: if (use_ymm) println(" vpsubw %%ymm1, %%ymm0, %%ymm0"); else println(" psubw %%xmm1, %%xmm0"); break; case ND_MUL: if (use_ymm) println(" vpmullw %%ymm1, %%ymm0, %%ymm0"); else println(" pmullw %%xmm1, %%xmm0"); break; case ND_BITXOR: if (use_ymm) println(" vpxor %%ymm1, %%ymm0, %%ymm0"); else println(" pxor %%xmm1, %%xmm0"); break; case ND_BITAND: if (use_ymm) println(" vpand %%ymm1, %%ymm0, %%ymm0"); else println(" pand %%xmm1, %%xmm0"); break; case ND_BITOR: if (use_ymm) println(" vpor %%ymm1, %%ymm0, %%ymm0"); else println(" por %%xmm1, %%xmm0"); break; case ND_NEG: if (use_ymm) { println(" vpxor %%ymm2, %%ymm2, %%ymm2"); println(" vpsubw %%ymm0, %%ymm2, %%ymm0"); } else { println(" pxor %%xmm2, %%xmm2"); println(" psubw %%xmm0, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_BITNOT: if (use_ymm) { println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" pcmpeqd %%xmm2, %%xmm2"); println(" pxor %%xmm2, %%xmm0"); } break; case ND_EQ: if (use_ymm) println(" vpcmpeqw %%ymm1, %%ymm0, %%ymm0"); else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpeqw %%xmm1, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_NE: if (use_ymm) { println(" vpcmpeqw %%ymm1, %%ymm0, %%ymm0"); println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpeqw %%xmm1, %%xmm2"); println(" pcmpeqd %%xmm3, %%xmm3"); println(" pxor %%xmm3, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_LT: if (use_ymm) { println(" vpcmpgtw %%ymm0, %%ymm1, %%ymm0"); } else { println(" movdqu %%xmm1, %%xmm2"); println(" pcmpgtw %%xmm0, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_LE: if (use_ymm) { println(" vpcmpgtw %%ymm1, %%ymm0, %%ymm0"); println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpgtw %%xmm1, %%xmm2"); println(" pcmpeqd %%xmm3, %%xmm3"); println(" pxor %%xmm3, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; default: error_tok(node->tok, "%s:%d: error: short vector operation not supported", __FILE__, __LINE__); } break; case TY_LLONG: case TY_LONG: switch (node->kind) { case ND_ADD: if (use_ymm) println(" vpaddq %%ymm1, %%ymm0, %%ymm0"); else println(" paddq %%xmm1, %%xmm0"); break; case ND_SUB: if (use_ymm) println(" vpsubq %%ymm1, %%ymm0, %%ymm0"); else println(" psubq %%xmm1, %%xmm0"); break; case ND_MUL: error_tok(node->tok, "%s:%d: error: 64-bit integer vector multiply not supported", __FILE__, __LINE__); break; case ND_BITXOR: if (use_ymm) println(" vpxor %%ymm1, %%ymm0, %%ymm0"); else println(" pxor %%xmm1, %%xmm0"); break; case ND_BITAND: if (use_ymm) println(" vpand %%ymm1, %%ymm0, %%ymm0"); else println(" pand %%xmm1, %%xmm0"); break; case ND_BITOR: if (use_ymm) println(" vpor %%ymm1, %%ymm0, %%ymm0"); else println(" por %%xmm1, %%xmm0"); break; case ND_NEG: if (use_ymm) { println(" vpxor %%ymm2, %%ymm2, %%ymm2"); println(" vpsubq %%ymm0, %%ymm2, %%ymm0"); } else { println(" pxor %%xmm1, %%xmm1"); println(" psubq %%xmm0, %%xmm1"); println(" movdqu %%xmm1, %%xmm0"); } break; case ND_BITNOT: if (use_ymm) { println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" pcmpeqd %%xmm1, %%xmm1"); println(" pxor %%xmm1, %%xmm0"); } break; case ND_EQ: if (use_ymm) println(" vpcmpeqq %%ymm1, %%ymm0, %%ymm0"); else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpeqq %%xmm1, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_NE: if (use_ymm) { println(" vpcmpeqq %%ymm1, %%ymm0, %%ymm0"); println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpeqq %%xmm1, %%xmm2"); println(" pcmpeqd %%xmm3, %%xmm3"); println(" pxor %%xmm3, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_LT: if (use_ymm) { println(" vpcmpgtq %%ymm0, %%ymm1, %%ymm0"); } else { println(" movdqu %%xmm1, %%xmm2"); println(" pcmpgtq %%xmm0, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_LE: if (use_ymm) { println(" vpcmpgtq %%ymm1, %%ymm0, %%ymm0"); println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpgtq %%xmm1, %%xmm2"); println(" pcmpeqd %%xmm3, %%xmm3"); println(" pxor %%xmm3, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; default: error_tok(node->tok, "%s:%d: error: long vector operation not supported", __FILE__, __LINE__); } break; case TY_INT: switch (node->kind) { case ND_ADD: if (use_ymm) println(" vpaddd %%ymm1, %%ymm0, %%ymm0"); else println(" paddd %%xmm1, %%xmm0"); break; case ND_SUB: if (use_ymm) println(" vpsubd %%ymm1, %%ymm0, %%ymm0"); else println(" psubd %%xmm1, %%xmm0"); break; case ND_MUL: if (use_ymm) println(" vpmulld %%ymm1, %%ymm0, %%ymm0"); else println(" pmulld %%xmm1, %%xmm0"); break; case ND_BITXOR: if (use_ymm) println(" vpxor %%ymm1, %%ymm0, %%ymm0"); else println(" pxor %%xmm1, %%xmm0"); break; case ND_BITAND: if (use_ymm) println(" vpand %%ymm1, %%ymm0, %%ymm0"); else println(" pand %%xmm1, %%xmm0"); break; case ND_BITOR: if (use_ymm) println(" vpor %%ymm1, %%ymm0, %%ymm0"); else println(" por %%xmm1, %%xmm0"); break; case ND_NEG: if (use_ymm) { println(" vpxor %%ymm2, %%ymm2, %%ymm2"); println(" vpsubd %%ymm0, %%ymm2, %%ymm0"); } else { println(" pxor %%xmm1, %%xmm1"); println(" psubd %%xmm0, %%xmm1"); println(" movdqu %%xmm1, %%xmm0"); } break; case ND_BITNOT: if (use_ymm) { println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" pcmpeqd %%xmm1, %%xmm1"); println(" pxor %%xmm1, %%xmm0"); } break; case ND_EQ: if (use_ymm) println(" vpcmpeqd %%ymm1, %%ymm0, %%ymm0"); else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpeqd %%xmm1, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_NE: if (use_ymm) { println(" vpcmpeqd %%ymm1, %%ymm0, %%ymm0"); println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpeqd %%xmm1, %%xmm2"); println(" pcmpeqd %%xmm3, %%xmm3"); println(" pxor %%xmm3, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_LT: if (use_ymm) { println(" vpcmpgtd %%ymm0, %%ymm1, %%ymm0"); } else { println(" movdqu %%xmm1, %%xmm2"); println(" pcmpgtd %%xmm0, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; case ND_LE: if (use_ymm) { println(" vpcmpgtd %%ymm1, %%ymm0, %%ymm0"); println(" vpcmpeqd %%ymm2, %%ymm2, %%ymm2"); println(" vpxor %%ymm2, %%ymm0, %%ymm0"); } else { println(" movdqu %%xmm0, %%xmm2"); println(" pcmpgtd %%xmm1, %%xmm2"); println(" pcmpeqd %%xmm3, %%xmm3"); println(" pxor %%xmm3, %%xmm2"); println(" movdqu %%xmm2, %%xmm0"); } break; default: error_tok(node->tok, "%s:%d: error: integer vector operation not supported", __FILE__, __LINE__); } break; default: error_tok(node->tok, "%s:%d: error: vector base type not supported %d", __FILE__, __LINE__, vec_ty->base->kind); } } static void gen_cmpxchg(Node *node) { int sz = node->cas_ptr->ty->base->size; gen_expr(node->cas_ptr); push_tmp(); gen_expr(node->cas_expected); push_tmp(); gen_expr(node->cas_desired); println(" mov %%rax, %%rcx"); pop_tmp("%rsi"); pop_tmp("%rdi"); if (sz == 16) { println(" mov %%rcx, %%r10"); // desired ptr println(" mov (%%r10), %%rbx"); println(" mov 8(%%r10), %%rcx"); println(" mov (%%rsi), %%rax"); println(" mov 8(%%rsi), %%rdx"); println(" lock cmpxchg16b (%%rdi)"); println(" je 1f"); println(" mov %%rax, (%%rsi)"); println(" mov %%rdx, 8(%%rsi)"); println("1:"); println(" sete %%al"); println(" movzbl %%al, %%eax"); if (node->cas_success || node->cas_failure) { println(" mfence"); } return; } if (sz == 1) { println(" movb (%%rcx), %%cl"); } else if (sz == 2) { println(" movw (%%rcx), %%cx"); } else if (sz == 4) { println(" movl (%%rcx), %%ecx"); } else if (sz == 8) { println(" movq (%%rcx), %%rcx"); } if (sz == 1) { println(" movb (%%rsi), %%al"); } else if (sz == 2) { println(" movw (%%rsi), %%ax"); } else if (sz == 4) { println(" movl (%%rsi), %%eax"); } else if (sz == 8) { println(" movq (%%rsi), %%rax"); } println(" lock cmpxchg %s, (%%rdi)", reg_cx(sz)); println(" je 1f"); println(" mov %s, (%%rsi)", reg_ax(sz)); println("1:"); println(" sete %%al"); println(" movzbl %%al, %%eax"); if (node->cas_success || node->cas_failure) { println(" mfence"); } } static void gen_cmpxchgn(Node *node) { int sz = node->cas_ptr->ty->base->size; gen_expr(node->cas_ptr); push_tmp(); gen_expr(node->cas_expected); push_tmp(); gen_expr(node->cas_desired); if (node->cas_desired->ty->kind == TY_FLOAT) println(" movd %%xmm0, %%eax"); else if (node->cas_desired->ty->kind == TY_DOUBLE) println(" movq %%xmm0, %%rax"); println(" mov %%rax, %%rcx"); if (sz == 16) { println(" mov %%rax, %%rbx"); println(" mov %%rdx, %%rcx"); pop_tmp("%rsi"); pop_tmp("%rdi"); println(" mov (%%rsi), %%rax"); println(" mov 8(%%rsi), %%rdx"); println(" lock cmpxchg16b (%%rdi)"); println(" je 1f"); println(" mov %%rax, (%%rsi)"); println(" mov %%rdx, 8(%%rsi)"); println("1:"); println(" sete %%al"); println(" movzbl %%al, %%eax"); if (node->cas_success || node->cas_failure) { println(" mfence"); } return; } pop_tmp("%rsi"); pop_tmp("%rdi"); if (sz == 1) println(" movb (%%rsi), %%al"); else if (sz == 2) println(" movw (%%rsi), %%ax"); else if (sz == 4) println(" movl (%%rsi), %%eax"); else println(" movq (%%rsi), %%rax"); if (sz == 1) { println(" lock cmpxchg %%cl, (%%rdi)"); } else if (sz == 2) { println(" lock cmpxchg %%cx, (%%rdi)"); } else if (sz == 4) { println(" lock cmpxchg %%ecx, (%%rdi)"); } else if (sz == 8) { println(" lock cmpxchg %%rcx, (%%rdi)"); } println(" je 1f"); if (sz == 1) println(" movb %%al, (%%rsi)"); else if (sz == 2) println(" movw %%ax, (%%rsi)"); else if (sz == 4) println(" movl %%eax, (%%rsi)"); else println(" movq %%rax, (%%rsi)"); println("1:"); println(" sete %%al"); println(" movzbl %%al, %%eax"); if (node->cas_success || node->cas_failure) { println(" mfence"); } } static void gen_signbit(Node *node) { gen_expr(node->lhs); switch (node->lhs->ty->kind) { case TY_FLOAT: println(" movd %%xmm0, %%eax"); println(" shr $31, %%eax"); return; case TY_DOUBLE: println(" movmskpd %%xmm0, %%eax"); println(" and $1, %%eax"); return; case TY_LDOUBLE: // println(" fxam"); // println(" fnstsw %%ax"); // println(" fstp %%st(0)"); // println(" and $0x200, %%eax"); println(" sub $16, %%rsp"); println(" fstpt (%%rsp)"); println(" movb 9(%%rsp), %%al"); // Get the byte containing the sign bit println(" shr $7, %%al"); // Move sign bit to LSB println(" movzbl %%al, %%eax"); // Zero-extend to EAX println(" add $16, %%rsp"); return; default: unreachable(); } } static void gen_isunordered(Node *node) { if (node->lhs->ty && node->rhs->ty && (node->lhs->ty->kind == TY_LDOUBLE || node->rhs->ty->kind == TY_LDOUBLE)) { gen_expr(node->lhs); pushld(); gen_expr(node->rhs); popld(); println(" fucomip"); println(" fstp %%st(0)"); println(" setp %%al"); println(" movzx %%al, %%eax"); return; } gen_expr(node->lhs); push_tmpf(); gen_expr(node->rhs); pop_tmpf(1); if (node->lhs->ty->kind == TY_DOUBLE) println(" ucomisd %%xmm1, %%xmm0"); else println(" ucomiss %%xmm1, %%xmm0"); println(" setp %%al"); println(" movzx %%al, %%eax"); return; } static void gen_builtin(Node *node, const char *insn, const char *reg) { gen_expr(node->builtin_val); println(" %s %%%s, %%%s", insn, reg, reg); } static void gen_vec_init_v2si(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); pop_tmp("%rdx"); println(" shl $32, %%rax"); println(" or %%rdx, %%rax"); println(" movq %%rax, %%xmm0"); } static void gen_vec_ext(Node *node) { gen_expr(node->lhs); push_xmm(0); gen_expr(node->rhs); println(" movslq %%eax, %%rcx"); if (node->kind == ND_VECEXTV16QI) { println(" and $15, %%ecx"); println(" movzbl (%%rsp,%%rcx), %%eax"); } else if (node->kind == ND_VECEXTV8HI) { println(" and $7, %%ecx"); println(" movswl (%%rsp,%%rcx,2), %%eax"); } else if (node->kind == ND_VECEXTV2DI) { println(" and $1, %%ecx"); println(" movq (%%rsp,%%rcx,8), %%rax"); } else { println(" and $%d, %%ecx", node->kind == ND_VECEXTV2SI ? 1 : 3); println(" movl (%%rsp,%%rcx,4), %%eax"); } pop_xmm(0); } static void gen_psubusb256(Node *node) { gen_expr(node->rhs); // B push_ymm(0); gen_expr(node->lhs); // A pop_ymm(1); println(" vpsubusb %%ymm1, %%ymm0, %%ymm0"); } static void gen_vec_init_binop(Node *node, const char *insn) { for (int i = 0; i < node->builtin_nargs; i++) { if (i == 0) { gen_expr(node->builtin_args[i]); // result in %eax println(" movd %%eax, %%xmm0"); } else { // Preserve previously packed lanes across arg evaluation. push_xmm(0); gen_expr(node->builtin_args[i]); // result in %eax pop_xmm(0); println(" %s $%d, %%eax, %%xmm0", insn, i); } } } static void gen_pshufd(Node *node) { gen_expr(node->lhs); int imm = node->rhs->val; println(" pshufd $%d, %%xmm0, %%xmm0", imm); } static void gen_shuf_binop(Node *node, const char *insn) { gen_expr(node->rhs); push_xmm(0); gen_expr(node->lhs); pop_xmm(1); println(" %s $%ld, %%xmm1, %%xmm0", insn, (int64_t)node->rhs->val); } static void gen_psll_binop(Node *node, const char *insn) { gen_expr(node->lhs); push_xmm(0); gen_expr(node->rhs); pop_xmm(1); if (node->rhs->kind == ND_NUM) println(" %s $%ld, %%xmm1", insn, (int64_t)node->rhs->val); else { println(" movq %%rax, %%xmm0"); println(" %s %%xmm0, %%xmm1", insn); } println(" movaps %%xmm1, %%xmm0"); } // Walk node to find a numeric constant. Works for ND_ASSIGN, ND_COMMA, ND_CAST etc. static int get_const_int_from_node(Node *node) { if (!node) error("%s:%d: error: in get_const_int_from_node : expected constant node", __FILE__, __LINE__); while (true) { if (node->kind == ND_NUM) return node->val; if (node->kind == ND_CAST) { node = node->lhs; continue; } if (node->kind == ND_COMMA) { node = node->rhs; continue; } if (node->kind == ND_ASSIGN) { node = node->rhs; continue; } break; } error_tok(node->tok, "%s:%d: error: in get_const_int_from_node : not a compile-time integer constant", __FILE__, __LINE__); } static Node *unwrap_casts(Node *node) { while (node && (node->kind == ND_CAST || node->kind == ND_COMMA)) node = node->lhs; return node; } // Fill vals[] with mask_node->var->ty->array_len ints (expect 4). static void get_mask_values(Node *mask_node, int *vals, int expected_len) { mask_node = unwrap_casts(mask_node); if (!mask_node->var || !mask_node->var->init) error_tok(mask_node->tok, "%s:%d: error: in get_mask_values : shuffle mask must be a constant vector initializer! %d", __FILE__, __LINE__, mask_node->kind); Initializer *init = mask_node->var->init; int len = mask_node->var->ty->array_len; for (int i = 0; i < len; i++) { Initializer *elem = init->children[i]; vals[i] = get_const_int_from_node(elem->expr); } } // Try to find imm1/imm2 (two shufps immediates) that produce mask[0..3]. // Returns true on success. static bool decompose_shuffle_mask_from_vals(int mask[4], int *out_imm1, int *out_imm2) { // mask entries must be 0..7 for (int i = 0; i < 4; i++) if (mask[i] < 0 || mask[i] > 7) return false; for (int comb = 0; comb < (1 << 4); comb++) { int idx[4]; int ia[2] = {-1,-1}, ib[2] = {-1,-1}; bool ok = true; for (int j = 0; j < 4; j++) { int bit = (comb >> j) & 1; if (mask[j] < 4) idx[j] = bit; // from a -> index 0/1 in intermediate else idx[j] = 2 + bit; // from b -> index 2/3 in intermediate if (idx[j] < 2) { if (ia[idx[j]] == -1) ia[idx[j]] = mask[j]; else if (ia[idx[j]] != mask[j]) { ok = false; break; } } else { int k = idx[j] - 2; if (ib[k] == -1) ib[k] = mask[j] - 4; else if (ib[k] != mask[j] - 4) { ok = false; break; } } } if (!ok) continue; for (int t = 0; t < 2; t++) { if (ia[t] == -1) ia[t] = 0; if (ib[t] == -1) ib[t] = 0; } int imm1 = (ia[0] & 3) | ((ia[1] & 3) << 2) | ((ib[0] & 3) << 4) | ((ib[1] & 3) << 6); int imm2 = (idx[0] & 3) | ((idx[1] & 3) << 2) | ((idx[2] & 3) << 4) | ((idx[3] & 3) << 6); // simulate int intermediate[4]; intermediate[0] = ia[0]; // reference a indices 0..3 treated as 0..3 intermediate[1] = ia[1]; intermediate[2] = ib[0] + 4; // convert back to 4..7 intermediate[3] = ib[1] + 4; int final[4]; for (int j = 0; j < 4; j++) final[j] = intermediate[(imm2 >> (2*j)) & 3]; bool match = true; for (int j = 0; j < 4; j++) if (final[j] != mask[j]) { match = false; break; } if (!match) continue; *out_imm1 = imm1; *out_imm2 = imm2; return true; } return false; } static void gen_shuffle(Node *node, const char *insn) { assert(node->builtin_nargs == 3); // Evaluate args so %xmm0 ends with lhs and %xmm1 ends with rhs as before: gen_expr(node->builtin_args[0]); // leaves a in %xmm0 println(" movaps %%xmm0, %%xmm2"); // save a in xmm2 gen_expr(node->builtin_args[1]); // leaves b in %xmm0 println(" movaps %%xmm0, %%xmm1"); // save b in xmm1 println(" movaps %%xmm2, %%xmm0"); // restore a into xmm0 (dest) // read the 4 mask values int mask[4]; get_mask_values(node->builtin_args[2], mask, 4); // try to decompose into two shufps immediates int imm1, imm2; if (decompose_shuffle_mask_from_vals(mask, &imm1, &imm2)) { // emit exactly what GCC emits println(" %s $%d, %%xmm1, %%xmm0", insn, imm1); // shufps imm1, xmm1, xmm0 println(" %s $%d, %%xmm0, %%xmm0", insn, imm2); // shufps imm2, xmm0, xmm0 } else { // fallback: try a single shufps immediate (simple encode) or emit more general sequence // Build single-byte immediate where bits are (lane3<<6)|(lane2<<4)|(lane1<<2)|lane0 int single = ((mask[3] & 3) << 6) | ((mask[2] & 3) << 4) | ((mask[1] & 3) << 2) | (mask[0] & 3); println(" %s $%d, %%xmm1, %%xmm0", insn, single); } } static void gen_maskmovq(Node *node) { assert(node->builtin_nargs == 3); gen_expr(node->builtin_args[1]); println(" movq (%%rax), %%mm1"); gen_expr(node->builtin_args[0]); println(" movq (%%rax), %%mm0"); gen_addr(node->builtin_args[2]); println(" movq %%rax, %%rdi"); println(" maskmovq %%mm1, %%mm0"); println(" emms"); } static void gen_maskmovdqu(Node *node) { assert(node->builtin_nargs == 3); gen_expr(node->builtin_args[1]); println(" movdqu (%%rax), %%xmm1"); gen_expr(node->builtin_args[0]); println(" movdqu (%%rax), %%xmm0"); gen_addr(node->builtin_args[2]); println(" movq %%rax, %%rdi"); println(" maskmovdqu %%xmm1, %%xmm0"); } static void gen_cvtpi2ps(Node *node) { gen_expr(node->lhs); gen_addr(node->rhs); println(" movq (%%rax), %%mm0"); println(" cvtpi2ps %%mm0, %%xmm0"); println(" emms"); } static void gen_loadhps(Node *node) { gen_expr(node->lhs); println(" movups (%%rax), %%xmm0"); push_xmm(0); gen_expr(node->rhs); println(" movq (%%rax), %%xmm1"); pop_xmm(0); println(" movlhps %%xmm1, %%xmm0"); } static void gen_packss128_binop(Node *node, const char *insn) { gen_expr(node->lhs); push_xmm(0); gen_expr(node->rhs); pop_xmm(1); println(" %s %%xmm0, %%xmm1", insn); println(" movdqu %%xmm1, %%xmm0"); } static void gen_alloc(Node *node) { gen_expr(node->lhs); // Assume size to allocate is in RAX println(" mov %%rax, %%rdi"); // Move size to RDI (or appropriate register) println(" sub %%rdi, %%rsp"); // Allocate space on the stack println(" mov %%rsp, %%rax"); // Store the new stack pointer (allocated memory address) in RAX } static void gen_release(Node *node) { gen_expr(node->lhs); println(" mov %%rax, %%rdi"); if (node->ty->size == 16) { println(" xor %%rax, %%rax"); println(" mov %%rax, (%%rdi)"); println(" mov %%rax, 8(%%rdi)"); return; } println(" xor %%eax, %%eax"); println(" mov %s, (%%rdi)", reg_ax(node->ty->size)); } static void gen_rdtsc(Node *node) { println(" rdtsc"); println(" shl $32, %%rdx"); println(" or %%rdx, %%rax"); } static void gen_rdpkru(Node *node) { println(" movl $0, %%eax"); println(" movl %%eax, %%ecx"); println(" rdpkru"); } static void gen_bsrsi(Node *node) { gen_expr(node->lhs); println(" bsrl %%eax, %%eax"); } static void gen_bsrdi(Node *node) { gen_expr(node->lhs); println(" bsrq %%rax, %%rax"); } static void gen_rdpmc(Node *node) { gen_expr(node->lhs); println(" mov %%eax, %%ecx"); println(" rdpmc"); } static void gen_rdtscp(Node *node) { gen_expr(node->lhs); println(" movq %%rax, %%rdi"); println(" rdtscp"); println(" movl %%ecx, (%%rdi)"); println(" movl %%edx, %%edx"); println(" salq $32, %%rdx"); println(" or %%rdx, %%rax"); } static void gen_rolqi(Node *node) { gen_expr(node->lhs); println(" mov %%al, %%bl"); gen_expr(node->rhs); println(" mov %%al, %%cl"); println(" rolb %%cl, %%bl"); println(" movzb %%bl, %%rax"); } static void gen_rorqi(Node *node) { gen_expr(node->lhs); println(" mov %%al, %%bl"); gen_expr(node->rhs); println(" mov %%al, %%cl"); println(" rorb %%cl, %%bl"); println(" movzb %%bl, %%rax"); } static void gen_rolhi(Node *node) { gen_expr(node->lhs); println(" mov %%ax, %%bx"); gen_expr(node->rhs); println(" mov %%al, %%cl"); println(" rolw %%cl, %%bx"); println(" movzx %%bx, %%rax"); } static void gen_rorhi(Node *node) { gen_expr(node->lhs); println(" mov %%ax, %%bx"); gen_expr(node->rhs); println(" mov %%al, %%cl"); println(" rorw %%cl, %%bx"); println(" movzx %%bx, %%rax"); } static void gen_readeflags_u64(Node *node) { println(" pushfq"); println(" popq %%rax"); } static void gen_writeeflags_u64(Node *node) { gen_expr(node->lhs); println(" pushq $%ld", (int64_t)node->lhs->val); println(" popfq"); } static void gen_incsspq(Node *node) { gen_expr(node->lhs); println(" incsspq %%rax"); } static void gen_rstorssp(Node *node) { gen_addr(node->lhs); println(" rstorssp (%%rax)"); } static void gen_wrssd(Node *node) { gen_expr(node->rhs); println(" movq %%rax, %%rdx"); gen_expr(node->lhs); println(" wrssd %%eax, (%%rdx)"); } static void gen_wrssq(Node *node) { gen_expr(node->rhs); println(" movq %%rax, %%rdx"); gen_expr(node->lhs); println(" wrssq %%rax, (%%rdx)"); } static void gen_wrussd(Node *node) { gen_expr(node->rhs); println(" movq %%rax, %%rdx"); gen_expr(node->lhs); println(" wrussd %%eax, (%%rdx)"); } static void gen_wrussq(Node *node) { gen_expr(node->rhs); println(" movq %%rax, %%rdx"); gen_expr(node->lhs); println(" wrussq %%rax, (%%rdx)"); } static void gen_clrssbsy(Node *node) { gen_expr(node->lhs); if (node->lhs->kind == ND_NUM) println(" clrssbsy %ld", (int64_t)node->lhs->val); else println(" clrssbsy (%%rax)"); } static void gen_sbb_u32(Node *node) { gen_expr(node->builtin_args[0]); println(" movl %%eax, %%edi"); gen_expr(node->builtin_args[1]); println(" movl %%eax, %%esi"); gen_expr(node->builtin_args[2]); println(" movl %%eax, %%edx"); gen_expr(node->builtin_args[3]); println(" movq %%rax, %%rcx"); println(" movl %%edi, %%eax"); println(" bt $0, %%edx"); println(" sbbl %%esi, %%eax"); println(" setc %%dl"); println(" movzbl %%dl, %%edx"); println(" movl %%edx, (%%rcx)"); } static void gen_sbb_u64(Node *node) { gen_expr(node->builtin_args[0]); println(" movq %%rax, %%rdi"); gen_expr(node->builtin_args[1]); println(" movq %%rax, %%rsi"); gen_expr(node->builtin_args[2]); println(" movq %%rax, %%rdx"); gen_expr(node->builtin_args[3]); println(" movq %%rax, %%rcx"); println(" movq %%rsi, %%rax"); println(" sbbq %%rdx, %%rax"); println(" sbbq %%rdi, %%rax"); println(" movq %%rax, (%%rcx)"); println(" setc %%al"); } static void gen_addcarryx_u32(Node *node) { gen_expr(node->builtin_args[0]); println(" movb %%al, %%dil"); gen_expr(node->builtin_args[1]); println(" movl %%eax, %%esi"); gen_expr(node->builtin_args[2]); println(" movl %%eax, %%edx"); gen_expr(node->builtin_args[3]); println(" movq %%rax, %%rcx"); println(" movl %%esi, %%eax"); println(" movzx %%dil, %%r10d "); println(" addl %%edx, %%eax"); println(" addl %%r10d, %%eax"); println(" setc %%al"); println(" movl %%eax, (%%rcx)"); } static void gen_addcarryx_u64(Node *node) { gen_expr(node->builtin_args[0]); println(" movq %%rax, %%rdi"); gen_expr(node->builtin_args[1]); println(" movq %%rax, %%rsi"); gen_expr(node->builtin_args[2]); println(" movq %%rax, %%rdx"); gen_expr(node->builtin_args[3]); println(" movq %%rax, %%rcx"); println(" movq %%rsi, %%rax"); println(" addq %%rdx, %%rax"); println(" addq %%rdi, %%rax"); println(" movq %%rax, (%%rcx)"); } static void gen_tzcnt_u16(Node *node) { gen_expr(node->lhs); println(" testw %%ax, %%ax"); println(" jne 1f"); println(" movl $16, %%eax"); println(" jmp 2f"); println("1:"); println(" bsfw %%ax, %%ax"); println("2:"); } static void gen_bextr_u32(Node *node) { gen_expr(node->lhs); println(" push %%rax"); gen_expr(node->rhs); println(" movl %%eax, %%ecx"); println(" pop %%rax"); println(" movl %%ecx, %%edx"); println(" andl $0xff, %%edx"); println(" shrl $8, %%ecx"); println(" andl $0xff, %%ecx"); println(" testl %%ecx, %%ecx"); println(" je 1f"); println(" cmpl $32, %%edx"); println(" jae 1f"); println(" movl $32, %%esi"); println(" subl %%edx, %%esi"); println(" cmpl %%esi, %%ecx"); println(" cmova %%esi, %%ecx"); println(" shrl %%cl, %%eax"); println(" movl $1, %%esi"); println(" shll %%cl, %%esi"); println(" decl %%esi"); println(" andl %%esi, %%eax"); println(" jmp 2f"); println("1:"); println(" xorl %%eax, %%eax"); println("2:"); } static void gen_binop1(Node *node, const char *insn) { println(" %s %%rax", insn); } static void gen_binop2(Node *node, const char *insn) { println(" %s %s", insn, reg_ax(node->ty->size)); } static void gen_nothing(Node *node) { println(" mov $0, %%rax"); } static void gen_singleop(Node *node, const char *insn) { println(" %s", insn); } static void gen_mul_overflow(Node *node) { int c = count(); Type *ty = node->lhs->ty; if (ty->base) ty = ty->base; int size = ty->size; gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); push_tmp(); gen_expr(node->builtin_dest); push_tmp(); pop_tmp("%rcx"); // result ptr (moved to rcx to free rdx) pop_tmp("%rsi"); pop_tmp("%rdi"); if (size == 1) { // For 8-bit values (char) println(" mov %%dil, %%al"); if (ty->is_unsigned) println(" mul %%sil"); else println(" imul %%sil"); println(" jo .L.overflowm%d", c); println(" mov %%al, (%%rcx)"); println(" mov $0, %%eax"); println(" jmp .L.donem%d", c); } else if (size == 2) { // For 16-bit values (short) println(" mov %%di, %%ax"); if (ty->is_unsigned) println(" mul %%si"); else println(" imul %%si"); println(" jo .L.overflowm%d", c); println(" mov %%ax, (%%rcx)"); println(" mov $0, %%eax"); println(" jmp .L.donem%d", c); } else if (size == 4) { // For 32-bit values (int) println(" mov %%edi, %%eax"); if (ty->is_unsigned) println(" mul %%esi"); else println(" imul %%esi"); println(" jo .L.overflowm%d", c); println(" mov %%eax, (%%rcx)"); println(" mov $0, %%eax"); println(" jmp .L.donem%d", c); } else if (size == 8) { // For 64-bit values (long long) println(" mov %%rdi, %%rax"); if (ty->is_unsigned) println(" mul %%rsi"); else println(" imul %%rsi"); println(" jo .L.overflowm%d", c); println(" mov %%rax, (%%rcx)"); println(" mov $0, %%rax"); println(" jmp .L.donem%d", c); } println(".L.overflowm%d:", c); // Store truncated result on overflow if (size == 1) println(" mov %%al, (%%rcx)"); else if (size == 2) println(" mov %%ax, (%%rcx)"); else if (size == 4) println(" mov %%eax, (%%rcx)"); else if (size == 8) println(" mov %%rax, (%%rcx)"); println(" mov $1, %%rax"); println(".L.donem%d:", c); } static void gen_sub_overflow(Node *node) { int c = count(); Type *ty = node->builtin_dest->ty; if (ty->base) ty = ty->base; gen_expr(node->lhs); if (ty->size == 16) pushx_tmp(); else push_tmp(); gen_expr(node->rhs); if (ty->size == 16) pushx_tmp(); else push_tmp(); gen_expr(node->builtin_dest); push_tmp(); pop_tmp("%rdx"); // dest ptr if (ty->size == 16) popx_tmp("%rcx", "%rsi"); // rhs low/high else pop_tmp("%rsi"); // rhs if (ty->size == 16) popx_tmp("%rax", "%rdi"); // lhs low/high else pop_tmp("%rdi"); // lhs if (ty->size == 1) { // Promote operands to signed 64-bit infinite precision values. // lhs -> %rax if (node->lhs->ty->is_unsigned) { println(" movzbl %%dil, %%eax"); } else { println(" movsbl %%dil, %%eax"); } println(" movslq %%eax, %%rax"); // rhs -> %rcx if (node->rhs->ty->is_unsigned) { println(" movzbl %%sil, %%ecx"); } else { println(" movsbl %%sil, %%ecx"); } println(" movslq %%ecx, %%rcx"); // wide = lhs - rhs println(" sub %%rcx, %%rax"); // store truncated result println(" mov %%al, (%%rdx)"); // overflow check vs destination type if (ty->is_unsigned) { // 0..255 println(" cmp $0, %%rax"); println(" jl .Loverflows%d", c); println(" cmp $255, %%rax"); println(" jg .Loverflows%d", c); } else { // -128..127 println(" cmp $-128, %%rax"); println(" jl .Loverflows%d", c); println(" cmp $127, %%rax"); println(" jg .Loverflows%d", c); } println(" mov $0, %%eax"); println(" jmp .Lends%d", c); println(".Loverflows%d:", c); println(" mov $1, %%eax"); println(".Lends%d:", c); return; } else if (ty->size == 2) { if (node->lhs->ty->is_unsigned) { println(" movzwl %%di, %%eax"); } else { println(" movswl %%di, %%eax"); } println(" movslq %%eax, %%rax"); if (node->rhs->ty->is_unsigned) { println(" movzwl %%si, %%ecx"); } else { println(" movswl %%si, %%ecx"); } println(" movslq %%ecx, %%rcx"); println(" sub %%rcx, %%rax"); println(" mov %%ax, (%%rdx)"); if (ty->is_unsigned) { // 0..65535 println(" cmp $0, %%rax"); println(" jl .Loverflows%d", c); println(" cmp $65535, %%rax"); println(" jg .Loverflows%d", c); } else { // -32768..32767 println(" cmp $-32768, %%rax"); println(" jl .Loverflows%d", c); println(" cmp $32767, %%rax"); println(" jg .Loverflows%d", c); } println(" mov $0, %%eax"); println(" jmp .Lends%d", c); println(".Loverflows%d:", c); println(" mov $1, %%eax"); println(".Lends%d:", c); return; } else if (ty->size == 4) { // lhs -> %rax println(" mov %%edi, %%eax"); if (!node->lhs->ty->is_unsigned) println(" movslq %%eax, %%rax"); // rhs -> %rcx println(" mov %%esi, %%ecx"); if (!node->rhs->ty->is_unsigned) println(" movslq %%ecx, %%rcx"); println(" sub %%rcx, %%rax"); println(" mov %%eax, (%%rdx)"); if (ty->is_unsigned) { // 0..4294967295 println(" cmp $0, %%rax"); println(" jl .Loverflows%d", c); println(" mov $4294967295, %%rcx"); println(" cmp %%rcx, %%rax"); println(" jg .Loverflows%d", c); } else { // -2147483648..2147483647 println(" mov $-2147483648, %%rcx"); println(" cmp %%rcx, %%rax"); println(" jl .Loverflows%d", c); println(" mov $2147483647, %%rcx"); println(" cmp %%rcx, %%rax"); println(" jg .Loverflows%d", c); } println(" mov $0, %%eax"); println(" jmp .Lends%d", c); println(".Loverflows%d:", c); println(" mov $1, %%eax"); println(".Lends%d:", c); return; } else if (ty->size == 8) { // Use 128-bit arithmetic for 64-bit operands. // Build lhs128 in rax:rcx, rhs128 in rbx:r8 (low:high). // lhs low in %rdi, rhs low in %rsi. println(" mov %%rdi, %%rax"); if (node->lhs->ty->is_unsigned) { println(" xor %%rcx, %%rcx"); } else { println(" mov %%rdi, %%rcx"); println(" sar $63, %%rcx"); } println(" mov %%rsi, %%rbx"); if (node->rhs->ty->is_unsigned) { println(" xor %%r8, %%r8"); } else { println(" mov %%rsi, %%r8"); println(" sar $63, %%r8"); } // rax:rcx = lhs, rbx:r8 = rhs println(" sub %%rbx, %%rax"); println(" sbb %%r8, %%rcx"); // Now wide result is in rax:rcx. // Store truncated 64-bit result. println(" mov %%rax, (%%rdx)"); if (ty->is_unsigned) { // Unsigned 64-bit destination: overflow iff high 64 bits are not 0. println(" test %%rcx, %%rcx"); println(" sete %%al"); println(" xor $1, %%al"); println(" movzx %%al, %%eax"); } else { // Signed 64-bit destination: overflow iff high 64 bits are not // sign-extension of low 64 bits. println(" mov %%rax, %%r8"); println(" sar $63, %%r8"); // expected high (-1 or 0) println(" cmp %%r8, %%rcx"); println(" sete %%al"); println(" xor $1, %%al"); println(" movzx %%al, %%eax"); } return; } else if (ty->size == 16) { // __int128 destination println(" sub %%rcx, %%rax"); // sub low println(" sbb %%rsi, %%rdi"); // sbb high println(" mov %%rax, (%%rdx)"); // store result low println(" mov %%rdi, 8(%%rdx)"); // store result high } if (ty->is_unsigned) println(" setc %%al"); else println(" seto %%al"); println(" movzx %%al, %%eax"); println(" cmp $0, %%eax"); println(" jne .Loverflows%d", c); println(" mov $0, %%eax"); println(" jmp .Lends%d", c); println(".Loverflows%d:", c); println(" mov $1, %%eax"); println(".Lends%d:", c); } static void gen_fetchadd(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->ty->size == 16) { println(" mov %%rax, %%r10"); // val low println(" mov %%rdx, %%r11"); // val high pop_tmp("%rdi"); // addr println(" mov (%%rdi), %%rax"); // old low println(" mov 8(%%rdi), %%rdx"); // old high println("1:"); println(" mov %%rax, %%rbx"); println(" add %%r10, %%rbx"); println(" mov %%rdx, %%rcx"); println(" adc %%r11, %%rcx"); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); return; } pop_tmp("%rdi"); println(" lock xadd %s, (%%rdi)", reg_ax(node->ty->size)); } static void gen_add_fetch(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->ty->size == 16) { println(" mov %%rax, %%r10"); // val low println(" mov %%rdx, %%r11"); // val high pop_tmp("%rdi"); // addr println(" mov (%%rdi), %%rax"); // old low println(" mov 8(%%rdi), %%rdx"); // old high println("1:"); println(" mov %%rax, %%rbx"); println(" add %%r10, %%rbx"); println(" mov %%rdx, %%rcx"); println(" adc %%r11, %%rcx"); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); println(" mov %%rbx, %%rax"); println(" mov %%rcx, %%rdx"); return; } pop_tmp("%rdi"); println(" mov %%rax, %%rdx"); println(" lock xadd %s, (%%rdi)", reg_ax(node->ty->size)); println(" add %s, %s", reg_ax(node->ty->size), reg_dx(node->ty->size)); println(" mov %%rdx, %%rax"); } static void gen_sub_fetch(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->ty->size == 16) { println(" mov %%rax, %%r10"); // val low println(" mov %%rdx, %%r11"); // val high pop_tmp("%rdi"); // addr println(" mov (%%rdi), %%rax"); // old low println(" mov 8(%%rdi), %%rdx"); // old high println("1:"); println(" mov %%rax, %%rbx"); println(" sub %%r10, %%rbx"); println(" mov %%rdx, %%rcx"); println(" sbb %%r11, %%rcx"); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); println(" mov %%rbx, %%rax"); println(" mov %%rcx, %%rdx"); return; } println(" mov %%rax, %%rdx"); pop_tmp("%rdi"); println(" neg %s", reg_ax(node->ty->size)); println(" lock xadd %s, (%%rdi)", reg_ax(node->ty->size)); println(" sub %s, %s", reg_dx(node->ty->size), reg_ax(node->ty->size)); } static void gen_fetchsub(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->ty->size == 16) { println(" mov %%rax, %%r10"); // val low println(" mov %%rdx, %%r11"); // val high pop_tmp("%rdi"); // addr println(" mov (%%rdi), %%rax"); // old low println(" mov 8(%%rdi), %%rdx"); // old high println("1:"); println(" mov %%rax, %%rbx"); println(" sub %%r10, %%rbx"); println(" mov %%rdx, %%rcx"); println(" sbb %%r11, %%rcx"); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); return; } pop_tmp("%rdi"); println(" neg %s", reg_ax(node->ty->size)); println(" lock xadd %s, (%%rdi)", reg_ax(node->ty->size)); } static void gen_store_binop(Node *node, const char *insn) { gen_expr(node->rhs); push_xmm(0); gen_expr(node->lhs); pop_xmm(0); println(" %s %%xmm0, (%%rax)", insn); } static void gen_loadlps(Node *node) { gen_expr(node->lhs); push_xmm(0); gen_expr(node->rhs); pop_xmm(0); println(" movlps (%%rax), %%xmm0"); } static void gen_stmxcsr(Node *node) { if (node->lhs) { gen_expr(node->lhs); println(" stmxcsr (%%rax)"); } else { println(" stmxcsr -8(%%rsp)"); println(" mov -8(%%rsp), %%eax"); } } static void gen_single_addr_binop(Node *node, const char *insn){ gen_addr(node->lhs); println(" %s (%%rax)", insn); } static void gen_add_overflow(Node *node) { int c = count(); // Unique label counter Type *ty = node->builtin_dest->ty; if (ty->base) ty = ty->base; gen_expr(node->lhs); if (ty->size == 16) pushx_tmp(); else push_tmp(); gen_expr(node->rhs); if (ty->size == 16) pushx_tmp(); else push_tmp(); gen_expr(node->builtin_dest); push_tmp(); pop_tmp("%rdx"); if (ty->size == 16) popx_tmp("%rcx", "%rsi"); else pop_tmp("%rsi"); if (ty->size == 16) popx_tmp("%rax", "%rdi"); else pop_tmp("%rdi"); if (ty->size == 1) { println(" mov %%dil, %%al"); println(" add %%sil, %%al"); println(" mov %%al, (%%rdx)"); } else if (ty->size == 2) { println(" mov %%di, %%ax"); println(" add %%si, %%ax"); println(" mov %%ax, (%%rdx)"); } else if (ty->size == 4) { println(" mov %%edi, %%eax"); println(" add %%esi, %%eax"); println(" mov %%eax, (%%rdx)"); } else if (ty->size == 8) { println(" mov %%rdi, %%rax"); println(" add %%rsi, %%rax"); println(" mov %%rax, (%%rdx)"); } else if (ty->size == 16) { // __int128 // lhs in rax:rdi (low:high), rhs in rcx:rsi. rdx is result ptr println(" add %%rcx, %%rax"); // add low println(" adc %%rsi, %%rdi"); // adc high println(" mov %%rax, (%%rdx)"); // store result low println(" mov %%rdi, 8(%%rdx)"); // store result high } // Check for overflow // Check for overflow if (ty->is_unsigned) println(" setc %%al"); else println(" seto %%al"); println(" movzx %%al, %%eax"); // Zero-extend AL to EAX // Return 0 if no overflow, 1 if overflow println(" cmp $0, %%eax"); println(" jne .Loverflowa%d", c); println(" mov $0, %%eax"); println(" jmp .Lenda%d", c); println(".Loverflowa%d:", c); println(" mov $1, %%eax"); println(".Lenda%d:", c); } static void gen_umul_overflow(Node *node) { int c = count(); Type *ty = node->lhs->ty; if (ty->base) ty = ty->base; int size = ty->size; // Generate expressions gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); push_tmp(); gen_expr(node->builtin_dest); push_tmp(); // Pop arguments pop_tmp("%rdx"); // result pointer (can be NULL) pop_tmp("%rsi"); // rhs pop_tmp("%rdi"); // lhs println(" mov %%rdx, %%rcx"); // Multiply if (size == 1) { println(" movzbl %%di, %%eax"); println(" movzbl %%si, %%ebx"); println(" mul %%bl"); // AL * BL -> AX println(" jc .Loverflowm%d", c); } else if (size == 2) { println(" movzwl %%di, %%eax"); println(" movzwl %%si, %%ebx"); println(" mul %%bx"); // AX * BX -> DX:AX println(" jc .Loverflowm%d", c); } else if (size == 4) { println(" mov %%edi, %%eax"); println(" mul %%esi"); // EAX * ESI -> EDX:EAX println(" jc .Loverflowm%d", c); } else if (size >= 8) { println(" mov %%rdi, %%rax"); println(" mul %%rsi"); // RAX * RSI -> RDX:RAX println(" test %%rdx, %%rdx"); // overflow check println(" jnz .Loverflowm%d", c); } // Store result if destination pointer is not NULL println(" test %%rcx, %%rcx"); println(" jz .Ldonem%d", c); if (size == 1) println(" mov %%al, (%%rcx)"); else if (size == 2) println(" mov %%ax, (%%rcx)"); else if (size == 4) println(" mov %%eax, (%%rcx)"); else if (size == 8) println(" mov %%rax, (%%rcx)"); println(".Ldonem%d:", c); println(" mov $0, %%rax"); // return 0 for no overflow println(" jmp .Lend%d", c); // Overflow label println(".Loverflowm%d:", c); println(" test %%rcx, %%rcx"); // only store if pointer not NULL println(" jz .Loverflow_end%d", c); if (size == 1) println(" movb $0, (%%rcx)"); else if (size == 2) println(" movw $0, (%%rcx)"); else if (size == 4) println(" movl $0, (%%rcx)"); else if (size == 8) println(" movq $0, (%%rcx)"); println(".Loverflow_end%d:", c); println(" mov $1, %%rax"); // return 1 for overflow println(".Lend%d:", c); } static void gen_uadd_overflow(Node *node) { int c = count(); Type *ty = node->builtin_dest->ty; if (ty->base) ty = ty->base; gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); push_tmp(); gen_expr(node->builtin_dest); push_tmp(); pop_tmp("%rdx"); pop_tmp("%rsi"); pop_tmp("%rdi"); if (ty->size == 1) { println(" mov %%dil, %%al"); println(" add %%sil, %%al"); println(" mov %%al, (%%rdx)"); } else if (ty->size == 2) { println(" mov %%di, %%ax"); println(" add %%si, %%ax"); println(" mov %%ax, (%%rdx)"); } else if (ty->size == 4) { println(" mov %%edi, %%eax"); println(" add %%esi, %%eax"); println(" mov %%eax, (%%rdx)"); } else { println(" mov %%rdi, %%rax"); println(" add %%rsi, %%rax"); println(" mov %%rax, (%%rdx)"); } println(" setc %%al"); // carry flag = unsigned overflow println(" movzx %%al, %%eax"); // zero-extend AL to EAX // Return 0 if no overflow, 1 if overflow println(" cmp $0, %%eax"); println(" jne .Loverflowa%d", c); println(" mov $0, %%eax"); println(" jmp .Lenda%d", c); println(".Loverflowa%d:", c); println(" mov $1, %%eax"); println(".Lenda%d:", c); } static void gen_parity(Node *node) { gen_expr(node->lhs); if (node->lhs->kind == ND_NUM) { uint64_t x = node->lhs->val; x ^= x >> 32; x ^= x >> 16; x ^= x >> 8; x ^= x >> 4; x ^= x >> 2; x ^= x >> 1; int parity = x & 1; println(" mov $%d, %%eax", parity); } else { println(" mov %%rax, %%rcx"); // copy to rcx println(" shr $32, %%rcx"); println(" xor %%rcx, %%rax"); println(" mov %%rax, %%rcx"); println(" shr $16, %%rcx"); println(" xor %%rcx, %%rax"); println(" mov %%rax, %%rcx"); println(" shr $8, %%rcx"); println(" xor %%rcx, %%rax"); println(" mov %%rax, %%rcx"); println(" shr $4, %%rcx"); println(" xor %%rcx, %%rax"); println(" mov %%rax, %%rcx"); println(" shr $2, %%rcx"); println(" xor %%rcx, %%rax"); println(" mov %%rax, %%rcx"); println(" shr $1, %%rcx"); println(" xor %%rcx, %%rax"); println(" and $1, %%eax"); // final parity in eax } } static void gen_mwait(Node *node) { gen_expr(node->builtin_args[0]); push_tmp(); gen_expr(node->builtin_args[1]); push_tmp(); pop_tmp("%rcx"); pop_tmp("%rax"); println("mwait"); } static void gen_monitor(Node *node) { gen_expr(node->builtin_args[0]); push_tmp(); gen_expr(node->builtin_args[1]); push_tmp(); gen_expr(node->builtin_args[2]); push_tmp(); pop_tmp("%rdx"); pop_tmp("%rcx"); pop_tmp("%rax"); println("monitor"); } static void gen_movq128(Node *node) { gen_expr(node->lhs); println(" movq %%xmm0, %%xmm1"); println(" pxor %%xmm0, %%xmm0"); println(" movq %%xmm1, %%xmm0"); } static void gen_movnti(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->rhs->kind == ND_NUM) println(" mov $%ld, %%ecx", (int64_t)node->rhs->val); else println(" movq (%%rax), %%rcx"); pop_tmp("%rax"); println(" movnti %%ecx, (%%rax)"); } static void gen_movnti64(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->rhs->kind == ND_NUM) println(" mov $%ld, %%rcx", (int64_t)node->rhs->val); else println(" movq (%%rax), %%rcx"); pop_tmp("%rax"); println(" movnti %%rcx, (%%rax)"); } static void gen_movnt_binop(Node *node, const char *insn) { gen_expr(node->rhs); push_xmm(0); gen_expr(node->lhs); pop_xmm(0); int c = count(); println(" test $15, %%rax"); println(" jnz .L.movnt_unaligned.%d", c); println(" %s %%xmm0, (%%rax)", insn); println(" jmp .L.movnt_done.%d", c); println(".L.movnt_unaligned.%d:", c); // movnt* faults on unaligned memory; fall back to unaligned SSE store. if (!strcmp(insn, "movntpd")) println(" movupd %%xmm0, (%%rax)"); else println(" movdqu %%xmm0, (%%rax)"); println(".L.movnt_done.%d:", c); } static void gen_movntdqa(Node *node) { gen_expr(node->lhs); int c = count(); println(" test $15, %%rax"); println(" jnz .L.movntdqa_unaligned.%d", c); println(" movntdqa (%%rax), %%xmm0"); println(" jmp .L.movntdqa_done.%d", c); println(".L.movntdqa_unaligned.%d:", c); // movntdqa faults on unaligned memory; fall back to unaligned load. println(" movdqu (%%rax), %%xmm0"); println(".L.movntdqa_done.%d:", c); } static void gen_crc32qi(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); pop_tmp("%rcx"); println(" crc32b %%al, %%ecx"); println(" movl %%ecx, %%eax"); } static void gen_crc32di(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); pop_tmp("%rcx"); println(" crc32q %%rax, %%rcx"); println(" movl %%ecx, %%eax"); } static void gen_crc32hi(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); pop_tmp("%rcx"); println(" crc32w %%ax, %%ecx"); println(" movl %%ecx, %%eax"); } static void gen_crc32si(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); pop_tmp("%rcx"); println(" crc32l %%eax, %%ecx"); println(" movl %%ecx, %%eax"); } // Helper to emit MMX two-operand instruction static void gen_sse_binop1(Node *node, const char *insn, bool rhs_is_imm) { gen_expr(node->rhs); println(" movss %%xmm0, %%xmm1"); gen_expr(node->lhs); println(" %s %%xmm1, %%xmm0", insn); } static void gen_sse_binop2(Node *node, const char *insn, const char *reg, bool rhs_is_imm) { gen_expr(node->lhs); println(" %s %%xmm0, %%%s", insn, reg); } static void gen_sse_binop3(Node *node, const char *insn, bool rhs_is_imm) { gen_expr(node->rhs); push_xmm(0); gen_expr(node->lhs); pop_xmm(1); println(" %s %%xmm1, %%xmm0", insn); } static void gen_sse_binop4(Node *node, const char *insn, const char *insn2) { gen_expr(node->lhs); push_xmm(0); gen_expr(node->rhs); pop_xmm(1); println(" %s %%xmm0, %%xmm1", insn); println(" %s %%al", insn2); println(" movzx %%al, %%eax"); } static void gen_sse_binop5(Node *node, const char *insn, const char *insn2) { gen_expr(node->lhs); push_xmm(0); gen_expr(node->rhs); pop_xmm(1); println(" %s %%xmm1, %%xmm0", insn); println(" %s %%al", insn2); println(" movzx %%al, %%eax"); } static void gen_sse_binop6(Node *node, const char *insn, const char *insn2) { gen_expr(node->lhs); push_xmm(0); gen_expr(node->rhs); pop_xmm(1); println(" %s %%xmm0, %%xmm1", insn); println(" setnp %%dl"); println(" %s %%al", insn2); println(" and %%al, %%dl"); println(" movzx %%dl, %%eax"); } static void gen_sse_binop7(Node *node, const char *insn) { gen_expr(node->lhs); push_xmm(0); gen_expr(node->rhs); pop_xmm(1); println(" %s %%xmm0, %%xmm1", insn); println(" movdqu %%xmm1, %%xmm0"); } static void gen_sse_binop8(Node *node, const char *insn, const char *reg) { gen_expr(node->lhs); println(" movq (%%rax), %%xmm0"); println(" %s %%xmm0, %%%s", insn, reg); } static void gen_sse_binop9(Node *node, const char *insn) { gen_expr(node->lhs); push_xmm(0); gen_expr(node->rhs); pop_xmm(1); println(" %s %%xmm1, %%xmm0", insn); } static void gen_sse_binop10(Node *node, const char *insn, const char *reg) { gen_expr(node->lhs); println(" movq %%rax, %%rdi"); gen_expr(node->rhs); println(" %s %%%s, (%%rdi)", insn, reg); } static void gen_sse_binop11(Node *node, const char *insn, const char *reg) { gen_expr(node->lhs); println(" movq %%rax, %%rdi"); gen_expr(node->rhs); println(" %s %%%s, %%xmm0", insn, reg); } static void gen_sse_binop12(Node *node, const char *insn) { gen_expr(node->lhs); println(" movaps %%xmm0, %%xmm1"); println(" %s %%xmm0, %%xmm1", insn); } static void gen_lddqu(Node *node) { gen_addr(node->lhs); println(" lddqu (%%rax), %%xmm0"); } static void gen_sse_pblendvb128(Node *node) { assert(node->builtin_nargs == 3); gen_expr(node->builtin_args[0]); println(" movaps %%xmm0, %%xmm1"); gen_expr(node->builtin_args[1]); println(" movaps %%xmm0, %%xmm2"); gen_expr(node->builtin_args[2]); println(" pblendvb %%xmm2, %%xmm1"); println(" movaps %%xmm1, %%xmm0"); } static void gen_pblendvb256(Node *node) { assert(node->builtin_nargs == 3); gen_expr(node->builtin_args[2]); // mask -> ymm0 push_ymm(0); gen_expr(node->builtin_args[1]); // src2 -> ymm0 push_ymm(0); gen_expr(node->builtin_args[0]); // src1 -> ymm0 pop_ymm(2); // src2 -> ymm2 pop_ymm(1); // mask -> ymm1 // GCC: vpblendvb %ymm1, %ymm2, %ymm0, %ymm0 println(" vpblendvb %%ymm1, %%ymm2, %%ymm0, %%ymm0"); } static void gen_sse_blendvpx(Node *node, const char *insn) { assert(node->builtin_nargs == 3); gen_expr(node->builtin_args[0]); println(" movups (%%rax), %%xmm1"); gen_expr(node->builtin_args[1]); println(" movups (%%rax), %%xmm2"); gen_expr(node->builtin_args[2]); println(" movups (%%rax), %%xmm0"); println(" %s %%xmm0, %%xmm2, %%xmm1", insn); println(" movaps %%xmm1, %%xmm0"); } static void gen_pcmpgtb256_mask(Node *node) { assert(node->builtin_nargs == 3); // __builtin_ia32_pcmpgtb256_mask(A, B, U) returns a __mmask32 with: // result = U & (A > B) (signed compare per-lane) // // We don't require AVX-512 to compute the mask; AVX2 can do it via: // vpcmpgtb -> 0x00/0xff bytes // vpmovmskb -> extract MSBs to a 32-bit mask gen_expr(node->builtin_args[2]); push_tmp(); gen_expr(node->builtin_args[0]); //println(" vmovdqu %%ymm0, %%ymm1"); push_ymm(0); gen_expr(node->builtin_args[1]); push_ymm(0); //println(" vmovdqu %%ymm0, %%ymm2"); pop_ymm(2); pop_ymm(1); println(" vpcmpgtb %%ymm2, %%ymm1, %%ymm0"); println(" vpmovmskb %%ymm0, %%eax"); pop_tmp("%rcx"); println(" andl %%ecx, %%eax"); println(" vzeroupper"); } static void gen_pshufb256(Node *node) { gen_expr(node->rhs); //println(" vmovdqu %%ymm0, %%ymm1"); push_ymm(0); gen_expr(node->lhs); push_ymm(0); pop_ymm(0); pop_ymm(1); println(" vpshufb %%ymm1, %%ymm0, %%ymm0"); } static void gen_avx2_256(Node *node, const char *insn) { gen_expr(node->lhs); int64_t imm_bits = eval(node->rhs); if (imm_bits < 0 || imm_bits > 255 * 8) error_tok(node->tok, "%s:%d: in gen_avx2_256: immediate out of range", __FILE__, __LINE__); if (imm_bits % 8 != 0) error_tok(node->tok, "%s:%d: in gen_avx2_256: immediate must be multiple of 8", __FILE__, __LINE__); int64_t imm_bytes = imm_bits / 8; println(" %s $%ld, %%ymm0, %%ymm0", insn, imm_bytes); } static void gen_vinsertf128_si256(Node *node) { assert(node->builtin_nargs == 3); gen_expr(node->builtin_args[0]); // -> ymm0 //println(" vmovdqu %%ymm0, %%ymm1"); push_ymm(0); gen_expr(node->builtin_args[1]); // -> xmm0 //println(" vmovdqu %%xmm0, %%xmm2"); push_ymm(0); pop_ymm(2); pop_ymm(1); // imm must be constant Node *imm = node->builtin_args[2]; int64_t imm8 = eval(imm); if (imm8 < 0 || imm8 > 1) error_tok(imm->tok, "%s:%d: error: vinsertf128 imm must be 0 or 1", __FILE__, __LINE__); int val = imm8 & 1; println(" vinsertf128 $%d, %%xmm2, %%ymm1, %%ymm0", val); } static void gen_avx2_permdi256(Node *node) { gen_expr(node->lhs); println(" vpermq $%ld, %%ymm0, %%ymm0", (int64_t)eval(node->rhs)); } static void gen_avx2_psll_binop(Node *node, const char *insn) { gen_expr(node->lhs); // ymm0 = lhs if (node->rhs->kind == ND_NUM) { println(" %s $%ld, %%ymm0, %%ymm0", insn, (int64_t)node->rhs->val); } else { // Shift with non-immediate count takes an xmm for the count. // The count is in the low 64 bits of the xmm. push_vec(node->lhs->ty); gen_expr(node->rhs); println(" movq %%rax, %%xmm1"); pop_vec(node->lhs->ty, 0); println(" %s %%xmm1, %%ymm0, %%ymm0", insn); } } static void gen_avx2_palignr256(Node *node) { assert(node->builtin_nargs == 3); gen_expr(node->builtin_args[1]); // B -> ymm0 //println(" vmovdqu %%ymm0, %%ymm1"); // ymm1 = B push_ymm(0); gen_expr(node->builtin_args[0]); // A -> ymm0 pop_ymm(1); int64_t imm_bytes = eval(node->builtin_args[2]) / 8; println(" vpalignr $%ld, %%ymm1, %%ymm0, %%ymm0", imm_bytes); } static void gen_vperm2i128_si256(Node *node) { assert(node->builtin_nargs == 3); gen_expr(node->builtin_args[1]); // Y -> ymm0 //println(" vmovdqu %%ymm0, %%ymm1"); // ymm1 = Y push_ymm(0); gen_expr(node->builtin_args[0]); // X -> ymm0 pop_ymm(1); int64_t imm = eval(node->builtin_args[2]); println(" vperm2i128 $%ld, %%ymm1, %%ymm0, %%ymm0", imm); } static void gen_pblendd256(Node *node) { assert(node->builtin_nargs == 3); gen_expr(node->builtin_args[1]); // B -> ymm0 //println(" vmovdqu %%ymm0, %%ymm1"); // ymm1 = B push_ymm(0); gen_expr(node->builtin_args[0]); // A -> ymm0 pop_ymm(1); int64_t imm = eval(node->builtin_args[2]); println(" vpblendd $%ld, %%ymm1, %%ymm0, %%ymm0", imm); } static void gen_pmulhuw256(Node *node) { gen_expr(node->lhs); // A -> ymm0 //println(" vmovdqu %%ymm0, %%ymm1"); // ymm1 = A push_ymm(0); gen_expr(node->rhs); // B -> ymm0 pop_ymm(1); println(" vpmulhuw %%ymm0, %%ymm1, %%ymm0"); // ymm0 = (A * B) >> 16 } static void gen_andnotsi256(Node *node) { gen_expr(node->lhs); //println(" vmovdqu %%ymm0, %%ymm1"); // ymm1 = A push_ymm(0); gen_expr(node->rhs); // B -> ymm0 pop_ymm(1); println(" vpandn %%ymm0, %%ymm1, %%ymm0"); } static void gen_vextractf128_si256(Node *node) { gen_expr(node->lhs); // Source vector -> ymm0 Node *imm_node = node->rhs; int64_t imm = eval(imm_node); if (imm < 0 || imm > 1) error_tok(imm_node->tok, "vextractf128 imm must be 0 or 1"); println(" vextractf128 $%ld, %%ymm0, %%xmm0", imm); } static void gen_si256 (Node *node) { gen_expr(node->lhs); } static void gen_cvt_mmx_binop(Node *node, const char *insn) { gen_addr(node->lhs); println(" movups (%%rax), %%xmm0"); println(" %s %%xmm0, %%mm0", insn); println(" movq %%mm0, %%rax"); println(" movq %%rax, %%xmm0"); println(" emms"); } static void gen_cvt_sse_binop2(Node *node, const char *insn, const char *reg, bool is_address) { gen_expr(node->lhs); push_xmm(0); gen_expr(node->rhs); pop_xmm(0); if (is_address) println(" %s (%%%s), %%xmm0", insn, reg); else println(" %s %%%s, %%xmm0", insn, reg); } static void gen_cvt_mmx_binop3(Node *node, const char *insn) { gen_expr(node->lhs); println(" %s %%xmm0, %%mm0", insn); gen_addr(node->lhs); println(" movq %%mm0, %%rax"); println(" movq %%rax, %%xmm0"); println(" emms"); } static void gen_cvt_mmx_binop4(Node *node, const char *insn) { gen_expr(node->lhs); println(" movq (%%rax), %%mm0"); println(" %s %%mm0, %%xmm0", insn); println(" emms"); } // Helper to emit MMX two-operand instruction static void gen_mmx_binop(Node *node, const char *insn, bool rhs_is_imm) { gen_expr(node->lhs); println(" movq (%%rax), %%mm0"); if (rhs_is_imm) { if (node->rhs->kind == ND_NUM) { println(" %s $%ld, %%mm0", insn, (int64_t)node->rhs->val); } else { gen_expr(node->rhs); println(" movq %%rax, %%mm1"); println(" %s %%mm1, %%mm0", insn); } } else { gen_expr(node->rhs); println(" movq (%%rax), %%mm1"); println(" %s %%mm1, %%mm0", insn); } println(" movq %%mm0, %%rax"); println(" movq %%rax, %%xmm0"); println(" emms"); } static void gen_mmx_binop1(Node *node, const char *insn) { gen_expr(node->lhs); println(" movq (%%rax), %%mm0"); println(" %s %%mm0, %%mm0", insn); println(" movq %%mm0, %%rax"); println(" movq %%rax, %%xmm0"); println(" emms"); } static void gen_sse_testz(Node *node) { gen_expr(node->lhs); // %xmm0 = M push_xmm(0); gen_expr(node->rhs); // %xmm0 = V pop_xmm(1); // ptest performs V & M println(" ptest %%xmm0, %%xmm1"); // sets ZF and CF println(" setz %%al"); // AL = 1 if ZF=1 println(" movzx %%al, %%eax"); // zero-extend to EAX } static void gen_sse_testc(Node *node) { gen_expr(node->lhs); // %xmm0 = M push_xmm(0); gen_expr(node->rhs); // %xmm0 = V pop_xmm(1); // ptest xmm1, xmm0 → sets ZF/CF println(" ptest %%xmm0, %%xmm1"); // CF = ((V & M) != M) // set result based on CF println(" setc %%al"); // AL = 1 if CF=1 println(" movzx %%al, %%eax"); // zero-extend to EAX } static void gen_sse_testnzc(Node *node) { gen_expr(node->rhs); push_xmm(0); gen_expr(node->lhs); pop_xmm(1); println(" ptest %%xmm1, %%xmm0"); // ptestnzc returns 1 if ZF==0 AND CF==0 (not zero and not carry) println(" setnz %%al"); // al = 1 if ZF==0 println(" setnc %%cl"); // cl = 1 if CF==0 println(" and %%cl, %%al"); // al = al & cl println(" movzx %%al, %%eax"); } static void gen_cas(Node *node) { if (node->cas_addr->ty->base->size == 16) { gen_expr(node->cas_addr); push_tmp(); if (node->cas_new->ty && node->cas_new->ty->kind == TY_LDOUBLE && node->cas_new->kind == ND_VAR) { gen_addr(node->cas_new); println(" mov 8(%%rax), %%rdx"); println(" mov (%%rax), %%rax"); } else { gen_expr(node->cas_new); if (node->cas_new->ty && node->cas_new->ty->kind == TY_LDOUBLE) { println(" sub $16, %%rsp"); println(" fstpt (%%rsp)"); println(" pop %%rax"); println(" pop %%rdx"); } } pushx_tmp(); gen_expr(node->cas_old); println(" mov %%rax, %%r10"); println(" mov (%%r10), %%rax"); println(" mov 8(%%r10), %%rdx"); popx_tmp("%rbx", "%rcx"); // new -> rcx:rbx pop_tmp("%rdi"); // addr println(" lock cmpxchg16b (%%rdi)"); println(" sete %%cl"); println(" je 1f"); println(" mov %%rax, (%%r10)"); println(" mov %%rdx, 8(%%r10)"); println("1:"); println(" movzbl %%cl, %%eax"); return; } gen_expr(node->cas_addr); push_tmp(); gen_expr(node->cas_new); push_tmp(); gen_expr(node->cas_old); println(" mov %%rax, %%r10"); if (!node->cas_old->ty->base) error("%s:%d: in gen_cas :node->cas_old base type is null!", __FILE__, __LINE__); load(node->cas_old->ty->base); pop_tmp("%rdx"); // new pop_tmp("%rdi"); // addr if (!node->cas_addr->ty->base) error("%s:%d: in gen_cas : node->cas_addr base type is null!", __FILE__, __LINE__); int sz = node->cas_addr->ty->base->size; println(" lock cmpxchg %s, (%%rdi)", reg_dx(sz)); println(" sete %%cl"); println(" je 1f"); println(" mov %s, (%%r10)", reg_ax(sz)); println("1:"); println(" movzbl %%cl, %%eax"); return; } static void gen_bool_cas(Node *node) { gen_expr(node->cas_ptr); push_tmp(); gen_expr(node->cas_expected); if (node->cas_ptr->ty->base->size == 16) { pushx_tmp(); gen_expr(node->cas_desired); if (node->cas_desired->ty && node->cas_desired->ty->kind == TY_LDOUBLE) { println(" sub $16, %%rsp"); println(" fstpt (%%rsp)"); println(" pop %%rax"); println(" pop %%rdx"); } println(" mov %%rax, %%rbx"); println(" mov %%rdx, %%rcx"); popx_tmp("%rax", "%rdx"); // expected -> rdx:rax pop_tmp("%rdi"); // addr println(" lock cmpxchg16b (%%rdi)"); println(" sete %%al"); println(" movzbl %%al, %%eax"); return; } push_tmp(); gen_expr(node->cas_desired); push_tmp(); pop_tmp("%rdx"); pop_tmp("%rax"); pop_tmp("%rdi"); int sz = node->cas_ptr->ty->base->size; if (!node->cas_ptr->ty->base) error("%s:%d: in gen_bool_cas : node->cas_ptr base type is null!", __FILE__, __LINE__); println(" lock cmpxchg %s, (%%rdi)", reg_dx(sz)); println(" sete %%al"); println(" movzbl %%al, %%eax"); } static void gen_add_and_fetch(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->lhs->ty->base->size == 16) { println(" mov %%rax, %%r10"); // val low println(" mov %%rdx, %%r11"); // val high pop_tmp("%rdi"); // addr println(" mov (%%rdi), %%rax"); // old low println(" mov 8(%%rdi), %%rdx"); // old high println("1:"); println(" mov %%rax, %%rbx"); println(" add %%r10, %%rbx"); println(" mov %%rdx, %%rcx"); println(" adc %%r11, %%rcx"); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); println(" mov %%rbx, %%rax"); println(" mov %%rcx, %%rdx"); return; } pop_tmp("%rdi"); int sz = node->lhs->ty->base->size; println(" mov %%rax, %%rcx"); println(" lock xadd %s, (%%rdi)", reg_ax(sz)); println(" add %%rcx, %%rax"); } static void gen_sub_and_fetch(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->ty->size == 16) { println(" mov %%rax, %%r10"); // val low println(" mov %%rdx, %%r11"); // val high pop_tmp("%rdi"); // addr println(" mov (%%rdi), %%rax"); // old low println(" mov 8(%%rdi), %%rdx"); // old high println("1:"); println(" mov %%rax, %%rbx"); println(" sub %%r10, %%rbx"); println(" mov %%rdx, %%rcx"); println(" sbb %%r11, %%rcx"); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); println(" mov %%rbx, %%rax"); println(" mov %%rcx, %%rdx"); return; } push_tmp(); pop_tmp("%rax"); pop_tmp("%rdi"); int sz = node->lhs->ty->base->size; println(" mov %s, %s", reg_ax(sz), reg_cx(sz)); println(" neg %s", reg_ax(sz)); println(" lock xadd %s, (%%rdi)", reg_ax(sz)); println(" sub %s, %s", reg_cx(sz), reg_ax(sz)); } static void gen_prefetch(Node *node) { Node *ptr = node->builtin_args[0]; Node *rw = node->builtin_args[1]; Node *locality = node->builtin_args[2]; gen_expr(ptr); push_tmp(); if (rw) gen_expr(rw); if (locality) gen_expr(locality); int loc = 3; if (locality && locality->kind == ND_NUM) { loc = locality->val; } const char *instr; switch (loc) { case 0: instr = "prefetchnta"; break; case 1: instr = "prefetcht2"; break; case 2: instr = "prefetcht1"; break; case 3: instr = "prefetcht0"; break; default: instr = "prefetcht0"; break; } pop_tmp("%rax"); println(" %s (%%rax)", instr); } static void gen_fetchnand(Node *node) { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->lhs->ty->base->size == 16) { println(" mov %%rax, %%r10"); // val low println(" mov %%rdx, %%r11"); // val high pop_tmp("%rdi"); // addr println(" mov (%%rdi), %%rax"); // old low println(" mov 8(%%rdi), %%rdx"); // old high println("1:"); println(" mov %%rax, %%rbx"); println(" mov %%rdx, %%rcx"); println(" and %%r10, %%rbx"); println(" and %%r11, %%rcx"); println(" not %%rbx"); println(" not %%rcx"); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); if (node->kind == ND_NANDFETCH) { println(" mov %%rbx, %%rax"); println(" mov %%rcx, %%rdx"); } return; } println(" mov %%rax, %%rsi"); pop_tmp("%rdi"); int sz = node->lhs->ty->base->size; switch(sz) { case 1: println(" movzbl (%%rdi), %%rax"); break; case 2: println(" movzwl (%%rdi), %%rax"); break; case 4: println(" movl (%%rdi), %%eax"); break; case 8: println(" movq (%%rdi), %%rax"); break; default: error("%s:%d: in gen_fetchnand : unsupported size %d!", __FILE__, __LINE__, sz); } int label = count(); println(".L.fetchnand_loop_%d:", label); println(" mov %%rax, %%rdx"); println(" and %%rsi, %%rdx"); println(" not %%rdx"); println(" lock cmpxchg %s, (%%rdi)", reg_dx(sz)); println(" jnz .L.fetchnand_loop_%d", label); if (node->kind == ND_NANDFETCH) println(" mov %%rdx, %%rax"); } static void gen_cas_n(Node *node) { gen_expr(node->cas_addr); push_tmp(); gen_expr(node->cas_new); if (node->cas_new->ty && node->cas_new->ty->kind == TY_LDOUBLE) { println(" sub $16, %%rsp"); println(" fstpt (%%rsp)"); println(" pop %%rax"); println(" pop %%rdx"); } if (node->cas_addr->ty && node->cas_addr->ty->base && node->cas_addr->ty->base->size == 16) { pushx_tmp(); gen_expr(node->cas_old); if (node->cas_old->ty && node->cas_old->ty->kind == TY_LDOUBLE) { println(" sub $16, %%rsp"); println(" fstpt (%%rsp)"); println(" pop %%rax"); println(" pop %%rdx"); } // old is in rdx:rax popx_tmp("%rbx", "%rcx"); // new -> rcx:rbx pop_tmp("%rdi"); // addr println(" lock cmpxchg16b (%%rdi)"); // result (old value) is in rdx:rax, which is what we want to return return; } push_tmp(); gen_expr(node->cas_old); pop_tmp("%rdx"); /* new */ pop_tmp("%rdi"); /* addr */ int sz = node->cas_addr->ty->base->size; if (!node->cas_addr->ty->base) error("%s:%d: in gen_cas_n : node->cas_addr base type is null!", __FILE__, __LINE__); println(" lock cmpxchg %s, (%%rdi)", reg_dx(sz)); { Type *bt = node->cas_old->ty; switch (bt->kind) { case TY_BOOL: println(" movzx %%al, %%eax"); break; case TY_CHAR: if (bt->is_unsigned) println(" movzbl %%al, %%eax"); else println(" movsbl %%al, %%eax"); break; case TY_SHORT: if (bt->is_unsigned) println(" movzwl %%ax, %%eax"); else println(" movswl %%ax, %%eax"); break; default: break; } } return; } static void gen_single_binop(const char *insn) { println(" %s", insn); } static void gen_cvt_binop(Node *node, const char *insn) { gen_addr(node->lhs); if (node->lhs->kind == ND_VAR || node->lhs->kind == ND_MEMBER) { println(" %s (%%rax), %%rax", insn); } else { println(" %s %%xmm0, %%rax", insn); } } static void gen_atomic_is_lock_free(Node *node) { gen_expr(node->lhs); int label = count(); println(" cmp $0, %%rax"); println(" jle .L.not_lock_free.%d", label); println(" cmp $8, %%rax"); println(" jle .L.lock_free.%d", label); println(".L.not_lock_free.%d:", label); println(" mov $0, %%rax"); println(" jmp .L.lock_free_done.%d", label); println(".L.lock_free.%d:", label); println(" mov $1, %%rax"); println(".L.lock_free_done.%d:", label); } // Generate code for a given node. static void gen_expr(Node *node) { if (!node) error("%s:%d: error: in gen_expr : node is null!", __FILE__, __LINE__); if (node->tok && (node->tok->line_no != last_loc_line || node->tok->file->file_no != last_loc_file)) { println(" .loc %d %u", node->tok->file->file_no, node->tok->line_no); last_loc_line = node->tok->line_no; last_loc_file = node->tok->file->file_no; } switch (node->kind) { case ND_NULL_EXPR: return; case ND_NUM: { switch (node->ty->kind) { case TY_FLOAT: { union { float f32; uint32_t u32; } u = {node->fval}; println(" mov $%u, %%eax # float %Lf", u.u32, node->fval); println(" movq %%rax, %%xmm0"); return; } case TY_DOUBLE: { union { double f64; uint64_t u64; } u = {node->fval}; println(" mov $%lu, %%rax # double %Lf", u.u64, node->fval); println(" movq %%rax, %%xmm0"); return; } case TY_LDOUBLE: { union { long double f80; uint64_t u64[2]; } u; memset(&u, 0, sizeof(u)); u.f80 = node->fval; println(" mov $%lu, %%rax # long double %Lf", u.u64[0], node->fval); println(" mov %%rax, -16(%%rsp)"); println(" mov $%lu, %%rax", u.u64[1]); println(" mov %%rax, -8(%%rsp)"); println(" fldt -16(%%rsp)"); return; } case TY_INT128: { // Extract the 128-bit integer value into high and low 64-bit parts __int128 val = node->val; uint64_t low = (uint64_t)val; uint64_t high = (uint64_t)(val >> 64); println(" mov $%lu, %%rax # low 64 bits", low); println(" mov $%lu, %%rdx # high 64 bits", high); return; } } println(" mov $%ld, %%rax", (int64_t)node->val); return; } case ND_POS: gen_expr(node->lhs); return; case ND_NEG: gen_expr(node->lhs); if (is_int128(node->ty)) { gen_int128_op(node); return; } if (is_vector(node->ty)) { gen_vector_op(node); return; } switch (node->ty->kind) { case TY_FLOAT: println(" mov $1, %%rax"); println(" shl $31, %%rax"); println(" movq %%rax, %%xmm1"); println(" xorps %%xmm1, %%xmm0"); return; case TY_DOUBLE: println(" mov $1, %%rax"); println(" shl $63, %%rax"); println(" movq %%rax, %%xmm1"); println(" xorpd %%xmm1, %%xmm0"); return; case TY_LDOUBLE: println(" fchs"); return; } println(" neg %%rax"); return; case ND_VAR: gen_addr(node); if (!node->ty) add_type(node); load(node->ty); return; case ND_MEMBER: { gen_addr(node); if (!node->ty) error("%s:%d: in gen_expr : ND_MEMBER node type is null!", __FILE__, __LINE__); load(node->ty); Member *mem = node->member; if (mem->is_bitfield) { //from @fuhsnn bitfield boolean returned -1 instead of 1 if (mem->ty->kind == TY_BOOL) { println(" shr $%d, %%rax", mem->bit_offset); println(" and $1, %%eax"); return; } println(" shl $%d, %%rax", 64 - mem->bit_width - mem->bit_offset); if (mem->ty->is_unsigned) println(" shr $%d, %%rax", 64 - mem->bit_width); else println(" sar $%d, %%rax", 64 - mem->bit_width); } return; } case ND_DEREF: gen_expr(node->lhs); if (!node->ty) error("%s:%d: in gen_expr : ND_DEREF node type is null!", __FILE__, __LINE__); load(node->ty); return; case ND_ADDR: gen_addr(node->lhs); return; case ND_ASSIGN: // Optimization: Evaluate RHS first for simple scalars to reduce stack usage. // This avoids keeping the address on stack while evaluating RHS (which might involve calls). if (!is_bitfield(node->lhs) && !is_int128(node->ty) && !is_vector(node->ty) && node->ty && node->ty->kind != TY_STRUCT && node->ty->kind != TY_UNION && node->ty->kind != TY_FLOAT && node->ty->kind != TY_DOUBLE && node->ty->kind != TY_LDOUBLE) { gen_expr(node->rhs); push_tmp(); gen_addr(node->lhs); pop_tmp("%rdi"); // Value if (node->ty->size == 1) println(" mov %%dil, (%%rax)"); else if (node->ty->size == 2) println(" mov %%di, (%%rax)"); else if (node->ty->size == 4) println(" mov %%edi, (%%rax)"); else println(" mov %%rdi, (%%rax)"); println(" mov %%rdi, %%rax"); return; } gen_addr(node->lhs); int tmp_offset = push_tmp(); gen_expr(node->rhs); if (node->lhs->kind == ND_MEMBER && node->lhs->member->is_bitfield) { println(" mov %%rax, %%r10"); Member *mem = node->lhs->member; println(" mov %%rax, %%rdi"); if (mem->bit_width >= 64) { println(" mov $-1, %%rax"); println(" and %%rax, %%rdi"); } else if (mem->bit_width >= 32) { println(" mov $%ld, %%rax", (1L << mem->bit_width) - 1); println(" and %%rax, %%rdi"); } else { println(" and $%ld, %%rdi", (1L << mem->bit_width) - 1); } println(" shl $%d, %%rdi", mem->bit_offset); if (is_omit_fp(current_fn)) println(" mov (%%rsp), %%rax"); else println(" mov %d(%s), %%rax", tmp_offset, lvar_ptr); load(mem->ty); long mask = ((1L << mem->bit_width) - 1) << mem->bit_offset; println(" mov $%ld, %%r11", ~mask); println(" and %%r11, %%rax"); println(" or %%rdi, %%rax"); store(node->ty); println(" mov %%r10, %%rax"); if (mem->ty->kind == TY_BOOL) return; if (mem->bit_width < 64) { long mask2 = (1L << mem->bit_width) - 1; println(" mov $%ld, %%r11", mask2); println(" and %%r11, %%rax"); // Assignment to a bitfield yields the stored field value. // Normalize by field width only (independent of storage bit offset). if (!mem->ty->is_unsigned) { int shift = 64 - mem->bit_width; println(" shl $%d, %%rax", shift); println(" sar $%d, %%rax", shift); } } return; } store(node->ty); // Keep assignment-expression results canonical for narrow integer types. // The value in %rax may still carry wider intermediate bits even though // only 1/2 bytes were stored to memory. if (is_integer(node->ty)) { if (node->ty->kind == TY_BOOL) { println(" movzbl %%al, %%eax"); } else if (node->ty->size == 1) { if (node->ty->is_unsigned) println(" movzbl %%al, %%eax"); else println(" movsbl %%al, %%eax"); } else if (node->ty->size == 2) { if (node->ty->is_unsigned) println(" movzwl %%ax, %%eax"); else println(" movswl %%ax, %%eax"); } } return; case ND_STMT_EXPR: for (Node *n = node->body; n; n = n->next) { if (n->next) gen_stmt(n); else if (n->kind == ND_EXPR_STMT) gen_expr(n->lhs); else gen_stmt(n); } return; case ND_COMMA: gen_expr(node->lhs); if (node->lhs->ty && node->lhs->ty->kind == TY_LDOUBLE) println(" fstp %%st(0)"); gen_expr(node->rhs); return; case ND_CAST: gen_expr(node->lhs); if (!node->ty) error("%s:%d: in gen_expr : ND_CAST node type is null!", __FILE__, __LINE__); cast(node->lhs->ty, node->ty); return; case ND_MEMZERO: gen_mem_zero(node->var->offset, node->var->ty->size); return; case ND_COND: { if (is_const_expr(node->cond)) { Node *n = eval(node->cond) ? node->then : node->els; if (n) gen_expr(n); return; } int c = count(); gen_expr(node->cond); cmp_zero(node->cond->ty); println(" je .L.else.%d", c); gen_expr(node->then); println(" jmp .L.end.%d", c); println(".L.else.%d:", c); gen_expr(node->els); println(".L.end.%d:", c); return; } case ND_NOT: gen_expr(node->lhs); cmp_zero(node->lhs->ty); println(" sete %%al"); println(" movzx %%al, %%rax"); return; case ND_BITNOT: if (is_int128(node->ty)) { gen_int128_op(node); return; } if (is_vector(node->ty)) { gen_vector_op(node); return; } gen_expr(node->lhs); println(" not %%rax"); return; case ND_LOGAND: if (is_int128(node->ty)) { gen_int128_op(node); return; } if (is_vector(node->ty)) { gen_vector_op(node); return; } { int c = count(); gen_expr(node->lhs); cmp_zero(node->lhs->ty); println(" je .L.false.%d", c); gen_expr(node->rhs); cmp_zero(node->rhs->ty); println(" je .L.false.%d", c); println(" mov $1, %%rax"); println(" jmp .L.end.%d", c); println(".L.false.%d:", c); println(" mov $0, %%rax"); println(".L.end.%d:", c); return; } case ND_LOGOR: if (is_int128(node->ty)) { gen_int128_op(node); return; } if (is_vector(node->ty)) { gen_vector_op(node); return; } { int c = count(); gen_expr(node->lhs); cmp_zero(node->lhs->ty); println(" jne .L.true.%d", c); gen_expr(node->rhs); cmp_zero(node->rhs->ty); println(" jne .L.true.%d", c); println(" mov $0, %%rax"); println(" jmp .L.end.%d", c); println(".L.true.%d:", c); println(" mov $1, %%rax"); println(".L.end.%d:", c); return; } case ND_FUNCALL: { if (node->lhs->kind == ND_VAR && (!strcmp(sym(node->lhs->var), "alloca") || !strcmp(sym(node->lhs->var), "__builtin_alloca"))) { gen_expr(node->args); println(" mov %%rax, %%rdi"); //builtin_alloca(); builtin_alloca(node); return; } int stack_args = push_args(node); gen_expr(node->lhs); int gp = 0, fp = 0; // If the return type is a large struct/union, the caller passes // a pointer to a buffer as if it were the first argument. if (node->ret_buffer && node->ty->size > 16) pop(argreg64[gp++]); for (Node *arg = node->args; arg; arg = arg->next) { Type *ty = arg->ty; if (!ty) error("%s:%d: in gen_expr : type is null!", __FILE__, __LINE__); switch (ty->kind) { case TY_STRUCT: case TY_UNION: if (ty->size == 0) continue; if (!pass_by_reg(ty, gp, fp)) continue; if (has_flonum1(ty)) popf(fp++); else pop(argreg64[gp++]); if (ty->size > 8) { if (has_flonum2(ty)) popf(fp++); else pop(argreg64[gp++]); } break; case TY_VECTOR: if (fp < FP_MAX) pop_vec(ty, fp++); break; case TY_FLOAT: case TY_DOUBLE: if (fp < FP_MAX) popf(fp++); break; case TY_LDOUBLE: break; case TY_INT128: if (gp + 2 <= GP_MAX) { int a = gp++; int b = gp++; popx(argreg64[a], argreg64[b]); } break; default: if (gp < GP_MAX) pop(argreg64[gp++]); break; } } // Function call println(" mov %%rax, %%r10"); //println(" mov $%d, %%rax", fp); println(" mov $%d, %%al", fp); // Tail call optimization if (node->is_tail && opt_optimize_level3) { char *funcname = NULL; if (node->lhs->kind == ND_VAR && node->lhs->var->is_function) funcname = sym(node->lhs->var); if (funcname && strcmp(funcname, sym(current_fn)) == 0) { // Recursive tail call optimization Node *arg = node->args; Obj *param = current_fn->params; while (arg && param) { if (arg->pass_by_stack) { for (int i = 0; i < arg->ty->size; i += 8) { int dest_offset = param->offset + i; if (strcmp(param->ptr, "%rsp") == 0) dest_offset += current_fn->stack_size + depth * 8; println(" mov %d(%%rsp), %%r11", arg->stack_offset + i); println(" mov %%r11, %d(%s)", dest_offset, param->ptr); } } arg = arg->next; param = param->next; } // Restore stack pointer before jumping back to function body // .L.body is now before the sub instruction, so we just need to reset RSP if (is_omit_fp(current_fn)) { // No frame pointer: just clean up stack args if (stack_args > 0) println(" add $%d, %%rsp", stack_args * 8); //println(" add $%d, %%rsp", current_fn->stack_size); } else { // Frame pointer exists: restore RSP to base pointer bool use_rbx = (current_fn->stack_align > 16); char *base = use_rbx ? "%rbx" : "%rbp"; println(" mov %s, %%rsp", base); } depth -= stack_args; println(" jmp .L.body.%s", sym(current_fn)); return; } if (stack_args == 0 && current_fn->stack_size == 0) { if (is_omit_fp(current_fn)) { //println(" add $%d, %%rsp", current_fn->stack_size); println(" add $%d, %%rsp", stack_args * 8); } else { println(" mov %%rbp, %%rsp"); println(" pop %%rbp"); } println(" jmp *%%r10"); return; } } println(" call *%%r10"); println(" add $%d, %%rsp", stack_args * 8); depth -= stack_args; // It looks like the most significant 48 or 56 bits in RAX may // contain garbage if a function return type is short or bool/char, // respectively. We clear the upper bits here. switch (node->ty->kind) { case TY_BOOL: println(" movzx %%al, %%eax"); return; case TY_CHAR: if (node->ty->is_unsigned) println(" movzbl %%al, %%eax"); else println(" movsbl %%al, %%eax"); return; case TY_SHORT: if (node->ty->is_unsigned) println(" movzwl %%ax, %%eax"); else println(" movswl %%ax, %%eax"); return; } // If the return type is a small struct, a value is returned // using up to two registers. if (node->ret_buffer && node->ty->size <= 16) { copy_ret_buffer(node->ret_buffer); if (is_omit_fp(current_fn)) println(" lea %d(%%rsp), %%rax", node->ret_buffer->offset + current_fn->stack_size + depth * 8); else println(" lea %d(%s), %%rax", node->ret_buffer->offset, node->ret_buffer->ptr); } return; } case ND_LABEL_VAL: println(" lea %s(%%rip), %%rax", node->unique_label); return; case ND_CAS: gen_cas(node); return; case ND_CAS_N: gen_cas_n(node); return; case ND_ATOMIC_IS_LOCK_FREE: gen_atomic_is_lock_free(node); return; case ND_FETCHNAND: case ND_NANDFETCH: gen_fetchnand(node); return; case ND_ADD_AND_FETCH: gen_add_and_fetch(node); return; case ND_SUB_AND_FETCH: gen_sub_and_fetch(node); return; case ND_BOOL_CAS: gen_bool_cas(node); return; case ND_MEMBARRIER: case ND_SYNC: { println(" mfence"); // x86-64 instruction for full memory barrier return; } case ND_BUILTIN_MEMCPY: gen_memcpy(node); return; case ND_BUILTIN_MEMSET: gen_memset(node); return; case ND_BUILTIN_CLZ: { gen_expr(node->builtin_val); println(" bsr %%eax, %%eax"); println(" xor $31, %%eax"); return; } case ND_BUILTIN_CLZLL: case ND_BUILTIN_CLZL: { gen_expr(node->builtin_val); println(" bsr %%rax, %%rax"); println(" xor $63, %%eax"); return; } case ND_BUILTIN_CTZ: gen_builtin(node, "bsf", "eax"); return; case ND_BUILTIN_CTZLL: case ND_BUILTIN_CTZL: gen_builtin(node, "bsf", "rax"); return; case ND_BUILTIN_BSWAP16: { gen_expr(node->builtin_val); println(" mov %%ax, %%dx"); println(" rol $8, %%dx"); println(" mov %%dx, %%ax"); return; } case ND_BUILTIN_BSWAP32: { gen_expr(node->builtin_val); println(" bswap %%eax"); return; } case ND_BUILTIN_BSWAP64: { gen_expr(node->builtin_val); println(" bswap %%rax"); return; } case ND_BUILTIN_FRAME_ADDRESS: { int c = count(); gen_expr(node->lhs); // Guard: limit frame walking to 64 levels println(" mov $64, %%rdi"); println(" cmp %%rax, %%rdi"); println(" ja .Lframe_address_ok%d", c); // if rax < 64, continue println(" jmp .Lframe_address_null%d", c); // else, bail out println(".Lframe_address_ok%d:", c); println(" cmp $0, %%rax"); println(" je .Lframe_address_%d", c); // Frame-chain builtins must walk canonical frame pointers (%rbp), // not lvar_ptr (which may be %rbx when stack is realigned). println(" mov %%rbp, %%rcx"); println(".Lframe_address_loop%d:", c); println(" test %%rax, %%rax"); println(" jz .Lframe_address_done%d", c); println(" test %%rcx, %%rcx"); println(" jz .Lframe_address_null%d", c); println(" mov (%%rcx), %%rcx"); // rcx = *(rcx) (next frame) println(" sub $1, %%rax"); println(" jmp .Lframe_address_loop%d", c); println(".Lframe_address_done%d:", c); println(" mov %%rcx, %%rax"); // return result println(" jmp .Lframe_address_return%d", c); println(".Lframe_address_%d:", c); println(" mov %%rbp, %%rax"); // level 0: return current frame println(" jmp .Lframe_address_return%d", c); println(".Lframe_address_null%d:", c); println(" mov $0, %%rax"); // return NULL println(".Lframe_address_return%d:", c); return; } case ND_POPCOUNTL: case ND_POPCOUNTLL: gen_builtin(node, "popcnt", "rax"); return; case ND_POPCOUNT: gen_builtin(node, "popcnt", "eax"); return; case ND_EXPECT: { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); pop_tmp("%rdi"); println(" cmp %%rax, %%rdi"); println(" mov %%rdi, %%rax"); return; } case ND_ABORT: { println(" call abort"); return; } case ND_RETURN_ADDR: { // Return-address builtin is also anchored on canonical frame pointer. println(" mov %%rbp, %%rax"); int tmpdepth = eval(node->lhs); for (int i = 0; i < tmpdepth; i++) { println(" mov (%%rax), %%rax"); } println(" mov 8(%%rax), %%rax"); return; } case ND_UMULL_OVERFLOW: case ND_UMULLL_OVERFLOW: case ND_UMUL_OVERFLOW: gen_umul_overflow(node); return; case ND_UADDL_OVERFLOW: case ND_UADDLL_OVERFLOW: case ND_UADD_OVERFLOW: gen_uadd_overflow(node); return; case ND_BUILTIN_ADD_OVERFLOW: gen_add_overflow(node); return; case ND_BUILTIN_SUB_OVERFLOW: gen_sub_overflow(node); return; case ND_BUILTIN_MUL_OVERFLOW: gen_mul_overflow(node); return; case ND_UNREACHABLE: println(" // __builtin_unreachable: no code generation needed"); return; case ND_BUILTIN_ISNAN: { gen_expr(node->builtin_val); // Generate code for the expression if (node->builtin_val->ty->kind == TY_FLOAT) { // Use movss to move the float value and then compare println(" movss %%xmm0, %%xmm1"); println(" ucomiss %%xmm1, %%xmm1"); } else { // Use ucomisd for double println(" ucomisd %%xmm0, %%xmm0"); } println(" setp %%al"); println(" movzx %%al, %%eax"); return; } case ND_EXCH: { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); int sz = node->lhs->ty->base->size; if (sz == 16) { println(" mov %%rax, %%rbx"); println(" mov %%rdx, %%rcx"); pop_tmp("%rdi"); println(" mov (%%rdi), %%rax"); println(" mov 8(%%rdi), %%rdx"); println("1:"); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); return; } pop_tmp("%rdi"); println(" xchg %s, (%%rdi)", reg_ax(sz)); return; } case ND_EXCH_N: case ND_TESTANDSET: { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->ty && node->ty->kind == TY_FLOAT) println(" movd %%xmm0, %%eax"); else if (node->ty->kind == TY_DOUBLE) println(" movq %%xmm0, %%rax"); if (node->ty->size == 16) { if (node->rhs->ty && node->rhs->ty->kind == TY_LDOUBLE) { println(" sub $16, %%rsp"); println(" fstpt (%%rsp)"); println(" pop %%rax"); println(" pop %%rdx"); } println(" mov %%rax, %%rbx"); println(" mov %%rdx, %%rcx"); pop_tmp("%rdi"); println(" mov (%%rdi), %%rax"); println(" mov 8(%%rdi), %%rdx"); println("1:"); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); return; } pop_tmp("%rdi"); println(" xchg %s, (%%rdi)", reg_ax(node->ty->size)); if (node->ty->kind == TY_FLOAT) println(" movd %%eax, %%xmm0"); else if (node->ty->kind == TY_DOUBLE) println(" movq %%rax, %%xmm0"); return; } case ND_CMPEXCH: gen_cmpxchg(node); return; case ND_CMPEXCH_N: gen_cmpxchgn(node); return; case ND_TESTANDSETA: { gen_expr(node->lhs); push_tmp(); if (node->ty->size == 16) { pop_tmp("%rdi"); println(" mov (%%rdi), %%rax"); println(" mov 8(%%rdi), %%rdx"); println("1:"); println(" mov $1, %%rbx"); println(" xor %%rcx, %%rcx"); println(" lock cmpxchg16b (%%rdi)"); println(" jnz 1b"); println(" or %%rdx, %%rax"); println(" setne %%al"); println(" movzbl %%al, %%eax"); return; } println(" mov $1, %%eax"); pop_tmp("%rdi"); println(" xchg %s, (%%rdi)", reg_ax(node->ty->size)); return; } case ND_LOAD: { gen_expr(node->rhs); push_tmp(); gen_expr(node->lhs); if (node->ty->size == 16) { println(" mov (%%rax), %%rcx"); println(" mov 8(%%rax), %%rdx"); pop_tmp("%rdi"); println(" mov %%rcx, (%%rdi)"); println(" mov %%rdx, 8(%%rdi)"); return; } println(" mov (%%rax), %s", reg_ax(node->ty->size)); pop_tmp("%rdi"); println(" mov %s, (%%rdi)", reg_ax(node->ty->size)); return; } case ND_LOAD_N: { gen_expr(node->lhs); if (node->ty->size == 16) { println(" mov 8(%%rax), %%rdx"); println(" mov (%%rax), %%rax"); } else { println(" mov (%%rax), %s", reg_ax(node->ty->size)); if (node->ty->kind == TY_FLOAT) println(" movd %%eax, %%xmm0"); else if (node->ty->kind == TY_DOUBLE) println(" movq %%rax, %%xmm0"); } if (node->memorder) { println(" mfence"); } return; } case ND_STORE: { gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); pop_tmp("%rdi"); if (node->ty->size == 16) { println(" mov (%%rax), %%rcx"); println(" mov 8(%%rax), %%rdx"); println(" mov %%rcx, (%%rdi)"); println(" mov %%rdx, 8(%%rdi)"); if (node->memorder) { println(" mfence"); } return; } println(" mov (%%rax),%s", reg_ax(node->ty->size)); println(" mov %s, (%%rdi)", reg_ax(node->ty->size)); if (node->memorder) { println(" mfence"); } return; } case ND_STORE_N: gen_expr(node->lhs); push_tmp(); gen_expr(node->rhs); if (node->ty && node->ty->kind == TY_FLOAT) println(" movd %%xmm0, %%eax"); else if (node->ty && node->ty->kind == TY_DOUBLE) println(" movq %%xmm0, %%rax"); if (node->ty && node->ty->size == 16) { if (node->rhs->ty && node->rhs->ty->kind == TY_LDOUBLE) { println(" sub $16, %%rsp"); println(" fstpt (%%rsp)"); println(" pop %%rax"); println(" pop %%rdx"); } println(" mov %%rax, %%rbx"); println(" mov %%rdx, %%rcx"); pop_tmp("%rdi"); println(" mov %%rbx, (%%rdi)"); println(" mov %%rcx, 8(%%rdi)"); if (node->memorder) { println(" mfence"); } return; } pop_tmp("%rdi"); println(" mov %s, (%%rdi)", reg_ax(node->ty->size)); if (node->memorder) { println(" mfence"); } return; case ND_CLEAR: gen_expr(node->lhs); println(" mov %%rax, %%rdi"); println(" xor %%eax, %%eax"); println(" mov %s, (%%rdi)", reg_ax(node->ty->size)); if (node->memorder) { println(" mfence"); } return; case ND_FETCHADD: gen_fetchadd(node); return; case ND_FETCHSUB: gen_fetchsub(node); return; case ND_ADDFETCH: gen_add_fetch(node); return; case ND_SUBFETCH: gen_sub_fetch(node); return; case ND_FETCHXOR: HandleAtomicArithmetic(node, "xor", false); return; case ND_FETCHAND: HandleAtomicArithmetic(node, "and", false); return; case ND_FETCHOR: HandleAtomicArithmetic(node, "or", false); return; case ND_ORFETCH: HandleAtomicArithmetic(node, "or", true); return; case ND_ANDFETCH: HandleAtomicArithmetic(node, "and", true); return; case ND_XORFETCH: HandleAtomicArithmetic(node, "xor", true); return; case ND_RELEASE: gen_release(node); return; case ND_ALLOC: gen_alloc(node); return; case ND_BUILTIN_NANF: case ND_BUILTIN_HUGE_VALF: case ND_BUILTIN_INFF: { union { float f; uint32_t i; } u; u.f = node->fval; println(" mov $%u, %%eax", u.i); println(" movd %%eax, %%xmm0"); return; } case ND_BUILTIN_NAN: case ND_BUILTIN_HUGE_VAL: case ND_BUILTIN_INF: { union { double d; uint64_t i; } u; u.d = node->fval; println(" movq $%lu, %%rax", u.i); println(" movq %%rax, %%xmm0"); return; } case ND_BUILTIN_NANL: case ND_BUILTIN_HUGE_VALL: { union { long double ld; uint8_t bytes[10]; } u; u.ld = node->fval; for (int i = 0; i < 10; i++) println(" movb $%d, -%d(%%rsp)", u.bytes[i], 10 - i); println(" fldt -10(%%rsp)"); return; } case ND_EMMS: gen_single_binop("emms"); return; case ND_SFENCE: gen_single_binop("sfence"); return; case ND_LFENCE: gen_single_binop("lfence"); return; case ND_MFENCE: gen_single_binop("mfence"); return; case ND_PAUSE: gen_single_binop("pause"); return; case ND_STMXCSR: gen_stmxcsr(node); return; case ND_LDMXCSR: gen_single_addr_binop(node, "ldmxcsr"); return; case ND_SHUFPS: gen_shuf_binop(node, "shufps"); return; case ND_SHUFPD: gen_shuf_binop(node, "shufpd"); return; case ND_SHUFFLE: gen_shuffle(node, "shufps"); return; case ND_CVTPI2PS: gen_cvtpi2ps(node); return; case ND_CVTPS2PI: gen_cvt_mmx_binop3(node, "cvtps2pi"); return; case ND_CVTSS2SI: gen_sse_binop2(node, "cvtss2si", "eax", false); return; case ND_CVTSS2SI64: gen_cvt_binop(node, "cvtss2siq"); return; case ND_CVTTSS2SI: gen_cvt_binop(node, "cvttss2si"); return; case ND_CVTTSS2SI64: gen_cvt_binop(node, "cvttss2siq"); return; case ND_CVTTPS2PI: gen_cvt_mmx_binop(node, "cvttps2pi"); return; case ND_CVTSI2SS: gen_cvt_sse_binop2(node, "cvtsi2ss", "eax", false); return; case ND_CVTSI642SS: gen_cvt_sse_binop2(node, "cvtsi2ss", "rax", false); return; case ND_MOVLHPS: gen_sse_binop3(node, "movlhps", false); return; case ND_MOVHLPS: gen_sse_binop3(node, "movhlps", false); return; case ND_UNPCKHPS: gen_sse_binop3(node, "unpckhps", false); return; case ND_UNPCKLPS: gen_sse_binop3(node, "unpcklps", false); return; case ND_LOADHPS: gen_loadhps(node); return; case ND_STOREHPS: gen_store_binop(node, "movhps"); return; case ND_LOADLPS: gen_loadlps(node); return; case ND_STORELPS: gen_store_binop(node, "movlps"); return; case ND_MOVMSKPS: gen_sse_binop2(node, "movmskps", "eax", false); return; case ND_CLFLUSH: gen_single_addr_binop(node, "clflush"); return; case ND_VECINITV2SI: gen_vec_init_v2si(node); return; case ND_VECEXTV16QI: case ND_VECEXTV8HI: case ND_VECEXTV2SI: case ND_VECEXTV2DI: case ND_VECEXTV4SI: gen_vec_ext(node); return; case ND_PACKSSWB: gen_mmx_binop(node, "packsswb", false); return; case ND_PACKSSDW: gen_mmx_binop(node, "packssdw", false); return; case ND_PACKUSWB: gen_mmx_binop(node, "packuswb", false); return; case ND_PUNPCKHBW: gen_mmx_binop(node, "punpckhbw", false); return; case ND_PUNPCKHWD: gen_mmx_binop(node, "punpckhwd", false); return; case ND_PUNPCKHDQ: gen_mmx_binop(node, "punpckhdq", false); return; case ND_PUNPCKLBW: gen_mmx_binop(node, "punpcklbw", false); return; case ND_PUNPCKLWD: gen_mmx_binop(node, "punpcklwd", false); return; case ND_PUNPCKLDQ: gen_mmx_binop(node, "punpckldq", false); return; case ND_PADDB: gen_mmx_binop(node, "paddb", false); return; case ND_PADDW: gen_mmx_binop(node, "paddw", false); return; case ND_PADDD: gen_mmx_binop(node, "paddd", false); return; case ND_PADDQ: gen_mmx_binop(node, "paddq", false); return; case ND_PADDSB: gen_mmx_binop(node, "paddsb", false); return; case ND_PADDSW: gen_mmx_binop(node, "paddsw", false); return; case ND_PADDUSB: gen_mmx_binop(node, "paddusb", false); return; case ND_PADDUSW: gen_mmx_binop(node, "paddusw", false); return; case ND_PSUBB: gen_mmx_binop(node, "psubb", false); return; case ND_PSUBW: gen_mmx_binop(node, "psubw", false); return; case ND_PSUBD: gen_mmx_binop(node, "psubd", false); return; case ND_PSUBQ: gen_mmx_binop(node, "psubq", false); return; case ND_PSUBSB: gen_mmx_binop(node, "psubsb", false); return; case ND_PSUBSW: gen_mmx_binop(node, "psubsw", false); return; case ND_PSUBUSB: gen_mmx_binop(node, "psubusb", false); return; case ND_PSUBUSW: gen_mmx_binop(node, "psubusw", false); return; case ND_PMADDWD: gen_mmx_binop(node, "pmaddwd", false); return; case ND_PMULHW: gen_mmx_binop(node, "pmulhw", false); return; case ND_PMULLW: gen_mmx_binop(node, "pmullw", false); return; case ND_PSLLW: gen_mmx_binop(node, "psllw", false); return; case ND_PSLLWI: gen_mmx_binop(node, "psllw", true); return; case ND_PSLLD: gen_mmx_binop(node, "pslld", false); return; case ND_PSLLDI: gen_mmx_binop(node, "pslld", true); return; case ND_PSLLQ: gen_mmx_binop(node, "psllq", false); return; case ND_PSLLQI: gen_mmx_binop(node, "psllq", true); return; case ND_PSRAW: gen_mmx_binop(node, "psraw", false); return; case ND_PSRAWI: gen_mmx_binop(node, "psraw", true); return; case ND_PSRAD: gen_mmx_binop(node, "psrad", false); return; case ND_PSRADI: gen_mmx_binop(node, "psrad", true); return; case ND_PSRLW: gen_mmx_binop(node, "psrlw", false); return; case ND_PSRLWI: gen_mmx_binop(node, "psrlw", true); return; case ND_PSRLD: gen_mmx_binop(node, "psrld", false); return; case ND_PSRLDI: gen_mmx_binop(node, "psrld", true); return; case ND_PSRLQ: gen_mmx_binop(node, "psrlq", false); return; case ND_PSRLQI: gen_mmx_binop(node, "psrlq", true); return; case ND_PAND: gen_mmx_binop(node, "pand", false); return; case ND_PANDN: gen_mmx_binop(node, "pandn", false); return; case ND_POR: gen_mmx_binop(node, "por", false); return; case ND_PXOR: gen_mmx_binop(node, "pxor", false); return; case ND_PCMPEQB: gen_mmx_binop(node, "pcmpeqb", false); return; case ND_PCMPGTB: gen_mmx_binop(node, "pcmpgtb", false); return; case ND_PCMPEQW: gen_mmx_binop(node, "pcmpeqw", false); return; case ND_PCMPGTW: gen_mmx_binop(node, "pcmpgtw", false); return; case ND_PCMPEQD: gen_mmx_binop(node, "pcmpeqd", false); return; case ND_PCMPGTD: gen_mmx_binop(node, "pcmpgtd", false); return; case ND_VECINITV4HI: gen_vec_init_binop(node, "pinsrw"); return; case ND_VECINITV8QI: gen_vec_init_binop(node, "pinsrb"); return; case ND_ADDSS: gen_sse_binop1(node, "addss", false); return; case ND_SUBSS: gen_sse_binop1(node, "subss", false); return; case ND_MULSS: gen_sse_binop1(node, "mulss", false); return; case ND_DIVSS: gen_sse_binop1(node, "divss", false); return; case ND_SQRTSS: gen_sse_binop2(node, "sqrtss", "xmm0", false); return; case ND_RCPSS: gen_sse_binop2(node, "rcpss", "xmm0", false); return; case ND_RSQRTSS: gen_sse_binop2(node, "rsqrtss", "xmm0", false); return; case ND_MINSS: gen_sse_binop1(node, "minss", false); return; case ND_MAXSS: gen_sse_binop1(node, "maxss", false); return; case ND_SQRTPS: gen_sse_binop2(node, "sqrtps", "xmm0", false); return; case ND_RCPPS: gen_sse_binop2(node, "rcpps", "xmm0", false); return; case ND_RSQRTPS: gen_sse_binop2(node, "rsqrtps", "xmm0", false); return; case ND_MINPS: gen_sse_binop3(node, "minps", false); return; case ND_MAXPS: gen_sse_binop3(node, "maxps", false); return; case ND_ANDPS: gen_sse_binop3(node, "andps", false); return; case ND_ANDNPS: gen_sse_binop3(node, "andnps", false); return; case ND_ORPS: gen_sse_binop3(node, "orps", false); return; case ND_XORPS: gen_sse_binop3(node, "xorps", false); return; case ND_CMPEQSS: gen_sse_binop3(node, "cmpeqss", false); return; case ND_CMPLTSS: gen_sse_binop3(node, "cmpltss", false); return; case ND_CMPLESS: gen_sse_binop3(node, "cmpless", false); return; case ND_MOVSS: gen_sse_binop3(node, "movss", false); return; case ND_CMPNEQSS: gen_sse_binop3(node, "cmpneqss", false); return; case ND_CMPNLTSS: gen_sse_binop3(node, "cmpnltss", false); return; case ND_CMPNLESS: gen_sse_binop3(node, "cmpnless", false); return; case ND_CMPORDSS: gen_sse_binop3(node, "cmpordss", false); return; case ND_CMPUNORDSS: gen_sse_binop3(node, "cmpunordss", false); return; case ND_CMPEQPS: gen_sse_binop3(node, "cmpeqps", false); return; case ND_CMPLTPS: gen_sse_binop3(node, "cmpltps", false); return; case ND_CMPLEPS: gen_sse_binop3(node, "cmpleps", false); return; case ND_CMPGTPS: gen_sse_binop3(node, "cmpps $0x6,", false); return; case ND_CMPGEPS: gen_sse_binop3(node, "cmpps $0xD,", false); return; case ND_CMPNEQPS: gen_sse_binop3(node, "cmpps $4,", false); return; case ND_CMPNLTPS: gen_sse_binop3(node, "cmpps $5,", false); return; case ND_CMPNLEPS: gen_sse_binop3(node, "cmpps $6,", false); return; case ND_CMPNGTPS: gen_sse_binop3(node, "cmpps $2,", false); return; case ND_CMPNGEPS: gen_sse_binop3(node, "cmpps $1,", false); return; case ND_CMPORDPS: gen_sse_binop3(node, "cmpordps", false); return; case ND_CMPUNORDPS: gen_sse_binop3(node, "cmpunordps", false); return; case ND_PHADDW128: gen_sse_binop3(node, "phaddw", false); return; case ND_PHADDD128: gen_sse_binop3(node, "phaddd", false); return; case ND_PHADDSW128: gen_sse_binop3(node, "phaddsw", false); return; case ND_PHADDW: gen_mmx_binop(node, "phaddw", false); return; case ND_PHADDD: gen_mmx_binop(node, "phaddd", false); return; case ND_PHADDSW: gen_mmx_binop(node, "phaddsw", false); return; case ND_COMIEQ: gen_sse_binop4(node, "comiss", "sete"); return; case ND_COMILT: gen_sse_binop4(node, "comiss", "setb"); return; case ND_COMILE: gen_sse_binop4(node, "comiss", "setbe"); return; case ND_COMIGT: gen_sse_binop4(node, "comiss", "seta"); return; case ND_COMIGE: gen_sse_binop5(node, "comiss", "setae"); return; case ND_COMINEQ: gen_sse_binop4(node, "comiss", "setne"); return; case ND_UCOMIEQ: gen_sse_binop6(node, "comiss", "sete"); return; case ND_UCOMILT: gen_sse_binop6(node, "comiss", "setb"); return; case ND_UCOMILE: gen_sse_binop6(node, "ucomiss", "setbe"); return; case ND_UCOMIGT: gen_sse_binop5(node, "ucomiss", "seta"); return; case ND_UCOMIGE: gen_sse_binop5(node, "ucomiss", "setae"); return; case ND_UCOMINEQ: gen_sse_binop4(node, "ucomiss", "setne"); return; case ND_PMAXSW: gen_sse_binop7(node, "pmaxsw"); return; case ND_PMAXUB: gen_sse_binop7(node, "pmaxub"); return; case ND_PMINSW: gen_sse_binop7(node, "pminsw"); return; case ND_PMINUB: gen_sse_binop7(node, "pminub"); return; case ND_PMOVMSKB: gen_sse_binop8(node, "pmovmskb", "eax"); return; case ND_PMULHUW: gen_sse_binop9(node, "pmulhuw"); return; case ND_MASKMOVQ: gen_maskmovq(node); return; case ND_PAVGB: gen_mmx_binop(node, "pavgb", false); return; case ND_PAVGW: gen_mmx_binop(node, "pavgw", false); return; case ND_PSADBW: gen_mmx_binop(node, "psadbw", false); return; case ND_MOVNTQ: gen_sse_binop10(node, "movnti", "rax"); return; case ND_MOVNTPS: gen_sse_binop10(node, "movaps", "xmm0"); return; case ND_ADDSD: gen_sse_binop3(node, "addsd", false); return; case ND_SUBSD: gen_sse_binop3(node, "subsd", false); return; case ND_MULSD: gen_sse_binop3(node, "mulsd", false); return; case ND_DIVSD: gen_sse_binop3(node, "divsd", false); return; case ND_SQRTPD: gen_sse_binop2(node, "sqrtpd", "xmm0", false); return; case ND_MOVSD: gen_sse_binop3(node, "movsd", false); return; case ND_SQRTSD: gen_sse_binop2(node, "sqrtsd", "xmm0", false); return; case ND_MINPD: gen_sse_binop3(node, "minpd", false); return; case ND_MINSD: gen_sse_binop3(node, "minsd", false); return; case ND_MAXPD: gen_sse_binop3(node, "maxpd", false); return; case ND_MAXSD: gen_sse_binop3(node, "maxsd", false); return; case ND_ANDPD: gen_sse_binop3(node, "andpd", false); return; case ND_ANDNPD: gen_sse_binop3(node, "andnpd", false); return; case ND_ORPD: gen_sse_binop3(node, "orpd", false); return; case ND_XORPD: gen_sse_binop3(node, "xorpd", false); return; case ND_CMPEQPD: gen_sse_binop3(node, "cmpeqpd", false); return; case ND_CMPLTPD: gen_sse_binop3(node, "cmpltpd", false); return; case ND_CMPLEPD: gen_sse_binop3(node, "cmplepd", false); return; case ND_CMPGTPD: gen_sse_binop3(node, "cmpnlepd", false); return; case ND_CMPGEPD: gen_sse_binop3(node, "cmpnltpd", false); return; case ND_CMPNEQPD: gen_sse_binop3(node, "cmpneqpd", false); return; case ND_CMPNLTPD: gen_sse_binop3(node, "cmpnltpd", false); return; case ND_CMPNLEPD: gen_sse_binop3(node, "cmpnlepd", false); return; case ND_CMPNGTPD: gen_sse_binop3(node, "cmplepd", false); return; case ND_CMPNGEPD: gen_sse_binop3(node, "cmpltpd", false); return; case ND_CMPORDPD: gen_sse_binop3(node, "cmpordpd", false); return; case ND_CMPUNORDPD: gen_sse_binop3(node, "cmpunordpd", false); return; case ND_CMPEQSD: gen_sse_binop3(node, "cmpeqsd", false); return; case ND_CMPLTSD: gen_sse_binop3(node, "cmpltsd", false); return; case ND_CMPLESD: gen_sse_binop3(node, "cmplesd", false); return; case ND_CMPNEQSD: gen_sse_binop3(node, "cmpneqsd", false); return; case ND_CMPNLTSD: gen_sse_binop3(node, "cmpnltsd", false); return; case ND_CMPNLESD: gen_sse_binop3(node, "cmpnlesd", false); return; case ND_CMPORDSD: gen_sse_binop3(node, "cmpordsd", false); return; case ND_CMPUNORDSD: gen_sse_binop3(node, "cmpunordsd", false); return; case ND_COMISDEQ: gen_sse_binop4(node, "comisd", "sete"); return; case ND_COMISDLT: gen_sse_binop4(node, "comisd", "setb"); return; case ND_COMISDLE: gen_sse_binop4(node, "comisd", "setbe"); return; case ND_COMISDGT: gen_sse_binop4(node, "comisd", "seta"); return; case ND_COMISDGE: gen_sse_binop4(node, "comisd", "setae"); return; case ND_COMISDNEQ: gen_sse_binop4(node, "comisd", "setne"); return; case ND_UCOMISDEQ: gen_sse_binop4(node, "ucomisd", "sete"); return; case ND_UCOMISDLT: gen_sse_binop4(node, "ucomisd", "setb"); return; case ND_UCOMISDLE: gen_sse_binop4(node, "ucomisd", "setbe"); return; case ND_UCOMISDGT: gen_sse_binop4(node, "ucomisd", "seta"); return; case ND_UCOMISDGE: gen_sse_binop4(node, "ucomisd", "setae"); return; case ND_UCOMISDNEQ: gen_sse_binop4(node, "ucomisd", "setne"); return; case ND_MOVQ128: gen_movq128(node); return; case ND_CVTDQ2PD: gen_sse_binop2(node, "cvtdq2pd", "xmm0", false); return; case ND_CVTDQ2PS: gen_sse_binop2(node, "cvtdq2ps", "xmm0", false); return; case ND_CVTPD2DQ: gen_sse_binop2(node, "cvtpd2dq", "xmm0", false); return; case ND_CVTPD2PI: gen_cvt_mmx_binop3(node, "cvtpd2pi"); return; case ND_CVTPD2PS: gen_sse_binop2(node, "cvtpd2ps", "xmm0", false); return; case ND_CVTTPD2DQ: gen_sse_binop2(node, "cvttpd2dq", "xmm0", false); return; case ND_CVTTPD2PI: gen_cvt_mmx_binop3(node, "cvttpd2pi"); return; case ND_CVTPI2PD: gen_cvt_mmx_binop4(node, "cvtpi2pd"); return; case ND_CVTPS2DQ: gen_sse_binop2(node, "cvtps2dq", "xmm0", false); return; case ND_CVTTPS2DQ: gen_sse_binop2(node, "cvttps2dq", "xmm0", false); return; case ND_CVTPS2PD: gen_sse_binop2(node, "cvtps2pd", "xmm0", false); return; case ND_CVTSD2SI: gen_sse_binop2(node, "cvtsd2si", "eax", false); return; case ND_CVTSD2SI64: gen_sse_binop2(node, "cvtsd2siq", "rax", false); return; case ND_CVTTSD2SI: gen_sse_binop2(node, "cvttsd2si", "eax", false); return; case ND_CVTTSD2SI64: gen_sse_binop2(node, "cvttsd2siq", "rax", false); return; case ND_CVTSD2SS: gen_sse_binop3(node, "cvtsd2ss", false); return; case ND_CVTSI2SD: gen_sse_binop11(node, "cvtsi2sd", "rax"); return; case ND_CVTSI642SD: gen_sse_binop11(node, "cvtsi2sdq", "rax"); return; case ND_CVTSS2SD: gen_sse_binop3(node, "cvtss2sd", false); return; case ND_UNPCKHPD: gen_sse_binop3(node, "unpckhpd", false); return; case ND_UNPCKLPD: gen_sse_binop3(node, "unpcklpd", false); return; case ND_LOADHPD: gen_cvt_sse_binop2(node, "movhpd", "rax", true); return; case ND_LOADLPD: gen_cvt_sse_binop2(node, "movlpd", "rax", true); return; case ND_MOVMSKPD: gen_sse_binop2(node, "movmskpd", "rax", false); return; case ND_PACKSSWB128: gen_packss128_binop(node, "packsswb"); return; case ND_PACKSSDW128: gen_packss128_binop(node, "packssdw"); return; case ND_PACKUSWB128: gen_packss128_binop(node, "packuswb"); return; case ND_PUNPCKHBW128: gen_packss128_binop(node, "punpckhbw"); return; case ND_PUNPCKHWD128: gen_packss128_binop(node, "punpckhwd"); return; case ND_PUNPCKHDQ128: gen_packss128_binop(node, "punpckhdq"); return; case ND_PUNPCKHQDQ128: gen_packss128_binop(node, "punpckhqdq"); return; case ND_PUNPCKLBW128: gen_packss128_binop(node, "punpcklbw"); return; case ND_PUNPCKLWD128: gen_packss128_binop(node, "punpcklwd"); return; case ND_PUNPCKLDQ128: gen_packss128_binop(node, "punpckldq"); return; case ND_PUNPCKLQDQ128: gen_packss128_binop(node, "punpcklqdq"); return; case ND_PADDSB128: gen_sse_binop3(node, "paddsb", false); return; case ND_PADDSW128: gen_sse_binop3(node, "paddsw", false); return; case ND_PADDUSB128: gen_sse_binop3(node, "paddusb", false); return; case ND_PADDUSW128: gen_sse_binop3(node, "paddusw", false); return; case ND_PSUBSB128: gen_sse_binop3(node, "psubsb", false); return; case ND_PSUBSW128: gen_sse_binop3(node, "psubsw", false); return; case ND_PSUBUSB128: gen_sse_binop3(node, "psubusb", false); return; case ND_PSUBUSW128: gen_sse_binop3(node, "psubusw", false); return; case ND_PMADDWD128: gen_sse_binop3(node, "pmaddwd", false); return; case ND_PMULHW128: gen_sse_binop3(node, "pmulhw", false); return; case ND_PMULUDQ: case ND_PMULUDQ128: gen_sse_binop3(node, "pmuludq", false); return; case ND_PSLLWI128: gen_psll_binop(node, "psllw"); return; case ND_PSLLDI128: gen_psll_binop(node, "pslld"); return; case ND_PSLLQI128: gen_psll_binop(node, "psllq"); return; case ND_PSRAWI128: gen_psll_binop(node, "psraw"); return; case ND_PSRADI128: gen_psll_binop(node, "psrad"); return; case ND_PSRLWI128: gen_psll_binop(node, "psrlw"); return; case ND_PSRLDI128: gen_psll_binop(node, "psrld"); return; case ND_PSRLQI128: gen_psll_binop(node, "psrlq"); return; case ND_PSLLW128:gen_sse_binop3(node, "psllw", false); return; case ND_PSLLD128:gen_sse_binop3(node, "pslld", false); return; case ND_PSLLQ128:gen_sse_binop3(node, "psllq", false); return; case ND_PSRAW128:gen_sse_binop3(node, "psraw", false); return; case ND_PSRAD128:gen_sse_binop3(node, "psrad", false); return; case ND_PSRLW128:gen_sse_binop3(node, "psrlw", false); return; case ND_PSRLD128:gen_sse_binop3(node, "psrld", false); return; case ND_PSRLQ128:gen_sse_binop3(node, "psrlq", false); return; case ND_PANDN128:gen_sse_binop3(node, "pandn", false); return; case ND_PMAXSW128:gen_sse_binop3(node, "pmaxsw", false); return; case ND_PMAXUB128:gen_sse_binop3(node, "pmaxub", false); return; case ND_PMINSW128:gen_sse_binop3(node, "pminsw", false); return; case ND_PMINUB128:gen_sse_binop3(node, "pminub", false); return; case ND_PHSUBW128:gen_sse_binop3(node, "phsubw", false); return; case ND_PHSUBD128:gen_sse_binop3(node, "phsubd", false); return; case ND_PHSUBSW128: gen_sse_binop3(node, "phsubsw", false); return; case ND_PMADDUBSW128: gen_sse_binop3(node, "pmaddubsw", false); return; case ND_PMULHRSW128: gen_sse_binop3(node, "pmulhrsw", false); return; case ND_PMOVMSKB128: gen_sse_binop2(node, "pmovmskb", "eax", false); return; case ND_PMULHUW128: gen_sse_binop9(node, "pmulhuw"); return; case ND_PSHUFB128: gen_sse_binop3(node, "pshufb", false); return; case ND_PSIGNB128: gen_sse_binop3(node, "psignb", false); return; case ND_PSIGNW128: gen_sse_binop3(node, "psignw", false); return; case ND_PSIGND128: gen_sse_binop3(node, "psignd", false); return; case ND_PHSUBW: gen_mmx_binop(node, "phsubw", false); return; case ND_PHSUBD: gen_mmx_binop(node, "phsubd", false); return; case ND_PHSUBSW: gen_mmx_binop(node, "phsubsw", false); return; case ND_PMADDUBSW: gen_mmx_binop(node, "pmaddubsw", false); return; case ND_PMULHRSW: gen_mmx_binop(node, "pmulhrsw", false); return; case ND_PSHUFB: gen_mmx_binop(node, "pshufb", false); return; case ND_PSIGNB: gen_mmx_binop(node, "psignb", false); return; case ND_PSIGNW: gen_mmx_binop(node, "psignw", false); return; case ND_PSIGND: gen_mmx_binop(node, "psignd", false); return; case ND_MASKMOVDQU: gen_maskmovdqu(node); return; case ND_PAVGB128:gen_sse_binop3(node, "pavgb", false); return; case ND_PAVGW128:gen_sse_binop3(node, "pavgw", false); return; case ND_PSADBW128:gen_sse_binop3(node, "psadbw", false); return; case ND_MOVNTI: gen_movnti(node); return; case ND_MOVNTI64: gen_movnti64(node); return; case ND_MOVNTDQ: gen_movnt_binop(node, "movntdq"); return; case ND_MOVNTPD: gen_movnt_binop(node, "movntpd"); return; case ND_PARITYL: case ND_PARITYLL: case ND_PARITY: gen_parity(node); return; case ND_MWAIT: gen_mwait(node); return; case ND_MONITOR: gen_monitor(node); return; case ND_ADDSUBPS: gen_sse_binop3(node, "addsubps", false); return; case ND_HADDPS: gen_sse_binop3(node, "haddps", false); return; case ND_HSUBPS: gen_sse_binop3(node, "hsubps", false); return; case ND_MOVSHDUP: gen_sse_binop12(node, "movshdup"); return; case ND_MOVSLDUP: gen_sse_binop12(node, "movsldup"); return; case ND_ADDSUBPD: gen_sse_binop3(node, "addsubpd", false); return; case ND_HADDPD: gen_sse_binop3(node, "haddpd", false); return; case ND_HSUBPD: gen_sse_binop3(node, "hsubpd", false); return; case ND_LDDQU: gen_lddqu(node); return; case ND_PABSB128: gen_sse_binop2(node, "pabsb", "xmm0", false); return; case ND_PABSW128: gen_sse_binop2(node, "pabsw", "xmm0", false); return; case ND_PABSD128: gen_sse_binop2(node, "pabsd", "xmm0", false); return; case ND_PABSB: gen_mmx_binop1(node, "pabsb"); return; case ND_PABSW: gen_mmx_binop1(node, "pabsw"); return; case ND_PABSD: gen_mmx_binop1(node, "pabsd"); return; case ND_PTESTZ128: gen_sse_testz(node); return; case ND_PTESTC128: gen_sse_testc(node); return; case ND_PTESTNZC128: gen_sse_testnzc(node); return; case ND_PBLENDVB128: gen_sse_pblendvb128(node); return; case ND_PBLENDVB256: gen_pblendvb256(node); return; case ND_BLENDVPS: gen_sse_blendvpx(node, "blendvps"); return; case ND_BLENDVPD: gen_sse_blendvpx(node, "blendvpd"); return; case ND_PMINSB128: gen_sse_binop3(node, "pminsb", false); return; case ND_PMAXSB128: gen_sse_binop3(node, "pmaxsb", false); return; case ND_PMINUW128: gen_sse_binop3(node, "pminuw", false); return; case ND_PMAXUW128: gen_sse_binop3(node, "pmaxuw", false); return; case ND_PMINSD128: gen_sse_binop3(node, "pminsd", false); return; case ND_PMAXSD128: gen_sse_binop3(node, "pmaxsd", false); return; case ND_PMINUD128: gen_sse_binop3(node, "pminud", false); return; case ND_PMAXUD128: gen_sse_binop3(node, "pmaxud", false); return; case ND_PMULDQ128: gen_sse_binop3(node, "pmuldq", false); return; case ND_PHMINPOSUW128: gen_sse_binop2(node, "phminposuw", "xmm0", false); return; case ND_PMOVSXBD128: gen_sse_binop2(node, "pmovsxbd", "xmm0", false); return; case ND_PMOVSXWD128: gen_sse_binop2(node, "pmovsxwd", "xmm0", false); return; case ND_PMOVSXBQ128: gen_sse_binop2(node, "pmovsxbq", "xmm0", false); return; case ND_PMOVSXDQ128: gen_sse_binop2(node, "pmovsxdq", "xmm0", false); return; case ND_PMOVSXWQ128: gen_sse_binop2(node, "pmovsxwq", "xmm0", false); return; case ND_PMOVSXBW128: gen_sse_binop2(node, "pmovsxbw", "xmm0", false); return; case ND_PMOVZXBD128: gen_sse_binop2(node, "pmovzxbd", "xmm0", false); return; case ND_PMOVZXWD128: gen_sse_binop2(node, "pmovzxwd", "xmm0", false); return; case ND_PMOVZXBQ128: gen_sse_binop2(node, "pmovzxbq", "xmm0", false); return; case ND_PMOVZXDQ128: gen_sse_binop2(node, "pmovzxdq", "xmm0", false); return; case ND_PMOVZXWQ128: gen_sse_binop2(node, "pmovzxwq", "xmm0", false); return; case ND_PMOVZXBW128: gen_sse_binop2(node, "pmovzxbw", "xmm0", false); return; case ND_PACKUSDW128: gen_sse_binop3(node, "packusdw", false); return; case ND_MOVNTDQA: gen_movntdqa(node); return; case ND_CRC32QI: gen_crc32qi(node); return; case ND_CRC32HI: gen_crc32hi(node); return; case ND_CRC32SI: gen_crc32si(node); return; case ND_CRC32DI: gen_crc32di(node); return; case ND_PSHUFD: gen_pshufd(node); return; case ND_PREFETCH: gen_prefetch(node); return; case ND_RDTSC: gen_rdtsc(node); return; case ND_READEFLAGS_U64: gen_readeflags_u64(node); return; case ND_RDSSPQ: gen_binop1(node, "rdsspq"); return; case ND_SAVEPREVSSP: gen_singleop(node, "saveprevssp"); return; case ND_SETSSBSY: gen_singleop(node, "setssbsy"); return; case ND_SLWPCB: gen_binop1(node, "slwpcb"); return; case ND_RDPKRU: gen_rdpkru(node); return; case ND_XBEGIN: gen_nothing(node); return; case ND_XEND: gen_singleop(node, "xend"); return; case ND_SERIALIZE: gen_singleop(node, "serialize"); return; case ND_XSUSLDTRK: gen_singleop(node, "xsusldtrk"); return; case ND_XRESLDTRK: gen_singleop(node, "xresldtrk"); return; case ND_CLUI: gen_singleop(node, "clui"); return; case ND_STUI: gen_singleop(node, "stui"); return; case ND_TESTUI: gen_singleop(node, "testui"); return; case ND_WBNOINVD: gen_singleop(node, "wbnoinvd"); return; case ND_XTEST: gen_singleop(node, "xtest"); return; case ND_WBINVD: gen_singleop(node, "wbinvd"); return; case ND_RDPID: gen_binop1(node, "rdpid"); return; case ND_RDFSBASE32: case ND_RDFSBASE64: gen_binop2(node, "rdfsbase"); return; case ND_RDGSBASE32: case ND_RDGSBASE64: gen_binop2(node, "rdgsbase"); return; case ND_VZEROALL: gen_singleop(node, "vzeroall"); return; case ND_VZEROUPPER: gen_singleop(node, "vzeroupper"); return; case ND_FEMMS: gen_singleop(node, "femms"); return; case ND_BSRSI: gen_bsrsi(node); return; case ND_RDPMC: gen_rdpmc(node); return; case ND_RDTSCP: gen_rdtscp(node); return; case ND_ROLQI: gen_rolqi(node); return; case ND_RORQI: gen_rorqi(node); return; case ND_ROLHI: gen_rolhi(node); return; case ND_RORHI: gen_rorhi(node); return; case ND_BSRDI: gen_bsrdi(node); return; case ND_WRITEEFLAGS_U64: gen_writeeflags_u64(node); return; case ND_INCSSPQ: gen_incsspq(node); return; case ND_RSTORSSP: gen_rstorssp(node); return; case ND_WRSSD: gen_wrssd(node); return; case ND_WRSSQ: gen_wrssq(node); return; case ND_WRUSSD: gen_wrussd(node); return; case ND_WRUSSQ: gen_wrussq(node); return; case ND_CLRSSBSY: gen_clrssbsy(node); return; case ND_SBB_U32: gen_sbb_u32(node); return; case ND_ADDCARRYX_U32: gen_addcarryx_u32(node); return; case ND_SBB_U64: gen_sbb_u64(node); return; case ND_ADDCARRYX_U64: gen_addcarryx_u64(node); return; case ND_TZCNT_U16: gen_tzcnt_u16(node); return; case ND_BEXTR_U32: gen_bextr_u32(node); return; case ND_FPCLASSIFY: gen_fpclassify(node->fpc); return; case ND_ISUNORDERED: gen_isunordered(node); return; case ND_SIGNBIT: case ND_SIGNBITF: case ND_SIGNBITL: gen_signbit(node); return; case ND_PSUBUSB256: gen_psubusb256(node); return; case ND_PCMPGTB256_MASK: gen_pcmpgtb256_mask(node); return; case ND_PSHUFB256: gen_pshufb256(node); return; case ND_PSRLDQI256: gen_avx2_256(node, "vpsrldq"); return; case ND_PSLLDQI256: gen_avx2_256(node, "vpslldq"); return; case ND_VINSERTF128_SI256: gen_vinsertf128_si256(node); return; case ND_SI256_SI: gen_si256(node); return; case ND_SI_SI256: gen_si256(node); return; case ND_PD256_PD: gen_si256(node); return; case ND_PS256_PS: gen_si256(node); return; case ND_PALIGNR256: gen_avx2_palignr256(node); return; case ND_VPERM2I128_SI256: gen_vperm2i128_si256(node); return; case ND_PSRLQI256: gen_avx2_psll_binop(node, "vpsrlq"); return; case ND_PSLLQI256: gen_avx2_psll_binop(node, "vpsllq"); return; case ND_PBLENDD256: gen_pblendd256(node); return; case ND_VEXTRACTF128_SI256: gen_vextractf128_si256(node); return; case ND_PERMDI256: gen_avx2_permdi256(node); return; case ND_ANDNOTSI256: gen_andnotsi256(node); return; case ND_PMULHUW256: gen_pmulhuw256(node); return; case ND_PSLLDI256: gen_avx2_psll_binop(node, "vpslld"); return; case ND_PSRLDI256: gen_avx2_psll_binop(node, "vpsrld"); return; case ND_PSRADI256: gen_avx2_psll_binop(node, "vpsrad"); return; } if (node->lhs && (is_vector(node->lhs->ty) || (node->rhs && is_vector(node->rhs->ty)))) { gen_vector_op(node); return; } //managing INT128 if (is_int128(node->lhs->ty)) { gen_int128_op(node); return; } switch (node->lhs->ty->kind) { case TY_FLOAT: case TY_DOUBLE: { gen_expr(node->rhs); push_tmpf(); gen_expr(node->lhs); pop_tmpf(1); char *sz = (node->lhs->ty->kind == TY_FLOAT) ? "ss" : "sd"; switch (node->kind) { case ND_ADD: println(" add%s %%xmm1, %%xmm0", sz); return; case ND_SUB: println(" sub%s %%xmm1, %%xmm0", sz); return; case ND_MUL: println(" mul%s %%xmm1, %%xmm0", sz); return; case ND_DIV: println(" div%s %%xmm1, %%xmm0", sz); return; case ND_EQ: case ND_NE: case ND_LT: case ND_LE: println(" ucomi%s %%xmm0, %%xmm1", sz); if (node->kind == ND_EQ) { println(" sete %%al"); println(" setnp %%dl"); println(" and %%dl, %%al"); } else if (node->kind == ND_NE) { println(" setne %%al"); println(" setp %%dl"); println(" or %%dl, %%al"); } else if (node->kind == ND_LT) { println(" seta %%al"); } else { println(" setae %%al"); } println(" and $1, %%al"); println(" movzb %%al, %%rax"); return; } error_tok(node->tok, "%s invalid expression", __FILE__); } case TY_LDOUBLE: { gen_expr(node->lhs); pushld(); gen_expr(node->rhs); popld(); switch (node->kind) { case ND_ADD: println(" faddp"); return; case ND_SUB: println(" fsubp"); return; case ND_MUL: println(" fmulp"); return; case ND_DIV: println(" fdivp"); return; case ND_EQ: case ND_NE: case ND_LT: case ND_LE: println(" fucomip"); println(" fstp %%st(0)"); if (node->kind == ND_EQ) { println(" sete %%al"); println(" setnp %%dl"); println(" and %%dl, %%al"); } else if (node->kind == ND_NE) { println(" setne %%al"); println(" setp %%dl"); println(" or %%dl, %%al"); } else if (node->kind == ND_LT) { println(" setb %%al"); println(" setnp %%dl"); println(" and %%dl, %%al"); } else { println(" setbe %%al"); println(" setnp %%dl"); println(" and %%dl, %%al"); } println(" movzbl %%al, %%eax"); return; } error_tok(node->tok, "%s invalid expression", __FILE__); } } if (!is_int128(node->rhs->ty)) { gen_expr(node->rhs); push_tmp(); gen_expr(node->lhs); pop_tmp("%rdi"); } char *ax, *di, *dx; if (node->lhs->ty->size == 8 || node->lhs->ty->base) { ax = "%rax"; di = "%rdi"; dx = "%rdx"; } else { ax = "%eax"; di = "%edi"; dx = "%edx"; } switch (node->kind) { case ND_ADD: if (node->lhs->ty->kind == TY_INT128) { println(" add %%rdi, %%rax"); println(" adc %%rsi, %%rdx"); } else { println(" add %s, %s", di, ax); } return; case ND_SUB: println(" sub %s, %s", di, ax); return; case ND_MUL: //println(" imul %s, %s", di, ax); if (node->lhs->ty->is_unsigned && node->rhs->ty->is_unsigned) { println(" mul %s", di); } else { println(" imul %s, %s", di, ax); } return; case ND_DIV: case ND_MOD: if (node->ty->is_unsigned) { println(" mov $0, %s", dx); println(" div %s", di); } else { if (node->lhs->ty->size == 8) println(" cqo"); else println(" cdq"); println(" idiv %s", di); } if (node->kind == ND_MOD) println(" mov %%rdx, %%rax"); return; case ND_BITAND: println(" and %s, %s", di, ax); return; case ND_BITOR: println(" or %s, %s", di, ax); return; case ND_BITXOR: println(" xor %s, %s", di, ax); return; case ND_EQ: case ND_NE: case ND_LT: case ND_LE: println(" cmp %s, %s", di, ax); if (node->kind == ND_EQ) { println(" sete %%al"); } else if (node->kind == ND_NE) { println(" setne %%al"); } else if (node->kind == ND_LT) { if (node->lhs->ty->is_unsigned) println(" setb %%al"); else println(" setl %%al"); } else if (node->kind == ND_LE) { if (node->lhs->ty->is_unsigned) println(" setbe %%al"); else println(" setle %%al"); } println(" movzb %%al, %%rax"); return; case ND_SHL: println(" mov %%rdi, %%rcx"); println(" shl %%cl, %s", ax); println(" xor %%r11, %%r11"); println(" cmp $%d, %%ecx", (int)node->ty->size * 8); println(" cmovge %s, %s", (node->ty->size == 8) ? "%r11" : "%r11d", ax); return; case ND_SHR: println(" mov %%rdi, %%rcx"); if (node->ty->is_unsigned) { println(" shr %%cl, %s", ax); println(" xor %%r11, %%r11"); println(" cmp $%d, %%ecx", (int)node->ty->size * 8); println(" cmovge %s, %s", (node->ty->size == 8) ? "%r11" : "%r11d", ax); } else { println(" sar %%cl, %s", ax); int c = count(); println(" cmp $%d, %%ecx", (int)node->ty->size * 8); println(" jl .L.shift_done.%d", c); if (node->ty->size == 8) { println(" sar $63, %%rax"); } else { println(" sar $31, %%eax"); println(" movsxd %%eax, %%rax"); } println(".L.shift_done.%d:", c); } return; } error_tok(node->tok, "%s invalid expression", __FILE__); } static void gen_stmt(Node *node) { if (!node) error("%s:%d: error: in gen_stmt : node is null!", __FILE__, __LINE__); if (node->tok && (node->tok->line_no != last_loc_line || node->tok->file->file_no != last_loc_file)) { println(" .loc %d %u", node->tok->file->file_no, node->tok->line_no); last_loc_line = node->tok->line_no; last_loc_file = node->tok->file->file_no; } switch (node->kind) { case ND_IF: { if (is_const_expr(node->cond)) { if (eval(node->cond)) { if (!contains_label(node->els)) { if (node->then) gen_stmt(node->then); return; } } else { if (!contains_label(node->then)) { if (node->els) gen_stmt(node->els); return; } } } int c = count(); gen_expr(node->cond); cmp_zero(node->cond->ty); println(" je .L.else.%d", c); if (node->then) gen_stmt(node->then); println(" jmp .L.end.%d", c); println(".L.else.%d:", c); if (node->els) gen_stmt(node->els); println(".L.end.%d:", c); return; } case ND_FOR: { if (node->cond && is_const_expr(node->cond) && !eval(node->cond)) { if (!contains_label(node->then)) { if (node->init) gen_stmt(node->init); return; } } int c = count(); if (node->init) gen_stmt(node->init); println(".L.begin.%d:", c); if (node->cond) { gen_expr(node->cond); cmp_zero(node->cond->ty); println(" je %s", node->brk_label); } gen_stmt(node->then); println("%s:", node->cont_label); if (node->inc) gen_expr(node->inc); println(" jmp .L.begin.%d", c); println("%s:", node->brk_label); return; } case ND_DO: { int c = count(); println(".L.begin.%d:", c); gen_stmt(node->then); println("%s:", node->cont_label); gen_expr(node->cond); cmp_zero(node->cond->ty); println(" jne .L.begin.%d", c); println("%s:", node->brk_label); return; } case ND_SWITCH: gen_expr(node->cond); for (Node *n = node->case_next; n; n = n->case_next) { char *ax, *di, *dx; if (node->cond->ty->size == 8) { ax = "%rax"; di = "%rdi"; dx = "%rdx"; } else { ax = "%eax"; di = "%edi"; dx = "%edx"; } if (n->begin == n->end) { println(" mov $%ld, %s", n->begin, dx); println(" cmp %s, %s", dx, ax); println(" je %s", n->label); continue; } // [GNU] Case ranges println(" mov %s, %s", ax, di); println(" mov $%ld, %s", n->begin, dx); println(" sub %s, %s", dx, di); println(" mov $%ld, %s", n->end - n->begin, dx); println(" cmp %s, %s", dx, di); println(" jbe %s", n->label); } if (node->default_case) println(" jmp %s", node->default_case->label); println(" jmp %s", node->brk_label); gen_stmt(node->then); println("%s:", node->brk_label); return; case ND_CASE: println("%s:", node->label); if (node->lhs) gen_stmt(node->lhs); return; case ND_BLOCK: for (Node *n = node->body; n; n = n->next) gen_stmt(n); return; case ND_GOTO: println(" jmp %s", node->unique_label); return; case ND_GOTO_EXPR: gen_expr(node->lhs); println(" jmp *%%rax"); return; case ND_LABEL: println("%s:", node->unique_label); if (node->lhs) gen_stmt(node->lhs); return; case ND_RETURN: if (node->lhs) { gen_expr(node->lhs); Type *ty = node->lhs->ty; switch (ty->kind) { case TY_STRUCT: case TY_UNION: if (ty->size <= 16) copy_struct_reg(); else copy_struct_mem(); break; } } println(" jmp .L.return.%s", sym(current_fn)); return; case ND_EXPR_STMT: gen_expr(node->lhs); if (node->lhs->ty && node->lhs->ty->kind == TY_LDOUBLE) println(" fstp %%st(0)"); return; case ND_NULL_EXPR: return; case ND_ASM: println(" %s", node->asm_str); return; } error_tok(node->tok, "%s invalid statement", __FILE__); } static void emit_data(Obj *prog) { for (Obj *var = prog; var; var = var->next) { if (var->ty->size != 0) println(" .zero %ld", labs(var->ty->size)); if (var->alias_name) println(" .set %s, %s", sym(var), var->alias_name); if (var->is_weak) println(" .weak %s", sym(var)); if (var->is_function || !var->is_definition) continue; print_visibility(var); int align = (var->ty->kind == TY_ARRAY && var->ty->size >= 16) ? MAX(16, var->align) : var->align; // Common symbol if (opt_fcommon && var->is_tentative && !var->is_tls && !var->section && !var->is_static) { if (var->ty->kind == TY_FUNC) continue; //from @fuhsnn incomplete array assuming to have one element if (var->ty->kind == TY_ARRAY && var->ty->size < 0) var->ty->size = var->ty->base->size; println(" .comm %s, %ld, %d", sym(var), var->ty->size, align); continue; } // .data or .tdata if (var->init_data) { //from cosmopolitan if (var->section) { println(" .section %s,\"aw\",@progbits", var->section); } else if (var->is_tls) println(" .section .tdata,\"awT\",@progbits"); else println(" .section .data,\"aw\",@progbits"); println(" .type %s, @object", sym(var)); println(" .size %s, %ld", sym(var), labs(var->ty->size)); if (align > 1) println(" .align %d", align); println("%s:", sym(var)); Relocation *rel = var->rel; int unit_size = (var->ty->kind == TY_ARRAY) ? var->ty->base->size : var->ty->size; int pos = 0; while (pos < var->ty->size) { if (rel && rel->offset == pos) { if (var->is_function) { println(" .long %s - . + %ld", *rel->label, rel->addend); pos += 4; } else if (!var->is_extern) { println(" .quad %s%+ld", *rel->label, rel->addend); pos += 8; } else { // Fallback for unexpected case pos += 8; } rel = rel->next; } else { //from @enh (Elliott Hughes) Use .byte/.short/.long/.quad as appropriate. //println(" .byte %d", var->init_data[pos++]); if (unit_size == 8) { long v = *(long*) &var->init_data[pos]; println(" .quad %ld # %#lx", v, v); pos += 8; } else if (unit_size == 4) { int v = *(int*) &var->init_data[pos]; println(" .long %d # %#x", v, v); pos += 4; } else if (unit_size == 2) { int v = *(short*) &var->init_data[pos] & 0xffff; println(" .short %d # %#x", v, v); pos += 2; } else { int v = var->init_data[pos] & 0xff; println(" .byte %d # %#x", v, v); pos += 1; } } } println(" .size %s, %ld", sym(var), var->ty->size); continue; } if (var->section) { println(" .section %s,\"aw\",@nobits", var->section); } else if (var->is_tls) println(" .section .tbss,\"awT\",@nobits"); else println(" .section .bss,\"aw\",@nobits"); if (align > 1) println(" .align %d", align); println("%s:", sym(var)); if (var->ty->size != 0) println(" .zero %ld", labs(var->ty->size)); } } static void store_fp(int r, int offset, int sz, char *ptr) { switch (sz) { case 0: // No operation for size 0 return; case 2: // movw is used for 2-byte (16-bit) words println(" movw %%xmm%d, %d(%s)", r, offset, ptr); return; case 4: println(" movss %%xmm%d, %d(%s)", r, offset, ptr); return; case 8: println(" movsd %%xmm%d, %d(%s)", r, offset, ptr); return; case 16: println(" movups %%xmm%d, %d(%s)", r, offset, ptr); return; case 32: // 256-bit vector arguments/returns use YMM registers in the SysV ABI. println(" vmovdqu %%ymm%d, %d(%s)", r, offset, ptr); return; } // Handle wide FP/vector objects (32, 64, ...) if (sz % 16 == 0) { for (int i = 0; i < sz; i += 16) { println(" movups %%xmm%d, %d(%s)", r + i / 16, offset + i, ptr); } return; } printf("===== r=%d offset=%d sz=%d\n", r, offset, sz); unreachable(); } static void store_gp(int r, int offset, int sz, char *ptr) { switch (sz) { case 0: // No operation for size 0 return; case 1: println(" mov %s, %d(%s)", argreg8[r], offset, ptr); return; case 2: println(" mov %s, %d(%s)", argreg16[r], offset, ptr); return; case 4: println(" mov %s, %d(%s)", argreg32[r], offset, ptr); return; case 8: println(" mov %s, %d(%s)", argreg64[r], offset, ptr); return; case 16: // Assuming we can use xmm registers to store 128 bits println(" movdqu %%xmm%d, %d(%s)", r, offset, ptr); return; default: for (int i = 0; i < sz; i++) { println(" mov %s, %d(%s)", argreg8[r], offset + i, ptr); println(" shr $8, %s", argreg64[r]); } return; } } static void emit_text(Obj *prog) { // First pass: collect constructor/destructor attributes for (Obj *fn = prog; fn; fn = fn->next) { if (!fn->is_function || !fn->is_definition) continue; if (fn->is_constructor || fn->ty->is_constructor) { int priority = fn->constructor_priority > fn->ty->constructor_priority ? fn->constructor_priority : fn->ty->constructor_priority; if (priority < 0 || priority > 65535) priority = 65535; CtorFunc *f = calloc(1, sizeof(CtorFunc)); f->name = sym(fn); f->priority = priority; constructors[constructor_cnt++] = f; } // Combine destructor flags and pick max priority if (fn->is_destructor || fn->ty->is_destructor) { int priority = fn->destructor_priority > fn->ty->destructor_priority ? fn->destructor_priority : fn->ty->destructor_priority; if (priority < 0 || priority > 65535) priority = 65535; CtorFunc *f = calloc(1, sizeof(CtorFunc)); f->name = sym(fn); f->priority = priority; destructors[destructor_cnt++] = f; } } println(" .section .text"); println(".L.text_start:"); for (Obj *fn = prog; fn; fn = fn->next) { if (!fn->is_function || !fn->is_definition) continue; // No code is emitted for "static inline" functions // if no one is referencing them. if (!fn->is_live) continue; if (fn->is_static) println(" .local %s", sym(fn)); else println(" .globl %s", sym(fn)); // Respect section attribute if set if (fn->section) println(" .section %s,\"ax\",@progbits", fn->section); else println(" .section .text,\"ax\",@progbits"); println(" .type %s, @function", sym(fn)); println(" .loc %d %d", fn->file_no, fn->line_no); last_loc_line = fn->line_no; last_loc_file = fn->file_no; println("%s:", sym(fn)); current_fn = fn; tmp_stack.bottom = fn->stack_size; bool use_rbx = (fn->stack_align > 16); lvar_ptr = use_rbx ? "%rbx" : "%rbp"; // Prologue long reserved_pos = ftell(output_file); if (!is_omit_fp(fn)) { println(" push %%rbp"); println(" .cfi_startproc"); println(" .cfi_def_cfa_offset 16"); println(" .cfi_offset %%rbp, -16"); println(" mov %%rsp, %%rbp"); println(" .cfi_def_cfa_register %%rbp"); } if (use_rbx) { println(" push %%rbx"); println(" mov %%rsp, %%rbx"); println(" and $-%d, %%rbx", fn->stack_align); println(" mov %%rbx, %%rsp"); } // Place .L.body label: // - BEFORE sub for frame-pointer functions (allows RSP restoration + re-execution of sub) // - AFTER sub for omit-fp functions (avoids re-allocating stack on each jump) // Note: Recursive TCO is disabled for omit-fp with stack params, so no offset issues if (!is_omit_fp(fn)) println(".L.body.%s:", sym(fn)); reserved_pos = ftell(output_file); println(" "); if (is_omit_fp(fn)) println(".L.body.%s:", sym(fn)); // Save RSP for alloca/VLA support if needed if (fn->alloca_bottom && fn->alloca_bottom->offset) println(" mov %%rsp, %d(%s)", fn->alloca_bottom->offset, lvar_ptr); //issue with postgres and local variables not initialized! for (Obj *var = fn->locals; var; var = var->next) { if (!var->init && !var->is_param && (var->ty->kind == TY_STRUCT || var->ty->kind == TY_UNION || var->ty->kind == TY_ARRAY || is_vector(var->ty))) { gen_mem_zero(var->offset, var->ty->size); } } // Save arg registers if function is variadic if (fn->va_area) { int gp = 0, fp = 0; for (Obj *var = fn->params; var; var = var->next) { Type *ty = var->ty; if (!ty) error("%s:%d: in emit_text : type is null!", __FILE__, __LINE__); switch (ty->kind) { case TY_STRUCT: case TY_UNION: if (ty->size == 0) continue; if (!pass_by_reg(ty, gp, fp)) continue; if (has_flonum1(ty)) fp++; else gp++; if (ty->size > 8) { if (has_flonum2(ty)) fp++; else gp++; } continue; case TY_VECTOR: case TY_FLOAT: case TY_DOUBLE: if (fp < FP_MAX) fp++; continue; case TY_LDOUBLE: continue; case TY_INT128: if (gp + 1 < FP_MAX) { gp++; gp++; } continue; default: if (gp < GP_MAX) gp++; } } int off = fn->va_area->offset; char *ptr = fn->va_area->ptr; if (is_omit_fp(fn)) off += fn->stack_size; // va_elem println(" movl $%d, %d(%s)", gp * 8, off, ptr); // gp_offset println(" movl $%d, %d(%s)", fp * 16 + 48, off + 4, ptr); // fp_offset if (is_omit_fp(fn)) { println(" movq %%rsp, %d(%s)", off + 8, ptr); // overflow_arg_area println(" addq $%d, %d(%s)", fn->stack_size + fn->overflow_arg_area - 8, off + 8, ptr); } else { println(" movq %%rbp, %d(%s)", off + 8, ptr); // overflow_arg_area println(" addq $%d, %d(%s)", fn->overflow_arg_area, off + 8, ptr); } println(" movq %s, %d(%s)", ptr, off + 16, ptr); // reg_save_area println(" addq $%d, %d(%s)", off + 32, off + 16, ptr); // __reg_save_area__ println(" movq %%rdi, %d(%s)", off + 32, ptr); println(" movq %%rsi, %d(%s)", off + 40, ptr); println(" movq %%rdx, %d(%s)", off + 48, ptr); println(" movq %%rcx, %d(%s)", off + 56, ptr); println(" movq %%r8, %d(%s)", off + 64, ptr); println(" movq %%r9, %d(%s)", off + 72, ptr); println(" movups %%xmm0, %d(%s)", off + 80, ptr); println(" movups %%xmm1, %d(%s)", off + 96, ptr); println(" movups %%xmm2, %d(%s)", off + 112, ptr); println(" movups %%xmm3, %d(%s)", off + 128, ptr); println(" movups %%xmm4, %d(%s)", off + 144, ptr); println(" movups %%xmm5, %d(%s)", off + 160, ptr); println(" movups %%xmm6, %d(%s)", off + 176, ptr); println(" movups %%xmm7, %d(%s)", off + 192, ptr); } // Save passed-by-register arguments to the stack int gp = 0, fp = 0; for (Obj *var = fn->params; var; var = var->next) { // if (var->offset > 0) // continue; if (var->pass_by_stack) continue; int offset = var->offset; if (offset == 0) { if (is_omit_fp(fn)) offset = -16; else offset = -fn->stack_size - 16; } else if (is_omit_fp(fn)) offset += fn->stack_size; Type *ty = var->ty; if (!ty) error("%s:%d: in emit_text : type is null!", __FILE__, __LINE__); switch (ty->kind) { case TY_VECTOR: if (ty->base->kind == TY_FLOAT || ty->base->kind == TY_DOUBLE) { store_fp(fp++, offset, ty->size, var->ptr); } else if (is_integer(ty->base)) { store_fp(fp++, offset, ty->size, var->ptr); } else { error("%s:%d: in emit_text : Unsupported vector base type", __FILE__, __LINE__); } break; case TY_STRUCT: case TY_UNION: assert(ty->size <= 16); if (has_flonum(ty, 0, 8, 0)) store_fp(fp++, offset, MIN(8, ty->size), var->ptr); else store_gp(gp++, offset, MIN(8, ty->size), var->ptr); if (ty->size > 8) { if (has_flonum(ty, 8, 16, 0)) store_fp(fp++, offset + 8, ty->size - 8, var->ptr); else store_gp(gp++, offset + 8, ty->size - 8, var->ptr); } break; case TY_FLOAT: case TY_DOUBLE: store_fp(fp++, offset, ty->size, var->ptr); break; case TY_INT128: store_gp(gp++, offset + 0, 8, var->ptr); store_gp(gp++, offset + 8, 8, var->ptr); break; default: store_gp(gp++, offset, ty->size, var->ptr); } } // Emit code gen_stmt(fn->body); assert(depth == 0); assert(tmp_stack.depth == 0); long cur_pos = ftell(output_file); fseek(output_file, reserved_pos, SEEK_SET); //println(" sub $%d, %%rsp", align_to(tmp_stack.bottom, 16)); if (is_omit_fp(fn)) println(" sub $%d, %%rsp", tmp_stack.bottom); else println(" sub $%d, %%rsp", align_to(tmp_stack.bottom, 16)); fseek(output_file, cur_pos, SEEK_SET); // [https://www.sigbus.info/n1570#5.1.2.2.3p1] The C spec defines // a special rule for the main function. Reaching the end of the // main function is equivalent to returning 0, even though the // behavior is undefined for the other functions. if (strcmp(sym(fn), "main") == 0) { println(" mov $0, %%rax"); } // Epilogue println(".L.return.%s:", sym(fn)); if (use_rbx) println(" mov -8(%%rbp), %%rbx"); if (!is_omit_fp(fn)) { println(" mov %%rbp, %%rsp"); println(" pop %%rbp"); println(" .cfi_def_cfa %%rsp, 8"); } else { println(" add $%d, %%rsp", fn->stack_size); } println(" ret"); if (!is_omit_fp(fn)) println(" .cfi_endproc"); println(" .size %s, .-%s", sym(fn), sym(fn)); println(".L.end.%s:", sym(fn)); } println(".L.text_end:"); emit_constructors(); emit_destructors(); } void codegen(Obj *prog, FILE *out) { output_file = out; File **files = get_input_files(); for (int i = 0; files[i]; i++) println(" .file %d \"%s\"", files[i]->file_no, files[i]->name); assign_lvar_offsets(prog); emit_data(prog); emit_text(prog); emit_debug_info(prog); println(" .section .note.GNU-stack,\"\",@progbits"); //print offset for each variable if (isDebug) print_offset(prog); } // Print offset. static void print_offset(Obj *prog) { for (Obj *fn = prog; fn; fn = fn->next) { for (Obj *var = fn->params; var; var = var->next) { printf("=====fn_name=%s var_name=%s offset=%d stack_size=%d var_alignment=%d\n", sym(fn), sym(var), var->offset, fn->stack_size, var->stack_align ); } for (Obj *var = fn->locals; var; var = var->next) { printf("=====fn_name=%s var_name=%s offset=%d stack_size=%d var_alignment=%d\n", sym(fn), sym(var), var->offset, fn->stack_size, var->align ); //update the function name if it's missing if (!var->funcname) var->funcname = sym(fn); } } } static int get_lvar_align(Obj *fn, int align) { for (Obj *var = fn->locals; var; var = var->next) align = MAX(align, get_align(var)); return align; } static int assign_lvar_offsets2(Obj *fn, int bottom, char *ptr) { for (Obj *var = fn->locals; var; var = var->next) { int align = get_align(var); if (var->offset) { // Skip variables that already have an offset continue; } // When the frame uses a super-aligned base pointer (stack_align > 16), // each variable's slot size must be a multiple of stack_align int size = var->ty->size; if (fn->stack_align > 16) size = align_to(size, fn->stack_align); bottom = align_to(bottom + size, align); var->offset = -bottom; var->ptr = ptr; } return align_to(bottom, 16); } void assign_lvar_offsets(Obj *prog) { for (Obj *fn = prog; fn; fn = fn->next) { if (!fn->is_function || !fn->is_definition) continue; fn->stack_align = get_lvar_align(fn, 16); bool omit_fp = is_omit_fp(fn); int bottom = fn->stack_size; if (omit_fp) bottom -= 8; if (bottom < 0) bottom = 0; int gp = 0, fp = 0; int max_align = 8; int stack = 0; int param_idx = 0; // If variables already have offsets (assigned during parsing for inline asm), // ensure 'bottom' reflects the space they occupy. for (Obj *var = fn->locals; var; var = var->next) { if (var->offset && !var->is_param) { int limit = -var->offset; // offsets are negative if (limit > bottom) bottom = limit; } } for (Obj *var = fn->params; var; var = var->next) { var->is_param = true; var->nbparm = param_idx++; if (var->offset) continue; Type *ty = var->ty; if (!ty) error("%s:%d: type is null!", __FILE__, __LINE__); // ABI: Check if passed in registers if (ty->kind == TY_STRUCT || ty->kind == TY_UNION) { if (pass_by_reg(ty, gp, fp)) { fp += has_flonum1(ty) + (ty->size > 8 && has_flonum2(ty)); gp += !has_flonum1(ty) + (ty->size > 8 && !has_flonum2(ty)); continue; } } else if (ty->kind == TY_VECTOR || ty->kind == TY_FLOAT || ty->kind == TY_DOUBLE) { if (fp < FP_MAX) { fp++; continue; } } else if (ty->kind == TY_INT128) { if (gp + 1 < GP_MAX) { gp += 2; continue; } } else if (ty->kind != TY_LDOUBLE) { if (gp++ < GP_MAX) continue; } // Passed on stack var->pass_by_stack = true; int align = (ty->kind == TY_STRUCT || ty->kind == TY_UNION) ? MAX(ty->align, 8) : (ty->kind == TY_LDOUBLE || ty->kind == TY_INT128 || ty->kind == TY_VECTOR) ? 16 : 8; max_align = MAX(max_align, align); stack = align_to(stack, align); if (omit_fp) { var->offset = stack + 8; var->ptr = "%rsp"; } else { var->offset = stack + 16; var->ptr = "%rbp"; } int size = (ty->kind == TY_STRUCT || ty->kind == TY_UNION) ? align_to(ty->size, align) : (ty->kind == TY_LDOUBLE || ty->kind == TY_INT128 || ty->kind == TY_VECTOR) ? 16 : 8; stack += size; } if (fn->ty->is_variadic) fn->overflow_arg_area = stack + 16; char *base = omit_fp ? "%rsp" : (fn->stack_align > 16) ? "%rbx" : "%rbp"; fn->stack_size = assign_lvar_offsets2(fn, bottom, base); if (omit_fp) fn->stack_size += 8; } } //check if a register is available char *register_available() { int len = sizeof(newargreg64)/sizeof(newargreg64[0]); int i; for(i = 0; i < len; ++i) { //register already used bool isFound = check_register_used(newargreg64[i]); if (isFound) continue; else { add_register_used(newargreg64[i]); return newargreg64[i]; } } //no registry available error("%s:%d: error: in register_available : no register available!", __FILE__, __LINE__); } //check if a specific register is available in priority if not try to found a new available char *specific_register_available(char *regist) { int found = check_register_used(regist); if (!found) { add_register_used(regist); return regist; } return register_available(); } //convert register 8 to register 64 char *register8_to_64(char *regist) { int len = sizeof(newargreg8)/sizeof(newargreg8[0]); int i; for(i = 0; i < len; ++i) { if(!strncmp(newargreg8[i], regist, strlen(regist))) { return newargreg64[i]; } } error("%s:%d: error: in register8_to_64 : unexpected error!", __FILE__, __LINE__); } //convert register 16 to register 64 char *register16_to_64(char *regist) { int len = sizeof(newargreg16)/sizeof(newargreg16[0]); int i; for(i = 0; i < len; ++i) { if(!strncmp(newargreg16[i], regist, strlen(regist))) { return newargreg64[i]; } } error("%s:%d: error: in register16_to_64 : unexpected error!", __FILE__, __LINE__); } //convert register 32 to register 64 char *register32_to_64(char *regist) { int len = sizeof(newargreg32)/sizeof(newargreg32[0]); int i; for(i = 0; i < len; ++i) { if(!strncmp(newargreg32[i], regist, strlen(regist))) { return newargreg64[i]; } } error("%s:%d: error: in register32_to_64 : unexpected error!", __FILE__, __LINE__); } //add a register in the list of used registers int add_register_used(char *regist) { int len = sizeof(registerUsed)/sizeof(registerUsed[0]); int i; char *tmp = "free"; for(i = 0; i < len; ++i) { if (!strncmp(registerUsed[i], tmp, strlen(registerUsed[i]))) { registerUsed[i] = regist; return i; } } //no free location return -1; } //check if register used return 0 if not used bool check_register_used(char *regist) { int isFound = false; int len = sizeof(registerUsed)/sizeof(registerUsed[0]); int i; for(i = 0; i < len; ++i) { if(!strncmp(registerUsed[i], regist, strlen(regist))) { isFound = true; return isFound; } } //not found return isFound; } //clear the registerUseds void clear_register_used() { int len = sizeof(registerUsed)/sizeof(registerUsed[0]); int i; for(i = 0; i < len; ++i) { registerUsed[i] = "free"; } } //check if a register8 is used in a template //if yes retrieve the register64 and add it in the registerUsed array //if not check if a register 16 is found in a template void check_register_in_template(char *template) { int len = sizeof(newargreg64)/sizeof(newargreg64[0]); //check if register 64 found in template and mark it as used for(int i = 0; i < len; ++i) { if (strstr(template, newargreg64[i]) != NULL) add_register_used(newargreg64[i]); } //check if register 32 found in template and mark it as used len = sizeof(newargreg32)/sizeof(newargreg32[0]); for(int i = 0; i < len; ++i) { if (strstr(template, newargreg32[i]) != NULL) add_register_used(register32_to_64(newargreg32[i])); } //check if register 16 found in template and mark it as used len = sizeof(newargreg16)/sizeof(newargreg16[0]); for(int i = 0; i < len; ++i) { if (strstr(template, newargreg16[i]) != NULL) add_register_used(register16_to_64(newargreg16[i])); } //check if register 8 found in template and mark it as used len = sizeof(newargreg8)/sizeof(newargreg8[0]); for(int i = 0; i < len; ++i) { if (strstr(template, newargreg8[i]) != NULL) add_register_used(register8_to_64(newargreg8[i])); } } static int cmp_ctor(const void *a, const void *b) { return (*(CtorFunc **)a)->priority - (*(CtorFunc **)b)->priority; } static void emit_constructors(void) { if (constructor_cnt == 0) return; qsort(constructors, constructor_cnt, sizeof(CtorFunc *), cmp_ctor); println(" .section .init_array,\"aw\",@init_array"); println(" .p2align 3"); for (int i = 0; i < constructor_cnt; i++) { println(" .quad %s", constructors[i]->name); } println(" .text"); } static void emit_destructors(void) { if (destructor_cnt == 0) return; qsort(destructors, destructor_cnt, sizeof(CtorFunc *), cmp_ctor); println(" .section .fini_array,\"aw\",@fini_array"); println(" .p2align 3"); for (int i = 0; i < destructor_cnt; i++) { println(" .quad %s", destructors[i]->name); } println(" .text"); } #define FPCLASSIFY_FLOAT \ "\tmovups\t%%xmm0,%%xmm1\n\ \tmov\t$0x7fffffff,%%eax\n\ \tmovd\t%%eax,%%xmm2\n\ \tandps\t%%xmm2,%%xmm1\n\ \tmov\t$%d,%%eax\n\ \tucomiss\t%%xmm1,%%xmm1\n\ \tjp\t9f\n\ \tmov\t$0x7f7fffff,%%edi\n\ \tmovd\t%%edi,%%xmm2\n\ \tucomiss\t%%xmm2,%%xmm1\n\ \tja\t2f\n\ \tmov\t$0x00800000,%%edi\n\ \tmovd\t%%edi,%%xmm2\n\ \tucomiss\t%%xmm2,%%xmm1\n\ \tjnb\t3f\n\ \txorps\t%%xmm1,%%xmm1\n\ \tucomiss\t%%xmm1,%%xmm0\n\ \tjp\t1f\n\ \tmovl\t$%d,%%eax\n\ \tje\t9f\n\ 1:\tmovl\t$%d,%%eax\n\ \tjmp\t9f\n\ 2:\tmovl\t$%d,%%eax\n\ \tjmp\t9f\n\ 3:\tmovl\t$%d,%%eax\n\ 9:" #define FPCLASSIFY_DOUBLE \ "\tmovapd\t%%xmm0,%%xmm1\n\ \tmov\t$0x7fffffffffffffff,%%rax\n\ \tmovq\t%%rax,%%xmm2\n\ \tandps\t%%xmm2,%%xmm1\n\ \tmov\t$%d,%%eax\n\ \tucomisd\t%%xmm1,%%xmm1\n\ \tjp\t9f\n\ \tmov\t$0x7fefffffffffffff,%%rdi\n\ \tmovq\t%%rdi,%%xmm2\n\ \tucomisd\t%%xmm2,%%xmm1\n\ \tja\t2f\n\ \tmov\t$0x0010000000000000,%%rdi\n\ \tmovq\t%%rdi,%%xmm2\n\ \tucomisd\t%%xmm2,%%xmm1\n\ \tjnb\t3f\n\ \txorps\t%%xmm1,%%xmm1\n\ \tucomisd\t%%xmm1,%%xmm0\n\ \tjp\t1f\n\ \tmovl\t$%d,%%eax\n\ \tje\t9f\n\ 1:\tmovl\t$%d,%%eax\n\ \tjmp\t9f\n\ 2:\tmovl\t$%d,%%eax\n\ \tjmp\t9f\n\ 3:\tmovl\t$%d,%%eax\n\ 9:" #define FPCLASSIFY_LDOUBLE \ "\tmov\t$%d,%%eax\n\ \tfld\t%%st\n\ \tfabs\n\ \tfucomi\t%%st,%%st\n\ \tjp\t6f\n\ \tpush\t$0x7ffe\n\ \tpush\t$-1\n\ \tfldt\t(%%rsp)\n\ \tadd\t$16,%%rsp\n\ \tfxch\n\ \tmov\t$%d,%%eax\n\ \tfucomi\n\ \tfstp\t%%st(1)\n\ \tja\t7f\n\ \tmov\t$1,%%edi\n\ \tpush\t%%rdi\n\ \tror\t%%rdi\n\ \tpush\t%%rdi\n\ \tfldt\t(%%rsp)\n\ \tadd\t$16,%%rsp\n\ \tfxch\n\ \tmov\t$%d,%%eax\n\ \tfucomip\n\ \tfstp\t%%st\n\ \tjnb\t8f\n\ \tfldz\n\ \tfxch\n\ \tfucomip\n\ \tfstp\t%%st\n\ \tjp\t5f\n\ \tmov\t$%d,%%eax\n\ \tje\t9f\n\ 5:\tmov\t$%d,%%eax\n\ \tjmp\t9f\n\ 6:\tfstp\t%%st\n\ \tfstp\t%%st\n\ \tjmp\t9f\n\ 7:\tfstp\t%%st\n\ \tfstp\t%%st\n\ \tjmp\t9f\n\ 8:\tfstp\t%%st\n\ 9:" void gen_fpclassify(FpClassify *fpc) { int fpnan = fpc->args[0]; int fpinf = fpc->args[1]; int fpnorm = fpc->args[2]; int fpsubnorm = fpc->args[3]; int fpzero = fpc->args[4]; gen_expr(fpc->node); switch (fpc->node->ty->kind) { case TY_FLOAT: println(FPCLASSIFY_FLOAT, fpnan, fpzero, fpsubnorm, fpinf, fpnorm); break; case TY_DOUBLE: println(FPCLASSIFY_DOUBLE, fpnan, fpzero, fpsubnorm, fpinf, fpnorm); break; case TY_LDOUBLE: println(FPCLASSIFY_LDOUBLE, fpnan, fpinf, fpnorm, fpzero, fpsubnorm); break; default: unreachable(); } } chibicc-1.0.24/compare.txt000066400000000000000000000000001517770275000153520ustar00rootroot00000000000000chibicc-1.0.24/debug.c000077500000000000000000000663701517770275000144460ustar00rootroot00000000000000#include "chibicc.h" #include #include // for debug needs char *tokenkind2str(TokenKind kind) { switch (kind) { case TK_IDENT: return "TK_IDENT"; case TK_PUNCT: return "TK_PUNCT"; case TK_KEYWORD: return "TK_KEYWORD"; case TK_STR: return "TK_STR"; case TK_NUM: return "TK_NUM"; case TK_PP_NUM: return "TK_PP_NUM"; case TK_EOF: return "TK_EOF"; default: return "UNREACHABLE"; } } // print all tokens received void print_debug_tokens(char *currentfilename, char *function, Token *tok) { fprintf(f, "=====================file : %s, function: %s\n", currentfilename, function); // for debug needs print all the tokens with values Token *t = tok; while (t->kind != TK_EOF) { if (t->len > 0) { char tokloc[t->len + 1]; memset(tokloc, 0, sizeof(tokloc)); char *ptokloc = &tokloc[0]; strncpy(ptokloc, t->loc, t->len); fprintf(f, "token->kind: %s, token->len: %d, token->val: %ld, token->fval:%Lf \n", tokenkind2str(t->kind), t->len, t->val, t->fval); fprintf(f, " token->str: %s, token->filename: %s, token->line_no: %d, token->at_bol:%d \n", t->str, t->filename, t->line_no, t->at_bol); fprintf(f, " token->loc: %s \n", ptokloc); } // TK_EOF not sure that it helps to have this information in the log! // else // { // fprintf(f, "token->kind: %s, token->len: %d, token->val: %ld, token->fval:%Lf \n", tokenkind2str(t->kind), t->len, t->val, t->fval); // fprintf(f, " token->str: %s, token->filename: %s, token->line_no: %d, token->at_bol:%d \n", t->str, t->filename, t->line_no, t->at_bol); // } t = t->next; } } static void emit_base_type_die(int c, char *label, char *name, int encoding, int size) { println(".L.%s%d:", label, c); println(" .uleb128 5"); println(" .string \"%s\"", name); println(" .byte %d", encoding); println(" .byte %d", size); } typedef struct DebugTypeInfo DebugTypeInfo; struct DebugTypeInfo { Type *ty; int id; DebugTypeInfo *next; }; typedef struct DebugQualTypeInfo DebugQualTypeInfo; struct DebugQualTypeInfo { Type *ty; int id; DebugQualTypeInfo *next; }; typedef struct EmittedTypedef EmittedTypedef; struct EmittedTypedef { char *name; Type *ty; EmittedTypedef *next; }; static DebugTypeInfo *find_debug_type(DebugTypeInfo *types, Type *ty) { for (DebugTypeInfo *it = types; it; it = it->next) if (it->ty == ty) return it; return NULL; } static DebugQualTypeInfo *find_debug_qual_type(DebugQualTypeInfo *types, Type *ty) { for (DebugQualTypeInfo *it = types; it; it = it->next) if (it->ty == ty) return it; return NULL; } static bool has_debug_type_qual(Type *ty) { return ty && (ty->is_const || ty->is_volatile || ty->is_restrict); } static Type *unqual_debug_type(Type *ty) { if (!ty) return NULL; if (ty->origin) return ty->origin; return ty; } static bool is_builtin_debug_type(Type *ty) { if (!ty) return true; switch (ty->kind) { case TY_VOID: case TY_BOOL: case TY_ENUM: case TY_CHAR: case TY_SHORT: case TY_INT: case TY_LONG: case TY_LLONG: case TY_INT128: case TY_FLOAT: case TY_DOUBLE: case TY_LDOUBLE: return true; default: return false; } } static bool emit_builtin_type_ref(Type *ty, int c) { if (!ty) { println(" .long .L.type_int%d - .L.debug_info%d", c, c); return true; } switch (ty->kind) { case TY_VOID: println(" .long .L.type_void%d - .L.debug_info%d", c, c); return true; case TY_BOOL: println(" .long .L.type_bool%d - .L.debug_info%d", c, c); return true; case TY_ENUM: println(" .long .L.type_int%d - .L.debug_info%d", c, c); return true; case TY_CHAR: if (ty->is_unsigned) { println(" .long .L.type_uchar%d - .L.debug_info%d", c, c); return true; } println(" .long .L.type_char%d - .L.debug_info%d", c, c); return true; case TY_SHORT: if (ty->is_unsigned) { println(" .long .L.type_ushort%d - .L.debug_info%d", c, c); return true; } println(" .long .L.type_short%d - .L.debug_info%d", c, c); return true; case TY_INT: if (ty->is_unsigned) { println(" .long .L.type_uint%d - .L.debug_info%d", c, c); return true; } println(" .long .L.type_int%d - .L.debug_info%d", c, c); return true; case TY_LONG: if (ty->is_unsigned) { println(" .long .L.type_ulong%d - .L.debug_info%d", c, c); return true; } println(" .long .L.type_long%d - .L.debug_info%d", c, c); return true; case TY_LLONG: if (ty->is_unsigned) { println(" .long .L.type_ullong%d - .L.debug_info%d", c, c); return true; } println(" .long .L.type_llong%d - .L.debug_info%d", c, c); return true; case TY_INT128: if (ty->is_unsigned) { println(" .long .L.type_uint128%d - .L.debug_info%d", c, c); return true; } println(" .long .L.type_int128%d - .L.debug_info%d", c, c); return true; case TY_FLOAT: println(" .long .L.type_float%d - .L.debug_info%d", c, c); return true; case TY_DOUBLE: println(" .long .L.type_double%d - .L.debug_info%d", c, c); return true; case TY_LDOUBLE: println(" .long .L.type_ldouble%d - .L.debug_info%d", c, c); return true; default: return false; } } static void collect_debug_qual_type(Type *ty, DebugQualTypeInfo **types, int *next_id) { if (!has_debug_type_qual(ty)) return; if (find_debug_qual_type(*types, ty)) return; DebugQualTypeInfo *entry = calloc(1, sizeof(DebugQualTypeInfo)); entry->ty = ty; entry->id = (*next_id)++; entry->next = *types; *types = entry; } static void collect_debug_type(Type *ty, DebugTypeInfo **types, int *next_id, DebugQualTypeInfo **quals, int *next_qual_id) { if (!ty) return; if (has_debug_type_qual(ty)) collect_debug_qual_type(ty, quals, next_qual_id); ty = unqual_debug_type(ty); if (is_builtin_debug_type(ty)) return; if (ty->kind != TY_PTR && ty->kind != TY_ARRAY && ty->kind != TY_STRUCT && ty->kind != TY_UNION) return; if (find_debug_type(*types, ty)) return; DebugTypeInfo *entry = calloc(1, sizeof(DebugTypeInfo)); entry->ty = ty; entry->id = (*next_id)++; entry->next = *types; *types = entry; if (ty->kind == TY_PTR || ty->kind == TY_ARRAY) { collect_debug_type(ty->base, types, next_id, quals, next_qual_id); return; } for (Member *mem = ty->members; mem; mem = mem->next) collect_debug_type(mem->ty, types, next_id, quals, next_qual_id); } static void emit_unqualified_type_ref(Type *ty, DebugTypeInfo *types, int c) { ty = unqual_debug_type(ty); if (emit_builtin_type_ref(ty, c)) return; DebugTypeInfo *entry = find_debug_type(types, ty); if (!entry) { println(" .long .L.type_int%d - .L.debug_info%d", c, c); return; } println(" .long .L.type_custom_%d_%d - .L.debug_info%d", c, entry->id, c); } static char *qual_outer_label(DebugQualTypeInfo *entry, int c) { Type *ty = entry->ty; if (ty->is_const) return format(".L.type_const_%d_%d", c, entry->id); if (ty->is_volatile) return format(".L.type_volatile_%d_%d", c, entry->id); return format(".L.type_restrict_%d_%d", c, entry->id); } static void emit_type_ref(Type *ty, DebugTypeInfo *types, DebugQualTypeInfo *quals, int c) { if (has_debug_type_qual(ty)) { DebugQualTypeInfo *entry = find_debug_qual_type(quals, ty); if (entry) { println(" .long %s - .L.debug_info%d", qual_outer_label(entry, c), c); return; } } emit_unqualified_type_ref(ty, types, c); } static void emit_struct_name(Type *ty, int id) { Token *tag = ty ? ty->tag_name : NULL; if (!tag && ty) tag = ty->name; if (tag) { println(" .string \"%.*s\"", tag->len, tag->loc); return; } println(" .string \"type_%d\"", id); } static void emit_member_name(Member *mem, int idx) { if (!mem->name) { println(" .string \"member_%d\"", idx); return; } println(" .string \"%.*s\"", mem->name->len, mem->name->loc); } static void emit_custom_type_die(DebugTypeInfo *entry, DebugTypeInfo *types, int c) { Type *ty = entry->ty; println(".L.type_custom_%d_%d:", c, entry->id); switch (ty->kind) { case TY_PTR: println(" .uleb128 6"); emit_unqualified_type_ref(ty->base, types, c); return; case TY_ARRAY: { int64_t count = ty->array_len; if (count < 0) count = 0; println(" .uleb128 7"); emit_unqualified_type_ref(ty->base, types, c); println(" .uleb128 8"); println(" .uleb128 %ld", count); println(" .byte 0"); return; } case TY_STRUCT: case TY_UNION: { println(" .uleb128 %d", ty->kind == TY_STRUCT ? 9 : 11); emit_struct_name(ty, entry->id); println(" .uleb128 %ld", ty->size); int member_idx = 0; for (Member *mem = ty->members; mem; mem = mem->next) { println(" .uleb128 10"); emit_member_name(mem, member_idx++); emit_unqualified_type_ref(mem->ty, types, c); println(" .uleb128 %d", ty->kind == TY_UNION ? 0 : mem->offset); } println(" .byte 0"); return; } default: return; } } static void emit_qual_type_dies(DebugQualTypeInfo *quals, DebugTypeInfo *types, int c) { for (DebugQualTypeInfo *entry = quals; entry; entry = entry->next) { Type *ty = entry->ty; if (ty->is_restrict) { println(".L.type_restrict_%d_%d:", c, entry->id); println(" .uleb128 16"); emit_unqualified_type_ref(ty, types, c); } if (ty->is_volatile) { println(".L.type_volatile_%d_%d:", c, entry->id); println(" .uleb128 15"); if (ty->is_restrict) println(" .long .L.type_restrict_%d_%d - .L.debug_info%d", c, entry->id, c); else emit_unqualified_type_ref(ty, types, c); } if (ty->is_const) { println(".L.type_const_%d_%d:", c, entry->id); println(" .uleb128 14"); if (ty->is_volatile) println(" .long .L.type_volatile_%d_%d - .L.debug_info%d", c, entry->id, c); else if (ty->is_restrict) println(" .long .L.type_restrict_%d_%d - .L.debug_info%d", c, entry->id, c); else emit_unqualified_type_ref(ty, types, c); } } } static bool is_emitted_typedef(EmittedTypedef *head, char *name, Type *ty) { for (EmittedTypedef *it = head; it; it = it->next) { if (it->ty == ty && !strcmp(it->name, name)) return true; } return false; } static void emit_typedef_dies(DebugTypeInfo *types, DebugQualTypeInfo *quals, int c) { EmittedTypedef *emitted = NULL; for (DebugTypedef *td = debug_typedefs; td; td = td->next) { if (!td->name || !td->ty) continue; if (is_emitted_typedef(emitted, td->name, td->ty)) continue; EmittedTypedef *entry = calloc(1, sizeof(EmittedTypedef)); entry->name = td->name; entry->ty = td->ty; entry->next = emitted; emitted = entry; println(" .uleb128 12"); println(" .string \"%s\"", td->name); emit_type_ref(td->ty, types, quals, c); } } void emit_debug_info(Obj *prog) { if (!opt_g) return; static int c = 0; static int label_count = 0; // Compute absolute source path and compilation directory char abs_path[PATH_MAX] = {0}; char comp_dir[PATH_MAX] = {0}; if (base_file) { // Use base_file directly without realpath snprintf(abs_path, sizeof(abs_path), "%s", base_file); // Extract directory from path (find last '/') char *last_slash = strrchr(base_file, '/'); if (last_slash && last_slash != base_file) { size_t dir_len = last_slash - base_file; if (dir_len < sizeof(comp_dir)) { strncpy(comp_dir, base_file, dir_len); comp_dir[dir_len] = '\0'; } } else { snprintf(comp_dir, sizeof(comp_dir), "."); } } else { snprintf(abs_path, sizeof(abs_path), "%s", "unknown_source"); snprintf(comp_dir, sizeof(comp_dir), "."); } println(" .section .debug_abbrev,\"\",@progbits"); println(".L.debug_abbrev%d:", c); println(" .uleb128 1"); // Abbrev code println(" .uleb128 0x11"); // DW_TAG_compile_unit println(" .byte 1"); // DW_CHILDREN_yes println(" .uleb128 0x25"); // DW_AT_producer println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0x13"); // DW_AT_language println(" .uleb128 0xb"); // DW_FORM_data1 println(" .uleb128 0x1b"); // DW_AT_comp_dir println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0x3"); // DW_AT_name println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0x10"); // DW_AT_stmt_list println(" .uleb128 0x17"); // DW_FORM_sec_offset println(" .uleb128 0x11"); // DW_AT_low_pc println(" .uleb128 0x1"); // DW_FORM_addr println(" .uleb128 0x12"); // DW_AT_high_pc println(" .uleb128 0x1"); // DW_FORM_addr println(" .byte 0"); println(" .byte 0"); //println(" .byte 0"); println(" .uleb128 2"); // Abbrev code println(" .uleb128 0x2e"); // DW_TAG_subprogram println(" .byte 1"); // DW_CHILDREN_yes println(" .uleb128 0x3"); // DW_AT_name println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0x3a"); // DW_AT_decl_file println(" .uleb128 0x15"); // DW_FORM_udata println(" .uleb128 0x3b"); // DW_AT_decl_line println(" .uleb128 0x15"); // DW_FORM_udata println(" .uleb128 0x11"); // DW_AT_low_pc println(" .uleb128 0x1"); // DW_FORM_addr println(" .uleb128 0x12"); // DW_AT_high_pc println(" .uleb128 0x1"); // DW_FORM_addr println(" .uleb128 0x40"); // DW_AT_frame_base println(" .uleb128 0x18"); // DW_FORM_exprloc println(" .uleb128 0x3f"); // DW_AT_external println(" .uleb128 0xc"); // DW_FORM_flag println(" .byte 0"); println(" .byte 0"); println(" .uleb128 3"); // Abbrev code println(" .uleb128 0x5"); // DW_TAG_formal_parameter println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x3"); // DW_AT_name println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0x49"); // DW_AT_type println(" .uleb128 0x13"); // DW_FORM_ref4 println(" .uleb128 0x2"); // DW_AT_location println(" .uleb128 0x18"); // DW_FORM_exprloc println(" .byte 0"); println(" .byte 0"); println(" .uleb128 4"); // Abbrev code println(" .uleb128 0x34"); // DW_TAG_variable println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x3"); // DW_AT_name println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0x49"); // DW_AT_type println(" .uleb128 0x13"); // DW_FORM_ref4 println(" .uleb128 0x2"); // DW_AT_location println(" .uleb128 0x18"); // DW_FORM_exprloc println(" .byte 0"); println(" .byte 0"); println(" .uleb128 5"); // Abbrev code println(" .uleb128 0x24"); // DW_TAG_base_type println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x3"); // DW_AT_name println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0x3e"); // DW_AT_encoding println(" .uleb128 0xb"); // DW_FORM_data1 println(" .uleb128 0xb"); // DW_AT_byte_size println(" .uleb128 0xb"); // DW_FORM_data1 println(" .byte 0"); println(" .byte 0"); println(" .uleb128 6"); // Abbrev code println(" .uleb128 0xf"); // DW_TAG_pointer_type println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x49"); // DW_AT_type println(" .uleb128 0x13"); // DW_FORM_ref4 println(" .byte 0"); println(" .byte 0"); println(" .uleb128 7"); // Abbrev code println(" .uleb128 0x1"); // DW_TAG_array_type println(" .byte 1"); // DW_CHILDREN_yes println(" .uleb128 0x49"); // DW_AT_type println(" .uleb128 0x13"); // DW_FORM_ref4 println(" .byte 0"); println(" .byte 0"); println(" .uleb128 8"); // Abbrev code println(" .uleb128 0x21"); // DW_TAG_subrange_type println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x37"); // DW_AT_count println(" .uleb128 0xf"); // DW_FORM_udata println(" .byte 0"); println(" .byte 0"); println(" .uleb128 9"); // Abbrev code println(" .uleb128 0x13"); // DW_TAG_structure_type println(" .byte 1"); // DW_CHILDREN_yes println(" .uleb128 0x3"); // DW_AT_name println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0xb"); // DW_AT_byte_size println(" .uleb128 0xf"); // DW_FORM_udata println(" .byte 0"); println(" .byte 0"); println(" .uleb128 10"); // Abbrev code println(" .uleb128 0xd"); // DW_TAG_member println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x3"); // DW_AT_name println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0x49"); // DW_AT_type println(" .uleb128 0x13"); // DW_FORM_ref4 println(" .uleb128 0x38"); // DW_AT_data_member_location println(" .uleb128 0xf"); // DW_FORM_udata println(" .byte 0"); println(" .byte 0"); println(" .uleb128 11"); // Abbrev code println(" .uleb128 0x17"); // DW_TAG_union_type println(" .byte 1"); // DW_CHILDREN_yes println(" .uleb128 0x3"); // DW_AT_name println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0xb"); // DW_AT_byte_size println(" .uleb128 0xf"); // DW_FORM_udata println(" .byte 0"); println(" .byte 0"); println(" .uleb128 12"); // Abbrev code println(" .uleb128 0x16"); // DW_TAG_typedef println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x3"); // DW_AT_name println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0x49"); // DW_AT_type println(" .uleb128 0x13"); // DW_FORM_ref4 println(" .byte 0"); println(" .byte 0"); println(" .uleb128 13"); // Abbrev code println(" .uleb128 0x34"); // DW_TAG_variable println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x3"); // DW_AT_name println(" .uleb128 0x8"); // DW_FORM_string println(" .uleb128 0x49"); // DW_AT_type println(" .uleb128 0x13"); // DW_FORM_ref4 println(" .uleb128 0x3a"); // DW_AT_decl_file println(" .uleb128 0x15"); // DW_FORM_udata println(" .uleb128 0x3b"); // DW_AT_decl_line println(" .uleb128 0x15"); // DW_FORM_udata println(" .uleb128 0x3f"); // DW_AT_external println(" .uleb128 0xc"); // DW_FORM_flag println(" .uleb128 0x2"); // DW_AT_location println(" .uleb128 0x18"); // DW_FORM_exprloc println(" .byte 0"); println(" .byte 0"); println(" .uleb128 14"); // Abbrev code println(" .uleb128 0x26"); // DW_TAG_const_type println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x49"); // DW_AT_type println(" .uleb128 0x13"); // DW_FORM_ref4 println(" .byte 0"); println(" .byte 0"); println(" .uleb128 15"); // Abbrev code println(" .uleb128 0x35"); // DW_TAG_volatile_type println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x49"); // DW_AT_type println(" .uleb128 0x13"); // DW_FORM_ref4 println(" .byte 0"); println(" .byte 0"); println(" .uleb128 16"); // Abbrev code println(" .uleb128 0x37"); // DW_TAG_restrict_type println(" .byte 0"); // DW_CHILDREN_no println(" .uleb128 0x49"); // DW_AT_type println(" .uleb128 0x13"); // DW_FORM_ref4 println(" .byte 0"); println(" .byte 0"); println(" .byte 0"); // End of abbrevs println(" .section .debug_info,\"\",@progbits"); println(".L.debug_info%d:", c); println(" .long .L.debug_info_end%d - .L.debug_info_start%d", c, c); println(".L.debug_info_start%d:", c); println(" .short 4"); println(" .long .L.debug_abbrev%d", c); println(" .byte 8"); println(" .uleb128 1"); println(" .string \"%s\"", PRODUCT); // DW_AT_producer println(" .byte 0xc"); // DW_AT_language (DW_LANG_C99) println(" .string \"%s\"", comp_dir); // DW_AT_comp_dir (new) println(" .string \"%s\"", abs_path); // DW_AT_name (absolute path) println(" .long .L.line_table_start0"); // DW_AT_stmt_list println(" .quad .L.text_start"); // DW_AT_low_pc println(" .quad .L.text_end"); // DW_AT_high_pc // Emit base types emit_base_type_die(c, "type_void", "void", 0, 0); emit_base_type_die(c, "type_bool", "_Bool", 2, 1); // DW_ATE_boolean emit_base_type_die(c, "type_char", "char", 6, 1); // DW_ATE_signed_char emit_base_type_die(c, "type_uchar", "unsigned char", 8, 1); // DW_ATE_unsigned_char emit_base_type_die(c, "type_short", "short", 5, 2); // DW_ATE_signed emit_base_type_die(c, "type_ushort", "unsigned short", 7, 2); // DW_ATE_unsigned emit_base_type_die(c, "type_int", "int", 5, 4); // DW_ATE_signed emit_base_type_die(c, "type_uint", "unsigned int", 7, 4); // DW_ATE_unsigned emit_base_type_die(c, "type_long", "long", 5, 8); // DW_ATE_signed emit_base_type_die(c, "type_ulong", "unsigned long", 7, 8); // DW_ATE_unsigned emit_base_type_die(c, "type_llong", "long long", 5, 8); // DW_ATE_signed emit_base_type_die(c, "type_ullong", "unsigned long long", 7, 8); // DW_ATE_unsigned emit_base_type_die(c, "type_int128", "__int128", 5, 16); // DW_ATE_signed emit_base_type_die(c, "type_uint128", "unsigned __int128", 7, 16); // DW_ATE_unsigned emit_base_type_die(c, "type_float", "float", 4, 4); // DW_ATE_float emit_base_type_die(c, "type_double", "double", 4, 8); // DW_ATE_float emit_base_type_die(c, "type_ldouble", "long double", 4, 16); // DW_ATE_float DebugTypeInfo *types = NULL; DebugQualTypeInfo *quals = NULL; int next_type_id = 0; int next_qual_id = 0; for (Obj *fn = prog; fn; fn = fn->next) { if (!fn->is_function || !fn->is_definition || !fn->is_live) continue; for (Obj *var = fn->params; var; var = var->next) collect_debug_type(var->ty, &types, &next_type_id, &quals, &next_qual_id); for (Obj *var = fn->locals; var; var = var->next) if (!var->is_param) collect_debug_type(var->ty, &types, &next_type_id, &quals, &next_qual_id); } for (Obj *var = prog; var; var = var->next) { if (var->is_function || !var->is_definition || !var->name) continue; collect_debug_type(var->ty, &types, &next_type_id, &quals, &next_qual_id); } for (DebugTypedef *td = debug_typedefs; td; td = td->next) collect_debug_type(td->ty, &types, &next_type_id, &quals, &next_qual_id); for (DebugTypeInfo *entry = types; entry; entry = entry->next) emit_custom_type_die(entry, types, c); emit_qual_type_dies(quals, types, c); emit_typedef_dies(types, quals, c); for (Obj *fn = prog; fn; fn = fn->next) { if (!fn->is_function || !fn->is_definition) continue; if (!fn->is_live) continue; println(" .uleb128 2"); println(" .string \"%s\"", fn->name); println(" .uleb128 %d", fn->file_no); println(" .uleb128 %d", fn->line_no); char *name = fn->asmname ? fn->asmname : fn->name; println(" .quad %s", name); println(" .quad .L.end.%s", name); // Frame base int lbl_fb = label_count++; println(" .uleb128 .L.loc_end_%d - .L.loc_start_%d", lbl_fb, lbl_fb); println(".L.loc_start_%d:", lbl_fb); if (is_omit_fp(fn)) { // If frame pointer is omitted, offsets are relative to RSP at entry. // We define frame base as RSP + stack_size. println(" .byte 0x77"); // DW_OP_breg7 (rsp) println(" .sleb128 %d", fn->stack_size); } else if (fn->stack_align > 16) { println(" .byte 0x53"); // DW_OP_reg3 (rbx) } else { println(" .byte 0x56"); // DW_OP_reg6 (rbp) } println(".L.loc_end_%d:", lbl_fb); println(" .byte %d", !fn->is_static); for (Obj *var = fn->params; var; var = var->next) { if (!var->name) continue; println(" .uleb128 3"); println(" .string \"%s\"", var->name); emit_type_ref(var->ty, types, quals, c); int lbl = label_count++; println(" .uleb128 .L.loc_end_%d - .L.loc_start_%d", lbl, lbl); println(".L.loc_start_%d:", lbl); println(" .byte 0x91"); // DW_OP_fbreg println(" .sleb128 %d", var->offset); println(".L.loc_end_%d:", lbl); } for (Obj *var = fn->locals; var; var = var->next) { if (var->is_param || !var->name) continue; println(" .uleb128 4"); println(" .string \"%s\"", var->name); emit_type_ref(var->ty, types, quals, c); int lbl = label_count++; println(" .uleb128 .L.loc_end_%d - .L.loc_start_%d", lbl, lbl); println(".L.loc_start_%d:", lbl); println(" .byte 0x91"); // DW_OP_fbreg println(" .sleb128 %d", var->offset); println(".L.loc_end_%d:", lbl); } println(" .byte 0"); // End of children } for (Obj *var = prog; var; var = var->next) { if (var->is_function || !var->is_definition || !var->name) continue; println(" .uleb128 13"); println(" .string \"%s\"", var->name); emit_type_ref(var->ty, types, quals, c); println(" .uleb128 %d", var->file_no); println(" .uleb128 %d", var->line_no); println(" .byte %d", !var->is_static); // DW_OP_addr println(" .byte 9"); println(" .byte 0x3"); println(" .quad %s", var->name); } println(" .byte 0"); println(".L.debug_info_end%d:", c); println(" .section .debug_line,\"\",@progbits"); println(".L.line_table_start0:"); } chibicc-1.0.24/diagram/000077500000000000000000000000001517770275000146015ustar00rootroot00000000000000chibicc-1.0.24/diagram/README.md000066400000000000000000000000621517770275000160560ustar00rootroot00000000000000# needed to have the diagram folder empty into gitchibicc-1.0.24/extended_asm.c000066400000000000000000003720251517770275000160120ustar00rootroot00000000000000// This file manages extended assembly. // asm ( // "assembler template" // : outputs // : inputs // : clobbers // : labels) // references https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html and https://www.felixcloutier.com/documents/gcc-asm.html // // Special format strings // In addition to the tokens described by the input, output, and goto operands, these tokens have special meanings in the assembler template: // //‘%%’ // Outputs a single ‘%’ into the assembler code. // //‘%=’ // Outputs a number that is unique to each instance of the asm statement in the entire compilation. This option is useful when creating local labels and referring to them multiple times in a single template that generates multiple assembler instructions. // //‘%{’ //‘%|’ //‘%}’ // Outputs ‘{’, ‘|’, and ‘}’ characters (respectively) into the assembler code. // When unescaped, these characters have special meaning to indicate multiple assembler dialects. #include "chibicc.h" typedef struct { Token *input; // store the token corresponding to input char *variableNumber; //store the variable %0, %1... char *input_value; // store the immediate value char *reg; // store the register that corresponds to the variable size char *reg64; //store the register 64 bits char *regh; //store the high bits of a register like ah char *regl; //store the lower bits of a register like al char *regw; //store the word register char *operand_name; //store the operand name like [dst], [src] int index; // store the index char letter; // store the letter corresponding to input int offset; // store the offset int size; // store the size to determine the operation to do ex movl movb movw movq bool isVariable; // store true if it's a variable otherwise false for immediate value bool isAddress; // store true if it's an address pointer bool isArray; //true if it's an array variable bool isStruct; //true if it's a struct variable bool isToNegate; //true if the value should be negate int indexArray; //store the index element of array int offsetArray; //store the index of array int offsetStruct; //store the offset of the struct bool isq; //true if q: 8-bit registers (al, bl, cl, dl) bool isl; //true if l: 32-bit registers (eax, ebx, ecx, edx) bool is_pure_register; // true if the input is a pure register bool isLea; // true if it's a lea operation like &var bool isBinaryExpr; // true if input is a simple binary expression char bin_op; // '+' or '-' bool bin_lhs_is_imm; bool bin_rhs_is_imm; long bin_lhs_imm; long bin_rhs_imm; int bin_lhs_offset; int bin_rhs_offset; int bin_lhs_size; int bin_rhs_size; } AsmInput; typedef struct { Token *output; // store the token corresponding to input char *variableNumber; //store the variable %0, %1... char *prefix; //= or + char *reg; // store the register that corresponds to the variable size char *reg64; //store the register 64 bits char *regh; //store the high bits of a register like ah char *regl; //store the lower bits of a register like al char *regw; //store the word register char *operand_name; //store the operand name like [dst], [src] char letter; // to store a b r int index; // order in output int size; // store the size to determine the operation to do bool isRegister; // r bool isMemory; // m bool isAlpha; // if is not r neither m is considered Alpha int offset; // store the offset bool isVariable; // store true if it's a variable otherwise false for immediate value bool isAddress; // store true if it's an address pointer bool isArray; //true if it's an array variable bool isStruct; //true if it's a struct variable int indexArray; //store the index element of array int offsetArray; //store the index of array int offsetStruct; //store the offset of the struct bool inputToGenerate; //true if it's the corresponding input should be generated bool isq; //true if q: 8-bit registers (al, bl, cl, dl) bool isl; //true if l: 32-bit registers (eax, ebx, ecx, edx) bool is_pure_register; } AsmOutput; typedef struct { char *templatestr; //bool hasPercent; } AsmTemplate; typedef struct { char *clobber; } AsmClobber; typedef struct { AsmTemplate *template; AsmOutput *output[10]; AsmInput *input[10]; AsmClobber *clobber[10]; int nboutput; int nbinput; int nbclobber; int nblabel; } AsmExtended; typedef AsmExtended AsmExtended; typedef enum { AT_TEMPLATE, // assembler template AT_OUTPUT, // outputs AT_INPUT, // inputs AT_CLOBBER, // clobbers AT_LABEL, // labels } AsmType; // //+ means that the output is actually a read-write value. //=& means that the output is an early-clobber output. Its initial value is unspecified. //= means that the output is write-only. //=@ccCOND is a special case of = that allows you to query the result of a condition code at the end of your assembly statement. // typedef enum // { // CP_READWRITEREG = 1, // +r // CP_READWRITEMEM, // +m // CP_CLOBBEROUTPUTREG, // =&r // CP_WRITEONLYREG, // =r // CP_WRITEONLYMEM, // =m // CP_WRITEONLYOTH, // =a =b =c... // CP_COND, // =@ccCOND // } ConstraintPrefix; static AsmExtended *asmExt; static int nbInput = 0; static int nbOutput = 0; static int nbClobber = 0; static int nbLabel = 0; static int asmtype = 0; extern Context *ctx; static bool hasInput = false; static bool hasOutput = false; static bool isToNegate = false; static bool hasOperandName = false; static char *register_lower(char *reg); static char *register_higher(char *reg); static char *register_word(char *reg); static bool parse_simple_binary_input(Token **rest, Token *tok, Obj *locals); static char *arith_opcode(char op, int size); static bool is_mem_placeholder(char *s) { return s && !strcmp(s, "%mem"); } static Obj *find_obj_by_tok(Obj *locals, Token *tok) { if (!locals || !tok || tok->kind != TK_IDENT) return NULL; for (Obj *var = locals; var; var = var->next) { if (!var->name) continue; if ((int)strlen(var->name) == tok->len && !strncmp(var->name, tok->loc, tok->len)) return var; } return NULL; } static char *use_fixed_register(char *reg64) { // Fixed constraints like "a" or "d" must use the exact register even if // other operands are present; flexible constraints should adapt instead. if (!check_register_used(reg64)) add_register_used(reg64); return reg64; } static void ensure_input_reg(AsmInput *in, char *preferred64) { if (in->reg && !is_mem_placeholder(in->reg)) return; in->reg = specific_register_available(preferred64); if (!in->reg) error("%s:%d: error: in ensure_input_reg :reg is null!", __FILE__, __LINE__); in->reg64 = in->reg; in->regh = register_higher(in->reg64); in->regl = register_lower(in->reg64); in->regw = register_word(in->reg64); } static void ensure_output_reg(AsmOutput *out, char *preferred64) { if (out->reg && !is_mem_placeholder(out->reg)) return; out->reg = specific_register_available(preferred64); if (!out->reg) error("%s:%d: error: in ensure_output_reg :reg is null!", __FILE__, __LINE__); out->reg64 = out->reg; out->regh = register_higher(out->reg64); out->regl = register_lower(out->reg64); out->regw = register_word(out->reg64); } char *extended_asm(Node *node, Token **rest, Token *tok, Obj *locals) { char *input_asm_str; char *output_loading; asmtype = 0; nbInput = 0; nbOutput = 0; nbClobber = 0; nbLabel = 0; hasInput = false; hasOutput = false; // Work on a private, writable buffer. Substitutions are done in-place and // string_replace() assumes enough capacity (up to 10000 bytes). char *template = calloc(1, sizeof(char) * 10000); if (!template) error("%s:%d: error: in extended_asm : out of memory", __FILE__, __LINE__); strncpy(template, tok->str, 9999); char *asm_str = calloc(1, sizeof(char) * 10000); if (isDebug) printf("template==%s\n", template); // allocate memory for all structs needed asmExt = calloc(1, sizeof(AsmExtended)); asmExt->template = calloc(1, sizeof(AsmTemplate)); for (int i = 0; i < 10; i++) asmExt->input[i] = calloc(1, sizeof(AsmInput)); for (int i = 0; i < 10; i++) asmExt->output[i] = calloc(1, sizeof(AsmOutput)); for (int i = 0; i < 10; i++) asmExt->clobber[i] = calloc(1, sizeof(AsmClobber)); //strncpy(asm_str, "", strlen(asm_str) + 1); char *output_asm_str = calloc(1, sizeof(char) * 2500); char *input_final = calloc(1, sizeof(char) * 2500); char *input_for_output = calloc(1, sizeof(char) * 4000); asmExt->template->templatestr = template; // asmExt->template->hasPercent = check_template(template); //clear the registerUsed array clear_register_used(); //mark the register used if found in template check_register_in_template(template); while (!equal(tok->next, ";") && !equal(tok, ";")) { switch (asmtype) { case AT_TEMPLATE: // assembler template break; case AT_OUTPUT: // outputs if (equal(tok, ":")) break; output_asm(node, rest, tok, locals); // generate output instruction for each output variable if (asmExt->output[nbOutput]->variableNumber) { hasOutput = true; output_loading = generate_output_asm(asmExt->output[nbOutput]->variableNumber); // replace %9 by the correct register if (!output_loading) error("%s:%d: error: in extended_asm function extended_asm :output_loading is null!", __FILE__, __LINE__); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in extended_asm function extended_asm :asmExt->output[nbOutput]->reg is null!", __FILE__, __LINE__); output_loading = subst_asm(output_loading, asmExt->output[nbOutput]->reg, asmExt->output[nbOutput]->variableNumber); //generate the ouput instruction strncat(output_asm_str, output_loading, strlen(output_loading)); } else { //to manage the case of no output tok = tok->next; *rest = tok; } nbOutput++; tok = *rest; break; case AT_INPUT: // inputs // return %0, %1 or %x if (equal(tok, ":")) break; input_asm(node, rest, tok, locals); // generate input instruction to load the parameter into register // Skip input loading for immediate constants - they will be substituted directly in the template if (asmExt->input[nbInput]->variableNumber) { hasInput = true; input_asm_str = generate_input_asm(asmExt->input[nbInput]->variableNumber); //replace %9, by the correct if (!input_asm_str) error("%s:%d: error: in extended_asm function extended_asm :input_asm_str is null!", __FILE__, __LINE__); if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in extended_asm function extended_asm :asmExt->input[nbInput]->reg is null!", __FILE__, __LINE__); if (asmExt->input[nbInput]->isAddress) input_asm_str = subst_asm(input_asm_str, asmExt->input[nbInput]->reg64, asmExt->input[nbInput]->variableNumber); else input_asm_str = subst_asm(input_asm_str, asmExt->input[nbInput]->reg, asmExt->input[nbInput]->variableNumber); // concatenate the input final strings to add to the assembly strncat(input_final, input_asm_str, strlen(input_asm_str)); } else if (asmExt->input[nbInput]->input_value) { // For immediate constants, just mark as having input so proper substitution happens hasInput = true; } else { //to manage the case of no input tok = tok->next; *rest = tok; } nbInput++; tok = *rest; break; case AT_CLOBBER: // clobbers if (equal(tok, ":")) break; asmExt->clobber[nbClobber]->clobber = tok->loc; tok = tok->next; // if (equal(tok, ",")) // tok = tok->next; *rest = tok; nbClobber++; break; case AT_LABEL: // labels //nbLabel++; tok = tok->next; *rest = tok; break; default: // error error_tok(tok, "%s:%d : in extended_asm function : too much parameters or complex extended assembly not managed!", __FILE__, __LINE__); } if (equal(tok, ":")) { asmtype += 1; tok = tok->next; continue; } if (equal(tok, ";")) break; tok = tok->next; } //case of no input need to generate input for output if (hasOutput && !hasInput){ input_for_output = generate_input_for_output(); if (input_for_output != NULL) { strncat(asm_str, input_for_output, strlen(input_for_output)); } } if (hasOutput) { // First, substitute named operands like %[dst] for (int i = 0; i < nbOutput; i++) { if (asmExt->output[i]->operand_name) { char pattern[32]; snprintf(pattern, sizeof(pattern), "%%[%s]", asmExt->output[i]->operand_name); template = subst_asm(template, asmExt->output[i]->reg, pattern); } } //replace each %9 by the correct output register char *tmp_asm = calloc(1, sizeof(char) * 300); for (int i = 0; i < nbOutput; i++) { if (asmExt->output[i]->isAddress) { char *tmp = calloc(1, sizeof(char) * 30); strncat(tmp, "(", 2); strncat(tmp, asmExt->output[i]->reg64, strlen(asmExt->output[i]->reg64) ); strncat(tmp, ")", 2); tmp_asm = subst_asm(template, tmp, asmExt->output[i]->variableNumber); free(tmp); }else { tmp_asm = subst_asm(template, asmExt->output[i]->reg, asmExt->output[i]->variableNumber); } } //special case %b0 %h0 for (int i = 0; i < nbOutput; i++) { // Replace %bN with regl if (asmExt->output[i]->regl) { char pattern[8]; snprintf(pattern, sizeof(pattern), "%%b%d", i); tmp_asm = subst_asm(template, asmExt->output[i]->regl, pattern); } // Replace %hN with regh if (asmExt->output[i]->regh) { char pattern[8]; snprintf(pattern, sizeof(pattern), "%%h%d", i); tmp_asm = subst_asm(template, asmExt->output[i]->regh, pattern); } // Replace %wN with regw if (asmExt->output[i]->regw) { char pattern[8]; snprintf(pattern, sizeof(pattern), "%%w%d", i); tmp_asm = subst_asm(template, asmExt->output[i]->regw, pattern); } } strncat(asm_str, tmp_asm, strlen(tmp_asm)); } if (hasInput) { if (hasOperandName) { // First, substitute named operands like %[src] for (int i = 0; i < nbInput; i++) { if (asmExt->input[i]->operand_name) { char pattern[32]; snprintf(pattern, sizeof(pattern), "%%[%s]", asmExt->input[i]->operand_name); template = subst_asm(template, asmExt->input[i]->reg, pattern); } } } //printf("template=%s\n", template); //replace each %9 by the correct input register for (int i = 0; i < nbInput; i++) { // Replace %bN with regl if (asmExt->input[i]->regl) { char pattern[8]; snprintf(pattern, sizeof(pattern), "%%b%d", asmExt->input[i]->index); asm_str = subst_asm(template, asmExt->input[i]->regl, pattern); } // Replace %hN with regh if (asmExt->input[i]->regh) { char pattern[8]; snprintf(pattern, sizeof(pattern), "%%h%d", asmExt->input[i]->index); asm_str = subst_asm(template, asmExt->input[i]->regh, pattern); } // Replace %wN with regw if (asmExt->input[i]->regw) { char pattern[8]; snprintf(pattern, sizeof(pattern), "%%w%d", asmExt->input[i]->index); asm_str = subst_asm(template, asmExt->input[i]->regw, pattern); } if (asmExt->input[i]->input_value) { // For immediate values, substitute the value directly with $ prefix char *tmp = calloc(1, sizeof(char) * 30); strncat(tmp, "$", 2); strncat(tmp, asmExt->input[i]->input_value, strlen(asmExt->input[i]->input_value)); asm_str = subst_asm(template, tmp, asmExt->input[i]->variableNumber); free(tmp); } else if (asmExt->input[i]->isAddress && asmExt->input[i]->letter == 'm') { char *tmp = calloc(1, sizeof(char) * 30); strncat(tmp, "(", 2); strncat(tmp, asmExt->input[i]->reg64, strlen(asmExt->input[i]->reg64) ); strncat(tmp, ")", 2); asm_str = subst_asm(template, tmp, asmExt->input[i]->variableNumber); free(tmp); } else { asm_str = subst_asm(template, asmExt->input[i]->reg, asmExt->input[i]->variableNumber); } } //generate the input instructions before the output if (input_final != NULL) { if (nbOutput > 0) input_for_output = generate_input_for_output(); //input_for_output can be NULL if no input to generate for output //generate first the input for output and then the input for the rest of the template if (input_for_output != NULL && input_final != NULL) { strncat(input_for_output, input_final, strlen(input_final)); strncpy(input_final, input_for_output, strlen(input_for_output) + 1); strncat(input_final, asm_str, strlen(asm_str)); } else { strncat(input_final, asm_str, strlen(asm_str)); } asm_str = input_final; } } //generate the output instructions if (hasOutput && output_asm_str != NULL) { strncat(asm_str, output_asm_str, strlen(output_asm_str)); } //case __asm__ __volatile__ ("rep; nop" ::: "memory"); if (!hasOutput && !hasInput) { if (strlen(template) == 0) strncat(asm_str, "\nnop;\n", 7); else strncat(asm_str, template, strlen(template)); } //replace special characters // replace %% by % // replace ‘%{’ by '{', ‘%|’ by '|' and ‘%}’ by '}' asm_str = subst_asm(asm_str, " %", "%%"); asm_str = subst_asm(asm_str, " {", "%{"); asm_str = subst_asm(asm_str, " |", "%|"); asm_str = subst_asm(asm_str, " }", "%}"); if (isDebug) printf("=====template=%s\n====asm_str=%s\n====input_final==%s\n====output_asm_str===%s\n", template, asm_str, input_final, output_asm_str); tok = tok->next; //printf("tok=%s\n", tok->loc); *rest = tok; // Don't leak template register "usage" into subsequent codegen. clear_register_used(); // free memory for (int i = 0; i < 10; i++) free(asmExt->input[i]); for (int i = 0; i < 10; i++) free(asmExt->output[i]); for (int i = 0; i < 10; i++) free(asmExt->clobber[i]); free(template); free(asmExt->template); // free(input_for_output); // free(output_asm_str); // free(input_final); free(asmExt); return asm_str; } static bool parse_simple_binary_input(Token **rest, Token *tok, Obj *locals) { Token *p = tok; while (equal(p, "(")) p = p->next; if (p->kind != TK_IDENT && p->kind != TK_NUM) return false; Token *lhs = p; Token *op = lhs->next; if (!equal(op, "+") && !equal(op, "-")) return false; Token *rhs = op->next; if (rhs->kind != TK_IDENT && rhs->kind != TK_NUM) return false; Token *end = rhs->next; if (!equal(end, ")")) return false; while (equal(end, ")")) end = end->next; AsmInput *in = asmExt->input[nbInput]; in->isBinaryExpr = true; in->bin_op = op->loc[0]; in->isVariable = false; in->isAddress = false; if (lhs->kind == TK_IDENT) { VarScope *sc = find_var(lhs); if (!sc) error_tok(lhs, "%s:%d: in input_asm function : variable undefined", __FILE__, __LINE__); if (!sc->var->ty) error_tok(lhs, "%s:%d: in input_asm function : variable type unknown", __FILE__, __LINE__); in->bin_lhs_is_imm = false; in->bin_lhs_offset = sc->var->offset; in->bin_lhs_size = sc->var->ty->size; if (sc->var->funcname) { update_offset(sc->var->funcname, locals); in->bin_lhs_offset = sc->var->offset; } } else { in->bin_lhs_is_imm = true; in->bin_lhs_imm = lhs->val; in->bin_lhs_size = 8; } if (rhs->kind == TK_IDENT) { VarScope *sc = find_var(rhs); if (!sc) error_tok(rhs, "%s:%d: in input_asm function : variable undefined", __FILE__, __LINE__); if (!sc->var->ty) error_tok(rhs, "%s:%d: in input_asm function : variable type unknown", __FILE__, __LINE__); in->bin_rhs_is_imm = false; in->bin_rhs_offset = sc->var->offset; in->bin_rhs_size = sc->var->ty->size; if (sc->var->funcname) { update_offset(sc->var->funcname, locals); in->bin_rhs_offset = sc->var->offset; } } else { in->bin_rhs_is_imm = true; in->bin_rhs_imm = rhs->val; in->bin_rhs_size = 8; } int size = 8; if (!in->bin_lhs_is_imm && !in->bin_rhs_is_imm) size = MAX(in->bin_lhs_size, in->bin_rhs_size); else if (!in->bin_lhs_is_imm) size = in->bin_lhs_size; else if (!in->bin_rhs_is_imm) size = in->bin_rhs_size; in->size = size; if (!in->reg) error_tok(lhs, "%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); in->reg = update_register_size(in->reg, size); *rest = end; return true; } void output_asm(Node *node, Token **rest, Token *tok, Obj *locals) { VarScope *sc; while (!equal(tok->next, ":") && !equal(tok->next, ";")) { //case of operand named if (equal(tok, "[") || equal(tok, "{")) { char closing = equal(tok, "[") ? ']' : '}'; tok = tok->next; //case of operand named [dst] or {src} if (tok->kind == TK_IDENT ) { char *name = calloc(tok->len + 1, 1); memcpy(name, tok->loc, tok->len); name[tok->len] = '\0'; asmExt->output[nbOutput]->operand_name = name; asmExt->output[nbOutput]->index = nbOutput; tok = tok->next; // Now consume the closing ] or } if (!equal(tok, (char[]){closing, 0})) { error_tok(tok, "%s:%d: error: in output_asm function : expected closing %c after operand name", __FILE__, __LINE__, closing); } tok = tok->next; } } // register in write only mode // check if the register constraint is followed by a variable like "=r" (val) if (tok->kind == TK_STR) { if (!strncmp(tok->str, "=r", tok->len) || !strncmp(tok->str, "+r", tok->len)) { asmExt->output[nbOutput]->isRegister = true; if (!strncmp(tok->str, "=r", tok->len)) asmExt->output[nbOutput]->prefix = "="; else { asmExt->output[nbOutput]->prefix = "+"; } // Let the allocator choose a free GPR. Hardcoding %rax breaks // common patterns like "+r"(carry) alongside "a"(low). asmExt->output[nbOutput]->reg = register_available(); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'r'; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } if (!strncmp(tok->str, "=&r", tok->len) ) { asmExt->output[nbOutput]->isRegister = true; asmExt->output[nbOutput]->prefix = "="; asmExt->output[nbOutput]->reg = specific_register_available("%r10"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'r'; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "=m", tok->len) || !strncmp(tok->str, "+m", tok->len)) { asmExt->output[nbOutput]->isMemory = true; if (!strncmp(tok->str, "=m", tok->len)) asmExt->output[nbOutput]->prefix = "="; else { asmExt->output[nbOutput]->prefix = "+"; } // For pure memory outputs, don't reserve a scratch register. // We'll substitute %N with the actual memory operand (e.g. -8(%rbp)). asmExt->output[nbOutput]->reg = "%mem"; asmExt->output[nbOutput]->reg64 = "%mem"; asmExt->output[nbOutput]->letter = 'm'; asmExt->output[nbOutput]->inputToGenerate = true; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "=q", tok->len) || !strncmp(tok->str, "+q", tok->len)) { asmExt->output[nbOutput]->isMemory = true; asmExt->output[nbOutput]->isq = true; if (!strncmp(tok->str, "=q", tok->len)) asmExt->output[nbOutput]->prefix = "="; else { asmExt->output[nbOutput]->prefix = "+"; } asmExt->output[nbOutput]->reg = register_available(); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'q'; asmExt->output[nbOutput]->inputToGenerate = true; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "=Q", tok->len) || !strncmp(tok->str, "+Q", tok->len)) { asmExt->output[nbOutput]->isMemory = true; asmExt->output[nbOutput]->isq = true; if (!strncmp(tok->str, "=Q", tok->len)) asmExt->output[nbOutput]->prefix = "="; else { asmExt->output[nbOutput]->prefix = "+"; } asmExt->output[nbOutput]->reg = register_available(); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'Q'; asmExt->output[nbOutput]->inputToGenerate = true; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "=l", tok->len) || !strncmp(tok->str, "+l", tok->len)) { asmExt->output[nbOutput]->isMemory = true; asmExt->output[nbOutput]->isl = true; if (!strncmp(tok->str, "=l", tok->len)) asmExt->output[nbOutput]->prefix = "="; else { asmExt->output[nbOutput]->prefix = "+"; } asmExt->output[nbOutput]->reg = register_available(); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'l'; asmExt->output[nbOutput]->inputToGenerate = true; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } // assuming that it's =a =b ??? else if (!strncmp(tok->str, "=a", tok->len) || !strncmp(tok->str, "=b", tok->len) || !strncmp(tok->str, "=c", tok->len) || !strncmp(tok->str, "=d", tok->len) || !strncmp(tok->str, "=&a", tok->len) || !strncmp(tok->str, "=&b", tok->len) || !strncmp(tok->str, "=&c", tok->len) || !strncmp(tok->str, "=&d", tok->len)) { if (!strncmp(tok->str, "=a", tok->len) || !strncmp(tok->str, "=&a", tok->len)) { asmExt->output[nbOutput]->prefix = "="; asmExt->output[nbOutput]->reg = specific_register_available("%rax"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'a'; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "=b", tok->len) || !strncmp(tok->str, "=&b", tok->len)) { asmExt->output[nbOutput]->prefix = "="; asmExt->output[nbOutput]->reg = specific_register_available("%rbx"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'b'; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "=c", tok->len) || !strncmp(tok->str, "=&c", tok->len)) { asmExt->output[nbOutput]->prefix = "="; asmExt->output[nbOutput]->reg = specific_register_available("%rcx"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'c'; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "=d", tok->len) || !strncmp(tok->str, "=&d", tok->len)) { asmExt->output[nbOutput]->prefix = "="; asmExt->output[nbOutput]->reg = specific_register_available("%rdx"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'd'; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else { tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } asmExt->output[nbOutput]->isAlpha = true; //asmExt->output[nbOutput]->prefix = "="; //asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "+a", tok->len) || !strncmp(tok->str, "+b", tok->len) || !strncmp(tok->str, "+c", tok->len) || !strncmp(tok->str, "+d", tok->len)) { if (!strncmp(tok->str, "+a", tok->len)) { asmExt->output[nbOutput]->prefix = "+"; asmExt->output[nbOutput]->reg = specific_register_available("%rax"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'a'; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "+b", tok->len)) { asmExt->output[nbOutput]->prefix = "+"; asmExt->output[nbOutput]->reg = specific_register_available("%rbx"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'b'; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "+c", tok->len)) { asmExt->output[nbOutput]->prefix = "+"; asmExt->output[nbOutput]->reg = specific_register_available("%rcx"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'c'; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else if (!strncmp(tok->str, "+d", tok->len)) { asmExt->output[nbOutput]->prefix = "+"; asmExt->output[nbOutput]->reg = specific_register_available("%rdx"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'd'; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } else { tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } asmExt->output[nbOutput]->isAlpha = true; //asmExt->output[nbOutput]->prefix = "="; //asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); } //D for destination operand else if (!strncmp(tok->str, "=D", tok->len) || !strncmp(tok->str, "+D", tok->len)) { asmExt->output[nbOutput]->isMemory = true; if (!strncmp(tok->str, "=D", tok->len)) asmExt->output[nbOutput]->prefix = "="; else { asmExt->output[nbOutput]->prefix = "+"; } asmExt->output[nbOutput]->reg = specific_register_available("%rax"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'D'; asmExt->output[nbOutput]->inputToGenerate = true; } //S for source operand else if (!strncmp(tok->str, "=S", tok->len) || !strncmp(tok->str, "+S", tok->len)) { asmExt->output[nbOutput]->isMemory = true; if (!strncmp(tok->str, "=S", tok->len)) asmExt->output[nbOutput]->prefix = "="; else { asmExt->output[nbOutput]->prefix = "+"; } asmExt->output[nbOutput]->reg = specific_register_available("%rax"); if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->reg64 = asmExt->output[nbOutput]->reg; asmExt->output[nbOutput]->regh = register_higher(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regl = register_lower(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->regw = register_word(asmExt->output[nbOutput]->reg64); asmExt->output[nbOutput]->letter = 'S'; asmExt->output[nbOutput]->inputToGenerate = true; } asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); asmExt->output[nbOutput]->index = nbOutput; } // skip the comma else if (equal(tok, ",")) { SET_CTX(ctx); tok = skip(tok, ",", ctx); continue; } // manage the variable inside parenthesis else if (equal(tok, "(")) { if (parse_simple_binary_input(rest, tok, locals)) return; SET_CTX(ctx); while (equal(tok, "(")) tok = tok->next; // check if the variable is defined if (tok->kind == TK_IDENT) { //TODO potential issue if several variables with same name inside different functions. //need to check if the variable is in the correct function asmExt->output[nbOutput]->output = tok; sc = find_var(tok); if (!sc) error_tok(tok, "%s:%d: in output_asm function : variable undefined", __FILE__, __LINE__); if (!sc->var->ty) error_tok(tok, "%s:%d: in output_asm function : variable type unknown", __FILE__, __LINE__); // retrieve the size of the variable to determine the register to use here we use RAX variation asmExt->output[nbOutput]->size = sc->var->ty->size; if (!asmExt->output[nbOutput]->reg) error_tok(tok, "%s:%d: in output_asm function : reg is null extended assembly not managed yet", __FILE__, __LINE__); asmExt->output[nbOutput]->isVariable = true; asmExt->output[nbOutput]->output = tok; asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); if (sc->var->funcname) { update_offset(sc->var->funcname, locals); Obj *ov = find_obj_by_tok(locals, tok); if (ov && ov->offset) sc->var->offset = ov->offset; asmExt->output[nbOutput]->offset = (ov && ov->offset) ? ov->offset : sc->var->offset; } else { asmExt->output[nbOutput]->offset = sc->var->offset; } int base_off = asmExt->output[nbOutput]->offset; //managing specific case of arrays Token *bracket = tok->next; while (equal(bracket, ")")) bracket = bracket->next; if (sc->var->ty->kind == TY_ARRAY && equal(bracket, "[")) { SET_CTX(ctx); tok = skip(bracket, "[", ctx); asmExt->output[nbOutput]->isArray = true; asmExt->output[nbOutput]->isAddress = false; asmExt->output[nbOutput]->indexArray = tok->val; asmExt->output[nbOutput]->size = sc->var->ty->base->size; if (!asmExt->output[nbOutput]->reg) error("%s:%d: error: in output_asm function :reg is null!", __FILE__, __LINE__); if (asmExt->output[nbOutput]->letter != 'm') asmExt->output[nbOutput]->reg = update_register_size(asmExt->output[nbOutput]->reg, asmExt->output[nbOutput]->size); //calculate the offset for each element from the bottom to the top r[0] has the lowest offset example -48, r[1] - 44, r[2] -40, r[3] - 36 asmExt->output[nbOutput]->offset = (sc->var->offset ) + (asmExt->output[nbOutput]->indexArray * asmExt->output[nbOutput]->size); asmExt->output[nbOutput]->offsetArray = base_off; if (asmExt->output[nbOutput]->letter == 'm') asmExt->output[nbOutput]->reg = load_variable(asmExt->output[nbOutput]->offset); tok = tok->next; SET_CTX(ctx); tok = skip(tok, "]", ctx); SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } //special case of array pointer it means that the parameter received is an address. Token *bracket_ptr = tok->next; while (equal(bracket_ptr, ")")) bracket_ptr = bracket_ptr->next; if (sc->var->ty->kind == TY_PTR && equal(bracket_ptr, "[")) { SET_CTX(ctx); tok = skip(bracket_ptr, "[", ctx); asmExt->output[nbOutput]->isArray = true; asmExt->output[nbOutput]->isAddress = true; asmExt->output[nbOutput]->indexArray = tok->val; asmExt->output[nbOutput]->size = sc->var->ty->base->size; if (!asmExt->output[nbOutput]->reg) error_tok(tok, "%s:%d: in output_asm function : reg is null extended assembly not managed yet", __FILE__, __LINE__); ensure_output_reg(asmExt->output[nbOutput], "%r11"); asmExt->output[nbOutput]->reg = update_register_size(asmExt->output[nbOutput]->reg, asmExt->output[nbOutput]->size); //calculate the offset for each element from the bottom to the top r[0] has the lowest offset example -48, r[1] - 44, r[2] -40, r[3] - 36 asmExt->output[nbOutput]->offset = (asmExt->output[nbOutput]->indexArray * asmExt->output[nbOutput]->size); asmExt->output[nbOutput]->offsetArray = base_off; tok = tok->next; SET_CTX(ctx); tok = skip(tok, "]", ctx); SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } //Trying to fix ISS-164 special case of ptr->value form (ptr to a struct) Token *arrow = tok->next; while (equal(arrow, ")")) arrow = arrow->next; if (sc->var->ty->kind == TY_PTR && equal(arrow, "->")) { if (!sc->var->ty->base) error_tok(tok, "%s:%d: in output_asm function : expecting struct base but base is null!", __FILE__, __LINE__); asmExt->output[nbOutput]->output = tok; SET_CTX(ctx); tok = skip(arrow, "->", ctx); Token * tokmbr = tok; // retrieve the size of the variable to determine the register to use here we use RAX variation asmExt->output[nbOutput]->isAddress = true; asmExt->output[nbOutput]->isStruct = true; asmExt->output[nbOutput]->size = sc->var->ty->size; if (!asmExt->output[nbOutput]->reg) error_tok(tok, "%s:%d: in output_asm function : reg is null extended assembly not managed yet", __FILE__, __LINE__); ensure_output_reg(asmExt->output[nbOutput], "%r11"); asmExt->output[nbOutput]->reg = update_register_size(asmExt->output[nbOutput]->reg, asmExt->output[nbOutput]->size); asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); if (!sc->var->ty->base->members) error_tok(tok, "%s:%d: in output_asm function : expecting members but members is null", __FILE__, __LINE__); if (sc->var->funcname) { update_offset(sc->var->funcname, locals); asmExt->output[nbOutput]->offset = sc->var->offset; asmExt->output[nbOutput]->offsetStruct = sc->var->ty->base->members->offset ; } else { asmExt->output[nbOutput]->offset = 0; } //need to update the specific struct field offset char *toktmp = calloc(1, sizeof(char) * 300); for (Member *mbr = sc->var->ty->base->members; mbr; mbr = mbr->next) { if (mbr->name->len > 59) error_tok(tok, "%s:%d %d: in output_asm function : not enough size for toktmp", __FILE__, __LINE__, mbr->name->len); strncat(toktmp, mbr->name->loc, mbr->name->len); if (equal(tokmbr, toktmp)) { asmExt->output[nbOutput]->offsetStruct = mbr->offset ; asmExt->output[nbOutput]->size = mbr->ty->size ; if (!asmExt->output[nbOutput]->reg) error_tok(tok, "%s:%d: in output_asm function : reg is null extended assembly not managed yet", __FILE__, __LINE__); asmExt->output[nbOutput]->reg = update_register_size(asmExt->output[nbOutput]->reg, asmExt->output[nbOutput]->size); } } tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } if (asmExt->output[nbOutput]->letter == 'm') asmExt->output[nbOutput]->reg = load_variable(asmExt->output[nbOutput]->offset); else asmExt->output[nbOutput]->reg = update_register_size(asmExt->output[nbOutput]->reg, asmExt->output[nbOutput]->size); // skip the variable to go to next token that should be a ")" // tok = tok->next; tok = tok->next; if (!equal(tok, ")")) error_tok(tok, "%s:%d: in output_asm function : extended assembly not managed yet", __FILE__, __LINE__); SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } // pointer else if (equal(tok, "*")) { consume(&tok, tok, "*"); if (tok->kind == TK_IDENT) { asmExt->output[nbOutput]->isAddress = true; ensure_output_reg(asmExt->output[nbOutput], "%r11"); asmExt->output[nbOutput]->output = tok; sc = find_var(tok); if (!sc) error_tok(tok, "%s:%d: in output_asm function : variable undefined2", __FILE__, __LINE__); if (!sc->var->ty) error_tok(tok, "%s:%d: in output_asm function : variable type unknown2", __FILE__, __LINE__); // retrieve the size of the variable to determine the register to use here we use RAX variation // skip the variable to go to next token that should be a ")" asmExt->output[nbOutput]->size = sc->var->ty->pointertype->size; if (sc->var->funcname) { update_offset(sc->var->funcname, locals); asmExt->output[nbOutput]->offset = sc->var->offset; } else { asmExt->output[nbOutput]->offset = 0; } if (!asmExt->output[nbOutput]->reg) error_tok(tok, "%s:%d: in output_asm function : reg is null extended assembly not managed yet", __FILE__, __LINE__); asmExt->output[nbOutput]->reg = update_register_size(asmExt->output[nbOutput]->reg, asmExt->output[nbOutput]->size); asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } else if (equal(tok, "(") && equal(tok->next, "(")) { // Skip '((' tok = tok->next->next; if (!equal(tok, "void")) error_tok(tok, "%s:%d: in output_asm function : expected cast to (void **)", __FILE__, __LINE__); tok = tok->next; int pointer_depth = 0; while (equal(tok, "*")) { pointer_depth++; tok = tok->next; } if (!equal(tok, ")")) error_tok(tok, "%s:%d: in output_asm function : expected ')' after cast type", __FILE__, __LINE__); tok = tok->next; if (tok->kind != TK_IDENT) error_tok(tok, "%s:%d: in output_asm function : expected identifier after cast", __FILE__, __LINE__); // At this point: we are at the identifier (like 'ofs') asmExt->output[nbOutput]->isAddress = true; asmExt->output[nbOutput]->output = tok; VarScope *sc = find_var(tok); if (!sc) error_tok(tok, "%s:%d: in output_asm function : variable undefined after cast", __FILE__, __LINE__); if (!sc->var->ty) error_tok(tok, "%s:%d: in output_asm function : variable type unknown after cast", __FILE__, __LINE__); asmExt->output[nbOutput]->size = sc->var->ty->size; if (sc->var->funcname) { update_offset(sc->var->funcname, locals); asmExt->output[nbOutput]->offset = sc->var->offset; } else { asmExt->output[nbOutput]->offset = 0; } ensure_output_reg(asmExt->output[nbOutput], "%r11"); asmExt->output[nbOutput]->reg = update_register_size(asmExt->output[nbOutput]->reg, asmExt->output[nbOutput]->size); asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); tok = tok->next; if (!equal(tok, ")")) error_tok(tok, "%s:%d: in output_asm function : expected ')' after cast type", __FILE__, __LINE__); tok = tok->next; //first parenthesis SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } else { error_tok(tok, "%s:%d: in output_asm function : extended assembly not managed yet", __FILE__, __LINE__); } } } tok = tok->next; *rest = tok; } return; } void input_asm(Node *node, Token **rest, Token *tok, Obj *locals) { VarScope *sc; char *input_value = calloc(1, sizeof(char) * 300); asmExt->input[nbInput]->offset = 0; while (!equal(tok->next, ":") && !equal(tok->next, ";")) { //case of operand named if (equal(tok, "[") || equal(tok, "{")) { char closing = equal(tok, "[") ? ']' : '}'; tok = tok->next; // case of operand named [dst] or {src} if (tok->kind == TK_IDENT) { char *name = calloc(tok->len + 1, 1); memcpy(name, tok->loc, tok->len); name[tok->len] = '\0'; asmExt->input[nbInput]->operand_name = name; asmExt->input[nbInput]->index = nbInput; hasOperandName = true; tok = tok->next; // Now consume the closing ] or } if (!equal(tok, (char[]){closing, 0})) { error_tok(tok, "%s:%d: error: in input_asm function : expected closing %c after operand name", __FILE__, __LINE__, closing); } tok = tok->next; } } // register in write only mode if (tok->kind == TK_STR && (!strncmp(tok->str, "0", tok->len) || !strncmp(tok->str, "%0", tok->len) )) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(0); asmExt->input[nbInput]->index = 0; asmExt->input[nbInput]->reg = asmExt->output[0]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[0]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } else if (tok->kind == TK_STR && (!strncmp(tok->str, "1", tok->len) || !strncmp(tok->str, "%1", tok->len))) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(1); asmExt->input[nbInput]->index = 1; asmExt->input[nbInput]->reg = asmExt->output[1]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[1]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } else if (tok->kind == TK_STR && (!strncmp(tok->str, "2", tok->len) || !strncmp(tok->str, "%2", tok->len))) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(2); asmExt->input[nbInput]->index = 2; asmExt->input[nbInput]->reg = asmExt->output[2]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[2]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } else if (tok->kind == TK_STR && (!strncmp(tok->str, "3", tok->len) || !strncmp(tok->str, "%3", tok->len))) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(3); asmExt->input[nbInput]->index = 3; asmExt->input[nbInput]->reg = asmExt->output[3]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[3]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } else if (tok->kind == TK_STR && (tok->len == 1 && tok->str[0] >= '4' && tok->str[0] <= '9')) { int digit = tok->str[0] - '0'; asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(digit); asmExt->input[nbInput]->index = digit; asmExt->input[nbInput]->reg = asmExt->output[digit]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[digit]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } else if (tok->kind == TK_STR && !strncmp(tok->str, "a", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->letter = 'a'; //=====ISS-156 case we have no output for the letter if (retrieve_output_index_from_letter('a') == -1) { asmExt->input[nbInput]->reg = use_fixed_register("%rax"); if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); } else { asmExt->input[nbInput]->reg = asmExt->output[retrieve_output_index_from_letter('a')]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[retrieve_output_index_from_letter('a')]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } } else if (tok->kind == TK_STR && !strncmp(tok->str, "b", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->letter = 'b'; //=====ISS-156 case we have no output for the letter if (retrieve_output_index_from_letter('b') == -1) { asmExt->input[nbInput]->reg = use_fixed_register("%rbx"); if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); } else { asmExt->input[nbInput]->reg = asmExt->output[retrieve_output_index_from_letter('b')]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[retrieve_output_index_from_letter('b')]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } } else if (tok->kind == TK_STR && !strncmp(tok->str, "c", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->letter = 'c'; //=====ISS-156 case we have no output for the letter if (retrieve_output_index_from_letter('c') == -1) { asmExt->input[nbInput]->reg = use_fixed_register("%rcx"); if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); } else { asmExt->input[nbInput]->reg = asmExt->output[retrieve_output_index_from_letter('c')]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[retrieve_output_index_from_letter('c')]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } } else if (tok->kind == TK_STR && !strncmp(tok->str, "d", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->letter = 'd'; //=====ISS-156 case we have no output for the letter if (retrieve_output_index_from_letter('d') == -1) { asmExt->input[nbInput]->reg = use_fixed_register("%rdx"); if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); } else { asmExt->input[nbInput]->reg = asmExt->output[retrieve_output_index_from_letter('d')]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[retrieve_output_index_from_letter('d')]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } } else if (tok->kind == TK_STR && !strncmp(tok->str, "g", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->letter = 'g'; //=====ISS-156 case we have no output for the letter if (retrieve_output_index_from_letter('g') == -1) { asmExt->input[nbInput]->reg = register_available(); if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); } else { asmExt->input[nbInput]->reg = asmExt->output[retrieve_output_index_from_letter('g')]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[retrieve_output_index_from_letter('g')]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } } else if (tok->kind == TK_STR && !strncmp(tok->str, "Nd", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->letter = 'N'; //=====ISS-156 case we have no output for the letter if (retrieve_output_index_from_letter('N') == -1) { asmExt->input[nbInput]->reg = use_fixed_register("%rdx"); if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); } else { asmExt->input[nbInput]->reg = asmExt->output[retrieve_output_index_from_letter('N')]->reg; if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->output[retrieve_output_index_from_letter('N')]->reg64; } asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } else if (tok->kind == TK_STR && (!strncmp(tok->str, "I", tok->len) || !strncmp(tok->str, "i", tok->len) || !strncmp(tok->str, "n", tok->len) || !strncmp(tok->str, "J", tok->len) || !strncmp(tok->str, "K", tok->len))) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->letter = tok->str[0]; // Treat as immediate/general register if no output matches if (retrieve_output_index_from_letter(tok->str[0]) == -1) { asmExt->input[nbInput]->reg = specific_register_available("%rax"); if (!asmExt->input[nbInput]->reg) error("%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); } else { int out_idx = retrieve_output_index_from_letter(tok->str[0]); asmExt->input[nbInput]->reg = asmExt->output[out_idx]->reg; asmExt->input[nbInput]->reg64 = asmExt->output[out_idx]->reg64; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); } } else if (tok->kind == TK_STR && (!strncmp(tok->str, "m", tok->len) || !strncmp(tok->str, "rm", tok->len))) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; // Pure memory input: don't reserve a scratch register unless we later // discover the operand needs an address in a register (e.g. *ptr). asmExt->input[nbInput]->reg = "%mem"; asmExt->input[nbInput]->reg64 = "%mem"; asmExt->input[nbInput]->letter = 'm'; } else if (tok->kind == TK_STR && !strncmp(tok->str, "q", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->reg = specific_register_available("%r10"); asmExt->input[nbInput]->isq = true; if (!asmExt->input[nbInput]->reg) error_tok(tok, "%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->letter = 'q'; } else if (tok->kind == TK_STR && !strncmp(tok->str, "Q", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->reg = specific_register_available("%rax"); asmExt->input[nbInput]->isq = true; if (!asmExt->input[nbInput]->reg) error_tok(tok, "%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->letter = 'Q'; } else if (tok->kind == TK_STR && !strncmp(tok->str, "l", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->reg = specific_register_available("%r10"); asmExt->input[nbInput]->isl = true; if (!asmExt->input[nbInput]->reg) error_tok(tok, "%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->letter = 'l'; } else if ((tok->kind == TK_STR && !strncmp(tok->str, "r", tok->len)) || (tok->kind == TK_STR && !strncmp(tok->str, "rn", tok->len)) ) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->reg = specific_register_available("%r10"); if (!asmExt->input[nbInput]->reg) error_tok(tok,"%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->letter = 'r'; if (hasOperandName) { asmExt->input[nbInput]->size = 8; asmExt->input[nbInput]->is_pure_register = true; } } //D for destination operand else if (tok->kind == TK_STR && !strncmp(tok->str, "D", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->reg = specific_register_available("%rdx"); if (!asmExt->input[nbInput]->reg) error_tok(tok,"%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->letter = 'D'; } //S for source operand else if (tok->kind == TK_STR && !strncmp(tok->str, "S", tok->len)) { asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbOutput + nbInput); asmExt->input[nbInput]->index = nbOutput + nbInput; asmExt->input[nbInput]->reg = specific_register_available("%r11"); if (!asmExt->input[nbInput]->reg) error_tok(tok, "%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg64 = asmExt->input[nbInput]->reg; asmExt->input[nbInput]->regh = register_higher(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regl = register_lower(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->regw = register_word(asmExt->input[nbInput]->reg64); asmExt->input[nbInput]->letter = 'S'; } else if (equal(tok, "(")) { SET_CTX(ctx); while (equal(tok, "(")) tok = tok->next; if (parse_simple_binary_input(rest, tok, locals)) return; // check if the variable is defined if (equal(tok, "-")) { isToNegate = true; consume(&tok, tok, "-"); } if (tok->kind == TK_IDENT) { if (isToNegate) { asmExt->input[nbInput]->isToNegate = isToNegate; isToNegate = false; } sc = find_var(tok); if (!sc) error_tok(tok, "%s:%d: in input_asm function : variable undefined", __FILE__, __LINE__); if (!sc->var->ty) error_tok(tok, "%s:%d: in input_asm function : variable type unknown", __FILE__, __LINE__); asmExt->input[nbInput]->input = tok; asmExt->input[nbInput]->isVariable = true; asmExt->input[nbInput]->size = sc->var->ty->size; if (sc->var->funcname) { update_offset(sc->var->funcname, locals); Obj *iv = find_obj_by_tok(locals, tok); if (iv && iv->offset) sc->var->offset = iv->offset; asmExt->input[nbInput]->offset = (iv && iv->offset) ? iv->offset : sc->var->offset; } else { asmExt->input[nbInput]->offset = sc->var->offset; } int base_off = asmExt->input[nbInput]->offset; if (!asmExt->input[nbInput]->reg) { error_tok(tok, "%s:%d: error: in input_asm function input_asm :reg is null! %d", __FILE__, __LINE__, nbInput); } //managing specific case of arrays Token *bracket = tok->next; while (equal(bracket, ")")) bracket = bracket->next; if (sc->var->ty->kind == TY_ARRAY && equal(bracket, "[")) { SET_CTX(ctx); tok = skip(bracket, "[", ctx); asmExt->input[nbInput]->isArray = true; asmExt->input[nbInput]->indexArray = tok->val; asmExt->input[nbInput]->isAddress = false; asmExt->input[nbInput]->size = sc->var->ty->base->size; if (!asmExt->input[nbInput]->reg) error_tok(tok, "%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); if (asmExt->input[nbInput]->letter != 'm') asmExt->input[nbInput]->reg = update_register_size(asmExt->input[nbInput]->reg, asmExt->input[nbInput]->size); //calculate the offset for each element from the bottom to the top r[0] has the lowest offset example -48, r[1] - 44, r[2] -40, r[3] - 36 asmExt->input[nbInput]->offset = (sc->var->offset ) + (asmExt->input[nbInput]->indexArray * asmExt->input[nbInput]->size); asmExt->input[nbInput]->offsetArray = base_off; if (asmExt->input[nbInput]->letter == 'm') asmExt->input[nbInput]->reg = load_variable(asmExt->input[nbInput]->offset); tok = tok->next; SET_CTX(ctx); tok = skip(tok, "]", ctx); SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } else if ((sc->var->ty->kind == TY_PTR || sc->var->ty->kind == TY_ARRAY) && ({ Token *p = tok->next; while(equal(p, ")")) p = p->next; equal(p, "["); })) { Token *bracket_ptr = tok->next; while (equal(bracket_ptr, ")")) bracket_ptr = bracket_ptr->next; SET_CTX(ctx); tok = skip(bracket_ptr, "[", ctx); asmExt->input[nbInput]->isArray = true; asmExt->input[nbInput]->isAddress = true; asmExt->input[nbInput]->indexArray = tok->val; asmExt->input[nbInput]->size = sc->var->ty->base->size; if (!asmExt->input[nbInput]->reg) error_tok(tok, "%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); ensure_input_reg(asmExt->input[nbInput], "%r11"); asmExt->input[nbInput]->reg = update_register_size(asmExt->input[nbInput]->reg, asmExt->input[nbInput]->size); //calculate the offset for each element from the bottom to the top r[0] has the lowest offset example -48, r[1] - 44, r[2] -40, r[3] - 36 asmExt->input[nbInput]->offset = (asmExt->input[nbInput]->indexArray * asmExt->input[nbInput]->size); asmExt->input[nbInput]->offsetArray = base_off; tok = tok->next; SET_CTX(ctx); tok = skip(tok, "]", ctx); SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } //Trying to fix ISS-164 special case of ptr->value form (ptr to a struct) else if (sc->var->ty->kind == TY_PTR && ({ Token *p = tok->next; while(equal(p, ")")) p = p->next; (equal(p, "->") || equal(p, ".")); })) { Token *arrow = tok->next; while (equal(arrow, ")")) arrow = arrow->next; if (!sc->var->ty->base) error_tok(tok, "%s:%d: in input_asm function : expecting struct base but base is null!", __FILE__, __LINE__); asmExt->input[nbInput]->input = tok; SET_CTX(ctx); tok = skip(arrow, (char *)(equal(arrow, "->") ? "->" : "."), ctx); Token * tokmbr = tok; // retrieve the size of the variable to determine the register to use here we use RAX variation asmExt->input[nbInput]->isAddress = true; asmExt->input[nbInput]->isStruct = true; asmExt->input[nbInput]->size = sc->var->ty->size; if (!asmExt->input[nbInput]->reg) error_tok(tok, "%s:%d: in input_asm function : reg is null extended assembly not managed yet", __FILE__, __LINE__); ensure_input_reg(asmExt->input[nbInput], "%r11"); asmExt->input[nbInput]->reg = update_register_size(asmExt->input[nbInput]->reg, asmExt->input[nbInput]->size); //asmExt->input[nbInput]->variableNumber = retrieveVariableNumber(nbInput); if (!sc->var->ty->base->members) error_tok(tok, "%s:%d: in input_asm function : expecting members but members is null", __FILE__, __LINE__); if (sc->var->funcname) { update_offset(sc->var->funcname, locals); asmExt->input[nbInput]->offset = sc->var->offset; } else { asmExt->input[nbInput]->offset = 0; } //need to update the specific struct field offset char *toktmp = calloc(1, sizeof(char) * 300); for (Member *mbr = sc->var->ty->base->members; mbr; mbr = mbr->next) { if (mbr->name->len > 59) error_tok(tok, "%s:%d %d: in input_asm function : not enough size for toktmp", __FILE__, __LINE__, mbr->name->len); strncat(toktmp, mbr->name->loc, mbr->name->len); if (equal(tokmbr, toktmp)) { asmExt->input[nbInput]->offsetStruct = mbr->offset ; asmExt->input[nbInput]->size = mbr->ty->size ; if (!asmExt->input[nbInput]->reg) error_tok(tok, "%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg = update_register_size(asmExt->input[nbInput]->reg, asmExt->input[nbInput]->size); } } tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } if (asmExt->input[nbInput]->letter == 'm' && !asmExt->input[nbInput]->isAddress) { asmExt->input[nbInput]->reg = load_variable(asmExt->input[nbInput]->offset); } else { ensure_input_reg(asmExt->input[nbInput], "%r11"); asmExt->input[nbInput]->reg = update_register_size(asmExt->input[nbInput]->reg, asmExt->input[nbInput]->size); } if (isDebug) printf("input_asm: TK_IDENT name=%.*s size=%d reg=%s\n", tok->len, tok->loc, asmExt->input[nbInput]->size, asmExt->input[nbInput]->reg); tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } // immediate value else if (tok->kind == TK_NUM) { int length = snprintf(NULL, 0, "%ld", tok->val); if (tok->val == 0) strncat(input_value, "0 ", 3); else snprintf(input_value, length + 1, "%ld", tok->val); asmExt->input[nbInput]->input = tok; asmExt->input[nbInput]->isVariable = false; asmExt->input[nbInput]->isAddress = false; asmExt->input[nbInput]->input_value = input_value; asmExt->input[nbInput]->size = 8; if (isDebug) printf("input_asm: TK_NUM val=%ld size=%d\n", tok->val, asmExt->input[nbInput]->size); asmExt->input[nbInput]->reg = update_register_size(asmExt->input[nbInput]->reg, asmExt->input[nbInput]->size); tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } // pointer else if (equal(tok, "*")) { consume(&tok, tok, "*"); if (tok->kind == TK_IDENT) { asmExt->input[nbInput]->input = tok; sc = find_var(tok); if (!sc) error_tok(tok, "%s:%d: in input_asm function : variable undefined2", __FILE__, __LINE__); asmExt->input[nbInput]->input = tok; asmExt->input[nbInput]->isVariable = true; asmExt->input[nbInput]->isAddress = true; asmExt->input[nbInput]->size = sc->var->ty->size; ensure_input_reg(asmExt->input[nbInput], "%r11"); if (sc->var->funcname) { update_offset(sc->var->funcname, locals); asmExt->input[nbInput]->offset = sc->var->offset; } if (!asmExt->input[nbInput]->reg) error_tok(tok,"%s:%d: error: in input_asm function input_asm :reg is null!", __FILE__, __LINE__); asmExt->input[nbInput]->reg = update_register_size(asmExt->input[nbInput]->reg, asmExt->input[nbInput]->size); tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; // Handle casted input like *((void **)ptr) } else if (equal(tok, "(") && equal(tok->next, "(")) { // Skip '((' tok = tok->next->next; // Parse cast type — here just support 'void **' for now if (!equal(tok, "void")) error_tok(tok, "%s:%d: error: in input_asm function input_asm : expected cast to (void **)!", __FILE__, __LINE__); tok = tok->next; int pointer_depth = 0; while (equal(tok, "*")) { pointer_depth++; tok = tok->next; } if (!equal(tok, ")")) error_tok(tok, "expected ')' after cast type"); tok = tok->next; // skip first ')' // Now expect TK_IDENT if (tok->kind != TK_IDENT) error_tok(tok, "expected identifier after cast"); asmExt->input[nbInput]->input = tok; asmExt->input[nbInput]->isVariable = true; asmExt->input[nbInput]->isAddress = true; sc = find_var(tok); if (!sc) error_tok(tok, "%s:%d: variable undefined in input_asm", __FILE__, __LINE__); if (!sc->var->ty) error_tok(tok, "%s:%d: variable type undefined in input_asm", __FILE__, __LINE__); asmExt->input[nbInput]->size = sc->var->ty->size; if (sc->var->funcname) { update_offset(sc->var->funcname, locals); asmExt->input[nbInput]->offset = sc->var->offset; } ensure_input_reg(asmExt->input[nbInput], "%r11"); asmExt->input[nbInput]->reg = update_register_size(asmExt->input[nbInput]->reg, asmExt->input[nbInput]->size); tok = tok->next; if (!equal(tok, ")")) error_tok(tok, "%s:%d: input_asm: expected ')' after cast", __FILE__, __LINE__); tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } } else if (equal(tok, "&")) { consume(&tok, tok, "&"); if (tok->kind == TK_IDENT) { asmExt->input[nbInput]->input = tok; sc = find_var(tok); if (!sc) error_tok(tok, "variable undefined in input_asm"); asmExt->input[nbInput]->input = tok; asmExt->input[nbInput]->isVariable = true; asmExt->input[nbInput]->isLea = true; asmExt->input[nbInput]->size = 8; if (sc->var->funcname) { update_offset(sc->var->funcname, locals); asmExt->input[nbInput]->offset = sc->var->offset; } if (!asmExt->input[nbInput]->reg) error_tok(tok, "reg is null in input_asm"); asmExt->input[nbInput]->reg = update_register_size(asmExt->input[nbInput]->reg, 8); tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } } else if (equal(tok, "&")) { consume(&tok, tok, "&"); if (tok->kind == TK_IDENT) { asmExt->output[nbOutput]->output = tok; sc = find_var(tok); if (!sc) error_tok(tok, "%s:%d: in output_asm function : variable undefined", __FILE__, __LINE__); if (!sc->var->ty) error_tok(tok, "%s:%d: in output_asm function : variable type unknown", __FILE__, __LINE__); asmExt->output[nbOutput]->size = sc->var->ty->size; if (sc->var->funcname) { update_offset(sc->var->funcname, locals); asmExt->output[nbOutput]->offset = sc->var->offset; } else { asmExt->output[nbOutput]->offset = 0; } asmExt->output[nbOutput]->isVariable = true; if (!asmExt->output[nbOutput]->reg) error_tok(tok, "%s:%d: in output_asm function : reg is null", __FILE__, __LINE__); asmExt->output[nbOutput]->reg = update_register_size(asmExt->output[nbOutput]->reg, asmExt->output[nbOutput]->size); asmExt->output[nbOutput]->variableNumber = retrieveVariableNumber(nbOutput); tok = tok->next; SET_CTX(ctx); while (equal(tok, ")")) tok = tok->next; *rest = tok; return; } } } else if (equal(tok, ",")) { SET_CTX(ctx); tok = skip(tok, ",", ctx); continue; } else { error_tok(tok, "%s:%d : in input_asm function : input complex constraint not managed yet! %.*s", __FILE__, __LINE__, tok->len, tok->loc); } tok = tok->next; *rest = tok; } return; } // do the susbtitution into the template char *subst_asm(char *template, char *output_str, char *input_str) { return string_replace(template, input_str, output_str); } // generic string replace function char *string_replace(char *str, char *oldstr, char *newstr) { size_t cap = 10000; char bstr[10000]; memset(bstr, 0, sizeof(bstr)); int i; for (i = 0; i < strlen(str); i++) { if (!strncmp(str + i, oldstr, strlen(oldstr))) { strcat(bstr, newstr); i += strlen(oldstr) - 1; } else { strncat(bstr, str + i, 1); } if (strlen(bstr) + 2 >= cap) error("%s:%d: error: in string_replace : not enough memory!", __FILE__, __LINE__); } strncpy(str, bstr, strlen(bstr) + 1); if (strlen(str)> 10000) error("%s:%d: error: in string_replace : not enough memory!", __FILE__, __LINE__); return str; } // generate input assembly instruction char *generate_input_asm(char *input_str) { char *tmp = calloc(1, sizeof(char) * 200); // For pure memory operands, substitute %N with the memory address and don't emit loads. if (asmExt->input[nbInput]->letter == 'm' && asmExt->input[nbInput]->isVariable && !asmExt->input[nbInput]->isAddress && !asmExt->input[nbInput]->isBinaryExpr) return tmp; if (asmExt->input[nbInput]->isBinaryExpr) { char imm_buf[32]; strncat(tmp, "\n", 3); strncat(tmp, opcode(asmExt->input[nbInput]->size), strlen(opcode(asmExt->input[nbInput]->size))); if (asmExt->input[nbInput]->bin_lhs_is_imm) { snprintf(imm_buf, sizeof(imm_buf), "%ld", asmExt->input[nbInput]->bin_lhs_imm); strncat(tmp, " $", 3); strncat(tmp, imm_buf, strlen(imm_buf)); } else { strncat(tmp, load_variable(asmExt->input[nbInput]->bin_lhs_offset), strlen(load_variable(asmExt->input[nbInput]->bin_lhs_offset))); } strncat(tmp, ", ", 3); strncat(tmp, asmExt->input[nbInput]->variableNumber, strlen(asmExt->input[nbInput]->variableNumber)); strncat(tmp, ";\n", 3); strncat(tmp, arith_opcode(asmExt->input[nbInput]->bin_op, asmExt->input[nbInput]->size), strlen(arith_opcode(asmExt->input[nbInput]->bin_op, asmExt->input[nbInput]->size))); if (asmExt->input[nbInput]->bin_rhs_is_imm) { snprintf(imm_buf, sizeof(imm_buf), "%ld", asmExt->input[nbInput]->bin_rhs_imm); strncat(tmp, " $", 3); strncat(tmp, imm_buf, strlen(imm_buf)); } else { strncat(tmp, load_variable(asmExt->input[nbInput]->bin_rhs_offset), strlen(load_variable(asmExt->input[nbInput]->bin_rhs_offset))); } strncat(tmp, ", ", 3); strncat(tmp, asmExt->input[nbInput]->variableNumber, strlen(asmExt->input[nbInput]->variableNumber)); strncat(tmp, ";\n", 3); return tmp; } //case variable if (asmExt->input[nbInput]->isVariable && asmExt->input[nbInput]->isToNegate) { strncat(tmp, "\n", 3); strncat(tmp, opcode(asmExt->input[nbInput]->size), strlen(opcode(asmExt->input[nbInput]->size))); strncat(tmp, load_variable(asmExt->input[nbInput]->offset), strlen(load_variable(asmExt->input[nbInput]->offset))); strncat(tmp, ", ", 3); strncat(tmp, asmExt->input[nbInput]->variableNumber, strlen(asmExt->input[nbInput]->variableNumber)); strncat(tmp, ";\n", 3); strncat(tmp, " neg ", 7); strncat(tmp, asmExt->input[nbInput]->variableNumber, strlen(asmExt->input[nbInput]->variableNumber)); strncat(tmp, ";\n", 3); return tmp; } else if (asmExt->input[nbInput]->isVariable && asmExt->input[nbInput]->isLea) { strncat(tmp, "\n leaq ", 10); strncat(tmp, load_variable(asmExt->input[nbInput]->offset), strlen(load_variable(asmExt->input[nbInput]->offset))); strncat(tmp, ", ", 3); strncat(tmp, asmExt->input[nbInput]->variableNumber, strlen(asmExt->input[nbInput]->variableNumber)); strncat(tmp, ";\n", 3); return tmp; } else if (asmExt->input[nbInput]->isVariable && !asmExt->input[nbInput]->isAddress) { strncat(tmp, "\n", 3); strncat(tmp, opcode(asmExt->input[nbInput]->size), strlen(opcode(asmExt->input[nbInput]->size))); strncat(tmp, load_variable(asmExt->input[nbInput]->offset), strlen(load_variable(asmExt->input[nbInput]->offset))); strncat(tmp, ", ", 3); strncat(tmp, asmExt->input[nbInput]->variableNumber, strlen(asmExt->input[nbInput]->variableNumber)); strncat(tmp, ";\n", 3); return tmp; } else if (asmExt->input[nbInput]->isAddress) { strncat(tmp, "\n", 3); strncat(tmp, opcode(8), strlen(opcode(8))); int off = (asmExt->input[nbInput]->isArray) ? asmExt->input[nbInput]->offsetArray : asmExt->input[nbInput]->offset; strncat(tmp, load_variable(off), strlen(load_variable(off))); strncat(tmp, ", ", 3); strncat(tmp, asmExt->input[nbInput]->variableNumber, strlen(asmExt->input[nbInput]->variableNumber)); strncat(tmp, ";\n", 3); int member_off = 0; if (asmExt->input[nbInput]->isArray) member_off = asmExt->input[nbInput]->offset; else if (asmExt->input[nbInput]->isStruct) member_off = asmExt->input[nbInput]->offsetStruct; if (member_off != 0) { char off_str[16]; snprintf(off_str, sizeof(off_str), "%d", member_off); strncat(tmp, " addq $", 11); strncat(tmp, off_str, strlen(off_str)); strncat(tmp, ", ", 3); strncat(tmp, asmExt->input[nbInput]->variableNumber, strlen(asmExt->input[nbInput]->variableNumber)); strncat(tmp, ";\n", 3); } if (asmExt->input[nbInput]->letter != 'm') { strncat(tmp, opcode(8), 8); strncat(tmp, "(", 2); strncat(tmp, asmExt->input[nbInput]->reg64, strlen(asmExt->input[nbInput]->reg64)); strncat(tmp, ")", 2); strncat(tmp, ", ", 3); strncat(tmp, asmExt->input[nbInput]->reg64, strlen(asmExt->input[nbInput]->reg64)); strncat(tmp, "\n", 3); } return tmp; } //case immediate value else if (asmExt->input[nbInput]->input_value) { strncat(tmp, "\n", 3); strncat(tmp, opcode(asmExt->input[nbInput]->size), strlen(opcode(asmExt->input[nbInput]->size))); strncat(tmp, " $", 3); strncat(tmp, asmExt->input[nbInput]->input_value, strlen(asmExt->input[nbInput]->input_value)); strncat(tmp, ", ", 3); strncat(tmp, asmExt->input[nbInput]->variableNumber, strlen(asmExt->input[nbInput]->variableNumber)); strncat(tmp, ";\n", 3); return tmp; } error("%s:%d: error: in extended_asm function generate_input_asm : unexpected error! %s", __FILE__, __LINE__, asmExt->template->templatestr); //return NULL; } // check if template contains % bool check_template(char *template) { return strchr(template, '%') != NULL; } // generate input assembly instruction char *generate_output_asm(char *output_str) { char *tmp = calloc(1, sizeof(char) * 300); // Memory outputs are written by the asm itself (read-modify-write included). // Don't emit a "store back" sequence; it can corrupt memory for ptr-based // operands like "+m"(rp[0]) used by OpenSSL. if (asmExt->output[nbOutput]->letter == 'm') return tmp; // For pure memory outputs, the asm writes directly to the lvalue. if (asmExt->output[nbOutput]->letter == 'm' && asmExt->output[nbOutput]->isVariable && !asmExt->output[nbOutput]->isAddress && !asmExt->output[nbOutput]->isArray && !asmExt->output[nbOutput]->isStruct) return tmp; //case variable and not an address if (asmExt->output[nbOutput]->isVariable && !asmExt->output[nbOutput]->isAddress) { strncat(tmp, "\n", 3); strncat(tmp, opcode(asmExt->output[nbOutput]->size), strlen(opcode(asmExt->output[nbOutput]->size))); strncat(tmp, asmExt->output[nbOutput]->variableNumber, strlen(asmExt->output[nbOutput]->variableNumber)); strncat(tmp, ", ", 3); strncat(tmp, load_variable(asmExt->output[nbOutput]->offset), strlen(load_variable(asmExt->output[nbOutput]->offset))); strncat(tmp, ";\n", 3); return tmp; } //case not an address it means that it's an immediate value should probably never exists else if (!asmExt->output[nbOutput]->isAddress) { strncat(tmp, opcode(asmExt->output[nbOutput]->size), strlen(opcode(asmExt->output[nbOutput]->size))); strncat(tmp, " $", 3); strncat(tmp, asmExt->input[nbInput]->input_value, strlen(asmExt->input[nbInput]->input_value)); strncat(tmp, ", ", 3); strncat(tmp, asmExt->input[nbInput]->variableNumber, strlen(asmExt->input[nbInput]->variableNumber)); strncat(tmp, ";\n", 3); return tmp; } //case it's an array with address we need to generate the correct output for the specified index else if (asmExt->output[nbOutput]->isAddress && asmExt->output[nbOutput]->isArray) { strncat(tmp, "\n", 3); strncat(tmp, " movq ", 8); strncat(tmp, load_variable(asmExt->output[nbOutput]->offsetArray), strlen(load_variable(asmExt->output[nbOutput]->offsetArray))); strncat(tmp, ", %rsi\n", 8); strncat(tmp, opcode(asmExt->output[nbOutput]->size), strlen(opcode(asmExt->output[nbOutput]->size))); strncat(tmp, asmExt->output[nbOutput]->variableNumber, strlen(asmExt->output[nbOutput]->variableNumber)); //if index 0 we move the value into address pointed by rsi, if index 1 the value will be stored at address pointed by rsi + size of one element //if index 2 the value will be stored at address pointed by rsi + (index * size of one element)... char *tmp2 = calloc(1, sizeof(char) * 100); if (asmExt->output[nbOutput]->indexArray == 0) strncat(tmp, ", (%rsi)\n", 11); else { strncat(tmp, ", ", 3); snprintf(tmp2, 100, "%d", asmExt->output[nbOutput]->offset); strncat(tmp2, "(%rsi)\n", 9); //to have example 4(%rsi) for index 1, 8(%rsi) for index 2... strncat(tmp, tmp2, strlen(tmp2)); } return tmp; } //Trying to fix ======ISS-164 case it's a struct with address we need to generate the correct output for the specified struct member else if (asmExt->output[nbOutput]->isAddress && asmExt->output[nbOutput]->isStruct && strncmp(asmExt->output[nbOutput]->prefix, "=", 2)) { strncat(tmp, "\n", 3); strncat(tmp, " movq ", 8); strncat(tmp, load_variable(asmExt->output[nbOutput]->offset), strlen(load_variable(asmExt->output[nbOutput]->offset))); strncat(tmp, ", %rsi\n", 8); strncat(tmp, opcode(asmExt->output[nbOutput]->size), strlen(opcode(asmExt->output[nbOutput]->size))); strncat(tmp, asmExt->output[nbOutput]->variableNumber, strlen(asmExt->output[nbOutput]->variableNumber)); //if index 0 we move the value into address pointed by rsi, if index 1 the value will be stored at address pointed by rsi + size of one element //if index 2 the value will be stored at address pointed by rsi + (index * size of one element)... char *tmp2 = calloc(1, sizeof(char) * 100); if (asmExt->output[nbOutput]->offsetStruct == 0) strncat(tmp, ", (%rsi)\n", 11); else { strncat(tmp, ", ", 3); snprintf(tmp2, 100, "%d", asmExt->output[nbOutput]->offsetStruct); strncat(tmp2, "(%rsi)\n", 9); //to have example 4(%rsi) for index 1, 8(%rsi) for index 2... strncat(tmp, tmp2, strlen(tmp2)); } return tmp; } //case it's an address else if (asmExt->output[nbOutput]->isAddress) { if (asmExt->output[nbOutput]->letter == 'm'|| asmExt->output[nbOutput]->letter == 'r' || asmExt->output[nbOutput]->letter == 'q') { strncat(tmp, "\n", 3); strncat(tmp, " movq ", 8); strncat(tmp, load_variable(asmExt->output[nbOutput]->offset), strlen(load_variable(asmExt->output[nbOutput]->offset))); strncat(tmp, ", %rsi\n", 8); strncat(tmp, opcode(asmExt->output[nbOutput]->size), strlen(opcode(asmExt->output[nbOutput]->size))); strncat(tmp, " (%rsi), ", 11); strncat(tmp, asmExt->output[nbOutput]->variableNumber, strlen(asmExt->output[nbOutput]->variableNumber)); strncat(tmp, "\n", 3); return tmp; } else { strncat(tmp, "\n", 3); strncat(tmp, " movq ", 8); strncat(tmp, load_variable(asmExt->output[nbOutput]->offset), strlen(load_variable(asmExt->output[nbOutput]->offset))); strncat(tmp, ", %rsi\n", 8); strncat(tmp, opcode(asmExt->output[nbOutput]->size), strlen(opcode(asmExt->output[nbOutput]->size))); strncat(tmp, asmExt->output[nbOutput]->variableNumber, strlen(asmExt->output[nbOutput]->variableNumber)); strncat(tmp, ", (%rsi)\n", 11); return tmp; } } error("%s:%d: error: in extended_asm function generate_output_asm : unexpected error! %s", __FILE__, __LINE__, asmExt->template->templatestr); //return NULL; } //codegen.c generates correctly the offset but it's too late. //two possibilities: // - write some specific value example %nameofvaroffset% that will be at the end after codegen.c replaced in assembly file // by the correct value. // - or trying to do the same job as codegen.c but here. It's the goal of assign_lvar_offsets_assembly in update_offset function // need to test in several cases char *load_variable(int offset) { //generic solution to handle all values of offset // if (offset == 0) // error("%s:%d : error: in load_variable : incorrect offset %d or not managed yet!", __FILE__,__LINE__, offset); char *targetaddr = calloc(20, sizeof(char)); int length = snprintf(targetaddr, 20, "%d", offset); if (length < 0) error("%s:%d : error:in load_variable : error during snprintf function! offset=%d length=%d", __FILE__, __LINE__, offset, length); strncat(targetaddr, "(%rbp)", 7); return targetaddr; } char *opcode(int size) { switch (size) { case 1: return " movb "; case 2: return " movw "; case 4: return " movl "; case 8: return " movq "; case 16: return " mov "; default: error("%s:%d: error: in opcode : size %d unexpected!", __FILE__, __LINE__, size); } } static char *arith_opcode(char op, int size) { switch (size) { case 1: return (op == '+') ? " addb " : " subb "; case 2: return (op == '+') ? " addw " : " subw "; case 4: return (op == '+') ? " addl " : " subl "; case 8: return (op == '+') ? " addq " : " subq "; case 16: return (op == '+') ? " add " : " sub "; default: error("%s:%d: error: in arith_opcode : size %d unexpected!", __FILE__, __LINE__, size); } } // we need to update the offset to be able to use this information later for loading result into output variables. // TODO we can have an issue here if several functions with same name. Probably need to find in a better way to avoid this issue. void update_offset(char *funcname, Obj *locals) { //printf(" function %s \n", funcname); Obj *fn = find_func(funcname); if (fn) { //fixing ====ISS-161 issue with some locals missing in fn->locals //if (!fn->locals) fn->locals = locals; // During parsing we may call this before the function is fully marked as // a definition. Force offset assignment so inline asm can use (%rbp)-relative // slots for locals/params. bool saved_def = fn->is_definition; fn->is_definition = true; fn->is_function = true; Type dummy_ty = {0}; if (!fn->ty) fn->ty = &dummy_ty; assign_lvar_offsets(fn); fn->is_definition = saved_def; return; } // Fallback: assign offsets using a synthetic function object. Obj dummy_fn = {0}; Type dummy_ty = {0}; dummy_fn.is_function = true; dummy_fn.is_definition = true; dummy_fn.locals = locals; dummy_fn.ty = &dummy_ty; assign_lvar_offsets(&dummy_fn); } // update register following the size char *update_register_size(char *reg, int size) { if (!reg) error("%s:%d: error: in update_register_size : reg is null!", __FILE__, __LINE__); if (!strncmp(reg, "%rax", 4) || !strncmp(reg, "%eax", 4) || !strncmp(reg, "%ax", 3) || !strncmp(reg, "%ah", 3) || !strncmp(reg, "%al", 3)) return reg_ax(size); else if (!strncmp(reg, "%rbx", 4) || !strncmp(reg, "%ebx", 4) || !strncmp(reg, "%bx", 3) || !strncmp(reg, "%bh", 3) || !strncmp(reg, "%bl", 3)) return reg_bx(size); else if (!strncmp(reg, "%rcx", 4) || !strncmp(reg, "%ecx", 4) || !strncmp(reg, "%cx", 3) || !strncmp(reg, "%ch", 3) || !strncmp(reg, "%cl", 3)) return reg_cx(size); else if (!strncmp(reg, "%rdx", 4) || !strncmp(reg, "%edx", 4) || !strncmp(reg, "%dx", 3) || !strncmp(reg, "%dh", 3) || !strncmp(reg, "%dl", 3)) return reg_dx(size); else if (!strncmp(reg, "%rdi", 4) || !strncmp(reg, "%edi", 4) || !strncmp(reg, "%di", 3) || !strncmp(reg, "%dil", 4)) return reg_di(size); else if (!strncmp(reg, "%rsi", 4) || !strncmp(reg, "%esi", 4) || !strncmp(reg, "%si", 3) || !strncmp(reg, "%sil", 4)) return reg_si(size); else if (!strncmp(reg, "%r8", 3)) return reg_r8w(size); else if (!strncmp(reg, "%r9", 3)) return reg_r9w(size); else if (!strncmp(reg, "%r10", 4)) return reg_r10w(size); else if (!strncmp(reg, "%r11", 4)) return reg_r11w(size); else if (!strncmp(reg, "%r12", 4)) return reg_r12w(size); else if (!strncmp(reg, "%r13", 4)) return reg_r13w(size); else if (!strncmp(reg, "%r14", 4)) return reg_r14w(size); else if (!strncmp(reg, "%r15", 4)) return reg_r15w(size); else return reg; } //returns the index corresponding to the letter received in parameter int retrieve_output_index_from_letter(char letter) { for (int i = 0; i < nbOutput; i++) { if (asmExt->output[i]->letter == letter) return asmExt->output[i]->index; } return -1; } //retrieve the variable number string like M0, %1, %2... char * retrieveVariableNumber(int index) { if (index > 8) error("%s:%d: error: in retrieveVariableNumber : index %d not managed yet!", __FILE__, __LINE__, index); char *tmp; char *variableNumberStr = calloc(20, sizeof(char)); char *indexstr = calloc(20, sizeof(char)); strncat(variableNumberStr, "%", 2); int length = snprintf(indexstr, 20, "%d", index); if (length < 0) error("%s:%d : error: in retrieveVariableNumber : error during snprintf function! index=%d length=%d", __FILE__, __LINE__, index, length); strncat(variableNumberStr, indexstr, strlen(indexstr)); tmp = variableNumberStr; return tmp; } //generate the input for the output when + is a prefix for output char *generate_input_for_output() { char *tmp = calloc(1, sizeof(char) * 500); for (int i = 0; i < nbOutput; i++) { //not sure yet about in which case exactly we need to generate the input for the output if (asmExt->output[i]->letter == 'm' && !asmExt->output[i]->isAddress) continue; if ((asmExt->output[i]->isAddress || (asmExt->output[i]->offset != 0 && !strncmp(asmExt->output[i]->prefix, "+", 2)))) { if (asmExt->output[i]->isVariable && !asmExt->output[i]->isAddress) { strncat(tmp, "\n", 3); strncat(tmp, opcode(asmExt->output[i]->size), strlen(opcode(asmExt->output[i]->size))); strncat(tmp, load_variable(asmExt->output[i]->offset), strlen(load_variable(asmExt->output[i]->offset))); strncat(tmp, ", ", 3); strncat(tmp, asmExt->output[i]->reg, strlen(asmExt->output[i]->reg)); strncat(tmp, ";\n", 3); }else if (asmExt->output[i]->isAddress ) { strncat(tmp, "\n", 3); strncat(tmp, opcode(8), 8); int off = asmExt->output[i]->isArray ? asmExt->output[i]->offsetArray : asmExt->output[i]->offset; strncat(tmp, load_variable(off), strlen(load_variable(off))); strncat(tmp, ", ", 3); strncat(tmp, asmExt->output[i]->reg64, strlen(asmExt->output[i]->reg64)); strncat(tmp, ";\n", 3); if (asmExt->output[i]->isArray && asmExt->output[i]->offset) { char off_str[16]; snprintf(off_str, sizeof(off_str), "%d", asmExt->output[i]->offset); strncat(tmp, " addq $", 11); strncat(tmp, off_str, strlen(off_str)); strncat(tmp, ", ", 3); strncat(tmp, asmExt->output[i]->reg64, strlen(asmExt->output[i]->reg64)); strncat(tmp, ";\n", 3); } } } } return tmp; } // Returns the high 8-bit register name for the given 64-bit register static char *register_higher(char *reg) { if (!reg) return NULL; if (!strncmp(reg, "%rax", 4) || !strncmp(reg, "%eax", 4) || !strncmp(reg, "%ax", 3)) return "%ah"; if (!strncmp(reg, "%rbx", 4) || !strncmp(reg, "%ebx", 4) || !strncmp(reg, "%bx", 3)) return "%bh"; if (!strncmp(reg, "%rcx", 4) || !strncmp(reg, "%ecx", 4) || !strncmp(reg, "%cx", 3)) return "%ch"; if (!strncmp(reg, "%rdx", 4) || !strncmp(reg, "%edx", 4) || !strncmp(reg, "%dx", 3)) return "%dh"; // %r10-%r11, %rdi, %rsi do not have high 8-bit registers in x86-64 if (!strncmp(reg, "%r10", 3) || !strncmp(reg, "%r11", 3) || !strncmp(reg, "%rdi", 4) || !strncmp(reg, "%rsi", 4)) return NULL; return NULL; } // Returns the low 8-bit register name for the given 64-bit register static char *register_lower(char *reg) { if (!reg) return NULL; if (!strncmp(reg, "%rax", 4) || !strncmp(reg, "%eax", 4) || !strncmp(reg, "%ax", 3)) return "%al"; if (!strncmp(reg, "%rbx", 4) || !strncmp(reg, "%ebx", 4) || !strncmp(reg, "%bx", 3)) return "%bl"; if (!strncmp(reg, "%rcx", 4) || !strncmp(reg, "%ecx", 4) || !strncmp(reg, "%cx", 3)) return "%cl"; if (!strncmp(reg, "%rdx", 4) || !strncmp(reg, "%edx", 4) || !strncmp(reg, "%dx", 3)) return "%dl"; if (!strncmp(reg, "%r8", 3)) return "%r8b"; if (!strncmp(reg, "%r9", 3)) return "%r9b"; if (!strncmp(reg, "%r10", 4)) return "%r10b"; if (!strncmp(reg, "%r11", 4)) return "%r11b"; if (!strncmp(reg, "%r12", 4)) return "%r12b"; if (!strncmp(reg, "%r13", 4)) return "%r13b"; if (!strncmp(reg, "%r14", 4)) return "%r14b"; if (!strncmp(reg, "%r15", 4)) return "%r15b"; if (!strncmp(reg, "%rdi", 4) || !strncmp(reg, "%edi", 4)) return "%dil"; if (!strncmp(reg, "%rsi", 4) || !strncmp(reg, "%esi", 4)) return "%sil"; return NULL; } // Returns the 16-bit register name for the given 64-bit register static char *register_word(char *reg) { if (!reg) return NULL; if (!strncmp(reg, "%rax", 4) || !strncmp(reg, "%eax", 4)) return "%ax"; if (!strncmp(reg, "%rbx", 4) || !strncmp(reg, "%ebx", 4)) return "%bx"; if (!strncmp(reg, "%rcx", 4) || !strncmp(reg, "%ecx", 4)) return "%cx"; if (!strncmp(reg, "%rdx", 4) || !strncmp(reg, "%edx", 4)) return "%dx"; if (!strncmp(reg, "%rsi", 4) || !strncmp(reg, "%esi", 4)) return "%si"; if (!strncmp(reg, "%rdi", 4) || !strncmp(reg, "%edi", 4)) return "%di"; if (!strncmp(reg, "%r8", 3)) return "%r8w"; if (!strncmp(reg, "%r9", 3)) return "%r9w"; if (!strncmp(reg, "%r10", 4)) return "%r10w"; if (!strncmp(reg, "%r11", 4)) return "%r11w"; if (!strncmp(reg, "%r12", 4)) return "%r12w"; if (!strncmp(reg, "%r13", 4)) return "%r13w"; if (!strncmp(reg, "%r14", 4)) return "%r14w"; if (!strncmp(reg, "%r15", 4)) return "%r15w"; if (!strncmp(reg, "%rbp", 5) || !strncmp(reg, "%ebp", 4)) return "%bp"; if (!strncmp(reg, "%rsp", 5) || !strncmp(reg, "%esp", 4)) return "%sp"; if (!strncmp(reg, "%r8", 3)) return "%r8w"; if (!strncmp(reg, "%r9", 3)) return "%r9w"; if (!strncmp(reg, "%r10", 4)) return "%r10w"; if (!strncmp(reg, "%r11", 4)) return "%r11w"; if (!strncmp(reg, "%r12", 4)) return "%r12w"; if (!strncmp(reg, "%r13", 4)) return "%r13w"; if (!strncmp(reg, "%r14", 4)) return "%r14w"; if (!strncmp(reg, "%r15", 4)) return "%r15w"; return NULL; } chibicc-1.0.24/hashmap.c000066400000000000000000000124251517770275000147660ustar00rootroot00000000000000// This is an implementation of the open-addressing hash table. #include "chibicc.h" // Initial hash bucket size #define INIT_SIZE 16 // Rehash if the usage exceeds 70%. #define HIGH_WATERMARK 70 // We'll keep the usage below 50% after rehashing. #define LOW_WATERMARK 50 // Represents a deleted hash entry #define TOMBSTONE ((void *)-1) static uint64_t fnv_hash(char *s, int len) { uint64_t hash = 0xcbf29ce484222325; for (int i = 0; i < len; i++) { hash *= 0x100000001b3; hash ^= (unsigned char)s[i]; } return hash; } // Make room for new entries in a given hashmap by removing // tombstones and possibly extending the bucket size. static void rehash(HashMap *map) { // Compute the size of the new hashmap. int nkeys = 0; for (int i = 0; i < map->capacity; i++) if (map->buckets[i].key && map->buckets[i].key != TOMBSTONE) nkeys++; int cap = map->capacity; while ((nkeys * 100) / cap >= LOW_WATERMARK) cap = cap * 2; assert(cap > 0); // Allocate new buckets HashEntry *buckets2 = calloc(cap, sizeof(HashEntry)); if (buckets2 == NULL) error("%s:%d: error: in rehash buckets2 is null!", __FILE__, __LINE__); // Rehash all valid entries int nkeys2 = 0; for (int i = 0; i < map->capacity; i++) { HashEntry *ent = &map->buckets[i]; if (ent->key && ent->key != TOMBSTONE) //hashmap_put2(&map2, ent->key, ent->keylen, ent->val); //} //assert(map2.used == nkeys); //*map = map2; { uint64_t hash = fnv_hash(ent->key, ent->keylen); for (int j = 0; j < cap; j++) { HashEntry *new_ent = &buckets2[(hash + j) % cap]; if (new_ent->key == NULL) { *new_ent = *ent; nkeys2++; break; } } } } assert(nkeys2 == nkeys); // Replace old buckets with new buckets free(map->buckets); map->buckets = buckets2; map->capacity = cap; map->used = nkeys2; } static bool match(HashEntry *ent, char *key, int keylen) { return ent->key && ent->key != TOMBSTONE && ent->keylen == keylen && memcmp(ent->key, key, keylen) == 0; } static HashEntry *get_entry(HashMap *map, char *key, int keylen) { if (!map->buckets) return NULL; uint64_t hash = fnv_hash(key, keylen); for (int i = 0; i < map->capacity; i++) { HashEntry *ent = &map->buckets[(hash + i) % map->capacity]; if (match(ent, key, keylen)) return ent; if (ent->key == NULL) return NULL; } unreachable(); } static HashEntry *get_or_insert_entry(HashMap *map, char *key, int keylen) { if (!map->buckets) { map->buckets = calloc(INIT_SIZE, sizeof(HashEntry)); if (map->buckets == NULL) error("%s:%d: error: in get_or_insert_entry map->buckets is null!", __FILE__, __LINE__); map->capacity = INIT_SIZE; } else if ((map->used * 100) / map->capacity >= HIGH_WATERMARK) { rehash(map); } uint64_t hash = fnv_hash(key, keylen); for (int i = 0; i < map->capacity; i++) { HashEntry *ent = &map->buckets[(hash + i) % map->capacity]; if (match(ent, key, keylen)) return ent; // if (ent->key == TOMBSTONE) // { // ent->key = key; // ent->keylen = keylen; // return ent; // } if (ent->key == NULL) { ent->key = key; ent->keylen = keylen; map->used++; return ent; } } unreachable(); } void *hashmap_get(HashMap *map, char *key) { return hashmap_get2(map, key, strlen(key)); } void *hashmap_get2(HashMap *map, char *key, int keylen) { HashEntry *ent = get_entry(map, key, keylen); return ent ? ent->val : NULL; } void hashmap_put(HashMap *map, char *key, void *val) { hashmap_put2(map, key, strlen(key), val); } void hashmap_put2(HashMap *map, char *key, int keylen, void *val) { if (map->buckets && ((map->used * 100) / map->capacity >= HIGH_WATERMARK)) rehash(map); HashEntry *ent = get_or_insert_entry(map, key, keylen); ent->val = val; } void hashmap_delete(HashMap *map, char *key) { hashmap_delete2(map, key, strlen(key)); } void hashmap_delete2(HashMap *map, char *key, int keylen) { HashEntry *ent = get_entry(map, key, keylen); if (ent) ent->key = TOMBSTONE; } void hashmap_test(void) { HashMap *map = calloc(1, sizeof(HashMap)); for (int i = 0; i < 5000; i++) hashmap_put(map, format("key %d", i), (void *)(size_t)i); for (int i = 1000; i < 2000; i++) hashmap_delete(map, format("key %d", i)); for (int i = 1500; i < 1600; i++) hashmap_put(map, format("key %d", i), (void *)(size_t)i); for (int i = 6000; i < 7000; i++) hashmap_put(map, format("key %d", i), (void *)(size_t)i); for (int i = 0; i < 1000; i++) assert((size_t)hashmap_get(map, format("key %d", i)) == i); for (int i = 1000; i < 1500; i++) assert(hashmap_get(map, "no such key") == NULL); for (int i = 1500; i < 1600; i++) assert((size_t)hashmap_get(map, format("key %d", i)) == i); for (int i = 1600; i < 2000; i++) assert(hashmap_get(map, "no such key") == NULL); for (int i = 2000; i < 5000; i++) assert((size_t)hashmap_get(map, format("key %d", i)) == i); for (int i = 5000; i < 6000; i++) assert(hashmap_get(map, "no such key") == NULL); for (int i = 6000; i < 7000; i++) hashmap_put(map, format("key %d", i), (void *)(size_t)i); assert(hashmap_get(map, "no such key") == NULL); printf("OK\n"); free(map); }chibicc-1.0.24/include/000077500000000000000000000000001517770275000146205ustar00rootroot00000000000000chibicc-1.0.24/include/adxintrin.h000066400000000000000000000056221517770275000167760ustar00rootroot00000000000000/* Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _ADXINTRIN_H_INCLUDED #define _ADXINTRIN_H_INCLUDED // extern __inline unsigned char // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _subborrow_u32 (unsigned char __CF, unsigned int __X, // unsigned int __Y, unsigned int *__P) // { // return __builtin_ia32_sbb_u32 (__CF, __X, __Y, __P); // } // extern __inline unsigned char // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _addcarry_u32 (unsigned char __CF, unsigned int __X, // unsigned int __Y, unsigned int *__P) // { // return __builtin_ia32_addcarryx_u32 (__CF, __X, __Y, __P); // } // extern __inline unsigned char // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _addcarryx_u32 (unsigned char __CF, unsigned int __X, // unsigned int __Y, unsigned int *__P) // { // return __builtin_ia32_addcarryx_u32 (__CF, __X, __Y, __P); // } // #ifdef __x86_64__ // extern __inline unsigned char // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _subborrow_u64 (unsigned char __CF, unsigned long long __X, // unsigned long long __Y, unsigned long long *__P) // { // return __builtin_ia32_sbb_u64 (__CF, __X, __Y, __P); // } // extern __inline unsigned char // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _addcarry_u64 (unsigned char __CF, unsigned long long __X, // unsigned long long __Y, unsigned long long *__P) // { // return __builtin_ia32_addcarryx_u64 (__CF, __X, __Y, __P); // } // extern __inline unsigned char // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _addcarryx_u64 (unsigned char __CF, unsigned long long __X, // unsigned long long __Y, unsigned long long *__P) // { // return __builtin_ia32_addcarryx_u64 (__CF, __X, __Y, __P); // } //#endif #endif /* _ADXINTRIN_H_INCLUDED */ chibicc-1.0.24/include/ammintrin.h000066400000000000000000000064211517770275000167720ustar00rootroot00000000000000/* Copyright (C) 2007-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the specification included in the AMD Programmers Manual Update, version 2.x */ #ifndef _AMMINTRIN_H_INCLUDED #define _AMMINTRIN_H_INCLUDED /* We need definitions from the SSE3, SSE2 and SSE header files*/ #include #ifndef __SSE4A__ #pragma GCC push_options #pragma GCC target("sse4a") #define __DISABLE_SSE4A__ #endif /* __SSE4A__ */ // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_stream_sd (double * __P, __m128d __Y) // { // __builtin_ia32_movntsd (__P, (__v2df) __Y); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_stream_ss (float * __P, __m128 __Y) // { // __builtin_ia32_movntss (__P, (__v4sf) __Y); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_extract_si64 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_extrq ((__v2di) __X, (__v16qi) __Y); // } // #ifdef __OPTIMIZE__ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_extracti_si64 (__m128i __X, unsigned const int __I, unsigned const int __L) // { // return (__m128i) __builtin_ia32_extrqi ((__v2di) __X, __I, __L); // } // #else // #define _mm_extracti_si64(X, I, L) \ // ((__m128i) __builtin_ia32_extrqi ((__v2di)(__m128i)(X), \ // (unsigned int)(I), (unsigned int)(L))) // #endif // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_insert_si64 (__m128i __X,__m128i __Y) // { // return (__m128i) __builtin_ia32_insertq ((__v2di)__X, (__v2di)__Y); // } // #ifdef __OPTIMIZE__ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_inserti_si64(__m128i __X, __m128i __Y, unsigned const int __I, unsigned const int __L) // { // return (__m128i) __builtin_ia32_insertqi ((__v2di)__X, (__v2di)__Y, __I, __L); // } // #else // #define _mm_inserti_si64(X, Y, I, L) \ // ((__m128i) __builtin_ia32_insertqi ((__v2di)(__m128i)(X), \ // (__v2di)(__m128i)(Y), \ // (unsigned int)(I), (unsigned int)(L))) // #endif #ifdef __DISABLE_SSE4A__ #undef __DISABLE_SSE4A__ #pragma GCC pop_options #endif /* __DISABLE_SSE4A__ */ #endif /* _AMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx2intrin.h000066400000000000000000001724451517770275000171120ustar00rootroot00000000000000/* Copyright (C) 2011-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _AVX2INTRIN_H_INCLUDED #define _AVX2INTRIN_H_INCLUDED #ifndef __AVX2__ #pragma GCC push_options #pragma GCC target("avx2") #define __DISABLE_AVX2__ #endif /* __AVX2__ */ /* Sum absolute 8-bit integer difference of adjacent groups of 4 byte integers in the first 2 operands. Starting offsets within operands are determined by the 3rd mask operand. */ #ifdef __OPTIMIZE__ extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_mpsadbw_epu8 (__m256i __X, __m256i __Y, const int __M) { return (__m256i) __builtin_ia32_mpsadbw256 ((__v32qi)__X, (__v32qi)__Y, __M); } #else #define _mm256_mpsadbw_epu8(X, Y, M) \ ((__m256i) __builtin_ia32_mpsadbw256 ((__v32qi)(__m256i)(X), \ (__v32qi)(__m256i)(Y), (int)(M))) #endif // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_abs_epi8 (__m256i __A) // { // return (__m256i)__builtin_ia32_pabsb256 ((__v32qi)__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_abs_epi16 (__m256i __A) // { // return (__m256i)__builtin_ia32_pabsw256 ((__v16hi)__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_abs_epi32 (__m256i __A) // { // return (__m256i)__builtin_ia32_pabsd256 ((__v8si)__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_packs_epi32 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_packssdw256 ((__v8si)__A, (__v8si)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_packs_epi16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_packsswb256 ((__v16hi)__A, (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_packus_epi32 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_packusdw256 ((__v8si)__A, (__v8si)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_packus_epi16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_packuswb256 ((__v16hi)__A, (__v16hi)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_add_epi8 (__m256i __A, __m256i __B) { return (__m256i) ((__v32qu)__A + (__v32qu)__B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_add_epi16 (__m256i __A, __m256i __B) // { // return (__m256i) ((__v16hu)__A + (__v16hu)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_add_epi32 (__m256i __A, __m256i __B) { return (__m256i) ((__v8su)__A + (__v8su)__B); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_add_epi64 (__m256i __A, __m256i __B) { return (__m256i) ((__v4du)__A + (__v4du)__B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_adds_epi8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_paddsb256 ((__v32qi)__A, (__v32qi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_adds_epi16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_paddsw256 ((__v16hi)__A, (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_adds_epu8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_paddusb256 ((__v32qi)__A, (__v32qi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_adds_epu16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_paddusw256 ((__v16hi)__A, (__v16hi)__B); // } #ifdef __OPTIMIZE__ extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_alignr_epi8 (__m256i __A, __m256i __B, const int __N) { return (__m256i) __builtin_ia32_palignr256 ((__v4di)__A, (__v4di)__B, __N * 8); } #else /* In that case (__N*8) will be in vreg, and insn will not be matched. */ /* Use define instead */ #define _mm256_alignr_epi8(A, B, N) \ ((__m256i) __builtin_ia32_palignr256 ((__v4di)(__m256i)(A), \ (__v4di)(__m256i)(B), \ (int)(N) * 8)) #endif extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_and_si256 (__m256i __A, __m256i __B) { return (__m256i) ((__v4du)__A & (__v4du)__B); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_andnot_si256 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_andnotsi256 ((__v4di)__A, (__v4di)__B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_avg_epu8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pavgb256 ((__v32qi)__A, (__v32qi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_avg_epu16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pavgw256 ((__v16hi)__A, (__v16hi)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_blendv_epi8 (__m256i __X, __m256i __Y, __m256i __M) { return (__m256i) __builtin_ia32_pblendvb256 ((__v32qi)__X, (__v32qi)__Y, (__v32qi)__M); } // #ifdef __OPTIMIZE__ // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_blend_epi16 (__m256i __X, __m256i __Y, const int __M) // { // return (__m256i) __builtin_ia32_pblendw256 ((__v16hi)__X, // (__v16hi)__Y, // __M); // } // #else // #define _mm256_blend_epi16(X, Y, M) \ // ((__m256i) __builtin_ia32_pblendw256 ((__v16hi)(__m256i)(X), \ // (__v16hi)(__m256i)(Y), (int)(M))) // #endif extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_cmpeq_epi8 (__m256i __A, __m256i __B) { return (__m256i) ((__v32qi)__A == (__v32qi)__B); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_cmpeq_epi16 (__m256i __A, __m256i __B) { return (__m256i) ((__v16hi)__A == (__v16hi)__B); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_cmpeq_epi32 (__m256i __A, __m256i __B) { return (__m256i) ((__v8si)__A == (__v8si)__B); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_cmpeq_epi64 (__m256i __A, __m256i __B) { return (__m256i) ((__v4di)__A == (__v4di)__B); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_cmpgt_epi8 (__m256i __A, __m256i __B) { return (__m256i) ((__v32qs)__A > (__v32qs)__B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpgt_epi16 (__m256i __A, __m256i __B) // { // return (__m256i) ((__v16hi)__A > (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpgt_epi32 (__m256i __A, __m256i __B) // { // return (__m256i) ((__v8si)__A > (__v8si)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpgt_epi64 (__m256i __A, __m256i __B) // { // return (__m256i) ((__v4di)__A > (__v4di)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_hadd_epi16 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_phaddw256 ((__v16hi)__X, // (__v16hi)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_hadd_epi32 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_phaddd256 ((__v8si)__X, (__v8si)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_hadds_epi16 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_phaddsw256 ((__v16hi)__X, // (__v16hi)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_hsub_epi16 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_phsubw256 ((__v16hi)__X, // (__v16hi)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_hsub_epi32 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_phsubd256 ((__v8si)__X, (__v8si)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_hsubs_epi16 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_phsubsw256 ((__v16hi)__X, // (__v16hi)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maddubs_epi16 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_pmaddubsw256 ((__v32qi)__X, // (__v32qi)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_madd_epi16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pmaddwd256 ((__v16hi)__A, // (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_max_epi8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pmaxsb256 ((__v32qi)__A, (__v32qi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_max_epi16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pmaxsw256 ((__v16hi)__A, (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_max_epi32 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pmaxsd256 ((__v8si)__A, (__v8si)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_max_epu8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pmaxub256 ((__v32qi)__A, (__v32qi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_max_epu16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pmaxuw256 ((__v16hi)__A, (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_max_epu32 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pmaxud256 ((__v8si)__A, (__v8si)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_min_epi8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pminsb256 ((__v32qi)__A, (__v32qi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_min_epi16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pminsw256 ((__v16hi)__A, (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_min_epi32 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pminsd256 ((__v8si)__A, (__v8si)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_min_epu8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pminub256 ((__v32qi)__A, (__v32qi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_min_epu16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pminuw256 ((__v16hi)__A, (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_min_epu32 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pminud256 ((__v8si)__A, (__v8si)__B); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movemask_epi8 (__m256i __A) // { // return __builtin_ia32_pmovmskb256 ((__v32qi)__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi8_epi16 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovsxbw256 ((__v16qi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi8_epi32 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovsxbd256 ((__v16qi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi8_epi64 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovsxbq256 ((__v16qi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi16_epi32 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovsxwd256 ((__v8hi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi16_epi64 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovsxwq256 ((__v8hi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi32_epi64 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovsxdq256 ((__v4si)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepu8_epi16 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovzxbw256 ((__v16qi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepu8_epi32 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovzxbd256 ((__v16qi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepu8_epi64 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovzxbq256 ((__v16qi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepu16_epi32 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovzxwd256 ((__v8hi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepu16_epi64 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovzxwq256 ((__v8hi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepu32_epi64 (__m128i __X) // { // return (__m256i) __builtin_ia32_pmovzxdq256 ((__v4si)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mul_epi32 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_pmuldq256 ((__v8si)__X, (__v8si)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mulhrs_epi16 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_pmulhrsw256 ((__v16hi)__X, // (__v16hi)__Y); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_mulhi_epu16 (__m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_pmulhuw256 ((__v16hi)__A, (__v16hi)__B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mulhi_epi16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pmulhw256 ((__v16hi)__A, (__v16hi)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_mullo_epi16 (__m256i __A, __m256i __B) { return (__m256i) ((__v16hu)__A * (__v16hu)__B); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_mullo_epi32 (__m256i __A, __m256i __B) { return (__m256i) ((__v8su)__A * (__v8su)__B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mul_epu32 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_pmuludq256 ((__v8si)__A, (__v8si)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_or_si256 (__m256i __A, __m256i __B) { return (__m256i) ((__v4du)__A | (__v4du)__B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sad_epu8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_psadbw256 ((__v32qi)__A, (__v32qi)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_shuffle_epi8 (__m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_pshufb256 ((__v32qi)__X, (__v32qi)__Y); } // #ifdef __OPTIMIZE__ // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shuffle_epi32 (__m256i __A, const int __mask) // { // return (__m256i)__builtin_ia32_pshufd256 ((__v8si)__A, __mask); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shufflehi_epi16 (__m256i __A, const int __mask) // { // return (__m256i)__builtin_ia32_pshufhw256 ((__v16hi)__A, __mask); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shufflelo_epi16 (__m256i __A, const int __mask) // { // return (__m256i)__builtin_ia32_pshuflw256 ((__v16hi)__A, __mask); // } // #else // #define _mm256_shuffle_epi32(A, N) \ // ((__m256i)__builtin_ia32_pshufd256 ((__v8si)(__m256i)(A), (int)(N))) // #define _mm256_shufflehi_epi16(A, N) \ // ((__m256i)__builtin_ia32_pshufhw256 ((__v16hi)(__m256i)(A), (int)(N))) // #define _mm256_shufflelo_epi16(A, N) \ // ((__m256i)__builtin_ia32_pshuflw256 ((__v16hi)(__m256i)(A), (int)(N))) // #endif // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sign_epi8 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psignb256 ((__v32qi)__X, (__v32qi)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sign_epi16 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psignw256 ((__v16hi)__X, (__v16hi)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sign_epi32 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psignd256 ((__v8si)__X, (__v8si)__Y); // } #ifdef __OPTIMIZE__ extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_bslli_epi128 (__m256i __A, const int __N) { return (__m256i)__builtin_ia32_pslldqi256 (__A, __N * 8); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_slli_si256 (__m256i __A, const int __N) { return (__m256i)__builtin_ia32_pslldqi256 (__A, __N * 8); } #else #define _mm256_bslli_epi128(A, N) \ ((__m256i)__builtin_ia32_pslldqi256 ((__m256i)(A), (int)(N) * 8)) #define _mm256_slli_si256(A, N) \ ((__m256i)__builtin_ia32_pslldqi256 ((__m256i)(A), (int)(N) * 8)) #endif // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_slli_epi16 (__m256i __A, int __B) // { // return (__m256i)__builtin_ia32_psllwi256 ((__v16hi)__A, __B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sll_epi16 (__m256i __A, __m128i __B) // { // return (__m256i)__builtin_ia32_psllw256((__v16hi)__A, (__v8hi)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_slli_epi32 (__m256i __A, int __B) { return (__m256i)__builtin_ia32_pslldi256 ((__v8si)__A, __B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sll_epi32 (__m256i __A, __m128i __B) // { // return (__m256i)__builtin_ia32_pslld256((__v8si)__A, (__v4si)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_slli_epi64 (__m256i __A, int __B) { return (__m256i)__builtin_ia32_psllqi256 ((__v4di)__A, __B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sll_epi64 (__m256i __A, __m128i __B) // { // return (__m256i)__builtin_ia32_psllq256((__v4di)__A, (__v2di)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srai_epi16 (__m256i __A, int __B) // { // return (__m256i)__builtin_ia32_psrawi256 ((__v16hi)__A, __B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sra_epi16 (__m256i __A, __m128i __B) // { // return (__m256i)__builtin_ia32_psraw256 ((__v16hi)__A, (__v8hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srai_epi32 (__m256i __A, int __B) // { // return (__m256i)__builtin_ia32_psradi256 ((__v8si)__A, __B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sra_epi32 (__m256i __A, __m128i __B) // { // return (__m256i)__builtin_ia32_psrad256 ((__v8si)__A, (__v4si)__B); // } #ifdef __OPTIMIZE__ extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_bsrli_epi128 (__m256i __A, const int __N) { return (__m256i)__builtin_ia32_psrldqi256 (__A, __N * 8); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_srli_si256 (__m256i __A, const int __N) { return (__m256i)__builtin_ia32_psrldqi256 (__A, __N * 8); } #else #define _mm256_bsrli_epi128(A, N) \ ((__m256i)__builtin_ia32_psrldqi256 ((__m256i)(A), (int)(N) * 8)) #define _mm256_srli_si256(A, N) \ ((__m256i)__builtin_ia32_psrldqi256 ((__m256i)(A), (int)(N) * 8)) #endif // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srli_epi16 (__m256i __A, int __B) // { // return (__m256i)__builtin_ia32_psrlwi256 ((__v16hi)__A, __B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srl_epi16 (__m256i __A, __m128i __B) // { // return (__m256i)__builtin_ia32_psrlw256((__v16hi)__A, (__v8hi)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_srli_epi32 (__m256i __A, int __B) { return (__m256i)__builtin_ia32_psrldi256 ((__v8si)__A, __B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srl_epi32 (__m256i __A, __m128i __B) // { // return (__m256i)__builtin_ia32_psrld256((__v8si)__A, (__v4si)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_srli_epi64 (__m256i __A, int __B) { return (__m256i)__builtin_ia32_psrlqi256 ((__v4di)__A, __B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srl_epi64 (__m256i __A, __m128i __B) // { // return (__m256i)__builtin_ia32_psrlq256((__v4di)__A, (__v2di)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_sub_epi8 (__m256i __A, __m256i __B) { return (__m256i) ((__v32qu)__A - (__v32qu)__B); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_sub_epi16 (__m256i __A, __m256i __B) { return (__m256i) ((__v16hu)__A - (__v16hu)__B); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_sub_epi32 (__m256i __A, __m256i __B) { return (__m256i) ((__v8su)__A - (__v8su)__B); } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_sub_epi64 (__m256i __A, __m256i __B) { return (__m256i) ((__v4du)__A - (__v4du)__B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_subs_epi8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_psubsb256 ((__v32qi)__A, (__v32qi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_subs_epi16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_psubsw256 ((__v16hi)__A, (__v16hi)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_subs_epu8 (__m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_psubusb256 ((__v32qi)__A, (__v32qi)__B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_subs_epu16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_psubusw256 ((__v16hi)__A, (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpackhi_epi8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_punpckhbw256 ((__v32qi)__A, (__v32qi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpackhi_epi16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_punpckhwd256 ((__v16hi)__A, (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpackhi_epi32 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_punpckhdq256 ((__v8si)__A, (__v8si)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpackhi_epi64 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_punpckhqdq256 ((__v4di)__A, (__v4di)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpacklo_epi8 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_punpcklbw256 ((__v32qi)__A, (__v32qi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpacklo_epi16 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_punpcklwd256 ((__v16hi)__A, (__v16hi)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpacklo_epi32 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_punpckldq256 ((__v8si)__A, (__v8si)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpacklo_epi64 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_punpcklqdq256 ((__v4di)__A, (__v4di)__B); // } extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_xor_si256 (__m256i __A, __m256i __B) { return (__m256i) ((__v4du)__A ^ (__v4du)__B); } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_stream_load_si256 (__m256i const *__X) // { // return (__m256i) __builtin_ia32_movntdqa256 ((__v4di *) __X); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_broadcastss_ps (__m128 __X) // { // return (__m128) __builtin_ia32_vbroadcastss_ps ((__v4sf)__X); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcastss_ps (__m128 __X) // { // return (__m256) __builtin_ia32_vbroadcastss_ps256 ((__v4sf)__X); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcastsd_pd (__m128d __X) // { // return (__m256d) __builtin_ia32_vbroadcastsd_pd256 ((__v2df)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcastsi128_si256 (__m128i __X) // { // return (__m256i) __builtin_ia32_vbroadcastsi256 ((__v2di)__X); // } // #ifdef __OPTIMIZE__ // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_blend_epi32 (__m128i __X, __m128i __Y, const int __M) // { // return (__m128i) __builtin_ia32_pblendd128 ((__v4si)__X, // (__v4si)__Y, // __M); // } // #else // #define _mm_blend_epi32(X, Y, M) \ // ((__m128i) __builtin_ia32_pblendd128 ((__v4si)(__m128i)(X), \ // (__v4si)(__m128i)(Y), (int)(M))) // #endif #ifdef __OPTIMIZE__ extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_blend_epi32 (__m256i __X, __m256i __Y, const int __M) { return (__m256i) __builtin_ia32_pblendd256 ((__v8si)__X, (__v8si)__Y, __M); } #else #define _mm256_blend_epi32(X, Y, M) \ ((__m256i) __builtin_ia32_pblendd256 ((__v8si)(__m256i)(X), \ (__v8si)(__m256i)(Y), (int)(M))) #endif // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcastb_epi8 (__m128i __X) // { // return (__m256i) __builtin_ia32_pbroadcastb256 ((__v16qi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcastw_epi16 (__m128i __X) // { // return (__m256i) __builtin_ia32_pbroadcastw256 ((__v8hi)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcastd_epi32 (__m128i __X) // { // return (__m256i) __builtin_ia32_pbroadcastd256 ((__v4si)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcastq_epi64 (__m128i __X) // { // return (__m256i) __builtin_ia32_pbroadcastq256 ((__v2di)__X); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_broadcastb_epi8 (__m128i __X) // { // return (__m128i) __builtin_ia32_pbroadcastb128 ((__v16qi)__X); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_broadcastw_epi16 (__m128i __X) // { // return (__m128i) __builtin_ia32_pbroadcastw128 ((__v8hi)__X); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_broadcastd_epi32 (__m128i __X) // { // return (__m128i) __builtin_ia32_pbroadcastd128 ((__v4si)__X); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_broadcastq_epi64 (__m128i __X) // { // return (__m128i) __builtin_ia32_pbroadcastq128 ((__v2di)__X); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutevar8x32_epi32 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_permvarsi256 ((__v8si)__X, (__v8si)__Y); // } // #ifdef __OPTIMIZE__ // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permute4x64_pd (__m256d __X, const int __M) // { // return (__m256d) __builtin_ia32_permdf256 ((__v4df)__X, __M); // } // #else // #define _mm256_permute4x64_pd(X, M) \ // ((__m256d) __builtin_ia32_permdf256 ((__v4df)(__m256d)(X), (int)(M))) // #endif // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutevar8x32_ps (__m256 __X, __m256i __Y) // { // return (__m256) __builtin_ia32_permvarsf256 ((__v8sf)__X, (__v8si)__Y); // } #ifdef __OPTIMIZE__ extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_permute4x64_epi64 (__m256i __X, const int __M) { return (__m256i) __builtin_ia32_permdi256 ((__v4di)__X, __M); } #else #define _mm256_permute4x64_epi64(X, M) \ ((__m256i) __builtin_ia32_permdi256 ((__v4di)(__m256i)(X), (int)(M))) #endif #ifdef __OPTIMIZE__ extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_permute2x128_si256 (__m256i __X, __m256i __Y, const int __M) { return (__m256i) __builtin_ia32_permti256 ((__v4di)__X, (__v4di)__Y, __M); } #else #define _mm256_permute2x128_si256(X, Y, M) \ ((__m256i) __builtin_ia32_permti256 ((__v4di)(__m256i)(X), (__v4di)(__m256i)(Y), (int)(M))) #endif // #ifdef __OPTIMIZE__ // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_extracti128_si256 (__m256i __X, const int __M) // { // return (__m128i) __builtin_ia32_extract128i256 ((__v4di)__X, __M); // } // #else // #define _mm256_extracti128_si256(X, M) \ // ((__m128i) __builtin_ia32_extract128i256 ((__v4di)(__m256i)(X), (int)(M))) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_inserti128_si256 (__m256i __X, __m128i __Y, const int __M) // { // return (__m256i) __builtin_ia32_insert128i256 ((__v4di)__X, (__v2di)__Y, __M); // } // #else // #define _mm256_inserti128_si256(X, Y, M) \ // ((__m256i) __builtin_ia32_insert128i256 ((__v4di)(__m256i)(X), \ // (__v2di)(__m128i)(Y), \ // (int)(M))) // #endif // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskload_epi32 (int const *__X, __m256i __M ) // { // return (__m256i) __builtin_ia32_maskloadd256 ((const __v8si *)__X, // (__v8si)__M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskload_epi64 (long long const *__X, __m256i __M ) // { // return (__m256i) __builtin_ia32_maskloadq256 ((const __v4di *)__X, // (__v4di)__M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskload_epi32 (int const *__X, __m128i __M ) // { // return (__m128i) __builtin_ia32_maskloadd ((const __v4si *)__X, // (__v4si)__M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskload_epi64 (long long const *__X, __m128i __M ) // { // return (__m128i) __builtin_ia32_maskloadq ((const __v2di *)__X, // (__v2di)__M); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskstore_epi32 (int *__X, __m256i __M, __m256i __Y ) // { // __builtin_ia32_maskstored256 ((__v8si *)__X, (__v8si)__M, (__v8si)__Y); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskstore_epi64 (long long *__X, __m256i __M, __m256i __Y ) // { // __builtin_ia32_maskstoreq256 ((__v4di *)__X, (__v4di)__M, (__v4di)__Y); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskstore_epi32 (int *__X, __m128i __M, __m128i __Y ) // { // __builtin_ia32_maskstored ((__v4si *)__X, (__v4si)__M, (__v4si)__Y); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskstore_epi64 (long long *__X, __m128i __M, __m128i __Y ) // { // __builtin_ia32_maskstoreq (( __v2di *)__X, (__v2di)__M, (__v2di)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sllv_epi32 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psllv8si ((__v8si)__X, (__v8si)__Y); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sllv_epi32 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psllv4si ((__v4si)__X, (__v4si)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sllv_epi64 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psllv4di ((__v4di)__X, (__v4di)__Y); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sllv_epi64 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psllv2di ((__v2di)__X, (__v2di)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srav_epi32 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psrav8si ((__v8si)__X, (__v8si)__Y); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_srav_epi32 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psrav4si ((__v4si)__X, (__v4si)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srlv_epi32 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psrlv8si ((__v8si)__X, (__v8si)__Y); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_srlv_epi32 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psrlv4si ((__v4si)__X, (__v4si)__Y); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srlv_epi64 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psrlv4di ((__v4di)__X, (__v4di)__Y); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_srlv_epi64 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psrlv2di ((__v2di)__X, (__v2di)__Y); // } // #ifdef __OPTIMIZE__ // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i32gather_pd (double const *__base, __m128i __index, const int __scale) // { // __v2df __zero = _mm_setzero_pd (); // __v2df __mask = _mm_cmpeq_pd (__zero, __zero); // return (__m128d) __builtin_ia32_gathersiv2df (_mm_undefined_pd (), // __base, // (__v4si)__index, // __mask, // __scale); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i32gather_pd (__m128d __src, double const *__base, __m128i __index, // __m128d __mask, const int __scale) // { // return (__m128d) __builtin_ia32_gathersiv2df ((__v2df)__src, // __base, // (__v4si)__index, // (__v2df)__mask, // __scale); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i32gather_pd (double const *__base, __m128i __index, const int __scale) // { // __v4df __zero = _mm256_setzero_pd (); // __v4df __mask = _mm256_cmp_pd (__zero, __zero, _CMP_EQ_OQ); // return (__m256d) __builtin_ia32_gathersiv4df (_mm256_undefined_pd (), // __base, // (__v4si)__index, // __mask, // __scale); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i32gather_pd (__m256d __src, double const *__base, // __m128i __index, __m256d __mask, const int __scale) // { // return (__m256d) __builtin_ia32_gathersiv4df ((__v4df)__src, // __base, // (__v4si)__index, // (__v4df)__mask, // __scale); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i64gather_pd (double const *__base, __m128i __index, const int __scale) // { // __v2df __src = _mm_setzero_pd (); // __v2df __mask = _mm_cmpeq_pd (__src, __src); // return (__m128d) __builtin_ia32_gatherdiv2df (__src, // __base, // (__v2di)__index, // __mask, // __scale); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i64gather_pd (__m128d __src, double const *__base, __m128i __index, // __m128d __mask, const int __scale) // { // return (__m128d) __builtin_ia32_gatherdiv2df ((__v2df)__src, // __base, // (__v2di)__index, // (__v2df)__mask, // __scale); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i64gather_pd (double const *__base, __m256i __index, const int __scale) // { // __v4df __src = _mm256_setzero_pd (); // __v4df __mask = _mm256_cmp_pd (__src, __src, _CMP_EQ_OQ); // return (__m256d) __builtin_ia32_gatherdiv4df (__src, // __base, // (__v4di)__index, // __mask, // __scale); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i64gather_pd (__m256d __src, double const *__base, // __m256i __index, __m256d __mask, const int __scale) // { // return (__m256d) __builtin_ia32_gatherdiv4df ((__v4df)__src, // __base, // (__v4di)__index, // (__v4df)__mask, // __scale); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i32gather_ps (float const *__base, __m128i __index, const int __scale) // { // __v4sf __src = _mm_setzero_ps (); // __v4sf __mask = _mm_cmpeq_ps (__src, __src); // return (__m128) __builtin_ia32_gathersiv4sf (__src, // __base, // (__v4si)__index, // __mask, // __scale); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i32gather_ps (__m128 __src, float const *__base, __m128i __index, // __m128 __mask, const int __scale) // { // return (__m128) __builtin_ia32_gathersiv4sf ((__v4sf)__src, // __base, // (__v4si)__index, // (__v4sf)__mask, // __scale); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i32gather_ps (float const *__base, __m256i __index, const int __scale) // { // __v8sf __src = _mm256_setzero_ps (); // __v8sf __mask = _mm256_cmp_ps (__src, __src, _CMP_EQ_OQ); // return (__m256) __builtin_ia32_gathersiv8sf (__src, // __base, // (__v8si)__index, // __mask, // __scale); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i32gather_ps (__m256 __src, float const *__base, // __m256i __index, __m256 __mask, const int __scale) // { // return (__m256) __builtin_ia32_gathersiv8sf ((__v8sf)__src, // __base, // (__v8si)__index, // (__v8sf)__mask, // __scale); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i64gather_ps (float const *__base, __m128i __index, const int __scale) // { // __v4sf __src = _mm_setzero_ps (); // __v4sf __mask = _mm_cmpeq_ps (__src, __src); // return (__m128) __builtin_ia32_gatherdiv4sf (__src, // __base, // (__v2di)__index, // __mask, // __scale); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i64gather_ps (__m128 __src, float const *__base, __m128i __index, // __m128 __mask, const int __scale) // { // return (__m128) __builtin_ia32_gatherdiv4sf ((__v4sf)__src, // __base, // (__v2di)__index, // (__v4sf)__mask, // __scale); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i64gather_ps (float const *__base, __m256i __index, const int __scale) // { // __v4sf __src = _mm_setzero_ps (); // __v4sf __mask = _mm_cmpeq_ps (__src, __src); // return (__m128) __builtin_ia32_gatherdiv4sf256 (__src, // __base, // (__v4di)__index, // __mask, // __scale); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i64gather_ps (__m128 __src, float const *__base, // __m256i __index, __m128 __mask, const int __scale) // { // return (__m128) __builtin_ia32_gatherdiv4sf256 ((__v4sf)__src, // __base, // (__v4di)__index, // (__v4sf)__mask, // __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i32gather_epi64 (long long int const *__base, // __m128i __index, const int __scale) // { // __v2di __src = __extension__ (__v2di){ 0, 0 }; // __v2di __mask = __extension__ (__v2di){ ~0, ~0 }; // return (__m128i) __builtin_ia32_gathersiv2di (__src, // __base, // (__v4si)__index, // __mask, // __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i32gather_epi64 (__m128i __src, long long int const *__base, // __m128i __index, __m128i __mask, const int __scale) // { // return (__m128i) __builtin_ia32_gathersiv2di ((__v2di)__src, // __base, // (__v4si)__index, // (__v2di)__mask, // __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i32gather_epi64 (long long int const *__base, // __m128i __index, const int __scale) // { // __v4di __src = __extension__ (__v4di){ 0, 0, 0, 0 }; // __v4di __mask = __extension__ (__v4di){ ~0, ~0, ~0, ~0 }; // return (__m256i) __builtin_ia32_gathersiv4di (__src, // __base, // (__v4si)__index, // __mask, // __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i32gather_epi64 (__m256i __src, long long int const *__base, // __m128i __index, __m256i __mask, // const int __scale) // { // return (__m256i) __builtin_ia32_gathersiv4di ((__v4di)__src, // __base, // (__v4si)__index, // (__v4di)__mask, // __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i64gather_epi64 (long long int const *__base, // __m128i __index, const int __scale) // { // __v2di __src = __extension__ (__v2di){ 0, 0 }; // __v2di __mask = __extension__ (__v2di){ ~0, ~0 }; // return (__m128i) __builtin_ia32_gatherdiv2di (__src, // __base, // (__v2di)__index, // __mask, // __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i64gather_epi64 (__m128i __src, long long int const *__base, // __m128i __index, __m128i __mask, const int __scale) // { // return (__m128i) __builtin_ia32_gatherdiv2di ((__v2di)__src, // __base, // (__v2di)__index, // (__v2di)__mask, // __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i64gather_epi64 (long long int const *__base, // __m256i __index, const int __scale) // { // __v4di __src = __extension__ (__v4di){ 0, 0, 0, 0 }; // __v4di __mask = __extension__ (__v4di){ ~0, ~0, ~0, ~0 }; // return (__m256i) __builtin_ia32_gatherdiv4di (__src, // __base, // (__v4di)__index, // __mask, // __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i64gather_epi64 (__m256i __src, long long int const *__base, // __m256i __index, __m256i __mask, // const int __scale) // { // return (__m256i) __builtin_ia32_gatherdiv4di ((__v4di)__src, // __base, // (__v4di)__index, // (__v4di)__mask, // __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i32gather_epi32 (int const *__base, __m128i __index, const int __scale) // { // __v4si __src = __extension__ (__v4si){ 0, 0, 0, 0 }; // __v4si __mask = __extension__ (__v4si){ ~0, ~0, ~0, ~0 }; // return (__m128i) __builtin_ia32_gathersiv4si (__src, // __base, // (__v4si)__index, // __mask, // __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i32gather_epi32 (__m128i __src, int const *__base, __m128i __index, // __m128i __mask, const int __scale) // { // return (__m128i) __builtin_ia32_gathersiv4si ((__v4si)__src, // __base, // (__v4si)__index, // (__v4si)__mask, // __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i32gather_epi32 (int const *__base, __m256i __index, const int __scale) // { // __v8si __src = __extension__ (__v8si){ 0, 0, 0, 0, 0, 0, 0, 0 }; // __v8si __mask = __extension__ (__v8si){ ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0 }; // return (__m256i) __builtin_ia32_gathersiv8si (__src, // __base, // (__v8si)__index, // __mask, // __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i32gather_epi32 (__m256i __src, int const *__base, // __m256i __index, __m256i __mask, // const int __scale) // { // return (__m256i) __builtin_ia32_gathersiv8si ((__v8si)__src, // __base, // (__v8si)__index, // (__v8si)__mask, // __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i64gather_epi32 (int const *__base, __m128i __index, const int __scale) // { // __v4si __src = __extension__ (__v4si){ 0, 0, 0, 0 }; // __v4si __mask = __extension__ (__v4si){ ~0, ~0, ~0, ~0 }; // return (__m128i) __builtin_ia32_gatherdiv4si (__src, // __base, // (__v2di)__index, // __mask, // __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i64gather_epi32 (__m128i __src, int const *__base, __m128i __index, // __m128i __mask, const int __scale) // { // return (__m128i) __builtin_ia32_gatherdiv4si ((__v4si)__src, // __base, // (__v2di)__index, // (__v4si)__mask, // __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i64gather_epi32 (int const *__base, __m256i __index, const int __scale) // { // __v4si __src = __extension__ (__v4si){ 0, 0, 0, 0 }; // __v4si __mask = __extension__ (__v4si){ ~0, ~0, ~0, ~0 }; // return (__m128i) __builtin_ia32_gatherdiv4si256 (__src, // __base, // (__v4di)__index, // __mask, // __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i64gather_epi32 (__m128i __src, int const *__base, // __m256i __index, __m128i __mask, // const int __scale) // { // return (__m128i) __builtin_ia32_gatherdiv4si256 ((__v4si)__src, // __base, // (__v4di)__index, // (__v4si)__mask, // __scale); // } // #else /* __OPTIMIZE__ */ // #define _mm_i32gather_pd(BASE, INDEX, SCALE) \ // (__m128d) __builtin_ia32_gathersiv2df ((__v2df) _mm_setzero_pd (), \ // (double const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v2df) \ // _mm_cmpeq_pd (_mm_setzero_pd (),\ // _mm_setzero_pd ()),\ // (int) (SCALE)) // #define _mm_mask_i32gather_pd(SRC, BASE, INDEX, MASK, SCALE) \ // (__m128d) __builtin_ia32_gathersiv2df ((__v2df)(__m128d) (SRC), \ // (double const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v2df)(__m128d) (MASK), \ // (int) (SCALE)) // #define _mm256_i32gather_pd(BASE, INDEX, SCALE) \ // (__m256d) __builtin_ia32_gathersiv4df ((__v4df) _mm256_setzero_pd (), \ // (double const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v4df) \ // _mm256_cmp_pd (_mm256_setzero_pd (),\ // _mm256_setzero_pd (),\ // _CMP_EQ_OQ), \ // (int) (SCALE)) // #define _mm256_mask_i32gather_pd(SRC, BASE, INDEX, MASK, SCALE) \ // (__m256d) __builtin_ia32_gathersiv4df ((__v4df)(__m256d) (SRC), \ // (double const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v4df)(__m256d) (MASK), \ // (int) (SCALE)) // #define _mm_i64gather_pd(BASE, INDEX, SCALE) \ // (__m128d) __builtin_ia32_gatherdiv2df ((__v2df) _mm_setzero_pd (), \ // (double const *) (BASE), \ // (__v2di)(__m128i) (INDEX), \ // (__v2df) \ // _mm_cmpeq_pd (_mm_setzero_pd (),\ // _mm_setzero_pd ()),\ // (int) (SCALE)) // #define _mm_mask_i64gather_pd(SRC, BASE, INDEX, MASK, SCALE) \ // (__m128d) __builtin_ia32_gatherdiv2df ((__v2df)(__m128d) (SRC), \ // (double const *) (BASE), \ // (__v2di)(__m128i) (INDEX), \ // (__v2df)(__m128d) (MASK), \ // (int) (SCALE)) // #define _mm256_i64gather_pd(BASE, INDEX, SCALE) \ // (__m256d) __builtin_ia32_gatherdiv4df ((__v4df) _mm256_setzero_pd (), \ // (double const *) (BASE), \ // (__v4di)(__m256i) (INDEX), \ // (__v4df) \ // _mm256_cmp_pd (_mm256_setzero_pd (),\ // _mm256_setzero_pd (),\ // _CMP_EQ_OQ), \ // (int) (SCALE)) // #define _mm256_mask_i64gather_pd(SRC, BASE, INDEX, MASK, SCALE) \ // (__m256d) __builtin_ia32_gatherdiv4df ((__v4df)(__m256d) (SRC), \ // (double const *) (BASE), \ // (__v4di)(__m256i) (INDEX), \ // (__v4df)(__m256d) (MASK), \ // (int) (SCALE)) // #define _mm_i32gather_ps(BASE, INDEX, SCALE) \ // (__m128) __builtin_ia32_gathersiv4sf ((__v4sf) _mm_setzero_ps (), \ // (float const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v4sf) \ // _mm_cmpeq_ps (_mm_setzero_ps (),\ // _mm_setzero_ps ()),\ // (int) (SCALE)) // #define _mm_mask_i32gather_ps(SRC, BASE, INDEX, MASK, SCALE) \ // (__m128) __builtin_ia32_gathersiv4sf ((__v4sf)(__m128) (SRC), \ // (float const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v4sf)(__m128) (MASK), \ // (int) (SCALE)) // #define _mm256_i32gather_ps(BASE, INDEX, SCALE) \ // (__m256) __builtin_ia32_gathersiv8sf ((__v8sf) _mm256_setzero_ps (), \ // (float const *) (BASE), \ // (__v8si)(__m256i) (INDEX), \ // (__v8sf) \ // _mm256_cmp_ps (_mm256_setzero_ps (),\ // _mm256_setzero_ps (),\ // _CMP_EQ_OQ), \ // (int) (SCALE)) // #define _mm256_mask_i32gather_ps(SRC, BASE, INDEX, MASK, SCALE) \ // (__m256) __builtin_ia32_gathersiv8sf ((__v8sf)(__m256) (SRC), \ // (float const *) (BASE), \ // (__v8si)(__m256i) (INDEX), \ // (__v8sf)(__m256) (MASK), \ // (int) (SCALE)) // #define _mm_i64gather_ps(BASE, INDEX, SCALE) \ // (__m128) __builtin_ia32_gatherdiv4sf ((__v4sf) _mm_setzero_pd (), \ // (float const *) (BASE), \ // (__v2di)(__m128i) (INDEX), \ // (__v4sf) \ // _mm_cmpeq_ps (_mm_setzero_ps (),\ // _mm_setzero_ps ()),\ // (int) (SCALE)) // #define _mm_mask_i64gather_ps(SRC, BASE, INDEX, MASK, SCALE) \ // (__m128) __builtin_ia32_gatherdiv4sf ((__v4sf)(__m128) (SRC), \ // (float const *) (BASE), \ // (__v2di)(__m128i) (INDEX), \ // (__v4sf)(__m128) (MASK), \ // (int) (SCALE)) // #define _mm256_i64gather_ps(BASE, INDEX, SCALE) \ // (__m128) __builtin_ia32_gatherdiv4sf256 ((__v4sf) _mm_setzero_ps (), \ // (float const *) (BASE), \ // (__v4di)(__m256i) (INDEX), \ // (__v4sf) \ // _mm_cmpeq_ps (_mm_setzero_ps (),\ // _mm_setzero_ps ()),\ // (int) (SCALE)) // #define _mm256_mask_i64gather_ps(SRC, BASE, INDEX, MASK, SCALE) \ // (__m128) __builtin_ia32_gatherdiv4sf256 ((__v4sf)(__m128) (SRC), \ // (float const *) (BASE), \ // (__v4di)(__m256i) (INDEX), \ // (__v4sf)(__m128) (MASK), \ // (int) (SCALE)) // #define _mm_i32gather_epi64(BASE, INDEX, SCALE) \ // (__m128i) __builtin_ia32_gathersiv2di ((__v2di) _mm_setzero_si128 (), \ // (long long const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v2di)_mm_set1_epi64x (-1), \ // (int) (SCALE)) // #define _mm_mask_i32gather_epi64(SRC, BASE, INDEX, MASK, SCALE) \ // (__m128i) __builtin_ia32_gathersiv2di ((__v2di)(__m128i) (SRC), \ // (long long const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v2di)(__m128i) (MASK), \ // (int) (SCALE)) // #define _mm256_i32gather_epi64(BASE, INDEX, SCALE) \ // (__m256i) __builtin_ia32_gathersiv4di ((__v4di) _mm256_setzero_si256 (), \ // (long long const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v4di)_mm256_set1_epi64x (-1), \ // (int) (SCALE)) // #define _mm256_mask_i32gather_epi64(SRC, BASE, INDEX, MASK, SCALE) \ // (__m256i) __builtin_ia32_gathersiv4di ((__v4di)(__m256i) (SRC), \ // (long long const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v4di)(__m256i) (MASK), \ // (int) (SCALE)) // #define _mm_i64gather_epi64(BASE, INDEX, SCALE) \ // (__m128i) __builtin_ia32_gatherdiv2di ((__v2di) _mm_setzero_si128 (), \ // (long long const *) (BASE), \ // (__v2di)(__m128i) (INDEX), \ // (__v2di)_mm_set1_epi64x (-1), \ // (int) (SCALE)) // #define _mm_mask_i64gather_epi64(SRC, BASE, INDEX, MASK, SCALE) \ // (__m128i) __builtin_ia32_gatherdiv2di ((__v2di)(__m128i) (SRC), \ // (long long const *) (BASE), \ // (__v2di)(__m128i) (INDEX), \ // (__v2di)(__m128i) (MASK), \ // (int) (SCALE)) // #define _mm256_i64gather_epi64(BASE, INDEX, SCALE) \ // (__m256i) __builtin_ia32_gatherdiv4di ((__v4di) _mm256_setzero_si256 (), \ // (long long const *) (BASE), \ // (__v4di)(__m256i) (INDEX), \ // (__v4di)_mm256_set1_epi64x (-1), \ // (int) (SCALE)) // #define _mm256_mask_i64gather_epi64(SRC, BASE, INDEX, MASK, SCALE) \ // (__m256i) __builtin_ia32_gatherdiv4di ((__v4di)(__m256i) (SRC), \ // (long long const *) (BASE), \ // (__v4di)(__m256i) (INDEX), \ // (__v4di)(__m256i) (MASK), \ // (int) (SCALE)) // #define _mm_i32gather_epi32(BASE, INDEX, SCALE) \ // (__m128i) __builtin_ia32_gathersiv4si ((__v4si) _mm_setzero_si128 (), \ // (int const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v4si)_mm_set1_epi32 (-1), \ // (int) (SCALE)) // #define _mm_mask_i32gather_epi32(SRC, BASE, INDEX, MASK, SCALE) \ // (__m128i) __builtin_ia32_gathersiv4si ((__v4si)(__m128i) (SRC), \ // (int const *) (BASE), \ // (__v4si)(__m128i) (INDEX), \ // (__v4si)(__m128i) (MASK), \ // (int) (SCALE)) // #define _mm256_i32gather_epi32(BASE, INDEX, SCALE) \ // (__m256i) __builtin_ia32_gathersiv8si ((__v8si) _mm256_setzero_si256 (), \ // (int const *) (BASE), \ // (__v8si)(__m256i) (INDEX), \ // (__v8si)_mm256_set1_epi32 (-1), \ // (int) (SCALE)) // #define _mm256_mask_i32gather_epi32(SRC, BASE, INDEX, MASK, SCALE) \ // (__m256i) __builtin_ia32_gathersiv8si ((__v8si)(__m256i) (SRC), \ // (int const *) (BASE), \ // (__v8si)(__m256i) (INDEX), \ // (__v8si)(__m256i) (MASK), \ // (int) (SCALE)) // #define _mm_i64gather_epi32(BASE, INDEX, SCALE) \ // (__m128i) __builtin_ia32_gatherdiv4si ((__v4si) _mm_setzero_si128 (), \ // (int const *) (BASE), \ // (__v2di)(__m128i) (INDEX), \ // (__v4si)_mm_set1_epi32 (-1), \ // (int) (SCALE)) // #define _mm_mask_i64gather_epi32(SRC, BASE, INDEX, MASK, SCALE) \ // (__m128i) __builtin_ia32_gatherdiv4si ((__v4si)(__m128i) (SRC), \ // (int const *) (BASE), \ // (__v2di)(__m128i) (INDEX), \ // (__v4si)(__m128i) (MASK), \ // (int) (SCALE)) // #define _mm256_i64gather_epi32(BASE, INDEX, SCALE) \ // (__m128i) __builtin_ia32_gatherdiv4si256 ((__v4si) _mm_setzero_si128 (), \ // (int const *) (BASE), \ // (__v4di)(__m256i) (INDEX), \ // (__v4si)_mm_set1_epi32(-1), \ // (int) (SCALE)) // #define _mm256_mask_i64gather_epi32(SRC, BASE, INDEX, MASK, SCALE) \ // (__m128i) __builtin_ia32_gatherdiv4si256 ((__v4si)(__m128i) (SRC), \ // (int const *) (BASE), \ // (__v4di)(__m256i) (INDEX), \ // (__v4si)(__m128i) (MASK), \ // (int) (SCALE)) // #endif /* __OPTIMIZE__ */ #ifdef __DISABLE_AVX2__ #undef __DISABLE_AVX2__ #pragma GCC pop_options #endif /* __DISABLE_AVX2__ */ #endif /* _AVX2INTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx5124fmapsintrin.h000066400000000000000000000155551517770275000203710ustar00rootroot00000000000000/* Copyright (C) 2015-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _AVX5124FMAPSINTRIN_H_INCLUDED #define _AVX5124FMAPSINTRIN_H_INCLUDED #ifndef __AVX5124FMAPS__ #pragma GCC push_options #pragma GCC target("avx5124fmaps") #define __DISABLE_AVX5124FMAPS__ #endif /* __AVX5124FMAPS__ */ // extern __inline __m512 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_4fmadd_ps (__m512 __A, __m512 __B, __m512 __C, // __m512 __D, __m512 __E, __m128 *__F) // { // return (__m512) __builtin_ia32_4fmaddps ((__v16sf) __B, // (__v16sf) __C, // (__v16sf) __D, // (__v16sf) __E, // (__v16sf) __A, // (const __v4sf *) __F); // } // extern __inline __m512 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_4fmadd_ps (__m512 __A, __mmask16 __U, __m512 __B, // __m512 __C, __m512 __D, __m512 __E, __m128 *__F) // { // return (__m512) __builtin_ia32_4fmaddps_mask ((__v16sf) __B, // (__v16sf) __C, // (__v16sf) __D, // (__v16sf) __E, // (__v16sf) __A, // (const __v4sf *) __F, // (__v16sf) __A, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_4fmadd_ps (__mmask16 __U, // __m512 __A, __m512 __B, __m512 __C, // __m512 __D, __m512 __E, __m128 *__F) // { // return (__m512) __builtin_ia32_4fmaddps_mask ((__v16sf) __B, // (__v16sf) __C, // (__v16sf) __D, // (__v16sf) __E, // (__v16sf) __A, // (const __v4sf *) __F, // (__v16sf) _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_4fmadd_ss (__m128 __A, __m128 __B, __m128 __C, // __m128 __D, __m128 __E, __m128 *__F) // { // return (__m128) __builtin_ia32_4fmaddss ((__v4sf) __B, // (__v4sf) __C, // (__v4sf) __D, // (__v4sf) __E, // (__v4sf) __A, // (const __v4sf *) __F); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_4fmadd_ss (__m128 __A, __mmask8 __U, __m128 __B, __m128 __C, // __m128 __D, __m128 __E, __m128 *__F) // { // return (__m128) __builtin_ia32_4fmaddss_mask ((__v4sf) __B, // (__v4sf) __C, // (__v4sf) __D, // (__v4sf) __E, // (__v4sf) __A, // (const __v4sf *) __F, // (__v4sf) __A, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_4fmadd_ss (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C, // __m128 __D, __m128 __E, __m128 *__F) // { // return (__m128) __builtin_ia32_4fmaddss_mask ((__v4sf) __B, // (__v4sf) __C, // (__v4sf) __D, // (__v4sf) __E, // (__v4sf) __A, // (const __v4sf *) __F, // (__v4sf) _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_4fnmadd_ps (__m512 __A, __m512 __B, __m512 __C, // __m512 __D, __m512 __E, __m128 *__F) // { // return (__m512) __builtin_ia32_4fnmaddps ((__v16sf) __B, // (__v16sf) __C, // (__v16sf) __D, // (__v16sf) __E, // (__v16sf) __A, // (const __v4sf *) __F); // } // extern __inline __m512 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_4fnmadd_ps (__m512 __A, __mmask16 __U, __m512 __B, // __m512 __C, __m512 __D, __m512 __E, __m128 *__F) // { // return (__m512) __builtin_ia32_4fnmaddps_mask ((__v16sf) __B, // (__v16sf) __C, // (__v16sf) __D, // (__v16sf) __E, // (__v16sf) __A, // (const __v4sf *) __F, // (__v16sf) __A, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_4fnmadd_ps (__mmask16 __U, // __m512 __A, __m512 __B, __m512 __C, // __m512 __D, __m512 __E, __m128 *__F) // { // return (__m512) __builtin_ia32_4fnmaddps_mask ((__v16sf) __B, // (__v16sf) __C, // (__v16sf) __D, // (__v16sf) __E, // (__v16sf) __A, // (const __v4sf *) __F, // (__v16sf) _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_4fnmadd_ss (__m128 __A, __m128 __B, __m128 __C, // __m128 __D, __m128 __E, __m128 *__F) // { // return (__m128) __builtin_ia32_4fnmaddss ((__v4sf) __B, // (__v4sf) __C, // (__v4sf) __D, // (__v4sf) __E, // (__v4sf) __A, // (const __v4sf *) __F); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_4fnmadd_ss (__m128 __A, __mmask8 __U, __m128 __B, __m128 __C, // __m128 __D, __m128 __E, __m128 *__F) // { // return (__m128) __builtin_ia32_4fnmaddss_mask ((__v4sf) __B, // (__v4sf) __C, // (__v4sf) __D, // (__v4sf) __E, // (__v4sf) __A, // (const __v4sf *) __F, // (__v4sf) __A, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_4fnmadd_ss (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C, // __m128 __D, __m128 __E, __m128 *__F) // { // return (__m128) __builtin_ia32_4fnmaddss_mask ((__v4sf) __B, // (__v4sf) __C, // (__v4sf) __D, // (__v4sf) __E, // (__v4sf) __A, // (const __v4sf *) __F, // (__v4sf) _mm_setzero_ps (), // (__mmask8) __U); // } #ifdef __DISABLE_AVX5124FMAPS__ #undef __DISABLE_AVX5124FMAPS__ #pragma GCC pop_options #endif /* __DISABLE_AVX5124FMAPS__ */ #endif /* _AVX5124FMAPSINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx5124vnniwintrin.h000066400000000000000000000106341517770275000204150ustar00rootroot00000000000000/* Copyright (C) 2015-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _AVX5124VNNIWINTRIN_H_INCLUDED #define _AVX5124VNNIWINTRIN_H_INCLUDED #ifndef __AVX5124VNNIW__ #pragma GCC push_options #pragma GCC target("avx5124vnniw") #define __DISABLE_AVX5124VNNIW__ #endif /* __AVX5124VNNIW__ */ // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_4dpwssd_epi32 (__m512i __A, __m512i __B, __m512i __C, // __m512i __D, __m512i __E, __m128i *__F) // { // return (__m512i) __builtin_ia32_vp4dpwssd ((__v16si) __B, // (__v16si) __C, // (__v16si) __D, // (__v16si) __E, // (__v16si) __A, // (const __v4si *) __F); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_4dpwssd_epi32 (__m512i __A, __mmask16 __U, __m512i __B, // __m512i __C, __m512i __D, __m512i __E, // __m128i *__F) // { // return (__m512i) __builtin_ia32_vp4dpwssd_mask ((__v16si) __B, // (__v16si) __C, // (__v16si) __D, // (__v16si) __E, // (__v16si) __A, // (const __v4si *) __F, // (__v16si) __A, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_4dpwssd_epi32 (__mmask16 __U, __m512i __A, __m512i __B, // __m512i __C, __m512i __D, __m512i __E, // __m128i *__F) // { // return (__m512i) __builtin_ia32_vp4dpwssd_mask ((__v16si) __B, // (__v16si) __C, // (__v16si) __D, // (__v16si) __E, // (__v16si) __A, // (const __v4si *) __F, // (__v16si) _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_4dpwssds_epi32 (__m512i __A, __m512i __B, __m512i __C, // __m512i __D, __m512i __E, __m128i *__F) // { // return (__m512i) __builtin_ia32_vp4dpwssds ((__v16si) __B, // (__v16si) __C, // (__v16si) __D, // (__v16si) __E, // (__v16si) __A, // (const __v4si *) __F); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_4dpwssds_epi32 (__m512i __A, __mmask16 __U, __m512i __B, // __m512i __C, __m512i __D, __m512i __E, // __m128i *__F) // { // return (__m512i) __builtin_ia32_vp4dpwssds_mask ((__v16si) __B, // (__v16si) __C, // (__v16si) __D, // (__v16si) __E, // (__v16si) __A, // (const __v4si *) __F, // (__v16si) __A, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_4dpwssds_epi32 (__mmask16 __U, __m512i __A, __m512i __B, // __m512i __C, __m512i __D, __m512i __E, // __m128i *__F) // { // return (__m512i) __builtin_ia32_vp4dpwssds_mask ((__v16si) __B, // (__v16si) __C, // (__v16si) __D, // (__v16si) __E, // (__v16si) __A, // (const __v4si *) __F, // (__v16si) _mm512_setzero_ps (), // (__mmask16) __U); // } #ifdef __DISABLE_AVX5124VNNIW__ #undef __DISABLE_AVX5124VNNIW__ #pragma GCC pop_options #endif /* __DISABLE_AVX5124VNNIW__ */ #endif /* _AVX5124VNNIWINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512bf16intrin.h000066400000000000000000000100221517770275000177150ustar00rootroot00000000000000/* Copyright (C) 2019-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512BF16INTRIN_H_INCLUDED #define _AVX512BF16INTRIN_H_INCLUDED #ifndef __AVX512BF16__ #pragma GCC push_options #pragma GCC target("avx512bf16") #define __DISABLE_AVX512BF16__ #endif /* __AVX512BF16__ */ /* Internal data types for implementing the intrinsics. */ typedef short __v32bh __attribute__ ((__vector_size__ (64))); /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef short __m512bh __attribute__ ((__vector_size__ (64), __may_alias__)); /* vcvtne2ps2bf16 */ // extern __inline __m512bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtne2ps_pbh (__m512 __A, __m512 __B) // { // return (__m512bh)__builtin_ia32_cvtne2ps2bf16_v32hi(__A, __B); // } // extern __inline __m512bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtne2ps_pbh (__m512bh __A, __mmask32 __B, __m512 __C, __m512 __D) // { // return (__m512bh)__builtin_ia32_cvtne2ps2bf16_v32hi_mask(__C, __D, __A, __B); // } // extern __inline __m512bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtne2ps_pbh (__mmask32 __A, __m512 __B, __m512 __C) // { // return (__m512bh)__builtin_ia32_cvtne2ps2bf16_v32hi_maskz(__B, __C, __A); // } // /* vcvtneps2bf16 */ // extern __inline __m256bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtneps_pbh (__m512 __A) // { // return (__m256bh)__builtin_ia32_cvtneps2bf16_v16sf(__A); // } // extern __inline __m256bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtneps_pbh (__m256bh __A, __mmask16 __B, __m512 __C) // { // return (__m256bh)__builtin_ia32_cvtneps2bf16_v16sf_mask(__C, __A, __B); // } // extern __inline __m256bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtneps_pbh (__mmask16 __A, __m512 __B) // { // return (__m256bh)__builtin_ia32_cvtneps2bf16_v16sf_maskz(__B, __A); // } // /* vdpbf16ps */ // extern __inline __m512 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_dpbf16_ps (__m512 __A, __m512bh __B, __m512bh __C) // { // return (__m512)__builtin_ia32_dpbf16ps_v16sf(__A, __B, __C); // } // extern __inline __m512 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_dpbf16_ps (__m512 __A, __mmask16 __B, __m512bh __C, __m512bh __D) // { // return (__m512)__builtin_ia32_dpbf16ps_v16sf_mask(__A, __C, __D, __B); // } // extern __inline __m512 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_dpbf16_ps (__mmask16 __A, __m512 __B, __m512bh __C, __m512bh __D) // { // return (__m512)__builtin_ia32_dpbf16ps_v16sf_maskz(__B, __C, __D, __A); // } #ifdef __DISABLE_AVX512BF16__ #undef __DISABLE_AVX512BF16__ #pragma GCC pop_options #endif /* __DISABLE_AVX512BF16__ */ #endif /* _AVX512BF16INTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512bf16vlintrin.h000066400000000000000000000145151517770275000202720ustar00rootroot00000000000000/* Copyright (C) 2019-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512BF16VLINTRIN_H_INCLUDED #define _AVX512BF16VLINTRIN_H_INCLUDED #if !defined(__AVX512VL__) || !defined(__AVX512BF16__) #pragma GCC push_options #pragma GCC target("avx512bf16,avx512vl") #define __DISABLE_AVX512BF16VL__ #endif /* __AVX512BF16__ */ /* Internal data types for implementing the intrinsics. */ typedef short __v16bh __attribute__ ((__vector_size__ (32))); typedef short __v8bh __attribute__ ((__vector_size__ (16))); /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef short __m256bh __attribute__ ((__vector_size__ (32), __may_alias__)); typedef short __m128bh __attribute__ ((__vector_size__ (16), __may_alias__)); /* vcvtne2ps2bf16 */ // extern __inline __m256bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtne2ps_pbh (__m256 __A, __m256 __B) // { // return (__m256bh)__builtin_ia32_cvtne2ps2bf16_v16hi(__A, __B); // } // extern __inline __m256bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtne2ps_pbh (__m256bh __A, __mmask16 __B, __m256 __C, __m256 __D) // { // return (__m256bh)__builtin_ia32_cvtne2ps2bf16_v16hi_mask(__C, __D, __A, __B); // } // extern __inline __m256bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtne2ps_pbh (__mmask16 __A, __m256 __B, __m256 __C) // { // return (__m256bh)__builtin_ia32_cvtne2ps2bf16_v16hi_maskz(__B, __C, __A); // } // extern __inline __m128bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtne2ps_pbh (__m128 __A, __m128 __B) // { // return (__m128bh)__builtin_ia32_cvtne2ps2bf16_v8hi(__A, __B); // } // extern __inline __m128bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtne2ps_pbh (__m128bh __A, __mmask8 __B, __m128 __C, __m128 __D) // { // return (__m128bh)__builtin_ia32_cvtne2ps2bf16_v8hi_mask(__C, __D, __A, __B); // } // extern __inline __m128bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtne2ps_pbh (__mmask8 __A, __m128 __B, __m128 __C) // { // return (__m128bh)__builtin_ia32_cvtne2ps2bf16_v8hi_maskz(__B, __C, __A); // } // /* vcvtneps2bf16 */ // extern __inline __m128bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtneps_pbh (__m256 __A) // { // return (__m128bh)__builtin_ia32_cvtneps2bf16_v8sf(__A); // } // extern __inline __m128bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtneps_pbh (__m128bh __A, __mmask8 __B, __m256 __C) // { // return (__m128bh)__builtin_ia32_cvtneps2bf16_v8sf_mask(__C, __A, __B); // } // extern __inline __m128bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtneps_pbh (__mmask8 __A, __m256 __B) // { // return (__m128bh)__builtin_ia32_cvtneps2bf16_v8sf_maskz(__B, __A); // } // extern __inline __m128bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtneps_pbh (__m128 __A) // { // return (__m128bh)__builtin_ia32_cvtneps2bf16_v4sf(__A); // } // extern __inline __m128bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtneps_pbh (__m128bh __A, __mmask8 __B, __m128 __C) // { // return (__m128bh)__builtin_ia32_cvtneps2bf16_v4sf_mask(__C, __A, __B); // } // extern __inline __m128bh // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtneps_pbh (__mmask8 __A, __m128 __B) // { // return (__m128bh)__builtin_ia32_cvtneps2bf16_v4sf_maskz(__B, __A); // } // /* vdpbf16ps */ // extern __inline __m256 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_dpbf16_ps (__m256 __A, __m256bh __B, __m256bh __C) // { // return (__m256)__builtin_ia32_dpbf16ps_v8sf(__A, __B, __C); // } // extern __inline __m256 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_dpbf16_ps (__m256 __A, __mmask8 __B, __m256bh __C, __m256bh __D) // { // return (__m256)__builtin_ia32_dpbf16ps_v8sf_mask(__A, __C, __D, __B); // } // extern __inline __m256 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_dpbf16_ps (__mmask8 __A, __m256 __B, __m256bh __C, __m256bh __D) // { // return (__m256)__builtin_ia32_dpbf16ps_v8sf_maskz(__B, __C, __D, __A); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_dpbf16_ps (__m128 __A, __m128bh __B, __m128bh __C) // { // return (__m128)__builtin_ia32_dpbf16ps_v4sf(__A, __B, __C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_dpbf16_ps (__m128 __A, __mmask8 __B, __m128bh __C, __m128bh __D) // { // return (__m128)__builtin_ia32_dpbf16ps_v4sf_mask(__A, __C, __D, __B); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_dpbf16_ps (__mmask8 __A, __m128 __B, __m128bh __C, __m128bh __D) // { // return (__m128)__builtin_ia32_dpbf16ps_v4sf_maskz(__B, __C, __D, __A); // } #ifdef __DISABLE_AVX512BF16VL__ #undef __DISABLE_AVX512BF16VL__ #pragma GCC pop_options #endif /* __DISABLE_AVX512BF16VL__ */ #endif /* _AVX512BF16VLINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512bitalgintrin.h000066400000000000000000000224211517770275000204270ustar00rootroot00000000000000/* Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _AVX512BITALGINTRIN_H_INCLUDED #define _AVX512BITALGINTRIN_H_INCLUDED #ifndef __AVX512BITALG__ #pragma GCC push_options #pragma GCC target("avx512bitalg") #define __DISABLE_AVX512BITALG__ #endif /* __AVX512BITALG__ */ // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_popcnt_epi8 (__m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountb_v64qi ((__v64qi) __A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_popcnt_epi16 (__m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountw_v32hi ((__v32hi) __A); // } // #ifdef __DISABLE_AVX512BITALG__ // #undef __DISABLE_AVX512BITALG__ // #pragma GCC pop_options // #endif /* __DISABLE_AVX512BITALG__ */ // #if !defined(__AVX512BITALG__) || !defined(__AVX512BW__) // #pragma GCC push_options // #pragma GCC target("avx512bitalg,avx512bw") // #define __DISABLE_AVX512BITALGBW__ // #endif /* __AVX512VLBW__ */ // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_popcnt_epi8 (__m512i __W, __mmask64 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountb_v64qi_mask ((__v64qi) __A, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_popcnt_epi8 (__mmask64 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountb_v64qi_mask ((__v64qi) __A, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_popcnt_epi16 (__m512i __W, __mmask32 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountw_v32hi_mask ((__v32hi) __A, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_popcnt_epi16 (__mmask32 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountw_v32hi_mask ((__v32hi) __A, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __mmask64 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_bitshuffle_epi64_mask (__m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_vpshufbitqmb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_bitshuffle_epi64_mask (__mmask64 __M, __m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_vpshufbitqmb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__mmask64) __M); // } // #ifdef __DISABLE_AVX512BITALGBW__ // #undef __DISABLE_AVX512BITALGBW__ // #pragma GCC pop_options // #endif /* __DISABLE_AVX512BITALGBW__ */ // #if !defined(__AVX512BITALG__) || !defined(__AVX512VL__) || !defined(__AVX512BW__) // #pragma GCC push_options // #pragma GCC target("avx512bitalg,avx512vl,avx512bw") // #define __DISABLE_AVX512BITALGVLBW__ // #endif /* __AVX512VLBW__ */ // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_popcnt_epi8 (__m256i __W, __mmask32 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountb_v32qi_mask ((__v32qi) __A, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_popcnt_epi8 (__mmask32 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountb_v32qi_mask ((__v32qi) __A, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __mmask32 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_bitshuffle_epi64_mask (__m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_vpshufbitqmb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_bitshuffle_epi64_mask (__mmask32 __M, __m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_vpshufbitqmb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__mmask32) __M); // } // #ifdef __DISABLE_AVX512BITALGVLBW__ // #undef __DISABLE_AVX512BITALGVLBW__ // #pragma GCC pop_options // #endif /* __DISABLE_AVX512BITALGVLBW__ */ // #if !defined(__AVX512BITALG__) || !defined(__AVX512VL__) // #pragma GCC push_options // #pragma GCC target("avx512bitalg,avx512vl") // #define __DISABLE_AVX512BITALGVL__ // #endif /* __AVX512VLBW__ */ // extern __inline __mmask16 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_bitshuffle_epi64_mask (__m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_vpshufbitqmb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_bitshuffle_epi64_mask (__mmask16 __M, __m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_vpshufbitqmb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__mmask16) __M); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_popcnt_epi8 (__m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountb_v32qi ((__v32qi) __A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_popcnt_epi16 (__m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountw_v16hi ((__v16hi) __A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_popcnt_epi8 (__m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountb_v16qi ((__v16qi) __A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_popcnt_epi16 (__m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountw_v8hi ((__v8hi) __A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_popcnt_epi16 (__m256i __W, __mmask16 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountw_v16hi_mask ((__v16hi) __A, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_popcnt_epi16 (__mmask16 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountw_v16hi_mask ((__v16hi) __A, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_popcnt_epi8 (__m128i __W, __mmask16 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountb_v16qi_mask ((__v16qi) __A, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_popcnt_epi8 (__mmask16 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountb_v16qi_mask ((__v16qi) __A, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_popcnt_epi16 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountw_v8hi_mask ((__v8hi) __A, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_popcnt_epi16 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountw_v8hi_mask ((__v8hi) __A, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } #ifdef __DISABLE_AVX512BITALGVL__ #undef __DISABLE_AVX512BITALGVL__ #pragma GCC pop_options #endif /* __DISABLE_AVX512BITALGBW__ */ #endif /* _AVX512BITALGINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512bwintrin.h000066400000000000000000003271771517770275000176150ustar00rootroot00000000000000/* Copyright (C) 2014-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512BWINTRIN_H_INCLUDED #define _AVX512BWINTRIN_H_INCLUDED #ifndef __AVX512BW__ #pragma GCC push_options #pragma GCC target("avx512bw") #define __DISABLE_AVX512BW__ #endif /* __AVX512BW__ */ /* Internal data types for implementing the intrinsics. */ typedef short __v32hi __attribute__ ((__vector_size__ (64))); typedef char __v64qi __attribute__ ((__vector_size__ (64))); typedef unsigned long long __mmask64; // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktest_mask32_u8 (__mmask32 __A, __mmask32 __B, unsigned char *__CF) // { // *__CF = (unsigned char) __builtin_ia32_ktestcsi (__A, __B); // return (unsigned char) __builtin_ia32_ktestzsi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktest_mask64_u8 (__mmask64 __A, __mmask64 __B, unsigned char *__CF) // { // *__CF = (unsigned char) __builtin_ia32_ktestcdi (__A, __B); // return (unsigned char) __builtin_ia32_ktestzdi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktestz_mask32_u8 (__mmask32 __A, __mmask32 __B) // { // return (unsigned char) __builtin_ia32_ktestzsi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktestz_mask64_u8 (__mmask64 __A, __mmask64 __B) // { // return (unsigned char) __builtin_ia32_ktestzdi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktestc_mask32_u8 (__mmask32 __A, __mmask32 __B) // { // return (unsigned char) __builtin_ia32_ktestcsi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktestc_mask64_u8 (__mmask64 __A, __mmask64 __B) // { // return (unsigned char) __builtin_ia32_ktestcdi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortest_mask32_u8 (__mmask32 __A, __mmask32 __B, unsigned char *__CF) // { // *__CF = (unsigned char) __builtin_ia32_kortestcsi (__A, __B); // return (unsigned char) __builtin_ia32_kortestzsi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortest_mask64_u8 (__mmask64 __A, __mmask64 __B, unsigned char *__CF) // { // *__CF = (unsigned char) __builtin_ia32_kortestcdi (__A, __B); // return (unsigned char) __builtin_ia32_kortestzdi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortestz_mask32_u8 (__mmask32 __A, __mmask32 __B) // { // return (unsigned char) __builtin_ia32_kortestzsi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortestz_mask64_u8 (__mmask64 __A, __mmask64 __B) // { // return (unsigned char) __builtin_ia32_kortestzdi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortestc_mask32_u8 (__mmask32 __A, __mmask32 __B) // { // return (unsigned char) __builtin_ia32_kortestcsi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortestc_mask64_u8 (__mmask64 __A, __mmask64 __B) // { // return (unsigned char) __builtin_ia32_kortestcdi (__A, __B); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kadd_mask32 (__mmask32 __A, __mmask32 __B) // { // return (__mmask32) __builtin_ia32_kaddsi ((__mmask32) __A, (__mmask32) __B); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kadd_mask64 (__mmask64 __A, __mmask64 __B) // { // return (__mmask64) __builtin_ia32_kadddi ((__mmask64) __A, (__mmask64) __B); // } // extern __inline unsigned int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _cvtmask32_u32 (__mmask32 __A) // { // return (unsigned int) __builtin_ia32_kmovd ((__mmask32) __A); // } // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _cvtmask64_u64 (__mmask64 __A) // { // return (unsigned long long) __builtin_ia32_kmovq ((__mmask64) __A); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _cvtu32_mask32 (unsigned int __A) // { // return (__mmask32) __builtin_ia32_kmovd ((__mmask32) __A); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _cvtu64_mask64 (unsigned long long __A) // { // return (__mmask64) __builtin_ia32_kmovq ((__mmask64) __A); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _load_mask32 (__mmask32 *__A) // { // return (__mmask32) __builtin_ia32_kmovd (*__A); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _load_mask64 (__mmask64 *__A) // { // return (__mmask64) __builtin_ia32_kmovq (*(__mmask64 *) __A); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _store_mask32 (__mmask32 *__A, __mmask32 __B) // { // *(__mmask32 *) __A = __builtin_ia32_kmovd (__B); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _store_mask64 (__mmask64 *__A, __mmask64 __B) // { // *(__mmask64 *) __A = __builtin_ia32_kmovq (__B); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _knot_mask32 (__mmask32 __A) // { // return (__mmask32) __builtin_ia32_knotsi ((__mmask32) __A); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _knot_mask64 (__mmask64 __A) // { // return (__mmask64) __builtin_ia32_knotdi ((__mmask64) __A); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kor_mask32 (__mmask32 __A, __mmask32 __B) // { // return (__mmask32) __builtin_ia32_korsi ((__mmask32) __A, (__mmask32) __B); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kor_mask64 (__mmask64 __A, __mmask64 __B) // { // return (__mmask64) __builtin_ia32_kordi ((__mmask64) __A, (__mmask64) __B); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kxnor_mask32 (__mmask32 __A, __mmask32 __B) // { // return (__mmask32) __builtin_ia32_kxnorsi ((__mmask32) __A, (__mmask32) __B); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kxnor_mask64 (__mmask64 __A, __mmask64 __B) // { // return (__mmask64) __builtin_ia32_kxnordi ((__mmask64) __A, (__mmask64) __B); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kxor_mask32 (__mmask32 __A, __mmask32 __B) // { // return (__mmask32) __builtin_ia32_kxorsi ((__mmask32) __A, (__mmask32) __B); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kxor_mask64 (__mmask64 __A, __mmask64 __B) // { // return (__mmask64) __builtin_ia32_kxordi ((__mmask64) __A, (__mmask64) __B); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kand_mask32 (__mmask32 __A, __mmask32 __B) // { // return (__mmask32) __builtin_ia32_kandsi ((__mmask32) __A, (__mmask32) __B); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kand_mask64 (__mmask64 __A, __mmask64 __B) // { // return (__mmask64) __builtin_ia32_kanddi ((__mmask64) __A, (__mmask64) __B); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kandn_mask32 (__mmask32 __A, __mmask32 __B) // { // return (__mmask32) __builtin_ia32_kandnsi ((__mmask32) __A, (__mmask32) __B); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kandn_mask64 (__mmask64 __A, __mmask64 __B) // { // return (__mmask64) __builtin_ia32_kandndi ((__mmask64) __A, (__mmask64) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mov_epi16 (__m512i __W, __mmask32 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_movdquhi512_mask ((__v32hi) __A, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mov_epi16 (__mmask32 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_movdquhi512_mask ((__v32hi) __A, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_loadu_epi16 (__m512i __W, __mmask32 __U, void const *__P) // { // return (__m512i) __builtin_ia32_loaddquhi512_mask ((const short *) __P, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_loadu_epi16 (__mmask32 __U, void const *__P) // { // return (__m512i) __builtin_ia32_loaddquhi512_mask ((const short *) __P, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_storeu_epi16 (void *__P, __mmask32 __U, __m512i __A) // { // __builtin_ia32_storedquhi512_mask ((short *) __P, // (__v32hi) __A, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mov_epi8 (__m512i __W, __mmask64 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_movdquqi512_mask ((__v64qi) __A, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mov_epi8 (__mmask64 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_movdquqi512_mask ((__v64qi) __A, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kunpackw (__mmask32 __A, __mmask32 __B) // { // return (__mmask32) __builtin_ia32_kunpcksi ((__mmask32) __A, // (__mmask32) __B); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kunpackw_mask32 (__mmask16 __A, __mmask16 __B) // { // return (__mmask32) __builtin_ia32_kunpcksi ((__mmask32) __A, // (__mmask32) __B); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kunpackd (__mmask64 __A, __mmask64 __B) // { // return (__mmask64) __builtin_ia32_kunpckdi ((__mmask64) __A, // (__mmask64) __B); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kunpackd_mask64 (__mmask32 __A, __mmask32 __B) // { // return (__mmask64) __builtin_ia32_kunpckdi ((__mmask64) __A, // (__mmask64) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_loadu_epi8 (__m512i __W, __mmask64 __U, void const *__P) // { // return (__m512i) __builtin_ia32_loaddquqi512_mask ((const char *) __P, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_loadu_epi8 (__mmask64 __U, void const *__P) // { // return (__m512i) __builtin_ia32_loaddquqi512_mask ((const char *) __P, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_storeu_epi8 (void *__P, __mmask64 __U, __m512i __A) // { // __builtin_ia32_storedquqi512_mask ((char *) __P, // (__v64qi) __A, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sad_epu8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psadbw512 ((__v64qi) __A, // (__v64qi) __B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi16_epi8 (__m512i __A) // { // return (__m256i) __builtin_ia32_pmovwb512_mask ((__v32hi) __A, // (__v32qi) _mm256_undefined_si256(), // (__mmask32) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi16_storeu_epi8 (void * __P, __mmask32 __M, __m512i __A) // { // __builtin_ia32_pmovwb512mem_mask ((__v32qi *) __P, (__v32hi) __A, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi16_epi8 (__m256i __O, __mmask32 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovwb512_mask ((__v32hi) __A, // (__v32qi) __O, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi16_epi8 (__mmask32 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovwb512_mask ((__v32hi) __A, // (__v32qi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtsepi16_epi8 (__m512i __A) // { // return (__m256i) __builtin_ia32_pmovswb512_mask ((__v32hi) __A, // (__v32qi)_mm256_undefined_si256(), // (__mmask32) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi16_storeu_epi8 (void * __P, __mmask32 __M, __m512i __A) // { // __builtin_ia32_pmovswb512mem_mask ((__v32qi *) __P, (__v32hi) __A, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi16_epi8 (__m256i __O, __mmask32 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovswb512_mask ((__v32hi) __A, // (__v32qi)__O, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtsepi16_epi8 (__mmask32 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovswb512_mask ((__v32hi) __A, // (__v32qi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtusepi16_epi8 (__m512i __A) // { // return (__m256i) __builtin_ia32_pmovuswb512_mask ((__v32hi) __A, // (__v32qi)_mm256_undefined_si256(), // (__mmask32) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi16_epi8 (__m256i __O, __mmask32 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovuswb512_mask ((__v32hi) __A, // (__v32qi) __O, // __M); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask32 __M, __m512i __A) // { // __builtin_ia32_pmovuswb512mem_mask ((__v32qi *) __P, (__v32hi) __A, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtusepi16_epi8 (__mmask32 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovuswb512_mask ((__v32hi) __A, // (__v32qi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcastb_epi8 (__m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastb512_mask ((__v16qi) __A, // (__v64qi)_mm512_undefined_epi32(), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcastb_epi8 (__m512i __O, __mmask64 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastb512_mask ((__v16qi) __A, // (__v64qi) __O, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcastb_epi8 (__mmask64 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastb512_mask ((__v16qi) __A, // (__v64qi) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_set1_epi8 (__m512i __O, __mmask64 __M, char __A) // { // return (__m512i) __builtin_ia32_pbroadcastb512_gpr_mask (__A, // (__v64qi) __O, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_set1_epi8 (__mmask64 __M, char __A) // { // return (__m512i) // __builtin_ia32_pbroadcastb512_gpr_mask (__A, // (__v64qi) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcastw_epi16 (__m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastw512_mask ((__v8hi) __A, // (__v32hi)_mm512_undefined_epi32(), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcastw_epi16 (__m512i __O, __mmask32 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastw512_mask ((__v8hi) __A, // (__v32hi) __O, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcastw_epi16 (__mmask32 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastw512_mask ((__v8hi) __A, // (__v32hi) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_set1_epi16 (__m512i __O, __mmask32 __M, short __A) // { // return (__m512i) __builtin_ia32_pbroadcastw512_gpr_mask (__A, // (__v32hi) __O, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_set1_epi16 (__mmask32 __M, short __A) // { // return (__m512i) // __builtin_ia32_pbroadcastw512_gpr_mask (__A, // (__v32hi) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mulhrs_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mulhrs_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mulhrs_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mulhi_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mulhi_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mulhi_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mulhi_epu16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mulhi_epu16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mulhi_epu16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mullo_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v32hu) __A * (__v32hu) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mullo_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pmullw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mullo_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmullw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi8_epi16 (__m256i __A) // { // return (__m512i) __builtin_ia32_pmovsxbw512_mask ((__v32qi) __A, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi8_epi16 (__m512i __W, __mmask32 __U, __m256i __A) // { // return (__m512i) __builtin_ia32_pmovsxbw512_mask ((__v32qi) __A, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi8_epi16 (__mmask32 __U, __m256i __A) // { // return (__m512i) __builtin_ia32_pmovsxbw512_mask ((__v32qi) __A, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepu8_epi16 (__m256i __A) // { // return (__m512i) __builtin_ia32_pmovzxbw512_mask ((__v32qi) __A, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepu8_epi16 (__m512i __W, __mmask32 __U, __m256i __A) // { // return (__m512i) __builtin_ia32_pmovzxbw512_mask ((__v32qi) __A, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepu8_epi16 (__mmask32 __U, __m256i __A) // { // return (__m512i) __builtin_ia32_pmovzxbw512_mask ((__v32qi) __A, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutexvar_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_permvarhi512_mask ((__v32hi) __B, // (__v32hi) __A, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutexvar_epi16 (__mmask32 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_permvarhi512_mask ((__v32hi) __B, // (__v32hi) __A, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutexvar_epi16 (__m512i __W, __mmask32 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_permvarhi512_mask ((__v32hi) __B, // (__v32hi) __A, // (__v32hi) __W, // (__mmask32) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutex2var_epi16 (__m512i __A, __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2varhi512_mask ((__v32hi) __I // /* idx */ , // (__v32hi) __A, // (__v32hi) __B, // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutex2var_epi16 (__m512i __A, __mmask32 __U, // __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2varhi512_mask ((__v32hi) __I // /* idx */ , // (__v32hi) __A, // (__v32hi) __B, // (__mmask32) // __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask2_permutex2var_epi16 (__m512i __A, __m512i __I, // __mmask32 __U, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermi2varhi512_mask ((__v32hi) __A, // (__v32hi) __I // /* idx */ , // (__v32hi) __B, // (__mmask32) // __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutex2var_epi16 (__mmask32 __U, __m512i __A, // __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2varhi512_maskz ((__v32hi) __I // /* idx */ , // (__v32hi) __A, // (__v32hi) __B, // (__mmask32) // __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_avg_epu8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pavgb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_avg_epu8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pavgb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_avg_epu8 (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pavgb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_add_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v64qu) __A + (__v64qu) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_add_epi8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_paddb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_add_epi8 (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sub_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v64qu) __A - (__v64qu) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sub_epi8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_psubb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sub_epi8 (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_avg_epu16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pavgw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_avg_epu16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pavgw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_avg_epu16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pavgw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_subs_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_subs_epi8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_psubsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_subs_epi8 (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_subs_epu8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubusb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_subs_epu8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_psubusb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_subs_epu8 (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubusb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_adds_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_adds_epi8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_paddsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_adds_epi8 (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_adds_epu8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddusb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_adds_epu8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_paddusb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_adds_epu8 (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddusb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sub_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v32hu) __A - (__v32hu) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sub_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_psubw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sub_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_subs_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_subs_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_psubsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_subs_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_subs_epu16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubusw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_subs_epu16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_psubusw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_subs_epu16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubusw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_add_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v32hu) __A + (__v32hu) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_add_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_paddw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_add_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_adds_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_adds_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_paddsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_adds_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_adds_epu16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddusw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_adds_epu16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_paddusw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_adds_epu16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddusw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srl_epi16 (__m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrlw512_mask ((__v32hi) __A, // (__v8hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srl_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m128i __B) // { // return (__m512i) __builtin_ia32_psrlw512_mask ((__v32hi) __A, // (__v8hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srl_epi16 (__mmask32 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrlw512_mask ((__v32hi) __A, // (__v8hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_packs_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_packsswb512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sll_epi16 (__m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psllw512_mask ((__v32hi) __A, // (__v8hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sll_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m128i __B) // { // return (__m512i) __builtin_ia32_psllw512_mask ((__v32hi) __A, // (__v8hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sll_epi16 (__mmask32 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psllw512_mask ((__v32hi) __A, // (__v8hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maddubs_epi16 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_pmaddubsw512_mask ((__v64qi) __X, // (__v64qi) __Y, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_maddubs_epi16 (__m512i __W, __mmask32 __U, __m512i __X, // __m512i __Y) // { // return (__m512i) __builtin_ia32_pmaddubsw512_mask ((__v64qi) __X, // (__v64qi) __Y, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_maddubs_epi16 (__mmask32 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_pmaddubsw512_mask ((__v64qi) __X, // (__v64qi) __Y, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_madd_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaddwd512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_madd_epi16 (__m512i __W, __mmask16 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pmaddwd512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_madd_epi16 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaddwd512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpackhi_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhbw512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpackhi_epi8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhbw512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpackhi_epi8 (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhbw512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpackhi_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhwd512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpackhi_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhwd512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpackhi_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhwd512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpacklo_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpcklbw512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpacklo_epi8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_punpcklbw512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpacklo_epi8 (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpcklbw512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpacklo_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpcklwd512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpacklo_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_punpcklwd512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpacklo_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpcklwd512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpeq_epu8_mask (__m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __A, // (__v64qi) __B, 0, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpeq_epi8_mask (__m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_pcmpeqb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpeq_epu8_mask (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __A, // (__v64qi) __B, 0, // __U); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpeq_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_pcmpeqb512_mask ((__v64qi) __A, // (__v64qi) __B, // __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpeq_epu16_mask (__m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __A, // (__v32hi) __B, 0, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpeq_epi16_mask (__m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_pcmpeqw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpeq_epu16_mask (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __A, // (__v32hi) __B, 0, // __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpeq_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_pcmpeqw512_mask ((__v32hi) __A, // (__v32hi) __B, // __U); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpgt_epu8_mask (__m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __A, // (__v64qi) __B, 6, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpgt_epi8_mask (__m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_pcmpgtb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpgt_epu8_mask (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __A, // (__v64qi) __B, 6, // __U); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpgt_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_pcmpgtb512_mask ((__v64qi) __A, // (__v64qi) __B, // __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpgt_epu16_mask (__m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __A, // (__v32hi) __B, 6, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpgt_epi16_mask (__m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_pcmpgtw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpgt_epu16_mask (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __A, // (__v32hi) __B, 6, // __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpgt_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_pcmpgtw512_mask ((__v32hi) __A, // (__v32hi) __B, // __U); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_movepi8_mask (__m512i __A) // { // return (__mmask64) __builtin_ia32_cvtb2mask512 ((__v64qi) __A); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_movepi16_mask (__m512i __A) // { // return (__mmask32) __builtin_ia32_cvtw2mask512 ((__v32hi) __A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_movm_epi8 (__mmask64 __A) // { // return (__m512i) __builtin_ia32_cvtmask2b512 (__A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_movm_epi16 (__mmask32 __A) // { // return (__m512i) __builtin_ia32_cvtmask2w512 (__A); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_test_epi8_mask (__m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_ptestmb512 ((__v64qi) __A, // (__v64qi) __B, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_test_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_ptestmb512 ((__v64qi) __A, // (__v64qi) __B, __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_test_epi16_mask (__m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_ptestmw512 ((__v32hi) __A, // (__v32hi) __B, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_test_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_ptestmw512 ((__v32hi) __A, // (__v32hi) __B, __U); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_testn_epi8_mask (__m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_ptestnmb512 ((__v64qi) __A, // (__v64qi) __B, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_testn_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__mmask64) __builtin_ia32_ptestnmb512 ((__v64qi) __A, // (__v64qi) __B, __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_testn_epi16_mask (__m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_ptestnmw512 ((__v32hi) __A, // (__v32hi) __B, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_testn_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__mmask32) __builtin_ia32_ptestnmw512 ((__v32hi) __A, // (__v32hi) __B, __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shuffle_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pshufb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shuffle_epi8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pshufb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shuffle_epi8 (__mmask64 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pshufb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_epu16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminuw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_epu16 (__mmask32 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminuw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_epu16 (__m512i __W, __mmask32 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pminuw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_epi16 (__mmask32 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_epi16 (__m512i __W, __mmask32 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pminsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_epu8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxub512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_epu8 (__mmask64 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxub512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_epu8 (__m512i __W, __mmask64 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxub512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_epi8 (__mmask64 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_epi8 (__m512i __W, __mmask64 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_epu8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminub512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_epu8 (__mmask64 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminub512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_epu8 (__m512i __W, __mmask64 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pminub512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_epi8 (__mmask64 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_epi8 (__m512i __W, __mmask64 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pminsb512_mask ((__v64qi) __A, // (__v64qi) __B, // (__v64qi) __W, // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_epi16 (__mmask32 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_epi16 (__m512i __W, __mmask32 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_epu16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxuw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_epu16 (__mmask32 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxuw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_epu16 (__m512i __W, __mmask32 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxuw512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sra_epi16 (__m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psraw512_mask ((__v32hi) __A, // (__v8hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sra_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m128i __B) // { // return (__m512i) __builtin_ia32_psraw512_mask ((__v32hi) __A, // (__v8hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sra_epi16 (__mmask32 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psraw512_mask ((__v32hi) __A, // (__v8hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srav_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psrav32hi_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srav_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_psrav32hi_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srav_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psrav32hi_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srlv_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psrlv32hi_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srlv_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_psrlv32hi_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srlv_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psrlv32hi_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sllv_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psllv32hi_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sllv_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_psllv32hi_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sllv_epi16 (__mmask32 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psllv32hi_mask ((__v32hi) __A, // (__v32hi) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_packs_epi16 (__m512i __W, __mmask64 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_packsswb512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v64qi) __W, // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_packs_epi16 (__mmask64 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_packsswb512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v64qi) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_packus_epi16 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_packuswb512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_packus_epi16 (__m512i __W, __mmask64 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_packuswb512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v64qi) __W, // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_packus_epi16 (__mmask64 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_packuswb512_mask ((__v32hi) __A, // (__v32hi) __B, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_abs_epi8 (__m512i __A) // { // return (__m512i) __builtin_ia32_pabsb512_mask ((__v64qi) __A, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_abs_epi8 (__m512i __W, __mmask64 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_pabsb512_mask ((__v64qi) __A, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_abs_epi8 (__mmask64 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_pabsb512_mask ((__v64qi) __A, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_abs_epi16 (__m512i __A) // { // return (__m512i) __builtin_ia32_pabsw512_mask ((__v32hi) __A, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_abs_epi16 (__m512i __W, __mmask32 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_pabsw512_mask ((__v32hi) __A, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_abs_epi16 (__mmask32 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_pabsw512_mask ((__v32hi) __A, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpneq_epu8_mask (__mmask64 __M, __m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 4, // (__mmask64) __M); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmplt_epu8_mask (__mmask64 __M, __m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 1, // (__mmask64) __M); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpge_epu8_mask (__mmask64 __M, __m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 5, // (__mmask64) __M); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmple_epu8_mask (__mmask64 __M, __m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 2, // (__mmask64) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpneq_epu16_mask (__mmask32 __M, __m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 4, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmplt_epu16_mask (__mmask32 __M, __m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 1, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpge_epu16_mask (__mmask32 __M, __m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 5, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmple_epu16_mask (__mmask32 __M, __m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 2, // (__mmask32) __M); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpneq_epi8_mask (__mmask64 __M, __m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 4, // (__mmask64) __M); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmplt_epi8_mask (__mmask64 __M, __m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 1, // (__mmask64) __M); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpge_epi8_mask (__mmask64 __M, __m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 5, // (__mmask64) __M); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmple_epi8_mask (__mmask64 __M, __m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 2, // (__mmask64) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpneq_epi16_mask (__mmask32 __M, __m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 4, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmplt_epi16_mask (__mmask32 __M, __m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 1, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpge_epi16_mask (__mmask32 __M, __m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 5, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmple_epi16_mask (__mmask32 __M, __m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 2, // (__mmask32) __M); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpneq_epu8_mask (__m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 4, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmplt_epu8_mask (__m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 1, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpge_epu8_mask (__m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 5, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmple_epu8_mask (__m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 2, // (__mmask64) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpneq_epu16_mask (__m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 4, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmplt_epu16_mask (__m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 1, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpge_epu16_mask (__m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 5, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmple_epu16_mask (__m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 2, // (__mmask32) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpneq_epi8_mask (__m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 4, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmplt_epi8_mask (__m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 1, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpge_epi8_mask (__m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 5, // (__mmask64) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmple_epi8_mask (__m512i __X, __m512i __Y) // { // return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, 2, // (__mmask64) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpneq_epi16_mask (__m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 4, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmplt_epi16_mask (__m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 1, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpge_epi16_mask (__m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 5, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmple_epi16_mask (__m512i __X, __m512i __Y) // { // return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, 2, // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_packs_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A, // (__v16si) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_packs_epi32 (__mmask32 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A, // (__v16si) __B, // (__v32hi) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_packs_epi32 (__m512i __W, __mmask32 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_packssdw512_mask ((__v16si) __A, // (__v16si) __B, // (__v32hi) __W, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_packus_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A, // (__v16si) __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_packus_epi32 (__mmask32 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A, // (__v16si) __B, // (__v32hi) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_packus_epi32 (__m512i __W, __mmask32 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_packusdw512_mask ((__v16si) __A, // (__v16si) __B, // (__v32hi) __W, // __M); // } // #ifdef __OPTIMIZE__ // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kshiftli_mask32 (__mmask32 __A, unsigned int __B) // { // return (__mmask32) __builtin_ia32_kshiftlisi ((__mmask32) __A, // (__mmask8) __B); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kshiftli_mask64 (__mmask64 __A, unsigned int __B) // { // return (__mmask64) __builtin_ia32_kshiftlidi ((__mmask64) __A, // (__mmask8) __B); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kshiftri_mask32 (__mmask32 __A, unsigned int __B) // { // return (__mmask32) __builtin_ia32_kshiftrisi ((__mmask32) __A, // (__mmask8) __B); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kshiftri_mask64 (__mmask64 __A, unsigned int __B) // { // return (__mmask64) __builtin_ia32_kshiftridi ((__mmask64) __A, // (__mmask8) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_alignr_epi8 (__m512i __A, __m512i __B, const int __N) // { // return (__m512i) __builtin_ia32_palignr512 ((__v8di) __A, // (__v8di) __B, __N * 8); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_alignr_epi8 (__m512i __W, __mmask64 __U, __m512i __A, // __m512i __B, const int __N) // { // return (__m512i) __builtin_ia32_palignr512_mask ((__v8di) __A, // (__v8di) __B, // __N * 8, // (__v8di) __W, // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_alignr_epi8 (__mmask64 __U, __m512i __A, __m512i __B, // const int __N) // { // return (__m512i) __builtin_ia32_palignr512_mask ((__v8di) __A, // (__v8di) __B, // __N * 8, // (__v8di) // _mm512_setzero_si512 (), // (__mmask64) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_dbsad_epu8 (__m512i __A, __m512i __B, const int __imm) // { // return (__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi) __A, // (__v64qi) __B, // __imm, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_dbsad_epu8 (__m512i __W, __mmask32 __U, __m512i __A, // __m512i __B, const int __imm) // { // return (__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi) __A, // (__v64qi) __B, // __imm, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_dbsad_epu8 (__mmask32 __U, __m512i __A, __m512i __B, // const int __imm) // { // return (__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi) __A, // (__v64qi) __B, // __imm, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srli_epi16 (__m512i __A, const int __imm) // { // return (__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi) __A, __imm, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srli_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // const int __imm) // { // return (__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi) __A, __imm, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srli_epi16 (__mmask32 __U, __m512i __A, const int __imm) // { // return (__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi) __A, __imm, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_slli_epi16 (__m512i __A, const int __B) // { // return (__m512i) __builtin_ia32_psllwi512_mask ((__v32hi) __A, __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_slli_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // const int __B) // { // return (__m512i) __builtin_ia32_psllwi512_mask ((__v32hi) __A, __B, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_slli_epi16 (__mmask32 __U, __m512i __A, const int __B) // { // return (__m512i) __builtin_ia32_psllwi512_mask ((__v32hi) __A, __B, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shufflehi_epi16 (__m512i __A, const int __imm) // { // return (__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi) __A, // __imm, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shufflehi_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // const int __imm) // { // return (__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi) __A, // __imm, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shufflehi_epi16 (__mmask32 __U, __m512i __A, // const int __imm) // { // return (__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi) __A, // __imm, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shufflelo_epi16 (__m512i __A, const int __imm) // { // return (__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi) __A, // __imm, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shufflelo_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // const int __imm) // { // return (__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi) __A, // __imm, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shufflelo_epi16 (__mmask32 __U, __m512i __A, // const int __imm) // { // return (__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi) __A, // __imm, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srai_epi16 (__m512i __A, const int __imm) // { // return (__m512i) __builtin_ia32_psrawi512_mask ((__v32hi) __A, __imm, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srai_epi16 (__m512i __W, __mmask32 __U, __m512i __A, // const int __imm) // { // return (__m512i) __builtin_ia32_psrawi512_mask ((__v32hi) __A, __imm, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srai_epi16 (__mmask32 __U, __m512i __A, const int __imm) // { // return (__m512i) __builtin_ia32_psrawi512_mask ((__v32hi) __A, __imm, // (__v32hi) // _mm512_setzero_si512 (), // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_blend_epi16 (__mmask32 __U, __m512i __A, __m512i __W) // { // return (__m512i) __builtin_ia32_blendmw_512_mask ((__v32hi) __A, // (__v32hi) __W, // (__mmask32) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_blend_epi8 (__mmask64 __U, __m512i __A, __m512i __W) // { // return (__m512i) __builtin_ia32_blendmb_512_mask ((__v64qi) __A, // (__v64qi) __W, // (__mmask64) __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_epi16_mask (__mmask32 __U, __m512i __X, __m512i __Y, // const int __P) // { // return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, __P, // (__mmask32) __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_epi16_mask (__m512i __X, __m512i __Y, const int __P) // { // return (__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, __P, // (__mmask32) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_epi8_mask (__mmask64 __U, __m512i __X, __m512i __Y, // const int __P) // { // return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, __P, // (__mmask64) __U); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_epi8_mask (__m512i __X, __m512i __Y, const int __P) // { // return (__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, __P, // (__mmask64) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_epu16_mask (__mmask32 __U, __m512i __X, __m512i __Y, // const int __P) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, __P, // (__mmask32) __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_epu16_mask (__m512i __X, __m512i __Y, const int __P) // { // return (__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi) __X, // (__v32hi) __Y, __P, // (__mmask32) -1); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_epu8_mask (__mmask64 __U, __m512i __X, __m512i __Y, // const int __P) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, __P, // (__mmask64) __U); // } // extern __inline __mmask64 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_epu8_mask (__m512i __X, __m512i __Y, const int __P) // { // return (__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi) __X, // (__v64qi) __Y, __P, // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_bslli_epi128 (__m512i __A, const int __N) // { // return (__m512i) __builtin_ia32_pslldq512 (__A, __N * 8); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_bsrli_epi128 (__m512i __A, const int __N) // { // return (__m512i) __builtin_ia32_psrldq512 (__A, __N * 8); // } // #else // #define _kshiftli_mask32(X, Y) \ // ((__mmask32) __builtin_ia32_kshiftlisi ((__mmask32)(X), (__mmask8)(Y))) // #define _kshiftli_mask64(X, Y) \ // ((__mmask64) __builtin_ia32_kshiftlidi ((__mmask64)(X), (__mmask8)(Y))) // #define _kshiftri_mask32(X, Y) \ // ((__mmask32) __builtin_ia32_kshiftrisi ((__mmask32)(X), (__mmask8)(Y))) // #define _kshiftri_mask64(X, Y) \ // ((__mmask64) __builtin_ia32_kshiftridi ((__mmask64)(X), (__mmask8)(Y))) // #define _mm512_alignr_epi8(X, Y, N) \ // ((__m512i) __builtin_ia32_palignr512 ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), \ // (int)((N) * 8))) // #define _mm512_mask_alignr_epi8(W, U, X, Y, N) \ // ((__m512i) __builtin_ia32_palignr512_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)((N) * 8), \ // (__v8di)(__m512i)(W), (__mmask64)(U))) // #define _mm512_maskz_alignr_epi8(U, X, Y, N) \ // ((__m512i) __builtin_ia32_palignr512_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)((N) * 8), \ // (__v8di)(__m512i) \ // _mm512_setzero_si512 (), \ // (__mmask64)(U))) // #define _mm512_dbsad_epu8(X, Y, C) \ // ((__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi)(__m512i) (X), \ // (__v64qi)(__m512i) (Y), (int) (C), \ // (__v32hi)(__m512i) \ // _mm512_setzero_si512 (), \ // (__mmask32)-1)) // #define _mm512_mask_dbsad_epu8(W, U, X, Y, C) \ // ((__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi)(__m512i) (X), \ // (__v64qi)(__m512i) (Y), (int) (C), \ // (__v32hi)(__m512i)(W), \ // (__mmask32)(U))) // #define _mm512_maskz_dbsad_epu8(U, X, Y, C) \ // ((__m512i) __builtin_ia32_dbpsadbw512_mask ((__v64qi)(__m512i) (X), \ // (__v64qi)(__m512i) (Y), (int) (C), \ // (__v32hi)(__m512i) \ // _mm512_setzero_si512 (), \ // (__mmask32)(U))) // #define _mm512_srli_epi16(A, B) \ // ((__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi)(__m512i)(A), \ // (int)(B), (__v32hi)_mm512_setzero_si512 (), (__mmask32)-1)) // #define _mm512_mask_srli_epi16(W, U, A, B) \ // ((__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi)(__m512i)(A), \ // (int)(B), (__v32hi)(__m512i)(W), (__mmask32)(U))) // #define _mm512_maskz_srli_epi16(U, A, B) \ // ((__m512i) __builtin_ia32_psrlwi512_mask ((__v32hi)(__m512i)(A), \ // (int)(B), (__v32hi)_mm512_setzero_si512 (), (__mmask32)(U))) // #define _mm512_slli_epi16(X, C) \ // ((__m512i)__builtin_ia32_psllwi512_mask ((__v32hi)(__m512i)(X), (int)(C),\ // (__v32hi)(__m512i)_mm512_setzero_si512 (), \ // (__mmask32)-1)) // #define _mm512_mask_slli_epi16(W, U, X, C) \ // ((__m512i)__builtin_ia32_psllwi512_mask ((__v32hi)(__m512i)(X), (int)(C),\ // (__v32hi)(__m512i)(W),\ // (__mmask32)(U))) // #define _mm512_maskz_slli_epi16(U, X, C) \ // ((__m512i)__builtin_ia32_psllwi512_mask ((__v32hi)(__m512i)(X), (int)(C),\ // (__v32hi)(__m512i)_mm512_setzero_si512 (), \ // (__mmask32)(U))) // #define _mm512_shufflehi_epi16(A, B) \ // ((__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi)(__m512i)(A), (int)(B), \ // (__v32hi)(__m512i) \ // _mm512_setzero_si512 (), \ // (__mmask32)-1)) // #define _mm512_mask_shufflehi_epi16(W, U, A, B) \ // ((__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi)(__m512i)(A), (int)(B), \ // (__v32hi)(__m512i)(W), \ // (__mmask32)(U))) // #define _mm512_maskz_shufflehi_epi16(U, A, B) \ // ((__m512i) __builtin_ia32_pshufhw512_mask ((__v32hi)(__m512i)(A), (int)(B), \ // (__v32hi)(__m512i) \ // _mm512_setzero_si512 (), \ // (__mmask32)(U))) // #define _mm512_shufflelo_epi16(A, B) \ // ((__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi)(__m512i)(A), (int)(B), \ // (__v32hi)(__m512i) \ // _mm512_setzero_si512 (), \ // (__mmask32)-1)) // #define _mm512_mask_shufflelo_epi16(W, U, A, B) \ // ((__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi)(__m512i)(A), (int)(B), \ // (__v32hi)(__m512i)(W), \ // (__mmask32)(U))) // #define _mm512_maskz_shufflelo_epi16(U, A, B) \ // ((__m512i) __builtin_ia32_pshuflw512_mask ((__v32hi)(__m512i)(A), (int)(B), \ // (__v32hi)(__m512i) \ // _mm512_setzero_si512 (), \ // (__mmask32)(U))) // #define _mm512_srai_epi16(A, B) \ // ((__m512i) __builtin_ia32_psrawi512_mask ((__v32hi)(__m512i)(A), \ // (int)(B), (__v32hi)_mm512_setzero_si512 (), (__mmask32)-1)) // #define _mm512_mask_srai_epi16(W, U, A, B) \ // ((__m512i) __builtin_ia32_psrawi512_mask ((__v32hi)(__m512i)(A), \ // (int)(B), (__v32hi)(__m512i)(W), (__mmask32)(U))) // #define _mm512_maskz_srai_epi16(U, A, B) \ // ((__m512i) __builtin_ia32_psrawi512_mask ((__v32hi)(__m512i)(A), \ // (int)(B), (__v32hi)_mm512_setzero_si512 (), (__mmask32)(U))) // #define _mm512_mask_blend_epi16(__U, __A, __W) \ // ((__m512i) __builtin_ia32_blendmw_512_mask ((__v32hi) (__A), \ // (__v32hi) (__W), \ // (__mmask32) (__U))) // #define _mm512_mask_blend_epi8(__U, __A, __W) \ // ((__m512i) __builtin_ia32_blendmb_512_mask ((__v64qi) (__A), \ // (__v64qi) (__W), \ // (__mmask64) (__U))) // #define _mm512_cmp_epi16_mask(X, Y, P) \ // ((__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi)(__m512i)(X), \ // (__v32hi)(__m512i)(Y), (int)(P),\ // (__mmask32)(-1))) // #define _mm512_cmp_epi8_mask(X, Y, P) \ // ((__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi)(__m512i)(X), \ // (__v64qi)(__m512i)(Y), (int)(P),\ // (__mmask64)(-1))) // #define _mm512_cmp_epu16_mask(X, Y, P) \ // ((__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi)(__m512i)(X), \ // (__v32hi)(__m512i)(Y), (int)(P),\ // (__mmask32)(-1))) // #define _mm512_cmp_epu8_mask(X, Y, P) \ // ((__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi)(__m512i)(X), \ // (__v64qi)(__m512i)(Y), (int)(P),\ // (__mmask64)(-1))) // #define _mm512_mask_cmp_epi16_mask(M, X, Y, P) \ // ((__mmask32) __builtin_ia32_cmpw512_mask ((__v32hi)(__m512i)(X), \ // (__v32hi)(__m512i)(Y), (int)(P),\ // (__mmask32)(M))) // #define _mm512_mask_cmp_epi8_mask(M, X, Y, P) \ // ((__mmask64) __builtin_ia32_cmpb512_mask ((__v64qi)(__m512i)(X), \ // (__v64qi)(__m512i)(Y), (int)(P),\ // (__mmask64)(M))) // #define _mm512_mask_cmp_epu16_mask(M, X, Y, P) \ // ((__mmask32) __builtin_ia32_ucmpw512_mask ((__v32hi)(__m512i)(X), \ // (__v32hi)(__m512i)(Y), (int)(P),\ // (__mmask32)(M))) // #define _mm512_mask_cmp_epu8_mask(M, X, Y, P) \ // ((__mmask64) __builtin_ia32_ucmpb512_mask ((__v64qi)(__m512i)(X), \ // (__v64qi)(__m512i)(Y), (int)(P),\ // (__mmask64)(M))) // #define _mm512_bslli_epi128(A, N) \ // ((__m512i)__builtin_ia32_pslldq512 ((__m512i)(A), (int)(N) * 8)) // #define _mm512_bsrli_epi128(A, N) \ // ((__m512i)__builtin_ia32_psrldq512 ((__m512i)(A), (int)(N) * 8)) // #endif #ifdef __DISABLE_AVX512BW__ #undef __DISABLE_AVX512BW__ #pragma GCC pop_options #endif /* __DISABLE_AVX512BW__ */ #endif /* _AVX512BWINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512cdintrin.h000066400000000000000000000140321517770275000175520ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512CDINTRIN_H_INCLUDED #define _AVX512CDINTRIN_H_INCLUDED #ifndef __AVX512CD__ #pragma GCC push_options #pragma GCC target("avx512cd") #define __DISABLE_AVX512CD__ #endif /* __AVX512CD__ */ /* Internal data types for implementing the intrinsics. */ typedef long long __v8di __attribute__ ((__vector_size__ (64))); typedef int __v16si __attribute__ ((__vector_size__ (64))); /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef long long __m512i __attribute__ ((__vector_size__ (64), __may_alias__)); typedef double __m512d __attribute__ ((__vector_size__ (64), __may_alias__)); typedef unsigned char __mmask8; typedef unsigned short __mmask16; // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_conflict_epi32 (__m512i __A) // { // return (__m512i) // __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A, // (__v16si) _mm512_setzero_si512 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_conflict_epi32 (__m512i __W, __mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_conflict_epi32 (__mmask16 __U, __m512i __A) // { // return (__m512i) // __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A, // (__v16si) _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_conflict_epi64 (__m512i __A) // { // return (__m512i) // __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A, // (__v8di) _mm512_setzero_si512 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_conflict_epi64 (__m512i __W, __mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_conflict_epi64 (__mmask8 __U, __m512i __A) // { // return (__m512i) // __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A, // (__v8di) _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_lzcnt_epi64 (__m512i __A) // { // return (__m512i) // __builtin_ia32_vplzcntq_512_mask ((__v8di) __A, // (__v8di) _mm512_setzero_si512 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_lzcnt_epi64 (__m512i __W, __mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vplzcntq_512_mask ((__v8di) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_lzcnt_epi64 (__mmask8 __U, __m512i __A) // { // return (__m512i) // __builtin_ia32_vplzcntq_512_mask ((__v8di) __A, // (__v8di) _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_lzcnt_epi32 (__m512i __A) // { // return (__m512i) // __builtin_ia32_vplzcntd_512_mask ((__v16si) __A, // (__v16si) _mm512_setzero_si512 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_lzcnt_epi32 (__m512i __W, __mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vplzcntd_512_mask ((__v16si) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_lzcnt_epi32 (__mmask16 __U, __m512i __A) // { // return (__m512i) // __builtin_ia32_vplzcntd_512_mask ((__v16si) __A, // (__v16si) _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcastmb_epi64 (__mmask8 __A) // { // return (__m512i) __builtin_ia32_broadcastmb512 (__A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcastmw_epi32 (__mmask16 __A) // { // return (__m512i) __builtin_ia32_broadcastmw512 (__A); // } #ifdef __DISABLE_AVX512CD__ #undef __DISABLE_AVX512CD__ #pragma GCC pop_options #endif /* __DISABLE_AVX512CD__ */ #endif /* _AVX512CDINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512dqintrin.h000066400000000000000000002662111517770275000176000ustar00rootroot00000000000000/* Copyright (C) 2014-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512DQINTRIN_H_INCLUDED #define _AVX512DQINTRIN_H_INCLUDED #ifndef __AVX512DQ__ #pragma GCC push_options #pragma GCC target("avx512dq") #define __DISABLE_AVX512DQ__ #endif /* __AVX512DQ__ */ // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktest_mask8_u8 (__mmask8 __A, __mmask8 __B, unsigned char *__CF) // { // *__CF = (unsigned char) __builtin_ia32_ktestcqi (__A, __B); // return (unsigned char) __builtin_ia32_ktestzqi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktestz_mask8_u8 (__mmask8 __A, __mmask8 __B) // { // return (unsigned char) __builtin_ia32_ktestzqi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktestc_mask8_u8 (__mmask8 __A, __mmask8 __B) // { // return (unsigned char) __builtin_ia32_ktestcqi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktest_mask16_u8 (__mmask16 __A, __mmask16 __B, unsigned char *__CF) // { // *__CF = (unsigned char) __builtin_ia32_ktestchi (__A, __B); // return (unsigned char) __builtin_ia32_ktestzhi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktestz_mask16_u8 (__mmask16 __A, __mmask16 __B) // { // return (unsigned char) __builtin_ia32_ktestzhi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _ktestc_mask16_u8 (__mmask16 __A, __mmask16 __B) // { // return (unsigned char) __builtin_ia32_ktestchi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortest_mask8_u8 (__mmask8 __A, __mmask8 __B, unsigned char *__CF) // { // *__CF = (unsigned char) __builtin_ia32_kortestcqi (__A, __B); // return (unsigned char) __builtin_ia32_kortestzqi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortestz_mask8_u8 (__mmask8 __A, __mmask8 __B) // { // return (unsigned char) __builtin_ia32_kortestzqi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortestc_mask8_u8 (__mmask8 __A, __mmask8 __B) // { // return (unsigned char) __builtin_ia32_kortestcqi (__A, __B); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kadd_mask8 (__mmask8 __A, __mmask8 __B) // { // return (__mmask8) __builtin_ia32_kaddqi ((__mmask8) __A, (__mmask8) __B); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kadd_mask16 (__mmask16 __A, __mmask16 __B) // { // return (__mmask16) __builtin_ia32_kaddhi ((__mmask16) __A, (__mmask16) __B); // } // extern __inline unsigned int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _cvtmask8_u32 (__mmask8 __A) // { // return (unsigned int) __builtin_ia32_kmovb ((__mmask8 ) __A); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _cvtu32_mask8 (unsigned int __A) // { // return (__mmask8) __builtin_ia32_kmovb ((__mmask8) __A); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _load_mask8 (__mmask8 *__A) // { // return (__mmask8) __builtin_ia32_kmovb (*(__mmask8 *) __A); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _store_mask8 (__mmask8 *__A, __mmask8 __B) // { // *(__mmask8 *) __A = __builtin_ia32_kmovb (__B); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _knot_mask8 (__mmask8 __A) // { // return (__mmask8) __builtin_ia32_knotqi ((__mmask8) __A); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kor_mask8 (__mmask8 __A, __mmask8 __B) // { // return (__mmask8) __builtin_ia32_korqi ((__mmask8) __A, (__mmask8) __B); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kxnor_mask8 (__mmask8 __A, __mmask8 __B) // { // return (__mmask8) __builtin_ia32_kxnorqi ((__mmask8) __A, (__mmask8) __B); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kxor_mask8 (__mmask8 __A, __mmask8 __B) // { // return (__mmask8) __builtin_ia32_kxorqi ((__mmask8) __A, (__mmask8) __B); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kand_mask8 (__mmask8 __A, __mmask8 __B) // { // return (__mmask8) __builtin_ia32_kandqi ((__mmask8) __A, (__mmask8) __B); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kandn_mask8 (__mmask8 __A, __mmask8 __B) // { // return (__mmask8) __builtin_ia32_kandnqi ((__mmask8) __A, (__mmask8) __B); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcast_f64x2 (__m128d __A) // { // return (__m512d) // __builtin_ia32_broadcastf64x2_512_mask ((__v2df) __A, // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcast_f64x2 (__m512d __O, __mmask8 __M, __m128d __A) // { // return (__m512d) __builtin_ia32_broadcastf64x2_512_mask ((__v2df) // __A, // (__v8df) // __O, __M); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcast_f64x2 (__mmask8 __M, __m128d __A) // { // return (__m512d) __builtin_ia32_broadcastf64x2_512_mask ((__v2df) // __A, // (__v8df) // _mm512_setzero_ps (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcast_i64x2 (__m128i __A) // { // return (__m512i) // __builtin_ia32_broadcasti64x2_512_mask ((__v2di) __A, // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcast_i64x2 (__m512i __O, __mmask8 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_broadcasti64x2_512_mask ((__v2di) // __A, // (__v8di) // __O, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcast_i64x2 (__mmask8 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_broadcasti64x2_512_mask ((__v2di) // __A, // (__v8di) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcast_f32x2 (__m128 __A) // { // return (__m512) // __builtin_ia32_broadcastf32x2_512_mask ((__v4sf) __A, // (__v16sf)_mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcast_f32x2 (__m512 __O, __mmask16 __M, __m128 __A) // { // return (__m512) __builtin_ia32_broadcastf32x2_512_mask ((__v4sf) __A, // (__v16sf) // __O, __M); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcast_f32x2 (__mmask16 __M, __m128 __A) // { // return (__m512) __builtin_ia32_broadcastf32x2_512_mask ((__v4sf) __A, // (__v16sf) // _mm512_setzero_ps (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcast_i32x2 (__m128i __A) // { // return (__m512i) // __builtin_ia32_broadcasti32x2_512_mask ((__v4si) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcast_i32x2 (__m512i __O, __mmask16 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_broadcasti32x2_512_mask ((__v4si) // __A, // (__v16si) // __O, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcast_i32x2 (__mmask16 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_broadcasti32x2_512_mask ((__v4si) // __A, // (__v16si) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcast_f32x8 (__m256 __A) // { // return (__m512) // __builtin_ia32_broadcastf32x8_512_mask ((__v8sf) __A, // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcast_f32x8 (__m512 __O, __mmask16 __M, __m256 __A) // { // return (__m512) __builtin_ia32_broadcastf32x8_512_mask ((__v8sf) __A, // (__v16sf)__O, // __M); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcast_f32x8 (__mmask16 __M, __m256 __A) // { // return (__m512) __builtin_ia32_broadcastf32x8_512_mask ((__v8sf) __A, // (__v16sf) // _mm512_setzero_ps (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcast_i32x8 (__m256i __A) // { // return (__m512i) // __builtin_ia32_broadcasti32x8_512_mask ((__v8si) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcast_i32x8 (__m512i __O, __mmask16 __M, __m256i __A) // { // return (__m512i) __builtin_ia32_broadcasti32x8_512_mask ((__v8si) // __A, // (__v16si)__O, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcast_i32x8 (__mmask16 __M, __m256i __A) // { // return (__m512i) __builtin_ia32_broadcasti32x8_512_mask ((__v8si) // __A, // (__v16si) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mullo_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v8du) __A * (__v8du) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mullo_epi64 (__m512i __W, __mmask8 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_pmullq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mullo_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmullq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_xor_pd (__m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_xorpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_xor_pd (__m512d __W, __mmask8 __U, __m512d __A, // __m512d __B) // { // return (__m512d) __builtin_ia32_xorpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_xor_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_xorpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_xor_ps (__m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_xorps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_xor_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_xorps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_xor_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_xorps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_or_pd (__m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_orpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_or_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_orpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_or_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_orpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_or_ps (__m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_orps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_or_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_orps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_or_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_orps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_and_pd (__m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_andpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_and_pd (__m512d __W, __mmask8 __U, __m512d __A, // __m512d __B) // { // return (__m512d) __builtin_ia32_andpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_and_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_andpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_and_ps (__m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_andps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_and_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_andps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_and_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_andps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_andnot_pd (__m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_andnpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_andnot_pd (__m512d __W, __mmask8 __U, __m512d __A, // __m512d __B) // { // return (__m512d) __builtin_ia32_andnpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_andnot_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_andnpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_andnot_ps (__m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_andnps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_andnot_ps (__m512 __W, __mmask16 __U, __m512 __A, // __m512 __B) // { // return (__m512) __builtin_ia32_andnps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_andnot_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_andnps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_movepi32_mask (__m512i __A) // { // return (__mmask16) __builtin_ia32_cvtd2mask512 ((__v16si) __A); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_movepi64_mask (__m512i __A) // { // return (__mmask8) __builtin_ia32_cvtq2mask512 ((__v8di) __A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_movm_epi32 (__mmask16 __A) // { // return (__m512i) __builtin_ia32_cvtmask2d512 (__A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_movm_epi64 (__mmask8 __A) // { // return (__m512i) __builtin_ia32_cvtmask2q512 (__A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvttpd_epi64 (__m512d __A) // { // return (__m512i) __builtin_ia32_cvttpd2qq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvttpd_epi64 (__m512i __W, __mmask8 __U, __m512d __A) // { // return (__m512i) __builtin_ia32_cvttpd2qq512_mask ((__v8df) __A, // (__v8di) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvttpd_epi64 (__mmask8 __U, __m512d __A) // { // return (__m512i) __builtin_ia32_cvttpd2qq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvttpd_epu64 (__m512d __A) // { // return (__m512i) __builtin_ia32_cvttpd2uqq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvttpd_epu64 (__m512i __W, __mmask8 __U, __m512d __A) // { // return (__m512i) __builtin_ia32_cvttpd2uqq512_mask ((__v8df) __A, // (__v8di) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvttpd_epu64 (__mmask8 __U, __m512d __A) // { // return (__m512i) __builtin_ia32_cvttpd2uqq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvttps_epi64 (__m256 __A) // { // return (__m512i) __builtin_ia32_cvttps2qq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvttps_epi64 (__m512i __W, __mmask8 __U, __m256 __A) // { // return (__m512i) __builtin_ia32_cvttps2qq512_mask ((__v8sf) __A, // (__v8di) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvttps_epi64 (__mmask8 __U, __m256 __A) // { // return (__m512i) __builtin_ia32_cvttps2qq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvttps_epu64 (__m256 __A) // { // return (__m512i) __builtin_ia32_cvttps2uqq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvttps_epu64 (__m512i __W, __mmask8 __U, __m256 __A) // { // return (__m512i) __builtin_ia32_cvttps2uqq512_mask ((__v8sf) __A, // (__v8di) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvttps_epu64 (__mmask8 __U, __m256 __A) // { // return (__m512i) __builtin_ia32_cvttps2uqq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtpd_epi64 (__m512d __A) // { // return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtpd_epi64 (__m512i __W, __mmask8 __U, __m512d __A) // { // return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A, // (__v8di) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtpd_epi64 (__mmask8 __U, __m512d __A) // { // return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtpd_epu64 (__m512d __A) // { // return (__m512i) __builtin_ia32_cvtpd2uqq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtpd_epu64 (__m512i __W, __mmask8 __U, __m512d __A) // { // return (__m512i) __builtin_ia32_cvtpd2uqq512_mask ((__v8df) __A, // (__v8di) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtpd_epu64 (__mmask8 __U, __m512d __A) // { // return (__m512i) __builtin_ia32_cvtpd2uqq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtps_epi64 (__m256 __A) // { // return (__m512i) __builtin_ia32_cvtps2qq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtps_epi64 (__m512i __W, __mmask8 __U, __m256 __A) // { // return (__m512i) __builtin_ia32_cvtps2qq512_mask ((__v8sf) __A, // (__v8di) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtps_epi64 (__mmask8 __U, __m256 __A) // { // return (__m512i) __builtin_ia32_cvtps2qq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtps_epu64 (__m256 __A) // { // return (__m512i) __builtin_ia32_cvtps2uqq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtps_epu64 (__m512i __W, __mmask8 __U, __m256 __A) // { // return (__m512i) __builtin_ia32_cvtps2uqq512_mask ((__v8sf) __A, // (__v8di) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtps_epu64 (__mmask8 __U, __m256 __A) // { // return (__m512i) __builtin_ia32_cvtps2uqq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi64_ps (__m512i __A) // { // return (__m256) __builtin_ia32_cvtqq2ps512_mask ((__v8di) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi64_ps (__m256 __W, __mmask8 __U, __m512i __A) // { // return (__m256) __builtin_ia32_cvtqq2ps512_mask ((__v8di) __A, // (__v8sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi64_ps (__mmask8 __U, __m512i __A) // { // return (__m256) __builtin_ia32_cvtqq2ps512_mask ((__v8di) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepu64_ps (__m512i __A) // { // return (__m256) __builtin_ia32_cvtuqq2ps512_mask ((__v8di) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepu64_ps (__m256 __W, __mmask8 __U, __m512i __A) // { // return (__m256) __builtin_ia32_cvtuqq2ps512_mask ((__v8di) __A, // (__v8sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepu64_ps (__mmask8 __U, __m512i __A) // { // return (__m256) __builtin_ia32_cvtuqq2ps512_mask ((__v8di) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi64_pd (__m512i __A) // { // return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi64_pd (__m512d __W, __mmask8 __U, __m512i __A) // { // return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi64_pd (__mmask8 __U, __m512i __A) // { // return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepu64_pd (__m512i __A) // { // return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepu64_pd (__m512d __W, __mmask8 __U, __m512i __A) // { // return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepu64_pd (__mmask8 __U, __m512i __A) // { // return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // #ifdef __OPTIMIZE__ // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kshiftli_mask8 (__mmask8 __A, unsigned int __B) // { // return (__mmask8) __builtin_ia32_kshiftliqi ((__mmask8) __A, (__mmask8) __B); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kshiftri_mask8 (__mmask8 __A, unsigned int __B) // { // return (__mmask8) __builtin_ia32_kshiftriqi ((__mmask8) __A, (__mmask8) __B); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_range_pd (__m512d __A, __m512d __B, int __C) // { // return (__m512d) __builtin_ia32_rangepd512_mask ((__v8df) __A, // (__v8df) __B, __C, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_range_pd (__m512d __W, __mmask8 __U, // __m512d __A, __m512d __B, int __C) // { // return (__m512d) __builtin_ia32_rangepd512_mask ((__v8df) __A, // (__v8df) __B, __C, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_range_pd (__mmask8 __U, __m512d __A, __m512d __B, int __C) // { // return (__m512d) __builtin_ia32_rangepd512_mask ((__v8df) __A, // (__v8df) __B, __C, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_range_ps (__m512 __A, __m512 __B, int __C) // { // return (__m512) __builtin_ia32_rangeps512_mask ((__v16sf) __A, // (__v16sf) __B, __C, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_range_ps (__m512 __W, __mmask16 __U, // __m512 __A, __m512 __B, int __C) // { // return (__m512) __builtin_ia32_rangeps512_mask ((__v16sf) __A, // (__v16sf) __B, __C, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_range_ps (__mmask16 __U, __m512 __A, __m512 __B, int __C) // { // return (__m512) __builtin_ia32_rangeps512_mask ((__v16sf) __A, // (__v16sf) __B, __C, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_reduce_sd (__m128d __A, __m128d __B, int __C) // { // return (__m128d) __builtin_ia32_reducesd_mask ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_reduce_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B, int __C) // { // return (__m128d) __builtin_ia32_reducesd_mask ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_reduce_sd (__mmask8 __U, __m128d __A, __m128d __B, int __C) // { // return (__m128d) __builtin_ia32_reducesd_mask ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_reduce_ss (__m128 __A, __m128 __B, int __C) // { // return (__m128) __builtin_ia32_reducess_mask ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_reduce_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B, int __C) // { // return (__m128) __builtin_ia32_reducess_mask ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_reduce_ss (__mmask8 __U, __m128 __A, __m128 __B, int __C) // { // return (__m128) __builtin_ia32_reducess_mask ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_range_sd (__m128d __A, __m128d __B, int __C) // { // return (__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_range_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B, int __C) // { // return (__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_range_sd (__mmask8 __U, __m128d __A, __m128d __B, int __C) // { // return (__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_range_ss (__m128 __A, __m128 __B, int __C) // { // return (__m128) __builtin_ia32_rangess128_mask_round ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_range_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, int __C) // { // return (__m128) __builtin_ia32_rangess128_mask_round ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_range_ss (__mmask8 __U, __m128 __A, __m128 __B, int __C) // { // return (__m128) __builtin_ia32_rangess128_mask_round ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_range_round_sd (__m128d __A, __m128d __B, int __C, const int __R) // { // return (__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_range_round_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B, // int __C, const int __R) // { // return (__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) __W, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_range_round_sd (__mmask8 __U, __m128d __A, __m128d __B, int __C, // const int __R) // { // return (__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_range_round_ss (__m128 __A, __m128 __B, int __C, const int __R) // { // return (__m128) __builtin_ia32_rangess128_mask_round ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_range_round_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, // int __C, const int __R) // { // return (__m128) __builtin_ia32_rangess128_mask_round ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_range_round_ss (__mmask8 __U, __m128 __A, __m128 __B, int __C, // const int __R) // { // return (__m128) __builtin_ia32_rangess128_mask_round ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, __R); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fpclass_ss_mask (__m128 __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclassss_mask ((__v4sf) __A, __imm, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fpclass_sd_mask (__m128d __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclasssd_mask ((__v2df) __A, __imm, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fpclass_ss_mask (__mmask8 __U, __m128 __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclassss_mask ((__v4sf) __A, __imm, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fpclass_sd_mask (__mmask8 __U, __m128d __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclasssd_mask ((__v2df) __A, __imm, __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtt_roundpd_epi64 (__m512d __A, const int __R) // { // return (__m512i) __builtin_ia32_cvttpd2qq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtt_roundpd_epi64 (__m512i __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvttpd2qq512_mask ((__v8df) __A, // (__v8di) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtt_roundpd_epi64 (__mmask8 __U, __m512d __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvttpd2qq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtt_roundpd_epu64 (__m512d __A, const int __R) // { // return (__m512i) __builtin_ia32_cvttpd2uqq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtt_roundpd_epu64 (__m512i __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvttpd2uqq512_mask ((__v8df) __A, // (__v8di) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtt_roundpd_epu64 (__mmask8 __U, __m512d __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvttpd2uqq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtt_roundps_epi64 (__m256 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvttps2qq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtt_roundps_epi64 (__m512i __W, __mmask8 __U, __m256 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvttps2qq512_mask ((__v8sf) __A, // (__v8di) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtt_roundps_epi64 (__mmask8 __U, __m256 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvttps2qq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtt_roundps_epu64 (__m256 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvttps2uqq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtt_roundps_epu64 (__m512i __W, __mmask8 __U, __m256 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvttps2uqq512_mask ((__v8sf) __A, // (__v8di) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtt_roundps_epu64 (__mmask8 __U, __m256 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvttps2uqq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundpd_epi64 (__m512d __A, const int __R) // { // return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundpd_epi64 (__m512i __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A, // (__v8di) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundpd_epi64 (__mmask8 __U, __m512d __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundpd_epu64 (__m512d __A, const int __R) // { // return (__m512i) __builtin_ia32_cvtpd2uqq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundpd_epu64 (__m512i __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvtpd2uqq512_mask ((__v8df) __A, // (__v8di) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundpd_epu64 (__mmask8 __U, __m512d __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvtpd2uqq512_mask ((__v8df) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundps_epi64 (__m256 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvtps2qq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundps_epi64 (__m512i __W, __mmask8 __U, __m256 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvtps2qq512_mask ((__v8sf) __A, // (__v8di) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundps_epi64 (__mmask8 __U, __m256 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvtps2qq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundps_epu64 (__m256 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvtps2uqq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundps_epu64 (__m512i __W, __mmask8 __U, __m256 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvtps2uqq512_mask ((__v8sf) __A, // (__v8di) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundps_epu64 (__mmask8 __U, __m256 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvtps2uqq512_mask ((__v8sf) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U, // __R); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundepi64_ps (__m512i __A, const int __R) // { // return (__m256) __builtin_ia32_cvtqq2ps512_mask ((__v8di) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1, // __R); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundepi64_ps (__m256 __W, __mmask8 __U, __m512i __A, // const int __R) // { // return (__m256) __builtin_ia32_cvtqq2ps512_mask ((__v8di) __A, // (__v8sf) __W, // (__mmask8) __U, // __R); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundepi64_ps (__mmask8 __U, __m512i __A, // const int __R) // { // return (__m256) __builtin_ia32_cvtqq2ps512_mask ((__v8di) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U, // __R); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundepu64_ps (__m512i __A, const int __R) // { // return (__m256) __builtin_ia32_cvtuqq2ps512_mask ((__v8di) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1, // __R); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundepu64_ps (__m256 __W, __mmask8 __U, __m512i __A, // const int __R) // { // return (__m256) __builtin_ia32_cvtuqq2ps512_mask ((__v8di) __A, // (__v8sf) __W, // (__mmask8) __U, // __R); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundepu64_ps (__mmask8 __U, __m512i __A, // const int __R) // { // return (__m256) __builtin_ia32_cvtuqq2ps512_mask ((__v8di) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U, // __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundepi64_pd (__m512i __A, const int __R) // { // return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1, // __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundepi64_pd (__m512d __W, __mmask8 __U, __m512i __A, // const int __R) // { // return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, // (__v8df) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundepi64_pd (__mmask8 __U, __m512i __A, // const int __R) // { // return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundepu64_pd (__m512i __A, const int __R) // { // return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1, // __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundepu64_pd (__m512d __W, __mmask8 __U, __m512i __A, // const int __R) // { // return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, // (__v8df) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundepu64_pd (__mmask8 __U, __m512i __A, // const int __R) // { // return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_pd (__m512d __A, int __B) // { // return (__m512d) __builtin_ia32_reducepd512_mask ((__v8df) __A, __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_pd (__m512d __W, __mmask8 __U, __m512d __A, int __B) // { // return (__m512d) __builtin_ia32_reducepd512_mask ((__v8df) __A, __B, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_reduce_pd (__mmask8 __U, __m512d __A, int __B) // { // return (__m512d) __builtin_ia32_reducepd512_mask ((__v8df) __A, __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_ps (__m512 __A, int __B) // { // return (__m512) __builtin_ia32_reduceps512_mask ((__v16sf) __A, __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_ps (__m512 __W, __mmask16 __U, __m512 __A, int __B) // { // return (__m512) __builtin_ia32_reduceps512_mask ((__v16sf) __A, __B, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_reduce_ps (__mmask16 __U, __m512 __A, int __B) // { // return (__m512) __builtin_ia32_reduceps512_mask ((__v16sf) __A, __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_extractf32x8_ps (__m512 __A, const int __imm) // { // return (__m256) __builtin_ia32_extractf32x8_mask ((__v16sf) __A, // __imm, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_extractf32x8_ps (__m256 __W, __mmask8 __U, __m512 __A, // const int __imm) // { // return (__m256) __builtin_ia32_extractf32x8_mask ((__v16sf) __A, // __imm, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_extractf32x8_ps (__mmask8 __U, __m512 __A, // const int __imm) // { // return (__m256) __builtin_ia32_extractf32x8_mask ((__v16sf) __A, // __imm, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_extractf64x2_pd (__m512d __A, const int __imm) // { // return (__m128d) __builtin_ia32_extractf64x2_512_mask ((__v8df) __A, // __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_extractf64x2_pd (__m128d __W, __mmask8 __U, __m512d __A, // const int __imm) // { // return (__m128d) __builtin_ia32_extractf64x2_512_mask ((__v8df) __A, // __imm, // (__v2df) __W, // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_extractf64x2_pd (__mmask8 __U, __m512d __A, // const int __imm) // { // return (__m128d) __builtin_ia32_extractf64x2_512_mask ((__v8df) __A, // __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_extracti32x8_epi32 (__m512i __A, const int __imm) // { // return (__m256i) __builtin_ia32_extracti32x8_mask ((__v16si) __A, // __imm, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_extracti32x8_epi32 (__m256i __W, __mmask8 __U, __m512i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_extracti32x8_mask ((__v16si) __A, // __imm, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_extracti32x8_epi32 (__mmask8 __U, __m512i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_extracti32x8_mask ((__v16si) __A, // __imm, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_extracti64x2_epi64 (__m512i __A, const int __imm) // { // return (__m128i) __builtin_ia32_extracti64x2_512_mask ((__v8di) __A, // __imm, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_extracti64x2_epi64 (__m128i __W, __mmask8 __U, __m512i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_extracti64x2_512_mask ((__v8di) __A, // __imm, // (__v2di) __W, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_extracti64x2_epi64 (__mmask8 __U, __m512i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_extracti64x2_512_mask ((__v8di) __A, // __imm, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) // __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_range_round_pd (__m512d __A, __m512d __B, int __C, // const int __R) // { // return (__m512d) __builtin_ia32_rangepd512_mask ((__v8df) __A, // (__v8df) __B, __C, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1, // __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_range_round_pd (__m512d __W, __mmask8 __U, // __m512d __A, __m512d __B, int __C, // const int __R) // { // return (__m512d) __builtin_ia32_rangepd512_mask ((__v8df) __A, // (__v8df) __B, __C, // (__v8df) __W, // (__mmask8) __U, // __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_range_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // int __C, const int __R) // { // return (__m512d) __builtin_ia32_rangepd512_mask ((__v8df) __A, // (__v8df) __B, __C, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_range_round_ps (__m512 __A, __m512 __B, int __C, const int __R) // { // return (__m512) __builtin_ia32_rangeps512_mask ((__v16sf) __A, // (__v16sf) __B, __C, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) -1, // __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_range_round_ps (__m512 __W, __mmask16 __U, // __m512 __A, __m512 __B, int __C, // const int __R) // { // return (__m512) __builtin_ia32_rangeps512_mask ((__v16sf) __A, // (__v16sf) __B, __C, // (__v16sf) __W, // (__mmask16) __U, // __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_range_round_ps (__mmask16 __U, __m512 __A, __m512 __B, // int __C, const int __R) // { // return (__m512) __builtin_ia32_rangeps512_mask ((__v16sf) __A, // (__v16sf) __B, __C, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_inserti32x8 (__m512i __A, __m256i __B, const int __imm) // { // return (__m512i) __builtin_ia32_inserti32x8_mask ((__v16si) __A, // (__v8si) __B, // __imm, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_inserti32x8 (__m512i __W, __mmask16 __U, __m512i __A, // __m256i __B, const int __imm) // { // return (__m512i) __builtin_ia32_inserti32x8_mask ((__v16si) __A, // (__v8si) __B, // __imm, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_inserti32x8 (__mmask16 __U, __m512i __A, __m256i __B, // const int __imm) // { // return (__m512i) __builtin_ia32_inserti32x8_mask ((__v16si) __A, // (__v8si) __B, // __imm, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_insertf32x8 (__m512 __A, __m256 __B, const int __imm) // { // return (__m512) __builtin_ia32_insertf32x8_mask ((__v16sf) __A, // (__v8sf) __B, // __imm, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_insertf32x8 (__m512 __W, __mmask16 __U, __m512 __A, // __m256 __B, const int __imm) // { // return (__m512) __builtin_ia32_insertf32x8_mask ((__v16sf) __A, // (__v8sf) __B, // __imm, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_insertf32x8 (__mmask16 __U, __m512 __A, __m256 __B, // const int __imm) // { // return (__m512) __builtin_ia32_insertf32x8_mask ((__v16sf) __A, // (__v8sf) __B, // __imm, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_inserti64x2 (__m512i __A, __m128i __B, const int __imm) // { // return (__m512i) __builtin_ia32_inserti64x2_512_mask ((__v8di) __A, // (__v2di) __B, // __imm, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_inserti64x2 (__m512i __W, __mmask8 __U, __m512i __A, // __m128i __B, const int __imm) // { // return (__m512i) __builtin_ia32_inserti64x2_512_mask ((__v8di) __A, // (__v2di) __B, // __imm, // (__v8di) __W, // (__mmask8) // __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_inserti64x2 (__mmask8 __U, __m512i __A, __m128i __B, // const int __imm) // { // return (__m512i) __builtin_ia32_inserti64x2_512_mask ((__v8di) __A, // (__v2di) __B, // __imm, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) // __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_insertf64x2 (__m512d __A, __m128d __B, const int __imm) // { // return (__m512d) __builtin_ia32_insertf64x2_512_mask ((__v8df) __A, // (__v2df) __B, // __imm, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_insertf64x2 (__m512d __W, __mmask8 __U, __m512d __A, // __m128d __B, const int __imm) // { // return (__m512d) __builtin_ia32_insertf64x2_512_mask ((__v8df) __A, // (__v2df) __B, // __imm, // (__v8df) __W, // (__mmask8) // __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_insertf64x2 (__mmask8 __U, __m512d __A, __m128d __B, // const int __imm) // { // return (__m512d) __builtin_ia32_insertf64x2_512_mask ((__v8df) __A, // (__v2df) __B, // __imm, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) // __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fpclass_pd_mask (__mmask8 __U, __m512d __A, // const int __imm) // { // return (__mmask8) __builtin_ia32_fpclasspd512_mask ((__v8df) __A, // __imm, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fpclass_pd_mask (__m512d __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclasspd512_mask ((__v8df) __A, // __imm, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fpclass_ps_mask (__mmask16 __U, __m512 __A, // const int __imm) // { // return (__mmask16) __builtin_ia32_fpclassps512_mask ((__v16sf) __A, // __imm, __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fpclass_ps_mask (__m512 __A, const int __imm) // { // return (__mmask16) __builtin_ia32_fpclassps512_mask ((__v16sf) __A, // __imm, // (__mmask16) -1); // } // #else // #define _kshiftli_mask8(X, Y) \ // ((__mmask8) __builtin_ia32_kshiftliqi ((__mmask8)(X), (__mmask8)(Y))) // #define _kshiftri_mask8(X, Y) \ // ((__mmask8) __builtin_ia32_kshiftriqi ((__mmask8)(X), (__mmask8)(Y))) // #define _mm_range_sd(A, B, C) \ // ((__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), (__v2df) _mm_setzero_pd (), \ // (__mmask8) -1, _MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_range_sd(W, U, A, B, C) \ // ((__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), (__v2df)(__m128d)(W), \ // (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm_maskz_range_sd(U, A, B, C) \ // ((__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), (__v2df) _mm_setzero_pd (), \ // (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm_range_ss(A, B, C) \ // ((__m128) __builtin_ia32_rangess128_mask_round ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), (__v4sf) _mm_setzero_ps (), \ // (__mmask8) -1, _MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_range_ss(W, U, A, B, C) \ // ((__m128) __builtin_ia32_rangess128_mask_round ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), (__v4sf)(__m128)(W), \ // (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm_maskz_range_ss(U, A, B, C) \ // ((__m128) __builtin_ia32_rangess128_mask_round ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), (__v4sf) _mm_setzero_ps (), \ // (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm_range_round_sd(A, B, C, R) \ // ((__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), (__v2df) _mm_setzero_pd (), \ // (__mmask8) -1, (R))) // #define _mm_mask_range_round_sd(W, U, A, B, C, R) \ // ((__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), (__v2df)(__m128d)(W), \ // (__mmask8)(U), (R))) // #define _mm_maskz_range_round_sd(U, A, B, C, R) \ // ((__m128d) __builtin_ia32_rangesd128_mask_round ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), (__v2df) _mm_setzero_pd (), \ // (__mmask8)(U), (R))) // #define _mm_range_round_ss(A, B, C, R) \ // ((__m128) __builtin_ia32_rangess128_mask_round ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), (__v4sf) _mm_setzero_ps (), \ // (__mmask8) -1, (R))) // #define _mm_mask_range_round_ss(W, U, A, B, C, R) \ // ((__m128) __builtin_ia32_rangess128_mask_round ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), (__v4sf)(__m128)(W), \ // (__mmask8)(U), (R))) // #define _mm_maskz_range_round_ss(U, A, B, C, R) \ // ((__m128) __builtin_ia32_rangess128_mask_round ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), (__v4sf) _mm_setzero_ps (), \ // (__mmask8)(U), (R))) // #define _mm512_cvtt_roundpd_epi64(A, B) \ // ((__m512i)__builtin_ia32_cvttpd2qq512_mask ((A), (__v8di) \ // _mm512_setzero_si512 (), \ // -1, (B))) // #define _mm512_mask_cvtt_roundpd_epi64(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvttpd2qq512_mask ((A), (__v8di)(W), (U), (B))) // #define _mm512_maskz_cvtt_roundpd_epi64(U, A, B) \ // ((__m512i)__builtin_ia32_cvttpd2qq512_mask ((A), (__v8di)_mm512_setzero_si512 (), (U), (B))) // #define _mm512_cvtt_roundpd_epu64(A, B) \ // ((__m512i)__builtin_ia32_cvttpd2uqq512_mask ((A), (__v8di)_mm512_setzero_si512 (), -1, (B))) // #define _mm512_mask_cvtt_roundpd_epu64(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvttpd2uqq512_mask ((A), (__v8di)(W), (U), (B))) // #define _mm512_maskz_cvtt_roundpd_epu64(U, A, B) \ // ((__m512i)__builtin_ia32_cvttpd2uqq512_mask ((A), (__v8di)_mm512_setzero_si512 (), (U), (B))) // #define _mm512_cvtt_roundps_epi64(A, B) \ // ((__m512i)__builtin_ia32_cvttps2qq512_mask ((A), (__v8di)_mm512_setzero_si512 (), -1, (B))) // #define _mm512_mask_cvtt_roundps_epi64(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvttps2qq512_mask ((A), (__v8di)(W), (U), (B))) // #define _mm512_maskz_cvtt_roundps_epi64(U, A, B) \ // ((__m512i)__builtin_ia32_cvttps2qq512_mask ((A), (__v8di)_mm512_setzero_si512 (), (U), (B))) // #define _mm512_cvtt_roundps_epu64(A, B) \ // ((__m512i)__builtin_ia32_cvttps2uqq512_mask ((A), (__v8di)_mm512_setzero_si512 (), -1, (B))) // #define _mm512_mask_cvtt_roundps_epu64(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvttps2uqq512_mask ((A), (__v8di)(W), (U), (B))) // #define _mm512_maskz_cvtt_roundps_epu64(U, A, B) \ // ((__m512i)__builtin_ia32_cvttps2uqq512_mask ((A), (__v8di)_mm512_setzero_si512 (), (U), (B))) // #define _mm512_cvt_roundpd_epi64(A, B) \ // ((__m512i)__builtin_ia32_cvtpd2qq512_mask ((A), (__v8di)_mm512_setzero_si512 (), -1, (B))) // #define _mm512_mask_cvt_roundpd_epi64(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvtpd2qq512_mask ((A), (__v8di)(W), (U), (B))) // #define _mm512_maskz_cvt_roundpd_epi64(U, A, B) \ // ((__m512i)__builtin_ia32_cvtpd2qq512_mask ((A), (__v8di)_mm512_setzero_si512 (), (U), (B))) // #define _mm512_cvt_roundpd_epu64(A, B) \ // ((__m512i)__builtin_ia32_cvtpd2uqq512_mask ((A), (__v8di)_mm512_setzero_si512 (), -1, (B))) // #define _mm512_mask_cvt_roundpd_epu64(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvtpd2uqq512_mask ((A), (__v8di)(W), (U), (B))) // #define _mm512_maskz_cvt_roundpd_epu64(U, A, B) \ // ((__m512i)__builtin_ia32_cvtpd2uqq512_mask ((A), (__v8di)_mm512_setzero_si512 (), (U), (B))) // #define _mm512_cvt_roundps_epi64(A, B) \ // ((__m512i)__builtin_ia32_cvtps2qq512_mask ((A), (__v8di)_mm512_setzero_si512 (), -1, (B))) // #define _mm512_mask_cvt_roundps_epi64(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvtps2qq512_mask ((A), (__v8di)(W), (U), (B))) // #define _mm512_maskz_cvt_roundps_epi64(U, A, B) \ // ((__m512i)__builtin_ia32_cvtps2qq512_mask ((A), (__v8di)_mm512_setzero_si512 (), (U), (B))) // #define _mm512_cvt_roundps_epu64(A, B) \ // ((__m512i)__builtin_ia32_cvtps2uqq512_mask ((A), (__v8di)_mm512_setzero_si512 (), -1, (B))) // #define _mm512_mask_cvt_roundps_epu64(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvtps2uqq512_mask ((A), (__v8di)(W), (U), (B))) // #define _mm512_maskz_cvt_roundps_epu64(U, A, B) \ // ((__m512i)__builtin_ia32_cvtps2uqq512_mask ((A), (__v8di)_mm512_setzero_si512 (), (U), (B))) // #define _mm512_cvt_roundepi64_ps(A, B) \ // ((__m256)__builtin_ia32_cvtqq2ps512_mask ((__v8di)(A), (__v8sf)_mm256_setzero_ps (), -1, (B))) // #define _mm512_mask_cvt_roundepi64_ps(W, U, A, B) \ // ((__m256)__builtin_ia32_cvtqq2ps512_mask ((__v8di)(A), (W), (U), (B))) // #define _mm512_maskz_cvt_roundepi64_ps(U, A, B) \ // ((__m256)__builtin_ia32_cvtqq2ps512_mask ((__v8di)(A), (__v8sf)_mm256_setzero_ps (), (U), (B))) // #define _mm512_cvt_roundepu64_ps(A, B) \ // ((__m256)__builtin_ia32_cvtuqq2ps512_mask ((__v8di)(A), (__v8sf)_mm256_setzero_ps (), -1, (B))) // #define _mm512_mask_cvt_roundepu64_ps(W, U, A, B) \ // ((__m256)__builtin_ia32_cvtuqq2ps512_mask ((__v8di)(A), (W), (U), (B))) // #define _mm512_maskz_cvt_roundepu64_ps(U, A, B) \ // ((__m256)__builtin_ia32_cvtuqq2ps512_mask ((__v8di)(A), (__v8sf)_mm256_setzero_ps (), (U), (B))) // #define _mm512_cvt_roundepi64_pd(A, B) \ // ((__m512d)__builtin_ia32_cvtqq2pd512_mask ((__v8di)(A), (__v8df)_mm512_setzero_pd (), -1, (B))) // #define _mm512_mask_cvt_roundepi64_pd(W, U, A, B) \ // ((__m512d)__builtin_ia32_cvtqq2pd512_mask ((__v8di)(A), (W), (U), (B))) // #define _mm512_maskz_cvt_roundepi64_pd(U, A, B) \ // ((__m512d)__builtin_ia32_cvtqq2pd512_mask ((__v8di)(A), (__v8df)_mm512_setzero_pd (), (U), (B))) // #define _mm512_cvt_roundepu64_pd(A, B) \ // ((__m512d)__builtin_ia32_cvtuqq2pd512_mask ((__v8di)(A), (__v8df)_mm512_setzero_pd (), -1, (B))) // #define _mm512_mask_cvt_roundepu64_pd(W, U, A, B) \ // ((__m512d)__builtin_ia32_cvtuqq2pd512_mask ((__v8di)(A), (W), (U), (B))) // #define _mm512_maskz_cvt_roundepu64_pd(U, A, B) \ // ((__m512d)__builtin_ia32_cvtuqq2pd512_mask ((__v8di)(A), (__v8df)_mm512_setzero_pd (), (U), (B))) // #define _mm512_reduce_pd(A, B) \ // ((__m512d) __builtin_ia32_reducepd512_mask ((__v8df)(__m512d)(A), \ // (int)(B), (__v8df)_mm512_setzero_pd (), (__mmask8)-1)) // #define _mm512_mask_reduce_pd(W, U, A, B) \ // ((__m512d) __builtin_ia32_reducepd512_mask ((__v8df)(__m512d)(A), \ // (int)(B), (__v8df)(__m512d)(W), (__mmask8)(U))) // #define _mm512_maskz_reduce_pd(U, A, B) \ // ((__m512d) __builtin_ia32_reducepd512_mask ((__v8df)(__m512d)(A), \ // (int)(B), (__v8df)_mm512_setzero_pd (), (__mmask8)(U))) // #define _mm512_reduce_ps(A, B) \ // ((__m512) __builtin_ia32_reduceps512_mask ((__v16sf)(__m512)(A), \ // (int)(B), (__v16sf)_mm512_setzero_ps (), (__mmask16)-1)) // #define _mm512_mask_reduce_ps(W, U, A, B) \ // ((__m512) __builtin_ia32_reduceps512_mask ((__v16sf)(__m512)(A), \ // (int)(B), (__v16sf)(__m512)(W), (__mmask16)(U))) // #define _mm512_maskz_reduce_ps(U, A, B) \ // ((__m512) __builtin_ia32_reduceps512_mask ((__v16sf)(__m512)(A), \ // (int)(B), (__v16sf)_mm512_setzero_ps (), (__mmask16)(U))) // #define _mm512_extractf32x8_ps(X, C) \ // ((__m256) __builtin_ia32_extractf32x8_mask ((__v16sf)(__m512) (X), \ // (int) (C), (__v8sf)(__m256) _mm256_setzero_ps (), (__mmask8)-1)) // #define _mm512_mask_extractf32x8_ps(W, U, X, C) \ // ((__m256) __builtin_ia32_extractf32x8_mask ((__v16sf)(__m512) (X), \ // (int) (C), (__v8sf)(__m256) (W), (__mmask8) (U))) // #define _mm512_maskz_extractf32x8_ps(U, X, C) \ // ((__m256) __builtin_ia32_extractf32x8_mask ((__v16sf)(__m512) (X), \ // (int) (C), (__v8sf)(__m256) _mm256_setzero_ps (), (__mmask8) (U))) // #define _mm512_extractf64x2_pd(X, C) \ // ((__m128d) __builtin_ia32_extractf64x2_512_mask ((__v8df)(__m512d) (X),\ // (int) (C), (__v2df)(__m128d) _mm_setzero_pd (), (__mmask8)-1)) // #define _mm512_mask_extractf64x2_pd(W, U, X, C) \ // ((__m128d) __builtin_ia32_extractf64x2_512_mask ((__v8df)(__m512d) (X),\ // (int) (C), (__v2df)(__m128d) (W), (__mmask8) (U))) // #define _mm512_maskz_extractf64x2_pd(U, X, C) \ // ((__m128d) __builtin_ia32_extractf64x2_512_mask ((__v8df)(__m512d) (X),\ // (int) (C), (__v2df)(__m128d) _mm_setzero_pd (), (__mmask8) (U))) // #define _mm512_extracti32x8_epi32(X, C) \ // ((__m256i) __builtin_ia32_extracti32x8_mask ((__v16si)(__m512i) (X), \ // (int) (C), (__v8si)(__m256i) _mm256_setzero_si256 (), (__mmask8)-1)) // #define _mm512_mask_extracti32x8_epi32(W, U, X, C) \ // ((__m256i) __builtin_ia32_extracti32x8_mask ((__v16si)(__m512i) (X), \ // (int) (C), (__v8si)(__m256i) (W), (__mmask8) (U))) // #define _mm512_maskz_extracti32x8_epi32(U, X, C) \ // ((__m256i) __builtin_ia32_extracti32x8_mask ((__v16si)(__m512i) (X), \ // (int) (C), (__v8si)(__m256i) _mm256_setzero_si256 (), (__mmask8) (U))) // #define _mm512_extracti64x2_epi64(X, C) \ // ((__m128i) __builtin_ia32_extracti64x2_512_mask ((__v8di)(__m512i) (X),\ // (int) (C), (__v2di)(__m128i) _mm_setzero_si128 (), (__mmask8)-1)) // #define _mm512_mask_extracti64x2_epi64(W, U, X, C) \ // ((__m128i) __builtin_ia32_extracti64x2_512_mask ((__v8di)(__m512i) (X),\ // (int) (C), (__v2di)(__m128i) (W), (__mmask8) (U))) // #define _mm512_maskz_extracti64x2_epi64(U, X, C) \ // ((__m128i) __builtin_ia32_extracti64x2_512_mask ((__v8di)(__m512i) (X),\ // (int) (C), (__v2di)(__m128i) _mm_setzero_si128 (), (__mmask8) (U))) // #define _mm512_range_pd(A, B, C) \ // ((__m512d) __builtin_ia32_rangepd512_mask ((__v8df)(__m512d)(A), \ // (__v8df)(__m512d)(B), (int)(C), \ // (__v8df)_mm512_setzero_pd (), (__mmask8)-1, _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_range_pd(W, U, A, B, C) \ // ((__m512d) __builtin_ia32_rangepd512_mask ((__v8df)(__m512d)(A), \ // (__v8df)(__m512d)(B), (int)(C), \ // (__v8df)(__m512d)(W), (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_maskz_range_pd(U, A, B, C) \ // ((__m512d) __builtin_ia32_rangepd512_mask ((__v8df)(__m512d)(A), \ // (__v8df)(__m512d)(B), (int)(C), \ // (__v8df)_mm512_setzero_pd (), (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_range_ps(A, B, C) \ // ((__m512) __builtin_ia32_rangeps512_mask ((__v16sf)(__m512)(A), \ // (__v16sf)(__m512)(B), (int)(C), \ // (__v16sf)_mm512_setzero_ps (), (__mmask16)-1, _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_range_ps(W, U, A, B, C) \ // ((__m512) __builtin_ia32_rangeps512_mask ((__v16sf)(__m512)(A), \ // (__v16sf)(__m512)(B), (int)(C), \ // (__v16sf)(__m512)(W), (__mmask16)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_maskz_range_ps(U, A, B, C) \ // ((__m512) __builtin_ia32_rangeps512_mask ((__v16sf)(__m512)(A), \ // (__v16sf)(__m512)(B), (int)(C), \ // (__v16sf)_mm512_setzero_ps (), (__mmask16)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_range_round_pd(A, B, C, R) \ // ((__m512d) __builtin_ia32_rangepd512_mask ((__v8df)(__m512d)(A), \ // (__v8df)(__m512d)(B), (int)(C), \ // (__v8df)_mm512_setzero_pd (), (__mmask8)-1, (R))) // #define _mm512_mask_range_round_pd(W, U, A, B, C, R) \ // ((__m512d) __builtin_ia32_rangepd512_mask ((__v8df)(__m512d)(A), \ // (__v8df)(__m512d)(B), (int)(C), \ // (__v8df)(__m512d)(W), (__mmask8)(U), (R))) // #define _mm512_maskz_range_round_pd(U, A, B, C, R) \ // ((__m512d) __builtin_ia32_rangepd512_mask ((__v8df)(__m512d)(A), \ // (__v8df)(__m512d)(B), (int)(C), \ // (__v8df)_mm512_setzero_pd (), (__mmask8)(U), (R))) // #define _mm512_range_round_ps(A, B, C, R) \ // ((__m512) __builtin_ia32_rangeps512_mask ((__v16sf)(__m512)(A), \ // (__v16sf)(__m512)(B), (int)(C), \ // (__v16sf)_mm512_setzero_ps (), (__mmask16)-1, (R))) // #define _mm512_mask_range_round_ps(W, U, A, B, C, R) \ // ((__m512) __builtin_ia32_rangeps512_mask ((__v16sf)(__m512)(A), \ // (__v16sf)(__m512)(B), (int)(C), \ // (__v16sf)(__m512)(W), (__mmask16)(U), (R))) // #define _mm512_maskz_range_round_ps(U, A, B, C, R) \ // ((__m512) __builtin_ia32_rangeps512_mask ((__v16sf)(__m512)(A), \ // (__v16sf)(__m512)(B), (int)(C), \ // (__v16sf)_mm512_setzero_ps (), (__mmask16)(U), (R))) // #define _mm512_insertf64x2(X, Y, C) \ // ((__m512d) __builtin_ia32_insertf64x2_512_mask ((__v8df)(__m512d) (X),\ // (__v2df)(__m128d) (Y), (int) (C), (__v8df)(__m512d) (X), \ // (__mmask8)-1)) // #define _mm512_mask_insertf64x2(W, U, X, Y, C) \ // ((__m512d) __builtin_ia32_insertf64x2_512_mask ((__v8df)(__m512d) (X),\ // (__v2df)(__m128d) (Y), (int) (C), (__v8df)(__m512d) (W), \ // (__mmask8) (U))) // #define _mm512_maskz_insertf64x2(U, X, Y, C) \ // ((__m512d) __builtin_ia32_insertf64x2_512_mask ((__v8df)(__m512d) (X),\ // (__v2df)(__m128d) (Y), (int) (C), \ // (__v8df)(__m512d) _mm512_setzero_pd (), (__mmask8) (U))) // #define _mm512_inserti64x2(X, Y, C) \ // ((__m512i) __builtin_ia32_inserti64x2_512_mask ((__v8di)(__m512i) (X),\ // (__v2di)(__m128i) (Y), (int) (C), (__v8di)(__m512i) (X), (__mmask8)-1)) // #define _mm512_mask_inserti64x2(W, U, X, Y, C) \ // ((__m512i) __builtin_ia32_inserti64x2_512_mask ((__v8di)(__m512i) (X),\ // (__v2di)(__m128i) (Y), (int) (C), (__v8di)(__m512i) (W), \ // (__mmask8) (U))) // #define _mm512_maskz_inserti64x2(U, X, Y, C) \ // ((__m512i) __builtin_ia32_inserti64x2_512_mask ((__v8di)(__m512i) (X),\ // (__v2di)(__m128i) (Y), (int) (C), \ // (__v8di)(__m512i) _mm512_setzero_si512 (), (__mmask8) (U))) // #define _mm512_insertf32x8(X, Y, C) \ // ((__m512) __builtin_ia32_insertf32x8_mask ((__v16sf)(__m512) (X), \ // (__v8sf)(__m256) (Y), (int) (C),\ // (__v16sf)(__m512)_mm512_setzero_ps (),\ // (__mmask16)-1)) // #define _mm512_mask_insertf32x8(W, U, X, Y, C) \ // ((__m512) __builtin_ia32_insertf32x8_mask ((__v16sf)(__m512) (X), \ // (__v8sf)(__m256) (Y), (int) (C),\ // (__v16sf)(__m512)(W),\ // (__mmask16)(U))) // #define _mm512_maskz_insertf32x8(U, X, Y, C) \ // ((__m512) __builtin_ia32_insertf32x8_mask ((__v16sf)(__m512) (X), \ // (__v8sf)(__m256) (Y), (int) (C),\ // (__v16sf)(__m512)_mm512_setzero_ps (),\ // (__mmask16)(U))) // #define _mm512_inserti32x8(X, Y, C) \ // ((__m512i) __builtin_ia32_inserti32x8_mask ((__v16si)(__m512i) (X), \ // (__v8si)(__m256i) (Y), (int) (C),\ // (__v16si)(__m512i)_mm512_setzero_si512 (),\ // (__mmask16)-1)) // #define _mm512_mask_inserti32x8(W, U, X, Y, C) \ // ((__m512i) __builtin_ia32_inserti32x8_mask ((__v16si)(__m512i) (X), \ // (__v8si)(__m256i) (Y), (int) (C),\ // (__v16si)(__m512i)(W),\ // (__mmask16)(U))) // #define _mm512_maskz_inserti32x8(U, X, Y, C) \ // ((__m512i) __builtin_ia32_inserti32x8_mask ((__v16si)(__m512i) (X), \ // (__v8si)(__m256i) (Y), (int) (C),\ // (__v16si)(__m512i)_mm512_setzero_si512 (),\ // (__mmask16)(U))) // #define _mm_fpclass_ss_mask(X, C) \ // ((__mmask8) __builtin_ia32_fpclassss_mask ((__v4sf) (__m128) (X), \ // (int) (C), (__mmask8) (-1))) \ // #define _mm_fpclass_sd_mask(X, C) \ // ((__mmask8) __builtin_ia32_fpclasssd_mask ((__v2df) (__m128d) (X), \ // (int) (C), (__mmask8) (-1))) \ // #define _mm_mask_fpclass_ss_mask(X, C, U) \ // ((__mmask8) __builtin_ia32_fpclassss_mask ((__v4sf) (__m128) (X), \ // (int) (C), (__mmask8) (U))) // #define _mm_mask_fpclass_sd_mask(X, C, U) \ // ((__mmask8) __builtin_ia32_fpclasssd_mask ((__v2df) (__m128d) (X), \ // (int) (C), (__mmask8) (U))) // #define _mm512_mask_fpclass_pd_mask(u, X, C) \ // ((__mmask8) __builtin_ia32_fpclasspd512_mask ((__v8df) (__m512d) (X), \ // (int) (C), (__mmask8)(u))) // #define _mm512_mask_fpclass_ps_mask(u, x, c) \ // ((__mmask16) __builtin_ia32_fpclassps512_mask ((__v16sf) (__m512) (x),\ // (int) (c),(__mmask16)(u))) // #define _mm512_fpclass_pd_mask(X, C) \ // ((__mmask8) __builtin_ia32_fpclasspd512_mask ((__v8df) (__m512d) (X), \ // (int) (C), (__mmask8)-1)) // #define _mm512_fpclass_ps_mask(x, c) \ // ((__mmask16) __builtin_ia32_fpclassps512_mask ((__v16sf) (__m512) (x),\ // (int) (c),(__mmask16)-1)) // #define _mm_reduce_sd(A, B, C) \ // ((__m128d) __builtin_ia32_reducesd_mask ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), (__v2df) _mm_setzero_pd (), \ // (__mmask8)-1)) // #define _mm_mask_reduce_sd(W, U, A, B, C) \ // ((__m128d) __builtin_ia32_reducesd_mask ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), (__v2df)(__m128d)(W), (__mmask8)(U))) // #define _mm_maskz_reduce_sd(U, A, B, C) \ // ((__m128d) __builtin_ia32_reducesd_mask ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), (__v2df) _mm_setzero_pd (), \ // (__mmask8)(U))) // #define _mm_reduce_ss(A, B, C) \ // ((__m128) __builtin_ia32_reducess_mask ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), (__v4sf) _mm_setzero_ps (), \ // (__mmask8)-1)) // #define _mm_mask_reduce_ss(W, U, A, B, C) \ // ((__m128) __builtin_ia32_reducess_mask ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), (__v4sf)(__m128)(W), (__mmask8)(U))) // #define _mm_maskz_reduce_ss(U, A, B, C) \ // ((__m128) __builtin_ia32_reducess_mask ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), (__v4sf) _mm_setzero_ps (), \ // (__mmask8)(U))) // #endif #ifdef __DISABLE_AVX512DQ__ #undef __DISABLE_AVX512DQ__ #pragma GCC pop_options #endif /* __DISABLE_AVX512DQ__ */ #endif /* _AVX512DQINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512erintrin.h000066400000000000000000000312451517770275000175770ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512ERINTRIN_H_INCLUDED #define _AVX512ERINTRIN_H_INCLUDED #ifndef __AVX512ER__ #pragma GCC push_options #pragma GCC target("avx512er") #define __DISABLE_AVX512ER__ #endif /* __AVX512ER__ */ /* Internal data types for implementing the intrinsics. */ typedef double __v8df __attribute__ ((__vector_size__ (64))); typedef float __v16sf __attribute__ ((__vector_size__ (64))); /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef float __m512 __attribute__ ((__vector_size__ (64), __may_alias__)); typedef double __m512d __attribute__ ((__vector_size__ (64), __may_alias__)); typedef unsigned char __mmask8; typedef unsigned short __mmask16; #ifdef __OPTIMIZE__ extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_exp2a23_round_pd (__m512d __A, int __R) { __m512d __W; return (__m512d) __builtin_ia32_exp2pd_mask ((__v8df) __A, (__v8df) __W, (__mmask8) -1, __R); } extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_exp2a23_round_pd (__m512d __W, __mmask8 __U, __m512d __A, int __R) { return (__m512d) __builtin_ia32_exp2pd_mask ((__v8df) __A, (__v8df) __W, (__mmask8) __U, __R); } extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_maskz_exp2a23_round_pd (__mmask8 __U, __m512d __A, int __R) { return (__m512d) __builtin_ia32_exp2pd_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) __U, __R); } extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_exp2a23_round_ps (__m512 __A, int __R) { __m512 __W; return (__m512) __builtin_ia32_exp2ps_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) -1, __R); } extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_exp2a23_round_ps (__m512 __W, __mmask16 __U, __m512 __A, int __R) { return (__m512) __builtin_ia32_exp2ps_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) __U, __R); } extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_maskz_exp2a23_round_ps (__mmask16 __U, __m512 __A, int __R) { return (__m512) __builtin_ia32_exp2ps_mask ((__v16sf) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, __R); } extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_rcp28_round_pd (__m512d __A, int __R) { __m512d __W; return (__m512d) __builtin_ia32_rcp28pd_mask ((__v8df) __A, (__v8df) __W, (__mmask8) -1, __R); } extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_rcp28_round_pd (__m512d __W, __mmask8 __U, __m512d __A, int __R) { return (__m512d) __builtin_ia32_rcp28pd_mask ((__v8df) __A, (__v8df) __W, (__mmask8) __U, __R); } extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_maskz_rcp28_round_pd (__mmask8 __U, __m512d __A, int __R) { return (__m512d) __builtin_ia32_rcp28pd_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) __U, __R); } extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_rcp28_round_ps (__m512 __A, int __R) { __m512 __W; return (__m512) __builtin_ia32_rcp28ps_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) -1, __R); } extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_rcp28_round_ps (__m512 __W, __mmask16 __U, __m512 __A, int __R) { return (__m512) __builtin_ia32_rcp28ps_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) __U, __R); } extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_maskz_rcp28_round_ps (__mmask16 __U, __m512 __A, int __R) { return (__m512) __builtin_ia32_rcp28ps_mask ((__v16sf) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, __R); } extern __inline __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_rcp28_round_sd (__m128d __A, __m128d __B, int __R) { return (__m128d) __builtin_ia32_rcp28sd_round ((__v2df) __B, (__v2df) __A, __R); } extern __inline __m128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_rcp28_round_ss (__m128 __A, __m128 __B, int __R) { return (__m128) __builtin_ia32_rcp28ss_round ((__v4sf) __B, (__v4sf) __A, __R); } extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_rsqrt28_round_pd (__m512d __A, int __R) { __m512d __W; return (__m512d) __builtin_ia32_rsqrt28pd_mask ((__v8df) __A, (__v8df) __W, (__mmask8) -1, __R); } extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_rsqrt28_round_pd (__m512d __W, __mmask8 __U, __m512d __A, int __R) { return (__m512d) __builtin_ia32_rsqrt28pd_mask ((__v8df) __A, (__v8df) __W, (__mmask8) __U, __R); } extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_maskz_rsqrt28_round_pd (__mmask8 __U, __m512d __A, int __R) { return (__m512d) __builtin_ia32_rsqrt28pd_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) __U, __R); } extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_rsqrt28_round_ps (__m512 __A, int __R) { __m512 __W; return (__m512) __builtin_ia32_rsqrt28ps_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) -1, __R); } extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_rsqrt28_round_ps (__m512 __W, __mmask16 __U, __m512 __A, int __R) { return (__m512) __builtin_ia32_rsqrt28ps_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) __U, __R); } extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_maskz_rsqrt28_round_ps (__mmask16 __U, __m512 __A, int __R) { return (__m512) __builtin_ia32_rsqrt28ps_mask ((__v16sf) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, __R); } extern __inline __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_rsqrt28_round_sd (__m128d __A, __m128d __B, int __R) { return (__m128d) __builtin_ia32_rsqrt28sd_round ((__v2df) __B, (__v2df) __A, __R); } extern __inline __m128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_rsqrt28_round_ss (__m128 __A, __m128 __B, int __R) { return (__m128) __builtin_ia32_rsqrt28ss_round ((__v4sf) __B, (__v4sf) __A, __R); } #else #define _mm512_exp2a23_round_pd(A, C) \ __builtin_ia32_exp2pd_mask(A, (__v8df)_mm512_setzero_pd(), -1, C) #define _mm512_mask_exp2a23_round_pd(W, U, A, C) \ __builtin_ia32_exp2pd_mask(A, W, U, C) #define _mm512_maskz_exp2a23_round_pd(U, A, C) \ __builtin_ia32_exp2pd_mask(A, (__v8df)_mm512_setzero_pd(), U, C) #define _mm512_exp2a23_round_ps(A, C) \ __builtin_ia32_exp2ps_mask(A, (__v16sf)_mm512_setzero_ps(), -1, C) #define _mm512_mask_exp2a23_round_ps(W, U, A, C) \ __builtin_ia32_exp2ps_mask(A, W, U, C) #define _mm512_maskz_exp2a23_round_ps(U, A, C) \ __builtin_ia32_exp2ps_mask(A, (__v16sf)_mm512_setzero_ps(), U, C) #define _mm512_rcp28_round_pd(A, C) \ __builtin_ia32_rcp28pd_mask(A, (__v8df)_mm512_setzero_pd(), -1, C) #define _mm512_mask_rcp28_round_pd(W, U, A, C) \ __builtin_ia32_rcp28pd_mask(A, W, U, C) #define _mm512_maskz_rcp28_round_pd(U, A, C) \ __builtin_ia32_rcp28pd_mask(A, (__v8df)_mm512_setzero_pd(), U, C) #define _mm512_rcp28_round_ps(A, C) \ __builtin_ia32_rcp28ps_mask(A, (__v16sf)_mm512_setzero_ps(), -1, C) #define _mm512_mask_rcp28_round_ps(W, U, A, C) \ __builtin_ia32_rcp28ps_mask(A, W, U, C) #define _mm512_maskz_rcp28_round_ps(U, A, C) \ __builtin_ia32_rcp28ps_mask(A, (__v16sf)_mm512_setzero_ps(), U, C) #define _mm512_rsqrt28_round_pd(A, C) \ __builtin_ia32_rsqrt28pd_mask(A, (__v8df)_mm512_setzero_pd(), -1, C) #define _mm512_mask_rsqrt28_round_pd(W, U, A, C) \ __builtin_ia32_rsqrt28pd_mask(A, W, U, C) #define _mm512_maskz_rsqrt28_round_pd(U, A, C) \ __builtin_ia32_rsqrt28pd_mask(A, (__v8df)_mm512_setzero_pd(), U, C) #define _mm512_rsqrt28_round_ps(A, C) \ __builtin_ia32_rsqrt28ps_mask(A, (__v16sf)_mm512_setzero_ps(), -1, C) #define _mm512_mask_rsqrt28_round_ps(W, U, A, C) \ __builtin_ia32_rsqrt28ps_mask(A, W, U, C) #define _mm512_maskz_rsqrt28_round_ps(U, A, C) \ __builtin_ia32_rsqrt28ps_mask(A, (__v16sf)_mm512_setzero_ps(), U, C) #define _mm_rcp28_round_sd(A, B, R) \ __builtin_ia32_rcp28sd_round(A, B, R) #define _mm_rcp28_round_ss(A, B, R) \ __builtin_ia32_rcp28ss_round(A, B, R) #define _mm_rsqrt28_round_sd(A, B, R) \ __builtin_ia32_rsqrt28sd_round(A, B, R) #define _mm_rsqrt28_round_ss(A, B, R) \ __builtin_ia32_rsqrt28ss_round(A, B, R) #endif #define _mm512_exp2a23_pd(A) \ _mm512_exp2a23_round_pd(A, _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_exp2a23_pd(W, U, A) \ _mm512_mask_exp2a23_round_pd(W, U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_exp2a23_pd(U, A) \ _mm512_maskz_exp2a23_round_pd(U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_exp2a23_ps(A) \ _mm512_exp2a23_round_ps(A, _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_exp2a23_ps(W, U, A) \ _mm512_mask_exp2a23_round_ps(W, U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_exp2a23_ps(U, A) \ _mm512_maskz_exp2a23_round_ps(U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_rcp28_pd(A) \ _mm512_rcp28_round_pd(A, _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rcp28_pd(W, U, A) \ _mm512_mask_rcp28_round_pd(W, U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rcp28_pd(U, A) \ _mm512_maskz_rcp28_round_pd(U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_rcp28_ps(A) \ _mm512_rcp28_round_ps(A, _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rcp28_ps(W, U, A) \ _mm512_mask_rcp28_round_ps(W, U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rcp28_ps(U, A) \ _mm512_maskz_rcp28_round_ps(U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_rsqrt28_pd(A) \ _mm512_rsqrt28_round_pd(A, _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rsqrt28_pd(W, U, A) \ _mm512_mask_rsqrt28_round_pd(W, U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rsqrt28_pd(U, A) \ _mm512_maskz_rsqrt28_round_pd(U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_rsqrt28_ps(A) \ _mm512_rsqrt28_round_ps(A, _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rsqrt28_ps(W, U, A) \ _mm512_mask_rsqrt28_round_ps(W, U, A, _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rsqrt28_ps(U, A) \ _mm512_maskz_rsqrt28_round_ps(U, A, _MM_FROUND_CUR_DIRECTION) #define _mm_rcp28_sd(A, B) \ __builtin_ia32_rcp28sd_round(B, A, _MM_FROUND_CUR_DIRECTION) #define _mm_rcp28_ss(A, B) \ __builtin_ia32_rcp28ss_round(B, A, _MM_FROUND_CUR_DIRECTION) #define _mm_rsqrt28_sd(A, B) \ __builtin_ia32_rsqrt28sd_round(B, A, _MM_FROUND_CUR_DIRECTION) #define _mm_rsqrt28_ss(A, B) \ __builtin_ia32_rsqrt28ss_round(B, A, _MM_FROUND_CUR_DIRECTION) #ifdef __DISABLE_AVX512ER__ #undef __DISABLE_AVX512ER__ #pragma GCC pop_options #endif /* __DISABLE_AVX512ER__ */ #endif /* _AVX512ERINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512fintrin.h000066400000000000000000021130611517770275000174150ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512FINTRIN_H_INCLUDED #define _AVX512FINTRIN_H_INCLUDED #ifndef __AVX512F__ #pragma GCC push_options #pragma GCC target("avx512f") #define __DISABLE_AVX512F__ #endif /* __AVX512F__ */ /* Internal data types for implementing the intrinsics. */ typedef double __v8df __attribute__ ((__vector_size__ (64))); typedef float __v16sf __attribute__ ((__vector_size__ (64))); typedef long long __v8di __attribute__ ((__vector_size__ (64))); typedef unsigned long long __v8du __attribute__ ((__vector_size__ (64))); typedef int __v16si __attribute__ ((__vector_size__ (64))); typedef unsigned int __v16su __attribute__ ((__vector_size__ (64))); typedef short __v32hi __attribute__ ((__vector_size__ (64))); typedef unsigned short __v32hu __attribute__ ((__vector_size__ (64))); typedef char __v64qi __attribute__ ((__vector_size__ (64))); typedef unsigned char __v64qu __attribute__ ((__vector_size__ (64))); /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef float __m512 __attribute__ ((__vector_size__ (64), __may_alias__)); typedef long long __m512i __attribute__ ((__vector_size__ (64), __may_alias__)); typedef double __m512d __attribute__ ((__vector_size__ (64), __may_alias__)); /* Unaligned version of the same type. */ typedef float __m512_u __attribute__ ((__vector_size__ (64), __may_alias__, __aligned__ (1))); typedef long long __m512i_u __attribute__ ((__vector_size__ (64), __may_alias__, __aligned__ (1))); typedef double __m512d_u __attribute__ ((__vector_size__ (64), __may_alias__, __aligned__ (1))); typedef unsigned char __mmask8; typedef unsigned short __mmask16; extern __inline __mmask16 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_int2mask (int __M) { return (__mmask16) __M; } extern __inline int __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask2int (__mmask16 __M) { return (int) __M; } extern __inline __m512i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_set_epi64 (long long __A, long long __B, long long __C, long long __D, long long __E, long long __F, long long __G, long long __H) { return __extension__ (__m512i) (__v8di) { __H, __G, __F, __E, __D, __C, __B, __A }; } /* Create the vector [A B C D E F G H I J K L M N O P]. */ extern __inline __m512i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_set_epi32 (int __A, int __B, int __C, int __D, int __E, int __F, int __G, int __H, int __I, int __J, int __K, int __L, int __M, int __N, int __O, int __P) { return __extension__ (__m512i)(__v16si) { __P, __O, __N, __M, __L, __K, __J, __I, __H, __G, __F, __E, __D, __C, __B, __A }; } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_set_epi16 (short __q31, short __q30, short __q29, short __q28, short __q27, short __q26, short __q25, short __q24, short __q23, short __q22, short __q21, short __q20, short __q19, short __q18, short __q17, short __q16, short __q15, short __q14, short __q13, short __q12, short __q11, short __q10, short __q09, short __q08, short __q07, short __q06, short __q05, short __q04, short __q03, short __q02, short __q01, short __q00) { return __extension__ (__m512i)(__v32hi){ __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07, __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15, __q16, __q17, __q18, __q19, __q20, __q21, __q22, __q23, __q24, __q25, __q26, __q27, __q28, __q29, __q30, __q31 }; } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_set_epi8 (char __q63, char __q62, char __q61, char __q60, char __q59, char __q58, char __q57, char __q56, char __q55, char __q54, char __q53, char __q52, char __q51, char __q50, char __q49, char __q48, char __q47, char __q46, char __q45, char __q44, char __q43, char __q42, char __q41, char __q40, char __q39, char __q38, char __q37, char __q36, char __q35, char __q34, char __q33, char __q32, char __q31, char __q30, char __q29, char __q28, char __q27, char __q26, char __q25, char __q24, char __q23, char __q22, char __q21, char __q20, char __q19, char __q18, char __q17, char __q16, char __q15, char __q14, char __q13, char __q12, char __q11, char __q10, char __q09, char __q08, char __q07, char __q06, char __q05, char __q04, char __q03, char __q02, char __q01, char __q00) { return __extension__ (__m512i)(__v64qi){ __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07, __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15, __q16, __q17, __q18, __q19, __q20, __q21, __q22, __q23, __q24, __q25, __q26, __q27, __q28, __q29, __q30, __q31, __q32, __q33, __q34, __q35, __q36, __q37, __q38, __q39, __q40, __q41, __q42, __q43, __q44, __q45, __q46, __q47, __q48, __q49, __q50, __q51, __q52, __q53, __q54, __q55, __q56, __q57, __q58, __q59, __q60, __q61, __q62, __q63 }; } extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_set_pd (double __A, double __B, double __C, double __D, double __E, double __F, double __G, double __H) { return __extension__ (__m512d) { __H, __G, __F, __E, __D, __C, __B, __A }; } extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_set_ps (float __A, float __B, float __C, float __D, float __E, float __F, float __G, float __H, float __I, float __J, float __K, float __L, float __M, float __N, float __O, float __P) { return __extension__ (__m512) { __P, __O, __N, __M, __L, __K, __J, __I, __H, __G, __F, __E, __D, __C, __B, __A }; } #define _mm512_setr_epi64(e0,e1,e2,e3,e4,e5,e6,e7) \ _mm512_set_epi64(e7,e6,e5,e4,e3,e2,e1,e0) #define _mm512_setr_epi32(e0,e1,e2,e3,e4,e5,e6,e7, \ e8,e9,e10,e11,e12,e13,e14,e15) \ _mm512_set_epi32(e15,e14,e13,e12,e11,e10,e9,e8,e7,e6,e5,e4,e3,e2,e1,e0) #define _mm512_setr_pd(e0,e1,e2,e3,e4,e5,e6,e7) \ _mm512_set_pd(e7,e6,e5,e4,e3,e2,e1,e0) #define _mm512_setr_ps(e0,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15) \ _mm512_set_ps(e15,e14,e13,e12,e11,e10,e9,e8,e7,e6,e5,e4,e3,e2,e1,e0) extern __inline __m512 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_undefined_ps (void) { __m512 __Y = __Y; return __Y; } #define _mm512_undefined _mm512_undefined_ps extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_undefined_pd (void) { __m512d __Y = __Y; return __Y; } extern __inline __m512i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_undefined_epi32 (void) { __m512i __Y = __Y; return __Y; } #define _mm512_undefined_si512 _mm512_undefined_epi32 extern __inline __m512i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_set1_epi8 (char __A) { return __extension__ (__m512i)(__v64qi) { __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A }; } extern __inline __m512i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_set1_epi16 (short __A) { return __extension__ (__m512i)(__v32hi) { __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A }; } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_set1_pd (double __A) // { // return (__m512d) __builtin_ia32_broadcastsd512 (__extension__ // (__v2df) { __A, }, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_set1_ps (float __A) // { // return (__m512) __builtin_ia32_broadcastss512 (__extension__ // (__v4sf) { __A, }, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // /* Create the vector [A B C D A B C D A B C D A B C D]. */ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_set4_epi32 (int __A, int __B, int __C, int __D) // { // return __extension__ (__m512i)(__v16si) // { __D, __C, __B, __A, __D, __C, __B, __A, // __D, __C, __B, __A, __D, __C, __B, __A }; // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_set4_epi64 (long long __A, long long __B, long long __C, // long long __D) // { // return __extension__ (__m512i) (__v8di) // { __D, __C, __B, __A, __D, __C, __B, __A }; // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_set4_pd (double __A, double __B, double __C, double __D) // { // return __extension__ (__m512d) // { __D, __C, __B, __A, __D, __C, __B, __A }; // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_set4_ps (float __A, float __B, float __C, float __D) // { // return __extension__ (__m512) // { __D, __C, __B, __A, __D, __C, __B, __A, // __D, __C, __B, __A, __D, __C, __B, __A }; // } // #define _mm512_setr4_epi64(e0,e1,e2,e3) \ // _mm512_set4_epi64(e3,e2,e1,e0) // #define _mm512_setr4_epi32(e0,e1,e2,e3) \ // _mm512_set4_epi32(e3,e2,e1,e0) // #define _mm512_setr4_pd(e0,e1,e2,e3) \ // _mm512_set4_pd(e3,e2,e1,e0) // #define _mm512_setr4_ps(e0,e1,e2,e3) \ // _mm512_set4_ps(e3,e2,e1,e0) // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_setzero_ps (void) // { // return __extension__ (__m512){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, // 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_setzero (void) // { // return _mm512_setzero_ps (); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_setzero_pd (void) // { // return __extension__ (__m512d) { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_setzero_epi32 (void) // { // return __extension__ (__m512i)(__v8di){ 0, 0, 0, 0, 0, 0, 0, 0 }; // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_setzero_si512 (void) // { // return __extension__ (__m512i)(__v8di){ 0, 0, 0, 0, 0, 0, 0, 0 }; // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mov_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_movapd512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mov_pd (__mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_movapd512_mask ((__v8df) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mov_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_movaps512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mov_ps (__mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_movaps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_load_pd (void const *__P) // { // return *(__m512d *) __P; // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_load_pd (__m512d __W, __mmask8 __U, void const *__P) // { // return (__m512d) __builtin_ia32_loadapd512_mask ((const __v8df *) __P, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_load_pd (__mmask8 __U, void const *__P) // { // return (__m512d) __builtin_ia32_loadapd512_mask ((const __v8df *) __P, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_store_pd (void *__P, __m512d __A) // { // *(__m512d *) __P = __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_store_pd (void *__P, __mmask8 __U, __m512d __A) // { // __builtin_ia32_storeapd512_mask ((__v8df *) __P, (__v8df) __A, // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_load_ps (void const *__P) // { // return *(__m512 *) __P; // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_load_ps (__m512 __W, __mmask16 __U, void const *__P) // { // return (__m512) __builtin_ia32_loadaps512_mask ((const __v16sf *) __P, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_load_ps (__mmask16 __U, void const *__P) // { // return (__m512) __builtin_ia32_loadaps512_mask ((const __v16sf *) __P, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_store_ps (void *__P, __m512 __A) // { // *(__m512 *) __P = __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_store_ps (void *__P, __mmask16 __U, __m512 __A) // { // __builtin_ia32_storeaps512_mask ((__v16sf *) __P, (__v16sf) __A, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mov_epi64 (__m512i __W, __mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_movdqa64_512_mask ((__v8di) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mov_epi64 (__mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_movdqa64_512_mask ((__v8di) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_load_epi64 (void const *__P) // { // return *(__m512i *) __P; // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_load_epi64 (__m512i __W, __mmask8 __U, void const *__P) // { // return (__m512i) __builtin_ia32_movdqa64load512_mask ((const __v8di *) __P, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_load_epi64 (__mmask8 __U, void const *__P) // { // return (__m512i) __builtin_ia32_movdqa64load512_mask ((const __v8di *) __P, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_store_epi64 (void *__P, __m512i __A) // { // *(__m512i *) __P = __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_store_epi64 (void *__P, __mmask8 __U, __m512i __A) // { // __builtin_ia32_movdqa64store512_mask ((__v8di *) __P, (__v8di) __A, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mov_epi32 (__m512i __W, __mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_movdqa32_512_mask ((__v16si) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mov_epi32 (__mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_movdqa32_512_mask ((__v16si) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_load_si512 (void const *__P) // { // return *(__m512i *) __P; // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_load_epi32 (void const *__P) // { // return *(__m512i *) __P; // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_load_epi32 (__m512i __W, __mmask16 __U, void const *__P) // { // return (__m512i) __builtin_ia32_movdqa32load512_mask ((const __v16si *) __P, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_load_epi32 (__mmask16 __U, void const *__P) // { // return (__m512i) __builtin_ia32_movdqa32load512_mask ((const __v16si *) __P, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_store_si512 (void *__P, __m512i __A) // { // *(__m512i *) __P = __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_store_epi32 (void *__P, __m512i __A) // { // *(__m512i *) __P = __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_store_epi32 (void *__P, __mmask16 __U, __m512i __A) // { // __builtin_ia32_movdqa32store512_mask ((__v16si *) __P, (__v16si) __A, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mullo_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v16su) __A * (__v16su) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mullo_epi32 (__mmask16 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmulld512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mullo_epi32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmulld512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mullox_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v8du) __A * (__v8du) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mullox_epi64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) // { // return _mm512_mask_mov_epi64 (__W, __M, _mm512_mullox_epi64 (__A, __B)); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sllv_epi32 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psllv16si_mask ((__v16si) __X, // (__v16si) __Y, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sllv_epi32 (__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psllv16si_mask ((__v16si) __X, // (__v16si) __Y, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sllv_epi32 (__mmask16 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psllv16si_mask ((__v16si) __X, // (__v16si) __Y, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srav_epi32 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrav16si_mask ((__v16si) __X, // (__v16si) __Y, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srav_epi32 (__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrav16si_mask ((__v16si) __X, // (__v16si) __Y, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srav_epi32 (__mmask16 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrav16si_mask ((__v16si) __X, // (__v16si) __Y, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srlv_epi32 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrlv16si_mask ((__v16si) __X, // (__v16si) __Y, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srlv_epi32 (__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrlv16si_mask ((__v16si) __X, // (__v16si) __Y, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srlv_epi32 (__mmask16 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrlv16si_mask ((__v16si) __X, // (__v16si) __Y, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_add_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v8du) __A + (__v8du) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_add_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_add_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sub_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v8du) __A - (__v8du) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sub_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sub_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sllv_epi64 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psllv8di_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sllv_epi64 (__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psllv8di_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sllv_epi64 (__mmask8 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psllv8di_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srav_epi64 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrav8di_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srav_epi64 (__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrav8di_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srav_epi64 (__mmask8 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrav8di_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srlv_epi64 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrlv8di_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srlv_epi64 (__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrlv8di_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srlv_epi64 (__mmask8 __U, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_psrlv8di_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_add_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v16su) __A + (__v16su) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_add_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_add_epi32 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_paddd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mul_epi32 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_pmuldq512_mask ((__v16si) __X, // (__v16si) __Y, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mul_epi32 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_pmuldq512_mask ((__v16si) __X, // (__v16si) __Y, // (__v8di) __W, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mul_epi32 (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_pmuldq512_mask ((__v16si) __X, // (__v16si) __Y, // (__v8di) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sub_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v16su) __A - (__v16su) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sub_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sub_epi32 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_psubd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mul_epu32 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_pmuludq512_mask ((__v16si) __X, // (__v16si) __Y, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mul_epu32 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_pmuludq512_mask ((__v16si) __X, // (__v16si) __Y, // (__v8di) __W, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mul_epu32 (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_pmuludq512_mask ((__v16si) __X, // (__v16si) __Y, // (__v8di) // _mm512_setzero_si512 (), // __M); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_slli_epi64 (__m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psllqi512_mask ((__v8di) __A, __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_slli_epi64 (__m512i __W, __mmask8 __U, __m512i __A, // unsigned int __B) // { // return (__m512i) __builtin_ia32_psllqi512_mask ((__v8di) __A, __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_slli_epi64 (__mmask8 __U, __m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psllqi512_mask ((__v8di) __A, __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #else // #define _mm512_slli_epi64(X, C) \ // ((__m512i) __builtin_ia32_psllqi512_mask ((__v8di)(__m512i)(X), (int)(C),\ // (__v8di)(__m512i)_mm512_undefined_epi32 (),\ // (__mmask8)-1)) // #define _mm512_mask_slli_epi64(W, U, X, C) \ // ((__m512i) __builtin_ia32_psllqi512_mask ((__v8di)(__m512i)(X), (int)(C),\ // (__v8di)(__m512i)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_slli_epi64(U, X, C) \ // ((__m512i) __builtin_ia32_psllqi512_mask ((__v8di)(__m512i)(X), (int)(C),\ // (__v8di)(__m512i)_mm512_setzero_si512 (),\ // (__mmask8)(U))) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sll_epi64 (__m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psllq512_mask ((__v8di) __A, // (__v2di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sll_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psllq512_mask ((__v8di) __A, // (__v2di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sll_epi64 (__mmask8 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psllq512_mask ((__v8di) __A, // (__v2di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srli_epi64 (__m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psrlqi512_mask ((__v8di) __A, __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srli_epi64 (__m512i __W, __mmask8 __U, // __m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psrlqi512_mask ((__v8di) __A, __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srli_epi64 (__mmask8 __U, __m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psrlqi512_mask ((__v8di) __A, __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #else // #define _mm512_srli_epi64(X, C) \ // ((__m512i) __builtin_ia32_psrlqi512_mask ((__v8di)(__m512i)(X), (int)(C),\ // (__v8di)(__m512i)_mm512_undefined_epi32 (),\ // (__mmask8)-1)) // #define _mm512_mask_srli_epi64(W, U, X, C) \ // ((__m512i) __builtin_ia32_psrlqi512_mask ((__v8di)(__m512i)(X), (int)(C),\ // (__v8di)(__m512i)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_srli_epi64(U, X, C) \ // ((__m512i) __builtin_ia32_psrlqi512_mask ((__v8di)(__m512i)(X), (int)(C),\ // (__v8di)(__m512i)_mm512_setzero_si512 (),\ // (__mmask8)(U))) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srl_epi64 (__m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrlq512_mask ((__v8di) __A, // (__v2di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srl_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrlq512_mask ((__v8di) __A, // (__v2di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srl_epi64 (__mmask8 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrlq512_mask ((__v8di) __A, // (__v2di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srai_epi64 (__m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psraqi512_mask ((__v8di) __A, __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srai_epi64 (__m512i __W, __mmask8 __U, __m512i __A, // unsigned int __B) // { // return (__m512i) __builtin_ia32_psraqi512_mask ((__v8di) __A, __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srai_epi64 (__mmask8 __U, __m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psraqi512_mask ((__v8di) __A, __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #else // #define _mm512_srai_epi64(X, C) \ // ((__m512i) __builtin_ia32_psraqi512_mask ((__v8di)(__m512i)(X), (int)(C),\ // (__v8di)(__m512i)_mm512_undefined_epi32 (),\ // (__mmask8)-1)) // #define _mm512_mask_srai_epi64(W, U, X, C) \ // ((__m512i) __builtin_ia32_psraqi512_mask ((__v8di)(__m512i)(X), (int)(C),\ // (__v8di)(__m512i)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_srai_epi64(U, X, C) \ // ((__m512i) __builtin_ia32_psraqi512_mask ((__v8di)(__m512i)(X), (int)(C),\ // (__v8di)(__m512i)_mm512_setzero_si512 (),\ // (__mmask8)(U))) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sra_epi64 (__m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psraq512_mask ((__v8di) __A, // (__v2di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sra_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psraq512_mask ((__v8di) __A, // (__v2di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sra_epi64 (__mmask8 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psraq512_mask ((__v8di) __A, // (__v2di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_slli_epi32 (__m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_pslldi512_mask ((__v16si) __A, __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_slli_epi32 (__m512i __W, __mmask16 __U, __m512i __A, // unsigned int __B) // { // return (__m512i) __builtin_ia32_pslldi512_mask ((__v16si) __A, __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_slli_epi32 (__mmask16 __U, __m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_pslldi512_mask ((__v16si) __A, __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // #else // #define _mm512_slli_epi32(X, C) \ // ((__m512i) __builtin_ia32_pslldi512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)_mm512_undefined_epi32 (),\ // (__mmask16)-1)) // #define _mm512_mask_slli_epi32(W, U, X, C) \ // ((__m512i) __builtin_ia32_pslldi512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)(W),\ // (__mmask16)(U))) // #define _mm512_maskz_slli_epi32(U, X, C) \ // ((__m512i) __builtin_ia32_pslldi512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)_mm512_setzero_si512 (),\ // (__mmask16)(U))) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sll_epi32 (__m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_pslld512_mask ((__v16si) __A, // (__v4si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sll_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_pslld512_mask ((__v16si) __A, // (__v4si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sll_epi32 (__mmask16 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_pslld512_mask ((__v16si) __A, // (__v4si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srli_epi32 (__m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psrldi512_mask ((__v16si) __A, __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srli_epi32 (__m512i __W, __mmask16 __U, // __m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psrldi512_mask ((__v16si) __A, __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srli_epi32 (__mmask16 __U, __m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psrldi512_mask ((__v16si) __A, __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // #else // #define _mm512_srli_epi32(X, C) \ // ((__m512i) __builtin_ia32_psrldi512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)_mm512_undefined_epi32 (),\ // (__mmask16)-1)) // #define _mm512_mask_srli_epi32(W, U, X, C) \ // ((__m512i) __builtin_ia32_psrldi512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)(W),\ // (__mmask16)(U))) // #define _mm512_maskz_srli_epi32(U, X, C) \ // ((__m512i) __builtin_ia32_psrldi512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)_mm512_setzero_si512 (),\ // (__mmask16)(U))) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srl_epi32 (__m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrld512_mask ((__v16si) __A, // (__v4si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srl_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrld512_mask ((__v16si) __A, // (__v4si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srl_epi32 (__mmask16 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrld512_mask ((__v16si) __A, // (__v4si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_srai_epi32 (__m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psradi512_mask ((__v16si) __A, __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_srai_epi32 (__m512i __W, __mmask16 __U, __m512i __A, // unsigned int __B) // { // return (__m512i) __builtin_ia32_psradi512_mask ((__v16si) __A, __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_srai_epi32 (__mmask16 __U, __m512i __A, unsigned int __B) // { // return (__m512i) __builtin_ia32_psradi512_mask ((__v16si) __A, __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // #else // #define _mm512_srai_epi32(X, C) \ // ((__m512i) __builtin_ia32_psradi512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)_mm512_undefined_epi32 (),\ // (__mmask16)-1)) // #define _mm512_mask_srai_epi32(W, U, X, C) \ // ((__m512i) __builtin_ia32_psradi512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)(W),\ // (__mmask16)(U))) // #define _mm512_maskz_srai_epi32(U, X, C) \ // ((__m512i) __builtin_ia32_psradi512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)_mm512_setzero_si512 (),\ // (__mmask16)(U))) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sra_epi32 (__m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrad512_mask ((__v16si) __A, // (__v4si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sra_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrad512_mask ((__v16si) __A, // (__v4si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sra_epi32 (__mmask16 __U, __m512i __A, __m128i __B) // { // return (__m512i) __builtin_ia32_psrad512_mask ((__v16si) __A, // (__v4si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_add_round_sd (__m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_addsd_round ((__v2df) __A, // (__v2df) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_add_round_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_addsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_add_round_sd (__mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_addsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_add_round_ss (__m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_addss_round ((__v4sf) __A, // (__v4sf) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_add_round_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_addss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_add_round_ss (__mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_addss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sub_round_sd (__m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_subsd_round ((__v2df) __A, // (__v2df) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sub_round_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_subsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sub_round_sd (__mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_subsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sub_round_ss (__m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_subss_round ((__v4sf) __A, // (__v4sf) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sub_round_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_subss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sub_round_ss (__mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_subss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, __R); // } // #else // #define _mm_add_round_sd(A, B, C) \ // (__m128d)__builtin_ia32_addsd_round(A, B, C) // #define _mm_mask_add_round_sd(W, U, A, B, C) \ // (__m128d)__builtin_ia32_addsd_mask_round(A, B, W, U, C) // #define _mm_maskz_add_round_sd(U, A, B, C) \ // (__m128d)__builtin_ia32_addsd_mask_round(A, B, (__v2df)_mm_setzero_pd(), U, C) // #define _mm_add_round_ss(A, B, C) \ // (__m128)__builtin_ia32_addss_round(A, B, C) // #define _mm_mask_add_round_ss(W, U, A, B, C) \ // (__m128)__builtin_ia32_addss_mask_round(A, B, W, U, C) // #define _mm_maskz_add_round_ss(U, A, B, C) \ // (__m128)__builtin_ia32_addss_mask_round(A, B, (__v4sf)_mm_setzero_ps(), U, C) // #define _mm_sub_round_sd(A, B, C) \ // (__m128d)__builtin_ia32_subsd_round(A, B, C) // #define _mm_mask_sub_round_sd(W, U, A, B, C) \ // (__m128d)__builtin_ia32_subsd_mask_round(A, B, W, U, C) // #define _mm_maskz_sub_round_sd(U, A, B, C) \ // (__m128d)__builtin_ia32_subsd_mask_round(A, B, (__v2df)_mm_setzero_pd(), U, C) // #define _mm_sub_round_ss(A, B, C) \ // (__m128)__builtin_ia32_subss_round(A, B, C) // #define _mm_mask_sub_round_ss(W, U, A, B, C) \ // (__m128)__builtin_ia32_subss_mask_round(A, B, W, U, C) // #define _mm_maskz_sub_round_ss(U, A, B, C) \ // (__m128)__builtin_ia32_subss_mask_round(A, B, (__v4sf)_mm_setzero_ps(), U, C) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_ternarylogic_epi64 (__m512i __A, __m512i __B, __m512i __C, // const int __imm) // { // return (__m512i) __builtin_ia32_pternlogq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __C, __imm, // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_ternarylogic_epi64 (__m512i __A, __mmask8 __U, __m512i __B, // __m512i __C, const int __imm) // { // return (__m512i) __builtin_ia32_pternlogq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __C, __imm, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_ternarylogic_epi64 (__mmask8 __U, __m512i __A, __m512i __B, // __m512i __C, const int __imm) // { // return (__m512i) __builtin_ia32_pternlogq512_maskz ((__v8di) __A, // (__v8di) __B, // (__v8di) __C, // __imm, (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_ternarylogic_epi32 (__m512i __A, __m512i __B, __m512i __C, // const int __imm) // { // return (__m512i) __builtin_ia32_pternlogd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __C, // __imm, (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_ternarylogic_epi32 (__m512i __A, __mmask16 __U, __m512i __B, // __m512i __C, const int __imm) // { // return (__m512i) __builtin_ia32_pternlogd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __C, // __imm, (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_ternarylogic_epi32 (__mmask16 __U, __m512i __A, __m512i __B, // __m512i __C, const int __imm) // { // return (__m512i) __builtin_ia32_pternlogd512_maskz ((__v16si) __A, // (__v16si) __B, // (__v16si) __C, // __imm, (__mmask16) __U); // } // #else // #define _mm512_ternarylogic_epi64(A, B, C, I) \ // ((__m512i) __builtin_ia32_pternlogq512_mask ((__v8di)(__m512i)(A), \ // (__v8di)(__m512i)(B), (__v8di)(__m512i)(C), (int)(I), (__mmask8)-1)) // #define _mm512_mask_ternarylogic_epi64(A, U, B, C, I) \ // ((__m512i) __builtin_ia32_pternlogq512_mask ((__v8di)(__m512i)(A), \ // (__v8di)(__m512i)(B), (__v8di)(__m512i)(C), (int)(I), (__mmask8)(U))) // #define _mm512_maskz_ternarylogic_epi64(U, A, B, C, I) \ // ((__m512i) __builtin_ia32_pternlogq512_maskz ((__v8di)(__m512i)(A), \ // (__v8di)(__m512i)(B), (__v8di)(__m512i)(C), (int)(I), (__mmask8)(U))) // #define _mm512_ternarylogic_epi32(A, B, C, I) \ // ((__m512i) __builtin_ia32_pternlogd512_mask ((__v16si)(__m512i)(A), \ // (__v16si)(__m512i)(B), (__v16si)(__m512i)(C), (int)(I), \ // (__mmask16)-1)) // #define _mm512_mask_ternarylogic_epi32(A, U, B, C, I) \ // ((__m512i) __builtin_ia32_pternlogd512_mask ((__v16si)(__m512i)(A), \ // (__v16si)(__m512i)(B), (__v16si)(__m512i)(C), (int)(I), \ // (__mmask16)(U))) // #define _mm512_maskz_ternarylogic_epi32(U, A, B, C, I) \ // ((__m512i) __builtin_ia32_pternlogd512_maskz ((__v16si)(__m512i)(A), \ // (__v16si)(__m512i)(B), (__v16si)(__m512i)(C), (int)(I), \ // (__mmask16)(U))) // #endif // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_rcp14_pd (__m512d __A) // { // return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_rcp14_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_rcp14_pd (__mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_rcp14_ps (__m512 __A) // { // return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_rcp14_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_rcp14_ps (__mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rcp14_sd (__m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_rcp14sd ((__v2df) __B, // (__v2df) __A); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rcp14_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_rcp14sd_mask ((__v2df) __B, // (__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rcp14_sd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_rcp14sd_mask ((__v2df) __B, // (__v2df) __A, // (__v2df) _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rcp14_ss (__m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_rcp14ss ((__v4sf) __B, // (__v4sf) __A); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rcp14_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_rcp14ss_mask ((__v4sf) __B, // (__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rcp14_ss (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_rcp14ss_mask ((__v4sf) __B, // (__v4sf) __A, // (__v4sf) _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_rsqrt14_pd (__m512d __A) // { // return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_rsqrt14_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_rsqrt14_pd (__mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_rsqrt14_ps (__m512 __A) // { // return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_rsqrt14_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_rsqrt14_ps (__mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rsqrt14_sd (__m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_rsqrt14sd ((__v2df) __B, // (__v2df) __A); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rsqrt14_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_rsqrt14sd_mask ((__v2df) __B, // (__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rsqrt14_sd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_rsqrt14sd_mask ((__v2df) __B, // (__v2df) __A, // (__v2df) _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rsqrt14_ss (__m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_rsqrt14ss ((__v4sf) __B, // (__v4sf) __A); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rsqrt14_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_rsqrt14ss_mask ((__v4sf) __B, // (__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rsqrt14_ss (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_rsqrt14ss_mask ((__v4sf) __B, // (__v4sf) __A, // (__v4sf) _mm_setzero_ps (), // (__mmask8) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sqrt_round_pd (__m512d __A, const int __R) // { // return (__m512d) __builtin_ia32_sqrtpd512_mask ((__v8df) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sqrt_round_pd (__m512d __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m512d) __builtin_ia32_sqrtpd512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sqrt_round_pd (__mmask8 __U, __m512d __A, const int __R) // { // return (__m512d) __builtin_ia32_sqrtpd512_mask ((__v8df) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sqrt_round_ps (__m512 __A, const int __R) // { // return (__m512) __builtin_ia32_sqrtps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sqrt_round_ps (__m512 __W, __mmask16 __U, __m512 __A, const int __R) // { // return (__m512) __builtin_ia32_sqrtps512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sqrt_round_ps (__mmask16 __U, __m512 __A, const int __R) // { // return (__m512) __builtin_ia32_sqrtps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sqrt_round_sd (__m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_sqrtsd_mask_round ((__v2df) __B, // (__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sqrt_round_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_sqrtsd_mask_round ((__v2df) __B, // (__v2df) __A, // (__v2df) __W, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sqrt_round_sd (__mmask8 __U, __m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_sqrtsd_mask_round ((__v2df) __B, // (__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sqrt_round_ss (__m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_sqrtss_mask_round ((__v4sf) __B, // (__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sqrt_round_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_sqrtss_mask_round ((__v4sf) __B, // (__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sqrt_round_ss (__mmask8 __U, __m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_sqrtss_mask_round ((__v4sf) __B, // (__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, __R); // } // #else // #define _mm512_sqrt_round_pd(A, C) \ // (__m512d)__builtin_ia32_sqrtpd512_mask(A, (__v8df)_mm512_undefined_pd(), -1, C) // #define _mm512_mask_sqrt_round_pd(W, U, A, C) \ // (__m512d)__builtin_ia32_sqrtpd512_mask(A, W, U, C) // #define _mm512_maskz_sqrt_round_pd(U, A, C) \ // (__m512d)__builtin_ia32_sqrtpd512_mask(A, (__v8df)_mm512_setzero_pd(), U, C) // #define _mm512_sqrt_round_ps(A, C) \ // (__m512)__builtin_ia32_sqrtps512_mask(A, (__v16sf)_mm512_undefined_ps(), -1, C) // #define _mm512_mask_sqrt_round_ps(W, U, A, C) \ // (__m512)__builtin_ia32_sqrtps512_mask(A, W, U, C) // #define _mm512_maskz_sqrt_round_ps(U, A, C) \ // (__m512)__builtin_ia32_sqrtps512_mask(A, (__v16sf)_mm512_setzero_ps(), U, C) // #define _mm_sqrt_round_sd(A, B, C) \ // (__m128d)__builtin_ia32_sqrtsd_mask_round (B, A, \ // (__v2df) _mm_setzero_pd (), -1, C) // #define _mm_mask_sqrt_round_sd(W, U, A, B, C) \ // (__m128d)__builtin_ia32_sqrtsd_mask_round (B, A, W, U, C) // #define _mm_maskz_sqrt_round_sd(U, A, B, C) \ // (__m128d)__builtin_ia32_sqrtsd_mask_round (B, A, \ // (__v2df) _mm_setzero_pd (), U, C) // #define _mm_sqrt_round_ss(A, B, C) \ // (__m128)__builtin_ia32_sqrtss_mask_round (B, A, \ // (__v4sf) _mm_setzero_ps (), -1, C) // #define _mm_mask_sqrt_round_ss(W, U, A, B, C) \ // (__m128)__builtin_ia32_sqrtss_mask_round (B, A, W, U, C) // #define _mm_maskz_sqrt_round_ss(U, A, B, C) \ // (__m128)__builtin_ia32_sqrtss_mask_round (B, A, \ // (__v4sf) _mm_setzero_ps (), U, C) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi8_epi32 (__m128i __A) // { // return (__m512i) __builtin_ia32_pmovsxbd512_mask ((__v16qi) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi8_epi32 (__m512i __W, __mmask16 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovsxbd512_mask ((__v16qi) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi8_epi32 (__mmask16 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovsxbd512_mask ((__v16qi) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi8_epi64 (__m128i __A) // { // return (__m512i) __builtin_ia32_pmovsxbq512_mask ((__v16qi) __A, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi8_epi64 (__m512i __W, __mmask8 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovsxbq512_mask ((__v16qi) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi8_epi64 (__mmask8 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovsxbq512_mask ((__v16qi) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi16_epi32 (__m256i __A) // { // return (__m512i) __builtin_ia32_pmovsxwd512_mask ((__v16hi) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi16_epi32 (__m512i __W, __mmask16 __U, __m256i __A) // { // return (__m512i) __builtin_ia32_pmovsxwd512_mask ((__v16hi) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi16_epi32 (__mmask16 __U, __m256i __A) // { // return (__m512i) __builtin_ia32_pmovsxwd512_mask ((__v16hi) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi16_epi64 (__m128i __A) // { // return (__m512i) __builtin_ia32_pmovsxwq512_mask ((__v8hi) __A, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi16_epi64 (__m512i __W, __mmask8 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovsxwq512_mask ((__v8hi) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi16_epi64 (__mmask8 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovsxwq512_mask ((__v8hi) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi32_epi64 (__m256i __X) // { // return (__m512i) __builtin_ia32_pmovsxdq512_mask ((__v8si) __X, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi32_epi64 (__m512i __W, __mmask8 __U, __m256i __X) // { // return (__m512i) __builtin_ia32_pmovsxdq512_mask ((__v8si) __X, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi32_epi64 (__mmask8 __U, __m256i __X) // { // return (__m512i) __builtin_ia32_pmovsxdq512_mask ((__v8si) __X, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepu8_epi32 (__m128i __A) // { // return (__m512i) __builtin_ia32_pmovzxbd512_mask ((__v16qi) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepu8_epi32 (__m512i __W, __mmask16 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovzxbd512_mask ((__v16qi) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepu8_epi32 (__mmask16 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovzxbd512_mask ((__v16qi) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepu8_epi64 (__m128i __A) // { // return (__m512i) __builtin_ia32_pmovzxbq512_mask ((__v16qi) __A, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepu8_epi64 (__m512i __W, __mmask8 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovzxbq512_mask ((__v16qi) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepu8_epi64 (__mmask8 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovzxbq512_mask ((__v16qi) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepu16_epi32 (__m256i __A) // { // return (__m512i) __builtin_ia32_pmovzxwd512_mask ((__v16hi) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepu16_epi32 (__m512i __W, __mmask16 __U, __m256i __A) // { // return (__m512i) __builtin_ia32_pmovzxwd512_mask ((__v16hi) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepu16_epi32 (__mmask16 __U, __m256i __A) // { // return (__m512i) __builtin_ia32_pmovzxwd512_mask ((__v16hi) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepu16_epi64 (__m128i __A) // { // return (__m512i) __builtin_ia32_pmovzxwq512_mask ((__v8hi) __A, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepu16_epi64 (__m512i __W, __mmask8 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovzxwq512_mask ((__v8hi) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepu16_epi64 (__mmask8 __U, __m128i __A) // { // return (__m512i) __builtin_ia32_pmovzxwq512_mask ((__v8hi) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepu32_epi64 (__m256i __X) // { // return (__m512i) __builtin_ia32_pmovzxdq512_mask ((__v8si) __X, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepu32_epi64 (__m512i __W, __mmask8 __U, __m256i __X) // { // return (__m512i) __builtin_ia32_pmovzxdq512_mask ((__v8si) __X, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepu32_epi64 (__mmask8 __U, __m256i __X) // { // return (__m512i) __builtin_ia32_pmovzxdq512_mask ((__v8si) __X, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_add_round_pd (__m512d __A, __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_addpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_add_round_pd (__m512d __W, __mmask8 __U, __m512d __A, // __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_addpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_add_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // const int __R) // { // return (__m512d) __builtin_ia32_addpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_add_round_ps (__m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_addps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_add_round_ps (__m512 __W, __mmask16 __U, __m512 __A, // __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_addps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_add_round_ps (__mmask16 __U, __m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_addps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sub_round_pd (__m512d __A, __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_subpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sub_round_pd (__m512d __W, __mmask8 __U, __m512d __A, // __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_subpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sub_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // const int __R) // { // return (__m512d) __builtin_ia32_subpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sub_round_ps (__m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_subps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sub_round_ps (__m512 __W, __mmask16 __U, __m512 __A, // __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_subps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sub_round_ps (__mmask16 __U, __m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_subps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // #else // #define _mm512_add_round_pd(A, B, C) \ // (__m512d)__builtin_ia32_addpd512_mask(A, B, (__v8df)_mm512_undefined_pd(), -1, C) // #define _mm512_mask_add_round_pd(W, U, A, B, C) \ // (__m512d)__builtin_ia32_addpd512_mask(A, B, W, U, C) // #define _mm512_maskz_add_round_pd(U, A, B, C) \ // (__m512d)__builtin_ia32_addpd512_mask(A, B, (__v8df)_mm512_setzero_pd(), U, C) // #define _mm512_add_round_ps(A, B, C) \ // (__m512)__builtin_ia32_addps512_mask(A, B, (__v16sf)_mm512_undefined_ps(), -1, C) // #define _mm512_mask_add_round_ps(W, U, A, B, C) \ // (__m512)__builtin_ia32_addps512_mask(A, B, W, U, C) // #define _mm512_maskz_add_round_ps(U, A, B, C) \ // (__m512)__builtin_ia32_addps512_mask(A, B, (__v16sf)_mm512_setzero_ps(), U, C) // #define _mm512_sub_round_pd(A, B, C) \ // (__m512d)__builtin_ia32_subpd512_mask(A, B, (__v8df)_mm512_undefined_pd(), -1, C) // #define _mm512_mask_sub_round_pd(W, U, A, B, C) \ // (__m512d)__builtin_ia32_subpd512_mask(A, B, W, U, C) // #define _mm512_maskz_sub_round_pd(U, A, B, C) \ // (__m512d)__builtin_ia32_subpd512_mask(A, B, (__v8df)_mm512_setzero_pd(), U, C) // #define _mm512_sub_round_ps(A, B, C) \ // (__m512)__builtin_ia32_subps512_mask(A, B, (__v16sf)_mm512_undefined_ps(), -1, C) // #define _mm512_mask_sub_round_ps(W, U, A, B, C) \ // (__m512)__builtin_ia32_subps512_mask(A, B, W, U, C) // #define _mm512_maskz_sub_round_ps(U, A, B, C) \ // (__m512)__builtin_ia32_subps512_mask(A, B, (__v16sf)_mm512_setzero_ps(), U, C) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mul_round_pd (__m512d __A, __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_mulpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mul_round_pd (__m512d __W, __mmask8 __U, __m512d __A, // __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_mulpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mul_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // const int __R) // { // return (__m512d) __builtin_ia32_mulpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mul_round_ps (__m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_mulps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mul_round_ps (__m512 __W, __mmask16 __U, __m512 __A, // __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_mulps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mul_round_ps (__mmask16 __U, __m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_mulps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_div_round_pd (__m512d __M, __m512d __V, const int __R) // { // return (__m512d) __builtin_ia32_divpd512_mask ((__v8df) __M, // (__v8df) __V, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_div_round_pd (__m512d __W, __mmask8 __U, __m512d __M, // __m512d __V, const int __R) // { // return (__m512d) __builtin_ia32_divpd512_mask ((__v8df) __M, // (__v8df) __V, // (__v8df) __W, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_div_round_pd (__mmask8 __U, __m512d __M, __m512d __V, // const int __R) // { // return (__m512d) __builtin_ia32_divpd512_mask ((__v8df) __M, // (__v8df) __V, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_div_round_ps (__m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_divps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_div_round_ps (__m512 __W, __mmask16 __U, __m512 __A, // __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_divps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_div_round_ps (__mmask16 __U, __m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_divps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mul_round_sd (__m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_mulsd_round ((__v2df) __A, // (__v2df) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mul_round_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_mulsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mul_round_sd (__mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_mulsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mul_round_ss (__m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_mulss_round ((__v4sf) __A, // (__v4sf) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mul_round_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_mulss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mul_round_ss (__mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_mulss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_div_round_sd (__m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_divsd_round ((__v2df) __A, // (__v2df) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_div_round_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_divsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_div_round_sd (__mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_divsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_div_round_ss (__m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_divss_round ((__v4sf) __A, // (__v4sf) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_div_round_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_divss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_div_round_ss (__mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_divss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, __R); // } // #else // #define _mm512_mul_round_pd(A, B, C) \ // (__m512d)__builtin_ia32_mulpd512_mask(A, B, (__v8df)_mm512_undefined_pd(), -1, C) // #define _mm512_mask_mul_round_pd(W, U, A, B, C) \ // (__m512d)__builtin_ia32_mulpd512_mask(A, B, W, U, C) // #define _mm512_maskz_mul_round_pd(U, A, B, C) \ // (__m512d)__builtin_ia32_mulpd512_mask(A, B, (__v8df)_mm512_setzero_pd(), U, C) // #define _mm512_mul_round_ps(A, B, C) \ // (__m512)__builtin_ia32_mulps512_mask(A, B, (__v16sf)_mm512_undefined_ps(), -1, C) // #define _mm512_mask_mul_round_ps(W, U, A, B, C) \ // (__m512)__builtin_ia32_mulps512_mask(A, B, W, U, C) // #define _mm512_maskz_mul_round_ps(U, A, B, C) \ // (__m512)__builtin_ia32_mulps512_mask(A, B, (__v16sf)_mm512_setzero_ps(), U, C) // #define _mm512_div_round_pd(A, B, C) \ // (__m512d)__builtin_ia32_divpd512_mask(A, B, (__v8df)_mm512_undefined_pd(), -1, C) // #define _mm512_mask_div_round_pd(W, U, A, B, C) \ // (__m512d)__builtin_ia32_divpd512_mask(A, B, W, U, C) // #define _mm512_maskz_div_round_pd(U, A, B, C) \ // (__m512d)__builtin_ia32_divpd512_mask(A, B, (__v8df)_mm512_setzero_pd(), U, C) // #define _mm512_div_round_ps(A, B, C) \ // (__m512)__builtin_ia32_divps512_mask(A, B, (__v16sf)_mm512_undefined_ps(), -1, C) // #define _mm512_mask_div_round_ps(W, U, A, B, C) \ // (__m512)__builtin_ia32_divps512_mask(A, B, W, U, C) // #define _mm512_maskz_div_round_ps(U, A, B, C) \ // (__m512)__builtin_ia32_divps512_mask(A, B, (__v16sf)_mm512_setzero_ps(), U, C) // #define _mm_mul_round_sd(A, B, C) \ // (__m128d)__builtin_ia32_mulsd_round(A, B, C) // #define _mm_mask_mul_round_sd(W, U, A, B, C) \ // (__m128d)__builtin_ia32_mulsd_mask_round(A, B, W, U, C) // #define _mm_maskz_mul_round_sd(U, A, B, C) \ // (__m128d)__builtin_ia32_mulsd_mask_round(A, B, (__v2df)_mm_setzero_pd(), U, C) // #define _mm_mul_round_ss(A, B, C) \ // (__m128)__builtin_ia32_mulss_round(A, B, C) // #define _mm_mask_mul_round_ss(W, U, A, B, C) \ // (__m128)__builtin_ia32_mulss_mask_round(A, B, W, U, C) // #define _mm_maskz_mul_round_ss(U, A, B, C) \ // (__m128)__builtin_ia32_mulss_mask_round(A, B, (__v4sf)_mm_setzero_ps(), U, C) // #define _mm_div_round_sd(A, B, C) \ // (__m128d)__builtin_ia32_divsd_round(A, B, C) // #define _mm_mask_div_round_sd(W, U, A, B, C) \ // (__m128d)__builtin_ia32_divsd_mask_round(A, B, W, U, C) // #define _mm_maskz_div_round_sd(U, A, B, C) \ // (__m128d)__builtin_ia32_divsd_mask_round(A, B, (__v2df)_mm_setzero_pd(), U, C) // #define _mm_div_round_ss(A, B, C) \ // (__m128)__builtin_ia32_divss_round(A, B, C) // #define _mm_mask_div_round_ss(W, U, A, B, C) \ // (__m128)__builtin_ia32_divss_mask_round(A, B, W, U, C) // #define _mm_maskz_div_round_ss(U, A, B, C) \ // (__m128)__builtin_ia32_divss_mask_round(A, B, (__v4sf)_mm_setzero_ps(), U, C) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_round_pd (__m512d __A, __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_round_pd (__m512d __W, __mmask8 __U, __m512d __A, // __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // const int __R) // { // return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_round_ps (__m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_round_ps (__m512 __W, __mmask16 __U, __m512 __A, // __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_round_ps (__mmask16 __U, __m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_round_pd (__m512d __A, __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_round_pd (__m512d __W, __mmask8 __U, __m512d __A, // __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // const int __R) // { // return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_round_ps (__m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_round_ps (__m512 __W, __mmask16 __U, __m512 __A, // __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_round_ps (__mmask16 __U, __m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // #else // #define _mm512_max_round_pd(A, B, R) \ // (__m512d)__builtin_ia32_maxpd512_mask(A, B, (__v8df)_mm512_undefined_pd(), -1, R) // #define _mm512_mask_max_round_pd(W, U, A, B, R) \ // (__m512d)__builtin_ia32_maxpd512_mask(A, B, W, U, R) // #define _mm512_maskz_max_round_pd(U, A, B, R) \ // (__m512d)__builtin_ia32_maxpd512_mask(A, B, (__v8df)_mm512_setzero_pd(), U, R) // #define _mm512_max_round_ps(A, B, R) \ // (__m512)__builtin_ia32_maxps512_mask(A, B, (__v16sf)_mm512_undefined_pd(), -1, R) // #define _mm512_mask_max_round_ps(W, U, A, B, R) \ // (__m512)__builtin_ia32_maxps512_mask(A, B, W, U, R) // #define _mm512_maskz_max_round_ps(U, A, B, R) \ // (__m512)__builtin_ia32_maxps512_mask(A, B, (__v16sf)_mm512_setzero_ps(), U, R) // #define _mm512_min_round_pd(A, B, R) \ // (__m512d)__builtin_ia32_minpd512_mask(A, B, (__v8df)_mm512_undefined_pd(), -1, R) // #define _mm512_mask_min_round_pd(W, U, A, B, R) \ // (__m512d)__builtin_ia32_minpd512_mask(A, B, W, U, R) // #define _mm512_maskz_min_round_pd(U, A, B, R) \ // (__m512d)__builtin_ia32_minpd512_mask(A, B, (__v8df)_mm512_setzero_pd(), U, R) // #define _mm512_min_round_ps(A, B, R) \ // (__m512)__builtin_ia32_minps512_mask(A, B, (__v16sf)_mm512_undefined_ps(), -1, R) // #define _mm512_mask_min_round_ps(W, U, A, B, R) \ // (__m512)__builtin_ia32_minps512_mask(A, B, W, U, R) // #define _mm512_maskz_min_round_ps(U, A, B, R) \ // (__m512)__builtin_ia32_minps512_mask(A, B, (__v16sf)_mm512_setzero_ps(), U, R) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_scalef_round_pd (__m512d __A, __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_scalefpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_scalef_round_pd (__m512d __W, __mmask8 __U, __m512d __A, // __m512d __B, const int __R) // { // return (__m512d) __builtin_ia32_scalefpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_scalef_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // const int __R) // { // return (__m512d) __builtin_ia32_scalefpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_scalef_round_ps (__m512 __A, __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_scalefps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_scalef_round_ps (__m512 __W, __mmask16 __U, __m512 __A, // __m512 __B, const int __R) // { // return (__m512) __builtin_ia32_scalefps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_scalef_round_ps (__mmask16 __U, __m512 __A, __m512 __B, // const int __R) // { // return (__m512) __builtin_ia32_scalefps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_scalef_round_sd (__m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_scalefsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_scalef_round_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_scalefsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_scalef_round_sd (__mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_scalefsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_scalef_round_ss (__m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_scalefss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_scalef_round_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_scalefss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_scalef_round_ss (__mmask8 __U, __m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_scalefss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, __R); // } // #else // #define _mm512_scalef_round_pd(A, B, C) \ // ((__m512d) \ // __builtin_ia32_scalefpd512_mask((A), (B), \ // (__v8df) _mm512_undefined_pd(), \ // -1, (C))) // #define _mm512_mask_scalef_round_pd(W, U, A, B, C) \ // ((__m512d) __builtin_ia32_scalefpd512_mask((A), (B), (W), (U), (C))) // #define _mm512_maskz_scalef_round_pd(U, A, B, C) \ // ((__m512d) \ // __builtin_ia32_scalefpd512_mask((A), (B), \ // (__v8df) _mm512_setzero_pd(), \ // (U), (C))) // #define _mm512_scalef_round_ps(A, B, C) \ // ((__m512) \ // __builtin_ia32_scalefps512_mask((A), (B), \ // (__v16sf) _mm512_undefined_ps(), \ // -1, (C))) // #define _mm512_mask_scalef_round_ps(W, U, A, B, C) \ // ((__m512) __builtin_ia32_scalefps512_mask((A), (B), (W), (U), (C))) // #define _mm512_maskz_scalef_round_ps(U, A, B, C) \ // ((__m512) \ // __builtin_ia32_scalefps512_mask((A), (B), \ // (__v16sf) _mm512_setzero_ps(), \ // (U), (C))) // #define _mm_scalef_round_sd(A, B, C) \ // ((__m128d) \ // __builtin_ia32_scalefsd_mask_round ((A), (B), \ // (__v2df) _mm_undefined_pd (), \ // -1, (C))) // #define _mm_scalef_round_ss(A, B, C) \ // ((__m128) \ // __builtin_ia32_scalefss_mask_round ((A), (B), \ // (__v4sf) _mm_undefined_ps (), \ // -1, (C))) // #define _mm_mask_scalef_round_sd(W, U, A, B, C) \ // ((__m128d) \ // __builtin_ia32_scalefsd_mask_round ((A), (B), (W), (U), (C))) // #define _mm_mask_scalef_round_ss(W, U, A, B, C) \ // ((__m128) \ // __builtin_ia32_scalefss_mask_round ((A), (B), (W), (U), (C))) // #define _mm_maskz_scalef_round_sd(U, A, B, C) \ // ((__m128d) \ // __builtin_ia32_scalefsd_mask_round ((A), (B), \ // (__v2df) _mm_setzero_pd (), \ // (U), (C))) // #define _mm_maskz_scalef_round_ss(U, A, B, C) \ // ((__m128) \ // __builtin_ia32_scalefss_mask_round ((A), (B), \ // (__v4sf) _mm_setzero_ps (), \ // (U), (C))) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmadd_round_pd (__m512d __A, __m512d __B, __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmadd_round_pd (__m512d __A, __mmask8 __U, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmadd_round_pd (__m512d __A, __m512d __B, __m512d __C, // __mmask8 __U, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmadd_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmadd_round_ps (__m512 __A, __m512 __B, __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmadd_round_ps (__m512 __A, __mmask16 __U, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmadd_round_ps (__m512 __A, __m512 __B, __m512 __C, // __mmask16 __U, const int __R) // { // return (__m512) __builtin_ia32_vfmaddps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmadd_round_ps (__mmask16 __U, __m512 __A, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmaddps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmsub_round_pd (__m512d __A, __m512d __B, __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmsub_round_pd (__m512d __A, __mmask8 __U, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmsub_round_pd (__m512d __A, __m512d __B, __m512d __C, // __mmask8 __U, const int __R) // { // return (__m512d) __builtin_ia32_vfmsubpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmsub_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmsubpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmsub_round_ps (__m512 __A, __m512 __B, __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmsub_round_ps (__m512 __A, __mmask16 __U, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmsub_round_ps (__m512 __A, __m512 __B, __m512 __C, // __mmask16 __U, const int __R) // { // return (__m512) __builtin_ia32_vfmsubps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmsub_round_ps (__mmask16 __U, __m512 __A, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmsubps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmaddsub_round_pd (__m512d __A, __m512d __B, __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmaddsub_round_pd (__m512d __A, __mmask8 __U, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmaddsub_round_pd (__m512d __A, __m512d __B, __m512d __C, // __mmask8 __U, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmaddsub_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmaddsub_round_ps (__m512 __A, __m512 __B, __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmaddsub_round_ps (__m512 __A, __mmask16 __U, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmaddsub_round_ps (__m512 __A, __m512 __B, __m512 __C, // __mmask16 __U, const int __R) // { // return (__m512) __builtin_ia32_vfmaddsubps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmaddsub_round_ps (__mmask16 __U, __m512 __A, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmaddsubps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmsubadd_round_pd (__m512d __A, __m512d __B, __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, // (__v8df) __B, // -(__v8df) __C, // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmsubadd_round_pd (__m512d __A, __mmask8 __U, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, // (__v8df) __B, // -(__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmsubadd_round_pd (__m512d __A, __m512d __B, __m512d __C, // __mmask8 __U, const int __R) // { // return (__m512d) __builtin_ia32_vfmsubaddpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmsubadd_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_maskz ((__v8df) __A, // (__v8df) __B, // -(__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmsubadd_round_ps (__m512 __A, __m512 __B, __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // -(__v16sf) __C, // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmsubadd_round_ps (__m512 __A, __mmask16 __U, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // -(__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmsubadd_round_ps (__m512 __A, __m512 __B, __m512 __C, // __mmask16 __U, const int __R) // { // return (__m512) __builtin_ia32_vfmsubaddps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmsubadd_round_ps (__mmask16 __U, __m512 __A, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfmaddsubps512_maskz ((__v16sf) __A, // (__v16sf) __B, // -(__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fnmadd_round_pd (__m512d __A, __m512d __B, __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfnmaddpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fnmadd_round_pd (__m512d __A, __mmask8 __U, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfnmaddpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fnmadd_round_pd (__m512d __A, __m512d __B, __m512d __C, // __mmask8 __U, const int __R) // { // return (__m512d) __builtin_ia32_vfnmaddpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fnmadd_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfnmaddpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fnmadd_round_ps (__m512 __A, __m512 __B, __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfnmaddps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fnmadd_round_ps (__m512 __A, __mmask16 __U, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfnmaddps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fnmadd_round_ps (__m512 __A, __m512 __B, __m512 __C, // __mmask16 __U, const int __R) // { // return (__m512) __builtin_ia32_vfnmaddps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fnmadd_round_ps (__mmask16 __U, __m512 __A, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfnmaddps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fnmsub_round_pd (__m512d __A, __m512d __B, __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfnmsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fnmsub_round_pd (__m512d __A, __mmask8 __U, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfnmsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fnmsub_round_pd (__m512d __A, __m512d __B, __m512d __C, // __mmask8 __U, const int __R) // { // return (__m512d) __builtin_ia32_vfnmsubpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fnmsub_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // __m512d __C, const int __R) // { // return (__m512d) __builtin_ia32_vfnmsubpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fnmsub_round_ps (__m512 __A, __m512 __B, __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfnmsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fnmsub_round_ps (__m512 __A, __mmask16 __U, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfnmsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fnmsub_round_ps (__m512 __A, __m512 __B, __m512 __C, // __mmask16 __U, const int __R) // { // return (__m512) __builtin_ia32_vfnmsubps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fnmsub_round_ps (__mmask16 __U, __m512 __A, __m512 __B, // __m512 __C, const int __R) // { // return (__m512) __builtin_ia32_vfnmsubps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, __R); // } // #else // #define _mm512_fmadd_round_pd(A, B, C, R) \ // (__m512d)__builtin_ia32_vfmaddpd512_mask(A, B, C, -1, R) // #define _mm512_mask_fmadd_round_pd(A, U, B, C, R) \ // (__m512d)__builtin_ia32_vfmaddpd512_mask(A, B, C, U, R) // #define _mm512_mask3_fmadd_round_pd(A, B, C, U, R) \ // (__m512d)__builtin_ia32_vfmaddpd512_mask3(A, B, C, U, R) // #define _mm512_maskz_fmadd_round_pd(U, A, B, C, R) \ // (__m512d)__builtin_ia32_vfmaddpd512_maskz(A, B, C, U, R) // #define _mm512_fmadd_round_ps(A, B, C, R) \ // (__m512)__builtin_ia32_vfmaddps512_mask(A, B, C, -1, R) // #define _mm512_mask_fmadd_round_ps(A, U, B, C, R) \ // (__m512)__builtin_ia32_vfmaddps512_mask(A, B, C, U, R) // #define _mm512_mask3_fmadd_round_ps(A, B, C, U, R) \ // (__m512)__builtin_ia32_vfmaddps512_mask3(A, B, C, U, R) // #define _mm512_maskz_fmadd_round_ps(U, A, B, C, R) \ // (__m512)__builtin_ia32_vfmaddps512_maskz(A, B, C, U, R) // #define _mm512_fmsub_round_pd(A, B, C, R) \ // (__m512d)__builtin_ia32_vfmsubpd512_mask(A, B, C, -1, R) // #define _mm512_mask_fmsub_round_pd(A, U, B, C, R) \ // (__m512d)__builtin_ia32_vfmsubpd512_mask(A, B, C, U, R) // #define _mm512_mask3_fmsub_round_pd(A, B, C, U, R) \ // (__m512d)__builtin_ia32_vfmsubpd512_mask3(A, B, C, U, R) // #define _mm512_maskz_fmsub_round_pd(U, A, B, C, R) \ // (__m512d)__builtin_ia32_vfmsubpd512_maskz(A, B, C, U, R) // #define _mm512_fmsub_round_ps(A, B, C, R) \ // (__m512)__builtin_ia32_vfmsubps512_mask(A, B, C, -1, R) // #define _mm512_mask_fmsub_round_ps(A, U, B, C, R) \ // (__m512)__builtin_ia32_vfmsubps512_mask(A, B, C, U, R) // #define _mm512_mask3_fmsub_round_ps(A, B, C, U, R) \ // (__m512)__builtin_ia32_vfmsubps512_mask3(A, B, C, U, R) // #define _mm512_maskz_fmsub_round_ps(U, A, B, C, R) \ // (__m512)__builtin_ia32_vfmsubps512_maskz(A, B, C, U, R) // #define _mm512_fmaddsub_round_pd(A, B, C, R) \ // (__m512d)__builtin_ia32_vfmaddsubpd512_mask(A, B, C, -1, R) // #define _mm512_mask_fmaddsub_round_pd(A, U, B, C, R) \ // (__m512d)__builtin_ia32_vfmaddsubpd512_mask(A, B, C, U, R) // #define _mm512_mask3_fmaddsub_round_pd(A, B, C, U, R) \ // (__m512d)__builtin_ia32_vfmaddsubpd512_mask3(A, B, C, U, R) // #define _mm512_maskz_fmaddsub_round_pd(U, A, B, C, R) \ // (__m512d)__builtin_ia32_vfmaddsubpd512_maskz(A, B, C, U, R) // #define _mm512_fmaddsub_round_ps(A, B, C, R) \ // (__m512)__builtin_ia32_vfmaddsubps512_mask(A, B, C, -1, R) // #define _mm512_mask_fmaddsub_round_ps(A, U, B, C, R) \ // (__m512)__builtin_ia32_vfmaddsubps512_mask(A, B, C, U, R) // #define _mm512_mask3_fmaddsub_round_ps(A, B, C, U, R) \ // (__m512)__builtin_ia32_vfmaddsubps512_mask3(A, B, C, U, R) // #define _mm512_maskz_fmaddsub_round_ps(U, A, B, C, R) \ // (__m512)__builtin_ia32_vfmaddsubps512_maskz(A, B, C, U, R) // #define _mm512_fmsubadd_round_pd(A, B, C, R) \ // (__m512d)__builtin_ia32_vfmaddsubpd512_mask(A, B, -(C), -1, R) // #define _mm512_mask_fmsubadd_round_pd(A, U, B, C, R) \ // (__m512d)__builtin_ia32_vfmaddsubpd512_mask(A, B, -(C), U, R) // #define _mm512_mask3_fmsubadd_round_pd(A, B, C, U, R) \ // (__m512d)__builtin_ia32_vfmsubaddpd512_mask3(A, B, C, U, R) // #define _mm512_maskz_fmsubadd_round_pd(U, A, B, C, R) \ // (__m512d)__builtin_ia32_vfmaddsubpd512_maskz(A, B, -(C), U, R) // #define _mm512_fmsubadd_round_ps(A, B, C, R) \ // (__m512)__builtin_ia32_vfmaddsubps512_mask(A, B, -(C), -1, R) // #define _mm512_mask_fmsubadd_round_ps(A, U, B, C, R) \ // (__m512)__builtin_ia32_vfmaddsubps512_mask(A, B, -(C), U, R) // #define _mm512_mask3_fmsubadd_round_ps(A, B, C, U, R) \ // (__m512)__builtin_ia32_vfmsubaddps512_mask3(A, B, C, U, R) // #define _mm512_maskz_fmsubadd_round_ps(U, A, B, C, R) \ // (__m512)__builtin_ia32_vfmaddsubps512_maskz(A, B, -(C), U, R) // #define _mm512_fnmadd_round_pd(A, B, C, R) \ // (__m512d)__builtin_ia32_vfnmaddpd512_mask(A, B, C, -1, R) // #define _mm512_mask_fnmadd_round_pd(A, U, B, C, R) \ // (__m512d)__builtin_ia32_vfnmaddpd512_mask(A, B, C, U, R) // #define _mm512_mask3_fnmadd_round_pd(A, B, C, U, R) \ // (__m512d)__builtin_ia32_vfnmaddpd512_mask3(A, B, C, U, R) // #define _mm512_maskz_fnmadd_round_pd(U, A, B, C, R) \ // (__m512d)__builtin_ia32_vfnmaddpd512_maskz(A, B, C, U, R) // #define _mm512_fnmadd_round_ps(A, B, C, R) \ // (__m512)__builtin_ia32_vfnmaddps512_mask(A, B, C, -1, R) // #define _mm512_mask_fnmadd_round_ps(A, U, B, C, R) \ // (__m512)__builtin_ia32_vfnmaddps512_mask(A, B, C, U, R) // #define _mm512_mask3_fnmadd_round_ps(A, B, C, U, R) \ // (__m512)__builtin_ia32_vfnmaddps512_mask3(A, B, C, U, R) // #define _mm512_maskz_fnmadd_round_ps(U, A, B, C, R) \ // (__m512)__builtin_ia32_vfnmaddps512_maskz(A, B, C, U, R) // #define _mm512_fnmsub_round_pd(A, B, C, R) \ // (__m512d)__builtin_ia32_vfnmsubpd512_mask(A, B, C, -1, R) // #define _mm512_mask_fnmsub_round_pd(A, U, B, C, R) \ // (__m512d)__builtin_ia32_vfnmsubpd512_mask(A, B, C, U, R) // #define _mm512_mask3_fnmsub_round_pd(A, B, C, U, R) \ // (__m512d)__builtin_ia32_vfnmsubpd512_mask3(A, B, C, U, R) // #define _mm512_maskz_fnmsub_round_pd(U, A, B, C, R) \ // (__m512d)__builtin_ia32_vfnmsubpd512_maskz(A, B, C, U, R) // #define _mm512_fnmsub_round_ps(A, B, C, R) \ // (__m512)__builtin_ia32_vfnmsubps512_mask(A, B, C, -1, R) // #define _mm512_mask_fnmsub_round_ps(A, U, B, C, R) \ // (__m512)__builtin_ia32_vfnmsubps512_mask(A, B, C, U, R) // #define _mm512_mask3_fnmsub_round_ps(A, B, C, U, R) \ // (__m512)__builtin_ia32_vfnmsubps512_mask3(A, B, C, U, R) // #define _mm512_maskz_fnmsub_round_ps(U, A, B, C, R) \ // (__m512)__builtin_ia32_vfnmsubps512_maskz(A, B, C, U, R) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_abs_epi64 (__m512i __A) // { // return (__m512i) __builtin_ia32_pabsq512_mask ((__v8di) __A, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_abs_epi64 (__m512i __W, __mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_pabsq512_mask ((__v8di) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_abs_epi64 (__mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_pabsq512_mask ((__v8di) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_abs_epi32 (__m512i __A) // { // return (__m512i) __builtin_ia32_pabsd512_mask ((__v16si) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_abs_epi32 (__m512i __W, __mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_pabsd512_mask ((__v16si) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_abs_epi32 (__mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_pabsd512_mask ((__v16si) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcastss_ps (__m128 __A) // { // return (__m512) __builtin_ia32_broadcastss512 ((__v4sf) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcastss_ps (__m512 __O, __mmask16 __M, __m128 __A) // { // return (__m512) __builtin_ia32_broadcastss512 ((__v4sf) __A, // (__v16sf) __O, __M); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcastss_ps (__mmask16 __M, __m128 __A) // { // return (__m512) __builtin_ia32_broadcastss512 ((__v4sf) __A, // (__v16sf) // _mm512_setzero_ps (), // __M); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcastsd_pd (__m128d __A) // { // return (__m512d) __builtin_ia32_broadcastsd512 ((__v2df) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcastsd_pd (__m512d __O, __mmask8 __M, __m128d __A) // { // return (__m512d) __builtin_ia32_broadcastsd512 ((__v2df) __A, // (__v8df) __O, __M); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcastsd_pd (__mmask8 __M, __m128d __A) // { // return (__m512d) __builtin_ia32_broadcastsd512 ((__v2df) __A, // (__v8df) // _mm512_setzero_pd (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcastd_epi32 (__m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastd512 ((__v4si) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcastd_epi32 (__m512i __O, __mmask16 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastd512 ((__v4si) __A, // (__v16si) __O, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcastd_epi32 (__mmask16 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastd512 ((__v4si) __A, // (__v16si) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_set1_epi32 (int __A) // { // return (__m512i) __builtin_ia32_pbroadcastd512_gpr_mask (__A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16)(-1)); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_set1_epi32 (__m512i __O, __mmask16 __M, int __A) // { // return (__m512i) __builtin_ia32_pbroadcastd512_gpr_mask (__A, (__v16si) __O, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_set1_epi32 (__mmask16 __M, int __A) // { // return (__m512i) // __builtin_ia32_pbroadcastd512_gpr_mask (__A, // (__v16si) _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcastq_epi64 (__m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastq512 ((__v2di) __A, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcastq_epi64 (__m512i __O, __mmask8 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastq512 ((__v2di) __A, // (__v8di) __O, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcastq_epi64 (__mmask8 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_pbroadcastq512 ((__v2di) __A, // (__v8di) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_set1_epi64 (long long __A) // { // return (__m512i) __builtin_ia32_pbroadcastq512_gpr_mask (__A, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8)(-1)); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_set1_epi64 (__m512i __O, __mmask8 __M, long long __A) // { // return (__m512i) __builtin_ia32_pbroadcastq512_gpr_mask (__A, (__v8di) __O, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_set1_epi64 (__mmask8 __M, long long __A) // { // return (__m512i) // __builtin_ia32_pbroadcastq512_gpr_mask (__A, // (__v8di) _mm512_setzero_si512 (), // __M); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcast_f32x4 (__m128 __A) // { // return (__m512) __builtin_ia32_broadcastf32x4_512 ((__v4sf) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcast_f32x4 (__m512 __O, __mmask16 __M, __m128 __A) // { // return (__m512) __builtin_ia32_broadcastf32x4_512 ((__v4sf) __A, // (__v16sf) __O, // __M); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcast_f32x4 (__mmask16 __M, __m128 __A) // { // return (__m512) __builtin_ia32_broadcastf32x4_512 ((__v4sf) __A, // (__v16sf) // _mm512_setzero_ps (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcast_i32x4 (__m128i __A) // { // return (__m512i) __builtin_ia32_broadcasti32x4_512 ((__v4si) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcast_i32x4 (__m512i __O, __mmask16 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_broadcasti32x4_512 ((__v4si) __A, // (__v16si) __O, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcast_i32x4 (__mmask16 __M, __m128i __A) // { // return (__m512i) __builtin_ia32_broadcasti32x4_512 ((__v4si) __A, // (__v16si) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcast_f64x4 (__m256d __A) // { // return (__m512d) __builtin_ia32_broadcastf64x4_512 ((__v4df) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcast_f64x4 (__m512d __O, __mmask8 __M, __m256d __A) // { // return (__m512d) __builtin_ia32_broadcastf64x4_512 ((__v4df) __A, // (__v8df) __O, // __M); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcast_f64x4 (__mmask8 __M, __m256d __A) // { // return (__m512d) __builtin_ia32_broadcastf64x4_512 ((__v4df) __A, // (__v8df) // _mm512_setzero_pd (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_broadcast_i64x4 (__m256i __A) // { // return (__m512i) __builtin_ia32_broadcasti64x4_512 ((__v4di) __A, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_broadcast_i64x4 (__m512i __O, __mmask8 __M, __m256i __A) // { // return (__m512i) __builtin_ia32_broadcasti64x4_512 ((__v4di) __A, // (__v8di) __O, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_broadcast_i64x4 (__mmask8 __M, __m256i __A) // { // return (__m512i) __builtin_ia32_broadcasti64x4_512 ((__v4di) __A, // (__v8di) // _mm512_setzero_si512 (), // __M); // } // typedef enum // { // _MM_PERM_AAAA = 0x00, _MM_PERM_AAAB = 0x01, _MM_PERM_AAAC = 0x02, // _MM_PERM_AAAD = 0x03, _MM_PERM_AABA = 0x04, _MM_PERM_AABB = 0x05, // _MM_PERM_AABC = 0x06, _MM_PERM_AABD = 0x07, _MM_PERM_AACA = 0x08, // _MM_PERM_AACB = 0x09, _MM_PERM_AACC = 0x0A, _MM_PERM_AACD = 0x0B, // _MM_PERM_AADA = 0x0C, _MM_PERM_AADB = 0x0D, _MM_PERM_AADC = 0x0E, // _MM_PERM_AADD = 0x0F, _MM_PERM_ABAA = 0x10, _MM_PERM_ABAB = 0x11, // _MM_PERM_ABAC = 0x12, _MM_PERM_ABAD = 0x13, _MM_PERM_ABBA = 0x14, // _MM_PERM_ABBB = 0x15, _MM_PERM_ABBC = 0x16, _MM_PERM_ABBD = 0x17, // _MM_PERM_ABCA = 0x18, _MM_PERM_ABCB = 0x19, _MM_PERM_ABCC = 0x1A, // _MM_PERM_ABCD = 0x1B, _MM_PERM_ABDA = 0x1C, _MM_PERM_ABDB = 0x1D, // _MM_PERM_ABDC = 0x1E, _MM_PERM_ABDD = 0x1F, _MM_PERM_ACAA = 0x20, // _MM_PERM_ACAB = 0x21, _MM_PERM_ACAC = 0x22, _MM_PERM_ACAD = 0x23, // _MM_PERM_ACBA = 0x24, _MM_PERM_ACBB = 0x25, _MM_PERM_ACBC = 0x26, // _MM_PERM_ACBD = 0x27, _MM_PERM_ACCA = 0x28, _MM_PERM_ACCB = 0x29, // _MM_PERM_ACCC = 0x2A, _MM_PERM_ACCD = 0x2B, _MM_PERM_ACDA = 0x2C, // _MM_PERM_ACDB = 0x2D, _MM_PERM_ACDC = 0x2E, _MM_PERM_ACDD = 0x2F, // _MM_PERM_ADAA = 0x30, _MM_PERM_ADAB = 0x31, _MM_PERM_ADAC = 0x32, // _MM_PERM_ADAD = 0x33, _MM_PERM_ADBA = 0x34, _MM_PERM_ADBB = 0x35, // _MM_PERM_ADBC = 0x36, _MM_PERM_ADBD = 0x37, _MM_PERM_ADCA = 0x38, // _MM_PERM_ADCB = 0x39, _MM_PERM_ADCC = 0x3A, _MM_PERM_ADCD = 0x3B, // _MM_PERM_ADDA = 0x3C, _MM_PERM_ADDB = 0x3D, _MM_PERM_ADDC = 0x3E, // _MM_PERM_ADDD = 0x3F, _MM_PERM_BAAA = 0x40, _MM_PERM_BAAB = 0x41, // _MM_PERM_BAAC = 0x42, _MM_PERM_BAAD = 0x43, _MM_PERM_BABA = 0x44, // _MM_PERM_BABB = 0x45, _MM_PERM_BABC = 0x46, _MM_PERM_BABD = 0x47, // _MM_PERM_BACA = 0x48, _MM_PERM_BACB = 0x49, _MM_PERM_BACC = 0x4A, // _MM_PERM_BACD = 0x4B, _MM_PERM_BADA = 0x4C, _MM_PERM_BADB = 0x4D, // _MM_PERM_BADC = 0x4E, _MM_PERM_BADD = 0x4F, _MM_PERM_BBAA = 0x50, // _MM_PERM_BBAB = 0x51, _MM_PERM_BBAC = 0x52, _MM_PERM_BBAD = 0x53, // _MM_PERM_BBBA = 0x54, _MM_PERM_BBBB = 0x55, _MM_PERM_BBBC = 0x56, // _MM_PERM_BBBD = 0x57, _MM_PERM_BBCA = 0x58, _MM_PERM_BBCB = 0x59, // _MM_PERM_BBCC = 0x5A, _MM_PERM_BBCD = 0x5B, _MM_PERM_BBDA = 0x5C, // _MM_PERM_BBDB = 0x5D, _MM_PERM_BBDC = 0x5E, _MM_PERM_BBDD = 0x5F, // _MM_PERM_BCAA = 0x60, _MM_PERM_BCAB = 0x61, _MM_PERM_BCAC = 0x62, // _MM_PERM_BCAD = 0x63, _MM_PERM_BCBA = 0x64, _MM_PERM_BCBB = 0x65, // _MM_PERM_BCBC = 0x66, _MM_PERM_BCBD = 0x67, _MM_PERM_BCCA = 0x68, // _MM_PERM_BCCB = 0x69, _MM_PERM_BCCC = 0x6A, _MM_PERM_BCCD = 0x6B, // _MM_PERM_BCDA = 0x6C, _MM_PERM_BCDB = 0x6D, _MM_PERM_BCDC = 0x6E, // _MM_PERM_BCDD = 0x6F, _MM_PERM_BDAA = 0x70, _MM_PERM_BDAB = 0x71, // _MM_PERM_BDAC = 0x72, _MM_PERM_BDAD = 0x73, _MM_PERM_BDBA = 0x74, // _MM_PERM_BDBB = 0x75, _MM_PERM_BDBC = 0x76, _MM_PERM_BDBD = 0x77, // _MM_PERM_BDCA = 0x78, _MM_PERM_BDCB = 0x79, _MM_PERM_BDCC = 0x7A, // _MM_PERM_BDCD = 0x7B, _MM_PERM_BDDA = 0x7C, _MM_PERM_BDDB = 0x7D, // _MM_PERM_BDDC = 0x7E, _MM_PERM_BDDD = 0x7F, _MM_PERM_CAAA = 0x80, // _MM_PERM_CAAB = 0x81, _MM_PERM_CAAC = 0x82, _MM_PERM_CAAD = 0x83, // _MM_PERM_CABA = 0x84, _MM_PERM_CABB = 0x85, _MM_PERM_CABC = 0x86, // _MM_PERM_CABD = 0x87, _MM_PERM_CACA = 0x88, _MM_PERM_CACB = 0x89, // _MM_PERM_CACC = 0x8A, _MM_PERM_CACD = 0x8B, _MM_PERM_CADA = 0x8C, // _MM_PERM_CADB = 0x8D, _MM_PERM_CADC = 0x8E, _MM_PERM_CADD = 0x8F, // _MM_PERM_CBAA = 0x90, _MM_PERM_CBAB = 0x91, _MM_PERM_CBAC = 0x92, // _MM_PERM_CBAD = 0x93, _MM_PERM_CBBA = 0x94, _MM_PERM_CBBB = 0x95, // _MM_PERM_CBBC = 0x96, _MM_PERM_CBBD = 0x97, _MM_PERM_CBCA = 0x98, // _MM_PERM_CBCB = 0x99, _MM_PERM_CBCC = 0x9A, _MM_PERM_CBCD = 0x9B, // _MM_PERM_CBDA = 0x9C, _MM_PERM_CBDB = 0x9D, _MM_PERM_CBDC = 0x9E, // _MM_PERM_CBDD = 0x9F, _MM_PERM_CCAA = 0xA0, _MM_PERM_CCAB = 0xA1, // _MM_PERM_CCAC = 0xA2, _MM_PERM_CCAD = 0xA3, _MM_PERM_CCBA = 0xA4, // _MM_PERM_CCBB = 0xA5, _MM_PERM_CCBC = 0xA6, _MM_PERM_CCBD = 0xA7, // _MM_PERM_CCCA = 0xA8, _MM_PERM_CCCB = 0xA9, _MM_PERM_CCCC = 0xAA, // _MM_PERM_CCCD = 0xAB, _MM_PERM_CCDA = 0xAC, _MM_PERM_CCDB = 0xAD, // _MM_PERM_CCDC = 0xAE, _MM_PERM_CCDD = 0xAF, _MM_PERM_CDAA = 0xB0, // _MM_PERM_CDAB = 0xB1, _MM_PERM_CDAC = 0xB2, _MM_PERM_CDAD = 0xB3, // _MM_PERM_CDBA = 0xB4, _MM_PERM_CDBB = 0xB5, _MM_PERM_CDBC = 0xB6, // _MM_PERM_CDBD = 0xB7, _MM_PERM_CDCA = 0xB8, _MM_PERM_CDCB = 0xB9, // _MM_PERM_CDCC = 0xBA, _MM_PERM_CDCD = 0xBB, _MM_PERM_CDDA = 0xBC, // _MM_PERM_CDDB = 0xBD, _MM_PERM_CDDC = 0xBE, _MM_PERM_CDDD = 0xBF, // _MM_PERM_DAAA = 0xC0, _MM_PERM_DAAB = 0xC1, _MM_PERM_DAAC = 0xC2, // _MM_PERM_DAAD = 0xC3, _MM_PERM_DABA = 0xC4, _MM_PERM_DABB = 0xC5, // _MM_PERM_DABC = 0xC6, _MM_PERM_DABD = 0xC7, _MM_PERM_DACA = 0xC8, // _MM_PERM_DACB = 0xC9, _MM_PERM_DACC = 0xCA, _MM_PERM_DACD = 0xCB, // _MM_PERM_DADA = 0xCC, _MM_PERM_DADB = 0xCD, _MM_PERM_DADC = 0xCE, // _MM_PERM_DADD = 0xCF, _MM_PERM_DBAA = 0xD0, _MM_PERM_DBAB = 0xD1, // _MM_PERM_DBAC = 0xD2, _MM_PERM_DBAD = 0xD3, _MM_PERM_DBBA = 0xD4, // _MM_PERM_DBBB = 0xD5, _MM_PERM_DBBC = 0xD6, _MM_PERM_DBBD = 0xD7, // _MM_PERM_DBCA = 0xD8, _MM_PERM_DBCB = 0xD9, _MM_PERM_DBCC = 0xDA, // _MM_PERM_DBCD = 0xDB, _MM_PERM_DBDA = 0xDC, _MM_PERM_DBDB = 0xDD, // _MM_PERM_DBDC = 0xDE, _MM_PERM_DBDD = 0xDF, _MM_PERM_DCAA = 0xE0, // _MM_PERM_DCAB = 0xE1, _MM_PERM_DCAC = 0xE2, _MM_PERM_DCAD = 0xE3, // _MM_PERM_DCBA = 0xE4, _MM_PERM_DCBB = 0xE5, _MM_PERM_DCBC = 0xE6, // _MM_PERM_DCBD = 0xE7, _MM_PERM_DCCA = 0xE8, _MM_PERM_DCCB = 0xE9, // _MM_PERM_DCCC = 0xEA, _MM_PERM_DCCD = 0xEB, _MM_PERM_DCDA = 0xEC, // _MM_PERM_DCDB = 0xED, _MM_PERM_DCDC = 0xEE, _MM_PERM_DCDD = 0xEF, // _MM_PERM_DDAA = 0xF0, _MM_PERM_DDAB = 0xF1, _MM_PERM_DDAC = 0xF2, // _MM_PERM_DDAD = 0xF3, _MM_PERM_DDBA = 0xF4, _MM_PERM_DDBB = 0xF5, // _MM_PERM_DDBC = 0xF6, _MM_PERM_DDBD = 0xF7, _MM_PERM_DDCA = 0xF8, // _MM_PERM_DDCB = 0xF9, _MM_PERM_DDCC = 0xFA, _MM_PERM_DDCD = 0xFB, // _MM_PERM_DDDA = 0xFC, _MM_PERM_DDDB = 0xFD, _MM_PERM_DDDC = 0xFE, // _MM_PERM_DDDD = 0xFF // } _MM_PERM_ENUM; // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shuffle_epi32 (__m512i __A, _MM_PERM_ENUM __mask) // { // return (__m512i) __builtin_ia32_pshufd512_mask ((__v16si) __A, // __mask, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shuffle_epi32 (__m512i __W, __mmask16 __U, __m512i __A, // _MM_PERM_ENUM __mask) // { // return (__m512i) __builtin_ia32_pshufd512_mask ((__v16si) __A, // __mask, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shuffle_epi32 (__mmask16 __U, __m512i __A, _MM_PERM_ENUM __mask) // { // return (__m512i) __builtin_ia32_pshufd512_mask ((__v16si) __A, // __mask, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shuffle_i64x2 (__m512i __A, __m512i __B, const int __imm) // { // return (__m512i) __builtin_ia32_shuf_i64x2_mask ((__v8di) __A, // (__v8di) __B, __imm, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shuffle_i64x2 (__m512i __W, __mmask8 __U, __m512i __A, // __m512i __B, const int __imm) // { // return (__m512i) __builtin_ia32_shuf_i64x2_mask ((__v8di) __A, // (__v8di) __B, __imm, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shuffle_i64x2 (__mmask8 __U, __m512i __A, __m512i __B, // const int __imm) // { // return (__m512i) __builtin_ia32_shuf_i64x2_mask ((__v8di) __A, // (__v8di) __B, __imm, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shuffle_i32x4 (__m512i __A, __m512i __B, const int __imm) // { // return (__m512i) __builtin_ia32_shuf_i32x4_mask ((__v16si) __A, // (__v16si) __B, // __imm, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shuffle_i32x4 (__m512i __W, __mmask16 __U, __m512i __A, // __m512i __B, const int __imm) // { // return (__m512i) __builtin_ia32_shuf_i32x4_mask ((__v16si) __A, // (__v16si) __B, // __imm, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shuffle_i32x4 (__mmask16 __U, __m512i __A, __m512i __B, // const int __imm) // { // return (__m512i) __builtin_ia32_shuf_i32x4_mask ((__v16si) __A, // (__v16si) __B, // __imm, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shuffle_f64x2 (__m512d __A, __m512d __B, const int __imm) // { // return (__m512d) __builtin_ia32_shuf_f64x2_mask ((__v8df) __A, // (__v8df) __B, __imm, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shuffle_f64x2 (__m512d __W, __mmask8 __U, __m512d __A, // __m512d __B, const int __imm) // { // return (__m512d) __builtin_ia32_shuf_f64x2_mask ((__v8df) __A, // (__v8df) __B, __imm, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shuffle_f64x2 (__mmask8 __U, __m512d __A, __m512d __B, // const int __imm) // { // return (__m512d) __builtin_ia32_shuf_f64x2_mask ((__v8df) __A, // (__v8df) __B, __imm, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shuffle_f32x4 (__m512 __A, __m512 __B, const int __imm) // { // return (__m512) __builtin_ia32_shuf_f32x4_mask ((__v16sf) __A, // (__v16sf) __B, __imm, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shuffle_f32x4 (__m512 __W, __mmask16 __U, __m512 __A, // __m512 __B, const int __imm) // { // return (__m512) __builtin_ia32_shuf_f32x4_mask ((__v16sf) __A, // (__v16sf) __B, __imm, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shuffle_f32x4 (__mmask16 __U, __m512 __A, __m512 __B, // const int __imm) // { // return (__m512) __builtin_ia32_shuf_f32x4_mask ((__v16sf) __A, // (__v16sf) __B, __imm, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // #else // #define _mm512_shuffle_epi32(X, C) \ // ((__m512i) __builtin_ia32_pshufd512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)_mm512_undefined_epi32 (),\ // (__mmask16)-1)) // #define _mm512_mask_shuffle_epi32(W, U, X, C) \ // ((__m512i) __builtin_ia32_pshufd512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)(W),\ // (__mmask16)(U))) // #define _mm512_maskz_shuffle_epi32(U, X, C) \ // ((__m512i) __builtin_ia32_pshufd512_mask ((__v16si)(__m512i)(X), (int)(C),\ // (__v16si)(__m512i)_mm512_setzero_si512 (),\ // (__mmask16)(U))) // #define _mm512_shuffle_i64x2(X, Y, C) \ // ((__m512i) __builtin_ia32_shuf_i64x2_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)(C),\ // (__v8di)(__m512i)_mm512_undefined_epi32 (),\ // (__mmask8)-1)) // #define _mm512_mask_shuffle_i64x2(W, U, X, Y, C) \ // ((__m512i) __builtin_ia32_shuf_i64x2_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)(C),\ // (__v8di)(__m512i)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_shuffle_i64x2(U, X, Y, C) \ // ((__m512i) __builtin_ia32_shuf_i64x2_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)(C),\ // (__v8di)(__m512i)_mm512_setzero_si512 (),\ // (__mmask8)(U))) // #define _mm512_shuffle_i32x4(X, Y, C) \ // ((__m512i) __builtin_ia32_shuf_i32x4_mask ((__v16si)(__m512i)(X), \ // (__v16si)(__m512i)(Y), (int)(C),\ // (__v16si)(__m512i)_mm512_undefined_epi32 (),\ // (__mmask16)-1)) // #define _mm512_mask_shuffle_i32x4(W, U, X, Y, C) \ // ((__m512i) __builtin_ia32_shuf_i32x4_mask ((__v16si)(__m512i)(X), \ // (__v16si)(__m512i)(Y), (int)(C),\ // (__v16si)(__m512i)(W),\ // (__mmask16)(U))) // #define _mm512_maskz_shuffle_i32x4(U, X, Y, C) \ // ((__m512i) __builtin_ia32_shuf_i32x4_mask ((__v16si)(__m512i)(X), \ // (__v16si)(__m512i)(Y), (int)(C),\ // (__v16si)(__m512i)_mm512_setzero_si512 (),\ // (__mmask16)(U))) // #define _mm512_shuffle_f64x2(X, Y, C) \ // ((__m512d) __builtin_ia32_shuf_f64x2_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (int)(C),\ // (__v8df)(__m512d)_mm512_undefined_pd(),\ // (__mmask8)-1)) // #define _mm512_mask_shuffle_f64x2(W, U, X, Y, C) \ // ((__m512d) __builtin_ia32_shuf_f64x2_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (int)(C),\ // (__v8df)(__m512d)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_shuffle_f64x2(U, X, Y, C) \ // ((__m512d) __builtin_ia32_shuf_f64x2_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (int)(C),\ // (__v8df)(__m512d)_mm512_setzero_pd(),\ // (__mmask8)(U))) // #define _mm512_shuffle_f32x4(X, Y, C) \ // ((__m512) __builtin_ia32_shuf_f32x4_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (int)(C),\ // (__v16sf)(__m512)_mm512_undefined_ps(),\ // (__mmask16)-1)) // #define _mm512_mask_shuffle_f32x4(W, U, X, Y, C) \ // ((__m512) __builtin_ia32_shuf_f32x4_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (int)(C),\ // (__v16sf)(__m512)(W),\ // (__mmask16)(U))) // #define _mm512_maskz_shuffle_f32x4(U, X, Y, C) \ // ((__m512) __builtin_ia32_shuf_f32x4_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (int)(C),\ // (__v16sf)(__m512)_mm512_setzero_ps(),\ // (__mmask16)(U))) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_rolv_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prolvd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_rolv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prolvd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_rolv_epi32 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prolvd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_rorv_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prorvd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_rorv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prorvd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_rorv_epi32 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prorvd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_rolv_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prolvq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_rolv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prolvq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_rolv_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prolvq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_rorv_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prorvq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_rorv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prorvq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_rorv_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_prorvq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtt_roundpd_epi32 (__m512d __A, const int __R) // { // return (__m256i) __builtin_ia32_cvttpd2dq512_mask ((__v8df) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtt_roundpd_epi32 (__m256i __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m256i) __builtin_ia32_cvttpd2dq512_mask ((__v8df) __A, // (__v8si) __W, // (__mmask8) __U, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtt_roundpd_epi32 (__mmask8 __U, __m512d __A, const int __R) // { // return (__m256i) __builtin_ia32_cvttpd2dq512_mask ((__v8df) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtt_roundpd_epu32 (__m512d __A, const int __R) // { // return (__m256i) __builtin_ia32_cvttpd2udq512_mask ((__v8df) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtt_roundpd_epu32 (__m256i __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m256i) __builtin_ia32_cvttpd2udq512_mask ((__v8df) __A, // (__v8si) __W, // (__mmask8) __U, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtt_roundpd_epu32 (__mmask8 __U, __m512d __A, const int __R) // { // return (__m256i) __builtin_ia32_cvttpd2udq512_mask ((__v8df) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U, __R); // } // #else // #define _mm512_cvtt_roundpd_epi32(A, B) \ // ((__m256i)__builtin_ia32_cvttpd2dq512_mask(A, (__v8si)_mm256_undefined_si256(), -1, B)) // #define _mm512_mask_cvtt_roundpd_epi32(W, U, A, B) \ // ((__m256i)__builtin_ia32_cvttpd2dq512_mask(A, (__v8si)(W), U, B)) // #define _mm512_maskz_cvtt_roundpd_epi32(U, A, B) \ // ((__m256i)__builtin_ia32_cvttpd2dq512_mask(A, (__v8si)_mm256_setzero_si256(), U, B)) // #define _mm512_cvtt_roundpd_epu32(A, B) \ // ((__m256i)__builtin_ia32_cvttpd2udq512_mask(A, (__v8si)_mm256_undefined_si256(), -1, B)) // #define _mm512_mask_cvtt_roundpd_epu32(W, U, A, B) \ // ((__m256i)__builtin_ia32_cvttpd2udq512_mask(A, (__v8si)(W), U, B)) // #define _mm512_maskz_cvtt_roundpd_epu32(U, A, B) \ // ((__m256i)__builtin_ia32_cvttpd2udq512_mask(A, (__v8si)_mm256_setzero_si256(), U, B)) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundpd_epi32 (__m512d __A, const int __R) // { // return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundpd_epi32 (__m256i __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A, // (__v8si) __W, // (__mmask8) __U, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundpd_epi32 (__mmask8 __U, __m512d __A, const int __R) // { // return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundpd_epu32 (__m512d __A, const int __R) // { // return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundpd_epu32 (__m256i __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A, // (__v8si) __W, // (__mmask8) __U, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundpd_epu32 (__mmask8 __U, __m512d __A, const int __R) // { // return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U, __R); // } // #else // #define _mm512_cvt_roundpd_epi32(A, B) \ // ((__m256i)__builtin_ia32_cvtpd2dq512_mask(A, (__v8si)_mm256_undefined_si256(), -1, B)) // #define _mm512_mask_cvt_roundpd_epi32(W, U, A, B) \ // ((__m256i)__builtin_ia32_cvtpd2dq512_mask(A, (__v8si)(W), U, B)) // #define _mm512_maskz_cvt_roundpd_epi32(U, A, B) \ // ((__m256i)__builtin_ia32_cvtpd2dq512_mask(A, (__v8si)_mm256_setzero_si256(), U, B)) // #define _mm512_cvt_roundpd_epu32(A, B) \ // ((__m256i)__builtin_ia32_cvtpd2udq512_mask(A, (__v8si)_mm256_undefined_si256(), -1, B)) // #define _mm512_mask_cvt_roundpd_epu32(W, U, A, B) \ // ((__m256i)__builtin_ia32_cvtpd2udq512_mask(A, (__v8si)(W), U, B)) // #define _mm512_maskz_cvt_roundpd_epu32(U, A, B) \ // ((__m256i)__builtin_ia32_cvtpd2udq512_mask(A, (__v8si)_mm256_setzero_si256(), U, B)) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtt_roundps_epi32 (__m512 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvttps2dq512_mask ((__v16sf) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1, __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtt_roundps_epi32 (__m512i __W, __mmask16 __U, __m512 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvttps2dq512_mask ((__v16sf) __A, // (__v16si) __W, // (__mmask16) __U, __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtt_roundps_epi32 (__mmask16 __U, __m512 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvttps2dq512_mask ((__v16sf) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U, __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtt_roundps_epu32 (__m512 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1, __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtt_roundps_epu32 (__m512i __W, __mmask16 __U, __m512 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A, // (__v16si) __W, // (__mmask16) __U, __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtt_roundps_epu32 (__mmask16 __U, __m512 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U, __R); // } // #else // #define _mm512_cvtt_roundps_epi32(A, B) \ // ((__m512i)__builtin_ia32_cvttps2dq512_mask(A, (__v16si)_mm512_undefined_epi32 (), -1, B)) // #define _mm512_mask_cvtt_roundps_epi32(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvttps2dq512_mask(A, (__v16si)(W), U, B)) // #define _mm512_maskz_cvtt_roundps_epi32(U, A, B) \ // ((__m512i)__builtin_ia32_cvttps2dq512_mask(A, (__v16si)_mm512_setzero_si512 (), U, B)) // #define _mm512_cvtt_roundps_epu32(A, B) \ // ((__m512i)__builtin_ia32_cvttps2udq512_mask(A, (__v16si)_mm512_undefined_epi32 (), -1, B)) // #define _mm512_mask_cvtt_roundps_epu32(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvttps2udq512_mask(A, (__v16si)(W), U, B)) // #define _mm512_maskz_cvtt_roundps_epu32(U, A, B) \ // ((__m512i)__builtin_ia32_cvttps2udq512_mask(A, (__v16si)_mm512_setzero_si512 (), U, B)) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundps_epi32 (__m512 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1, __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundps_epi32 (__m512i __W, __mmask16 __U, __m512 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A, // (__v16si) __W, // (__mmask16) __U, __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundps_epi32 (__mmask16 __U, __m512 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U, __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundps_epu32 (__m512 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1, __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundps_epu32 (__m512i __W, __mmask16 __U, __m512 __A, // const int __R) // { // return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A, // (__v16si) __W, // (__mmask16) __U, __R); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundps_epu32 (__mmask16 __U, __m512 __A, const int __R) // { // return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U, __R); // } // #else // #define _mm512_cvt_roundps_epi32(A, B) \ // ((__m512i)__builtin_ia32_cvtps2dq512_mask(A, (__v16si)_mm512_undefined_epi32 (), -1, B)) // #define _mm512_mask_cvt_roundps_epi32(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvtps2dq512_mask(A, (__v16si)(W), U, B)) // #define _mm512_maskz_cvt_roundps_epi32(U, A, B) \ // ((__m512i)__builtin_ia32_cvtps2dq512_mask(A, (__v16si)_mm512_setzero_si512 (), U, B)) // #define _mm512_cvt_roundps_epu32(A, B) \ // ((__m512i)__builtin_ia32_cvtps2udq512_mask(A, (__v16si)_mm512_undefined_epi32 (), -1, B)) // #define _mm512_mask_cvt_roundps_epu32(W, U, A, B) \ // ((__m512i)__builtin_ia32_cvtps2udq512_mask(A, (__v16si)(W), U, B)) // #define _mm512_maskz_cvt_roundps_epu32(U, A, B) \ // ((__m512i)__builtin_ia32_cvtps2udq512_mask(A, (__v16si)_mm512_setzero_si512 (), U, B)) // #endif // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtu32_sd (__m128d __A, unsigned __B) // { // return (__m128d) __builtin_ia32_cvtusi2sd32 ((__v2df) __A, __B); // } // #ifdef __x86_64__ // #ifdef __OPTIMIZE__ // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundu64_sd (__m128d __A, unsigned long long __B, const int __R) // { // return (__m128d) __builtin_ia32_cvtusi2sd64 ((__v2df) __A, __B, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundi64_sd (__m128d __A, long long __B, const int __R) // { // return (__m128d) __builtin_ia32_cvtsi2sd64 ((__v2df) __A, __B, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundsi64_sd (__m128d __A, long long __B, const int __R) // { // return (__m128d) __builtin_ia32_cvtsi2sd64 ((__v2df) __A, __B, __R); // } // #else // #define _mm_cvt_roundu64_sd(A, B, C) \ // (__m128d)__builtin_ia32_cvtusi2sd64(A, B, C) // #define _mm_cvt_roundi64_sd(A, B, C) \ // (__m128d)__builtin_ia32_cvtsi2sd64(A, B, C) // #define _mm_cvt_roundsi64_sd(A, B, C) \ // (__m128d)__builtin_ia32_cvtsi2sd64(A, B, C) // #endif // #endif // #ifdef __OPTIMIZE__ // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundu32_ss (__m128 __A, unsigned __B, const int __R) // { // return (__m128) __builtin_ia32_cvtusi2ss32 ((__v4sf) __A, __B, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundsi32_ss (__m128 __A, int __B, const int __R) // { // return (__m128) __builtin_ia32_cvtsi2ss32 ((__v4sf) __A, __B, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundi32_ss (__m128 __A, int __B, const int __R) // { // return (__m128) __builtin_ia32_cvtsi2ss32 ((__v4sf) __A, __B, __R); // } // #else // #define _mm_cvt_roundu32_ss(A, B, C) \ // (__m128)__builtin_ia32_cvtusi2ss32(A, B, C) // #define _mm_cvt_roundi32_ss(A, B, C) \ // (__m128)__builtin_ia32_cvtsi2ss32(A, B, C) // #define _mm_cvt_roundsi32_ss(A, B, C) \ // (__m128)__builtin_ia32_cvtsi2ss32(A, B, C) // #endif // #ifdef __x86_64__ // #ifdef __OPTIMIZE__ // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundu64_ss (__m128 __A, unsigned long long __B, const int __R) // { // return (__m128) __builtin_ia32_cvtusi2ss64 ((__v4sf) __A, __B, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundsi64_ss (__m128 __A, long long __B, const int __R) // { // return (__m128) __builtin_ia32_cvtsi2ss64 ((__v4sf) __A, __B, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundi64_ss (__m128 __A, long long __B, const int __R) // { // return (__m128) __builtin_ia32_cvtsi2ss64 ((__v4sf) __A, __B, __R); // } // #else // #define _mm_cvt_roundu64_ss(A, B, C) \ // (__m128)__builtin_ia32_cvtusi2ss64(A, B, C) // #define _mm_cvt_roundi64_ss(A, B, C) \ // (__m128)__builtin_ia32_cvtsi2ss64(A, B, C) // #define _mm_cvt_roundsi64_ss(A, B, C) \ // (__m128)__builtin_ia32_cvtsi2ss64(A, B, C) // #endif // #endif // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi32_epi8 (__m512i __A) // { // return (__m128i) __builtin_ia32_pmovdb512_mask ((__v16si) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask16) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi32_storeu_epi8 (void * __P, __mmask16 __M, __m512i __A) // { // __builtin_ia32_pmovdb512mem_mask ((__v16qi *) __P, (__v16si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi32_epi8 (__m128i __O, __mmask16 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovdb512_mask ((__v16si) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi32_epi8 (__mmask16 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovdb512_mask ((__v16si) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtsepi32_epi8 (__m512i __A) // { // return (__m128i) __builtin_ia32_pmovsdb512_mask ((__v16si) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask16) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi32_storeu_epi8 (void * __P, __mmask16 __M, __m512i __A) // { // __builtin_ia32_pmovsdb512mem_mask ((__v16qi *) __P, (__v16si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi32_epi8 (__m128i __O, __mmask16 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovsdb512_mask ((__v16si) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtsepi32_epi8 (__mmask16 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovsdb512_mask ((__v16si) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtusepi32_epi8 (__m512i __A) // { // return (__m128i) __builtin_ia32_pmovusdb512_mask ((__v16si) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask16) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi32_storeu_epi8 (void * __P, __mmask16 __M, __m512i __A) // { // __builtin_ia32_pmovusdb512mem_mask ((__v16qi *) __P, (__v16si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi32_epi8 (__m128i __O, __mmask16 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovusdb512_mask ((__v16si) __A, // (__v16qi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtusepi32_epi8 (__mmask16 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovusdb512_mask ((__v16si) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi32_epi16 (__m512i __A) // { // return (__m256i) __builtin_ia32_pmovdw512_mask ((__v16si) __A, // (__v16hi) // _mm256_undefined_si256 (), // (__mmask16) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi32_storeu_epi16 (void * __P, __mmask16 __M, __m512i __A) // { // __builtin_ia32_pmovdw512mem_mask ((__v16hi *) __P, (__v16si) __A, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi32_epi16 (__m256i __O, __mmask16 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovdw512_mask ((__v16si) __A, // (__v16hi) __O, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi32_epi16 (__mmask16 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovdw512_mask ((__v16si) __A, // (__v16hi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtsepi32_epi16 (__m512i __A) // { // return (__m256i) __builtin_ia32_pmovsdw512_mask ((__v16si) __A, // (__v16hi) // _mm256_undefined_si256 (), // (__mmask16) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi32_storeu_epi16 (void *__P, __mmask16 __M, __m512i __A) // { // __builtin_ia32_pmovsdw512mem_mask ((__v16hi*) __P, (__v16si) __A, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi32_epi16 (__m256i __O, __mmask16 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovsdw512_mask ((__v16si) __A, // (__v16hi) __O, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtsepi32_epi16 (__mmask16 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovsdw512_mask ((__v16si) __A, // (__v16hi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtusepi32_epi16 (__m512i __A) // { // return (__m256i) __builtin_ia32_pmovusdw512_mask ((__v16si) __A, // (__v16hi) // _mm256_undefined_si256 (), // (__mmask16) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi32_storeu_epi16 (void *__P, __mmask16 __M, __m512i __A) // { // __builtin_ia32_pmovusdw512mem_mask ((__v16hi*) __P, (__v16si) __A, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi32_epi16 (__m256i __O, __mmask16 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovusdw512_mask ((__v16si) __A, // (__v16hi) __O, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtusepi32_epi16 (__mmask16 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovusdw512_mask ((__v16si) __A, // (__v16hi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi64_epi32 (__m512i __A) // { // return (__m256i) __builtin_ia32_pmovqd512_mask ((__v8di) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi64_storeu_epi32 (void* __P, __mmask8 __M, __m512i __A) // { // __builtin_ia32_pmovqd512mem_mask ((__v8si *) __P, (__v8di) __A, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi64_epi32 (__m256i __O, __mmask8 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovqd512_mask ((__v8di) __A, // (__v8si) __O, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi64_epi32 (__mmask8 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovqd512_mask ((__v8di) __A, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtsepi64_epi32 (__m512i __A) // { // return (__m256i) __builtin_ia32_pmovsqd512_mask ((__v8di) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi64_storeu_epi32 (void *__P, __mmask8 __M, __m512i __A) // { // __builtin_ia32_pmovsqd512mem_mask ((__v8si *) __P, (__v8di) __A, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi64_epi32 (__m256i __O, __mmask8 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovsqd512_mask ((__v8di) __A, // (__v8si) __O, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtsepi64_epi32 (__mmask8 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovsqd512_mask ((__v8di) __A, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtusepi64_epi32 (__m512i __A) // { // return (__m256i) __builtin_ia32_pmovusqd512_mask ((__v8di) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi64_storeu_epi32 (void* __P, __mmask8 __M, __m512i __A) // { // __builtin_ia32_pmovusqd512mem_mask ((__v8si*) __P, (__v8di) __A, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi64_epi32 (__m256i __O, __mmask8 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovusqd512_mask ((__v8di) __A, // (__v8si) __O, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtusepi64_epi32 (__mmask8 __M, __m512i __A) // { // return (__m256i) __builtin_ia32_pmovusqd512_mask ((__v8di) __A, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi64_epi16 (__m512i __A) // { // return (__m128i) __builtin_ia32_pmovqw512_mask ((__v8di) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A) // { // __builtin_ia32_pmovqw512mem_mask ((__v8hi *) __P, (__v8di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi64_epi16 (__m128i __O, __mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovqw512_mask ((__v8di) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi64_epi16 (__mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovqw512_mask ((__v8di) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtsepi64_epi16 (__m512i __A) // { // return (__m128i) __builtin_ia32_pmovsqw512_mask ((__v8di) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi64_storeu_epi16 (void * __P, __mmask8 __M, __m512i __A) // { // __builtin_ia32_pmovsqw512mem_mask ((__v8hi *) __P, (__v8di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi64_epi16 (__m128i __O, __mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovsqw512_mask ((__v8di) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtsepi64_epi16 (__mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovsqw512_mask ((__v8di) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtusepi64_epi16 (__m512i __A) // { // return (__m128i) __builtin_ia32_pmovusqw512_mask ((__v8di) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A) // { // __builtin_ia32_pmovusqw512mem_mask ((__v8hi*) __P, (__v8di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi64_epi16 (__m128i __O, __mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovusqw512_mask ((__v8di) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtusepi64_epi16 (__mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovusqw512_mask ((__v8di) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi64_epi8 (__m512i __A) // { // return (__m128i) __builtin_ia32_pmovqb512_mask ((__v8di) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m512i __A) // { // __builtin_ia32_pmovqb512mem_mask ((__v16qi *) __P, (__v8di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi64_epi8 (__m128i __O, __mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovqb512_mask ((__v8di) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi64_epi8 (__mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovqb512_mask ((__v8di) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtsepi64_epi8 (__m512i __A) // { // return (__m128i) __builtin_ia32_pmovsqb512_mask ((__v8di) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi64_storeu_epi8 (void * __P, __mmask8 __M, __m512i __A) // { // __builtin_ia32_pmovsqb512mem_mask ((__v16qi *) __P, (__v8di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtsepi64_epi8 (__m128i __O, __mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovsqb512_mask ((__v8di) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtsepi64_epi8 (__mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovsqb512_mask ((__v8di) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtusepi64_epi8 (__m512i __A) // { // return (__m128i) __builtin_ia32_pmovusqb512_mask ((__v8di) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi64_storeu_epi8 (void * __P, __mmask8 __M, __m512i __A) // { // __builtin_ia32_pmovusqb512mem_mask ((__v16qi *) __P, (__v8di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtusepi64_epi8 (__m128i __O, __mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovusqb512_mask ((__v8di) __A, // (__v16qi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtusepi64_epi8 (__mmask8 __M, __m512i __A) // { // return (__m128i) __builtin_ia32_pmovusqb512_mask ((__v8di) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi32_pd (__m256i __A) // { // return (__m512d) __builtin_ia32_cvtdq2pd512_mask ((__v8si) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi32_pd (__m512d __W, __mmask8 __U, __m256i __A) // { // return (__m512d) __builtin_ia32_cvtdq2pd512_mask ((__v8si) __A, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi32_pd (__mmask8 __U, __m256i __A) // { // return (__m512d) __builtin_ia32_cvtdq2pd512_mask ((__v8si) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepu32_pd (__m256i __A) // { // return (__m512d) __builtin_ia32_cvtudq2pd512_mask ((__v8si) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepu32_pd (__m512d __W, __mmask8 __U, __m256i __A) // { // return (__m512d) __builtin_ia32_cvtudq2pd512_mask ((__v8si) __A, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepu32_pd (__mmask8 __U, __m256i __A) // { // return (__m512d) __builtin_ia32_cvtudq2pd512_mask ((__v8si) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundepi32_ps (__m512i __A, const int __R) // { // return (__m512) __builtin_ia32_cvtdq2ps512_mask ((__v16si) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundepi32_ps (__m512 __W, __mmask16 __U, __m512i __A, // const int __R) // { // return (__m512) __builtin_ia32_cvtdq2ps512_mask ((__v16si) __A, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundepi32_ps (__mmask16 __U, __m512i __A, const int __R) // { // return (__m512) __builtin_ia32_cvtdq2ps512_mask ((__v16si) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundepu32_ps (__m512i __A, const int __R) // { // return (__m512) __builtin_ia32_cvtudq2ps512_mask ((__v16si) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundepu32_ps (__m512 __W, __mmask16 __U, __m512i __A, // const int __R) // { // return (__m512) __builtin_ia32_cvtudq2ps512_mask ((__v16si) __A, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundepu32_ps (__mmask16 __U, __m512i __A, const int __R) // { // return (__m512) __builtin_ia32_cvtudq2ps512_mask ((__v16si) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // #else // #define _mm512_cvt_roundepi32_ps(A, B) \ // (__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(A), (__v16sf)_mm512_undefined_ps(), -1, B) // #define _mm512_mask_cvt_roundepi32_ps(W, U, A, B) \ // (__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(A), W, U, B) // #define _mm512_maskz_cvt_roundepi32_ps(U, A, B) \ // (__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(A), (__v16sf)_mm512_setzero_ps(), U, B) // #define _mm512_cvt_roundepu32_ps(A, B) \ // (__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(A), (__v16sf)_mm512_undefined_ps(), -1, B) // #define _mm512_mask_cvt_roundepu32_ps(W, U, A, B) \ // (__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(A), W, U, B) // #define _mm512_maskz_cvt_roundepu32_ps(U, A, B) \ // (__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(A), (__v16sf)_mm512_setzero_ps(), U, B) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_extractf64x4_pd (__m512d __A, const int __imm) // { // return (__m256d) __builtin_ia32_extractf64x4_mask ((__v8df) __A, // __imm, // (__v4df) // _mm256_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_extractf64x4_pd (__m256d __W, __mmask8 __U, __m512d __A, // const int __imm) // { // return (__m256d) __builtin_ia32_extractf64x4_mask ((__v8df) __A, // __imm, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_extractf64x4_pd (__mmask8 __U, __m512d __A, const int __imm) // { // return (__m256d) __builtin_ia32_extractf64x4_mask ((__v8df) __A, // __imm, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_extractf32x4_ps (__m512 __A, const int __imm) // { // return (__m128) __builtin_ia32_extractf32x4_mask ((__v16sf) __A, // __imm, // (__v4sf) // _mm_undefined_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_extractf32x4_ps (__m128 __W, __mmask8 __U, __m512 __A, // const int __imm) // { // return (__m128) __builtin_ia32_extractf32x4_mask ((__v16sf) __A, // __imm, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_extractf32x4_ps (__mmask8 __U, __m512 __A, const int __imm) // { // return (__m128) __builtin_ia32_extractf32x4_mask ((__v16sf) __A, // __imm, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_extracti64x4_epi64 (__m512i __A, const int __imm) // { // return (__m256i) __builtin_ia32_extracti64x4_mask ((__v8di) __A, // __imm, // (__v4di) // _mm256_undefined_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_extracti64x4_epi64 (__m256i __W, __mmask8 __U, __m512i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_extracti64x4_mask ((__v8di) __A, // __imm, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_extracti64x4_epi64 (__mmask8 __U, __m512i __A, const int __imm) // { // return (__m256i) __builtin_ia32_extracti64x4_mask ((__v8di) __A, // __imm, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_extracti32x4_epi32 (__m512i __A, const int __imm) // { // return (__m128i) __builtin_ia32_extracti32x4_mask ((__v16si) __A, // __imm, // (__v4si) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_extracti32x4_epi32 (__m128i __W, __mmask8 __U, __m512i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_extracti32x4_mask ((__v16si) __A, // __imm, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_extracti32x4_epi32 (__mmask8 __U, __m512i __A, const int __imm) // { // return (__m128i) __builtin_ia32_extracti32x4_mask ((__v16si) __A, // __imm, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // #else // #define _mm512_extractf64x4_pd(X, C) \ // ((__m256d) __builtin_ia32_extractf64x4_mask ((__v8df)(__m512d) (X), \ // (int) (C),\ // (__v4df)(__m256d)_mm256_undefined_pd(),\ // (__mmask8)-1)) // #define _mm512_mask_extractf64x4_pd(W, U, X, C) \ // ((__m256d) __builtin_ia32_extractf64x4_mask ((__v8df)(__m512d) (X), \ // (int) (C),\ // (__v4df)(__m256d)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_extractf64x4_pd(U, X, C) \ // ((__m256d) __builtin_ia32_extractf64x4_mask ((__v8df)(__m512d) (X), \ // (int) (C),\ // (__v4df)(__m256d)_mm256_setzero_pd(),\ // (__mmask8)(U))) // #define _mm512_extractf32x4_ps(X, C) \ // ((__m128) __builtin_ia32_extractf32x4_mask ((__v16sf)(__m512) (X), \ // (int) (C),\ // (__v4sf)(__m128)_mm_undefined_ps(),\ // (__mmask8)-1)) // #define _mm512_mask_extractf32x4_ps(W, U, X, C) \ // ((__m128) __builtin_ia32_extractf32x4_mask ((__v16sf)(__m512) (X), \ // (int) (C),\ // (__v4sf)(__m128)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_extractf32x4_ps(U, X, C) \ // ((__m128) __builtin_ia32_extractf32x4_mask ((__v16sf)(__m512) (X), \ // (int) (C),\ // (__v4sf)(__m128)_mm_setzero_ps(),\ // (__mmask8)(U))) // #define _mm512_extracti64x4_epi64(X, C) \ // ((__m256i) __builtin_ia32_extracti64x4_mask ((__v8di)(__m512i) (X), \ // (int) (C),\ // (__v4di)(__m256i)_mm256_undefined_si256 (),\ // (__mmask8)-1)) // #define _mm512_mask_extracti64x4_epi64(W, U, X, C) \ // ((__m256i) __builtin_ia32_extracti64x4_mask ((__v8di)(__m512i) (X), \ // (int) (C),\ // (__v4di)(__m256i)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_extracti64x4_epi64(U, X, C) \ // ((__m256i) __builtin_ia32_extracti64x4_mask ((__v8di)(__m512i) (X), \ // (int) (C),\ // (__v4di)(__m256i)_mm256_setzero_si256 (),\ // (__mmask8)(U))) // #define _mm512_extracti32x4_epi32(X, C) \ // ((__m128i) __builtin_ia32_extracti32x4_mask ((__v16si)(__m512i) (X), \ // (int) (C),\ // (__v4si)(__m128i)_mm_undefined_si128 (),\ // (__mmask8)-1)) // #define _mm512_mask_extracti32x4_epi32(W, U, X, C) \ // ((__m128i) __builtin_ia32_extracti32x4_mask ((__v16si)(__m512i) (X), \ // (int) (C),\ // (__v4si)(__m128i)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_extracti32x4_epi32(U, X, C) \ // ((__m128i) __builtin_ia32_extracti32x4_mask ((__v16si)(__m512i) (X), \ // (int) (C),\ // (__v4si)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)(U))) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_inserti32x4 (__m512i __A, __m128i __B, const int __imm) // { // return (__m512i) __builtin_ia32_inserti32x4_mask ((__v16si) __A, // (__v4si) __B, // __imm, // (__v16si) __A, -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_insertf32x4 (__m512 __A, __m128 __B, const int __imm) // { // return (__m512) __builtin_ia32_insertf32x4_mask ((__v16sf) __A, // (__v4sf) __B, // __imm, // (__v16sf) __A, -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_inserti64x4 (__m512i __A, __m256i __B, const int __imm) // { // return (__m512i) __builtin_ia32_inserti64x4_mask ((__v8di) __A, // (__v4di) __B, // __imm, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_inserti64x4 (__m512i __W, __mmask8 __U, __m512i __A, // __m256i __B, const int __imm) // { // return (__m512i) __builtin_ia32_inserti64x4_mask ((__v8di) __A, // (__v4di) __B, // __imm, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_inserti64x4 (__mmask8 __U, __m512i __A, __m256i __B, // const int __imm) // { // return (__m512i) __builtin_ia32_inserti64x4_mask ((__v8di) __A, // (__v4di) __B, // __imm, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_insertf64x4 (__m512d __A, __m256d __B, const int __imm) // { // return (__m512d) __builtin_ia32_insertf64x4_mask ((__v8df) __A, // (__v4df) __B, // __imm, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_insertf64x4 (__m512d __W, __mmask8 __U, __m512d __A, // __m256d __B, const int __imm) // { // return (__m512d) __builtin_ia32_insertf64x4_mask ((__v8df) __A, // (__v4df) __B, // __imm, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_insertf64x4 (__mmask8 __U, __m512d __A, __m256d __B, // const int __imm) // { // return (__m512d) __builtin_ia32_insertf64x4_mask ((__v8df) __A, // (__v4df) __B, // __imm, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // #else // #define _mm512_insertf32x4(X, Y, C) \ // ((__m512) __builtin_ia32_insertf32x4_mask ((__v16sf)(__m512) (X), \ // (__v4sf)(__m128) (Y), (int) (C), (__v16sf)(__m512) (X), (__mmask16)(-1))) // #define _mm512_inserti32x4(X, Y, C) \ // ((__m512i) __builtin_ia32_inserti32x4_mask ((__v16si)(__m512i) (X), \ // (__v4si)(__m128i) (Y), (int) (C), (__v16si)(__m512i) (X), (__mmask16)(-1))) // #define _mm512_insertf64x4(X, Y, C) \ // ((__m512d) __builtin_ia32_insertf64x4_mask ((__v8df)(__m512d) (X), \ // (__v4df)(__m256d) (Y), (int) (C), \ // (__v8df)(__m512d)_mm512_undefined_pd(), \ // (__mmask8)-1)) // #define _mm512_mask_insertf64x4(W, U, X, Y, C) \ // ((__m512d) __builtin_ia32_insertf64x4_mask ((__v8df)(__m512d) (X), \ // (__v4df)(__m256d) (Y), (int) (C), \ // (__v8df)(__m512d)(W), \ // (__mmask8)(U))) // #define _mm512_maskz_insertf64x4(U, X, Y, C) \ // ((__m512d) __builtin_ia32_insertf64x4_mask ((__v8df)(__m512d) (X), \ // (__v4df)(__m256d) (Y), (int) (C), \ // (__v8df)(__m512d)_mm512_setzero_pd(), \ // (__mmask8)(U))) // #define _mm512_inserti64x4(X, Y, C) \ // ((__m512i) __builtin_ia32_inserti64x4_mask ((__v8di)(__m512i) (X), \ // (__v4di)(__m256i) (Y), (int) (C), \ // (__v8di)(__m512i)_mm512_undefined_epi32 (), \ // (__mmask8)-1)) // #define _mm512_mask_inserti64x4(W, U, X, Y, C) \ // ((__m512i) __builtin_ia32_inserti64x4_mask ((__v8di)(__m512i) (X), \ // (__v4di)(__m256i) (Y), (int) (C),\ // (__v8di)(__m512i)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_inserti64x4(U, X, Y, C) \ // ((__m512i) __builtin_ia32_inserti64x4_mask ((__v8di)(__m512i) (X), \ // (__v4di)(__m256i) (Y), (int) (C), \ // (__v8di)(__m512i)_mm512_setzero_si512 (), \ // (__mmask8)(U))) // #endif // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_loadu_pd (void const *__P) // { // return *(__m512d_u *)__P; // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_loadu_pd (__m512d __W, __mmask8 __U, void const *__P) // { // return (__m512d) __builtin_ia32_loadupd512_mask ((const double *) __P, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_loadu_pd (__mmask8 __U, void const *__P) // { // return (__m512d) __builtin_ia32_loadupd512_mask ((const double *) __P, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_storeu_pd (void *__P, __m512d __A) // { // *(__m512d_u *)__P = __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_storeu_pd (void *__P, __mmask8 __U, __m512d __A) // { // __builtin_ia32_storeupd512_mask ((double *) __P, (__v8df) __A, // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_loadu_ps (void const *__P) // { // return *(__m512_u *)__P; // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_loadu_ps (__m512 __W, __mmask16 __U, void const *__P) // { // return (__m512) __builtin_ia32_loadups512_mask ((const float *) __P, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_loadu_ps (__mmask16 __U, void const *__P) // { // return (__m512) __builtin_ia32_loadups512_mask ((const float *) __P, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_storeu_ps (void *__P, __m512 __A) // { // *(__m512_u *)__P = __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_storeu_ps (void *__P, __mmask16 __U, __m512 __A) // { // __builtin_ia32_storeups512_mask ((float *) __P, (__v16sf) __A, // (__mmask16) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_load_ss (__m128 __W, __mmask8 __U, const float *__P) // { // return (__m128) __builtin_ia32_loadss_mask (__P, (__v4sf) __W, __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_load_ss (__mmask8 __U, const float *__P) // { // return (__m128) __builtin_ia32_loadss_mask (__P, (__v4sf) _mm_setzero_ps (), // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_load_sd (__m128d __W, __mmask8 __U, const double *__P) // { // return (__m128d) __builtin_ia32_loadsd_mask (__P, (__v2df) __W, __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_load_sd (__mmask8 __U, const double *__P) // { // return (__m128d) __builtin_ia32_loadsd_mask (__P, (__v2df) _mm_setzero_pd (), // __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_move_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_movess_mask ((__v4sf) __A, (__v4sf) __B, // (__v4sf) __W, __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_move_ss (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_movess_mask ((__v4sf) __A, (__v4sf) __B, // (__v4sf) _mm_setzero_ps (), __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_move_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_movesd_mask ((__v2df) __A, (__v2df) __B, // (__v2df) __W, __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_move_sd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_movesd_mask ((__v2df) __A, (__v2df) __B, // (__v2df) _mm_setzero_pd (), // __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_store_ss (float *__P, __mmask8 __U, __m128 __A) // { // __builtin_ia32_storess_mask (__P, (__v4sf) __A, (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_store_sd (double *__P, __mmask8 __U, __m128d __A) // { // __builtin_ia32_storesd_mask (__P, (__v2df) __A, (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_loadu_epi64 (void const *__P) // { // return *(__m512i_u *) __P; // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_loadu_epi64 (__m512i __W, __mmask8 __U, void const *__P) // { // return (__m512i) __builtin_ia32_loaddqudi512_mask ((const long long *) __P, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_loadu_epi64 (__mmask8 __U, void const *__P) // { // return (__m512i) __builtin_ia32_loaddqudi512_mask ((const long long *) __P, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_storeu_epi64 (void *__P, __m512i __A) // { // *(__m512i_u *) __P = (__m512i_u) __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_storeu_epi64 (void *__P, __mmask8 __U, __m512i __A) // { // __builtin_ia32_storedqudi512_mask ((long long *) __P, (__v8di) __A, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_loadu_si512 (void const *__P) // { // return *(__m512i_u *)__P; // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_loadu_epi32 (void const *__P) // { // return *(__m512i_u *) __P; // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_loadu_epi32 (__m512i __W, __mmask16 __U, void const *__P) // { // return (__m512i) __builtin_ia32_loaddqusi512_mask ((const int *) __P, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_loadu_epi32 (__mmask16 __U, void const *__P) // { // return (__m512i) __builtin_ia32_loaddqusi512_mask ((const int *) __P, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_storeu_si512 (void *__P, __m512i __A) // { // *(__m512i_u *)__P = __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_storeu_epi32 (void *__P, __m512i __A) // { // *(__m512i_u *) __P = (__m512i_u) __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_storeu_epi32 (void *__P, __mmask16 __U, __m512i __A) // { // __builtin_ia32_storedqusi512_mask ((int *) __P, (__v16si) __A, // (__mmask16) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutevar_pd (__m512d __A, __m512i __C) // { // return (__m512d) __builtin_ia32_vpermilvarpd512_mask ((__v8df) __A, // (__v8di) __C, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutevar_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512i __C) // { // return (__m512d) __builtin_ia32_vpermilvarpd512_mask ((__v8df) __A, // (__v8di) __C, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutevar_pd (__mmask8 __U, __m512d __A, __m512i __C) // { // return (__m512d) __builtin_ia32_vpermilvarpd512_mask ((__v8df) __A, // (__v8di) __C, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutevar_ps (__m512 __A, __m512i __C) // { // return (__m512) __builtin_ia32_vpermilvarps512_mask ((__v16sf) __A, // (__v16si) __C, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutevar_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512i __C) // { // return (__m512) __builtin_ia32_vpermilvarps512_mask ((__v16sf) __A, // (__v16si) __C, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutevar_ps (__mmask16 __U, __m512 __A, __m512i __C) // { // return (__m512) __builtin_ia32_vpermilvarps512_mask ((__v16sf) __A, // (__v16si) __C, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutex2var_epi64 (__m512i __A, __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2varq512_mask ((__v8di) __I // /* idx */ , // (__v8di) __A, // (__v8di) __B, // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutex2var_epi64 (__m512i __A, __mmask8 __U, __m512i __I, // __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2varq512_mask ((__v8di) __I // /* idx */ , // (__v8di) __A, // (__v8di) __B, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask2_permutex2var_epi64 (__m512i __A, __m512i __I, // __mmask8 __U, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermi2varq512_mask ((__v8di) __A, // (__v8di) __I // /* idx */ , // (__v8di) __B, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutex2var_epi64 (__mmask8 __U, __m512i __A, // __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2varq512_maskz ((__v8di) __I // /* idx */ , // (__v8di) __A, // (__v8di) __B, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutex2var_epi32 (__m512i __A, __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2vard512_mask ((__v16si) __I // /* idx */ , // (__v16si) __A, // (__v16si) __B, // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutex2var_epi32 (__m512i __A, __mmask16 __U, // __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2vard512_mask ((__v16si) __I // /* idx */ , // (__v16si) __A, // (__v16si) __B, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask2_permutex2var_epi32 (__m512i __A, __m512i __I, // __mmask16 __U, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermi2vard512_mask ((__v16si) __A, // (__v16si) __I // /* idx */ , // (__v16si) __B, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutex2var_epi32 (__mmask16 __U, __m512i __A, // __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2vard512_maskz ((__v16si) __I // /* idx */ , // (__v16si) __A, // (__v16si) __B, // (__mmask16) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutex2var_pd (__m512d __A, __m512i __I, __m512d __B) // { // return (__m512d) __builtin_ia32_vpermt2varpd512_mask ((__v8di) __I // /* idx */ , // (__v8df) __A, // (__v8df) __B, // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutex2var_pd (__m512d __A, __mmask8 __U, __m512i __I, // __m512d __B) // { // return (__m512d) __builtin_ia32_vpermt2varpd512_mask ((__v8di) __I // /* idx */ , // (__v8df) __A, // (__v8df) __B, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask2_permutex2var_pd (__m512d __A, __m512i __I, __mmask8 __U, // __m512d __B) // { // return (__m512d) __builtin_ia32_vpermi2varpd512_mask ((__v8df) __A, // (__v8di) __I // /* idx */ , // (__v8df) __B, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutex2var_pd (__mmask8 __U, __m512d __A, __m512i __I, // __m512d __B) // { // return (__m512d) __builtin_ia32_vpermt2varpd512_maskz ((__v8di) __I // /* idx */ , // (__v8df) __A, // (__v8df) __B, // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutex2var_ps (__m512 __A, __m512i __I, __m512 __B) // { // return (__m512) __builtin_ia32_vpermt2varps512_mask ((__v16si) __I // /* idx */ , // (__v16sf) __A, // (__v16sf) __B, // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutex2var_ps (__m512 __A, __mmask16 __U, __m512i __I, __m512 __B) // { // return (__m512) __builtin_ia32_vpermt2varps512_mask ((__v16si) __I // /* idx */ , // (__v16sf) __A, // (__v16sf) __B, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask2_permutex2var_ps (__m512 __A, __m512i __I, __mmask16 __U, // __m512 __B) // { // return (__m512) __builtin_ia32_vpermi2varps512_mask ((__v16sf) __A, // (__v16si) __I // /* idx */ , // (__v16sf) __B, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutex2var_ps (__mmask16 __U, __m512 __A, __m512i __I, // __m512 __B) // { // return (__m512) __builtin_ia32_vpermt2varps512_maskz ((__v16si) __I // /* idx */ , // (__v16sf) __A, // (__v16sf) __B, // (__mmask16) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permute_pd (__m512d __X, const int __C) // { // return (__m512d) __builtin_ia32_vpermilpd512_mask ((__v8df) __X, __C, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permute_pd (__m512d __W, __mmask8 __U, __m512d __X, const int __C) // { // return (__m512d) __builtin_ia32_vpermilpd512_mask ((__v8df) __X, __C, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permute_pd (__mmask8 __U, __m512d __X, const int __C) // { // return (__m512d) __builtin_ia32_vpermilpd512_mask ((__v8df) __X, __C, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permute_ps (__m512 __X, const int __C) // { // return (__m512) __builtin_ia32_vpermilps512_mask ((__v16sf) __X, __C, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permute_ps (__m512 __W, __mmask16 __U, __m512 __X, const int __C) // { // return (__m512) __builtin_ia32_vpermilps512_mask ((__v16sf) __X, __C, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permute_ps (__mmask16 __U, __m512 __X, const int __C) // { // return (__m512) __builtin_ia32_vpermilps512_mask ((__v16sf) __X, __C, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // #else // #define _mm512_permute_pd(X, C) \ // ((__m512d) __builtin_ia32_vpermilpd512_mask ((__v8df)(__m512d)(X), (int)(C), \ // (__v8df)(__m512d)_mm512_undefined_pd(),\ // (__mmask8)(-1))) // #define _mm512_mask_permute_pd(W, U, X, C) \ // ((__m512d) __builtin_ia32_vpermilpd512_mask ((__v8df)(__m512d)(X), (int)(C), \ // (__v8df)(__m512d)(W), \ // (__mmask8)(U))) // #define _mm512_maskz_permute_pd(U, X, C) \ // ((__m512d) __builtin_ia32_vpermilpd512_mask ((__v8df)(__m512d)(X), (int)(C), \ // (__v8df)(__m512d)_mm512_setzero_pd(), \ // (__mmask8)(U))) // #define _mm512_permute_ps(X, C) \ // ((__m512) __builtin_ia32_vpermilps512_mask ((__v16sf)(__m512)(X), (int)(C), \ // (__v16sf)(__m512)_mm512_undefined_ps(),\ // (__mmask16)(-1))) // #define _mm512_mask_permute_ps(W, U, X, C) \ // ((__m512) __builtin_ia32_vpermilps512_mask ((__v16sf)(__m512)(X), (int)(C), \ // (__v16sf)(__m512)(W), \ // (__mmask16)(U))) // #define _mm512_maskz_permute_ps(U, X, C) \ // ((__m512) __builtin_ia32_vpermilps512_mask ((__v16sf)(__m512)(X), (int)(C), \ // (__v16sf)(__m512)_mm512_setzero_ps(), \ // (__mmask16)(U))) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutex_epi64 (__m512i __X, const int __I) // { // return (__m512i) __builtin_ia32_permdi512_mask ((__v8di) __X, __I, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) (-1)); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutex_epi64 (__m512i __W, __mmask8 __M, // __m512i __X, const int __I) // { // return (__m512i) __builtin_ia32_permdi512_mask ((__v8di) __X, __I, // (__v8di) __W, // (__mmask8) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutex_epi64 (__mmask8 __M, __m512i __X, const int __I) // { // return (__m512i) __builtin_ia32_permdi512_mask ((__v8di) __X, __I, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __M); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutex_pd (__m512d __X, const int __M) // { // return (__m512d) __builtin_ia32_permdf512_mask ((__v8df) __X, __M, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutex_pd (__m512d __W, __mmask8 __U, __m512d __X, const int __M) // { // return (__m512d) __builtin_ia32_permdf512_mask ((__v8df) __X, __M, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutex_pd (__mmask8 __U, __m512d __X, const int __M) // { // return (__m512d) __builtin_ia32_permdf512_mask ((__v8df) __X, __M, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // #else // #define _mm512_permutex_pd(X, M) \ // ((__m512d) __builtin_ia32_permdf512_mask ((__v8df)(__m512d)(X), (int)(M), \ // (__v8df)(__m512d)_mm512_undefined_pd(),\ // (__mmask8)-1)) // #define _mm512_mask_permutex_pd(W, U, X, M) \ // ((__m512d) __builtin_ia32_permdf512_mask ((__v8df)(__m512d)(X), (int)(M), \ // (__v8df)(__m512d)(W), (__mmask8)(U))) // #define _mm512_maskz_permutex_pd(U, X, M) \ // ((__m512d) __builtin_ia32_permdf512_mask ((__v8df)(__m512d)(X), (int)(M), \ // (__v8df)(__m512d)_mm512_setzero_pd(),\ // (__mmask8)(U))) // #define _mm512_permutex_epi64(X, I) \ // ((__m512i) __builtin_ia32_permdi512_mask ((__v8di)(__m512i)(X), \ // (int)(I), \ // (__v8di)(__m512i) \ // (_mm512_undefined_epi32 ()),\ // (__mmask8)(-1))) // #define _mm512_maskz_permutex_epi64(M, X, I) \ // ((__m512i) __builtin_ia32_permdi512_mask ((__v8di)(__m512i)(X), \ // (int)(I), \ // (__v8di)(__m512i) \ // (_mm512_setzero_si512 ()),\ // (__mmask8)(M))) // #define _mm512_mask_permutex_epi64(W, M, X, I) \ // ((__m512i) __builtin_ia32_permdi512_mask ((__v8di)(__m512i)(X), \ // (int)(I), \ // (__v8di)(__m512i)(W), \ // (__mmask8)(M))) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutexvar_epi64 (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_permvardi512_mask ((__v8di) __Y, // (__v8di) __X, // (__v8di) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutexvar_epi64 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_permvardi512_mask ((__v8di) __Y, // (__v8di) __X, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutexvar_epi64 (__m512i __W, __mmask8 __M, __m512i __X, // __m512i __Y) // { // return (__m512i) __builtin_ia32_permvardi512_mask ((__v8di) __Y, // (__v8di) __X, // (__v8di) __W, // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutexvar_epi32 (__mmask16 __M, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_permvarsi512_mask ((__v16si) __Y, // (__v16si) __X, // (__v16si) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutexvar_epi32 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_permvarsi512_mask ((__v16si) __Y, // (__v16si) __X, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutexvar_epi32 (__m512i __W, __mmask16 __M, __m512i __X, // __m512i __Y) // { // return (__m512i) __builtin_ia32_permvarsi512_mask ((__v16si) __Y, // (__v16si) __X, // (__v16si) __W, // __M); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutexvar_pd (__m512i __X, __m512d __Y) // { // return (__m512d) __builtin_ia32_permvardf512_mask ((__v8df) __Y, // (__v8di) __X, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutexvar_pd (__m512d __W, __mmask8 __U, __m512i __X, __m512d __Y) // { // return (__m512d) __builtin_ia32_permvardf512_mask ((__v8df) __Y, // (__v8di) __X, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutexvar_pd (__mmask8 __U, __m512i __X, __m512d __Y) // { // return (__m512d) __builtin_ia32_permvardf512_mask ((__v8df) __Y, // (__v8di) __X, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutexvar_ps (__m512i __X, __m512 __Y) // { // return (__m512) __builtin_ia32_permvarsf512_mask ((__v16sf) __Y, // (__v16si) __X, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutexvar_ps (__m512 __W, __mmask16 __U, __m512i __X, __m512 __Y) // { // return (__m512) __builtin_ia32_permvarsf512_mask ((__v16sf) __Y, // (__v16si) __X, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutexvar_ps (__mmask16 __U, __m512i __X, __m512 __Y) // { // return (__m512) __builtin_ia32_permvarsf512_mask ((__v16sf) __Y, // (__v16si) __X, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shuffle_ps (__m512 __M, __m512 __V, const int __imm) // { // return (__m512) __builtin_ia32_shufps512_mask ((__v16sf) __M, // (__v16sf) __V, __imm, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shuffle_ps (__m512 __W, __mmask16 __U, __m512 __M, // __m512 __V, const int __imm) // { // return (__m512) __builtin_ia32_shufps512_mask ((__v16sf) __M, // (__v16sf) __V, __imm, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shuffle_ps (__mmask16 __U, __m512 __M, __m512 __V, const int __imm) // { // return (__m512) __builtin_ia32_shufps512_mask ((__v16sf) __M, // (__v16sf) __V, __imm, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shuffle_pd (__m512d __M, __m512d __V, const int __imm) // { // return (__m512d) __builtin_ia32_shufpd512_mask ((__v8df) __M, // (__v8df) __V, __imm, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shuffle_pd (__m512d __W, __mmask8 __U, __m512d __M, // __m512d __V, const int __imm) // { // return (__m512d) __builtin_ia32_shufpd512_mask ((__v8df) __M, // (__v8df) __V, __imm, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shuffle_pd (__mmask8 __U, __m512d __M, __m512d __V, // const int __imm) // { // return (__m512d) __builtin_ia32_shufpd512_mask ((__v8df) __M, // (__v8df) __V, __imm, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fixupimm_round_pd (__m512d __A, __m512d __B, __m512i __C, // const int __imm, const int __R) // { // return (__m512d) __builtin_ia32_fixupimmpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8di) __C, // __imm, // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fixupimm_round_pd (__m512d __A, __mmask8 __U, __m512d __B, // __m512i __C, const int __imm, const int __R) // { // return (__m512d) __builtin_ia32_fixupimmpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8di) __C, // __imm, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fixupimm_round_pd (__mmask8 __U, __m512d __A, __m512d __B, // __m512i __C, const int __imm, const int __R) // { // return (__m512d) __builtin_ia32_fixupimmpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8di) __C, // __imm, // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fixupimm_round_ps (__m512 __A, __m512 __B, __m512i __C, // const int __imm, const int __R) // { // return (__m512) __builtin_ia32_fixupimmps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16si) __C, // __imm, // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fixupimm_round_ps (__m512 __A, __mmask16 __U, __m512 __B, // __m512i __C, const int __imm, const int __R) // { // return (__m512) __builtin_ia32_fixupimmps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16si) __C, // __imm, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fixupimm_round_ps (__mmask16 __U, __m512 __A, __m512 __B, // __m512i __C, const int __imm, const int __R) // { // return (__m512) __builtin_ia32_fixupimmps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16si) __C, // __imm, // (__mmask16) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fixupimm_round_sd (__m128d __A, __m128d __B, __m128i __C, // const int __imm, const int __R) // { // return (__m128d) __builtin_ia32_fixupimmsd_mask ((__v2df) __A, // (__v2df) __B, // (__v2di) __C, __imm, // (__mmask8) -1, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fixupimm_round_sd (__m128d __A, __mmask8 __U, __m128d __B, // __m128i __C, const int __imm, const int __R) // { // return (__m128d) __builtin_ia32_fixupimmsd_mask ((__v2df) __A, // (__v2df) __B, // (__v2di) __C, __imm, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fixupimm_round_sd (__mmask8 __U, __m128d __A, __m128d __B, // __m128i __C, const int __imm, const int __R) // { // return (__m128d) __builtin_ia32_fixupimmsd_maskz ((__v2df) __A, // (__v2df) __B, // (__v2di) __C, // __imm, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fixupimm_round_ss (__m128 __A, __m128 __B, __m128i __C, // const int __imm, const int __R) // { // return (__m128) __builtin_ia32_fixupimmss_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4si) __C, __imm, // (__mmask8) -1, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fixupimm_round_ss (__m128 __A, __mmask8 __U, __m128 __B, // __m128i __C, const int __imm, const int __R) // { // return (__m128) __builtin_ia32_fixupimmss_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4si) __C, __imm, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fixupimm_round_ss (__mmask8 __U, __m128 __A, __m128 __B, // __m128i __C, const int __imm, const int __R) // { // return (__m128) __builtin_ia32_fixupimmss_maskz ((__v4sf) __A, // (__v4sf) __B, // (__v4si) __C, __imm, // (__mmask8) __U, __R); // } // #else // #define _mm512_shuffle_pd(X, Y, C) \ // ((__m512d)__builtin_ia32_shufpd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (int)(C),\ // (__v8df)(__m512d)_mm512_undefined_pd(),\ // (__mmask8)-1)) // #define _mm512_mask_shuffle_pd(W, U, X, Y, C) \ // ((__m512d)__builtin_ia32_shufpd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (int)(C),\ // (__v8df)(__m512d)(W),\ // (__mmask8)(U))) // #define _mm512_maskz_shuffle_pd(U, X, Y, C) \ // ((__m512d)__builtin_ia32_shufpd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (int)(C),\ // (__v8df)(__m512d)_mm512_setzero_pd(),\ // (__mmask8)(U))) // #define _mm512_shuffle_ps(X, Y, C) \ // ((__m512)__builtin_ia32_shufps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (int)(C),\ // (__v16sf)(__m512)_mm512_undefined_ps(),\ // (__mmask16)-1)) // #define _mm512_mask_shuffle_ps(W, U, X, Y, C) \ // ((__m512)__builtin_ia32_shufps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (int)(C),\ // (__v16sf)(__m512)(W),\ // (__mmask16)(U))) // #define _mm512_maskz_shuffle_ps(U, X, Y, C) \ // ((__m512)__builtin_ia32_shufps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (int)(C),\ // (__v16sf)(__m512)_mm512_setzero_ps(),\ // (__mmask16)(U))) // #define _mm512_fixupimm_round_pd(X, Y, Z, C, R) \ // ((__m512d)__builtin_ia32_fixupimmpd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (__v8di)(__m512i)(Z), (int)(C), \ // (__mmask8)(-1), (R))) // #define _mm512_mask_fixupimm_round_pd(X, U, Y, Z, C, R) \ // ((__m512d)__builtin_ia32_fixupimmpd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (__v8di)(__m512i)(Z), (int)(C), \ // (__mmask8)(U), (R))) // #define _mm512_maskz_fixupimm_round_pd(U, X, Y, Z, C, R) \ // ((__m512d)__builtin_ia32_fixupimmpd512_maskz ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (__v8di)(__m512i)(Z), (int)(C), \ // (__mmask8)(U), (R))) // #define _mm512_fixupimm_round_ps(X, Y, Z, C, R) \ // ((__m512)__builtin_ia32_fixupimmps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (__v16si)(__m512i)(Z), (int)(C), \ // (__mmask16)(-1), (R))) // #define _mm512_mask_fixupimm_round_ps(X, U, Y, Z, C, R) \ // ((__m512)__builtin_ia32_fixupimmps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (__v16si)(__m512i)(Z), (int)(C), \ // (__mmask16)(U), (R))) // #define _mm512_maskz_fixupimm_round_ps(U, X, Y, Z, C, R) \ // ((__m512)__builtin_ia32_fixupimmps512_maskz ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (__v16si)(__m512i)(Z), (int)(C), \ // (__mmask16)(U), (R))) // #define _mm_fixupimm_round_sd(X, Y, Z, C, R) \ // ((__m128d)__builtin_ia32_fixupimmsd_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (__v2di)(__m128i)(Z), (int)(C), \ // (__mmask8)(-1), (R))) // #define _mm_mask_fixupimm_round_sd(X, U, Y, Z, C, R) \ // ((__m128d)__builtin_ia32_fixupimmsd_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (__v2di)(__m128i)(Z), (int)(C), \ // (__mmask8)(U), (R))) // #define _mm_maskz_fixupimm_round_sd(U, X, Y, Z, C, R) \ // ((__m128d)__builtin_ia32_fixupimmsd_maskz ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (__v2di)(__m128i)(Z), (int)(C), \ // (__mmask8)(U), (R))) // #define _mm_fixupimm_round_ss(X, Y, Z, C, R) \ // ((__m128)__builtin_ia32_fixupimmss_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (__v4si)(__m128i)(Z), (int)(C), \ // (__mmask8)(-1), (R))) // #define _mm_mask_fixupimm_round_ss(X, U, Y, Z, C, R) \ // ((__m128)__builtin_ia32_fixupimmss_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (__v4si)(__m128i)(Z), (int)(C), \ // (__mmask8)(U), (R))) // #define _mm_maskz_fixupimm_round_ss(U, X, Y, Z, C, R) \ // ((__m128)__builtin_ia32_fixupimmss_maskz ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (__v4si)(__m128i)(Z), (int)(C), \ // (__mmask8)(U), (R))) // #endif // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_movehdup_ps (__m512 __A) // { // return (__m512) __builtin_ia32_movshdup512_mask ((__v16sf) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_movehdup_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_movshdup512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_movehdup_ps (__mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_movshdup512_mask ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_moveldup_ps (__m512 __A) // { // return (__m512) __builtin_ia32_movsldup512_mask ((__v16sf) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_moveldup_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_movsldup512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_moveldup_ps (__mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_movsldup512_mask ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_or_si512 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v16su) __A | (__v16su) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_or_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v16su) __A | (__v16su) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_or_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pord512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_or_epi32 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pord512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_or_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v8du) __A | (__v8du) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_or_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_porq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_or_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_porq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_xor_si512 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v16su) __A ^ (__v16su) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_xor_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v16su) __A ^ (__v16su) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_xor_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pxord512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_xor_epi32 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pxord512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_xor_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v8du) __A ^ (__v8du) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_xor_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pxorq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_xor_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pxorq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_rol_epi32 (__m512i __A, const int __B) // { // return (__m512i) __builtin_ia32_prold512_mask ((__v16si) __A, __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_rol_epi32 (__m512i __W, __mmask16 __U, __m512i __A, const int __B) // { // return (__m512i) __builtin_ia32_prold512_mask ((__v16si) __A, __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_rol_epi32 (__mmask16 __U, __m512i __A, const int __B) // { // return (__m512i) __builtin_ia32_prold512_mask ((__v16si) __A, __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_ror_epi32 (__m512i __A, int __B) // { // return (__m512i) __builtin_ia32_prord512_mask ((__v16si) __A, __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_ror_epi32 (__m512i __W, __mmask16 __U, __m512i __A, int __B) // { // return (__m512i) __builtin_ia32_prord512_mask ((__v16si) __A, __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_ror_epi32 (__mmask16 __U, __m512i __A, int __B) // { // return (__m512i) __builtin_ia32_prord512_mask ((__v16si) __A, __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_rol_epi64 (__m512i __A, const int __B) // { // return (__m512i) __builtin_ia32_prolq512_mask ((__v8di) __A, __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_rol_epi64 (__m512i __W, __mmask8 __U, __m512i __A, const int __B) // { // return (__m512i) __builtin_ia32_prolq512_mask ((__v8di) __A, __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_rol_epi64 (__mmask8 __U, __m512i __A, const int __B) // { // return (__m512i) __builtin_ia32_prolq512_mask ((__v8di) __A, __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_ror_epi64 (__m512i __A, int __B) // { // return (__m512i) __builtin_ia32_prorq512_mask ((__v8di) __A, __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_ror_epi64 (__m512i __W, __mmask8 __U, __m512i __A, int __B) // { // return (__m512i) __builtin_ia32_prorq512_mask ((__v8di) __A, __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_ror_epi64 (__mmask8 __U, __m512i __A, int __B) // { // return (__m512i) __builtin_ia32_prorq512_mask ((__v8di) __A, __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #else // #define _mm512_rol_epi32(A, B) \ // ((__m512i)__builtin_ia32_prold512_mask ((__v16si)(__m512i)(A), \ // (int)(B), \ // (__v16si)_mm512_undefined_epi32 (), \ // (__mmask16)(-1))) // #define _mm512_mask_rol_epi32(W, U, A, B) \ // ((__m512i)__builtin_ia32_prold512_mask ((__v16si)(__m512i)(A), \ // (int)(B), \ // (__v16si)(__m512i)(W), \ // (__mmask16)(U))) // #define _mm512_maskz_rol_epi32(U, A, B) \ // ((__m512i)__builtin_ia32_prold512_mask ((__v16si)(__m512i)(A), \ // (int)(B), \ // (__v16si)_mm512_setzero_si512 (), \ // (__mmask16)(U))) // #define _mm512_ror_epi32(A, B) \ // ((__m512i)__builtin_ia32_prord512_mask ((__v16si)(__m512i)(A), \ // (int)(B), \ // (__v16si)_mm512_undefined_epi32 (), \ // (__mmask16)(-1))) // #define _mm512_mask_ror_epi32(W, U, A, B) \ // ((__m512i)__builtin_ia32_prord512_mask ((__v16si)(__m512i)(A), \ // (int)(B), \ // (__v16si)(__m512i)(W), \ // (__mmask16)(U))) // #define _mm512_maskz_ror_epi32(U, A, B) \ // ((__m512i)__builtin_ia32_prord512_mask ((__v16si)(__m512i)(A), \ // (int)(B), \ // (__v16si)_mm512_setzero_si512 (), \ // (__mmask16)(U))) // #define _mm512_rol_epi64(A, B) \ // ((__m512i)__builtin_ia32_prolq512_mask ((__v8di)(__m512i)(A), \ // (int)(B), \ // (__v8di)_mm512_undefined_epi32 (), \ // (__mmask8)(-1))) // #define _mm512_mask_rol_epi64(W, U, A, B) \ // ((__m512i)__builtin_ia32_prolq512_mask ((__v8di)(__m512i)(A), \ // (int)(B), \ // (__v8di)(__m512i)(W), \ // (__mmask8)(U))) // #define _mm512_maskz_rol_epi64(U, A, B) \ // ((__m512i)__builtin_ia32_prolq512_mask ((__v8di)(__m512i)(A), \ // (int)(B), \ // (__v8di)_mm512_setzero_si512 (), \ // (__mmask8)(U))) // #define _mm512_ror_epi64(A, B) \ // ((__m512i)__builtin_ia32_prorq512_mask ((__v8di)(__m512i)(A), \ // (int)(B), \ // (__v8di)_mm512_undefined_epi32 (), \ // (__mmask8)(-1))) // #define _mm512_mask_ror_epi64(W, U, A, B) \ // ((__m512i)__builtin_ia32_prorq512_mask ((__v8di)(__m512i)(A), \ // (int)(B), \ // (__v8di)(__m512i)(W), \ // (__mmask8)(U))) // #define _mm512_maskz_ror_epi64(U, A, B) \ // ((__m512i)__builtin_ia32_prorq512_mask ((__v8di)(__m512i)(A), \ // (int)(B), \ // (__v8di)_mm512_setzero_si512 (), \ // (__mmask8)(U))) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_and_si512 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v16su) __A & (__v16su) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_and_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v16su) __A & (__v16su) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_and_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_and_epi32 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_and_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) ((__v8du) __A & (__v8du) __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_and_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_and_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_pd (), // __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_andnot_si512 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandnd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_andnot_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandnd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_andnot_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandnd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_andnot_epi32 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandnd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_andnot_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandnq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_andnot_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandnq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_andnot_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pandnq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_pd (), // __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_test_epi32_mask (__m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_ptestmd512 ((__v16si) __A, // (__v16si) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_test_epi32_mask (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_ptestmd512 ((__v16si) __A, // (__v16si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_test_epi64_mask (__m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_ptestmq512 ((__v8di) __A, // (__v8di) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_test_epi64_mask (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_ptestmq512 ((__v8di) __A, (__v8di) __B, __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_testn_epi32_mask (__m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_ptestnmd512 ((__v16si) __A, // (__v16si) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_testn_epi32_mask (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_ptestnmd512 ((__v16si) __A, // (__v16si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_testn_epi64_mask (__m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_ptestnmq512 ((__v8di) __A, // (__v8di) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_testn_epi64_mask (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_ptestnmq512 ((__v8di) __A, // (__v8di) __B, __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_abs_ps (__m512 __A) // { // return (__m512) _mm512_and_epi32 ((__m512i) __A, // _mm512_set1_epi32 (0x7fffffff)); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_abs_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) _mm512_mask_and_epi32 ((__m512i) __W, __U, (__m512i) __A, // _mm512_set1_epi32 (0x7fffffff)); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_abs_pd (__m512d __A) // { // return (__m512d) _mm512_and_epi64 ((__m512i) __A, // _mm512_set1_epi64 (0x7fffffffffffffffLL)); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_abs_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) // _mm512_mask_and_epi64 ((__m512i) __W, __U, (__m512i) __A, // _mm512_set1_epi64 (0x7fffffffffffffffLL)); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpackhi_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhdq512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpackhi_epi32 (__m512i __W, __mmask16 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhdq512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpackhi_epi32 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhdq512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpackhi_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhqdq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpackhi_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhqdq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpackhi_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckhqdq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpacklo_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckldq512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpacklo_epi32 (__m512i __W, __mmask16 __U, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_punpckldq512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpacklo_epi32 (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpckldq512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpacklo_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpcklqdq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpacklo_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpcklqdq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpacklo_epi64 (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_punpcklqdq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #ifdef __x86_64__ // #ifdef __OPTIMIZE__ // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundss_u64 (__m128 __A, const int __R) // { // return (unsigned long long) __builtin_ia32_vcvtss2usi64 ((__v4sf) __A, __R); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundss_si64 (__m128 __A, const int __R) // { // return (long long) __builtin_ia32_vcvtss2si64 ((__v4sf) __A, __R); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundss_i64 (__m128 __A, const int __R) // { // return (long long) __builtin_ia32_vcvtss2si64 ((__v4sf) __A, __R); // } // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundss_u64 (__m128 __A, const int __R) // { // return (unsigned long long) __builtin_ia32_vcvttss2usi64 ((__v4sf) __A, __R); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundss_i64 (__m128 __A, const int __R) // { // return (long long) __builtin_ia32_vcvttss2si64 ((__v4sf) __A, __R); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundss_si64 (__m128 __A, const int __R) // { // return (long long) __builtin_ia32_vcvttss2si64 ((__v4sf) __A, __R); // } // #else // #define _mm_cvt_roundss_u64(A, B) \ // ((unsigned long long)__builtin_ia32_vcvtss2usi64(A, B)) // #define _mm_cvt_roundss_si64(A, B) \ // ((long long)__builtin_ia32_vcvtss2si64(A, B)) // #define _mm_cvt_roundss_i64(A, B) \ // ((long long)__builtin_ia32_vcvtss2si64(A, B)) // #define _mm_cvtt_roundss_u64(A, B) \ // ((unsigned long long)__builtin_ia32_vcvttss2usi64(A, B)) // #define _mm_cvtt_roundss_i64(A, B) \ // ((long long)__builtin_ia32_vcvttss2si64(A, B)) // #define _mm_cvtt_roundss_si64(A, B) \ // ((long long)__builtin_ia32_vcvttss2si64(A, B)) // #endif // #endif // #ifdef __OPTIMIZE__ // extern __inline unsigned // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundss_u32 (__m128 __A, const int __R) // { // return (unsigned) __builtin_ia32_vcvtss2usi32 ((__v4sf) __A, __R); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundss_si32 (__m128 __A, const int __R) // { // return (int) __builtin_ia32_vcvtss2si32 ((__v4sf) __A, __R); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundss_i32 (__m128 __A, const int __R) // { // return (int) __builtin_ia32_vcvtss2si32 ((__v4sf) __A, __R); // } // extern __inline unsigned // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundss_u32 (__m128 __A, const int __R) // { // return (unsigned) __builtin_ia32_vcvttss2usi32 ((__v4sf) __A, __R); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundss_i32 (__m128 __A, const int __R) // { // return (int) __builtin_ia32_vcvttss2si32 ((__v4sf) __A, __R); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundss_si32 (__m128 __A, const int __R) // { // return (int) __builtin_ia32_vcvttss2si32 ((__v4sf) __A, __R); // } // #else // #define _mm_cvt_roundss_u32(A, B) \ // ((unsigned)__builtin_ia32_vcvtss2usi32(A, B)) // #define _mm_cvt_roundss_si32(A, B) \ // ((int)__builtin_ia32_vcvtss2si32(A, B)) // #define _mm_cvt_roundss_i32(A, B) \ // ((int)__builtin_ia32_vcvtss2si32(A, B)) // #define _mm_cvtt_roundss_u32(A, B) \ // ((unsigned)__builtin_ia32_vcvttss2usi32(A, B)) // #define _mm_cvtt_roundss_si32(A, B) \ // ((int)__builtin_ia32_vcvttss2si32(A, B)) // #define _mm_cvtt_roundss_i32(A, B) \ // ((int)__builtin_ia32_vcvttss2si32(A, B)) // #endif // #ifdef __x86_64__ // #ifdef __OPTIMIZE__ // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundsd_u64 (__m128d __A, const int __R) // { // return (unsigned long long) __builtin_ia32_vcvtsd2usi64 ((__v2df) __A, __R); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundsd_si64 (__m128d __A, const int __R) // { // return (long long) __builtin_ia32_vcvtsd2si64 ((__v2df) __A, __R); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundsd_i64 (__m128d __A, const int __R) // { // return (long long) __builtin_ia32_vcvtsd2si64 ((__v2df) __A, __R); // } // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundsd_u64 (__m128d __A, const int __R) // { // return (unsigned long long) __builtin_ia32_vcvttsd2usi64 ((__v2df) __A, __R); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundsd_si64 (__m128d __A, const int __R) // { // return (long long) __builtin_ia32_vcvttsd2si64 ((__v2df) __A, __R); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundsd_i64 (__m128d __A, const int __R) // { // return (long long) __builtin_ia32_vcvttsd2si64 ((__v2df) __A, __R); // } // #else // #define _mm_cvt_roundsd_u64(A, B) \ // ((unsigned long long)__builtin_ia32_vcvtsd2usi64(A, B)) // #define _mm_cvt_roundsd_si64(A, B) \ // ((long long)__builtin_ia32_vcvtsd2si64(A, B)) // #define _mm_cvt_roundsd_i64(A, B) \ // ((long long)__builtin_ia32_vcvtsd2si64(A, B)) // #define _mm_cvtt_roundsd_u64(A, B) \ // ((unsigned long long)__builtin_ia32_vcvttsd2usi64(A, B)) // #define _mm_cvtt_roundsd_si64(A, B) \ // ((long long)__builtin_ia32_vcvttsd2si64(A, B)) // #define _mm_cvtt_roundsd_i64(A, B) \ // ((long long)__builtin_ia32_vcvttsd2si64(A, B)) // #endif // #endif // #ifdef __OPTIMIZE__ // extern __inline unsigned // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundsd_u32 (__m128d __A, const int __R) // { // return (unsigned) __builtin_ia32_vcvtsd2usi32 ((__v2df) __A, __R); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundsd_si32 (__m128d __A, const int __R) // { // return (int) __builtin_ia32_vcvtsd2si32 ((__v2df) __A, __R); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundsd_i32 (__m128d __A, const int __R) // { // return (int) __builtin_ia32_vcvtsd2si32 ((__v2df) __A, __R); // } // extern __inline unsigned // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundsd_u32 (__m128d __A, const int __R) // { // return (unsigned) __builtin_ia32_vcvttsd2usi32 ((__v2df) __A, __R); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundsd_i32 (__m128d __A, const int __R) // { // return (int) __builtin_ia32_vcvttsd2si32 ((__v2df) __A, __R); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtt_roundsd_si32 (__m128d __A, const int __R) // { // return (int) __builtin_ia32_vcvttsd2si32 ((__v2df) __A, __R); // } // #else // #define _mm_cvt_roundsd_u32(A, B) \ // ((unsigned)__builtin_ia32_vcvtsd2usi32(A, B)) // #define _mm_cvt_roundsd_si32(A, B) \ // ((int)__builtin_ia32_vcvtsd2si32(A, B)) // #define _mm_cvt_roundsd_i32(A, B) \ // ((int)__builtin_ia32_vcvtsd2si32(A, B)) // #define _mm_cvtt_roundsd_u32(A, B) \ // ((unsigned)__builtin_ia32_vcvttsd2usi32(A, B)) // #define _mm_cvtt_roundsd_si32(A, B) \ // ((int)__builtin_ia32_vcvttsd2si32(A, B)) // #define _mm_cvtt_roundsd_i32(A, B) \ // ((int)__builtin_ia32_vcvttsd2si32(A, B)) // #endif // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_movedup_pd (__m512d __A) // { // return (__m512d) __builtin_ia32_movddup512_mask ((__v8df) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_movedup_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_movddup512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_movedup_pd (__mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_movddup512_mask ((__v8df) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpacklo_pd (__m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_unpcklpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpacklo_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_unpcklpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpacklo_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_unpcklpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpackhi_pd (__m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_unpckhpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpackhi_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_unpckhpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpackhi_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_unpckhpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpackhi_ps (__m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_unpckhps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpackhi_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_unpckhps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpackhi_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_unpckhps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundps_pd (__m256 __A, const int __R) // { // return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundps_pd (__m512d __W, __mmask8 __U, __m256 __A, // const int __R) // { // return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, // (__v8df) __W, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundps_pd (__mmask8 __U, __m256 __A, const int __R) // { // return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundph_ps (__m256i __A, const int __R) // { // return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundph_ps (__m512 __W, __mmask16 __U, __m256i __A, // const int __R) // { // return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundph_ps (__mmask16 __U, __m256i __A, const int __R) // { // return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundps_ph (__m512 __A, const int __I) // { // return (__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf) __A, // __I, // (__v16hi) // _mm256_undefined_si256 (), // -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtps_ph (__m512 __A, const int __I) // { // return (__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf) __A, // __I, // (__v16hi) // _mm256_undefined_si256 (), // -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundps_ph (__m256i __U, __mmask16 __W, __m512 __A, // const int __I) // { // return (__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf) __A, // __I, // (__v16hi) __U, // (__mmask16) __W); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtps_ph (__m256i __U, __mmask16 __W, __m512 __A, const int __I) // { // return (__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf) __A, // __I, // (__v16hi) __U, // (__mmask16) __W); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundps_ph (__mmask16 __W, __m512 __A, const int __I) // { // return (__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf) __A, // __I, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __W); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtps_ph (__mmask16 __W, __m512 __A, const int __I) // { // return (__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf) __A, // __I, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __W); // } // #else // #define _mm512_cvt_roundps_pd(A, B) \ // (__m512d)__builtin_ia32_cvtps2pd512_mask(A, (__v8df)_mm512_undefined_pd(), -1, B) // #define _mm512_mask_cvt_roundps_pd(W, U, A, B) \ // (__m512d)__builtin_ia32_cvtps2pd512_mask(A, (__v8df)(W), U, B) // #define _mm512_maskz_cvt_roundps_pd(U, A, B) \ // (__m512d)__builtin_ia32_cvtps2pd512_mask(A, (__v8df)_mm512_setzero_pd(), U, B) // #define _mm512_cvt_roundph_ps(A, B) \ // (__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(A), (__v16sf)_mm512_undefined_ps(), -1, B) // #define _mm512_mask_cvt_roundph_ps(W, U, A, B) \ // (__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(A), (__v16sf)(W), U, B) // #define _mm512_maskz_cvt_roundph_ps(U, A, B) \ // (__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(A), (__v16sf)_mm512_setzero_ps(), U, B) // #define _mm512_cvt_roundps_ph(A, I) \ // ((__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf)(__m512) (A), (int) (I),\ // (__v16hi)_mm256_undefined_si256 (), -1)) // #define _mm512_cvtps_ph(A, I) \ // ((__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf)(__m512) (A), (int) (I),\ // (__v16hi)_mm256_undefined_si256 (), -1)) // #define _mm512_mask_cvt_roundps_ph(U, W, A, I) \ // ((__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf)(__m512) (A), (int) (I),\ // (__v16hi)(__m256i)(U), (__mmask16) (W))) // #define _mm512_mask_cvtps_ph(U, W, A, I) \ // ((__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf)(__m512) (A), (int) (I),\ // (__v16hi)(__m256i)(U), (__mmask16) (W))) // #define _mm512_maskz_cvt_roundps_ph(W, A, I) \ // ((__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf)(__m512) (A), (int) (I),\ // (__v16hi)_mm256_setzero_si256 (), (__mmask16) (W))) // #define _mm512_maskz_cvtps_ph(W, A, I) \ // ((__m256i) __builtin_ia32_vcvtps2ph512_mask ((__v16sf)(__m512) (A), (int) (I),\ // (__v16hi)_mm256_setzero_si256 (), (__mmask16) (W))) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvt_roundpd_ps (__m512d __A, const int __R) // { // return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A, // (__v8sf) // _mm256_undefined_ps (), // (__mmask8) -1, __R); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvt_roundpd_ps (__m256 __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A, // (__v8sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvt_roundpd_ps (__mmask8 __U, __m512d __A, const int __R) // { // return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundsd_ss (__m128 __A, __m128d __B, const int __R) // { // return (__m128) __builtin_ia32_cvtsd2ss_round ((__v4sf) __A, // (__v2df) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvt_roundss_sd (__m128d __A, __m128 __B, const int __R) // { // return (__m128d) __builtin_ia32_cvtss2sd_round ((__v2df) __A, // (__v4sf) __B, // __R); // } // #else // #define _mm512_cvt_roundpd_ps(A, B) \ // (__m256)__builtin_ia32_cvtpd2ps512_mask(A, (__v8sf)_mm256_undefined_ps(), -1, B) // #define _mm512_mask_cvt_roundpd_ps(W, U, A, B) \ // (__m256)__builtin_ia32_cvtpd2ps512_mask(A, (__v8sf)(W), U, B) // #define _mm512_maskz_cvt_roundpd_ps(U, A, B) \ // (__m256)__builtin_ia32_cvtpd2ps512_mask(A, (__v8sf)_mm256_setzero_ps(), U, B) // #define _mm_cvt_roundsd_ss(A, B, C) \ // (__m128)__builtin_ia32_cvtsd2ss_round(A, B, C) // #define _mm_cvt_roundss_sd(A, B, C) \ // (__m128d)__builtin_ia32_cvtss2sd_round(A, B, C) // #endif // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_stream_si512 (__m512i * __P, __m512i __A) // { // __builtin_ia32_movntdq512 ((__v8di *) __P, (__v8di) __A); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_stream_ps (float *__P, __m512 __A) // { // __builtin_ia32_movntps512 (__P, (__v16sf) __A); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_stream_pd (double *__P, __m512d __A) // { // __builtin_ia32_movntpd512 (__P, (__v8df) __A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_stream_load_si512 (void *__P) // { // return __builtin_ia32_movntdqa512 ((__v8di *)__P); // } // /* Constants for mantissa extraction */ // typedef enum // { // _MM_MANT_NORM_1_2, /* interval [1, 2) */ // _MM_MANT_NORM_p5_2, /* interval [0.5, 2) */ // _MM_MANT_NORM_p5_1, /* interval [0.5, 1) */ // _MM_MANT_NORM_p75_1p5 /* interval [0.75, 1.5) */ // } _MM_MANTISSA_NORM_ENUM; // typedef enum // { // _MM_MANT_SIGN_src, /* sign = sign(SRC) */ // _MM_MANT_SIGN_zero, /* sign = 0 */ // _MM_MANT_SIGN_nan /* DEST = NaN if sign(SRC) = 1 */ // } _MM_MANTISSA_SIGN_ENUM; // #ifdef __OPTIMIZE__ // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getexp_round_ss (__m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_getexpss128_round ((__v4sf) __A, // (__v4sf) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getexp_round_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_getexpss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getexp_round_ss (__mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_getexpss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getexp_round_sd (__m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_getexpsd128_round ((__v2df) __A, // (__v2df) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getexp_round_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_getexpsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getexp_round_sd (__mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_getexpsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_getexp_round_ps (__m512 __A, const int __R) // { // return (__m512) __builtin_ia32_getexpps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_getexp_round_ps (__m512 __W, __mmask16 __U, __m512 __A, // const int __R) // { // return (__m512) __builtin_ia32_getexpps512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_getexp_round_ps (__mmask16 __U, __m512 __A, const int __R) // { // return (__m512) __builtin_ia32_getexpps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_getexp_round_pd (__m512d __A, const int __R) // { // return (__m512d) __builtin_ia32_getexppd512_mask ((__v8df) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_getexp_round_pd (__m512d __W, __mmask8 __U, __m512d __A, // const int __R) // { // return (__m512d) __builtin_ia32_getexppd512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_getexp_round_pd (__mmask8 __U, __m512d __A, const int __R) // { // return (__m512d) __builtin_ia32_getexppd512_mask ((__v8df) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_getmant_round_pd (__m512d __A, _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C, const int __R) // { // return (__m512d) __builtin_ia32_getmantpd512_mask ((__v8df) __A, // (__C << 2) | __B, // _mm512_undefined_pd (), // (__mmask8) -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_getmant_round_pd (__m512d __W, __mmask8 __U, __m512d __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C, const int __R) // { // return (__m512d) __builtin_ia32_getmantpd512_mask ((__v8df) __A, // (__C << 2) | __B, // (__v8df) __W, __U, // __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_getmant_round_pd (__mmask8 __U, __m512d __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C, const int __R) // { // return (__m512d) __builtin_ia32_getmantpd512_mask ((__v8df) __A, // (__C << 2) | __B, // (__v8df) // _mm512_setzero_pd (), // __U, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_getmant_round_ps (__m512 __A, _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C, const int __R) // { // return (__m512) __builtin_ia32_getmantps512_mask ((__v16sf) __A, // (__C << 2) | __B, // _mm512_undefined_ps (), // (__mmask16) -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_getmant_round_ps (__m512 __W, __mmask16 __U, __m512 __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C, const int __R) // { // return (__m512) __builtin_ia32_getmantps512_mask ((__v16sf) __A, // (__C << 2) | __B, // (__v16sf) __W, __U, // __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_getmant_round_ps (__mmask16 __U, __m512 __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C, const int __R) // { // return (__m512) __builtin_ia32_getmantps512_mask ((__v16sf) __A, // (__C << 2) | __B, // (__v16sf) // _mm512_setzero_ps (), // __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getmant_round_sd (__m128d __A, __m128d __B, // _MM_MANTISSA_NORM_ENUM __C, // _MM_MANTISSA_SIGN_ENUM __D, const int __R) // { // return (__m128d) __builtin_ia32_getmantsd_round ((__v2df) __A, // (__v2df) __B, // (__D << 2) | __C, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getmant_round_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B, _MM_MANTISSA_NORM_ENUM __C, // _MM_MANTISSA_SIGN_ENUM __D, const int __R) // { // return (__m128d) __builtin_ia32_getmantsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__D << 2) | __C, // (__v2df) __W, // __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getmant_round_sd (__mmask8 __U, __m128d __A, __m128d __B, // _MM_MANTISSA_NORM_ENUM __C, // _MM_MANTISSA_SIGN_ENUM __D, const int __R) // { // return (__m128d) __builtin_ia32_getmantsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__D << 2) | __C, // (__v2df) // _mm_setzero_pd(), // __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getmant_round_ss (__m128 __A, __m128 __B, // _MM_MANTISSA_NORM_ENUM __C, // _MM_MANTISSA_SIGN_ENUM __D, const int __R) // { // return (__m128) __builtin_ia32_getmantss_round ((__v4sf) __A, // (__v4sf) __B, // (__D << 2) | __C, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getmant_round_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B, _MM_MANTISSA_NORM_ENUM __C, // _MM_MANTISSA_SIGN_ENUM __D, const int __R) // { // return (__m128) __builtin_ia32_getmantss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__D << 2) | __C, // (__v4sf) __W, // __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getmant_round_ss (__mmask8 __U, __m128 __A, __m128 __B, // _MM_MANTISSA_NORM_ENUM __C, // _MM_MANTISSA_SIGN_ENUM __D, const int __R) // { // return (__m128) __builtin_ia32_getmantss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__D << 2) | __C, // (__v4sf) // _mm_setzero_ps(), // __U, __R); // } // #else // #define _mm512_getmant_round_pd(X, B, C, R) \ // ((__m512d)__builtin_ia32_getmantpd512_mask ((__v8df)(__m512d)(X), \ // (int)(((C)<<2) | (B)), \ // (__v8df)(__m512d)_mm512_undefined_pd(), \ // (__mmask8)-1,\ // (R))) // #define _mm512_mask_getmant_round_pd(W, U, X, B, C, R) \ // ((__m512d)__builtin_ia32_getmantpd512_mask ((__v8df)(__m512d)(X), \ // (int)(((C)<<2) | (B)), \ // (__v8df)(__m512d)(W), \ // (__mmask8)(U),\ // (R))) // #define _mm512_maskz_getmant_round_pd(U, X, B, C, R) \ // ((__m512d)__builtin_ia32_getmantpd512_mask ((__v8df)(__m512d)(X), \ // (int)(((C)<<2) | (B)), \ // (__v8df)(__m512d)_mm512_setzero_pd(), \ // (__mmask8)(U),\ // (R))) // #define _mm512_getmant_round_ps(X, B, C, R) \ // ((__m512)__builtin_ia32_getmantps512_mask ((__v16sf)(__m512)(X), \ // (int)(((C)<<2) | (B)), \ // (__v16sf)(__m512)_mm512_undefined_ps(), \ // (__mmask16)-1,\ // (R))) // #define _mm512_mask_getmant_round_ps(W, U, X, B, C, R) \ // ((__m512)__builtin_ia32_getmantps512_mask ((__v16sf)(__m512)(X), \ // (int)(((C)<<2) | (B)), \ // (__v16sf)(__m512)(W), \ // (__mmask16)(U),\ // (R))) // #define _mm512_maskz_getmant_round_ps(U, X, B, C, R) \ // ((__m512)__builtin_ia32_getmantps512_mask ((__v16sf)(__m512)(X), \ // (int)(((C)<<2) | (B)), \ // (__v16sf)(__m512)_mm512_setzero_ps(), \ // (__mmask16)(U),\ // (R))) // #define _mm_getmant_round_sd(X, Y, C, D, R) \ // ((__m128d)__builtin_ia32_getmantsd_round ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), \ // (int)(((D)<<2) | (C)), \ // (R))) // #define _mm_mask_getmant_round_sd(W, U, X, Y, C, D, R) \ // ((__m128d)__builtin_ia32_getmantsd_mask_round ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), \ // (int)(((D)<<2) | (C)), \ // (__v2df)(__m128d)(W), \ // (__mmask8)(U),\ // (R))) // #define _mm_maskz_getmant_round_sd(U, X, Y, C, D, R) \ // ((__m128d)__builtin_ia32_getmantsd_mask_round ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), \ // (int)(((D)<<2) | (C)), \ // (__v2df)(__m128d)_mm_setzero_pd(), \ // (__mmask8)(U),\ // (R))) // #define _mm_getmant_round_ss(X, Y, C, D, R) \ // ((__m128)__builtin_ia32_getmantss_round ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), \ // (int)(((D)<<2) | (C)), \ // (R))) // #define _mm_mask_getmant_round_ss(W, U, X, Y, C, D, R) \ // ((__m128)__builtin_ia32_getmantss_mask_round ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), \ // (int)(((D)<<2) | (C)), \ // (__v4sf)(__m128)(W), \ // (__mmask8)(U),\ // (R))) // #define _mm_maskz_getmant_round_ss(U, X, Y, C, D, R) \ // ((__m128)__builtin_ia32_getmantss_mask_round ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), \ // (int)(((D)<<2) | (C)), \ // (__v4sf)(__m128)_mm_setzero_ps(), \ // (__mmask8)(U),\ // (R))) // #define _mm_getexp_round_ss(A, B, R) \ // ((__m128)__builtin_ia32_getexpss128_round((__v4sf)(__m128)(A), (__v4sf)(__m128)(B), R)) // #define _mm_mask_getexp_round_ss(W, U, A, B, C) \ // (__m128)__builtin_ia32_getexpss_mask_round(A, B, W, U, C) // #define _mm_maskz_getexp_round_ss(U, A, B, C) \ // (__m128)__builtin_ia32_getexpss_mask_round(A, B, (__v4sf)_mm_setzero_ps(), U, C) // #define _mm_getexp_round_sd(A, B, R) \ // ((__m128d)__builtin_ia32_getexpsd128_round((__v2df)(__m128d)(A), (__v2df)(__m128d)(B), R)) // #define _mm_mask_getexp_round_sd(W, U, A, B, C) \ // (__m128d)__builtin_ia32_getexpsd_mask_round(A, B, W, U, C) // #define _mm_maskz_getexp_round_sd(U, A, B, C) \ // (__m128d)__builtin_ia32_getexpsd_mask_round(A, B, (__v2df)_mm_setzero_pd(), U, C) // #define _mm512_getexp_round_ps(A, R) \ // ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ // (__v16sf)_mm512_undefined_ps(), (__mmask16)-1, R)) // #define _mm512_mask_getexp_round_ps(W, U, A, R) \ // ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ // (__v16sf)(__m512)(W), (__mmask16)(U), R)) // #define _mm512_maskz_getexp_round_ps(U, A, R) \ // ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ // (__v16sf)_mm512_setzero_ps(), (__mmask16)(U), R)) // #define _mm512_getexp_round_pd(A, R) \ // ((__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \ // (__v8df)_mm512_undefined_pd(), (__mmask8)-1, R)) // #define _mm512_mask_getexp_round_pd(W, U, A, R) \ // ((__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \ // (__v8df)(__m512d)(W), (__mmask8)(U), R)) // #define _mm512_maskz_getexp_round_pd(U, A, R) \ // ((__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \ // (__v8df)_mm512_setzero_pd(), (__mmask8)(U), R)) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_roundscale_round_ps (__m512 __A, const int __imm, const int __R) // { // return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, __imm, // (__v16sf) // _mm512_undefined_ps (), // -1, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_roundscale_round_ps (__m512 __A, __mmask16 __B, __m512 __C, // const int __imm, const int __R) // { // return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __C, __imm, // (__v16sf) __A, // (__mmask16) __B, __R); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_roundscale_round_ps (__mmask16 __A, __m512 __B, // const int __imm, const int __R) // { // return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __B, // __imm, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __A, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_roundscale_round_pd (__m512d __A, const int __imm, const int __R) // { // return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, __imm, // (__v8df) // _mm512_undefined_pd (), // -1, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_roundscale_round_pd (__m512d __A, __mmask8 __B, // __m512d __C, const int __imm, const int __R) // { // return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __C, __imm, // (__v8df) __A, // (__mmask8) __B, __R); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_roundscale_round_pd (__mmask8 __A, __m512d __B, // const int __imm, const int __R) // { // return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __B, // __imm, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __A, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_roundscale_round_ss (__m128 __A, __m128 __B, const int __imm, // const int __R) // { // return (__m128) // __builtin_ia32_rndscaless_mask_round ((__v4sf) __A, // (__v4sf) __B, __imm, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_roundscale_round_ss (__m128 __A, __mmask8 __B, __m128 __C, // __m128 __D, const int __imm, const int __R) // { // return (__m128) // __builtin_ia32_rndscaless_mask_round ((__v4sf) __C, // (__v4sf) __D, __imm, // (__v4sf) __A, // (__mmask8) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_roundscale_round_ss (__mmask8 __A, __m128 __B, __m128 __C, // const int __imm, const int __R) // { // return (__m128) // __builtin_ia32_rndscaless_mask_round ((__v4sf) __B, // (__v4sf) __C, __imm, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __A, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_roundscale_round_sd (__m128d __A, __m128d __B, const int __imm, // const int __R) // { // return (__m128d) // __builtin_ia32_rndscalesd_mask_round ((__v2df) __A, // (__v2df) __B, __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_roundscale_round_sd (__m128d __A, __mmask8 __B, __m128d __C, // __m128d __D, const int __imm, const int __R) // { // return (__m128d) // __builtin_ia32_rndscalesd_mask_round ((__v2df) __C, // (__v2df) __D, __imm, // (__v2df) __A, // (__mmask8) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_roundscale_round_sd (__mmask8 __A, __m128d __B, __m128d __C, // const int __imm, const int __R) // { // return (__m128d) // __builtin_ia32_rndscalesd_mask_round ((__v2df) __B, // (__v2df) __C, __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __A, // __R); // } // #else // #define _mm512_roundscale_round_ps(A, B, R) \ // ((__m512) __builtin_ia32_rndscaleps_mask ((__v16sf)(__m512)(A), (int)(B),\ // (__v16sf)_mm512_undefined_ps(), (__mmask16)(-1), R)) // #define _mm512_mask_roundscale_round_ps(A, B, C, D, R) \ // ((__m512) __builtin_ia32_rndscaleps_mask ((__v16sf)(__m512)(C), \ // (int)(D), \ // (__v16sf)(__m512)(A), \ // (__mmask16)(B), R)) // #define _mm512_maskz_roundscale_round_ps(A, B, C, R) \ // ((__m512) __builtin_ia32_rndscaleps_mask ((__v16sf)(__m512)(B), \ // (int)(C), \ // (__v16sf)_mm512_setzero_ps(),\ // (__mmask16)(A), R)) // #define _mm512_roundscale_round_pd(A, B, R) \ // ((__m512d) __builtin_ia32_rndscalepd_mask ((__v8df)(__m512d)(A), (int)(B),\ // (__v8df)_mm512_undefined_pd(), (__mmask8)(-1), R)) // #define _mm512_mask_roundscale_round_pd(A, B, C, D, R) \ // ((__m512d) __builtin_ia32_rndscalepd_mask ((__v8df)(__m512d)(C), \ // (int)(D), \ // (__v8df)(__m512d)(A), \ // (__mmask8)(B), R)) // #define _mm512_maskz_roundscale_round_pd(A, B, C, R) \ // ((__m512d) __builtin_ia32_rndscalepd_mask ((__v8df)(__m512d)(B), \ // (int)(C), \ // (__v8df)_mm512_setzero_pd(),\ // (__mmask8)(A), R)) // #define _mm_roundscale_round_ss(A, B, I, R) \ // ((__m128) \ // __builtin_ia32_rndscaless_mask_round ((__v4sf) (__m128) (A), \ // (__v4sf) (__m128) (B), \ // (int) (I), \ // (__v4sf) _mm_setzero_ps (), \ // (__mmask8) (-1), \ // (int) (R))) // #define _mm_mask_roundscale_round_ss(A, U, B, C, I, R) \ // ((__m128) \ // __builtin_ia32_rndscaless_mask_round ((__v4sf) (__m128) (B), \ // (__v4sf) (__m128) (C), \ // (int) (I), \ // (__v4sf) (__m128) (A), \ // (__mmask8) (U), \ // (int) (R))) // #define _mm_maskz_roundscale_round_ss(U, A, B, I, R) \ // ((__m128) \ // __builtin_ia32_rndscaless_mask_round ((__v4sf) (__m128) (A), \ // (__v4sf) (__m128) (B), \ // (int) (I), \ // (__v4sf) _mm_setzero_ps (), \ // (__mmask8) (U), \ // (int) (R))) // #define _mm_roundscale_round_sd(A, B, I, R) \ // ((__m128d) \ // __builtin_ia32_rndscalesd_mask_round ((__v2df) (__m128d) (A), \ // (__v2df) (__m128d) (B), \ // (int) (I), \ // (__v2df) _mm_setzero_pd (), \ // (__mmask8) (-1), \ // (int) (R))) // #define _mm_mask_roundscale_round_sd(A, U, B, C, I, R) \ // ((__m128d) \ // __builtin_ia32_rndscalesd_mask_round ((__v2df) (__m128d) (B), \ // (__v2df) (__m128d) (C), \ // (int) (I), \ // (__v2df) (__m128d) (A), \ // (__mmask8) (U), \ // (int) (R))) // #define _mm_maskz_roundscale_round_sd(U, A, B, I, R) \ // ((__m128d) \ // __builtin_ia32_rndscalesd_mask_round ((__v2df) (__m128d) (A), \ // (__v2df) (__m128d) (B), \ // (int) (I), \ // (__v2df) _mm_setzero_pd (), \ // (__mmask8) (U), \ // (int) (R))) // #endif // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_floor_ps (__m512 __A) // { // return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, // _MM_FROUND_FLOOR, // (__v16sf) __A, -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_floor_pd (__m512d __A) // { // return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, // _MM_FROUND_FLOOR, // (__v8df) __A, -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_ceil_ps (__m512 __A) // { // return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, // _MM_FROUND_CEIL, // (__v16sf) __A, -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_ceil_pd (__m512d __A) // { // return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, // _MM_FROUND_CEIL, // (__v8df) __A, -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_floor_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, // _MM_FROUND_FLOOR, // (__v16sf) __W, __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_floor_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, // _MM_FROUND_FLOOR, // (__v8df) __W, __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_ceil_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, // _MM_FROUND_CEIL, // (__v16sf) __W, __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_ceil_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, // _MM_FROUND_CEIL, // (__v8df) __W, __U, // _MM_FROUND_CUR_DIRECTION); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_alignr_epi32 (__m512i __A, __m512i __B, const int __imm) // { // return (__m512i) __builtin_ia32_alignd512_mask ((__v16si) __A, // (__v16si) __B, __imm, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_alignr_epi32 (__m512i __W, __mmask16 __U, __m512i __A, // __m512i __B, const int __imm) // { // return (__m512i) __builtin_ia32_alignd512_mask ((__v16si) __A, // (__v16si) __B, __imm, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_alignr_epi32 (__mmask16 __U, __m512i __A, __m512i __B, // const int __imm) // { // return (__m512i) __builtin_ia32_alignd512_mask ((__v16si) __A, // (__v16si) __B, __imm, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_alignr_epi64 (__m512i __A, __m512i __B, const int __imm) // { // return (__m512i) __builtin_ia32_alignq512_mask ((__v8di) __A, // (__v8di) __B, __imm, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_alignr_epi64 (__m512i __W, __mmask8 __U, __m512i __A, // __m512i __B, const int __imm) // { // return (__m512i) __builtin_ia32_alignq512_mask ((__v8di) __A, // (__v8di) __B, __imm, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_alignr_epi64 (__mmask8 __U, __m512i __A, __m512i __B, // const int __imm) // { // return (__m512i) __builtin_ia32_alignq512_mask ((__v8di) __A, // (__v8di) __B, __imm, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // #else // #define _mm512_alignr_epi32(X, Y, C) \ // ((__m512i)__builtin_ia32_alignd512_mask ((__v16si)(__m512i)(X), \ // (__v16si)(__m512i)(Y), (int)(C), (__v16si)_mm512_undefined_epi32 (),\ // (__mmask16)-1)) // #define _mm512_mask_alignr_epi32(W, U, X, Y, C) \ // ((__m512i)__builtin_ia32_alignd512_mask ((__v16si)(__m512i)(X), \ // (__v16si)(__m512i)(Y), (int)(C), (__v16si)(__m512i)(W), \ // (__mmask16)(U))) // #define _mm512_maskz_alignr_epi32(U, X, Y, C) \ // ((__m512i)__builtin_ia32_alignd512_mask ((__v16si)(__m512i)(X), \ // (__v16si)(__m512i)(Y), (int)(C), (__v16si)_mm512_setzero_si512 (),\ // (__mmask16)(U))) // #define _mm512_alignr_epi64(X, Y, C) \ // ((__m512i)__builtin_ia32_alignq512_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)(C), (__v8di)_mm512_undefined_epi32 (), \ // (__mmask8)-1)) // #define _mm512_mask_alignr_epi64(W, U, X, Y, C) \ // ((__m512i)__builtin_ia32_alignq512_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)(C), (__v8di)(__m512i)(W), (__mmask8)(U))) // #define _mm512_maskz_alignr_epi64(U, X, Y, C) \ // ((__m512i)__builtin_ia32_alignq512_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)(C), (__v8di)_mm512_setzero_si512 (),\ // (__mmask8)(U))) // #endif // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpeq_epi32_mask (__m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_pcmpeqd512_mask ((__v16si) __A, // (__v16si) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpeq_epi32_mask (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_pcmpeqd512_mask ((__v16si) __A, // (__v16si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpeq_epi64_mask (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqq512_mask ((__v8di) __A, // (__v8di) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpeq_epi64_mask (__m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqq512_mask ((__v8di) __A, // (__v8di) __B, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpgt_epi32_mask (__m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_pcmpgtd512_mask ((__v16si) __A, // (__v16si) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpgt_epi32_mask (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_pcmpgtd512_mask ((__v16si) __A, // (__v16si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpgt_epi64_mask (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtq512_mask ((__v8di) __A, // (__v8di) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpgt_epi64_mask (__m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtq512_mask ((__v8di) __A, // (__v8di) __B, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpge_epi32_mask (__m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_cmpd512_mask ((__v16si) __X, // (__v16si) __Y, 5, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpge_epi32_mask (__mmask16 __M, __m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_cmpd512_mask ((__v16si) __X, // (__v16si) __Y, 5, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpge_epu32_mask (__mmask16 __M, __m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __X, // (__v16si) __Y, 5, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpge_epu32_mask (__m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __X, // (__v16si) __Y, 5, // (__mmask16) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpge_epi64_mask (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_cmpq512_mask ((__v8di) __X, // (__v8di) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpge_epi64_mask (__m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_cmpq512_mask ((__v8di) __X, // (__v8di) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpge_epu64_mask (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __X, // (__v8di) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpge_epu64_mask (__m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __X, // (__v8di) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmple_epi32_mask (__mmask16 __M, __m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_cmpd512_mask ((__v16si) __X, // (__v16si) __Y, 2, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmple_epi32_mask (__m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_cmpd512_mask ((__v16si) __X, // (__v16si) __Y, 2, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmple_epu32_mask (__mmask16 __M, __m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __X, // (__v16si) __Y, 2, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmple_epu32_mask (__m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __X, // (__v16si) __Y, 2, // (__mmask16) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmple_epi64_mask (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_cmpq512_mask ((__v8di) __X, // (__v8di) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmple_epi64_mask (__m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_cmpq512_mask ((__v8di) __X, // (__v8di) __Y, 2, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmple_epu64_mask (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __X, // (__v8di) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmple_epu64_mask (__m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __X, // (__v8di) __Y, 2, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmplt_epi32_mask (__mmask16 __M, __m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_cmpd512_mask ((__v16si) __X, // (__v16si) __Y, 1, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmplt_epi32_mask (__m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_cmpd512_mask ((__v16si) __X, // (__v16si) __Y, 1, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmplt_epu32_mask (__mmask16 __M, __m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __X, // (__v16si) __Y, 1, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmplt_epu32_mask (__m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __X, // (__v16si) __Y, 1, // (__mmask16) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmplt_epi64_mask (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_cmpq512_mask ((__v8di) __X, // (__v8di) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmplt_epi64_mask (__m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_cmpq512_mask ((__v8di) __X, // (__v8di) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmplt_epu64_mask (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __X, // (__v8di) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmplt_epu64_mask (__m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __X, // (__v8di) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpneq_epi32_mask (__m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_cmpd512_mask ((__v16si) __X, // (__v16si) __Y, 4, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpneq_epi32_mask (__mmask16 __M, __m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_cmpd512_mask ((__v16si) __X, // (__v16si) __Y, 4, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpneq_epu32_mask (__mmask16 __M, __m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __X, // (__v16si) __Y, 4, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpneq_epu32_mask (__m512i __X, __m512i __Y) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __X, // (__v16si) __Y, 4, // (__mmask16) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpneq_epi64_mask (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_cmpq512_mask ((__v8di) __X, // (__v8di) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpneq_epi64_mask (__m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_cmpq512_mask ((__v8di) __X, // (__v8di) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpneq_epu64_mask (__mmask8 __M, __m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __X, // (__v8di) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpneq_epu64_mask (__m512i __X, __m512i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __X, // (__v8di) __Y, 4, // (__mmask8) -1); // } // #define _MM_CMPINT_EQ 0x0 // #define _MM_CMPINT_LT 0x1 // #define _MM_CMPINT_LE 0x2 // #define _MM_CMPINT_UNUSED 0x3 // #define _MM_CMPINT_NE 0x4 // #define _MM_CMPINT_NLT 0x5 // #define _MM_CMPINT_GE 0x5 // #define _MM_CMPINT_NLE 0x6 // #define _MM_CMPINT_GT 0x6 // #ifdef __OPTIMIZE__ // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kshiftli_mask16 (__mmask16 __A, unsigned int __B) // { // return (__mmask16) __builtin_ia32_kshiftlihi ((__mmask16) __A, // (__mmask8) __B); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kshiftri_mask16 (__mmask16 __A, unsigned int __B) // { // return (__mmask16) __builtin_ia32_kshiftrihi ((__mmask16) __A, // (__mmask8) __B); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_epi64_mask (__m512i __X, __m512i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpq512_mask ((__v8di) __X, // (__v8di) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_epi32_mask (__m512i __X, __m512i __Y, const int __P) // { // return (__mmask16) __builtin_ia32_cmpd512_mask ((__v16si) __X, // (__v16si) __Y, __P, // (__mmask16) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_epu64_mask (__m512i __X, __m512i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __X, // (__v8di) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_epu32_mask (__m512i __X, __m512i __Y, const int __P) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __X, // (__v16si) __Y, __P, // (__mmask16) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_round_pd_mask (__m512d __X, __m512d __Y, const int __P, // const int __R) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, __P, // (__mmask8) -1, __R); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_round_ps_mask (__m512 __X, __m512 __Y, const int __P, const int __R) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, __P, // (__mmask16) -1, __R); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_epi64_mask (__mmask8 __U, __m512i __X, __m512i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_cmpq512_mask ((__v8di) __X, // (__v8di) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_epi32_mask (__mmask16 __U, __m512i __X, __m512i __Y, // const int __P) // { // return (__mmask16) __builtin_ia32_cmpd512_mask ((__v16si) __X, // (__v16si) __Y, __P, // (__mmask16) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_epu64_mask (__mmask8 __U, __m512i __X, __m512i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __X, // (__v8di) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_epu32_mask (__mmask16 __U, __m512i __X, __m512i __Y, // const int __P) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __X, // (__v16si) __Y, __P, // (__mmask16) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_round_pd_mask (__mmask8 __U, __m512d __X, __m512d __Y, // const int __P, const int __R) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, __P, // (__mmask8) __U, __R); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_round_ps_mask (__mmask16 __U, __m512 __X, __m512 __Y, // const int __P, const int __R) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, __P, // (__mmask16) __U, __R); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_round_sd_mask (__m128d __X, __m128d __Y, const int __P, const int __R) // { // return (__mmask8) __builtin_ia32_cmpsd_mask ((__v2df) __X, // (__v2df) __Y, __P, // (__mmask8) -1, __R); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_round_sd_mask (__mmask8 __M, __m128d __X, __m128d __Y, // const int __P, const int __R) // { // return (__mmask8) __builtin_ia32_cmpsd_mask ((__v2df) __X, // (__v2df) __Y, __P, // (__mmask8) __M, __R); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_round_ss_mask (__m128 __X, __m128 __Y, const int __P, const int __R) // { // return (__mmask8) __builtin_ia32_cmpss_mask ((__v4sf) __X, // (__v4sf) __Y, __P, // (__mmask8) -1, __R); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_round_ss_mask (__mmask8 __M, __m128 __X, __m128 __Y, // const int __P, const int __R) // { // return (__mmask8) __builtin_ia32_cmpss_mask ((__v4sf) __X, // (__v4sf) __Y, __P, // (__mmask8) __M, __R); // } // #else // #define _kshiftli_mask16(X, Y) \ // ((__mmask16) __builtin_ia32_kshiftlihi ((__mmask16)(X), (__mmask8)(Y))) // #define _kshiftri_mask16(X, Y) \ // ((__mmask16) __builtin_ia32_kshiftrihi ((__mmask16)(X), (__mmask8)(Y))) // #define _mm512_cmp_epi64_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpq512_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm512_cmp_epi32_mask(X, Y, P) \ // ((__mmask16) __builtin_ia32_cmpd512_mask ((__v16si)(__m512i)(X), \ // (__v16si)(__m512i)(Y), (int)(P), \ // (__mmask16)-1)) // #define _mm512_cmp_epu64_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm512_cmp_epu32_mask(X, Y, P) \ // ((__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si)(__m512i)(X), \ // (__v16si)(__m512i)(Y), (int)(P), \ // (__mmask16)-1)) // #define _mm512_cmp_round_pd_mask(X, Y, P, R) \ // ((__mmask8) __builtin_ia32_cmppd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (int)(P),\ // (__mmask8)-1, R)) // #define _mm512_cmp_round_ps_mask(X, Y, P, R) \ // ((__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (int)(P),\ // (__mmask16)-1, R)) // #define _mm512_mask_cmp_epi64_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpq512_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm512_mask_cmp_epi32_mask(M, X, Y, P) \ // ((__mmask16) __builtin_ia32_cmpd512_mask ((__v16si)(__m512i)(X), \ // (__v16si)(__m512i)(Y), (int)(P), \ // (__mmask16)(M))) // #define _mm512_mask_cmp_epu64_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di)(__m512i)(X), \ // (__v8di)(__m512i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm512_mask_cmp_epu32_mask(M, X, Y, P) \ // ((__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si)(__m512i)(X), \ // (__v16si)(__m512i)(Y), (int)(P), \ // (__mmask16)(M))) // #define _mm512_mask_cmp_round_pd_mask(M, X, Y, P, R) \ // ((__mmask8) __builtin_ia32_cmppd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (int)(P),\ // (__mmask8)(M), R)) // #define _mm512_mask_cmp_round_ps_mask(M, X, Y, P, R) \ // ((__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (int)(P),\ // (__mmask16)(M), R)) // #define _mm_cmp_round_sd_mask(X, Y, P, R) \ // ((__mmask8) __builtin_ia32_cmpsd_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (int)(P),\ // (__mmask8)-1, R)) // #define _mm_mask_cmp_round_sd_mask(M, X, Y, P, R) \ // ((__mmask8) __builtin_ia32_cmpsd_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (int)(P),\ // (M), R)) // #define _mm_cmp_round_ss_mask(X, Y, P, R) \ // ((__mmask8) __builtin_ia32_cmpss_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (int)(P), \ // (__mmask8)-1, R)) // #define _mm_mask_cmp_round_ss_mask(M, X, Y, P, R) \ // ((__mmask8) __builtin_ia32_cmpss_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (int)(P), \ // (M), R)) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i32gather_ps (__m512i __index, void const *__addr, int __scale) // { // __m512 __v1_old = _mm512_undefined_ps (); // __mmask16 __mask = 0xFFFF; // return (__m512) __builtin_ia32_gathersiv16sf ((__v16sf) __v1_old, // __addr, // (__v16si) __index, // __mask, __scale); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i32gather_ps (__m512 __v1_old, __mmask16 __mask, // __m512i __index, void const *__addr, int __scale) // { // return (__m512) __builtin_ia32_gathersiv16sf ((__v16sf) __v1_old, // __addr, // (__v16si) __index, // __mask, __scale); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i32gather_pd (__m256i __index, void const *__addr, int __scale) // { // __m512d __v1_old = _mm512_undefined_pd (); // __mmask8 __mask = 0xFF; // return (__m512d) __builtin_ia32_gathersiv8df ((__v8df) __v1_old, // __addr, // (__v8si) __index, __mask, // __scale); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i32gather_pd (__m512d __v1_old, __mmask8 __mask, // __m256i __index, void const *__addr, int __scale) // { // return (__m512d) __builtin_ia32_gathersiv8df ((__v8df) __v1_old, // __addr, // (__v8si) __index, // __mask, __scale); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i64gather_ps (__m512i __index, void const *__addr, int __scale) // { // __m256 __v1_old = _mm256_undefined_ps (); // __mmask8 __mask = 0xFF; // return (__m256) __builtin_ia32_gatherdiv16sf ((__v8sf) __v1_old, // __addr, // (__v8di) __index, __mask, // __scale); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i64gather_ps (__m256 __v1_old, __mmask8 __mask, // __m512i __index, void const *__addr, int __scale) // { // return (__m256) __builtin_ia32_gatherdiv16sf ((__v8sf) __v1_old, // __addr, // (__v8di) __index, // __mask, __scale); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i64gather_pd (__m512i __index, void const *__addr, int __scale) // { // __m512d __v1_old = _mm512_undefined_pd (); // __mmask8 __mask = 0xFF; // return (__m512d) __builtin_ia32_gatherdiv8df ((__v8df) __v1_old, // __addr, // (__v8di) __index, __mask, // __scale); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i64gather_pd (__m512d __v1_old, __mmask8 __mask, // __m512i __index, void const *__addr, int __scale) // { // return (__m512d) __builtin_ia32_gatherdiv8df ((__v8df) __v1_old, // __addr, // (__v8di) __index, // __mask, __scale); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i32gather_epi32 (__m512i __index, void const *__addr, int __scale) // { // __m512i __v1_old = _mm512_undefined_epi32 (); // __mmask16 __mask = 0xFFFF; // return (__m512i) __builtin_ia32_gathersiv16si ((__v16si) __v1_old, // __addr, // (__v16si) __index, // __mask, __scale); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i32gather_epi32 (__m512i __v1_old, __mmask16 __mask, // __m512i __index, void const *__addr, int __scale) // { // return (__m512i) __builtin_ia32_gathersiv16si ((__v16si) __v1_old, // __addr, // (__v16si) __index, // __mask, __scale); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i32gather_epi64 (__m256i __index, void const *__addr, int __scale) // { // __m512i __v1_old = _mm512_undefined_epi32 (); // __mmask8 __mask = 0xFF; // return (__m512i) __builtin_ia32_gathersiv8di ((__v8di) __v1_old, // __addr, // (__v8si) __index, __mask, // __scale); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i32gather_epi64 (__m512i __v1_old, __mmask8 __mask, // __m256i __index, void const *__addr, // int __scale) // { // return (__m512i) __builtin_ia32_gathersiv8di ((__v8di) __v1_old, // __addr, // (__v8si) __index, // __mask, __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i64gather_epi32 (__m512i __index, void const *__addr, int __scale) // { // __m256i __v1_old = _mm256_undefined_si256 (); // __mmask8 __mask = 0xFF; // return (__m256i) __builtin_ia32_gatherdiv16si ((__v8si) __v1_old, // __addr, // (__v8di) __index, // __mask, __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i64gather_epi32 (__m256i __v1_old, __mmask8 __mask, // __m512i __index, void const *__addr, int __scale) // { // return (__m256i) __builtin_ia32_gatherdiv16si ((__v8si) __v1_old, // __addr, // (__v8di) __index, // __mask, __scale); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i64gather_epi64 (__m512i __index, void const *__addr, int __scale) // { // __m512i __v1_old = _mm512_undefined_epi32 (); // __mmask8 __mask = 0xFF; // return (__m512i) __builtin_ia32_gatherdiv8di ((__v8di) __v1_old, // __addr, // (__v8di) __index, __mask, // __scale); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i64gather_epi64 (__m512i __v1_old, __mmask8 __mask, // __m512i __index, void const *__addr, // int __scale) // { // return (__m512i) __builtin_ia32_gatherdiv8di ((__v8di) __v1_old, // __addr, // (__v8di) __index, // __mask, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i32scatter_ps (void *__addr, __m512i __index, __m512 __v1, int __scale) // { // __builtin_ia32_scattersiv16sf (__addr, (__mmask16) 0xFFFF, // (__v16si) __index, (__v16sf) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i32scatter_ps (void *__addr, __mmask16 __mask, // __m512i __index, __m512 __v1, int __scale) // { // __builtin_ia32_scattersiv16sf (__addr, __mask, (__v16si) __index, // (__v16sf) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i32scatter_pd (void *__addr, __m256i __index, __m512d __v1, // int __scale) // { // __builtin_ia32_scattersiv8df (__addr, (__mmask8) 0xFF, // (__v8si) __index, (__v8df) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i32scatter_pd (void *__addr, __mmask8 __mask, // __m256i __index, __m512d __v1, int __scale) // { // __builtin_ia32_scattersiv8df (__addr, __mask, (__v8si) __index, // (__v8df) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i64scatter_ps (void *__addr, __m512i __index, __m256 __v1, int __scale) // { // __builtin_ia32_scatterdiv16sf (__addr, (__mmask8) 0xFF, // (__v8di) __index, (__v8sf) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i64scatter_ps (void *__addr, __mmask8 __mask, // __m512i __index, __m256 __v1, int __scale) // { // __builtin_ia32_scatterdiv16sf (__addr, __mask, (__v8di) __index, // (__v8sf) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i64scatter_pd (void *__addr, __m512i __index, __m512d __v1, // int __scale) // { // __builtin_ia32_scatterdiv8df (__addr, (__mmask8) 0xFF, // (__v8di) __index, (__v8df) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i64scatter_pd (void *__addr, __mmask8 __mask, // __m512i __index, __m512d __v1, int __scale) // { // __builtin_ia32_scatterdiv8df (__addr, __mask, (__v8di) __index, // (__v8df) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i32scatter_epi32 (void *__addr, __m512i __index, // __m512i __v1, int __scale) // { // __builtin_ia32_scattersiv16si (__addr, (__mmask16) 0xFFFF, // (__v16si) __index, (__v16si) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i32scatter_epi32 (void *__addr, __mmask16 __mask, // __m512i __index, __m512i __v1, int __scale) // { // __builtin_ia32_scattersiv16si (__addr, __mask, (__v16si) __index, // (__v16si) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i32scatter_epi64 (void *__addr, __m256i __index, // __m512i __v1, int __scale) // { // __builtin_ia32_scattersiv8di (__addr, (__mmask8) 0xFF, // (__v8si) __index, (__v8di) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i32scatter_epi64 (void *__addr, __mmask8 __mask, // __m256i __index, __m512i __v1, int __scale) // { // __builtin_ia32_scattersiv8di (__addr, __mask, (__v8si) __index, // (__v8di) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i64scatter_epi32 (void *__addr, __m512i __index, // __m256i __v1, int __scale) // { // __builtin_ia32_scatterdiv16si (__addr, (__mmask8) 0xFF, // (__v8di) __index, (__v8si) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i64scatter_epi32 (void *__addr, __mmask8 __mask, // __m512i __index, __m256i __v1, int __scale) // { // __builtin_ia32_scatterdiv16si (__addr, __mask, (__v8di) __index, // (__v8si) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_i64scatter_epi64 (void *__addr, __m512i __index, // __m512i __v1, int __scale) // { // __builtin_ia32_scatterdiv8di (__addr, (__mmask8) 0xFF, // (__v8di) __index, (__v8di) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_i64scatter_epi64 (void *__addr, __mmask8 __mask, // __m512i __index, __m512i __v1, int __scale) // { // __builtin_ia32_scatterdiv8di (__addr, __mask, (__v8di) __index, // (__v8di) __v1, __scale); // } // #else // #define _mm512_i32gather_ps(INDEX, ADDR, SCALE) \ // (__m512) __builtin_ia32_gathersiv16sf ((__v16sf)_mm512_undefined_ps(),\ // (void const *) (ADDR), \ // (__v16si)(__m512i) (INDEX), \ // (__mmask16)0xFFFF, \ // (int) (SCALE)) // #define _mm512_mask_i32gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m512) __builtin_ia32_gathersiv16sf ((__v16sf)(__m512) (V1OLD), \ // (void const *) (ADDR), \ // (__v16si)(__m512i) (INDEX), \ // (__mmask16) (MASK), \ // (int) (SCALE)) // #define _mm512_i32gather_pd(INDEX, ADDR, SCALE) \ // (__m512d) __builtin_ia32_gathersiv8df ((__v8df)_mm512_undefined_pd(), \ // (void const *) (ADDR), \ // (__v8si)(__m256i) (INDEX), \ // (__mmask8)0xFF, (int) (SCALE)) // #define _mm512_mask_i32gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m512d) __builtin_ia32_gathersiv8df ((__v8df)(__m512d) (V1OLD), \ // (void const *) (ADDR), \ // (__v8si)(__m256i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm512_i64gather_ps(INDEX, ADDR, SCALE) \ // (__m256) __builtin_ia32_gatherdiv16sf ((__v8sf)_mm256_undefined_ps(), \ // (void const *) (ADDR), \ // (__v8di)(__m512i) (INDEX), \ // (__mmask8)0xFF, (int) (SCALE)) // #define _mm512_mask_i64gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m256) __builtin_ia32_gatherdiv16sf ((__v8sf)(__m256) (V1OLD), \ // (void const *) (ADDR), \ // (__v8di)(__m512i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm512_i64gather_pd(INDEX, ADDR, SCALE) \ // (__m512d) __builtin_ia32_gatherdiv8df ((__v8df)_mm512_undefined_pd(), \ // (void const *) (ADDR), \ // (__v8di)(__m512i) (INDEX), \ // (__mmask8)0xFF, (int) (SCALE)) // #define _mm512_mask_i64gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m512d) __builtin_ia32_gatherdiv8df ((__v8df)(__m512d) (V1OLD), \ // (void const *) (ADDR), \ // (__v8di)(__m512i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm512_i32gather_epi32(INDEX, ADDR, SCALE) \ // (__m512i) __builtin_ia32_gathersiv16si ((__v16si)_mm512_undefined_epi32 (),\ // (void const *) (ADDR), \ // (__v16si)(__m512i) (INDEX), \ // (__mmask16)0xFFFF, \ // (int) (SCALE)) // #define _mm512_mask_i32gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m512i) __builtin_ia32_gathersiv16si ((__v16si)(__m512i) (V1OLD), \ // (void const *) (ADDR), \ // (__v16si)(__m512i) (INDEX), \ // (__mmask16) (MASK), \ // (int) (SCALE)) // #define _mm512_i32gather_epi64(INDEX, ADDR, SCALE) \ // (__m512i) __builtin_ia32_gathersiv8di ((__v8di)_mm512_undefined_epi32 (),\ // (void const *) (ADDR), \ // (__v8si)(__m256i) (INDEX), \ // (__mmask8)0xFF, (int) (SCALE)) // #define _mm512_mask_i32gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m512i) __builtin_ia32_gathersiv8di ((__v8di)(__m512i) (V1OLD), \ // (void const *) (ADDR), \ // (__v8si)(__m256i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm512_i64gather_epi32(INDEX, ADDR, SCALE) \ // (__m256i) __builtin_ia32_gatherdiv16si ((__v8si)_mm256_undefined_si256(),\ // (void const *) (ADDR), \ // (__v8di)(__m512i) (INDEX), \ // (__mmask8)0xFF, (int) (SCALE)) // #define _mm512_mask_i64gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m256i) __builtin_ia32_gatherdiv16si ((__v8si)(__m256i) (V1OLD), \ // (void const *) (ADDR), \ // (__v8di)(__m512i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm512_i64gather_epi64(INDEX, ADDR, SCALE) \ // (__m512i) __builtin_ia32_gatherdiv8di ((__v8di)_mm512_undefined_epi32 (),\ // (void const *) (ADDR), \ // (__v8di)(__m512i) (INDEX), \ // (__mmask8)0xFF, (int) (SCALE)) // #define _mm512_mask_i64gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m512i) __builtin_ia32_gatherdiv8di ((__v8di)(__m512i) (V1OLD), \ // (void const *) (ADDR), \ // (__v8di)(__m512i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm512_i32scatter_ps(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv16sf ((void *) (ADDR), (__mmask16)0xFFFF, \ // (__v16si)(__m512i) (INDEX), \ // (__v16sf)(__m512) (V1), (int) (SCALE)) // #define _mm512_mask_i32scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv16sf ((void *) (ADDR), (__mmask16) (MASK), \ // (__v16si)(__m512i) (INDEX), \ // (__v16sf)(__m512) (V1), (int) (SCALE)) // #define _mm512_i32scatter_pd(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv8df ((void *) (ADDR), (__mmask8)0xFF, \ // (__v8si)(__m256i) (INDEX), \ // (__v8df)(__m512d) (V1), (int) (SCALE)) // #define _mm512_mask_i32scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv8df ((void *) (ADDR), (__mmask8) (MASK), \ // (__v8si)(__m256i) (INDEX), \ // (__v8df)(__m512d) (V1), (int) (SCALE)) // #define _mm512_i64scatter_ps(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv16sf ((void *) (ADDR), (__mmask8)0xFF, \ // (__v8di)(__m512i) (INDEX), \ // (__v8sf)(__m256) (V1), (int) (SCALE)) // #define _mm512_mask_i64scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv16sf ((void *) (ADDR), (__mmask16) (MASK), \ // (__v8di)(__m512i) (INDEX), \ // (__v8sf)(__m256) (V1), (int) (SCALE)) // #define _mm512_i64scatter_pd(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv8df ((void *) (ADDR), (__mmask8)0xFF, \ // (__v8di)(__m512i) (INDEX), \ // (__v8df)(__m512d) (V1), (int) (SCALE)) // #define _mm512_mask_i64scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv8df ((void *) (ADDR), (__mmask8) (MASK), \ // (__v8di)(__m512i) (INDEX), \ // (__v8df)(__m512d) (V1), (int) (SCALE)) // #define _mm512_i32scatter_epi32(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv16si ((void *) (ADDR), (__mmask16)0xFFFF, \ // (__v16si)(__m512i) (INDEX), \ // (__v16si)(__m512i) (V1), (int) (SCALE)) // #define _mm512_mask_i32scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv16si ((void *) (ADDR), (__mmask16) (MASK), \ // (__v16si)(__m512i) (INDEX), \ // (__v16si)(__m512i) (V1), (int) (SCALE)) // #define _mm512_i32scatter_epi64(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv8di ((void *) (ADDR), (__mmask8)0xFF, \ // (__v8si)(__m256i) (INDEX), \ // (__v8di)(__m512i) (V1), (int) (SCALE)) // #define _mm512_mask_i32scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv8di ((void *) (ADDR), (__mmask8) (MASK), \ // (__v8si)(__m256i) (INDEX), \ // (__v8di)(__m512i) (V1), (int) (SCALE)) // #define _mm512_i64scatter_epi32(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv16si ((void *) (ADDR), (__mmask8)0xFF, \ // (__v8di)(__m512i) (INDEX), \ // (__v8si)(__m256i) (V1), (int) (SCALE)) // #define _mm512_mask_i64scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv16si ((void *) (ADDR), (__mmask8) (MASK), \ // (__v8di)(__m512i) (INDEX), \ // (__v8si)(__m256i) (V1), (int) (SCALE)) // #define _mm512_i64scatter_epi64(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv8di ((void *) (ADDR), (__mmask8)0xFF, \ // (__v8di)(__m512i) (INDEX), \ // (__v8di)(__m512i) (V1), (int) (SCALE)) // #define _mm512_mask_i64scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv8di ((void *) (ADDR), (__mmask8) (MASK), \ // (__v8di)(__m512i) (INDEX), \ // (__v8di)(__m512i) (V1), (int) (SCALE)) // #endif // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compress_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_compressdf512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_compress_pd (__mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_compressdf512_mask ((__v8df) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compressstoreu_pd (void *__P, __mmask8 __U, __m512d __A) // { // __builtin_ia32_compressstoredf512_mask ((__v8df *) __P, (__v8df) __A, // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compress_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_compresssf512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_compress_ps (__mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_compresssf512_mask ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compressstoreu_ps (void *__P, __mmask16 __U, __m512 __A) // { // __builtin_ia32_compressstoresf512_mask ((__v16sf *) __P, (__v16sf) __A, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compress_epi64 (__m512i __W, __mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_compressdi512_mask ((__v8di) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_compress_epi64 (__mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_compressdi512_mask ((__v8di) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compressstoreu_epi64 (void *__P, __mmask8 __U, __m512i __A) // { // __builtin_ia32_compressstoredi512_mask ((__v8di *) __P, (__v8di) __A, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compress_epi32 (__m512i __W, __mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_compresssi512_mask ((__v16si) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_compress_epi32 (__mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_compresssi512_mask ((__v16si) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compressstoreu_epi32 (void *__P, __mmask16 __U, __m512i __A) // { // __builtin_ia32_compressstoresi512_mask ((__v16si *) __P, (__v16si) __A, // (__mmask16) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expand_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_expanddf512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expand_pd (__mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_expanddf512_maskz ((__v8df) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expandloadu_pd (__m512d __W, __mmask8 __U, void const *__P) // { // return (__m512d) __builtin_ia32_expandloaddf512_mask ((const __v8df *) __P, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expandloadu_pd (__mmask8 __U, void const *__P) // { // return (__m512d) __builtin_ia32_expandloaddf512_maskz ((const __v8df *) __P, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expand_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_expandsf512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expand_ps (__mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_expandsf512_maskz ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expandloadu_ps (__m512 __W, __mmask16 __U, void const *__P) // { // return (__m512) __builtin_ia32_expandloadsf512_mask ((const __v16sf *) __P, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expandloadu_ps (__mmask16 __U, void const *__P) // { // return (__m512) __builtin_ia32_expandloadsf512_maskz ((const __v16sf *) __P, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expand_epi64 (__m512i __W, __mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_expanddi512_mask ((__v8di) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expand_epi64 (__mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_expanddi512_maskz ((__v8di) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expandloadu_epi64 (__m512i __W, __mmask8 __U, void const *__P) // { // return (__m512i) __builtin_ia32_expandloaddi512_mask ((const __v8di *) __P, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expandloadu_epi64 (__mmask8 __U, void const *__P) // { // return (__m512i) // __builtin_ia32_expandloaddi512_maskz ((const __v8di *) __P, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expand_epi32 (__m512i __W, __mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_expandsi512_mask ((__v16si) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expand_epi32 (__mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_expandsi512_maskz ((__v16si) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expandloadu_epi32 (__m512i __W, __mmask16 __U, void const *__P) // { // return (__m512i) __builtin_ia32_expandloadsi512_mask ((const __v16si *) __P, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expandloadu_epi32 (__mmask16 __U, void const *__P) // { // return (__m512i) __builtin_ia32_expandloadsi512_maskz ((const __v16si *) __P, // (__v16si) // _mm512_setzero_si512 // (), (__mmask16) __U); // } // /* Mask arithmetic operations */ // #define _kand_mask16 _mm512_kand // #define _kandn_mask16 _mm512_kandn // #define _knot_mask16 _mm512_knot // #define _kor_mask16 _mm512_kor // #define _kxnor_mask16 _mm512_kxnor // #define _kxor_mask16 _mm512_kxor // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortest_mask16_u8 (__mmask16 __A, __mmask16 __B, unsigned char *__CF) // { // *__CF = (unsigned char) __builtin_ia32_kortestchi (__A, __B); // return (unsigned char) __builtin_ia32_kortestzhi (__A, __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortestz_mask16_u8 (__mmask16 __A, __mmask16 __B) // { // return (unsigned char) __builtin_ia32_kortestzhi ((__mmask16) __A, // (__mmask16) __B); // } // extern __inline unsigned char // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kortestc_mask16_u8 (__mmask16 __A, __mmask16 __B) // { // return (unsigned char) __builtin_ia32_kortestchi ((__mmask16) __A, // (__mmask16) __B); // } // extern __inline unsigned int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _cvtmask16_u32 (__mmask16 __A) // { // return (unsigned int) __builtin_ia32_kmovw ((__mmask16 ) __A); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _cvtu32_mask16 (unsigned int __A) // { // return (__mmask16) __builtin_ia32_kmovw ((__mmask16 ) __A); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _load_mask16 (__mmask16 *__A) // { // return (__mmask16) __builtin_ia32_kmovw (*(__mmask16 *) __A); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _store_mask16 (__mmask16 *__A, __mmask16 __B) // { // *(__mmask16 *) __A = __builtin_ia32_kmovw (__B); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kand (__mmask16 __A, __mmask16 __B) // { // return (__mmask16) __builtin_ia32_kandhi ((__mmask16) __A, (__mmask16) __B); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kandn (__mmask16 __A, __mmask16 __B) // { // return (__mmask16) __builtin_ia32_kandnhi ((__mmask16) __A, // (__mmask16) __B); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kor (__mmask16 __A, __mmask16 __B) // { // return (__mmask16) __builtin_ia32_korhi ((__mmask16) __A, (__mmask16) __B); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kortestz (__mmask16 __A, __mmask16 __B) // { // return (__mmask16) __builtin_ia32_kortestzhi ((__mmask16) __A, // (__mmask16) __B); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kortestc (__mmask16 __A, __mmask16 __B) // { // return (__mmask16) __builtin_ia32_kortestchi ((__mmask16) __A, // (__mmask16) __B); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kxnor (__mmask16 __A, __mmask16 __B) // { // return (__mmask16) __builtin_ia32_kxnorhi ((__mmask16) __A, (__mmask16) __B); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kxor (__mmask16 __A, __mmask16 __B) // { // return (__mmask16) __builtin_ia32_kxorhi ((__mmask16) __A, (__mmask16) __B); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_knot (__mmask16 __A) // { // return (__mmask16) __builtin_ia32_knothi ((__mmask16) __A); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kunpackb (__mmask16 __A, __mmask16 __B) // { // return (__mmask16) __builtin_ia32_kunpckhi ((__mmask16) __A, (__mmask16) __B); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _kunpackb_mask16 (__mmask8 __A, __mmask8 __B) // { // return (__mmask16) __builtin_ia32_kunpckhi ((__mmask16) __A, (__mmask16) __B); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_inserti32x4 (__mmask16 __B, __m512i __C, __m128i __D, // const int __imm) // { // return (__m512i) __builtin_ia32_inserti32x4_mask ((__v16si) __C, // (__v4si) __D, // __imm, // (__v16si) // _mm512_setzero_si512 (), // __B); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_insertf32x4 (__mmask16 __B, __m512 __C, __m128 __D, // const int __imm) // { // return (__m512) __builtin_ia32_insertf32x4_mask ((__v16sf) __C, // (__v4sf) __D, // __imm, // (__v16sf) // _mm512_setzero_ps (), __B); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_inserti32x4 (__m512i __A, __mmask16 __B, __m512i __C, // __m128i __D, const int __imm) // { // return (__m512i) __builtin_ia32_inserti32x4_mask ((__v16si) __C, // (__v4si) __D, // __imm, // (__v16si) __A, // __B); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_insertf32x4 (__m512 __A, __mmask16 __B, __m512 __C, // __m128 __D, const int __imm) // { // return (__m512) __builtin_ia32_insertf32x4_mask ((__v16sf) __C, // (__v4sf) __D, // __imm, // (__v16sf) __A, __B); // } // #else // #define _mm512_maskz_insertf32x4(A, X, Y, C) \ // ((__m512) __builtin_ia32_insertf32x4_mask ((__v16sf)(__m512) (X), \ // (__v4sf)(__m128) (Y), (int) (C), (__v16sf)_mm512_setzero_ps(), \ // (__mmask16)(A))) // #define _mm512_maskz_inserti32x4(A, X, Y, C) \ // ((__m512i) __builtin_ia32_inserti32x4_mask ((__v16si)(__m512i) (X), \ // (__v4si)(__m128i) (Y), (int) (C), (__v16si)_mm512_setzero_si512 (), \ // (__mmask16)(A))) // #define _mm512_mask_insertf32x4(A, B, X, Y, C) \ // ((__m512) __builtin_ia32_insertf32x4_mask ((__v16sf)(__m512) (X), \ // (__v4sf)(__m128) (Y), (int) (C), (__v16sf)(__m512) (A), \ // (__mmask16)(B))) // #define _mm512_mask_inserti32x4(A, B, X, Y, C) \ // ((__m512i) __builtin_ia32_inserti32x4_mask ((__v16si)(__m512i) (X), \ // (__v4si)(__m128i) (Y), (int) (C), (__v16si)(__m512i) (A), \ // (__mmask16)(B))) // #endif // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_epi64 (__mmask8 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_epi64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_epi64 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminsq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_epi64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminsq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_epi64 (__mmask8 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminsq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_epu64 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxuq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_epu64 (__mmask8 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxuq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_epu64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxuq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_epu64 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminuq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_undefined_epi32 (), // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_epu64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminuq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) __W, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_epu64 (__mmask8 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminuq512_mask ((__v8di) __A, // (__v8di) __B, // (__v8di) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_epi32 (__mmask16 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_epi32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxsd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_epi32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminsd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_epi32 (__mmask16 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminsd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_epi32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminsd512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_epu32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxud512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_epu32 (__mmask16 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxud512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_epu32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pmaxud512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_epu32 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminud512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_epu32 (__mmask16 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminud512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) // _mm512_setzero_si512 (), // __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_epu32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_pminud512_mask ((__v16si) __A, // (__v16si) __B, // (__v16si) __W, __M); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_unpacklo_ps (__m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_unpcklps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_unpacklo_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_unpcklps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_unpacklo_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_unpcklps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_max_round_sd (__m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_maxsd_round ((__v2df) __A, // (__v2df) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_round_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_maxsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_round_sd (__mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_maxsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_max_round_ss (__m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_maxss_round ((__v4sf) __A, // (__v4sf) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_round_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_maxss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_round_ss (__mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_maxss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_min_round_sd (__m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_minsd_round ((__v2df) __A, // (__v2df) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_round_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_minsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_round_sd (__mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_minsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_min_round_ss (__m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_minss_round ((__v4sf) __A, // (__v4sf) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_round_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_minss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_round_ss (__mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_minss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, __R); // } // #else // #define _mm_max_round_sd(A, B, C) \ // (__m128d)__builtin_ia32_maxsd_round(A, B, C) // #define _mm_mask_max_round_sd(W, U, A, B, C) \ // (__m128d)__builtin_ia32_maxsd_mask_round(A, B, W, U, C) // #define _mm_maskz_max_round_sd(U, A, B, C) \ // (__m128d)__builtin_ia32_maxsd_mask_round(A, B, (__v2df)_mm_setzero_pd(), U, C) // #define _mm_max_round_ss(A, B, C) \ // (__m128)__builtin_ia32_maxss_round(A, B, C) // #define _mm_mask_max_round_ss(W, U, A, B, C) \ // (__m128)__builtin_ia32_maxss_mask_round(A, B, W, U, C) // #define _mm_maskz_max_round_ss(U, A, B, C) \ // (__m128)__builtin_ia32_maxss_mask_round(A, B, (__v4sf)_mm_setzero_ps(), U, C) // #define _mm_min_round_sd(A, B, C) \ // (__m128d)__builtin_ia32_minsd_round(A, B, C) // #define _mm_mask_min_round_sd(W, U, A, B, C) \ // (__m128d)__builtin_ia32_minsd_mask_round(A, B, W, U, C) // #define _mm_maskz_min_round_sd(U, A, B, C) \ // (__m128d)__builtin_ia32_minsd_mask_round(A, B, (__v2df)_mm_setzero_pd(), U, C) // #define _mm_min_round_ss(A, B, C) \ // (__m128)__builtin_ia32_minss_round(A, B, C) // #define _mm_mask_min_round_ss(W, U, A, B, C) \ // (__m128)__builtin_ia32_minss_mask_round(A, B, W, U, C) // #define _mm_maskz_min_round_ss(U, A, B, C) \ // (__m128)__builtin_ia32_minss_mask_round(A, B, (__v4sf)_mm_setzero_ps(), U, C) // #endif // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_blend_pd (__mmask8 __U, __m512d __A, __m512d __W) // { // return (__m512d) __builtin_ia32_blendmpd_512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_blend_ps (__mmask16 __U, __m512 __A, __m512 __W) // { // return (__m512) __builtin_ia32_blendmps_512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_blend_epi64 (__mmask8 __U, __m512i __A, __m512i __W) // { // return (__m512i) __builtin_ia32_blendmq_512_mask ((__v8di) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_blend_epi32 (__mmask16 __U, __m512i __A, __m512i __W) // { // return (__m512i) __builtin_ia32_blendmd_512_mask ((__v16si) __A, // (__v16si) __W, // (__mmask16) __U); // } // #ifdef __OPTIMIZE__ // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmadd_round_sd (__m128d __W, __m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_round ((__v2df) __W, // (__v2df) __A, // (__v2df) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmadd_round_ss (__m128 __W, __m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_round ((__v4sf) __W, // (__v4sf) __A, // (__v4sf) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmsub_round_sd (__m128d __W, __m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_round ((__v2df) __W, // (__v2df) __A, // -(__v2df) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmsub_round_ss (__m128 __W, __m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_round ((__v4sf) __W, // (__v4sf) __A, // -(__v4sf) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmadd_round_sd (__m128d __W, __m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_round ((__v2df) __W, // -(__v2df) __A, // (__v2df) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmadd_round_ss (__m128 __W, __m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_round ((__v4sf) __W, // -(__v4sf) __A, // (__v4sf) __B, // __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmsub_round_sd (__m128d __W, __m128d __A, __m128d __B, const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_round ((__v2df) __W, // -(__v2df) __A, // -(__v2df) __B, // __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmsub_round_ss (__m128 __W, __m128 __A, __m128 __B, const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_round ((__v4sf) __W, // -(__v4sf) __A, // -(__v4sf) __B, // __R); // } // #else // #define _mm_fmadd_round_sd(A, B, C, R) \ // (__m128d)__builtin_ia32_vfmaddsd3_round(A, B, C, R) // #define _mm_fmadd_round_ss(A, B, C, R) \ // (__m128)__builtin_ia32_vfmaddss3_round(A, B, C, R) // #define _mm_fmsub_round_sd(A, B, C, R) \ // (__m128d)__builtin_ia32_vfmaddsd3_round(A, B, -(C), R) // #define _mm_fmsub_round_ss(A, B, C, R) \ // (__m128)__builtin_ia32_vfmaddss3_round(A, B, -(C), R) // #define _mm_fnmadd_round_sd(A, B, C, R) \ // (__m128d)__builtin_ia32_vfmaddsd3_round(A, -(B), C, R) // #define _mm_fnmadd_round_ss(A, B, C, R) \ // (__m128)__builtin_ia32_vfmaddss3_round(A, -(B), C, R) // #define _mm_fnmsub_round_sd(A, B, C, R) \ // (__m128d)__builtin_ia32_vfmaddsd3_round(A, -(B), -(C), R) // #define _mm_fnmsub_round_ss(A, B, C, R) \ // (__m128)__builtin_ia32_vfmaddss3_round(A, -(B), -(C), R) // #endif // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmadd_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask ((__v2df) __W, // (__v2df) __A, // (__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmadd_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmadd_sd (__m128d __W, __m128d __A, __m128d __B, __mmask8 __U) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask3 ((__v2df) __W, // (__v2df) __A, // (__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmadd_ss (__m128 __W, __m128 __A, __m128 __B, __mmask8 __U) // { // return (__m128) __builtin_ia32_vfmaddss3_mask3 ((__v4sf) __W, // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmadd_sd (__mmask8 __U, __m128d __W, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_vfmaddsd3_maskz ((__v2df) __W, // (__v2df) __A, // (__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmadd_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_vfmaddss3_maskz ((__v4sf) __W, // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmsub_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask ((__v2df) __W, // (__v2df) __A, // -(__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmsub_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, // (__v4sf) __A, // -(__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmsub_sd (__m128d __W, __m128d __A, __m128d __B, __mmask8 __U) // { // return (__m128d) __builtin_ia32_vfmsubsd3_mask3 ((__v2df) __W, // (__v2df) __A, // (__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmsub_ss (__m128 __W, __m128 __A, __m128 __B, __mmask8 __U) // { // return (__m128) __builtin_ia32_vfmsubss3_mask3 ((__v4sf) __W, // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmsub_sd (__mmask8 __U, __m128d __W, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_vfmaddsd3_maskz ((__v2df) __W, // (__v2df) __A, // -(__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmsub_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_vfmaddss3_maskz ((__v4sf) __W, // (__v4sf) __A, // -(__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmadd_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask ((__v2df) __W, // -(__v2df) __A, // (__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmadd_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, // -(__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmadd_sd (__m128d __W, __m128d __A, __m128d __B, __mmask8 __U) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask3 ((__v2df) __W, // -(__v2df) __A, // (__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmadd_ss (__m128 __W, __m128 __A, __m128 __B, __mmask8 __U) // { // return (__m128) __builtin_ia32_vfmaddss3_mask3 ((__v4sf) __W, // -(__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmadd_sd (__mmask8 __U, __m128d __W, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_vfmaddsd3_maskz ((__v2df) __W, // -(__v2df) __A, // (__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmadd_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_vfmaddss3_maskz ((__v4sf) __W, // -(__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmsub_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask ((__v2df) __W, // -(__v2df) __A, // -(__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmsub_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, // -(__v4sf) __A, // -(__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmsub_sd (__m128d __W, __m128d __A, __m128d __B, __mmask8 __U) // { // return (__m128d) __builtin_ia32_vfmsubsd3_mask3 ((__v2df) __W, // -(__v2df) __A, // (__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmsub_ss (__m128 __W, __m128 __A, __m128 __B, __mmask8 __U) // { // return (__m128) __builtin_ia32_vfmsubss3_mask3 ((__v4sf) __W, // -(__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmsub_sd (__mmask8 __U, __m128d __W, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_vfmaddsd3_maskz ((__v2df) __W, // -(__v2df) __A, // -(__v2df) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmsub_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_vfmaddss3_maskz ((__v4sf) __W, // -(__v4sf) __A, // -(__v4sf) __B, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // #ifdef __OPTIMIZE__ // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmadd_round_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask ((__v2df) __W, // (__v2df) __A, // (__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmadd_round_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmadd_round_sd (__m128d __W, __m128d __A, __m128d __B, __mmask8 __U, // const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask3 ((__v2df) __W, // (__v2df) __A, // (__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmadd_round_ss (__m128 __W, __m128 __A, __m128 __B, __mmask8 __U, // const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_mask3 ((__v4sf) __W, // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmadd_round_sd (__mmask8 __U, __m128d __W, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_maskz ((__v2df) __W, // (__v2df) __A, // (__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmadd_round_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_maskz ((__v4sf) __W, // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmsub_round_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask ((__v2df) __W, // (__v2df) __A, // -(__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmsub_round_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, // (__v4sf) __A, // -(__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmsub_round_sd (__m128d __W, __m128d __A, __m128d __B, __mmask8 __U, // const int __R) // { // return (__m128d) __builtin_ia32_vfmsubsd3_mask3 ((__v2df) __W, // (__v2df) __A, // (__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmsub_round_ss (__m128 __W, __m128 __A, __m128 __B, __mmask8 __U, // const int __R) // { // return (__m128) __builtin_ia32_vfmsubss3_mask3 ((__v4sf) __W, // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmsub_round_sd (__mmask8 __U, __m128d __W, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_maskz ((__v2df) __W, // (__v2df) __A, // -(__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmsub_round_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_maskz ((__v4sf) __W, // (__v4sf) __A, // -(__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmadd_round_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask ((__v2df) __W, // -(__v2df) __A, // (__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmadd_round_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, // -(__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmadd_round_sd (__m128d __W, __m128d __A, __m128d __B, __mmask8 __U, // const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask3 ((__v2df) __W, // -(__v2df) __A, // (__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmadd_round_ss (__m128 __W, __m128 __A, __m128 __B, __mmask8 __U, // const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_mask3 ((__v4sf) __W, // -(__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmadd_round_sd (__mmask8 __U, __m128d __W, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_maskz ((__v2df) __W, // -(__v2df) __A, // (__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmadd_round_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_maskz ((__v4sf) __W, // -(__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmsub_round_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_mask ((__v2df) __W, // -(__v2df) __A, // -(__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmsub_round_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, // -(__v4sf) __A, // -(__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmsub_round_sd (__m128d __W, __m128d __A, __m128d __B, __mmask8 __U, // const int __R) // { // return (__m128d) __builtin_ia32_vfmsubsd3_mask3 ((__v2df) __W, // -(__v2df) __A, // (__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmsub_round_ss (__m128 __W, __m128 __A, __m128 __B, __mmask8 __U, // const int __R) // { // return (__m128) __builtin_ia32_vfmsubss3_mask3 ((__v4sf) __W, // -(__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U, __R); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmsub_round_sd (__mmask8 __U, __m128d __W, __m128d __A, __m128d __B, // const int __R) // { // return (__m128d) __builtin_ia32_vfmaddsd3_maskz ((__v2df) __W, // -(__v2df) __A, // -(__v2df) __B, // (__mmask8) __U, __R); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmsub_round_ss (__mmask8 __U, __m128 __W, __m128 __A, __m128 __B, // const int __R) // { // return (__m128) __builtin_ia32_vfmaddss3_maskz ((__v4sf) __W, // -(__v4sf) __A, // -(__v4sf) __B, // (__mmask8) __U, __R); // } // #else // #define _mm_mask_fmadd_round_sd(A, U, B, C, R) \ // (__m128d) __builtin_ia32_vfmaddsd3_mask (A, B, C, U, R) // #define _mm_mask_fmadd_round_ss(A, U, B, C, R) \ // (__m128) __builtin_ia32_vfmaddss3_mask (A, B, C, U, R) // #define _mm_mask3_fmadd_round_sd(A, B, C, U, R) \ // (__m128d) __builtin_ia32_vfmaddsd3_mask3 (A, B, C, U, R) // #define _mm_mask3_fmadd_round_ss(A, B, C, U, R) \ // (__m128) __builtin_ia32_vfmaddss3_mask3 (A, B, C, U, R) // #define _mm_maskz_fmadd_round_sd(U, A, B, C, R) \ // (__m128d) __builtin_ia32_vfmaddsd3_maskz (A, B, C, U, R) // #define _mm_maskz_fmadd_round_ss(U, A, B, C, R) \ // (__m128) __builtin_ia32_vfmaddss3_maskz (A, B, C, U, R) // #define _mm_mask_fmsub_round_sd(A, U, B, C, R) \ // (__m128d) __builtin_ia32_vfmaddsd3_mask (A, B, -(C), U, R) // #define _mm_mask_fmsub_round_ss(A, U, B, C, R) \ // (__m128) __builtin_ia32_vfmaddss3_mask (A, B, -(C), U, R) // #define _mm_mask3_fmsub_round_sd(A, B, C, U, R) \ // (__m128d) __builtin_ia32_vfmsubsd3_mask3 (A, B, C, U, R) // #define _mm_mask3_fmsub_round_ss(A, B, C, U, R) \ // (__m128) __builtin_ia32_vfmsubss3_mask3 (A, B, C, U, R) // #define _mm_maskz_fmsub_round_sd(U, A, B, C, R) \ // (__m128d) __builtin_ia32_vfmaddsd3_maskz (A, B, -(C), U, R) // #define _mm_maskz_fmsub_round_ss(U, A, B, C, R) \ // (__m128) __builtin_ia32_vfmaddss3_maskz (A, B, -(C), U, R) // #define _mm_mask_fnmadd_round_sd(A, U, B, C, R) \ // (__m128d) __builtin_ia32_vfmaddsd3_mask (A, -(B), C, U, R) // #define _mm_mask_fnmadd_round_ss(A, U, B, C, R) \ // (__m128) __builtin_ia32_vfmaddss3_mask (A, -(B), C, U, R) // #define _mm_mask3_fnmadd_round_sd(A, B, C, U, R) \ // (__m128d) __builtin_ia32_vfmaddsd3_mask3 (A, -(B), C, U, R) // #define _mm_mask3_fnmadd_round_ss(A, B, C, U, R) \ // (__m128) __builtin_ia32_vfmaddss3_mask3 (A, -(B), C, U, R) // #define _mm_maskz_fnmadd_round_sd(U, A, B, C, R) \ // (__m128d) __builtin_ia32_vfmaddsd3_maskz (A, -(B), C, U, R) // #define _mm_maskz_fnmadd_round_ss(U, A, B, C, R) \ // (__m128) __builtin_ia32_vfmaddss3_maskz (A, -(B), C, U, R) // #define _mm_mask_fnmsub_round_sd(A, U, B, C, R) \ // (__m128d) __builtin_ia32_vfmaddsd3_mask (A, -(B), -(C), U, R) // #define _mm_mask_fnmsub_round_ss(A, U, B, C, R) \ // (__m128) __builtin_ia32_vfmaddss3_mask (A, -(B), -(C), U, R) // #define _mm_mask3_fnmsub_round_sd(A, B, C, U, R) \ // (__m128d) __builtin_ia32_vfmsubsd3_mask3 (A, -(B), C, U, R) // #define _mm_mask3_fnmsub_round_ss(A, B, C, U, R) \ // (__m128) __builtin_ia32_vfmsubss3_mask3 (A, -(B), C, U, R) // #define _mm_maskz_fnmsub_round_sd(U, A, B, C, R) \ // (__m128d) __builtin_ia32_vfmaddsd3_maskz (A, -(B), -(C), U, R) // #define _mm_maskz_fnmsub_round_ss(U, A, B, C, R) \ // (__m128) __builtin_ia32_vfmaddss3_maskz (A, -(B), -(C), U, R) // #endif // #ifdef __OPTIMIZE__ // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comi_round_ss (__m128 __A, __m128 __B, const int __P, const int __R) // { // return __builtin_ia32_vcomiss ((__v4sf) __A, (__v4sf) __B, __P, __R); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comi_round_sd (__m128d __A, __m128d __B, const int __P, const int __R) // { // return __builtin_ia32_vcomisd ((__v2df) __A, (__v2df) __B, __P, __R); // } // #else // #define _mm_comi_round_ss(A, B, C, D)\ // __builtin_ia32_vcomiss(A, B, C, D) // #define _mm_comi_round_sd(A, B, C, D)\ // __builtin_ia32_vcomisd(A, B, C, D) // #endif // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sqrt_pd (__m512d __A) // { // return (__m512d) __builtin_ia32_sqrtpd512_mask ((__v8df) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sqrt_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_sqrtpd512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sqrt_pd (__mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_sqrtpd512_mask ((__v8df) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sqrt_ps (__m512 __A) // { // return (__m512) __builtin_ia32_sqrtps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sqrt_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_sqrtps512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sqrt_ps (__mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_sqrtps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_add_pd (__m512d __A, __m512d __B) // { // return (__m512d) ((__v8df)__A + (__v8df)__B); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_add_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_addpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_add_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_addpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_add_ps (__m512 __A, __m512 __B) // { // return (__m512) ((__v16sf)__A + (__v16sf)__B); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_add_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_addps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_add_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_addps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_add_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_addsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_add_sd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_addsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_add_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_addss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_add_ss (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_addss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sub_pd (__m512d __A, __m512d __B) // { // return (__m512d) ((__v8df)__A - (__v8df)__B); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sub_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_subpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sub_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_subpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_sub_ps (__m512 __A, __m512 __B) // { // return (__m512) ((__v16sf)__A - (__v16sf)__B); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_sub_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_subps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_sub_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_subps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sub_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_subsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sub_sd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_subsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sub_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_subss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sub_ss (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_subss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mul_pd (__m512d __A, __m512d __B) // { // return (__m512d) ((__v8df)__A * (__v8df)__B); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mul_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_mulpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mul_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_mulpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mul_ps (__m512 __A, __m512 __B) // { // return (__m512) ((__v16sf)__A * (__v16sf)__B); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_mul_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_mulps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_mul_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_mulps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mul_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B) // { // return (__m128d) __builtin_ia32_mulsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mul_sd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_mulsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mul_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B) // { // return (__m128) __builtin_ia32_mulss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mul_ss (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_mulss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_div_pd (__m512d __M, __m512d __V) // { // return (__m512d) ((__v8df)__M / (__v8df)__V); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_div_pd (__m512d __W, __mmask8 __U, __m512d __M, __m512d __V) // { // return (__m512d) __builtin_ia32_divpd512_mask ((__v8df) __M, // (__v8df) __V, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_div_pd (__mmask8 __U, __m512d __M, __m512d __V) // { // return (__m512d) __builtin_ia32_divpd512_mask ((__v8df) __M, // (__v8df) __V, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_div_ps (__m512 __A, __m512 __B) // { // return (__m512) ((__v16sf)__A / (__v16sf)__B); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_div_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_divps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_div_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_divps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_div_sd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B) // { // return (__m128d) __builtin_ia32_divsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_div_sd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_divsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_div_ss (__m128 __W, __mmask8 __U, __m128 __A, // __m128 __B) // { // return (__m128) __builtin_ia32_divss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_div_ss (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_divss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_pd (__m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_max_ps (__m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_max_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_max_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_maxsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_sd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_maxsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_maxss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_ss (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_maxss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_pd (__m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_min_ps (__m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_min_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_min_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_minsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_sd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_minsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_minss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_ss (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_minss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_scalef_pd (__m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_scalefpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_scalef_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_scalefpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_scalef_pd (__mmask8 __U, __m512d __A, __m512d __B) // { // return (__m512d) __builtin_ia32_scalefpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_scalef_ps (__m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_scalefps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_scalef_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_scalefps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_scalef_ps (__mmask16 __U, __m512 __A, __m512 __B) // { // return (__m512) __builtin_ia32_scalefps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_scalef_sd (__m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_scalefsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_scalef_ss (__m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_scalefss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmadd_pd (__m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmadd_pd (__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmadd_pd (__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) // { // return (__m512d) __builtin_ia32_vfmaddpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmadd_pd (__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmaddpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmadd_ps (__m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmadd_ps (__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmadd_ps (__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) // { // return (__m512) __builtin_ia32_vfmaddps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmadd_ps (__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmaddps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmsub_pd (__m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmsub_pd (__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmsub_pd (__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) // { // return (__m512d) __builtin_ia32_vfmsubpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmsub_pd (__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmsubpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmsub_ps (__m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmsub_ps (__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmsub_ps (__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) // { // return (__m512) __builtin_ia32_vfmsubps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmsub_ps (__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmsubps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmaddsub_pd (__m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmaddsub_pd (__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmaddsub_pd (__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmaddsub_pd (__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmaddsub_ps (__m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmaddsub_ps (__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmaddsub_ps (__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) // { // return (__m512) __builtin_ia32_vfmaddsubps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmaddsub_ps (__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmaddsubps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmsubadd_pd (__m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, // (__v8df) __B, // -(__v8df) __C, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmsubadd_pd (__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, // (__v8df) __B, // -(__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmsubadd_pd (__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) // { // return (__m512d) __builtin_ia32_vfmsubaddpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmsubadd_pd (__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfmaddsubpd512_maskz ((__v8df) __A, // (__v8df) __B, // -(__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fmsubadd_ps (__m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // -(__v16sf) __C, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fmsubadd_ps (__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // -(__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fmsubadd_ps (__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) // { // return (__m512) __builtin_ia32_vfmsubaddps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fmsubadd_ps (__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfmaddsubps512_maskz ((__v16sf) __A, // (__v16sf) __B, // -(__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fnmadd_pd (__m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfnmaddpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fnmadd_pd (__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfnmaddpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fnmadd_pd (__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) // { // return (__m512d) __builtin_ia32_vfnmaddpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fnmadd_pd (__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfnmaddpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fnmadd_ps (__m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfnmaddps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fnmadd_ps (__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfnmaddps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fnmadd_ps (__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) // { // return (__m512) __builtin_ia32_vfnmaddps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fnmadd_ps (__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfnmaddps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fnmsub_pd (__m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfnmsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fnmsub_pd (__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfnmsubpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fnmsub_pd (__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) // { // return (__m512d) __builtin_ia32_vfnmsubpd512_mask3 ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fnmsub_pd (__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) // { // return (__m512d) __builtin_ia32_vfnmsubpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8df) __C, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fnmsub_ps (__m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfnmsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fnmsub_ps (__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfnmsubps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask3_fnmsub_ps (__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) // { // return (__m512) __builtin_ia32_vfnmsubps512_mask3 ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fnmsub_ps (__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) // { // return (__m512) __builtin_ia32_vfnmsubps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16sf) __C, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvttpd_epi32 (__m512d __A) // { // return (__m256i) __builtin_ia32_cvttpd2dq512_mask ((__v8df) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvttpd_epi32 (__m256i __W, __mmask8 __U, __m512d __A) // { // return (__m256i) __builtin_ia32_cvttpd2dq512_mask ((__v8df) __A, // (__v8si) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvttpd_epi32 (__mmask8 __U, __m512d __A) // { // return (__m256i) __builtin_ia32_cvttpd2dq512_mask ((__v8df) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvttpd_epu32 (__m512d __A) // { // return (__m256i) __builtin_ia32_cvttpd2udq512_mask ((__v8df) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvttpd_epu32 (__m256i __W, __mmask8 __U, __m512d __A) // { // return (__m256i) __builtin_ia32_cvttpd2udq512_mask ((__v8df) __A, // (__v8si) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvttpd_epu32 (__mmask8 __U, __m512d __A) // { // return (__m256i) __builtin_ia32_cvttpd2udq512_mask ((__v8df) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtpd_epi32 (__m512d __A) // { // return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtpd_epi32 (__m256i __W, __mmask8 __U, __m512d __A) // { // return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A, // (__v8si) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtpd_epi32 (__mmask8 __U, __m512d __A) // { // return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtpd_epu32 (__m512d __A) // { // return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A, // (__v8si) // _mm256_undefined_si256 (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtpd_epu32 (__m256i __W, __mmask8 __U, __m512d __A) // { // return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A, // (__v8si) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtpd_epu32 (__mmask8 __U, __m512d __A) // { // return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvttps_epi32 (__m512 __A) // { // return (__m512i) __builtin_ia32_cvttps2dq512_mask ((__v16sf) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvttps_epi32 (__m512i __W, __mmask16 __U, __m512 __A) // { // return (__m512i) __builtin_ia32_cvttps2dq512_mask ((__v16sf) __A, // (__v16si) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvttps_epi32 (__mmask16 __U, __m512 __A) // { // return (__m512i) __builtin_ia32_cvttps2dq512_mask ((__v16sf) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvttps_epu32 (__m512 __A) // { // return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvttps_epu32 (__m512i __W, __mmask16 __U, __m512 __A) // { // return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A, // (__v16si) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvttps_epu32 (__mmask16 __U, __m512 __A) // { // return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtps_epi32 (__m512 __A) // { // return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtps_epi32 (__m512i __W, __mmask16 __U, __m512 __A) // { // return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A, // (__v16si) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtps_epi32 (__mmask16 __U, __m512 __A) // { // return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtps_epu32 (__m512 __A) // { // return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A, // (__v16si) // _mm512_undefined_epi32 (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtps_epu32 (__m512i __W, __mmask16 __U, __m512 __A) // { // return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A, // (__v16si) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtps_epu32 (__mmask16 __U, __m512 __A) // { // return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline double // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtsd_f64 (__m512d __A) // { // return __A[0]; // } // extern __inline float // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtss_f32 (__m512 __A) // { // return __A[0]; // } // #ifdef __x86_64__ // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtu64_ss (__m128 __A, unsigned long long __B) // { // return (__m128) __builtin_ia32_cvtusi2ss64 ((__v4sf) __A, __B, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtu64_sd (__m128d __A, unsigned long long __B) // { // return (__m128d) __builtin_ia32_cvtusi2sd64 ((__v2df) __A, __B, // _MM_FROUND_CUR_DIRECTION); // } // #endif // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtu32_ss (__m128 __A, unsigned __B) // { // return (__m128) __builtin_ia32_cvtusi2ss32 ((__v4sf) __A, __B, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepi32_ps (__m512i __A) // { // return (__m512) __builtin_ia32_cvtdq2ps512_mask ((__v16si) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepi32_ps (__m512 __W, __mmask16 __U, __m512i __A) // { // return (__m512) __builtin_ia32_cvtdq2ps512_mask ((__v16si) __A, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepi32_ps (__mmask16 __U, __m512i __A) // { // return (__m512) __builtin_ia32_cvtdq2ps512_mask ((__v16si) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtepu32_ps (__m512i __A) // { // return (__m512) __builtin_ia32_cvtudq2ps512_mask ((__v16si) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtepu32_ps (__m512 __W, __mmask16 __U, __m512i __A) // { // return (__m512) __builtin_ia32_cvtudq2ps512_mask ((__v16si) __A, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtepu32_ps (__mmask16 __U, __m512i __A) // { // return (__m512) __builtin_ia32_cvtudq2ps512_mask ((__v16si) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // #ifdef __OPTIMIZE__ // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fixupimm_pd (__m512d __A, __m512d __B, __m512i __C, const int __imm) // { // return (__m512d) __builtin_ia32_fixupimmpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8di) __C, // __imm, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fixupimm_pd (__m512d __A, __mmask8 __U, __m512d __B, // __m512i __C, const int __imm) // { // return (__m512d) __builtin_ia32_fixupimmpd512_mask ((__v8df) __A, // (__v8df) __B, // (__v8di) __C, // __imm, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fixupimm_pd (__mmask8 __U, __m512d __A, __m512d __B, // __m512i __C, const int __imm) // { // return (__m512d) __builtin_ia32_fixupimmpd512_maskz ((__v8df) __A, // (__v8df) __B, // (__v8di) __C, // __imm, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_fixupimm_ps (__m512 __A, __m512 __B, __m512i __C, const int __imm) // { // return (__m512) __builtin_ia32_fixupimmps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16si) __C, // __imm, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_fixupimm_ps (__m512 __A, __mmask16 __U, __m512 __B, // __m512i __C, const int __imm) // { // return (__m512) __builtin_ia32_fixupimmps512_mask ((__v16sf) __A, // (__v16sf) __B, // (__v16si) __C, // __imm, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_fixupimm_ps (__mmask16 __U, __m512 __A, __m512 __B, // __m512i __C, const int __imm) // { // return (__m512) __builtin_ia32_fixupimmps512_maskz ((__v16sf) __A, // (__v16sf) __B, // (__v16si) __C, // __imm, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fixupimm_sd (__m128d __A, __m128d __B, __m128i __C, const int __imm) // { // return (__m128d) __builtin_ia32_fixupimmsd_mask ((__v2df) __A, // (__v2df) __B, // (__v2di) __C, __imm, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fixupimm_sd (__m128d __A, __mmask8 __U, __m128d __B, // __m128i __C, const int __imm) // { // return (__m128d) __builtin_ia32_fixupimmsd_mask ((__v2df) __A, // (__v2df) __B, // (__v2di) __C, __imm, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fixupimm_sd (__mmask8 __U, __m128d __A, __m128d __B, // __m128i __C, const int __imm) // { // return (__m128d) __builtin_ia32_fixupimmsd_maskz ((__v2df) __A, // (__v2df) __B, // (__v2di) __C, // __imm, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fixupimm_ss (__m128 __A, __m128 __B, __m128i __C, const int __imm) // { // return (__m128) __builtin_ia32_fixupimmss_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4si) __C, __imm, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fixupimm_ss (__m128 __A, __mmask8 __U, __m128 __B, // __m128i __C, const int __imm) // { // return (__m128) __builtin_ia32_fixupimmss_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4si) __C, __imm, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fixupimm_ss (__mmask8 __U, __m128 __A, __m128 __B, // __m128i __C, const int __imm) // { // return (__m128) __builtin_ia32_fixupimmss_maskz ((__v4sf) __A, // (__v4sf) __B, // (__v4si) __C, __imm, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // #else // #define _mm512_fixupimm_pd(X, Y, Z, C) \ // ((__m512d)__builtin_ia32_fixupimmpd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (__v8di)(__m512i)(Z), (int)(C), \ // (__mmask8)(-1), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_fixupimm_pd(X, U, Y, Z, C) \ // ((__m512d)__builtin_ia32_fixupimmpd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (__v8di)(__m512i)(Z), (int)(C), \ // (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_maskz_fixupimm_pd(U, X, Y, Z, C) \ // ((__m512d)__builtin_ia32_fixupimmpd512_maskz ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (__v8di)(__m512i)(Z), (int)(C), \ // (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_fixupimm_ps(X, Y, Z, C) \ // ((__m512)__builtin_ia32_fixupimmps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (__v16si)(__m512i)(Z), (int)(C), \ // (__mmask16)(-1), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_fixupimm_ps(X, U, Y, Z, C) \ // ((__m512)__builtin_ia32_fixupimmps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (__v16si)(__m512i)(Z), (int)(C), \ // (__mmask16)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_maskz_fixupimm_ps(U, X, Y, Z, C) \ // ((__m512)__builtin_ia32_fixupimmps512_maskz ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (__v16si)(__m512i)(Z), (int)(C), \ // (__mmask16)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm_fixupimm_sd(X, Y, Z, C) \ // ((__m128d)__builtin_ia32_fixupimmsd_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (__v2di)(__m128i)(Z), (int)(C), \ // (__mmask8)(-1), _MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_fixupimm_sd(X, U, Y, Z, C) \ // ((__m128d)__builtin_ia32_fixupimmsd_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (__v2di)(__m128i)(Z), (int)(C), \ // (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm_maskz_fixupimm_sd(U, X, Y, Z, C) \ // ((__m128d)__builtin_ia32_fixupimmsd_maskz ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (__v2di)(__m128i)(Z), (int)(C), \ // (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm_fixupimm_ss(X, Y, Z, C) \ // ((__m128)__builtin_ia32_fixupimmss_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (__v4si)(__m128i)(Z), (int)(C), \ // (__mmask8)(-1), _MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_fixupimm_ss(X, U, Y, Z, C) \ // ((__m128)__builtin_ia32_fixupimmss_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (__v4si)(__m128i)(Z), (int)(C), \ // (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm_maskz_fixupimm_ss(U, X, Y, Z, C) \ // ((__m128)__builtin_ia32_fixupimmss_maskz ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (__v4si)(__m128i)(Z), (int)(C), \ // (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #endif // #ifdef __x86_64__ // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtss_u64 (__m128 __A) // { // return (unsigned long long) __builtin_ia32_vcvtss2usi64 ((__v4sf) // __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttss_u64 (__m128 __A) // { // return (unsigned long long) __builtin_ia32_vcvttss2usi64 ((__v4sf) // __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttss_i64 (__m128 __A) // { // return (long long) __builtin_ia32_vcvttss2si64 ((__v4sf) __A, // _MM_FROUND_CUR_DIRECTION); // } // #endif /* __x86_64__ */ // extern __inline unsigned // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtss_u32 (__m128 __A) // { // return (unsigned) __builtin_ia32_vcvtss2usi32 ((__v4sf) __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline unsigned // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttss_u32 (__m128 __A) // { // return (unsigned) __builtin_ia32_vcvttss2usi32 ((__v4sf) __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttss_i32 (__m128 __A) // { // return (int) __builtin_ia32_vcvttss2si32 ((__v4sf) __A, // _MM_FROUND_CUR_DIRECTION); // } // #ifdef __x86_64__ // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtsd_u64 (__m128d __A) // { // return (unsigned long long) __builtin_ia32_vcvtsd2usi64 ((__v2df) // __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttsd_u64 (__m128d __A) // { // return (unsigned long long) __builtin_ia32_vcvttsd2usi64 ((__v2df) // __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttsd_i64 (__m128d __A) // { // return (long long) __builtin_ia32_vcvttsd2si64 ((__v2df) __A, // _MM_FROUND_CUR_DIRECTION); // } // #endif /* __x86_64__ */ // extern __inline unsigned // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtsd_u32 (__m128d __A) // { // return (unsigned) __builtin_ia32_vcvtsd2usi32 ((__v2df) __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline unsigned // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttsd_u32 (__m128d __A) // { // return (unsigned) __builtin_ia32_vcvttsd2usi32 ((__v2df) __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttsd_i32 (__m128d __A) // { // return (int) __builtin_ia32_vcvttsd2si32 ((__v2df) __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtps_pd (__m256 __A) // { // return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtps_pd (__m512d __W, __mmask8 __U, __m256 __A) // { // return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtps_pd (__mmask8 __U, __m256 __A) // { // return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtph_ps (__m256i __A) // { // return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtph_ps (__m512 __W, __mmask16 __U, __m256i __A) // { // return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtph_ps (__mmask16 __U, __m256i __A) // { // return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cvtpd_ps (__m512d __A) // { // return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A, // (__v8sf) // _mm256_undefined_ps (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cvtpd_ps (__m256 __W, __mmask8 __U, __m512d __A) // { // return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A, // (__v8sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_cvtpd_ps (__mmask8 __U, __m512d __A) // { // return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // #ifdef __OPTIMIZE__ // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_getexp_ps (__m512 __A) // { // return (__m512) __builtin_ia32_getexpps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_undefined_ps (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_getexp_ps (__m512 __W, __mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_getexpps512_mask ((__v16sf) __A, // (__v16sf) __W, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_getexp_ps (__mmask16 __U, __m512 __A) // { // return (__m512) __builtin_ia32_getexpps512_mask ((__v16sf) __A, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_getexp_pd (__m512d __A) // { // return (__m512d) __builtin_ia32_getexppd512_mask ((__v8df) __A, // (__v8df) // _mm512_undefined_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_getexp_pd (__m512d __W, __mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_getexppd512_mask ((__v8df) __A, // (__v8df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_getexp_pd (__mmask8 __U, __m512d __A) // { // return (__m512d) __builtin_ia32_getexppd512_mask ((__v8df) __A, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getexp_ss (__m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_getexpss128_round ((__v4sf) __A, // (__v4sf) __B, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getexp_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_getexpss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getexp_ss (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_getexpss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getexp_sd (__m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_getexpsd128_round ((__v2df) __A, // (__v2df) __B, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getexp_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_getexpsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getexp_sd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_getexpsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_getmant_pd (__m512d __A, _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m512d) __builtin_ia32_getmantpd512_mask ((__v8df) __A, // (__C << 2) | __B, // _mm512_undefined_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_getmant_pd (__m512d __W, __mmask8 __U, __m512d __A, // _MM_MANTISSA_NORM_ENUM __B, _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m512d) __builtin_ia32_getmantpd512_mask ((__v8df) __A, // (__C << 2) | __B, // (__v8df) __W, __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_getmant_pd (__mmask8 __U, __m512d __A, // _MM_MANTISSA_NORM_ENUM __B, _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m512d) __builtin_ia32_getmantpd512_mask ((__v8df) __A, // (__C << 2) | __B, // (__v8df) // _mm512_setzero_pd (), // __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_getmant_ps (__m512 __A, _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m512) __builtin_ia32_getmantps512_mask ((__v16sf) __A, // (__C << 2) | __B, // _mm512_undefined_ps (), // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_getmant_ps (__m512 __W, __mmask16 __U, __m512 __A, // _MM_MANTISSA_NORM_ENUM __B, _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m512) __builtin_ia32_getmantps512_mask ((__v16sf) __A, // (__C << 2) | __B, // (__v16sf) __W, __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_getmant_ps (__mmask16 __U, __m512 __A, // _MM_MANTISSA_NORM_ENUM __B, _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m512) __builtin_ia32_getmantps512_mask ((__v16sf) __A, // (__C << 2) | __B, // (__v16sf) // _mm512_setzero_ps (), // __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getmant_sd (__m128d __A, __m128d __B, _MM_MANTISSA_NORM_ENUM __C, // _MM_MANTISSA_SIGN_ENUM __D) // { // return (__m128d) __builtin_ia32_getmantsd_round ((__v2df) __A, // (__v2df) __B, // (__D << 2) | __C, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getmant_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B, // _MM_MANTISSA_NORM_ENUM __C, _MM_MANTISSA_SIGN_ENUM __D) // { // return (__m128d) __builtin_ia32_getmantsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__D << 2) | __C, // (__v2df) __W, // __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getmant_sd (__mmask8 __U, __m128d __A, __m128d __B, // _MM_MANTISSA_NORM_ENUM __C, _MM_MANTISSA_SIGN_ENUM __D) // { // return (__m128d) __builtin_ia32_getmantsd_mask_round ((__v2df) __A, // (__v2df) __B, // (__D << 2) | __C, // (__v2df) // _mm_setzero_pd(), // __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getmant_ss (__m128 __A, __m128 __B, _MM_MANTISSA_NORM_ENUM __C, // _MM_MANTISSA_SIGN_ENUM __D) // { // return (__m128) __builtin_ia32_getmantss_round ((__v4sf) __A, // (__v4sf) __B, // (__D << 2) | __C, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getmant_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, // _MM_MANTISSA_NORM_ENUM __C, _MM_MANTISSA_SIGN_ENUM __D) // { // return (__m128) __builtin_ia32_getmantss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__D << 2) | __C, // (__v4sf) __W, // __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getmant_ss (__mmask8 __U, __m128 __A, __m128 __B, // _MM_MANTISSA_NORM_ENUM __C, _MM_MANTISSA_SIGN_ENUM __D) // { // return (__m128) __builtin_ia32_getmantss_mask_round ((__v4sf) __A, // (__v4sf) __B, // (__D << 2) | __C, // (__v4sf) // _mm_setzero_ps(), // __U, // _MM_FROUND_CUR_DIRECTION); // } // #else // #define _mm512_getmant_pd(X, B, C) \ // ((__m512d)__builtin_ia32_getmantpd512_mask ((__v8df)(__m512d)(X), \ // (int)(((C)<<2) | (B)), \ // (__v8df)_mm512_undefined_pd(), \ // (__mmask8)-1,\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_getmant_pd(W, U, X, B, C) \ // ((__m512d)__builtin_ia32_getmantpd512_mask ((__v8df)(__m512d)(X), \ // (int)(((C)<<2) | (B)), \ // (__v8df)(__m512d)(W), \ // (__mmask8)(U),\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm512_maskz_getmant_pd(U, X, B, C) \ // ((__m512d)__builtin_ia32_getmantpd512_mask ((__v8df)(__m512d)(X), \ // (int)(((C)<<2) | (B)), \ // (__v8df)_mm512_setzero_pd(), \ // (__mmask8)(U),\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm512_getmant_ps(X, B, C) \ // ((__m512)__builtin_ia32_getmantps512_mask ((__v16sf)(__m512)(X), \ // (int)(((C)<<2) | (B)), \ // (__v16sf)_mm512_undefined_ps(), \ // (__mmask16)-1,\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_getmant_ps(W, U, X, B, C) \ // ((__m512)__builtin_ia32_getmantps512_mask ((__v16sf)(__m512)(X), \ // (int)(((C)<<2) | (B)), \ // (__v16sf)(__m512)(W), \ // (__mmask16)(U),\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm512_maskz_getmant_ps(U, X, B, C) \ // ((__m512)__builtin_ia32_getmantps512_mask ((__v16sf)(__m512)(X), \ // (int)(((C)<<2) | (B)), \ // (__v16sf)_mm512_setzero_ps(), \ // (__mmask16)(U),\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_getmant_sd(X, Y, C, D) \ // ((__m128d)__builtin_ia32_getmantsd_round ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), \ // (int)(((D)<<2) | (C)), \ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_getmant_sd(W, U, X, Y, C, D) \ // ((__m128d)__builtin_ia32_getmantsd_mask_round ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), \ // (int)(((D)<<2) | (C)), \ // (__v2df)(__m128d)(W), \ // (__mmask8)(U),\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_maskz_getmant_sd(U, X, Y, C, D) \ // ((__m128d)__builtin_ia32_getmantsd_mask_round ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), \ // (int)(((D)<<2) | (C)), \ // (__v2df)_mm_setzero_pd(), \ // (__mmask8)(U),\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_getmant_ss(X, Y, C, D) \ // ((__m128)__builtin_ia32_getmantss_round ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), \ // (int)(((D)<<2) | (C)), \ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_getmant_ss(W, U, X, Y, C, D) \ // ((__m128)__builtin_ia32_getmantss_mask_round ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), \ // (int)(((D)<<2) | (C)), \ // (__v4sf)(__m128)(W), \ // (__mmask8)(U),\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_maskz_getmant_ss(U, X, Y, C, D) \ // ((__m128)__builtin_ia32_getmantss_mask_round ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), \ // (int)(((D)<<2) | (C)), \ // (__v4sf)_mm_setzero_ps(), \ // (__mmask8)(U),\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_getexp_ss(A, B) \ // ((__m128)__builtin_ia32_getexpss128_round((__v4sf)(__m128)(A), (__v4sf)(__m128)(B), \ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_getexp_ss(W, U, A, B) \ // (__m128)__builtin_ia32_getexpss_mask_round(A, B, W, U,\ // _MM_FROUND_CUR_DIRECTION) // #define _mm_maskz_getexp_ss(U, A, B) \ // (__m128)__builtin_ia32_getexpss_mask_round(A, B, (__v4sf)_mm_setzero_ps(), U,\ // _MM_FROUND_CUR_DIRECTION) // #define _mm_getexp_sd(A, B) \ // ((__m128d)__builtin_ia32_getexpsd128_round((__v2df)(__m128d)(A), (__v2df)(__m128d)(B),\ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_getexp_sd(W, U, A, B) \ // (__m128d)__builtin_ia32_getexpsd_mask_round(A, B, W, U,\ // _MM_FROUND_CUR_DIRECTION) // #define _mm_maskz_getexp_sd(U, A, B) \ // (__m128d)__builtin_ia32_getexpsd_mask_round(A, B, (__v2df)_mm_setzero_pd(), U,\ // _MM_FROUND_CUR_DIRECTION) // #define _mm512_getexp_ps(A) \ // ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ // (__v16sf)_mm512_undefined_ps(), (__mmask16)-1, _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_getexp_ps(W, U, A) \ // ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ // (__v16sf)(__m512)(W), (__mmask16)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_maskz_getexp_ps(U, A) \ // ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ // (__v16sf)_mm512_setzero_ps(), (__mmask16)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_getexp_pd(A) \ // ((__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \ // (__v8df)_mm512_undefined_pd(), (__mmask8)-1, _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_getexp_pd(W, U, A) \ // ((__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \ // (__v8df)(__m512d)(W), (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_maskz_getexp_pd(U, A) \ // ((__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \ // (__v8df)_mm512_setzero_pd(), (__mmask8)(U), _MM_FROUND_CUR_DIRECTION)) // #endif // #ifdef __OPTIMIZE__ // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_roundscale_ps (__m512 __A, const int __imm) // { // return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, __imm, // (__v16sf) // _mm512_undefined_ps (), // -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_roundscale_ps (__m512 __A, __mmask16 __B, __m512 __C, // const int __imm) // { // return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __C, __imm, // (__v16sf) __A, // (__mmask16) __B, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_roundscale_ps (__mmask16 __A, __m512 __B, const int __imm) // { // return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __B, // __imm, // (__v16sf) // _mm512_setzero_ps (), // (__mmask16) __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_roundscale_pd (__m512d __A, const int __imm) // { // return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, __imm, // (__v8df) // _mm512_undefined_pd (), // -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_roundscale_pd (__m512d __A, __mmask8 __B, __m512d __C, // const int __imm) // { // return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __C, __imm, // (__v8df) __A, // (__mmask8) __B, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_roundscale_pd (__mmask8 __A, __m512d __B, const int __imm) // { // return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __B, // __imm, // (__v8df) // _mm512_setzero_pd (), // (__mmask8) __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_roundscale_ss (__m128 __A, __m128 __B, const int __imm) // { // return (__m128) // __builtin_ia32_rndscaless_mask_round ((__v4sf) __A, // (__v4sf) __B, __imm, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_roundscale_ss (__m128 __A, __mmask8 __B, __m128 __C, __m128 __D, // const int __imm) // { // return (__m128) // __builtin_ia32_rndscaless_mask_round ((__v4sf) __C, // (__v4sf) __D, __imm, // (__v4sf) __A, // (__mmask8) __B, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_roundscale_ss (__mmask8 __A, __m128 __B, __m128 __C, // const int __imm) // { // return (__m128) // __builtin_ia32_rndscaless_mask_round ((__v4sf) __B, // (__v4sf) __C, __imm, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __A, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_roundscale_sd (__m128d __A, __m128d __B, const int __imm) // { // return (__m128d) // __builtin_ia32_rndscalesd_mask_round ((__v2df) __A, // (__v2df) __B, __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_roundscale_sd (__m128d __A, __mmask8 __B, __m128d __C, __m128d __D, // const int __imm) // { // return (__m128d) // __builtin_ia32_rndscalesd_mask_round ((__v2df) __C, // (__v2df) __D, __imm, // (__v2df) __A, // (__mmask8) __B, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_roundscale_sd (__mmask8 __A, __m128d __B, __m128d __C, // const int __imm) // { // return (__m128d) // __builtin_ia32_rndscalesd_mask_round ((__v2df) __B, // (__v2df) __C, __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __A, // _MM_FROUND_CUR_DIRECTION); // } // #else // #define _mm512_roundscale_ps(A, B) \ // ((__m512) __builtin_ia32_rndscaleps_mask ((__v16sf)(__m512)(A), (int)(B),\ // (__v16sf)_mm512_undefined_ps(), (__mmask16)(-1), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_roundscale_ps(A, B, C, D) \ // ((__m512) __builtin_ia32_rndscaleps_mask ((__v16sf)(__m512)(C), \ // (int)(D), \ // (__v16sf)(__m512)(A), \ // (__mmask16)(B), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_maskz_roundscale_ps(A, B, C) \ // ((__m512) __builtin_ia32_rndscaleps_mask ((__v16sf)(__m512)(B), \ // (int)(C), \ // (__v16sf)_mm512_setzero_ps(),\ // (__mmask16)(A), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_roundscale_pd(A, B) \ // ((__m512d) __builtin_ia32_rndscalepd_mask ((__v8df)(__m512d)(A), (int)(B),\ // (__v8df)_mm512_undefined_pd(), (__mmask8)(-1), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_roundscale_pd(A, B, C, D) \ // ((__m512d) __builtin_ia32_rndscalepd_mask ((__v8df)(__m512d)(C), \ // (int)(D), \ // (__v8df)(__m512d)(A), \ // (__mmask8)(B), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_maskz_roundscale_pd(A, B, C) \ // ((__m512d) __builtin_ia32_rndscalepd_mask ((__v8df)(__m512d)(B), \ // (int)(C), \ // (__v8df)_mm512_setzero_pd(),\ // (__mmask8)(A), _MM_FROUND_CUR_DIRECTION)) // #define _mm_roundscale_ss(A, B, I) \ // ((__m128) \ // __builtin_ia32_rndscaless_mask_round ((__v4sf) (__m128) (A), \ // (__v4sf) (__m128) (B), \ // (int) (I), \ // (__v4sf) _mm_setzero_ps (), \ // (__mmask8) (-1), \ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_roundscale_ss(A, U, B, C, I) \ // ((__m128) \ // __builtin_ia32_rndscaless_mask_round ((__v4sf) (__m128) (B), \ // (__v4sf) (__m128) (C), \ // (int) (I), \ // (__v4sf) (__m128) (A), \ // (__mmask8) (U), \ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_maskz_roundscale_ss(U, A, B, I) \ // ((__m128) \ // __builtin_ia32_rndscaless_mask_round ((__v4sf) (__m128) (A), \ // (__v4sf) (__m128) (B), \ // (int) (I), \ // (__v4sf) _mm_setzero_ps (), \ // (__mmask8) (U), \ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_roundscale_sd(A, B, I) \ // ((__m128d) \ // __builtin_ia32_rndscalesd_mask_round ((__v2df) (__m128d) (A), \ // (__v2df) (__m128d) (B), \ // (int) (I), \ // (__v2df) _mm_setzero_pd (), \ // (__mmask8) (-1), \ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_roundscale_sd(A, U, B, C, I) \ // ((__m128d) \ // __builtin_ia32_rndscalesd_mask_round ((__v2df) (__m128d) (B), \ // (__v2df) (__m128d) (C), \ // (int) (I), \ // (__v2df) (__m128d) (A), \ // (__mmask8) (U), \ // _MM_FROUND_CUR_DIRECTION)) // #define _mm_maskz_roundscale_sd(U, A, B, I) \ // ((__m128d) \ // __builtin_ia32_rndscalesd_mask_round ((__v2df) (__m128d) (A), \ // (__v2df) (__m128d) (B), \ // (int) (I), \ // (__v2df) _mm_setzero_pd (), \ // (__mmask8) (U), \ // _MM_FROUND_CUR_DIRECTION)) // #endif // #ifdef __OPTIMIZE__ // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_pd_mask (__m512d __X, __m512d __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, __P, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmp_ps_mask (__m512 __X, __m512 __Y, const int __P) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, __P, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_ps_mask (__mmask16 __U, __m512 __X, __m512 __Y, const int __P) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, __P, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmp_pd_mask (__mmask8 __U, __m512d __X, __m512d __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, __P, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_sd_mask (__m128d __X, __m128d __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpsd_mask ((__v2df) __X, // (__v2df) __Y, __P, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_sd_mask (__mmask8 __M, __m128d __X, __m128d __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpsd_mask ((__v2df) __X, // (__v2df) __Y, __P, // (__mmask8) __M, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_ss_mask (__m128 __X, __m128 __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpss_mask ((__v4sf) __X, // (__v4sf) __Y, __P, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_ss_mask (__mmask8 __M, __m128 __X, __m128 __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpss_mask ((__v4sf) __X, // (__v4sf) __Y, __P, // (__mmask8) __M, // _MM_FROUND_CUR_DIRECTION); // } // #else // #define _mm512_cmp_pd_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmppd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (int)(P),\ // (__mmask8)-1,_MM_FROUND_CUR_DIRECTION)) // #define _mm512_cmp_ps_mask(X, Y, P) \ // ((__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (int)(P),\ // (__mmask16)-1,_MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_cmp_pd_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmppd512_mask ((__v8df)(__m512d)(X), \ // (__v8df)(__m512d)(Y), (int)(P),\ // (__mmask8)(M), _MM_FROUND_CUR_DIRECTION)) // #define _mm512_mask_cmp_ps_mask(M, X, Y, P) \ // ((__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf)(__m512)(X), \ // (__v16sf)(__m512)(Y), (int)(P),\ // (__mmask16)(M),_MM_FROUND_CUR_DIRECTION)) // #define _mm_cmp_sd_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpsd_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (int)(P),\ // (__mmask8)-1,_MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_cmp_sd_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpsd_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (int)(P),\ // M,_MM_FROUND_CUR_DIRECTION)) // #define _mm_cmp_ss_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpss_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (int)(P), \ // (__mmask8)-1,_MM_FROUND_CUR_DIRECTION)) // #define _mm_mask_cmp_ss_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpss_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (int)(P), \ // M,_MM_FROUND_CUR_DIRECTION)) // #endif // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpeq_pd_mask (__m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_EQ_OQ, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpeq_pd_mask (__mmask8 __U, __m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_EQ_OQ, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmplt_pd_mask (__m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_LT_OS, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmplt_pd_mask (__mmask8 __U, __m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_LT_OS, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmple_pd_mask (__m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_LE_OS, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmple_pd_mask (__mmask8 __U, __m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_LE_OS, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpunord_pd_mask (__m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_UNORD_Q, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpunord_pd_mask (__mmask8 __U, __m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_UNORD_Q, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpneq_pd_mask (__m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_NEQ_UQ, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpneq_pd_mask (__mmask8 __U, __m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_NEQ_UQ, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpnlt_pd_mask (__m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_NLT_US, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpnlt_pd_mask (__mmask8 __U, __m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_NLT_US, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpnle_pd_mask (__m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_NLE_US, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpnle_pd_mask (__mmask8 __U, __m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_NLE_US, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpord_pd_mask (__m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_ORD_Q, // (__mmask8) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpord_pd_mask (__mmask8 __U, __m512d __X, __m512d __Y) // { // return (__mmask8) __builtin_ia32_cmppd512_mask ((__v8df) __X, // (__v8df) __Y, _CMP_ORD_Q, // (__mmask8) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpeq_ps_mask (__m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_EQ_OQ, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpeq_ps_mask (__mmask16 __U, __m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_EQ_OQ, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmplt_ps_mask (__m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_LT_OS, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmplt_ps_mask (__mmask16 __U, __m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_LT_OS, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmple_ps_mask (__m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_LE_OS, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmple_ps_mask (__mmask16 __U, __m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_LE_OS, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpunord_ps_mask (__m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_UNORD_Q, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpunord_ps_mask (__mmask16 __U, __m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_UNORD_Q, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpneq_ps_mask (__m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_NEQ_UQ, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpneq_ps_mask (__mmask16 __U, __m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_NEQ_UQ, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpnlt_ps_mask (__m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_NLT_US, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpnlt_ps_mask (__mmask16 __U, __m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_NLT_US, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpnle_ps_mask (__m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_NLE_US, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpnle_ps_mask (__mmask16 __U, __m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_NLE_US, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpord_ps_mask (__m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_ORD_Q, // (__mmask16) -1, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpord_ps_mask (__mmask16 __U, __m512 __X, __m512 __Y) // { // return (__mmask16) __builtin_ia32_cmpps512_mask ((__v16sf) __X, // (__v16sf) __Y, _CMP_ORD_Q, // (__mmask16) __U, // _MM_FROUND_CUR_DIRECTION); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_kmov (__mmask16 __A) // { // return __builtin_ia32_kmovw (__A); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castpd_ps (__m512d __A) // { // return (__m512) (__A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castpd_si512 (__m512d __A) // { // return (__m512i) (__A); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castps_pd (__m512 __A) // { // return (__m512d) (__A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castps_si512 (__m512 __A) // { // return (__m512i) (__A); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castsi512_ps (__m512i __A) // { // return (__m512) (__A); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castsi512_pd (__m512i __A) // { // return (__m512d) (__A); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castpd512_pd128 (__m512d __A) // { // return (__m128d)_mm512_extractf32x4_ps((__m512)__A, 0); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castps512_ps128 (__m512 __A) // { // return _mm512_extractf32x4_ps(__A, 0); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castsi512_si128 (__m512i __A) // { // return (__m128i)_mm512_extracti32x4_epi32((__m512i)__A, 0); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castpd512_pd256 (__m512d __A) // { // return _mm512_extractf64x4_pd(__A, 0); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castps512_ps256 (__m512 __A) // { // return (__m256)_mm512_extractf64x4_pd((__m512d)__A, 0); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castsi512_si256 (__m512i __A) // { // return (__m256i)_mm512_extractf64x4_pd((__m512d)__A, 0); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castpd128_pd512 (__m128d __A) // { // return (__m512d) __builtin_ia32_pd512_pd((__m128d)__A); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castps128_ps512 (__m128 __A) // { // return (__m512) __builtin_ia32_ps512_ps((__m128)__A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castsi128_si512 (__m128i __A) // { // return (__m512i) __builtin_ia32_si512_si((__v4si)__A); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castpd256_pd512 (__m256d __A) // { // return __builtin_ia32_pd512_256pd (__A); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castps256_ps512 (__m256 __A) // { // return __builtin_ia32_ps512_256ps (__A); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_castsi256_si512 (__m256i __A) // { // return (__m512i)__builtin_ia32_si512_256si ((__v8si)__A); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_zextpd128_pd512 (__m128d __A) // { // return (__m512d) _mm512_insertf32x4 (_mm512_setzero_ps (), (__m128) __A, 0); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_zextps128_ps512 (__m128 __A) // { // return _mm512_insertf32x4 (_mm512_setzero_ps (), __A, 0); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_zextsi128_si512 (__m128i __A) // { // return _mm512_inserti32x4 (_mm512_setzero_si512 (), __A, 0); // } // extern __inline __m512d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_zextpd256_pd512 (__m256d __A) // { // return _mm512_insertf64x4 (_mm512_setzero_pd (), __A, 0); // } // extern __inline __m512 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_zextps256_ps512 (__m256 __A) // { // return (__m512) _mm512_insertf64x4 (_mm512_setzero_pd (), (__m256d) __A, 0); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_zextsi256_si512 (__m256i __A) // { // return _mm512_inserti64x4 (_mm512_setzero_si512 (), __A, 0); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpeq_epu32_mask (__m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __A, // (__v16si) __B, 0, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpeq_epu32_mask (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __A, // (__v16si) __B, 0, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpeq_epu64_mask (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __A, // (__v8di) __B, 0, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpeq_epu64_mask (__m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __A, // (__v8di) __B, 0, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpgt_epu32_mask (__m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __A, // (__v16si) __B, 6, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpgt_epu32_mask (__mmask16 __U, __m512i __A, __m512i __B) // { // return (__mmask16) __builtin_ia32_ucmpd512_mask ((__v16si) __A, // (__v16si) __B, 6, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_cmpgt_epu64_mask (__mmask8 __U, __m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __A, // (__v8di) __B, 6, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_cmpgt_epu64_mask (__m512i __A, __m512i __B) // { // return (__mmask8) __builtin_ia32_ucmpq512_mask ((__v8di) __A, // (__v8di) __B, 6, // (__mmask8) -1); // } // #undef __MM512_REDUCE_OP // #define __MM512_REDUCE_OP(op) \ // __v8si __T1 = (__v8si) _mm512_extracti64x4_epi64 (__A, 1); \ // __v8si __T2 = (__v8si) _mm512_extracti64x4_epi64 (__A, 0); \ // __m256i __T3 = (__m256i) (__T1 op __T2); \ // __v4si __T4 = (__v4si) _mm256_extracti128_si256 (__T3, 1); \ // __v4si __T5 = (__v4si) _mm256_extracti128_si256 (__T3, 0); \ // __v4si __T6 = __T4 op __T5; \ // __v4si __T7 = __builtin_shuffle (__T6, (__v4si) { 2, 3, 0, 1 }); \ // __v4si __T8 = __T6 op __T7; \ // return __T8[0] op __T8[1] // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_add_epi32 (__m512i __A) // { // __MM512_REDUCE_OP (+); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_mul_epi32 (__m512i __A) // { // __MM512_REDUCE_OP (*); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_and_epi32 (__m512i __A) // { // __MM512_REDUCE_OP (&); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_or_epi32 (__m512i __A) // { // __MM512_REDUCE_OP (|); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_add_epi32 (__mmask16 __U, __m512i __A) // { // __A = _mm512_maskz_mov_epi32 (__U, __A); // __MM512_REDUCE_OP (+); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_mul_epi32 (__mmask16 __U, __m512i __A) // { // __A = _mm512_mask_mov_epi32 (_mm512_set1_epi32 (1), __U, __A); // __MM512_REDUCE_OP (*); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_and_epi32 (__mmask16 __U, __m512i __A) // { // __A = _mm512_mask_mov_epi32 (_mm512_set1_epi32 (~0), __U, __A); // __MM512_REDUCE_OP (&); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_or_epi32 (__mmask16 __U, __m512i __A) // { // __A = _mm512_maskz_mov_epi32 (__U, __A); // __MM512_REDUCE_OP (|); // } // #undef __MM512_REDUCE_OP // #define __MM512_REDUCE_OP(op) \ // __m256i __T1 = (__m256i) _mm512_extracti64x4_epi64 (__A, 1); \ // __m256i __T2 = (__m256i) _mm512_extracti64x4_epi64 (__A, 0); \ // __m256i __T3 = _mm256_##op (__T1, __T2); \ // __m128i __T4 = (__m128i) _mm256_extracti128_si256 (__T3, 1); \ // __m128i __T5 = (__m128i) _mm256_extracti128_si256 (__T3, 0); \ // __m128i __T6 = _mm_##op (__T4, __T5); \ // __m128i __T7 = (__m128i) __builtin_shuffle ((__v4si) __T6, \ // (__v4si) { 2, 3, 0, 1 }); \ // __m128i __T8 = _mm_##op (__T6, __T7); \ // __m128i __T9 = (__m128i) __builtin_shuffle ((__v4si) __T8, \ // (__v4si) { 1, 0, 1, 0 }); \ // __v4si __T10 = (__v4si) _mm_##op (__T8, __T9); \ // return __T10[0] // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_min_epi32 (__m512i __A) // { // __MM512_REDUCE_OP (min_epi32); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_max_epi32 (__m512i __A) // { // __MM512_REDUCE_OP (max_epi32); // } // extern __inline unsigned int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_min_epu32 (__m512i __A) // { // __MM512_REDUCE_OP (min_epu32); // } // extern __inline unsigned int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_max_epu32 (__m512i __A) // { // __MM512_REDUCE_OP (max_epu32); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_min_epi32 (__mmask16 __U, __m512i __A) // { // __A = _mm512_mask_mov_epi32 (_mm512_set1_epi32 (__INT_MAX__), __U, __A); // __MM512_REDUCE_OP (min_epi32); // } // extern __inline int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_max_epi32 (__mmask16 __U, __m512i __A) // { // __A = _mm512_mask_mov_epi32 (_mm512_set1_epi32 (-__INT_MAX__ - 1), __U, __A); // __MM512_REDUCE_OP (max_epi32); // } // extern __inline unsigned int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_min_epu32 (__mmask16 __U, __m512i __A) // { // __A = _mm512_mask_mov_epi32 (_mm512_set1_epi32 (~0), __U, __A); // __MM512_REDUCE_OP (min_epu32); // } // extern __inline unsigned int // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_max_epu32 (__mmask16 __U, __m512i __A) // { // __A = _mm512_maskz_mov_epi32 (__U, __A); // __MM512_REDUCE_OP (max_epu32); // } // #undef __MM512_REDUCE_OP // #define __MM512_REDUCE_OP(op) \ // __m256 __T1 = (__m256) _mm512_extractf64x4_pd ((__m512d) __A, 1); \ // __m256 __T2 = (__m256) _mm512_extractf64x4_pd ((__m512d) __A, 0); \ // __m256 __T3 = __T1 op __T2; \ // __m128 __T4 = _mm256_extractf128_ps (__T3, 1); \ // __m128 __T5 = _mm256_extractf128_ps (__T3, 0); \ // __m128 __T6 = __T4 op __T5; \ // __m128 __T7 = __builtin_shuffle (__T6, (__v4si) { 2, 3, 0, 1 }); \ // __m128 __T8 = __T6 op __T7; \ // return __T8[0] op __T8[1] // extern __inline float // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_add_ps (__m512 __A) // { // __MM512_REDUCE_OP (+); // } // extern __inline float // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_mul_ps (__m512 __A) // { // __MM512_REDUCE_OP (*); // } // extern __inline float // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_add_ps (__mmask16 __U, __m512 __A) // { // __A = _mm512_maskz_mov_ps (__U, __A); // __MM512_REDUCE_OP (+); // } // extern __inline float // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_mul_ps (__mmask16 __U, __m512 __A) // { // __A = _mm512_mask_mov_ps (_mm512_set1_ps (1.0f), __U, __A); // __MM512_REDUCE_OP (*); // } // #undef __MM512_REDUCE_OP // #define __MM512_REDUCE_OP(op) \ // __m256 __T1 = (__m256) _mm512_extractf64x4_pd ((__m512d) __A, 1); \ // __m256 __T2 = (__m256) _mm512_extractf64x4_pd ((__m512d) __A, 0); \ // __m256 __T3 = _mm256_##op (__T1, __T2); \ // __m128 __T4 = _mm256_extractf128_ps (__T3, 1); \ // __m128 __T5 = _mm256_extractf128_ps (__T3, 0); \ // __m128 __T6 = _mm_##op (__T4, __T5); \ // __m128 __T7 = __builtin_shuffle (__T6, (__v4si) { 2, 3, 0, 1 }); \ // __m128 __T8 = _mm_##op (__T6, __T7); \ // __m128 __T9 = __builtin_shuffle (__T8, (__v4si) { 1, 0, 1, 0 }); \ // __m128 __T10 = _mm_##op (__T8, __T9); \ // return __T10[0] // extern __inline float // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_min_ps (__m512 __A) // { // __MM512_REDUCE_OP (min_ps); // } // extern __inline float // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_max_ps (__m512 __A) // { // __MM512_REDUCE_OP (max_ps); // } // extern __inline float // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_min_ps (__mmask16 __U, __m512 __A) // { // __A = _mm512_mask_mov_ps (_mm512_set1_ps (__builtin_inff ()), __U, __A); // __MM512_REDUCE_OP (min_ps); // } // extern __inline float // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_max_ps (__mmask16 __U, __m512 __A) // { // __A = _mm512_mask_mov_ps (_mm512_set1_ps (-__builtin_inff ()), __U, __A); // __MM512_REDUCE_OP (max_ps); // } // #undef __MM512_REDUCE_OP // #define __MM512_REDUCE_OP(op) \ // __v4di __T1 = (__v4di) _mm512_extracti64x4_epi64 (__A, 1); \ // __v4di __T2 = (__v4di) _mm512_extracti64x4_epi64 (__A, 0); \ // __m256i __T3 = (__m256i) (__T1 op __T2); \ // __v2di __T4 = (__v2di) _mm256_extracti128_si256 (__T3, 1); \ // __v2di __T5 = (__v2di) _mm256_extracti128_si256 (__T3, 0); \ // __v2di __T6 = __T4 op __T5; \ // return __T6[0] op __T6[1] // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_add_epi64 (__m512i __A) // { // __MM512_REDUCE_OP (+); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_mul_epi64 (__m512i __A) // { // __MM512_REDUCE_OP (*); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_and_epi64 (__m512i __A) // { // __MM512_REDUCE_OP (&); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_or_epi64 (__m512i __A) // { // __MM512_REDUCE_OP (|); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_add_epi64 (__mmask8 __U, __m512i __A) // { // __A = _mm512_maskz_mov_epi64 (__U, __A); // __MM512_REDUCE_OP (+); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_mul_epi64 (__mmask8 __U, __m512i __A) // { // __A = _mm512_mask_mov_epi64 (_mm512_set1_epi64 (1LL), __U, __A); // __MM512_REDUCE_OP (*); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_and_epi64 (__mmask8 __U, __m512i __A) // { // __A = _mm512_mask_mov_epi64 (_mm512_set1_epi64 (~0LL), __U, __A); // __MM512_REDUCE_OP (&); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_or_epi64 (__mmask8 __U, __m512i __A) // { // __A = _mm512_maskz_mov_epi64 (__U, __A); // __MM512_REDUCE_OP (|); // } // #undef __MM512_REDUCE_OP // #define __MM512_REDUCE_OP(op) \ // __m512i __T1 = _mm512_shuffle_i64x2 (__A, __A, 0x4e); \ // __m512i __T2 = _mm512_##op (__A, __T1); \ // __m512i __T3 \ // = (__m512i) __builtin_shuffle ((__v8di) __T2, \ // (__v8di) { 2, 3, 0, 1, 6, 7, 4, 5 });\ // __m512i __T4 = _mm512_##op (__T2, __T3); \ // __m512i __T5 \ // = (__m512i) __builtin_shuffle ((__v8di) __T4, \ // (__v8di) { 1, 0, 3, 2, 5, 4, 7, 6 });\ // __v8di __T6 = (__v8di) _mm512_##op (__T4, __T5); \ // return __T6[0] // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_min_epi64 (__m512i __A) // { // __MM512_REDUCE_OP (min_epi64); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_max_epi64 (__m512i __A) // { // __MM512_REDUCE_OP (max_epi64); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_min_epi64 (__mmask8 __U, __m512i __A) // { // __A = _mm512_mask_mov_epi64 (_mm512_set1_epi64 (__LONG_LONG_MAX__), // __U, __A); // __MM512_REDUCE_OP (min_epi64); // } // extern __inline long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_max_epi64 (__mmask8 __U, __m512i __A) // { // __A = _mm512_mask_mov_epi64 (_mm512_set1_epi64 (-__LONG_LONG_MAX__ - 1), // __U, __A); // __MM512_REDUCE_OP (max_epi64); // } // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_min_epu64 (__m512i __A) // { // __MM512_REDUCE_OP (min_epu64); // } // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_max_epu64 (__m512i __A) // { // __MM512_REDUCE_OP (max_epu64); // } // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_min_epu64 (__mmask8 __U, __m512i __A) // { // __A = _mm512_mask_mov_epi64 (_mm512_set1_epi64 (~0LL), __U, __A); // __MM512_REDUCE_OP (min_epu64); // } // extern __inline unsigned long long // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_max_epu64 (__mmask8 __U, __m512i __A) // { // __A = _mm512_maskz_mov_epi64 (__U, __A); // __MM512_REDUCE_OP (max_epu64); // } // #undef __MM512_REDUCE_OP // #define __MM512_REDUCE_OP(op) \ // __m256d __T1 = (__m256d) _mm512_extractf64x4_pd (__A, 1); \ // __m256d __T2 = (__m256d) _mm512_extractf64x4_pd (__A, 0); \ // __m256d __T3 = __T1 op __T2; \ // __m128d __T4 = _mm256_extractf128_pd (__T3, 1); \ // __m128d __T5 = _mm256_extractf128_pd (__T3, 0); \ // __m128d __T6 = __T4 op __T5; \ // return __T6[0] op __T6[1] // extern __inline double // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_add_pd (__m512d __A) // { // __MM512_REDUCE_OP (+); // } // extern __inline double // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_mul_pd (__m512d __A) // { // __MM512_REDUCE_OP (*); // } // extern __inline double // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_add_pd (__mmask8 __U, __m512d __A) // { // __A = _mm512_maskz_mov_pd (__U, __A); // __MM512_REDUCE_OP (+); // } // extern __inline double // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_mul_pd (__mmask8 __U, __m512d __A) // { // __A = _mm512_mask_mov_pd (_mm512_set1_pd (1.0), __U, __A); // __MM512_REDUCE_OP (*); // } // #undef __MM512_REDUCE_OP // #define __MM512_REDUCE_OP(op) \ // __m256d __T1 = (__m256d) _mm512_extractf64x4_pd (__A, 1); \ // __m256d __T2 = (__m256d) _mm512_extractf64x4_pd (__A, 0); \ // __m256d __T3 = _mm256_##op (__T1, __T2); \ // __m128d __T4 = _mm256_extractf128_pd (__T3, 1); \ // __m128d __T5 = _mm256_extractf128_pd (__T3, 0); \ // __m128d __T6 = _mm_##op (__T4, __T5); \ // __m128d __T7 = (__m128d) __builtin_shuffle (__T6, (__v2di) { 1, 0 }); \ // __m128d __T8 = _mm_##op (__T6, __T7); \ // return __T8[0] // extern __inline double // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_min_pd (__m512d __A) // { // __MM512_REDUCE_OP (min_pd); // } // extern __inline double // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_reduce_max_pd (__m512d __A) // { // __MM512_REDUCE_OP (max_pd); // } // extern __inline double // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_min_pd (__mmask8 __U, __m512d __A) // { // __A = _mm512_mask_mov_pd (_mm512_set1_pd (__builtin_inf ()), __U, __A); // __MM512_REDUCE_OP (min_pd); // } // extern __inline double // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_reduce_max_pd (__mmask8 __U, __m512d __A) // { // __A = _mm512_mask_mov_pd (_mm512_set1_pd (-__builtin_inf ()), __U, __A); // __MM512_REDUCE_OP (max_pd); // } #undef __MM512_REDUCE_OP #ifdef __DISABLE_AVX512F__ #undef __DISABLE_AVX512F__ #pragma GCC pop_options #endif /* __DISABLE_AVX512F__ */ #endif /* _AVX512FINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512ifmaintrin.h000066400000000000000000000070161517770275000201040ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512IFMAINTRIN_H_INCLUDED #define _AVX512IFMAINTRIN_H_INCLUDED #ifndef __AVX512IFMA__ #pragma GCC push_options #pragma GCC target("avx512ifma") #define __DISABLE_AVX512IFMA__ #endif /* __AVX512IFMA__ */ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_madd52lo_epu64 (__m512i __X, __m512i __Y, __m512i __Z) // { // return (__m512i) __builtin_ia32_vpmadd52luq512_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) __Z, // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_madd52hi_epu64 (__m512i __X, __m512i __Y, __m512i __Z) // { // return (__m512i) __builtin_ia32_vpmadd52huq512_mask ((__v8di) __X, // (__v8di) __Y, // (__v8di) __Z, // (__mmask8) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_madd52lo_epu64 (__m512i __W, __mmask8 __M, __m512i __X, // __m512i __Y) // { // return (__m512i) __builtin_ia32_vpmadd52luq512_mask ((__v8di) __W, // (__v8di) __X, // (__v8di) __Y, // (__mmask8) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_madd52hi_epu64 (__m512i __W, __mmask8 __M, __m512i __X, // __m512i __Y) // { // return (__m512i) __builtin_ia32_vpmadd52huq512_mask ((__v8di) __W, // (__v8di) __X, // (__v8di) __Y, // (__mmask8) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_madd52lo_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z) // { // return (__m512i) __builtin_ia32_vpmadd52luq512_maskz ((__v8di) __X, // (__v8di) __Y, // (__v8di) __Z, // (__mmask8) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_madd52hi_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z) // { // return (__m512i) __builtin_ia32_vpmadd52huq512_maskz ((__v8di) __X, // (__v8di) __Y, // (__v8di) __Z, // (__mmask8) __M); // } #ifdef __DISABLE_AVX512IFMA__ #undef __DISABLE_AVX512IFMA__ #pragma GCC pop_options #endif /* __DISABLE_AVX512IFMA__ */ #endif /* _AVX512IFMAINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512ifmavlintrin.h000066400000000000000000000131231517770275000204420ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512IFMAVLINTRIN_H_INCLUDED #define _AVX512IFMAVLINTRIN_H_INCLUDED #if !defined(__AVX512VL__) || !defined(__AVX512IFMA__) #pragma GCC push_options #pragma GCC target("avx512ifma,avx512vl") #define __DISABLE_AVX512IFMAVL__ #endif /* __AVX512IFMAVL__ */ // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_madd52lo_epu64 (__m128i __X, __m128i __Y, __m128i __Z) // { // return (__m128i) __builtin_ia32_vpmadd52luq128_mask ((__v2di) __X, // (__v2di) __Y, // (__v2di) __Z, // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_madd52hi_epu64 (__m128i __X, __m128i __Y, __m128i __Z) // { // return (__m128i) __builtin_ia32_vpmadd52huq128_mask ((__v2di) __X, // (__v2di) __Y, // (__v2di) __Z, // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_madd52lo_epu64 (__m256i __X, __m256i __Y, __m256i __Z) // { // return (__m256i) __builtin_ia32_vpmadd52luq256_mask ((__v4di) __X, // (__v4di) __Y, // (__v4di) __Z, // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_madd52hi_epu64 (__m256i __X, __m256i __Y, __m256i __Z) // { // return (__m256i) __builtin_ia32_vpmadd52huq256_mask ((__v4di) __X, // (__v4di) __Y, // (__v4di) __Z, // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_madd52lo_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_vpmadd52luq128_mask ((__v2di) __W, // (__v2di) __X, // (__v2di) __Y, // (__mmask8) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_madd52hi_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_vpmadd52huq128_mask ((__v2di) __W, // (__v2di) __X, // (__v2di) __Y, // (__mmask8) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_madd52lo_epu64 (__m256i __W, __mmask8 __M, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_vpmadd52luq256_mask ((__v4di) __W, // (__v4di) __X, // (__v4di) __Y, // (__mmask8) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_madd52hi_epu64 (__m256i __W, __mmask8 __M, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_vpmadd52huq256_mask ((__v4di) __W, // (__v4di) __X, // (__v4di) __Y, // (__mmask8) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_madd52lo_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z) // { // return (__m128i) __builtin_ia32_vpmadd52luq128_maskz ((__v2di) __X, // (__v2di) __Y, // (__v2di) __Z, // (__mmask8) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_madd52hi_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z) // { // return (__m128i) __builtin_ia32_vpmadd52huq128_maskz ((__v2di) __X, // (__v2di) __Y, // (__v2di) __Z, // (__mmask8) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_madd52lo_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z) // { // return (__m256i) __builtin_ia32_vpmadd52luq256_maskz ((__v4di) __X, // (__v4di) __Y, // (__v4di) __Z, // (__mmask8) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_madd52hi_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z) // { // return (__m256i) __builtin_ia32_vpmadd52huq256_maskz ((__v4di) __X, // (__v4di) __Y, // (__v4di) __Z, // (__mmask8) __M); // } #ifdef __DISABLE_AVX512IFMAVL__ #undef __DISABLE_AVX512IFMAVL__ #pragma GCC pop_options #endif /* __DISABLE_AVX512IFMAVL__ */ #endif /* _AVX512IFMAVLINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512pfintrin.h000066400000000000000000000240601517770275000175730ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512PFINTRIN_H_INCLUDED #define _AVX512PFINTRIN_H_INCLUDED #ifndef __AVX512PF__ #pragma GCC push_options #pragma GCC target("avx512pf") #define __DISABLE_AVX512PF__ #endif /* __AVX512PF__ */ /* Internal data types for implementing the intrinsics. */ typedef long long __v8di __attribute__ ((__vector_size__ (64))); typedef int __v16si __attribute__ ((__vector_size__ (64))); /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef long long __m512i __attribute__ ((__vector_size__ (64), __may_alias__)); typedef unsigned char __mmask8; typedef unsigned short __mmask16; #ifdef __OPTIMIZE__ extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_prefetch_i32gather_pd (__m256i __index, void const *__addr, int __scale, int __hint) { __builtin_ia32_gatherpfdpd ((__mmask8) 0xFF, (__v8si) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_prefetch_i32gather_ps (__m512i __index, void const *__addr, int __scale, int __hint) { __builtin_ia32_gatherpfdps ((__mmask16) 0xFFFF, (__v16si) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_prefetch_i32gather_pd (__m256i __index, __mmask8 __mask, void const *__addr, int __scale, int __hint) { __builtin_ia32_gatherpfdpd (__mask, (__v8si) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_prefetch_i32gather_ps (__m512i __index, __mmask16 __mask, void const *__addr, int __scale, int __hint) { __builtin_ia32_gatherpfdps (__mask, (__v16si) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_prefetch_i64gather_pd (__m512i __index, void const *__addr, int __scale, int __hint) { __builtin_ia32_gatherpfqpd ((__mmask8) 0xFF, (__v8di) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_prefetch_i64gather_ps (__m512i __index, void const *__addr, int __scale, int __hint) { __builtin_ia32_gatherpfqps ((__mmask8) 0xFF, (__v8di) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_prefetch_i64gather_pd (__m512i __index, __mmask8 __mask, void const *__addr, int __scale, int __hint) { __builtin_ia32_gatherpfqpd (__mask, (__v8di) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_prefetch_i64gather_ps (__m512i __index, __mmask8 __mask, void const *__addr, int __scale, int __hint) { __builtin_ia32_gatherpfqps (__mask, (__v8di) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_prefetch_i32scatter_pd (void *__addr, __m256i __index, int __scale, int __hint) { __builtin_ia32_scatterpfdpd ((__mmask8) 0xFF, (__v8si) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_prefetch_i32scatter_ps (void *__addr, __m512i __index, int __scale, int __hint) { __builtin_ia32_scatterpfdps ((__mmask16) 0xFFFF, (__v16si) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_prefetch_i32scatter_pd (void *__addr, __mmask8 __mask, __m256i __index, int __scale, int __hint) { __builtin_ia32_scatterpfdpd (__mask, (__v8si) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_prefetch_i32scatter_ps (void *__addr, __mmask16 __mask, __m512i __index, int __scale, int __hint) { __builtin_ia32_scatterpfdps (__mask, (__v16si) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_prefetch_i64scatter_pd (void *__addr, __m512i __index, int __scale, int __hint) { __builtin_ia32_scatterpfqpd ((__mmask8) 0xFF, (__v8di) __index,__addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_prefetch_i64scatter_ps (void *__addr, __m512i __index, int __scale, int __hint) { __builtin_ia32_scatterpfqps ((__mmask8) 0xFF, (__v8di) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_prefetch_i64scatter_pd (void *__addr, __mmask8 __mask, __m512i __index, int __scale, int __hint) { __builtin_ia32_scatterpfqpd (__mask, (__v8di) __index, __addr, __scale, __hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_prefetch_i64scatter_ps (void *__addr, __mmask8 __mask, __m512i __index, int __scale, int __hint) { __builtin_ia32_scatterpfqps (__mask, (__v8di) __index, __addr, __scale, __hint); } #else #define _mm512_prefetch_i32gather_pd(INDEX, ADDR, SCALE, HINT) \ __builtin_ia32_gatherpfdpd ((__mmask8)0xFF, (__v8si)(__m256i) (INDEX), \ (void const *) (ADDR), (int) (SCALE), \ (int) (HINT)) #define _mm512_prefetch_i32gather_ps(INDEX, ADDR, SCALE, HINT) \ __builtin_ia32_gatherpfdps ((__mmask16)0xFFFF, (__v16si)(__m512i) (INDEX), \ (void const *) (ADDR), (int) (SCALE), \ (int) (HINT)) #define _mm512_mask_prefetch_i32gather_pd(INDEX, MASK, ADDR, SCALE, HINT) \ __builtin_ia32_gatherpfdpd ((__mmask8) (MASK), (__v8si)(__m256i) (INDEX), \ (void const *) (ADDR), (int) (SCALE), \ (int) (HINT)) #define _mm512_mask_prefetch_i32gather_ps(INDEX, MASK, ADDR, SCALE, HINT) \ __builtin_ia32_gatherpfdps ((__mmask16) (MASK), (__v16si)(__m512i) (INDEX),\ (void const *) (ADDR), (int) (SCALE), \ (int) (HINT)) #define _mm512_prefetch_i64gather_pd(INDEX, ADDR, SCALE, HINT) \ __builtin_ia32_gatherpfqpd ((__mmask8)0xFF, (__v8di)(__m512i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_prefetch_i64gather_ps(INDEX, ADDR, SCALE, HINT) \ __builtin_ia32_gatherpfqps ((__mmask8)0xFF, (__v8di)(__m512i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_mask_prefetch_i64gather_pd(INDEX, MASK, ADDR, SCALE, HINT) \ __builtin_ia32_gatherpfqpd ((__mmask8) (MASK), (__v8di)(__m512i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_mask_prefetch_i64gather_ps(INDEX, MASK, ADDR, SCALE, HINT) \ __builtin_ia32_gatherpfqps ((__mmask8) (MASK), (__v8di)(__m512i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_prefetch_i32scatter_pd(ADDR, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfdpd ((__mmask8)0xFF, (__v8si)(__m256i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_prefetch_i32scatter_ps(ADDR, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfdps ((__mmask16)0xFFFF, (__v16si)(__m512i) (INDEX),\ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_mask_prefetch_i32scatter_pd(ADDR, MASK, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfdpd ((__mmask8) (MASK), (__v8si)(__m256i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_mask_prefetch_i32scatter_ps(ADDR, MASK, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfdps ((__mmask16) (MASK), \ (__v16si)(__m512i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_prefetch_i64scatter_pd(ADDR, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfqpd ((__mmask8)0xFF, (__v8di)(__m512i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_prefetch_i64scatter_ps(ADDR, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfqps ((__mmask8)0xFF, (__v8di)(__m512i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_mask_prefetch_i64scatter_pd(ADDR, MASK, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfqpd ((__mmask8) (MASK), (__v8di)(__m512i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #define _mm512_mask_prefetch_i64scatter_ps(ADDR, MASK, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfqps ((__mmask8) (MASK), (__v8di)(__m512i) (INDEX), \ (void *) (ADDR), (int) (SCALE), (int) (HINT)) #endif #ifdef __DISABLE_AVX512PF__ #undef __DISABLE_AVX512PF__ #pragma GCC pop_options #endif /* __DISABLE_AVX512PF__ */ #endif /* _AVX512PFINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vbmi2intrin.h000066400000000000000000000503161517770275000202100ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef __AVX512VBMI2INTRIN_H_INCLUDED #define __AVX512VBMI2INTRIN_H_INCLUDED #if !defined(__AVX512VBMI2__) #pragma GCC push_options #pragma GCC target("avx512vbmi2") #define __DISABLE_AVX512VBMI2__ #endif /* __AVX512VBMI2__ */ #ifdef __OPTIMIZE__ extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_shrdi_epi16 (__m512i __A, __m512i __B, int __C) { return (__m512i) __builtin_ia32_vpshrd_v32hi ((__v32hi)__A, (__v32hi) __B, __C); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_shrdi_epi32 (__m512i __A, __m512i __B, int __C) { return (__m512i) __builtin_ia32_vpshrd_v16si ((__v16si)__A, (__v16si) __B, __C); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_shrdi_epi32 (__m512i __A, __mmask16 __B, __m512i __C, __m512i __D, int __E) { return (__m512i)__builtin_ia32_vpshrd_v16si_mask ((__v16si)__C, (__v16si) __D, __E, (__v16si) __A, (__mmask16)__B); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_maskz_shrdi_epi32 (__mmask16 __A, __m512i __B, __m512i __C, int __D) { return (__m512i)__builtin_ia32_vpshrd_v16si_mask ((__v16si)__B, (__v16si) __C, __D, (__v16si) _mm512_setzero_si512 (), (__mmask16)__A); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_shrdi_epi64 (__m512i __A, __m512i __B, int __C) { return (__m512i) __builtin_ia32_vpshrd_v8di ((__v8di)__A, (__v8di) __B, __C); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_shrdi_epi64 (__m512i __A, __mmask8 __B, __m512i __C, __m512i __D, int __E) { return (__m512i)__builtin_ia32_vpshrd_v8di_mask ((__v8di)__C, (__v8di) __D, __E, (__v8di) __A, (__mmask8)__B); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_maskz_shrdi_epi64 (__mmask8 __A, __m512i __B, __m512i __C, int __D) { return (__m512i)__builtin_ia32_vpshrd_v8di_mask ((__v8di)__B, (__v8di) __C, __D, (__v8di) _mm512_setzero_si512 (), (__mmask8)__A); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_shldi_epi16 (__m512i __A, __m512i __B, int __C) { return (__m512i) __builtin_ia32_vpshld_v32hi ((__v32hi)__A, (__v32hi) __B, __C); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_shldi_epi32 (__m512i __A, __m512i __B, int __C) { return (__m512i) __builtin_ia32_vpshld_v16si ((__v16si)__A, (__v16si) __B, __C); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_shldi_epi32 (__m512i __A, __mmask16 __B, __m512i __C, __m512i __D, int __E) { return (__m512i)__builtin_ia32_vpshld_v16si_mask ((__v16si)__C, (__v16si) __D, __E, (__v16si) __A, (__mmask16)__B); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_maskz_shldi_epi32 (__mmask16 __A, __m512i __B, __m512i __C, int __D) { return (__m512i)__builtin_ia32_vpshld_v16si_mask ((__v16si)__B, (__v16si) __C, __D, (__v16si) _mm512_setzero_si512 (), (__mmask16)__A); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_shldi_epi64 (__m512i __A, __m512i __B, int __C) { return (__m512i) __builtin_ia32_vpshld_v8di ((__v8di)__A, (__v8di) __B, __C); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_shldi_epi64 (__m512i __A, __mmask8 __B, __m512i __C, __m512i __D, int __E) { return (__m512i)__builtin_ia32_vpshld_v8di_mask ((__v8di)__C, (__v8di) __D, __E, (__v8di) __A, (__mmask8)__B); } extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_maskz_shldi_epi64 (__mmask8 __A, __m512i __B, __m512i __C, int __D) { return (__m512i)__builtin_ia32_vpshld_v8di_mask ((__v8di)__B, (__v8di) __C, __D, (__v8di) _mm512_setzero_si512 (), (__mmask8)__A); } #else #define _mm512_shrdi_epi16(A, B, C) \ ((__m512i) __builtin_ia32_vpshrd_v32hi ((__v32hi)(__m512i)(A), \ (__v32hi)(__m512i)(B),(int)(C))) #define _mm512_shrdi_epi32(A, B, C) \ ((__m512i) __builtin_ia32_vpshrd_v16si ((__v16si)(__m512i)(A), \ (__v16si)(__m512i)(B),(int)(C))) #define _mm512_mask_shrdi_epi32(A, B, C, D, E) \ ((__m512i) __builtin_ia32_vpshrd_v16si_mask ((__v16si)(__m512i)(C), \ (__v16si)(__m512i)(D), \ (int)(E), \ (__v16si)(__m512i)(A), \ (__mmask16)(B))) #define _mm512_maskz_shrdi_epi32(A, B, C, D) \ ((__m512i) \ __builtin_ia32_vpshrd_v16si_mask ((__v16si)(__m512i)(B), \ (__v16si)(__m512i)(C),(int)(D), \ (__v16si)(__m512i)_mm512_setzero_si512 (), \ (__mmask16)(A))) #define _mm512_shrdi_epi64(A, B, C) \ ((__m512i) __builtin_ia32_vpshrd_v8di ((__v8di)(__m512i)(A), \ (__v8di)(__m512i)(B),(int)(C))) #define _mm512_mask_shrdi_epi64(A, B, C, D, E) \ ((__m512i) __builtin_ia32_vpshrd_v8di_mask ((__v8di)(__m512i)(C), \ (__v8di)(__m512i)(D), (int)(E), \ (__v8di)(__m512i)(A), \ (__mmask8)(B))) #define _mm512_maskz_shrdi_epi64(A, B, C, D) \ ((__m512i) \ __builtin_ia32_vpshrd_v8di_mask ((__v8di)(__m512i)(B), \ (__v8di)(__m512i)(C),(int)(D), \ (__v8di)(__m512i)_mm512_setzero_si512 (), \ (__mmask8)(A))) #define _mm512_shldi_epi16(A, B, C) \ ((__m512i) __builtin_ia32_vpshld_v32hi ((__v32hi)(__m512i)(A), \ (__v32hi)(__m512i)(B),(int)(C))) #define _mm512_shldi_epi32(A, B, C) \ ((__m512i) __builtin_ia32_vpshld_v16si ((__v16si)(__m512i)(A), \ (__v16si)(__m512i)(B),(int)(C))) #define _mm512_mask_shldi_epi32(A, B, C, D, E) \ ((__m512i) __builtin_ia32_vpshld_v16si_mask ((__v16si)(__m512i)(C), \ (__v16si)(__m512i)(D), \ (int)(E), \ (__v16si)(__m512i)(A), \ (__mmask16)(B))) #define _mm512_maskz_shldi_epi32(A, B, C, D) \ ((__m512i) \ __builtin_ia32_vpshld_v16si_mask ((__v16si)(__m512i)(B), \ (__v16si)(__m512i)(C),(int)(D), \ (__v16si)(__m512i)_mm512_setzero_si512 (), \ (__mmask16)(A))) #define _mm512_shldi_epi64(A, B, C) \ ((__m512i) __builtin_ia32_vpshld_v8di ((__v8di)(__m512i)(A), \ (__v8di)(__m512i)(B), (int)(C))) #define _mm512_mask_shldi_epi64(A, B, C, D, E) \ ((__m512i) __builtin_ia32_vpshld_v8di_mask ((__v8di)(__m512i)(C), \ (__v8di)(__m512i)(D), (int)(E), \ (__v8di)(__m512i)(A), \ (__mmask8)(B))) #define _mm512_maskz_shldi_epi64(A, B, C, D) \ ((__m512i) \ __builtin_ia32_vpshld_v8di_mask ((__v8di)(__m512i)(B), \ (__v8di)(__m512i)(C),(int)(D), \ (__v8di)(__m512i)_mm512_setzero_si512 (), \ (__mmask8)(A))) #endif // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shrdv_epi16 (__m512i __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vpshrdv_v32hi ((__v32hi)__A, (__v32hi) __B, // (__v32hi) __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shrdv_epi32 (__m512i __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vpshrdv_v16si ((__v16si)__A, (__v16si) __B, // (__v16si) __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shrdv_epi32 (__m512i __A, __mmask16 __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshrdv_v16si_mask ((__v16si)__A, // (__v16si) __C, (__v16si) __D, (__mmask16)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shrdv_epi32 (__mmask16 __A, __m512i __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshrdv_v16si_maskz ((__v16si)__B, // (__v16si) __C, (__v16si) __D, (__mmask16)__A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shrdv_epi64 (__m512i __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vpshrdv_v8di ((__v8di)__A, (__v8di) __B, // (__v8di) __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shrdv_epi64 (__m512i __A, __mmask8 __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshrdv_v8di_mask ((__v8di)__A, (__v8di) __C, // (__v8di) __D, (__mmask8)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shrdv_epi64 (__mmask8 __A, __m512i __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshrdv_v8di_maskz ((__v8di)__B, (__v8di) __C, // (__v8di) __D, (__mmask8)__A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shldv_epi16 (__m512i __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vpshldv_v32hi ((__v32hi)__A, (__v32hi) __B, // (__v32hi) __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shldv_epi32 (__m512i __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vpshldv_v16si ((__v16si)__A, (__v16si) __B, // (__v16si) __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shldv_epi32 (__m512i __A, __mmask16 __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshldv_v16si_mask ((__v16si)__A, // (__v16si) __C, (__v16si) __D, (__mmask16)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shldv_epi32 (__mmask16 __A, __m512i __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshldv_v16si_maskz ((__v16si)__B, // (__v16si) __C, (__v16si) __D, (__mmask16)__A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_shldv_epi64 (__m512i __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vpshldv_v8di ((__v8di)__A, (__v8di) __B, // (__v8di) __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shldv_epi64 (__m512i __A, __mmask8 __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshldv_v8di_mask ((__v8di)__A, (__v8di) __C, // (__v8di) __D, (__mmask8)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shldv_epi64 (__mmask8 __A, __m512i __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshldv_v8di_maskz ((__v8di)__B, (__v8di) __C, // (__v8di) __D, (__mmask8)__A); // } // #ifdef __DISABLE_AVX512VBMI2__ // #undef __DISABLE_AVX512VBMI2__ // #pragma GCC pop_options // #endif /* __DISABLE_AVX512VBMI2__ */ // #if !defined(__AVX512VBMI2__) || !defined(__AVX512BW__) // #pragma GCC push_options // #pragma GCC target("avx512vbmi2,avx512bw") // #define __DISABLE_AVX512VBMI2BW__ // #endif /* __AVX512VBMI2BW__ */ // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compress_epi8 (__m512i __A, __mmask64 __B, __m512i __C) // { // return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi)__C, // (__v64qi)__A, (__mmask64)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_compress_epi8 (__mmask64 __A, __m512i __B) // { // return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi)__B, // (__v64qi)_mm512_setzero_si512 (), (__mmask64)__A); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compressstoreu_epi8 (void * __A, __mmask64 __B, __m512i __C) // { // __builtin_ia32_compressstoreuqi512_mask ((__v64qi *) __A, (__v64qi) __C, // (__mmask64) __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compress_epi16 (__m512i __A, __mmask32 __B, __m512i __C) // { // return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi)__C, // (__v32hi)__A, (__mmask32)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_compress_epi16 (__mmask32 __A, __m512i __B) // { // return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi)__B, // (__v32hi)_mm512_setzero_si512 (), (__mmask32)__A); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_compressstoreu_epi16 (void * __A, __mmask32 __B, __m512i __C) // { // __builtin_ia32_compressstoreuhi512_mask ((__v32hi *) __A, (__v32hi) __C, // (__mmask32) __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expand_epi8 (__m512i __A, __mmask64 __B, __m512i __C) // { // return (__m512i) __builtin_ia32_expandqi512_mask ((__v64qi) __C, // (__v64qi) __A, // (__mmask64) __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expand_epi8 (__mmask64 __A, __m512i __B) // { // return (__m512i) __builtin_ia32_expandqi512_maskz ((__v64qi) __B, // (__v64qi) _mm512_setzero_si512 (), (__mmask64) __A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expandloadu_epi8 (__m512i __A, __mmask64 __B, const void * __C) // { // return (__m512i) __builtin_ia32_expandloadqi512_mask ((const __v64qi *) __C, // (__v64qi) __A, (__mmask64) __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expandloadu_epi8 (__mmask64 __A, const void * __B) // { // return (__m512i) __builtin_ia32_expandloadqi512_maskz ((const __v64qi *) __B, // (__v64qi) _mm512_setzero_si512 (), (__mmask64) __A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expand_epi16 (__m512i __A, __mmask32 __B, __m512i __C) // { // return (__m512i) __builtin_ia32_expandhi512_mask ((__v32hi) __C, // (__v32hi) __A, // (__mmask32) __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expand_epi16 (__mmask32 __A, __m512i __B) // { // return (__m512i) __builtin_ia32_expandhi512_maskz ((__v32hi) __B, // (__v32hi) _mm512_setzero_si512 (), (__mmask32) __A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_expandloadu_epi16 (__m512i __A, __mmask32 __B, const void * __C) // { // return (__m512i) __builtin_ia32_expandloadhi512_mask ((const __v32hi *) __C, // (__v32hi) __A, (__mmask32) __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_expandloadu_epi16 (__mmask32 __A, const void * __B) // { // return (__m512i) __builtin_ia32_expandloadhi512_maskz ((const __v32hi *) __B, // (__v32hi) _mm512_setzero_si512 (), (__mmask32) __A); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shrdi_epi16 (__m512i __A, __mmask32 __B, __m512i __C, __m512i __D, // int __E) // { // return (__m512i)__builtin_ia32_vpshrd_v32hi_mask ((__v32hi)__C, // (__v32hi) __D, __E, (__v32hi) __A, (__mmask32)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shrdi_epi16 (__mmask32 __A, __m512i __B, __m512i __C, int __D) // { // return (__m512i)__builtin_ia32_vpshrd_v32hi_mask ((__v32hi)__B, // (__v32hi) __C, __D, (__v32hi) _mm512_setzero_si512 (), (__mmask32)__A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shldi_epi16 (__m512i __A, __mmask32 __B, __m512i __C, __m512i __D, // int __E) // { // return (__m512i)__builtin_ia32_vpshld_v32hi_mask ((__v32hi)__C, // (__v32hi) __D, __E, (__v32hi) __A, (__mmask32)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shldi_epi16 (__mmask32 __A, __m512i __B, __m512i __C, int __D) // { // return (__m512i)__builtin_ia32_vpshld_v32hi_mask ((__v32hi)__B, // (__v32hi) __C, __D, (__v32hi) _mm512_setzero_si512 (), (__mmask32)__A); // } // #else // #define _mm512_mask_shrdi_epi16(A, B, C, D, E) \ // ((__m512i) __builtin_ia32_vpshrd_v32hi_mask ((__v32hi)(__m512i)(C), \ // (__v32hi)(__m512i)(D), \ // (int)(E), \ // (__v32hi)(__m512i)(A), \ // (__mmask32)(B))) // #define _mm512_maskz_shrdi_epi16(A, B, C, D) \ // ((__m512i) \ // __builtin_ia32_vpshrd_v32hi_mask ((__v32hi)(__m512i)(B), \ // (__v32hi)(__m512i)(C),(int)(D), \ // (__v32hi)(__m512i)_mm512_setzero_si512 (), \ // (__mmask32)(A))) // #define _mm512_mask_shldi_epi16(A, B, C, D, E) \ // ((__m512i) __builtin_ia32_vpshld_v32hi_mask ((__v32hi)(__m512i)(C), \ // (__v32hi)(__m512i)(D), \ // (int)(E), \ // (__v32hi)(__m512i)(A), \ // (__mmask32)(B))) // #define _mm512_maskz_shldi_epi16(A, B, C, D) \ // ((__m512i) \ // __builtin_ia32_vpshld_v32hi_mask ((__v32hi)(__m512i)(B), \ // (__v32hi)(__m512i)(C),(int)(D), \ // (__v32hi)(__m512i)_mm512_setzero_si512 (), \ // (__mmask32)(A))) // #endif // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shrdv_epi16 (__m512i __A, __mmask32 __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshrdv_v32hi_mask ((__v32hi)__A, // (__v32hi) __C, (__v32hi) __D, (__mmask32)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shrdv_epi16 (__mmask32 __A, __m512i __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshrdv_v32hi_maskz ((__v32hi)__B, // (__v32hi) __C, (__v32hi) __D, (__mmask32)__A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_shldv_epi16 (__m512i __A, __mmask32 __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshldv_v32hi_mask ((__v32hi)__A, // (__v32hi) __C, (__v32hi) __D, (__mmask32)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_shldv_epi16 (__mmask32 __A, __m512i __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpshldv_v32hi_maskz ((__v32hi)__B, // (__v32hi) __C, (__v32hi) __D, (__mmask32)__A); // } #ifdef __DISABLE_AVX512VBMI2BW__ #undef __DISABLE_AVX512VBMI2BW__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VBMI2BW__ */ #endif /* __AVX512VBMI2INTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vbmi2vlintrin.h000066400000000000000000001155561517770275000205620ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512VBMI2VLINTRIN_H_INCLUDED #define _AVX512VBMI2VLINTRIN_H_INCLUDED #if !defined(__AVX512VL__) || !defined(__AVX512VBMI2__) #pragma GCC push_options #pragma GCC target("avx512vbmi2,avx512vl") #define __DISABLE_AVX512VBMI2VL__ #endif /* __AVX512VBMIVL__ */ // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compress_epi8 (__m128i __A, __mmask16 __B, __m128i __C) // { // return (__m128i) __builtin_ia32_compressqi128_mask ((__v16qi)__C, // (__v16qi)__A, (__mmask16)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_compress_epi8 (__mmask16 __A, __m128i __B) // { // return (__m128i) __builtin_ia32_compressqi128_mask ((__v16qi) __B, // (__v16qi) _mm_setzero_si128 (), (__mmask16) __A); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compressstoreu_epi16 (void * __A, __mmask16 __B, __m256i __C) // { // __builtin_ia32_compressstoreuhi256_mask ((__v16hi *) __A, (__v16hi) __C, // (__mmask16) __B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compress_epi16 (__m128i __A, __mmask8 __B, __m128i __C) // { // return (__m128i) __builtin_ia32_compresshi128_mask ((__v8hi)__C, (__v8hi)__A, // (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_compress_epi16 (__mmask8 __A, __m128i __B) // { // return (__m128i) __builtin_ia32_compresshi128_mask ((__v8hi) __B, // (__v8hi) _mm_setzero_si128 (), (__mmask8) __A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compress_epi16 (__m256i __A, __mmask16 __B, __m256i __C) // { // return (__m256i) __builtin_ia32_compresshi256_mask ((__v16hi)__C, // (__v16hi)__A, (__mmask16)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_compress_epi16 (__mmask16 __A, __m256i __B) // { // return (__m256i) __builtin_ia32_compresshi256_mask ((__v16hi) __B, // (__v16hi) _mm256_setzero_si256 (), (__mmask16) __A); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compressstoreu_epi8 (void * __A, __mmask16 __B, __m128i __C) // { // __builtin_ia32_compressstoreuqi128_mask ((__v16qi *) __A, (__v16qi) __C, // (__mmask16) __B); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compressstoreu_epi16 (void * __A, __mmask8 __B, __m128i __C) // { // __builtin_ia32_compressstoreuhi128_mask ((__v8hi *) __A, (__v8hi) __C, // (__mmask8) __B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expand_epi8 (__m128i __A, __mmask16 __B, __m128i __C) // { // return (__m128i) __builtin_ia32_expandqi128_mask ((__v16qi) __C, // (__v16qi) __A, // (__mmask16) __B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expand_epi8 (__mmask16 __A, __m128i __B) // { // return (__m128i) __builtin_ia32_expandqi128_maskz ((__v16qi) __B, // (__v16qi) _mm_setzero_si128 (), (__mmask16) __A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expandloadu_epi8 (__m128i __A, __mmask16 __B, const void * __C) // { // return (__m128i) __builtin_ia32_expandloadqi128_mask ((const __v16qi *) __C, // (__v16qi) __A, (__mmask16) __B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expandloadu_epi8 (__mmask16 __A, const void * __B) // { // return (__m128i) __builtin_ia32_expandloadqi128_maskz ((const __v16qi *) __B, // (__v16qi) _mm_setzero_si128 (), (__mmask16) __A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expand_epi16 (__m128i __A, __mmask8 __B, __m128i __C) // { // return (__m128i) __builtin_ia32_expandhi128_mask ((__v8hi) __C, // (__v8hi) __A, // (__mmask8) __B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expand_epi16 (__mmask8 __A, __m128i __B) // { // return (__m128i) __builtin_ia32_expandhi128_maskz ((__v8hi) __B, // (__v8hi) _mm_setzero_si128 (), (__mmask8) __A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expandloadu_epi16 (__m128i __A, __mmask8 __B, const void * __C) // { // return (__m128i) __builtin_ia32_expandloadhi128_mask ((const __v8hi *) __C, // (__v8hi) __A, (__mmask8) __B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expandloadu_epi16 (__mmask8 __A, const void * __B) // { // return (__m128i) __builtin_ia32_expandloadhi128_maskz ((const __v8hi *) __B, // (__v8hi) _mm_setzero_si128 (), (__mmask8) __A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expand_epi16 (__m256i __A, __mmask16 __B, __m256i __C) // { // return (__m256i) __builtin_ia32_expandhi256_mask ((__v16hi) __C, // (__v16hi) __A, // (__mmask16) __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expand_epi16 (__mmask16 __A, __m256i __B) // { // return (__m256i) __builtin_ia32_expandhi256_maskz ((__v16hi) __B, // (__v16hi) _mm256_setzero_si256 (), (__mmask16) __A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expandloadu_epi16 (__m256i __A, __mmask16 __B, const void * __C) // { // return (__m256i) __builtin_ia32_expandloadhi256_mask ((const __v16hi *) __C, // (__v16hi) __A, (__mmask16) __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expandloadu_epi16 (__mmask16 __A, const void * __B) // { // return (__m256i) __builtin_ia32_expandloadhi256_maskz ((const __v16hi *) __B, // (__v16hi) _mm256_setzero_si256 (), (__mmask16) __A); // } // #ifdef __OPTIMIZE__ // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shrdi_epi16 (__m256i __A, __m256i __B, int __C) // { // return (__m256i) __builtin_ia32_vpshrd_v16hi ((__v16hi)__A, (__v16hi) __B, // __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shrdi_epi16 (__m256i __A, __mmask16 __B, __m256i __C, __m256i __D, // int __E) // { // return (__m256i)__builtin_ia32_vpshrd_v16hi_mask ((__v16hi)__C, // (__v16hi) __D, __E, (__v16hi) __A, (__mmask16)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shrdi_epi16 (__mmask16 __A, __m256i __B, __m256i __C, int __D) // { // return (__m256i)__builtin_ia32_vpshrd_v16hi_mask ((__v16hi)__B, // (__v16hi) __C, __D, (__v16hi) _mm256_setzero_si256 (), (__mmask16)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shrdi_epi32 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D, // int __E) // { // return (__m256i)__builtin_ia32_vpshrd_v8si_mask ((__v8si)__C, (__v8si) __D, // __E, (__v8si) __A, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shrdi_epi32 (__mmask8 __A, __m256i __B, __m256i __C, int __D) // { // return (__m256i)__builtin_ia32_vpshrd_v8si_mask ((__v8si)__B, (__v8si) __C, // __D, (__v8si) _mm256_setzero_si256 (), (__mmask8)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shrdi_epi32 (__m256i __A, __m256i __B, int __C) // { // return (__m256i) __builtin_ia32_vpshrd_v8si ((__v8si)__A, (__v8si) __B, __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shrdi_epi64 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D, // int __E) // { // return (__m256i)__builtin_ia32_vpshrd_v4di_mask ((__v4di)__C, (__v4di) __D, // __E, (__v4di) __A, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shrdi_epi64 (__mmask8 __A, __m256i __B, __m256i __C, int __D) // { // return (__m256i)__builtin_ia32_vpshrd_v4di_mask ((__v4di)__B, (__v4di) __C, // __D, (__v4di) _mm256_setzero_si256 (), (__mmask8)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shrdi_epi64 (__m256i __A, __m256i __B, int __C) // { // return (__m256i) __builtin_ia32_vpshrd_v4di ((__v4di)__A, (__v4di) __B, __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shrdi_epi16 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D, // int __E) // { // return (__m128i)__builtin_ia32_vpshrd_v8hi_mask ((__v8hi)__C, (__v8hi) __D, // __E, (__v8hi) __A, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shrdi_epi16 (__mmask8 __A, __m128i __B, __m128i __C, int __D) // { // return (__m128i)__builtin_ia32_vpshrd_v8hi_mask ((__v8hi)__B, (__v8hi) __C, // __D, (__v8hi) _mm_setzero_si128 (), (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shrdi_epi16 (__m128i __A, __m128i __B, int __C) // { // return (__m128i) __builtin_ia32_vpshrd_v8hi ((__v8hi)__A, (__v8hi) __B, __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shrdi_epi32 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D, // int __E) // { // return (__m128i)__builtin_ia32_vpshrd_v4si_mask ((__v4si)__C, (__v4si) __D, // __E, (__v4si) __A, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shrdi_epi32 (__mmask8 __A, __m128i __B, __m128i __C, int __D) // { // return (__m128i)__builtin_ia32_vpshrd_v4si_mask ((__v4si)__B, (__v4si) __C, // __D, (__v4si) _mm_setzero_si128 (), (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shrdi_epi32 (__m128i __A, __m128i __B, int __C) // { // return (__m128i) __builtin_ia32_vpshrd_v4si ((__v4si)__A, (__v4si) __B, __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shrdi_epi64 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D, // int __E) // { // return (__m128i)__builtin_ia32_vpshrd_v2di_mask ((__v2di)__C, (__v2di) __D, // __E, (__v2di) __A, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shrdi_epi64 (__mmask8 __A, __m128i __B, __m128i __C, int __D) // { // return (__m128i)__builtin_ia32_vpshrd_v2di_mask ((__v2di)__B, (__v2di) __C, // __D, (__v2di) _mm_setzero_si128 (), (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shrdi_epi64 (__m128i __A, __m128i __B, int __C) // { // return (__m128i) __builtin_ia32_vpshrd_v2di ((__v2di)__A, (__v2di) __B, __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shldi_epi16 (__m256i __A, __m256i __B, int __C) // { // return (__m256i) __builtin_ia32_vpshld_v16hi ((__v16hi)__A, (__v16hi) __B, // __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shldi_epi16 (__m256i __A, __mmask16 __B, __m256i __C, __m256i __D, // int __E) // { // return (__m256i)__builtin_ia32_vpshld_v16hi_mask ((__v16hi)__C, // (__v16hi) __D, __E, (__v16hi) __A, (__mmask16)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shldi_epi16 (__mmask16 __A, __m256i __B, __m256i __C, int __D) // { // return (__m256i)__builtin_ia32_vpshld_v16hi_mask ((__v16hi)__B, // (__v16hi) __C, __D, (__v16hi) _mm256_setzero_si256 (), (__mmask16)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shldi_epi32 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D, // int __E) // { // return (__m256i)__builtin_ia32_vpshld_v8si_mask ((__v8si)__C, (__v8si) __D, // __E, (__v8si) __A, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shldi_epi32 (__mmask8 __A, __m256i __B, __m256i __C, int __D) // { // return (__m256i)__builtin_ia32_vpshld_v8si_mask ((__v8si)__B, (__v8si) __C, // __D, (__v8si) _mm256_setzero_si256 (), (__mmask8)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shldi_epi32 (__m256i __A, __m256i __B, int __C) // { // return (__m256i) __builtin_ia32_vpshld_v8si ((__v8si)__A, (__v8si) __B, __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shldi_epi64 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D, // int __E) // { // return (__m256i)__builtin_ia32_vpshld_v4di_mask ((__v4di)__C, (__v4di) __D, // __E, (__v4di) __A, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shldi_epi64 (__mmask8 __A, __m256i __B, __m256i __C, int __D) // { // return (__m256i)__builtin_ia32_vpshld_v4di_mask ((__v4di)__B, (__v4di) __C, // __D, (__v4di) _mm256_setzero_si256 (), (__mmask8)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shldi_epi64 (__m256i __A, __m256i __B, int __C) // { // return (__m256i) __builtin_ia32_vpshld_v4di ((__v4di)__A, (__v4di) __B, __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shldi_epi16 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D, // int __E) // { // return (__m128i)__builtin_ia32_vpshld_v8hi_mask ((__v8hi)__C, (__v8hi) __D, // __E, (__v8hi) __A, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shldi_epi16 (__mmask8 __A, __m128i __B, __m128i __C, int __D) // { // return (__m128i)__builtin_ia32_vpshld_v8hi_mask ((__v8hi)__B, (__v8hi) __C, // __D, (__v8hi) _mm_setzero_si128 (), (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shldi_epi16 (__m128i __A, __m128i __B, int __C) // { // return (__m128i) __builtin_ia32_vpshld_v8hi ((__v8hi)__A, (__v8hi) __B, __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shldi_epi32 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D, // int __E) // { // return (__m128i)__builtin_ia32_vpshld_v4si_mask ((__v4si)__C, (__v4si) __D, // __E, (__v4si) __A, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shldi_epi32 (__mmask8 __A, __m128i __B, __m128i __C, int __D) // { // return (__m128i)__builtin_ia32_vpshld_v4si_mask ((__v4si)__B, (__v4si) __C, // __D, (__v4si) _mm_setzero_si128 (), (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shldi_epi32 (__m128i __A, __m128i __B, int __C) // { // return (__m128i) __builtin_ia32_vpshld_v4si ((__v4si)__A, (__v4si) __B, __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shldi_epi64 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D, // int __E) // { // return (__m128i)__builtin_ia32_vpshld_v2di_mask ((__v2di)__C, (__v2di) __D, // __E, (__v2di) __A, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shldi_epi64 (__mmask8 __A, __m128i __B, __m128i __C, int __D) // { // return (__m128i)__builtin_ia32_vpshld_v2di_mask ((__v2di)__B, (__v2di) __C, // __D, (__v2di) _mm_setzero_si128 (), (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shldi_epi64 (__m128i __A, __m128i __B, int __C) // { // return (__m128i) __builtin_ia32_vpshld_v2di ((__v2di)__A, (__v2di) __B, __C); // } // #else // #define _mm256_shrdi_epi16(A, B, C) \ // ((__m256i) __builtin_ia32_vpshrd_v16hi ((__v16hi)(__m256i)(A), \ // (__v16hi)(__m256i)(B),(int)(C))) // #define _mm256_mask_shrdi_epi16(A, B, C, D, E) \ // ((__m256i) __builtin_ia32_vpshrd_v16hi_mask ((__v16hi)(__m256i)(C), \ // (__v16hi)(__m256i)(D), \ // (int)(E), \ // (__v16hi)(__m256i)(A), \ // (__mmask16)(B))) // #define _mm256_maskz_shrdi_epi16(A, B, C, D) \ // ((__m256i) \ // __builtin_ia32_vpshrd_v16hi_mask ((__v16hi)(__m256i)(B), \ // (__v16hi)(__m256i)(C),(int)(D), \ // (__v16hi)(__m256i)_mm256_setzero_si256 (), \ // (__mmask16)(A))) // #define _mm256_shrdi_epi32(A, B, C) \ // ((__m256i) __builtin_ia32_vpshrd_v8si ((__v8si)(__m256i)(A), \ // (__v8si)(__m256i)(B),(int)(C))) // #define _mm256_mask_shrdi_epi32(A, B, C, D, E) \ // ((__m256i) __builtin_ia32_vpshrd_v8si_mask ((__v8si)(__m256i)(C), \ // (__v8si)(__m256i)(D), \ // (int)(E), \ // (__v8si)(__m256i)(A), \ // (__mmask8)(B))) // #define _mm256_maskz_shrdi_epi32(A, B, C, D) \ // ((__m256i) \ // __builtin_ia32_vpshrd_v8si_mask ((__v8si)(__m256i)(B), \ // (__v8si)(__m256i)(C),(int)(D), \ // (__v8si)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)(A))) // #define _mm256_shrdi_epi64(A, B, C) \ // ((__m256i) __builtin_ia32_vpshrd_v4di ((__v4di)(__m256i)(A), \ // (__v4di)(__m256i)(B),(int)(C))) // #define _mm256_mask_shrdi_epi64(A, B, C, D, E) \ // ((__m256i) __builtin_ia32_vpshrd_v4di_mask ((__v4di)(__m256i)(C), \ // (__v4di)(__m256i)(D), (int)(E), \ // (__v4di)(__m256i)(A), \ // (__mmask8)(B))) // #define _mm256_maskz_shrdi_epi64(A, B, C, D) \ // ((__m256i) \ // __builtin_ia32_vpshrd_v4di_mask ((__v4di)(__m256i)(B), \ // (__v4di)(__m256i)(C),(int)(D), \ // (__v4di)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)(A))) // #define _mm_shrdi_epi16(A, B, C) \ // ((__m128i) __builtin_ia32_vpshrd_v8hi ((__v8hi)(__m128i)(A), \ // (__v8hi)(__m128i)(B),(int)(C))) // #define _mm_mask_shrdi_epi16(A, B, C, D, E) \ // ((__m128i) __builtin_ia32_vpshrd_v8hi_mask ((__v8hi)(__m128i)(C), \ // (__v8hi)(__m128i)(D), (int)(E), \ // (__v8hi)(__m128i)(A), \ // (__mmask8)(B))) // #define _mm_maskz_shrdi_epi16(A, B, C, D) \ // ((__m128i) \ // __builtin_ia32_vpshrd_v8hi_mask ((__v8hi)(__m128i)(B), \ // (__v8hi)(__m128i)(C),(int)(D), \ // (__v8hi)(__m128i)_mm_setzero_si128 (), \ // (__mmask8)(A))) // #define _mm_shrdi_epi32(A, B, C) \ // ((__m128i) __builtin_ia32_vpshrd_v4si ((__v4si)(__m128i)(A), \ // (__v4si)(__m128i)(B),(int)(C))) // #define _mm_mask_shrdi_epi32(A, B, C, D, E) \ // ((__m128i) __builtin_ia32_vpshrd_v4si_mask ((__v4si)(__m128i)(C), \ // (__v4si)(__m128i)(D), (int)(E), \ // (__v4si)(__m128i)(A), \ // (__mmask8)(B))) // #define _mm_maskz_shrdi_epi32(A, B, C, D) \ // ((__m128i) \ // __builtin_ia32_vpshrd_v4si_mask ((__v4si)(__m128i)(B), \ // (__v4si)(__m128i)(C),(int)(D), \ // (__v4si)(__m128i)_mm_setzero_si128 (), \ // (__mmask8)(A))) // #define _mm_shrdi_epi64(A, B, C) \ // ((__m128i) __builtin_ia32_vpshrd_v2di ((__v2di)(__m128i)(A), \ // (__v2di)(__m128i)(B),(int)(C))) // #define _mm_mask_shrdi_epi64(A, B, C, D, E) \ // ((__m128i) __builtin_ia32_vpshrd_v2di_mask ((__v2di)(__m128i)(C), \ // (__v2di)(__m128i)(D), (int)(E), \ // (__v2di)(__m128i)(A), \ // (__mmask8)(B))) // #define _mm_maskz_shrdi_epi64(A, B, C, D) \ // ((__m128i) \ // __builtin_ia32_vpshrd_v2di_mask ((__v2di)(__m128i)(B), \ // (__v2di)(__m128i)(C),(int)(D), \ // (__v2di)(__m128i)_mm_setzero_si128 (), \ // (__mmask8)(A))) // #define _mm256_shldi_epi16(A, B, C) \ // ((__m256i) __builtin_ia32_vpshld_v16hi ((__v16hi)(__m256i)(A), \ // (__v16hi)(__m256i)(B),(int)(C))) // #define _mm256_mask_shldi_epi16(A, B, C, D, E) \ // ((__m256i) __builtin_ia32_vpshld_v16hi_mask ((__v16hi)(__m256i)(C), \ // (__v16hi)(__m256i)(D), \ // (int)(E), \ // (__v16hi)(__m256i)(A), \ // (__mmask16)(B))) // #define _mm256_maskz_shldi_epi16(A, B, C, D) \ // ((__m256i) \ // __builtin_ia32_vpshld_v16hi_mask ((__v16hi)(__m256i)(B), \ // (__v16hi)(__m256i)(C),(int)(D), \ // (__v16hi)(__m256i)_mm256_setzero_si256 (), \ // (__mmask16)(A))) // #define _mm256_shldi_epi32(A, B, C) \ // ((__m256i) __builtin_ia32_vpshld_v8si ((__v8si)(__m256i)(A), \ // (__v8si)(__m256i)(B),(int)(C))) // #define _mm256_mask_shldi_epi32(A, B, C, D, E) \ // ((__m256i) __builtin_ia32_vpshld_v8si_mask ((__v8si)(__m256i)(C), \ // (__v8si)(__m256i)(D), (int)(E), \ // (__v8si)(__m256i)(A), \ // (__mmask8)(B))) // #define _mm256_maskz_shldi_epi32(A, B, C, D) \ // ((__m256i) \ // __builtin_ia32_vpshld_v8si_mask ((__v8si)(__m256i)(B), \ // (__v8si)(__m256i)(C),(int)(D), \ // (__v8si)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)(A))) // #define _mm256_shldi_epi64(A, B, C) \ // ((__m256i) __builtin_ia32_vpshld_v4di ((__v4di)(__m256i)(A), \ // (__v4di)(__m256i)(B),(int)(C))) // #define _mm256_mask_shldi_epi64(A, B, C, D, E) \ // ((__m256i) __builtin_ia32_vpshld_v4di_mask ((__v4di)(__m256i)(C), \ // (__v4di)(__m256i)(D), (int)(E), \ // (__v4di)(__m256i)(A), \ // (__mmask8)(B))) // #define _mm256_maskz_shldi_epi64(A, B, C, D) \ // ((__m256i) \ // __builtin_ia32_vpshld_v4di_mask ((__v4di)(__m256i)(B), \ // (__v4di)(__m256i)(C),(int)(D), \ // (__v4di)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)(A))) // #define _mm_shldi_epi16(A, B, C) \ // ((__m128i) __builtin_ia32_vpshld_v8hi ((__v8hi)(__m128i)(A), \ // (__v8hi)(__m128i)(B),(int)(C))) // #define _mm_mask_shldi_epi16(A, B, C, D, E) \ // ((__m128i) __builtin_ia32_vpshld_v8hi_mask ((__v8hi)(__m128i)(C), \ // (__v8hi)(__m128i)(D), (int)(E), \ // (__v8hi)(__m128i)(A), \ // (__mmask8)(B))) // #define _mm_maskz_shldi_epi16(A, B, C, D) \ // ((__m128i) \ // __builtin_ia32_vpshld_v8hi_mask ((__v8hi)(__m128i)(B), \ // (__v8hi)(__m128i)(C),(int)(D), \ // (__v8hi)(__m128i)_mm_setzero_si128 (), \ // (__mmask8)(A))) // #define _mm_shldi_epi32(A, B, C) \ // ((__m128i) __builtin_ia32_vpshld_v4si ((__v4si)(__m128i)(A), \ // (__v4si)(__m128i)(B),(int)(C))) // #define _mm_mask_shldi_epi32(A, B, C, D, E) \ // ((__m128i) __builtin_ia32_vpshld_v4si_mask ((__v4si)(__m128i)(C), \ // (__v4si)(__m128i)(D), (int)(E), \ // (__v4si)(__m128i)(A), \ // (__mmask8)(B))) // #define _mm_maskz_shldi_epi32(A, B, C, D) \ // ((__m128i) \ // __builtin_ia32_vpshld_v4si_mask ((__v4si)(__m128i)(B), \ // (__v4si)(__m128i)(C),(int)(D), \ // (__v4si)(__m128i)_mm_setzero_si128 (), \ // (__mmask8)(A))) // #define _mm_shldi_epi64(A, B, C) \ // ((__m128i) __builtin_ia32_vpshld_v2di ((__v2di)(__m128i)(A), \ // (__v2di)(__m128i)(B),(int)(C))) // #define _mm_mask_shldi_epi64(A, B, C, D, E) \ // ((__m128i) __builtin_ia32_vpshld_v2di_mask ((__v2di)(__m128i)(C), \ // (__v2di)(__m128i)(D), (int)(E), \ // (__v2di)(__m128i)(A), \ // (__mmask8)(B))) // #define _mm_maskz_shldi_epi64(A, B, C, D) \ // ((__m128i) \ // __builtin_ia32_vpshld_v2di_mask ((__v2di)(__m128i)(B), \ // (__v2di)(__m128i)(C),(int)(D), \ // (__v2di)(__m128i)_mm_setzero_si128 (), \ // (__mmask8)(A))) // #endif // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shrdv_epi16 (__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpshrdv_v16hi ((__v16hi)__A, (__v16hi) __B, // (__v16hi) __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shrdv_epi16 (__m256i __A, __mmask16 __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshrdv_v16hi_mask ((__v16hi)__A, // (__v16hi) __C, (__v16hi) __D, (__mmask16)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shrdv_epi16 (__mmask16 __A, __m256i __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshrdv_v16hi_maskz ((__v16hi)__B, // (__v16hi) __C, (__v16hi) __D, (__mmask16)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shrdv_epi32 (__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpshrdv_v8si ((__v8si)__A, (__v8si) __B, // (__v8si) __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shrdv_epi32 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshrdv_v8si_mask ((__v8si)__A, (__v8si) __C, // (__v8si) __D, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shrdv_epi32 (__mmask8 __A, __m256i __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshrdv_v8si_maskz ((__v8si)__B, (__v8si) __C, // (__v8si) __D, (__mmask8)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shrdv_epi64 (__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpshrdv_v4di ((__v4di)__A, (__v4di) __B, // (__v4di) __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shrdv_epi64 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshrdv_v4di_mask ((__v4di)__A, (__v4di) __C, // (__v4di) __D, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shrdv_epi64 (__mmask8 __A, __m256i __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshrdv_v4di_maskz ((__v4di)__B, (__v4di) __C, // (__v4di) __D, (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shrdv_epi16 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpshrdv_v8hi ((__v8hi)__A, (__v8hi) __B, // (__v8hi) __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shrdv_epi16 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshrdv_v8hi_mask ((__v8hi)__A, (__v8hi) __C, // (__v8hi) __D, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shrdv_epi16 (__mmask8 __A, __m128i __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshrdv_v8hi_maskz ((__v8hi)__B, (__v8hi) __C, // (__v8hi) __D, (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shrdv_epi32 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpshrdv_v4si ((__v4si)__A, (__v4si) __B, // (__v4si) __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shrdv_epi32 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshrdv_v4si_mask ((__v4si)__A, (__v4si) __C, // (__v4si) __D, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shrdv_epi32 (__mmask8 __A, __m128i __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshrdv_v4si_maskz ((__v4si)__B, (__v4si) __C, // (__v4si) __D, (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shrdv_epi64 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpshrdv_v2di ((__v2di)__A, (__v2di) __B, // (__v2di) __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shrdv_epi64 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshrdv_v2di_mask ((__v2di)__A, (__v2di) __C, // (__v2di) __D, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shrdv_epi64 (__mmask8 __A, __m128i __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshrdv_v2di_maskz ((__v2di)__B, (__v2di) __C, // (__v2di) __D, (__mmask8)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shldv_epi16 (__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpshldv_v16hi ((__v16hi)__A, (__v16hi) __B, // (__v16hi) __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shldv_epi16 (__m256i __A, __mmask16 __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshldv_v16hi_mask ((__v16hi)__A, // (__v16hi) __C, (__v16hi) __D, (__mmask16)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shldv_epi16 (__mmask16 __A, __m256i __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshldv_v16hi_maskz ((__v16hi)__B, // (__v16hi) __C, (__v16hi) __D, (__mmask16)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shldv_epi32 (__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpshldv_v8si ((__v8si)__A, (__v8si) __B, // (__v8si) __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shldv_epi32 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshldv_v8si_mask ((__v8si)__A, (__v8si) __C, // (__v8si) __D, (__mmask8)__B) ; // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shldv_epi32 (__mmask8 __A, __m256i __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshldv_v8si_maskz ((__v8si)__B, (__v8si) __C, // (__v8si) __D, (__mmask8)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shldv_epi64 (__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpshldv_v4di ((__v4di)__A, (__v4di) __B, // (__v4di) __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shldv_epi64 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshldv_v4di_mask ((__v4di)__A, (__v4di) __C, // (__v4di) __D, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shldv_epi64 (__mmask8 __A, __m256i __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpshldv_v4di_maskz ((__v4di)__B, (__v4di) __C, // (__v4di) __D, (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shldv_epi16 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpshldv_v8hi ((__v8hi)__A, (__v8hi) __B, // (__v8hi) __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shldv_epi16 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshldv_v8hi_mask ((__v8hi)__A, (__v8hi) __C, // (__v8hi) __D, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shldv_epi16 (__mmask8 __A, __m128i __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshldv_v8hi_maskz ((__v8hi)__B, (__v8hi) __C, // (__v8hi) __D, (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shldv_epi32 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpshldv_v4si ((__v4si)__A, (__v4si) __B, // (__v4si) __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shldv_epi32 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshldv_v4si_mask ((__v4si)__A, (__v4si) __C, // (__v4si) __D, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shldv_epi32 (__mmask8 __A, __m128i __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshldv_v4si_maskz ((__v4si)__B, (__v4si) __C, // (__v4si) __D, (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shldv_epi64 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpshldv_v2di ((__v2di)__A, (__v2di) __B, // (__v2di) __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shldv_epi64 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshldv_v2di_mask ((__v2di)__A, (__v2di) __C, // (__v2di) __D, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shldv_epi64 (__mmask8 __A, __m128i __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpshldv_v2di_maskz ((__v2di)__B, (__v2di) __C, // (__v2di) __D, (__mmask8)__A); // } // #ifdef __DISABLE_AVX512VBMI2VL__ // #undef __DISABLE_AVX512VBMI2VL__ // #pragma GCC pop_options // #endif /* __DISABLE_AVX512VBMIVL__ */ // #if !defined(__AVX512VL__) || !defined(__AVX512VBMI2__) || \ // !defined(__AVX512BW__) // #pragma GCC push_options // #pragma GCC target("avx512vbmi2,avx512vl,avx512bw") // #define __DISABLE_AVX512VBMI2VLBW__ // #endif /* __AVX512VBMIVLBW__ */ // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compress_epi8 (__m256i __A, __mmask32 __B, __m256i __C) // { // return (__m256i) __builtin_ia32_compressqi256_mask ((__v32qi)__C, // (__v32qi)__A, (__mmask32)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_compress_epi8 (__mmask32 __A, __m256i __B) // { // return (__m256i) __builtin_ia32_compressqi256_mask ((__v32qi) __B, // (__v32qi) _mm256_setzero_si256 (), (__mmask32) __A); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compressstoreu_epi8 (void * __A, __mmask32 __B, __m256i __C) // { // __builtin_ia32_compressstoreuqi256_mask ((__v32qi *) __A, (__v32qi) __C, // (__mmask32) __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expand_epi8 (__m256i __A, __mmask32 __B, __m256i __C) // { // return (__m256i) __builtin_ia32_expandqi256_mask ((__v32qi) __C, // (__v32qi) __A, // (__mmask32) __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expand_epi8 (__mmask32 __A, __m256i __B) // { // return (__m256i) __builtin_ia32_expandqi256_maskz ((__v32qi) __B, // (__v32qi) _mm256_setzero_si256 (), (__mmask32) __A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expandloadu_epi8 (__m256i __A, __mmask32 __B, const void * __C) // { // return (__m256i) __builtin_ia32_expandloadqi256_mask ((const __v32qi *) __C, // (__v32qi) __A, (__mmask32) __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expandloadu_epi8 (__mmask32 __A, const void * __B) // { // return (__m256i) __builtin_ia32_expandloadqi256_maskz ((const __v32qi *) __B, // (__v32qi) _mm256_setzero_si256 (), (__mmask32) __A); // } #ifdef __DISABLE_AVX512VBMI2VLBW__ #undef __DISABLE_AVX512VBMI2VLBW__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VBMIVLBW__ */ #endif /* _AVX512VBMIVLINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vbmiintrin.h000066400000000000000000000121671517770275000201300ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512VBMIINTRIN_H_INCLUDED #define _AVX512VBMIINTRIN_H_INCLUDED #ifndef __AVX512VBMI__ #pragma GCC push_options #pragma GCC target("avx512vbmi") #define __DISABLE_AVX512VBMI__ #endif /* __AVX512VBMI__ */ // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_multishift_epi64_epi8 (__m512i __W, __mmask64 __M, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X, // (__v64qi) __Y, // (__v64qi) __W, // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_multishift_epi64_epi8 (__mmask64 __M, __m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X, // (__v64qi) __Y, // (__v64qi) // _mm512_setzero_si512 (), // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_multishift_epi64_epi8 (__m512i __X, __m512i __Y) // { // return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X, // (__v64qi) __Y, // (__v64qi) // _mm512_undefined_epi32 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutexvar_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B, // (__v64qi) __A, // (__v64qi) // _mm512_undefined_epi32 (), // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutexvar_epi8 (__mmask64 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B, // (__v64qi) __A, // (__v64qi) // _mm512_setzero_si512(), // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutexvar_epi8 (__m512i __W, __mmask64 __M, __m512i __A, // __m512i __B) // { // return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B, // (__v64qi) __A, // (__v64qi) __W, // (__mmask64) __M); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_permutex2var_epi8 (__m512i __A, __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2varqi512_mask ((__v64qi) __I // /* idx */ , // (__v64qi) __A, // (__v64qi) __B, // (__mmask64) -1); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_permutex2var_epi8 (__m512i __A, __mmask64 __U, // __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2varqi512_mask ((__v64qi) __I // /* idx */ , // (__v64qi) __A, // (__v64qi) __B, // (__mmask64) // __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask2_permutex2var_epi8 (__m512i __A, __m512i __I, // __mmask64 __U, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermi2varqi512_mask ((__v64qi) __A, // (__v64qi) __I // /* idx */ , // (__v64qi) __B, // (__mmask64) // __U); // } // extern __inline __m512i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_permutex2var_epi8 (__mmask64 __U, __m512i __A, // __m512i __I, __m512i __B) // { // return (__m512i) __builtin_ia32_vpermt2varqi512_maskz ((__v64qi) __I // /* idx */ , // (__v64qi) __A, // (__v64qi) __B, // (__mmask64) // __U); // } #ifdef __DISABLE_AVX512VBMI__ #undef __DISABLE_AVX512VBMI__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VBMI__ */ #endif /* _AVX512VBMIINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vbmivlintrin.h000066400000000000000000000214451517770275000204710ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512VBMIVLINTRIN_H_INCLUDED #define _AVX512VBMIVLINTRIN_H_INCLUDED #if !defined(__AVX512VL__) || !defined(__AVX512VBMI__) #pragma GCC push_options #pragma GCC target("avx512vbmi,avx512vl") #define __DISABLE_AVX512VBMIVL__ #endif /* __AVX512VBMIVL__ */ // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_multishift_epi64_epi8 (__m256i __W, __mmask32 __M, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X, // (__v32qi) __Y, // (__v32qi) __W, // (__mmask32) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_multishift_epi64_epi8 (__mmask32 __M, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X, // (__v32qi) __Y, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_multishift_epi64_epi8 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X, // (__v32qi) __Y, // (__v32qi) // _mm256_undefined_si256 (), // (__mmask32) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_multishift_epi64_epi8 (__m128i __W, __mmask16 __M, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X, // (__v16qi) __Y, // (__v16qi) __W, // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_multishift_epi64_epi8 (__mmask16 __M, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X, // (__v16qi) __Y, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_multishift_epi64_epi8 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X, // (__v16qi) __Y, // (__v16qi) // _mm_undefined_si128 (), // (__mmask16) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutexvar_epi8 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_permvarqi256_mask ((__v32qi) __B, // (__v32qi) __A, // (__v32qi) // _mm256_undefined_si256 (), // (__mmask32) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutexvar_epi8 (__mmask32 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_permvarqi256_mask ((__v32qi) __B, // (__v32qi) __A, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutexvar_epi8 (__m256i __W, __mmask32 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_permvarqi256_mask ((__v32qi) __B, // (__v32qi) __A, // (__v32qi) __W, // (__mmask32) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permutexvar_epi8 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_permvarqi128_mask ((__v16qi) __B, // (__v16qi) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask16) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permutexvar_epi8 (__mmask16 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_permvarqi128_mask ((__v16qi) __B, // (__v16qi) __A, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permutexvar_epi8 (__m128i __W, __mmask16 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_permvarqi128_mask ((__v16qi) __B, // (__v16qi) __A, // (__v16qi) __W, // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutex2var_epi8 (__m256i __A, __m256i __I, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2varqi256_mask ((__v32qi) __I // /* idx */ , // (__v32qi) __A, // (__v32qi) __B, // (__mmask32) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutex2var_epi8 (__m256i __A, __mmask32 __U, // __m256i __I, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2varqi256_mask ((__v32qi) __I // /* idx */ , // (__v32qi) __A, // (__v32qi) __B, // (__mmask32) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask2_permutex2var_epi8 (__m256i __A, __m256i __I, // __mmask32 __U, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermi2varqi256_mask ((__v32qi) __A, // (__v32qi) __I // /* idx */ , // (__v32qi) __B, // (__mmask32) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutex2var_epi8 (__mmask32 __U, __m256i __A, // __m256i __I, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2varqi256_maskz ((__v32qi) __I // /* idx */ , // (__v32qi) __A, // (__v32qi) __B, // (__mmask32) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permutex2var_epi8 (__m128i __A, __m128i __I, __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2varqi128_mask ((__v16qi) __I // /* idx */ , // (__v16qi) __A, // (__v16qi) __B, // (__mmask16) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permutex2var_epi8 (__m128i __A, __mmask16 __U, __m128i __I, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2varqi128_mask ((__v16qi) __I // /* idx */ , // (__v16qi) __A, // (__v16qi) __B, // (__mmask16) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask2_permutex2var_epi8 (__m128i __A, __m128i __I, __mmask16 __U, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermi2varqi128_mask ((__v16qi) __A, // (__v16qi) __I // /* idx */ , // (__v16qi) __B, // (__mmask16) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permutex2var_epi8 (__mmask16 __U, __m128i __A, __m128i __I, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2varqi128_maskz ((__v16qi) __I // /* idx */ , // (__v16qi) __A, // (__v16qi) __B, // (__mmask16) // __U); // } #ifdef __DISABLE_AVX512VBMIVL__ #undef __DISABLE_AVX512VBMIVL__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VBMIVL__ */ #endif /* _AVX512VBMIVLINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vlbwintrin.h000066400000000000000000004612021517770275000201430ustar00rootroot00000000000000/* Copyright (C) 2014-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512VLBWINTRIN_H_INCLUDED #define _AVX512VLBWINTRIN_H_INCLUDED #if !defined(__AVX512VL__) || !defined(__AVX512BW__) #pragma GCC push_options #pragma GCC target("avx512vl,avx512bw") #define __DISABLE_AVX512VLBW__ #endif /* __AVX512VLBW__ */ // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mov_epi8 (__m256i __W, __mmask32 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_movdquqi256_mask ((__v32qi) __A, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mov_epi8 (__mmask32 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_movdquqi256_mask ((__v32qi) __A, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mov_epi8 (__m128i __W, __mmask16 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_movdquqi128_mask ((__v16qi) __A, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mov_epi8 (__mmask16 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_movdquqi128_mask ((__v16qi) __A, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_storeu_epi8 (void *__P, __mmask32 __U, __m256i __A) // { // __builtin_ia32_storedquqi256_mask ((char *) __P, // (__v32qi) __A, // (__mmask32) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_storeu_epi8 (void *__P, __mmask16 __U, __m128i __A) // { // __builtin_ia32_storedquqi128_mask ((char *) __P, // (__v16qi) __A, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_loadu_epi16 (__m256i __W, __mmask16 __U, void const *__P) // { // return (__m256i) __builtin_ia32_loaddquhi256_mask ((const short *) __P, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_loadu_epi16 (__mmask16 __U, void const *__P) // { // return (__m256i) __builtin_ia32_loaddquhi256_mask ((const short *) __P, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_loadu_epi16 (__m128i __W, __mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_loaddquhi128_mask ((const short *) __P, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_loadu_epi16 (__mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_loaddquhi128_mask ((const short *) __P, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mov_epi16 (__m256i __W, __mmask16 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_movdquhi256_mask ((__v16hi) __A, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mov_epi16 (__mmask16 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_movdquhi256_mask ((__v16hi) __A, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mov_epi16 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_movdquhi128_mask ((__v8hi) __A, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mov_epi16 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_movdquhi128_mask ((__v8hi) __A, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_loadu_epi8 (__m256i __W, __mmask32 __U, void const *__P) // { // return (__m256i) __builtin_ia32_loaddquqi256_mask ((const char *) __P, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_loadu_epi8 (__mmask32 __U, void const *__P) // { // return (__m256i) __builtin_ia32_loaddquqi256_mask ((const char *) __P, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_loadu_epi8 (__m128i __W, __mmask16 __U, void const *__P) // { // return (__m128i) __builtin_ia32_loaddquqi128_mask ((const char *) __P, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_loadu_epi8 (__mmask16 __U, void const *__P) // { // return (__m128i) __builtin_ia32_loaddquqi128_mask ((const char *) __P, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi16_epi8 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovwb256_mask ((__v16hi) __A, // (__v16qi)_mm_undefined_si128(), // (__mmask16) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi16_storeu_epi8 (void * __P, __mmask16 __M,__m256i __A) // { // __builtin_ia32_pmovwb256mem_mask ((__v16qi *) __P , (__v16hi) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi16_epi8 (__m128i __O, __mmask16 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovwb256_mask ((__v16hi) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi16_epi8 (__mmask16 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovwb256_mask ((__v16hi) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtsepi16_epi8 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovswb128_mask ((__v8hi) __A, // (__v16qi)_mm_undefined_si128(), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi16_storeu_epi8 (void * __P, __mmask8 __M,__m128i __A) // { // __builtin_ia32_pmovswb128mem_mask ((__v8qi *) __P , (__v8hi) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi16_epi8 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovswb128_mask ((__v8hi) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtsepi16_epi8 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovswb128_mask ((__v8hi) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtsepi16_epi8 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovswb256_mask ((__v16hi) __A, // (__v16qi)_mm_undefined_si128(), // (__mmask16) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi16_storeu_epi8 (void * __P, __mmask16 __M,__m256i __A) // { // __builtin_ia32_pmovswb256mem_mask ((__v16qi *) __P , (__v16hi) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi16_epi8 (__m128i __O, __mmask16 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovswb256_mask ((__v16hi) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtsepi16_epi8 (__mmask16 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovswb256_mask ((__v16hi) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtusepi16_epi8 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovuswb128_mask ((__v8hi) __A, // (__v16qi)_mm_undefined_si128(), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask8 __M,__m128i __A) // { // __builtin_ia32_pmovuswb128mem_mask ((__v8qi *) __P , (__v8hi) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi16_epi8 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovuswb128_mask ((__v8hi) __A, // (__v16qi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtusepi16_epi8 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovuswb128_mask ((__v8hi) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtusepi16_epi8 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovuswb256_mask ((__v16hi) __A, // (__v16qi)_mm_undefined_si128(), // (__mmask16) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask16 __M,__m256i __A) // { // __builtin_ia32_pmovuswb256mem_mask ((__v16qi *) __P , (__v16hi) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi16_epi8 (__m128i __O, __mmask16 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovuswb256_mask ((__v16hi) __A, // (__v16qi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtusepi16_epi8 (__mmask16 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovuswb256_mask ((__v16hi) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcastb_epi8 (__m256i __O, __mmask32 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_pbroadcastb256_mask ((__v16qi) __A, // (__v32qi) __O, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcastb_epi8 (__mmask32 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_pbroadcastb256_mask ((__v16qi) __A, // (__v32qi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_set1_epi8 (__m256i __O, __mmask32 __M, char __A) // { // return (__m256i) __builtin_ia32_pbroadcastb256_gpr_mask (__A, // (__v32qi) __O, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_set1_epi8 (__mmask32 __M, char __A) // { // return (__m256i) __builtin_ia32_pbroadcastb256_gpr_mask (__A, // (__v32qi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_broadcastb_epi8 (__m128i __O, __mmask16 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pbroadcastb128_mask ((__v16qi) __A, // (__v16qi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_broadcastb_epi8 (__mmask16 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pbroadcastb128_mask ((__v16qi) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_set1_epi8 (__m128i __O, __mmask16 __M, char __A) // { // return (__m128i) __builtin_ia32_pbroadcastb128_gpr_mask (__A, // (__v16qi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_set1_epi8 (__mmask16 __M, char __A) // { // return (__m128i) __builtin_ia32_pbroadcastb128_gpr_mask (__A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcastw_epi16 (__m256i __O, __mmask16 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_pbroadcastw256_mask ((__v8hi) __A, // (__v16hi) __O, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcastw_epi16 (__mmask16 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_pbroadcastw256_mask ((__v8hi) __A, // (__v16hi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_set1_epi16 (__m256i __O, __mmask16 __M, short __A) // { // return (__m256i) __builtin_ia32_pbroadcastw256_gpr_mask (__A, // (__v16hi) __O, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_set1_epi16 (__mmask16 __M, short __A) // { // return (__m256i) __builtin_ia32_pbroadcastw256_gpr_mask (__A, // (__v16hi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_broadcastw_epi16 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pbroadcastw128_mask ((__v8hi) __A, // (__v8hi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_broadcastw_epi16 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pbroadcastw128_mask ((__v8hi) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_set1_epi16 (__m128i __O, __mmask8 __M, short __A) // { // return (__m128i) __builtin_ia32_pbroadcastw128_gpr_mask (__A, // (__v8hi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_set1_epi16 (__mmask8 __M, short __A) // { // return (__m128i) __builtin_ia32_pbroadcastw128_gpr_mask (__A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutexvar_epi16 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_permvarhi256_mask ((__v16hi) __B, // (__v16hi) __A, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutexvar_epi16 (__mmask16 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_permvarhi256_mask ((__v16hi) __B, // (__v16hi) __A, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutexvar_epi16 (__m256i __W, __mmask16 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_permvarhi256_mask ((__v16hi) __B, // (__v16hi) __A, // (__v16hi) __W, // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permutexvar_epi16 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_permvarhi128_mask ((__v8hi) __B, // (__v8hi) __A, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permutexvar_epi16 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_permvarhi128_mask ((__v8hi) __B, // (__v8hi) __A, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permutexvar_epi16 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_permvarhi128_mask ((__v8hi) __B, // (__v8hi) __A, // (__v8hi) __W, // (__mmask8) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutex2var_epi16 (__m256i __A, __m256i __I, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2varhi256_mask ((__v16hi) __I // /* idx */ , // (__v16hi) __A, // (__v16hi) __B, // (__mmask16) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutex2var_epi16 (__m256i __A, __mmask16 __U, // __m256i __I, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2varhi256_mask ((__v16hi) __I // /* idx */ , // (__v16hi) __A, // (__v16hi) __B, // (__mmask16) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask2_permutex2var_epi16 (__m256i __A, __m256i __I, // __mmask16 __U, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermi2varhi256_mask ((__v16hi) __A, // (__v16hi) __I // /* idx */ , // (__v16hi) __B, // (__mmask16) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutex2var_epi16 (__mmask16 __U, __m256i __A, // __m256i __I, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2varhi256_maskz ((__v16hi) __I // /* idx */ , // (__v16hi) __A, // (__v16hi) __B, // (__mmask16) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permutex2var_epi16 (__m128i __A, __m128i __I, __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2varhi128_mask ((__v8hi) __I // /* idx */ , // (__v8hi) __A, // (__v8hi) __B, // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permutex2var_epi16 (__m128i __A, __mmask8 __U, __m128i __I, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2varhi128_mask ((__v8hi) __I // /* idx */ , // (__v8hi) __A, // (__v8hi) __B, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask2_permutex2var_epi16 (__m128i __A, __m128i __I, __mmask8 __U, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermi2varhi128_mask ((__v8hi) __A, // (__v8hi) __I // /* idx */ , // (__v8hi) __B, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permutex2var_epi16 (__mmask8 __U, __m128i __A, __m128i __I, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2varhi128_maskz ((__v8hi) __I // /* idx */ , // (__v8hi) __A, // (__v8hi) __B, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_maddubs_epi16 (__m256i __W, __mmask16 __U, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_pmaddubsw256_mask ((__v32qi) __X, // (__v32qi) __Y, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_maddubs_epi16 (__mmask16 __U, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_pmaddubsw256_mask ((__v32qi) __X, // (__v32qi) __Y, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_maddubs_epi16 (__m128i __W, __mmask8 __U, __m128i __X, // __m128i __Y) // { // return (__m128i) __builtin_ia32_pmaddubsw128_mask ((__v16qi) __X, // (__v16qi) __Y, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_maddubs_epi16 (__mmask8 __U, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_pmaddubsw128_mask ((__v16qi) __X, // (__v16qi) __Y, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_madd_epi16 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmaddwd256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_madd_epi16 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaddwd256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_madd_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmaddwd128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_madd_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaddwd128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_movepi8_mask (__m128i __A) // { // return (__mmask16) __builtin_ia32_cvtb2mask128 ((__v16qi) __A); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movepi8_mask (__m256i __A) // { // return (__mmask32) __builtin_ia32_cvtb2mask256 ((__v32qi) __A); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_movepi16_mask (__m128i __A) // { // return (__mmask8) __builtin_ia32_cvtw2mask128 ((__v8hi) __A); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movepi16_mask (__m256i __A) // { // return (__mmask16) __builtin_ia32_cvtw2mask256 ((__v16hi) __A); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_movm_epi8 (__mmask16 __A) // { // return (__m128i) __builtin_ia32_cvtmask2b128 (__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movm_epi8 (__mmask32 __A) // { // return (__m256i) __builtin_ia32_cvtmask2b256 (__A); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_movm_epi16 (__mmask8 __A) // { // return (__m128i) __builtin_ia32_cvtmask2w128 (__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movm_epi16 (__mmask16 __A) // { // return (__m256i) __builtin_ia32_cvtmask2w256 (__A); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_test_epi8_mask (__m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_ptestmb128 ((__v16qi) __A, // (__v16qi) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_test_epi8_mask (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_ptestmb128 ((__v16qi) __A, // (__v16qi) __B, __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_test_epi8_mask (__m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_ptestmb256 ((__v32qi) __A, // (__v32qi) __B, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_test_epi8_mask (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_ptestmb256 ((__v32qi) __A, // (__v32qi) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_test_epi16_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestmw128 ((__v8hi) __A, // (__v8hi) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_test_epi16_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestmw128 ((__v8hi) __A, // (__v8hi) __B, __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_test_epi16_mask (__m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_ptestmw256 ((__v16hi) __A, // (__v16hi) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_test_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_ptestmw256 ((__v16hi) __A, // (__v16hi) __B, __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_min_epu16 (__mmask16 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pminuw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_min_epu16 (__m256i __W, __mmask16 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pminuw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_epu16 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pminuw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_epu16 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pminuw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_min_epi16 (__mmask16 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pminsw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_min_epi16 (__m256i __W, __mmask16 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pminsw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_max_epu8 (__mmask32 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxub256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_max_epu8 (__m256i __W, __mmask32 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxub256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_epu8 (__mmask16 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxub128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_epu8 (__m128i __W, __mmask16 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxub128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_max_epi8 (__mmask32 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxsb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_max_epi8 (__m256i __W, __mmask32 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxsb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_epi8 (__mmask16 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxsb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_epi8 (__m128i __W, __mmask16 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxsb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_min_epu8 (__mmask32 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pminub256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_min_epu8 (__m256i __W, __mmask32 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pminub256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_epu8 (__mmask16 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pminub128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_epu8 (__m128i __W, __mmask16 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pminub128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_min_epi8 (__mmask32 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pminsb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_min_epi8 (__m256i __W, __mmask32 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pminsb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_epi8 (__mmask16 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pminsb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_epi8 (__m128i __W, __mmask16 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pminsb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_max_epi16 (__mmask16 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxsw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_max_epi16 (__m256i __W, __mmask16 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxsw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_epi16 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxsw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_epi16 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxsw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_max_epu16 (__mmask16 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxuw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_max_epu16 (__m256i __W, __mmask16 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxuw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_epu16 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxuw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_epu16 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxuw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_epi16 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pminsw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_epi16 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pminsw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __M); // } // #ifdef __OPTIMIZE__ // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_alignr_epi8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B, const int __N) // { // return (__m256i) __builtin_ia32_palignr256_mask ((__v4di) __A, // (__v4di) __B, // __N * 8, // (__v4di) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_alignr_epi8 (__mmask32 __U, __m256i __A, __m256i __B, // const int __N) // { // return (__m256i) __builtin_ia32_palignr256_mask ((__v4di) __A, // (__v4di) __B, // __N * 8, // (__v4di) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_alignr_epi8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B, const int __N) // { // return (__m128i) __builtin_ia32_palignr128_mask ((__v2di) __A, // (__v2di) __B, // __N * 8, // (__v2di) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_alignr_epi8 (__mmask16 __U, __m128i __A, __m128i __B, // const int __N) // { // return (__m128i) __builtin_ia32_palignr128_mask ((__v2di) __A, // (__v2di) __B, // __N * 8, // (__v2di) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_dbsad_epu8 (__m256i __A, __m256i __B, const int __imm) // { // return (__m256i) __builtin_ia32_dbpsadbw256_mask ((__v32qi) __A, // (__v32qi) __B, // __imm, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_dbsad_epu8 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B, const int __imm) // { // return (__m256i) __builtin_ia32_dbpsadbw256_mask ((__v32qi) __A, // (__v32qi) __B, // __imm, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_dbsad_epu8 (__mmask16 __U, __m256i __A, __m256i __B, // const int __imm) // { // return (__m256i) __builtin_ia32_dbpsadbw256_mask ((__v32qi) __A, // (__v32qi) __B, // __imm, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_dbsad_epu8 (__m128i __A, __m128i __B, const int __imm) // { // return (__m128i) __builtin_ia32_dbpsadbw128_mask ((__v16qi) __A, // (__v16qi) __B, // __imm, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_dbsad_epu8 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B, const int __imm) // { // return (__m128i) __builtin_ia32_dbpsadbw128_mask ((__v16qi) __A, // (__v16qi) __B, // __imm, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_dbsad_epu8 (__mmask8 __U, __m128i __A, __m128i __B, // const int __imm) // { // return (__m128i) __builtin_ia32_dbpsadbw128_mask ((__v16qi) __A, // (__v16qi) __B, // __imm, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_blend_epi16 (__mmask8 __U, __m128i __A, __m128i __W) // { // return (__m128i) __builtin_ia32_blendmw_128_mask ((__v8hi) __A, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_blend_epi8 (__mmask16 __U, __m128i __A, __m128i __W) // { // return (__m128i) __builtin_ia32_blendmb_128_mask ((__v16qi) __A, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_blend_epi16 (__mmask16 __U, __m256i __A, __m256i __W) // { // return (__m256i) __builtin_ia32_blendmw_256_mask ((__v16hi) __A, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_blend_epi8 (__mmask32 __U, __m256i __A, __m256i __W) // { // return (__m256i) __builtin_ia32_blendmb_256_mask ((__v32qi) __A, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_epi16_mask (__mmask8 __U, __m128i __X, __m128i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_epi16_mask (__m128i __X, __m128i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmp_epi16_mask (__mmask16 __U, __m256i __X, __m256i __Y, // const int __P) // { // return (__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, __P, // (__mmask16) __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmp_epi16_mask (__m256i __X, __m256i __Y, const int __P) // { // return (__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, __P, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_epi8_mask (__mmask16 __U, __m128i __X, __m128i __Y, // const int __P) // { // return (__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, __P, // (__mmask16) __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_epi8_mask (__m128i __X, __m128i __Y, const int __P) // { // return (__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, __P, // (__mmask16) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmp_epi8_mask (__mmask32 __U, __m256i __X, __m256i __Y, // const int __P) // { // return (__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, __P, // (__mmask32) __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmp_epi8_mask (__m256i __X, __m256i __Y, const int __P) // { // return (__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, __P, // (__mmask32) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_epu16_mask (__mmask8 __U, __m128i __X, __m128i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_epu16_mask (__m128i __X, __m128i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmp_epu16_mask (__mmask16 __U, __m256i __X, __m256i __Y, // const int __P) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, __P, // (__mmask16) __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmp_epu16_mask (__m256i __X, __m256i __Y, const int __P) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, __P, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_epu8_mask (__mmask16 __U, __m128i __X, __m128i __Y, // const int __P) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, __P, // (__mmask16) __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_epu8_mask (__m128i __X, __m128i __Y, const int __P) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, __P, // (__mmask16) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmp_epu8_mask (__mmask32 __U, __m256i __X, __m256i __Y, // const int __P) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, __P, // (__mmask32) __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmp_epu8_mask (__m256i __X, __m256i __Y, const int __P) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, __P, // (__mmask32) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srli_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_psrlwi256_mask ((__v16hi) __A, __imm, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srli_epi16 (__mmask16 __U, __m256i __A, const int __imm) // { // return (__m256i) __builtin_ia32_psrlwi256_mask ((__v16hi) __A, __imm, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srli_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_psrlwi128_mask ((__v8hi) __A, __imm, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srli_epi16 (__mmask8 __U, __m128i __A, const int __imm) // { // return (__m128i) __builtin_ia32_psrlwi128_mask ((__v8hi) __A, __imm, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shufflehi_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_pshufhw256_mask ((__v16hi) __A, // __imm, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shufflehi_epi16 (__mmask16 __U, __m256i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_pshufhw256_mask ((__v16hi) __A, // __imm, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shufflehi_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_pshufhw128_mask ((__v8hi) __A, __imm, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shufflehi_epi16 (__mmask8 __U, __m128i __A, const int __imm) // { // return (__m128i) __builtin_ia32_pshufhw128_mask ((__v8hi) __A, __imm, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shufflelo_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_pshuflw256_mask ((__v16hi) __A, // __imm, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shufflelo_epi16 (__mmask16 __U, __m256i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_pshuflw256_mask ((__v16hi) __A, // __imm, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shufflelo_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_pshuflw128_mask ((__v8hi) __A, __imm, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shufflelo_epi16 (__mmask8 __U, __m128i __A, const int __imm) // { // return (__m128i) __builtin_ia32_pshuflw128_mask ((__v8hi) __A, __imm, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srai_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_psrawi256_mask ((__v16hi) __A, __imm, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srai_epi16 (__mmask16 __U, __m256i __A, const int __imm) // { // return (__m256i) __builtin_ia32_psrawi256_mask ((__v16hi) __A, __imm, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srai_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_psrawi128_mask ((__v8hi) __A, __imm, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srai_epi16 (__mmask8 __U, __m128i __A, const int __imm) // { // return (__m128i) __builtin_ia32_psrawi128_mask ((__v8hi) __A, __imm, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_slli_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // int __B) // { // return (__m256i) __builtin_ia32_psllwi256_mask ((__v16hi) __A, __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_slli_epi16 (__mmask16 __U, __m256i __A, int __B) // { // return (__m256i) __builtin_ia32_psllwi256_mask ((__v16hi) __A, __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_slli_epi16 (__m128i __W, __mmask8 __U, __m128i __A, int __B) // { // return (__m128i) __builtin_ia32_psllwi128_mask ((__v8hi) __A, __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_slli_epi16 (__mmask8 __U, __m128i __A, int __B) // { // return (__m128i) __builtin_ia32_psllwi128_mask ((__v8hi) __A, __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // #else // #define _mm256_mask_alignr_epi8(W, U, X, Y, N) \ // ((__m256i) __builtin_ia32_palignr256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)((N) * 8), \ // (__v4di)(__m256i)(X), (__mmask32)(U))) // #define _mm256_mask_srli_epi16(W, U, A, B) \ // ((__m256i) __builtin_ia32_psrlwi256_mask ((__v16hi)(__m256i)(A), \ // (int)(B), (__v16hi)(__m256i)(W), (__mmask16)(U))) // #define _mm256_maskz_srli_epi16(U, A, B) \ // ((__m256i) __builtin_ia32_psrlwi256_mask ((__v16hi)(__m256i)(A), \ // (int)(B), (__v16hi)_mm256_setzero_si256 (), (__mmask16)(U))) // #define _mm_mask_srli_epi16(W, U, A, B) \ // ((__m128i) __builtin_ia32_psrlwi128_mask ((__v8hi)(__m128i)(A), \ // (int)(B), (__v8hi)(__m128i)(W), (__mmask8)(U))) // #define _mm_maskz_srli_epi16(U, A, B) \ // ((__m128i) __builtin_ia32_psrlwi128_mask ((__v8hi)(__m128i)(A), \ // (int)(B), (__v8hi)_mm_setzero_si128(), (__mmask8)(U))) // #define _mm256_mask_srai_epi16(W, U, A, B) \ // ((__m256i) __builtin_ia32_psrawi256_mask ((__v16hi)(__m256i)(A), \ // (int)(B), (__v16hi)(__m256i)(W), (__mmask16)(U))) // #define _mm256_maskz_srai_epi16(U, A, B) \ // ((__m256i) __builtin_ia32_psrawi256_mask ((__v16hi)(__m256i)(A), \ // (int)(B), (__v16hi)_mm256_setzero_si256 (), (__mmask16)(U))) // #define _mm_mask_srai_epi16(W, U, A, B) \ // ((__m128i) __builtin_ia32_psrawi128_mask ((__v8hi)(__m128i)(A), \ // (int)(B), (__v8hi)(__m128i)(W), (__mmask8)(U))) // #define _mm_maskz_srai_epi16(U, A, B) \ // ((__m128i) __builtin_ia32_psrawi128_mask ((__v8hi)(__m128i)(A), \ // (int)(B), (__v8hi)_mm_setzero_si128(), (__mmask8)(U))) // #define _mm256_mask_shufflehi_epi16(W, U, A, B) \ // ((__m256i) __builtin_ia32_pshufhw256_mask ((__v16hi)(__m256i)(A), (int)(B), \ // (__v16hi)(__m256i)(W), \ // (__mmask16)(U))) // #define _mm256_maskz_shufflehi_epi16(U, A, B) \ // ((__m256i) __builtin_ia32_pshufhw256_mask ((__v16hi)(__m256i)(A), (int)(B), \ // (__v16hi)(__m256i)_mm256_setzero_si256 (), \ // (__mmask16)(U))) // #define _mm_mask_shufflehi_epi16(W, U, A, B) \ // ((__m128i) __builtin_ia32_pshufhw128_mask ((__v8hi)(__m128i)(A), (int)(B), \ // (__v8hi)(__m128i)(W), \ // (__mmask8)(U))) // #define _mm_maskz_shufflehi_epi16(U, A, B) \ // ((__m128i) __builtin_ia32_pshufhw128_mask ((__v8hi)(__m128i)(A), (int)(B), \ // (__v8hi)(__m128i)_mm_setzero_si128 (), \ // (__mmask8)(U))) // #define _mm256_mask_shufflelo_epi16(W, U, A, B) \ // ((__m256i) __builtin_ia32_pshuflw256_mask ((__v16hi)(__m256i)(A), (int)(B), \ // (__v16hi)(__m256i)(W), \ // (__mmask16)(U))) // #define _mm256_maskz_shufflelo_epi16(U, A, B) \ // ((__m256i) __builtin_ia32_pshuflw256_mask ((__v16hi)(__m256i)(A), (int)(B), \ // (__v16hi)(__m256i)_mm256_setzero_si256 (), \ // (__mmask16)(U))) // #define _mm_mask_shufflelo_epi16(W, U, A, B) \ // ((__m128i) __builtin_ia32_pshuflw128_mask ((__v8hi)(__m128i)(A), (int)(B), \ // (__v8hi)(__m128i)(W), \ // (__mmask8)(U))) // #define _mm_maskz_shufflelo_epi16(U, A, B) \ // ((__m128i) __builtin_ia32_pshuflw128_mask ((__v8hi)(__m128i)(A), (int)(B), \ // (__v8hi)(__m128i)_mm_setzero_si128 (), \ // (__mmask8)(U))) // #define _mm256_maskz_alignr_epi8(U, X, Y, N) \ // ((__m256i) __builtin_ia32_palignr256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)((N) * 8), \ // (__v4di)(__m256i)_mm256_setzero_si256 (), \ // (__mmask32)(U))) // #define _mm_mask_alignr_epi8(W, U, X, Y, N) \ // ((__m128i) __builtin_ia32_palignr128_mask ((__v2di)(__m128i)(X), \ // (__v2di)(__m128i)(Y), (int)((N) * 8), \ // (__v2di)(__m128i)(X), (__mmask16)(U))) // #define _mm_maskz_alignr_epi8(U, X, Y, N) \ // ((__m128i) __builtin_ia32_palignr128_mask ((__v2di)(__m128i)(X), \ // (__v2di)(__m128i)(Y), (int)((N) * 8), \ // (__v2di)(__m128i)_mm_setzero_si128 (), \ // (__mmask16)(U))) // #define _mm_mask_slli_epi16(W, U, X, C) \ // ((__m128i)__builtin_ia32_psllwi128_mask ((__v8hi)(__m128i)(X), (int)(C),\ // (__v8hi)(__m128i)(W),\ // (__mmask8)(U))) // #define _mm_maskz_slli_epi16(U, X, C) \ // ((__m128i)__builtin_ia32_psllwi128_mask ((__v8hi)(__m128i)(X), (int)(C),\ // (__v8hi)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)(U))) // #define _mm256_dbsad_epu8(X, Y, C) \ // ((__m256i) __builtin_ia32_dbpsadbw256_mask ((__v32qi)(__m256i) (X), \ // (__v32qi)(__m256i) (Y), (int) (C), \ // (__v16hi)(__m256i)_mm256_setzero_si256(),\ // (__mmask16)-1)) // #define _mm256_mask_slli_epi16(W, U, X, C) \ // ((__m256i)__builtin_ia32_psllwi256_mask ((__v16hi)(__m256i)(X), (int)(C),\ // (__v16hi)(__m256i)(W),\ // (__mmask16)(U))) // #define _mm256_maskz_slli_epi16(U, X, C) \ // ((__m256i)__builtin_ia32_psllwi256_mask ((__v16hi)(__m256i)(X), (int)(C),\ // (__v16hi)(__m256i)_mm256_setzero_si256 (),\ // (__mmask16)(U))) // #define _mm256_mask_dbsad_epu8(W, U, X, Y, C) \ // ((__m256i) __builtin_ia32_dbpsadbw256_mask ((__v32qi)(__m256i) (X), \ // (__v32qi)(__m256i) (Y), (int) (C), \ // (__v16hi)(__m256i)(W), \ // (__mmask16)(U))) // #define _mm256_maskz_dbsad_epu8(U, X, Y, C) \ // ((__m256i) __builtin_ia32_dbpsadbw256_mask ((__v32qi)(__m256i) (X), \ // (__v32qi)(__m256i) (Y), (int) (C), \ // (__v16hi)(__m256i)_mm256_setzero_si256(),\ // (__mmask16)(U))) // #define _mm_dbsad_epu8(X, Y, C) \ // ((__m128i) __builtin_ia32_dbpsadbw128_mask ((__v16qi)(__m128i) (X), \ // (__v16qi)(__m128i) (Y), (int) (C), \ // (__v8hi)(__m128i)_mm_setzero_si128(), \ // (__mmask8)-1)) // #define _mm_mask_dbsad_epu8(W, U, X, Y, C) \ // ((__m128i) __builtin_ia32_dbpsadbw128_mask ((__v16qi)(__m128i) (X), \ // (__v16qi)(__m128i) (Y), (int) (C), \ // (__v8hi)(__m128i)(W), \ // (__mmask8)(U))) // #define _mm_maskz_dbsad_epu8(U, X, Y, C) \ // ((__m128i) __builtin_ia32_dbpsadbw128_mask ((__v16qi)(__m128i) (X), \ // (__v16qi)(__m128i) (Y), (int) (C), \ // (__v8hi)(__m128i)_mm_setzero_si128(), \ // (__mmask8)(U))) // #define _mm_mask_blend_epi16(__U, __A, __W) \ // ((__m128i) __builtin_ia32_blendmw_128_mask ((__v8hi) (__A), \ // (__v8hi) (__W), \ // (__mmask8) (__U))) // #define _mm_mask_blend_epi8(__U, __A, __W) \ // ((__m128i) __builtin_ia32_blendmb_128_mask ((__v16qi) (__A), \ // (__v16qi) (__W), \ // (__mmask16) (__U))) // #define _mm256_mask_blend_epi16(__U, __A, __W) \ // ((__m256i) __builtin_ia32_blendmw_256_mask ((__v16hi) (__A), \ // (__v16hi) (__W), \ // (__mmask16) (__U))) // #define _mm256_mask_blend_epi8(__U, __A, __W) \ // ((__m256i) __builtin_ia32_blendmb_256_mask ((__v32qi) (__A), \ // (__v32qi) (__W), \ // (__mmask32) (__U))) // #define _mm_cmp_epi16_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi)(__m128i)(X), \ // (__v8hi)(__m128i)(Y), (int)(P),\ // (__mmask8)(-1))) // #define _mm_cmp_epi8_mask(X, Y, P) \ // ((__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi)(__m128i)(X), \ // (__v16qi)(__m128i)(Y), (int)(P),\ // (__mmask16)(-1))) // #define _mm256_cmp_epi16_mask(X, Y, P) \ // ((__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi)(__m256i)(X), \ // (__v16hi)(__m256i)(Y), (int)(P),\ // (__mmask16)(-1))) // #define _mm256_cmp_epi8_mask(X, Y, P) \ // ((__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi)(__m256i)(X), \ // (__v32qi)(__m256i)(Y), (int)(P),\ // (__mmask32)(-1))) // #define _mm_cmp_epu16_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi)(__m128i)(X), \ // (__v8hi)(__m128i)(Y), (int)(P),\ // (__mmask8)(-1))) // #define _mm_cmp_epu8_mask(X, Y, P) \ // ((__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi)(__m128i)(X), \ // (__v16qi)(__m128i)(Y), (int)(P),\ // (__mmask16)(-1))) // #define _mm256_cmp_epu16_mask(X, Y, P) \ // ((__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi)(__m256i)(X), \ // (__v16hi)(__m256i)(Y), (int)(P),\ // (__mmask16)(-1))) // #define _mm256_cmp_epu8_mask(X, Y, P) \ // ((__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi)(__m256i)(X), \ // (__v32qi)(__m256i)(Y), (int)(P),\ // (__mmask32)-1)) // #define _mm_mask_cmp_epi16_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi)(__m128i)(X), \ // (__v8hi)(__m128i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm_mask_cmp_epi8_mask(M, X, Y, P) \ // ((__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi)(__m128i)(X), \ // (__v16qi)(__m128i)(Y), (int)(P),\ // (__mmask16)(M))) // #define _mm256_mask_cmp_epi16_mask(M, X, Y, P) \ // ((__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi)(__m256i)(X), \ // (__v16hi)(__m256i)(Y), (int)(P),\ // (__mmask16)(M))) // #define _mm256_mask_cmp_epi8_mask(M, X, Y, P) \ // ((__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi)(__m256i)(X), \ // (__v32qi)(__m256i)(Y), (int)(P),\ // (__mmask32)(M))) // #define _mm_mask_cmp_epu16_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi)(__m128i)(X), \ // (__v8hi)(__m128i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm_mask_cmp_epu8_mask(M, X, Y, P) \ // ((__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi)(__m128i)(X), \ // (__v16qi)(__m128i)(Y), (int)(P),\ // (__mmask16)(M))) // #define _mm256_mask_cmp_epu16_mask(M, X, Y, P) \ // ((__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi)(__m256i)(X), \ // (__v16hi)(__m256i)(Y), (int)(P),\ // (__mmask16)(M))) // #define _mm256_mask_cmp_epu8_mask(M, X, Y, P) \ // ((__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi)(__m256i)(X), \ // (__v32qi)(__m256i)(Y), (int)(P),\ // (__mmask32)(M))) // #endif // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpneq_epi8_mask (__m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 4, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmplt_epi8_mask (__m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 1, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpge_epi8_mask (__m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 5, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmple_epi8_mask (__m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 2, // (__mmask32) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpneq_epi16_mask (__m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 4, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmplt_epi16_mask (__m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 1, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpge_epi16_mask (__m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 5, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmple_epi16_mask (__m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 2, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpneq_epu8_mask (__m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 4, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmplt_epu8_mask (__m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 1, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpge_epu8_mask (__m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 5, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmple_epu8_mask (__m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 2, // (__mmask16) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpneq_epu16_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmplt_epu16_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpge_epu16_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmple_epu16_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 2, // (__mmask8) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpneq_epi8_mask (__m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 4, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmplt_epi8_mask (__m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 1, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpge_epi8_mask (__m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 5, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmple_epi8_mask (__m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 2, // (__mmask16) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpneq_epi16_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmplt_epi16_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpge_epi16_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmple_epi16_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 2, // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mulhrs_epi16 (__m256i __W, __mmask16 __U, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_pmulhrsw256_mask ((__v16hi) __X, // (__v16hi) __Y, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mulhrs_epi16 (__mmask16 __U, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_pmulhrsw256_mask ((__v16hi) __X, // (__v16hi) __Y, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mulhi_epu16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmulhuw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mulhi_epu16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmulhuw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mulhi_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmulhw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mulhi_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmulhw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mulhi_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmulhw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mulhi_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmulhw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mulhi_epu16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmulhuw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mulhi_epu16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmulhuw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mulhrs_epi16 (__m128i __W, __mmask8 __U, __m128i __X, // __m128i __Y) // { // return (__m128i) __builtin_ia32_pmulhrsw128_mask ((__v8hi) __X, // (__v8hi) __Y, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mulhrs_epi16 (__mmask8 __U, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_pmulhrsw128_mask ((__v8hi) __X, // (__v8hi) __Y, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mullo_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmullw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mullo_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmullw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mullo_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmullw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mullo_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmullw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi8_epi16 (__m256i __W, __mmask16 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovsxbw256_mask ((__v16qi) __A, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi8_epi16 (__mmask16 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovsxbw256_mask ((__v16qi) __A, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi8_epi16 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsxbw128_mask ((__v16qi) __A, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi8_epi16 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsxbw128_mask ((__v16qi) __A, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepu8_epi16 (__m256i __W, __mmask16 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovzxbw256_mask ((__v16qi) __A, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepu8_epi16 (__mmask16 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovzxbw256_mask ((__v16qi) __A, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepu8_epi16 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovzxbw128_mask ((__v16qi) __A, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepu8_epi16 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovzxbw128_mask ((__v16qi) __A, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_avg_epu8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pavgb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_avg_epu8 (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pavgb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_avg_epu8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pavgb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_avg_epu8 (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pavgb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_avg_epu16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pavgw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_avg_epu16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pavgw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_avg_epu16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pavgw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_avg_epu16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pavgw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_add_epi8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_paddb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_add_epi8 (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_paddb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_add_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_paddw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_add_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_paddw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_adds_epi8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_paddsb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_adds_epi8 (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_paddsb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_adds_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_paddsw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_adds_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_paddsw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_adds_epu8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_paddusb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_adds_epu8 (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_paddusb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_adds_epu16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_paddusw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_adds_epu16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_paddusw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sub_epi8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psubb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sub_epi8 (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psubb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sub_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psubw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sub_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psubw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_subs_epi8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psubsb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_subs_epi8 (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psubsb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_subs_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psubsw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_subs_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psubsw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_subs_epu8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psubusb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_subs_epu8 (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psubusb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_subs_epu16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psubusw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_subs_epu16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psubusw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_add_epi8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_paddb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_add_epi8 (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_paddb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_add_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_paddw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_add_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_paddw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpackhi_epi8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_punpckhbw256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpackhi_epi8 (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_punpckhbw256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpackhi_epi8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_punpckhbw128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpackhi_epi8 (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_punpckhbw128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpackhi_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_punpckhwd256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpackhi_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_punpckhwd256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpackhi_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_punpckhwd128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpackhi_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_punpckhwd128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpacklo_epi8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_punpcklbw256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpacklo_epi8 (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_punpcklbw256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpacklo_epi8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_punpcklbw128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpacklo_epi8 (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_punpcklbw128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpacklo_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_punpcklwd256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpacklo_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_punpcklwd256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpacklo_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_punpcklwd128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpacklo_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_punpcklwd128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpeq_epi8_mask (__m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_pcmpeqb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpeq_epu8_mask (__m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __A, // (__v16qi) __B, 0, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpeq_epu8_mask (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __A, // (__v16qi) __B, 0, // __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpeq_epi8_mask (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_pcmpeqb128_mask ((__v16qi) __A, // (__v16qi) __B, // __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpeq_epu8_mask (__m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __A, // (__v32qi) __B, 0, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpeq_epi8_mask (__m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_pcmpeqb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpeq_epu8_mask (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __A, // (__v32qi) __B, 0, // __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpeq_epi8_mask (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_pcmpeqb256_mask ((__v32qi) __A, // (__v32qi) __B, // __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpeq_epu16_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __A, // (__v8hi) __B, 0, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpeq_epi16_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpeq_epu16_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __A, // (__v8hi) __B, 0, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpeq_epi16_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqw128_mask ((__v8hi) __A, // (__v8hi) __B, __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpeq_epu16_mask (__m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __A, // (__v16hi) __B, 0, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpeq_epi16_mask (__m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_pcmpeqw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpeq_epu16_mask (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __A, // (__v16hi) __B, 0, // __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpeq_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_pcmpeqw256_mask ((__v16hi) __A, // (__v16hi) __B, // __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpgt_epu8_mask (__m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __A, // (__v16qi) __B, 6, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpgt_epi8_mask (__m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_pcmpgtb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpgt_epu8_mask (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __A, // (__v16qi) __B, 6, // __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpgt_epi8_mask (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_pcmpgtb128_mask ((__v16qi) __A, // (__v16qi) __B, // __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpgt_epu8_mask (__m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __A, // (__v32qi) __B, 6, // (__mmask32) -1); // } extern __inline __mmask32 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_cmpgt_epi8_mask (__m256i __A, __m256i __B) { return (__mmask32) __builtin_ia32_pcmpgtb256_mask ((__v32qi) __A, (__v32qi) __B, (__mmask32) -1); } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpgt_epu8_mask (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __A, // (__v32qi) __B, 6, // __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpgt_epi8_mask (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_pcmpgtb256_mask ((__v32qi) __A, // (__v32qi) __B, // __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpgt_epu16_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __A, // (__v8hi) __B, 6, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpgt_epi16_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpgt_epu16_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __A, // (__v8hi) __B, 6, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpgt_epi16_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtw128_mask ((__v8hi) __A, // (__v8hi) __B, __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpgt_epu16_mask (__m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __A, // (__v16hi) __B, 6, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpgt_epi16_mask (__m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_pcmpgtw256_mask ((__v16hi) __A, // (__v16hi) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpgt_epu16_mask (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __A, // (__v16hi) __B, 6, // __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpgt_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_pcmpgtw256_mask ((__v16hi) __A, // (__v16hi) __B, // __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_testn_epi8_mask (__m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_ptestnmb128 ((__v16qi) __A, // (__v16qi) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_testn_epi8_mask (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__mmask16) __builtin_ia32_ptestnmb128 ((__v16qi) __A, // (__v16qi) __B, __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testn_epi8_mask (__m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_ptestnmb256 ((__v32qi) __A, // (__v32qi) __B, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_testn_epi8_mask (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__mmask32) __builtin_ia32_ptestnmb256 ((__v32qi) __A, // (__v32qi) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_testn_epi16_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestnmw128 ((__v8hi) __A, // (__v8hi) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_testn_epi16_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestnmw128 ((__v8hi) __A, // (__v8hi) __B, __U); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testn_epi16_mask (__m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_ptestnmw256 ((__v16hi) __A, // (__v16hi) __B, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_testn_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__mmask16) __builtin_ia32_ptestnmw256 ((__v16hi) __A, // (__v16hi) __B, __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shuffle_epi8 (__m256i __W, __mmask32 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pshufb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shuffle_epi8 (__mmask32 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pshufb256_mask ((__v32qi) __A, // (__v32qi) __B, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shuffle_epi8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pshufb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shuffle_epi8 (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pshufb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_packs_epi16 (__mmask32 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_packsswb256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v32qi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_packs_epi16 (__m256i __W, __mmask32 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_packsswb256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v32qi) __W, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_packs_epi16 (__mmask16 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_packsswb128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_packs_epi16 (__m128i __W, __mmask16 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_packsswb128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v16qi) __W, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_packus_epi16 (__mmask32 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_packuswb256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v32qi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_packus_epi16 (__m256i __W, __mmask32 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_packuswb256_mask ((__v16hi) __A, // (__v16hi) __B, // (__v32qi) __W, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_packus_epi16 (__mmask16 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_packuswb128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_packus_epi16 (__m128i __W, __mmask16 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_packuswb128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v16qi) __W, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_abs_epi8 (__m256i __W, __mmask32 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_pabsb256_mask ((__v32qi) __A, // (__v32qi) __W, // (__mmask32) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_abs_epi8 (__mmask32 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_pabsb256_mask ((__v32qi) __A, // (__v32qi) // _mm256_setzero_si256 (), // (__mmask32) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_abs_epi8 (__m128i __W, __mmask16 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pabsb128_mask ((__v16qi) __A, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_abs_epi8 (__mmask16 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pabsb128_mask ((__v16qi) __A, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_abs_epi16 (__m256i __W, __mmask16 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_pabsw256_mask ((__v16hi) __A, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_abs_epi16 (__mmask16 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_pabsw256_mask ((__v16hi) __A, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_abs_epi16 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pabsw128_mask ((__v8hi) __A, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_abs_epi16 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pabsw128_mask ((__v8hi) __A, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpneq_epu8_mask (__m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 4, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmplt_epu8_mask (__m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 1, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpge_epu8_mask (__m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 5, // (__mmask32) -1); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmple_epu8_mask (__m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 2, // (__mmask32) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpneq_epu16_mask (__m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 4, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmplt_epu16_mask (__m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 1, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpge_epu16_mask (__m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 5, // (__mmask16) -1); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmple_epu16_mask (__m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 2, // (__mmask16) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_storeu_epi16 (void *__P, __mmask16 __U, __m256i __A) // { // __builtin_ia32_storedquhi256_mask ((short *) __P, // (__v16hi) __A, // (__mmask16) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_storeu_epi16 (void *__P, __mmask8 __U, __m128i __A) // { // __builtin_ia32_storedquhi128_mask ((short *) __P, // (__v8hi) __A, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_adds_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_paddsw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_subs_epi8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psubsb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_subs_epi8 (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psubsb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_subs_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psubsw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_subs_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psubsw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_subs_epu8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psubusb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_subs_epu8 (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psubusb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_subs_epu16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psubusw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_subs_epu16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psubusw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srl_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m128i __B) // { // return (__m256i) __builtin_ia32_psrlw256_mask ((__v16hi) __A, // (__v8hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srl_epi16 (__mmask16 __U, __m256i __A, __m128i __B) // { // return (__m256i) __builtin_ia32_psrlw256_mask ((__v16hi) __A, // (__v8hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srl_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psrlw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srl_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psrlw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sra_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m128i __B) // { // return (__m256i) __builtin_ia32_psraw256_mask ((__v16hi) __A, // (__v8hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sra_epi16 (__mmask16 __U, __m256i __A, __m128i __B) // { // return (__m256i) __builtin_ia32_psraw256_mask ((__v16hi) __A, // (__v8hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sra_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psraw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sra_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psraw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_adds_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_paddsw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_adds_epu8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_paddusb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_adds_epu8 (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_paddusb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_adds_epu16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_paddusw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_adds_epu16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_paddusw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sub_epi8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psubb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sub_epi8 (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psubb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sub_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psubw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sub_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psubw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_adds_epi8 (__m128i __W, __mmask16 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_paddsb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_adds_epi8 (__mmask16 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_paddsb128_mask ((__v16qi) __A, // (__v16qi) __B, // (__v16qi) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepi16_epi8 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovwb128_mask ((__v8hi) __A, // (__v16qi)_mm_undefined_si128(), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi16_storeu_epi8 (void * __P, __mmask8 __M,__m128i __A) // { // __builtin_ia32_pmovwb128mem_mask ((__v8qi *) __P , (__v8hi) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi16_epi8 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovwb128_mask ((__v8hi) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi16_epi8 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovwb128_mask ((__v8hi) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srav_epi16 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psrav16hi_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srav_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psrav16hi_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srav_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psrav16hi_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_srav_epi16 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psrav8hi_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srav_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psrav8hi_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srav_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psrav8hi_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srlv_epi16 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psrlv16hi_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srlv_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psrlv16hi_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srlv_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psrlv16hi_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_srlv_epi16 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psrlv8hi_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srlv_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psrlv8hi_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srlv_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psrlv8hi_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sllv_epi16 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psllv16hi_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sllv_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psllv16hi_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sllv_epi16 (__mmask16 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psllv16hi_mask ((__v16hi) __A, // (__v16hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sllv_epi16 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psllv8hi_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sllv_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psllv8hi_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sllv_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psllv8hi_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sll_epi16 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psllw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sll_epi16 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psllw128_mask ((__v8hi) __A, // (__v8hi) __B, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sll_epi16 (__m256i __W, __mmask16 __U, __m256i __A, // __m128i __B) // { // return (__m256i) __builtin_ia32_psllw256_mask ((__v16hi) __A, // (__v8hi) __B, // (__v16hi) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sll_epi16 (__mmask16 __U, __m256i __A, __m128i __B) // { // return (__m256i) __builtin_ia32_psllw256_mask ((__v16hi) __A, // (__v8hi) __B, // (__v16hi) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_packus_epi32 (__mmask16 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_packusdw256_mask ((__v8si) __A, // (__v8si) __B, // (__v16hi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_packus_epi32 (__m256i __W, __mmask16 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_packusdw256_mask ((__v8si) __A, // (__v8si) __B, // (__v16hi) __W, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_packus_epi32 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_packusdw128_mask ((__v4si) __A, // (__v4si) __B, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_packus_epi32 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_packusdw128_mask ((__v4si) __A, // (__v4si) __B, // (__v8hi) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_packs_epi32 (__mmask16 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_packssdw256_mask ((__v8si) __A, // (__v8si) __B, // (__v16hi) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_packs_epi32 (__m256i __W, __mmask16 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_packssdw256_mask ((__v8si) __A, // (__v8si) __B, // (__v16hi) __W, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_packs_epi32 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_packssdw128_mask ((__v4si) __A, // (__v4si) __B, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_packs_epi32 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_packssdw128_mask ((__v4si) __A, // (__v4si) __B, // (__v8hi) __W, __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpneq_epu8_mask (__mmask16 __M, __m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 4, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmplt_epu8_mask (__mmask16 __M, __m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 1, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpge_epu8_mask (__mmask16 __M, __m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 5, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmple_epu8_mask (__mmask16 __M, __m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_ucmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 2, // (__mmask16) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpneq_epu16_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmplt_epu16_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpge_epu16_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmple_epu16_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpneq_epi8_mask (__mmask16 __M, __m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 4, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmplt_epi8_mask (__mmask16 __M, __m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 1, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpge_epi8_mask (__mmask16 __M, __m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 5, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmple_epi8_mask (__mmask16 __M, __m128i __X, __m128i __Y) // { // return (__mmask16) __builtin_ia32_cmpb128_mask ((__v16qi) __X, // (__v16qi) __Y, 2, // (__mmask16) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpneq_epi16_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmplt_epi16_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpge_epi16_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmple_epi16_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpw128_mask ((__v8hi) __X, // (__v8hi) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpneq_epu8_mask (__mmask32 __M, __m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 4, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmplt_epu8_mask (__mmask32 __M, __m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 1, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpge_epu8_mask (__mmask32 __M, __m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 5, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmple_epu8_mask (__mmask32 __M, __m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_ucmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 2, // (__mmask32) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpneq_epu16_mask (__mmask16 __M, __m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 4, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmplt_epu16_mask (__mmask16 __M, __m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 1, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpge_epu16_mask (__mmask16 __M, __m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 5, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmple_epu16_mask (__mmask16 __M, __m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_ucmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 2, // (__mmask16) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpneq_epi8_mask (__mmask32 __M, __m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 4, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmplt_epi8_mask (__mmask32 __M, __m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 1, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpge_epi8_mask (__mmask32 __M, __m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 5, // (__mmask32) __M); // } // extern __inline __mmask32 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmple_epi8_mask (__mmask32 __M, __m256i __X, __m256i __Y) // { // return (__mmask32) __builtin_ia32_cmpb256_mask ((__v32qi) __X, // (__v32qi) __Y, 2, // (__mmask32) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpneq_epi16_mask (__mmask16 __M, __m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 4, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmplt_epi16_mask (__mmask16 __M, __m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 1, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpge_epi16_mask (__mmask16 __M, __m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 5, // (__mmask16) __M); // } // extern __inline __mmask16 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmple_epi16_mask (__mmask16 __M, __m256i __X, __m256i __Y) // { // return (__mmask16) __builtin_ia32_cmpw256_mask ((__v16hi) __X, // (__v16hi) __Y, 2, // (__mmask16) __M); // } #ifdef __DISABLE_AVX512VLBW__ #undef __DISABLE_AVX512VLBW__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VLBW__ */ #endif /* _AVX512VLBWINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vldqintrin.h000066400000000000000000002020151517770275000201320ustar00rootroot00000000000000/* Copyright (C) 2014-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512VLDQINTRIN_H_INCLUDED #define _AVX512VLDQINTRIN_H_INCLUDED #if !defined(__AVX512VL__) || !defined(__AVX512DQ__) #pragma GCC push_options #pragma GCC target("avx512vl,avx512dq") #define __DISABLE_AVX512VLDQ__ #endif /* __AVX512VLDQ__ */ // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvttpd_epi64 (__m256d __A) // { // return (__m256i) __builtin_ia32_cvttpd2qq256_mask ((__v4df) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvttpd_epi64 (__m256i __W, __mmask8 __U, __m256d __A) // { // return (__m256i) __builtin_ia32_cvttpd2qq256_mask ((__v4df) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvttpd_epi64 (__mmask8 __U, __m256d __A) // { // return (__m256i) __builtin_ia32_cvttpd2qq256_mask ((__v4df) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttpd_epi64 (__m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2qq128_mask ((__v2df) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvttpd_epi64 (__m128i __W, __mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2qq128_mask ((__v2df) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvttpd_epi64 (__mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2qq128_mask ((__v2df) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvttpd_epu64 (__m256d __A) // { // return (__m256i) __builtin_ia32_cvttpd2uqq256_mask ((__v4df) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvttpd_epu64 (__m256i __W, __mmask8 __U, __m256d __A) // { // return (__m256i) __builtin_ia32_cvttpd2uqq256_mask ((__v4df) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvttpd_epu64 (__mmask8 __U, __m256d __A) // { // return (__m256i) __builtin_ia32_cvttpd2uqq256_mask ((__v4df) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttpd_epu64 (__m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2uqq128_mask ((__v2df) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvttpd_epu64 (__m128i __W, __mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2uqq128_mask ((__v2df) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvttpd_epu64 (__mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2uqq128_mask ((__v2df) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtpd_epi64 (__m256d __A) // { // return (__m256i) __builtin_ia32_cvtpd2qq256_mask ((__v4df) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtpd_epi64 (__m256i __W, __mmask8 __U, __m256d __A) // { // return (__m256i) __builtin_ia32_cvtpd2qq256_mask ((__v4df) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtpd_epi64 (__mmask8 __U, __m256d __A) // { // return (__m256i) __builtin_ia32_cvtpd2qq256_mask ((__v4df) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtpd_epi64 (__m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2qq128_mask ((__v2df) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtpd_epi64 (__m128i __W, __mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2qq128_mask ((__v2df) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtpd_epi64 (__mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2qq128_mask ((__v2df) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtpd_epu64 (__m256d __A) // { // return (__m256i) __builtin_ia32_cvtpd2uqq256_mask ((__v4df) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtpd_epu64 (__m256i __W, __mmask8 __U, __m256d __A) // { // return (__m256i) __builtin_ia32_cvtpd2uqq256_mask ((__v4df) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtpd_epu64 (__mmask8 __U, __m256d __A) // { // return (__m256i) __builtin_ia32_cvtpd2uqq256_mask ((__v4df) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtpd_epu64 (__m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2uqq128_mask ((__v2df) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtpd_epu64 (__m128i __W, __mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2uqq128_mask ((__v2df) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtpd_epu64 (__mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2uqq128_mask ((__v2df) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvttps_epi64 (__m128 __A) // { // return (__m256i) __builtin_ia32_cvttps2qq256_mask ((__v4sf) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvttps_epi64 (__m256i __W, __mmask8 __U, __m128 __A) // { // return (__m256i) __builtin_ia32_cvttps2qq256_mask ((__v4sf) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvttps_epi64 (__mmask8 __U, __m128 __A) // { // return (__m256i) __builtin_ia32_cvttps2qq256_mask ((__v4sf) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttps_epi64 (__m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2qq128_mask ((__v4sf) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvttps_epi64 (__m128i __W, __mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2qq128_mask ((__v4sf) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvttps_epi64 (__mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2qq128_mask ((__v4sf) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvttps_epu64 (__m128 __A) // { // return (__m256i) __builtin_ia32_cvttps2uqq256_mask ((__v4sf) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvttps_epu64 (__m256i __W, __mmask8 __U, __m128 __A) // { // return (__m256i) __builtin_ia32_cvttps2uqq256_mask ((__v4sf) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvttps_epu64 (__mmask8 __U, __m128 __A) // { // return (__m256i) __builtin_ia32_cvttps2uqq256_mask ((__v4sf) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttps_epu64 (__m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2uqq128_mask ((__v4sf) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvttps_epu64 (__m128i __W, __mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2uqq128_mask ((__v4sf) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvttps_epu64 (__mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2uqq128_mask ((__v4sf) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcast_f64x2 (__m128d __A) // { // return (__m256d) __builtin_ia32_broadcastf64x2_256_mask ((__v2df) // __A, // (__v4df)_mm256_undefined_pd(), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcast_f64x2 (__m256d __O, __mmask8 __M, __m128d __A) // { // return (__m256d) __builtin_ia32_broadcastf64x2_256_mask ((__v2df) // __A, // (__v4df) // __O, __M); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcast_f64x2 (__mmask8 __M, __m128d __A) // { // return (__m256d) __builtin_ia32_broadcastf64x2_256_mask ((__v2df) // __A, // (__v4df) // _mm256_setzero_ps (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcast_i64x2 (__m128i __A) // { // return (__m256i) __builtin_ia32_broadcasti64x2_256_mask ((__v2di) // __A, // (__v4di)_mm256_undefined_si256(), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcast_i64x2 (__m256i __O, __mmask8 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_broadcasti64x2_256_mask ((__v2di) // __A, // (__v4di) // __O, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcast_i64x2 (__mmask8 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_broadcasti64x2_256_mask ((__v2di) // __A, // (__v4di) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcast_f32x2 (__m128 __A) // { // return (__m256) __builtin_ia32_broadcastf32x2_256_mask ((__v4sf) __A, // (__v8sf)_mm256_undefined_ps(), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcast_f32x2 (__m256 __O, __mmask8 __M, __m128 __A) // { // return (__m256) __builtin_ia32_broadcastf32x2_256_mask ((__v4sf) __A, // (__v8sf) __O, // __M); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcast_f32x2 (__mmask8 __M, __m128 __A) // { // return (__m256) __builtin_ia32_broadcastf32x2_256_mask ((__v4sf) __A, // (__v8sf) // _mm256_setzero_ps (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcast_i32x2 (__m128i __A) // { // return (__m256i) __builtin_ia32_broadcasti32x2_256_mask ((__v4si) // __A, // (__v8si)_mm256_undefined_si256(), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcast_i32x2 (__m256i __O, __mmask8 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_broadcasti32x2_256_mask ((__v4si) // __A, // (__v8si) // __O, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcast_i32x2 (__mmask8 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_broadcasti32x2_256_mask ((__v4si) // __A, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_broadcast_i32x2 (__m128i __A) // { // return (__m128i) __builtin_ia32_broadcasti32x2_128_mask ((__v4si) // __A, // (__v4si)_mm_undefined_si128(), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_broadcast_i32x2 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_broadcasti32x2_128_mask ((__v4si) // __A, // (__v4si) // __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_broadcast_i32x2 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_broadcasti32x2_128_mask ((__v4si) // __A, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mullo_epi64 (__m256i __A, __m256i __B) // { // return (__m256i) ((__v4du) __A * (__v4du) __B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mullo_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmullq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mullo_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmullq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mullo_epi64 (__m128i __A, __m128i __B) // { // return (__m128i) ((__v2du) __A * (__v2du) __B); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mullo_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmullq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mullo_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmullq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_andnot_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_andnpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_andnot_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_andnpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_andnot_pd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B) // { // return (__m128d) __builtin_ia32_andnpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_andnot_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_andnpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_andnot_ps (__m256 __W, __mmask8 __U, __m256 __A, // __m256 __B) // { // return (__m256) __builtin_ia32_andnps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_andnot_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_andnps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_andnot_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_andnps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_andnot_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_andnps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtps_epi64 (__m128 __A) // { // return (__m256i) __builtin_ia32_cvtps2qq256_mask ((__v4sf) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtps_epi64 (__m256i __W, __mmask8 __U, __m128 __A) // { // return (__m256i) __builtin_ia32_cvtps2qq256_mask ((__v4sf) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtps_epi64 (__mmask8 __U, __m128 __A) // { // return (__m256i) __builtin_ia32_cvtps2qq256_mask ((__v4sf) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtps_epi64 (__m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2qq128_mask ((__v4sf) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtps_epi64 (__m128i __W, __mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2qq128_mask ((__v4sf) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtps_epi64 (__mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2qq128_mask ((__v4sf) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtps_epu64 (__m128 __A) // { // return (__m256i) __builtin_ia32_cvtps2uqq256_mask ((__v4sf) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtps_epu64 (__m256i __W, __mmask8 __U, __m128 __A) // { // return (__m256i) __builtin_ia32_cvtps2uqq256_mask ((__v4sf) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtps_epu64 (__mmask8 __U, __m128 __A) // { // return (__m256i) __builtin_ia32_cvtps2uqq256_mask ((__v4sf) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtps_epu64 (__m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2uqq128_mask ((__v4sf) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtps_epu64 (__m128i __W, __mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2uqq128_mask ((__v4sf) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtps_epu64 (__mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2uqq128_mask ((__v4sf) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi64_ps (__m256i __A) // { // return (__m128) __builtin_ia32_cvtqq2ps256_mask ((__v4di) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi64_ps (__m128 __W, __mmask8 __U, __m256i __A) // { // return (__m128) __builtin_ia32_cvtqq2ps256_mask ((__v4di) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi64_ps (__mmask8 __U, __m256i __A) // { // return (__m128) __builtin_ia32_cvtqq2ps256_mask ((__v4di) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepi64_ps (__m128i __A) // { // return (__m128) __builtin_ia32_cvtqq2ps128_mask ((__v2di) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi64_ps (__m128 __W, __mmask8 __U, __m128i __A) // { // return (__m128) __builtin_ia32_cvtqq2ps128_mask ((__v2di) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi64_ps (__mmask8 __U, __m128i __A) // { // return (__m128) __builtin_ia32_cvtqq2ps128_mask ((__v2di) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepu64_ps (__m256i __A) // { // return (__m128) __builtin_ia32_cvtuqq2ps256_mask ((__v4di) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepu64_ps (__m128 __W, __mmask8 __U, __m256i __A) // { // return (__m128) __builtin_ia32_cvtuqq2ps256_mask ((__v4di) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepu64_ps (__mmask8 __U, __m256i __A) // { // return (__m128) __builtin_ia32_cvtuqq2ps256_mask ((__v4di) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepu64_ps (__m128i __A) // { // return (__m128) __builtin_ia32_cvtuqq2ps128_mask ((__v2di) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepu64_ps (__m128 __W, __mmask8 __U, __m128i __A) // { // return (__m128) __builtin_ia32_cvtuqq2ps128_mask ((__v2di) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepu64_ps (__mmask8 __U, __m128i __A) // { // return (__m128) __builtin_ia32_cvtuqq2ps128_mask ((__v2di) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi64_pd (__m256i __A) // { // return (__m256d) __builtin_ia32_cvtqq2pd256_mask ((__v4di) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi64_pd (__m256d __W, __mmask8 __U, __m256i __A) // { // return (__m256d) __builtin_ia32_cvtqq2pd256_mask ((__v4di) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi64_pd (__mmask8 __U, __m256i __A) // { // return (__m256d) __builtin_ia32_cvtqq2pd256_mask ((__v4di) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepi64_pd (__m128i __A) // { // return (__m128d) __builtin_ia32_cvtqq2pd128_mask ((__v2di) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi64_pd (__m128d __W, __mmask8 __U, __m128i __A) // { // return (__m128d) __builtin_ia32_cvtqq2pd128_mask ((__v2di) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi64_pd (__mmask8 __U, __m128i __A) // { // return (__m128d) __builtin_ia32_cvtqq2pd128_mask ((__v2di) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepu64_pd (__m256i __A) // { // return (__m256d) __builtin_ia32_cvtuqq2pd256_mask ((__v4di) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepu64_pd (__m256d __W, __mmask8 __U, __m256i __A) // { // return (__m256d) __builtin_ia32_cvtuqq2pd256_mask ((__v4di) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepu64_pd (__mmask8 __U, __m256i __A) // { // return (__m256d) __builtin_ia32_cvtuqq2pd256_mask ((__v4di) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_and_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_andpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_and_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_andpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_and_pd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_andpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_and_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_andpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_and_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_andps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_and_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_andps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_and_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_andps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_and_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_andps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepu64_pd (__m128i __A) // { // return (__m128d) __builtin_ia32_cvtuqq2pd128_mask ((__v2di) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepu64_pd (__m128d __W, __mmask8 __U, __m128i __A) // { // return (__m128d) __builtin_ia32_cvtuqq2pd128_mask ((__v2di) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepu64_pd (__mmask8 __U, __m128i __A) // { // return (__m128d) __builtin_ia32_cvtuqq2pd128_mask ((__v2di) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_xor_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_xorpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_xor_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_xorpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_xor_pd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_xorpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_xor_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_xorpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_xor_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_xorps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_xor_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_xorps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_xor_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_xorps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_xor_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_xorps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_or_pd (__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_orpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_or_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_orpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_or_pd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_orpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_or_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_orpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_or_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_orps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_or_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_orps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_or_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_orps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_or_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_orps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_movm_epi32 (__mmask8 __A) // { // return (__m128i) __builtin_ia32_cvtmask2d128 (__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movm_epi32 (__mmask8 __A) // { // return (__m256i) __builtin_ia32_cvtmask2d256 (__A); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_movm_epi64 (__mmask8 __A) // { // return (__m128i) __builtin_ia32_cvtmask2q128 (__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movm_epi64 (__mmask8 __A) // { // return (__m256i) __builtin_ia32_cvtmask2q256 (__A); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_movepi32_mask (__m128i __A) // { // return (__mmask8) __builtin_ia32_cvtd2mask128 ((__v4si) __A); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movepi32_mask (__m256i __A) // { // return (__mmask8) __builtin_ia32_cvtd2mask256 ((__v8si) __A); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_movepi64_mask (__m128i __A) // { // return (__mmask8) __builtin_ia32_cvtq2mask128 ((__v2di) __A); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movepi64_mask (__m256i __A) // { // return (__mmask8) __builtin_ia32_cvtq2mask256 ((__v4di) __A); // } // #ifdef __OPTIMIZE__ // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_extractf64x2_pd (__m256d __A, const int __imm) // { // return (__m128d) __builtin_ia32_extractf64x2_256_mask ((__v4df) __A, // __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_extractf64x2_pd (__m128d __W, __mmask8 __U, __m256d __A, // const int __imm) // { // return (__m128d) __builtin_ia32_extractf64x2_256_mask ((__v4df) __A, // __imm, // (__v2df) __W, // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_extractf64x2_pd (__mmask8 __U, __m256d __A, // const int __imm) // { // return (__m128d) __builtin_ia32_extractf64x2_256_mask ((__v4df) __A, // __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_extracti64x2_epi64 (__m256i __A, const int __imm) // { // return (__m128i) __builtin_ia32_extracti64x2_256_mask ((__v4di) __A, // __imm, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_extracti64x2_epi64 (__m128i __W, __mmask8 __U, __m256i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_extracti64x2_256_mask ((__v4di) __A, // __imm, // (__v2di) __W, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_extracti64x2_epi64 (__mmask8 __U, __m256i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_extracti64x2_256_mask ((__v4di) __A, // __imm, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) // __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_reduce_pd (__m256d __A, int __B) // { // return (__m256d) __builtin_ia32_reducepd256_mask ((__v4df) __A, __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_reduce_pd (__m256d __W, __mmask8 __U, __m256d __A, int __B) // { // return (__m256d) __builtin_ia32_reducepd256_mask ((__v4df) __A, __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_reduce_pd (__mmask8 __U, __m256d __A, int __B) // { // return (__m256d) __builtin_ia32_reducepd256_mask ((__v4df) __A, __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_reduce_pd (__m128d __A, int __B) // { // return (__m128d) __builtin_ia32_reducepd128_mask ((__v2df) __A, __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_reduce_pd (__m128d __W, __mmask8 __U, __m128d __A, int __B) // { // return (__m128d) __builtin_ia32_reducepd128_mask ((__v2df) __A, __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_reduce_pd (__mmask8 __U, __m128d __A, int __B) // { // return (__m128d) __builtin_ia32_reducepd128_mask ((__v2df) __A, __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_reduce_ps (__m256 __A, int __B) // { // return (__m256) __builtin_ia32_reduceps256_mask ((__v8sf) __A, __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_reduce_ps (__m256 __W, __mmask8 __U, __m256 __A, int __B) // { // return (__m256) __builtin_ia32_reduceps256_mask ((__v8sf) __A, __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_reduce_ps (__mmask8 __U, __m256 __A, int __B) // { // return (__m256) __builtin_ia32_reduceps256_mask ((__v8sf) __A, __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_reduce_ps (__m128 __A, int __B) // { // return (__m128) __builtin_ia32_reduceps128_mask ((__v4sf) __A, __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_reduce_ps (__m128 __W, __mmask8 __U, __m128 __A, int __B) // { // return (__m128) __builtin_ia32_reduceps128_mask ((__v4sf) __A, __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_reduce_ps (__mmask8 __U, __m128 __A, int __B) // { // return (__m128) __builtin_ia32_reduceps128_mask ((__v4sf) __A, __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_range_pd (__m256d __A, __m256d __B, int __C) // { // return (__m256d) __builtin_ia32_rangepd256_mask ((__v4df) __A, // (__v4df) __B, __C, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_range_pd (__m256d __W, __mmask8 __U, // __m256d __A, __m256d __B, int __C) // { // return (__m256d) __builtin_ia32_rangepd256_mask ((__v4df) __A, // (__v4df) __B, __C, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_range_pd (__mmask8 __U, __m256d __A, __m256d __B, int __C) // { // return (__m256d) __builtin_ia32_rangepd256_mask ((__v4df) __A, // (__v4df) __B, __C, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_range_pd (__m128d __A, __m128d __B, int __C) // { // return (__m128d) __builtin_ia32_rangepd128_mask ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_range_pd (__m128d __W, __mmask8 __U, // __m128d __A, __m128d __B, int __C) // { // return (__m128d) __builtin_ia32_rangepd128_mask ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_range_pd (__mmask8 __U, __m128d __A, __m128d __B, int __C) // { // return (__m128d) __builtin_ia32_rangepd128_mask ((__v2df) __A, // (__v2df) __B, __C, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_range_ps (__m256 __A, __m256 __B, int __C) // { // return (__m256) __builtin_ia32_rangeps256_mask ((__v8sf) __A, // (__v8sf) __B, __C, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_range_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B, // int __C) // { // return (__m256) __builtin_ia32_rangeps256_mask ((__v8sf) __A, // (__v8sf) __B, __C, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_range_ps (__mmask8 __U, __m256 __A, __m256 __B, int __C) // { // return (__m256) __builtin_ia32_rangeps256_mask ((__v8sf) __A, // (__v8sf) __B, __C, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_range_ps (__m128 __A, __m128 __B, int __C) // { // return (__m128) __builtin_ia32_rangeps128_mask ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_range_ps (__m128 __W, __mmask8 __U, // __m128 __A, __m128 __B, int __C) // { // return (__m128) __builtin_ia32_rangeps128_mask ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_range_ps (__mmask8 __U, __m128 __A, __m128 __B, int __C) // { // return (__m128) __builtin_ia32_rangeps128_mask ((__v4sf) __A, // (__v4sf) __B, __C, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fpclass_pd_mask (__mmask8 __U, __m256d __A, // const int __imm) // { // return (__mmask8) __builtin_ia32_fpclasspd256_mask ((__v4df) __A, // __imm, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fpclass_pd_mask (__m256d __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclasspd256_mask ((__v4df) __A, // __imm, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fpclass_ps_mask (__mmask8 __U, __m256 __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclassps256_mask ((__v8sf) __A, // __imm, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fpclass_ps_mask (__m256 __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclassps256_mask ((__v8sf) __A, // __imm, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fpclass_pd_mask (__mmask8 __U, __m128d __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclasspd128_mask ((__v2df) __A, // __imm, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fpclass_pd_mask (__m128d __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclasspd128_mask ((__v2df) __A, // __imm, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fpclass_ps_mask (__mmask8 __U, __m128 __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclassps128_mask ((__v4sf) __A, // __imm, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fpclass_ps_mask (__m128 __A, const int __imm) // { // return (__mmask8) __builtin_ia32_fpclassps128_mask ((__v4sf) __A, // __imm, // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_inserti64x2 (__m256i __A, __m128i __B, const int __imm) // { // return (__m256i) __builtin_ia32_inserti64x2_256_mask ((__v4di) __A, // (__v2di) __B, // __imm, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_inserti64x2 (__m256i __W, __mmask8 __U, __m256i __A, // __m128i __B, const int __imm) // { // return (__m256i) __builtin_ia32_inserti64x2_256_mask ((__v4di) __A, // (__v2di) __B, // __imm, // (__v4di) __W, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_inserti64x2 (__mmask8 __U, __m256i __A, __m128i __B, // const int __imm) // { // return (__m256i) __builtin_ia32_inserti64x2_256_mask ((__v4di) __A, // (__v2di) __B, // __imm, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) // __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_insertf64x2 (__m256d __A, __m128d __B, const int __imm) // { // return (__m256d) __builtin_ia32_insertf64x2_256_mask ((__v4df) __A, // (__v2df) __B, // __imm, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_insertf64x2 (__m256d __W, __mmask8 __U, __m256d __A, // __m128d __B, const int __imm) // { // return (__m256d) __builtin_ia32_insertf64x2_256_mask ((__v4df) __A, // (__v2df) __B, // __imm, // (__v4df) __W, // (__mmask8) // __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_insertf64x2 (__mmask8 __U, __m256d __A, __m128d __B, // const int __imm) // { // return (__m256d) __builtin_ia32_insertf64x2_256_mask ((__v4df) __A, // (__v2df) __B, // __imm, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) // __U); // } // #else // #define _mm256_insertf64x2(X, Y, C) \ // ((__m256d) __builtin_ia32_insertf64x2_256_mask ((__v4df)(__m256d) (X),\ // (__v2df)(__m128d) (Y), (int) (C), \ // (__v4df)(__m256d)_mm256_setzero_pd(), \ // (__mmask8)-1)) // #define _mm256_mask_insertf64x2(W, U, X, Y, C) \ // ((__m256d) __builtin_ia32_insertf64x2_256_mask ((__v4df)(__m256d) (X),\ // (__v2df)(__m128d) (Y), (int) (C), \ // (__v4df)(__m256d)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_insertf64x2(U, X, Y, C) \ // ((__m256d) __builtin_ia32_insertf64x2_256_mask ((__v4df)(__m256d) (X),\ // (__v2df)(__m128d) (Y), (int) (C), \ // (__v4df)(__m256d)_mm256_setzero_pd(), \ // (__mmask8)(U))) // #define _mm256_inserti64x2(X, Y, C) \ // ((__m256i) __builtin_ia32_inserti64x2_256_mask ((__v4di)(__m256i) (X),\ // (__v2di)(__m128i) (Y), (int) (C), \ // (__v4di)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)-1)) // #define _mm256_mask_inserti64x2(W, U, X, Y, C) \ // ((__m256i) __builtin_ia32_inserti64x2_256_mask ((__v4di)(__m256i) (X),\ // (__v2di)(__m128i) (Y), (int) (C), \ // (__v4di)(__m256i)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_inserti64x2(U, X, Y, C) \ // ((__m256i) __builtin_ia32_inserti64x2_256_mask ((__v4di)(__m256i) (X),\ // (__v2di)(__m128i) (Y), (int) (C), \ // (__v4di)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)(U))) // #define _mm256_extractf64x2_pd(X, C) \ // ((__m128d) __builtin_ia32_extractf64x2_256_mask ((__v4df)(__m256d) (X),\ // (int) (C), (__v2df)(__m128d) _mm_setzero_pd(), (__mmask8)-1)) // #define _mm256_mask_extractf64x2_pd(W, U, X, C) \ // ((__m128d) __builtin_ia32_extractf64x2_256_mask ((__v4df)(__m256d) (X),\ // (int) (C), (__v2df)(__m128d) (W), (__mmask8) (U))) // #define _mm256_maskz_extractf64x2_pd(U, X, C) \ // ((__m128d) __builtin_ia32_extractf64x2_256_mask ((__v4df)(__m256d) (X),\ // (int) (C), (__v2df)(__m128d) _mm_setzero_pd(), (__mmask8) (U))) // #define _mm256_extracti64x2_epi64(X, C) \ // ((__m128i) __builtin_ia32_extracti64x2_256_mask ((__v4di)(__m256i) (X),\ // (int) (C), (__v2di)(__m128i) _mm_setzero_si128 (), (__mmask8)-1)) // #define _mm256_mask_extracti64x2_epi64(W, U, X, C) \ // ((__m128i) __builtin_ia32_extracti64x2_256_mask ((__v4di)(__m256i) (X),\ // (int) (C), (__v2di)(__m128i) (W), (__mmask8) (U))) // #define _mm256_maskz_extracti64x2_epi64(U, X, C) \ // ((__m128i) __builtin_ia32_extracti64x2_256_mask ((__v4di)(__m256i) (X),\ // (int) (C), (__v2di)(__m128i) _mm_setzero_si128 (), (__mmask8) (U))) // #define _mm256_reduce_pd(A, B) \ // ((__m256d) __builtin_ia32_reducepd256_mask ((__v4df)(__m256d)(A), \ // (int)(B), (__v4df)_mm256_setzero_pd(), (__mmask8)-1)) // #define _mm256_mask_reduce_pd(W, U, A, B) \ // ((__m256d) __builtin_ia32_reducepd256_mask ((__v4df)(__m256d)(A), \ // (int)(B), (__v4df)(__m256d)(W), (__mmask8)(U))) // #define _mm256_maskz_reduce_pd(U, A, B) \ // ((__m256d) __builtin_ia32_reducepd256_mask ((__v4df)(__m256d)(A), \ // (int)(B), (__v4df)_mm256_setzero_pd(), (__mmask8)(U))) // #define _mm_reduce_pd(A, B) \ // ((__m128d) __builtin_ia32_reducepd128_mask ((__v2df)(__m128d)(A), \ // (int)(B), (__v2df)_mm_setzero_pd(), (__mmask8)-1)) // #define _mm_mask_reduce_pd(W, U, A, B) \ // ((__m128d) __builtin_ia32_reducepd128_mask ((__v2df)(__m128d)(A), \ // (int)(B), (__v2df)(__m128d)(W), (__mmask8)(U))) // #define _mm_maskz_reduce_pd(U, A, B) \ // ((__m128d) __builtin_ia32_reducepd128_mask ((__v2df)(__m128d)(A), \ // (int)(B), (__v2df)_mm_setzero_pd(), (__mmask8)(U))) // #define _mm256_reduce_ps(A, B) \ // ((__m256) __builtin_ia32_reduceps256_mask ((__v8sf)(__m256)(A), \ // (int)(B), (__v8sf)_mm256_setzero_ps(), (__mmask8)-1)) // #define _mm256_mask_reduce_ps(W, U, A, B) \ // ((__m256) __builtin_ia32_reduceps256_mask ((__v8sf)(__m256)(A), \ // (int)(B), (__v8sf)(__m256)(W), (__mmask8)(U))) // #define _mm256_maskz_reduce_ps(U, A, B) \ // ((__m256) __builtin_ia32_reduceps256_mask ((__v8sf)(__m256)(A), \ // (int)(B), (__v8sf)_mm256_setzero_ps(), (__mmask8)(U))) // #define _mm_reduce_ps(A, B) \ // ((__m128) __builtin_ia32_reduceps128_mask ((__v4sf)(__m128)(A), \ // (int)(B), (__v4sf)_mm_setzero_ps(), (__mmask8)-1)) // #define _mm_mask_reduce_ps(W, U, A, B) \ // ((__m128) __builtin_ia32_reduceps128_mask ((__v4sf)(__m128)(A), \ // (int)(B), (__v4sf)(__m128)(W), (__mmask8)(U))) // #define _mm_maskz_reduce_ps(U, A, B) \ // ((__m128) __builtin_ia32_reduceps128_mask ((__v4sf)(__m128)(A), \ // (int)(B), (__v4sf)_mm_setzero_ps(), (__mmask8)(U))) // #define _mm256_range_pd(A, B, C) \ // ((__m256d) __builtin_ia32_rangepd256_mask ((__v4df)(__m256d)(A), \ // (__v4df)(__m256d)(B), (int)(C), \ // (__v4df)_mm256_setzero_pd(), (__mmask8)-1)) // #define _mm256_maskz_range_pd(U, A, B, C) \ // ((__m256d) __builtin_ia32_rangepd256_mask ((__v4df)(__m256d)(A), \ // (__v4df)(__m256d)(B), (int)(C), \ // (__v4df)_mm256_setzero_pd(), (__mmask8)(U))) // #define _mm_range_pd(A, B, C) \ // ((__m128d) __builtin_ia32_rangepd128_mask ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), \ // (__v2df)_mm_setzero_pd(), (__mmask8)-1)) // #define _mm256_range_ps(A, B, C) \ // ((__m256) __builtin_ia32_rangeps256_mask ((__v8sf)(__m256)(A), \ // (__v8sf)(__m256)(B), (int)(C), \ // (__v8sf)_mm256_setzero_ps(), (__mmask8)-1)) // #define _mm256_mask_range_ps(W, U, A, B, C) \ // ((__m256) __builtin_ia32_rangeps256_mask ((__v8sf)(__m256)(A), \ // (__v8sf)(__m256)(B), (int)(C), \ // (__v8sf)(__m256)(W), (__mmask8)(U))) // #define _mm256_maskz_range_ps(U, A, B, C) \ // ((__m256) __builtin_ia32_rangeps256_mask ((__v8sf)(__m256)(A), \ // (__v8sf)(__m256)(B), (int)(C), \ // (__v8sf)_mm256_setzero_ps(), (__mmask8)(U))) // #define _mm_range_ps(A, B, C) \ // ((__m128) __builtin_ia32_rangeps128_mask ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), \ // (__v4sf)_mm_setzero_ps(), (__mmask8)-1)) // #define _mm_mask_range_ps(W, U, A, B, C) \ // ((__m128) __builtin_ia32_rangeps128_mask ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), \ // (__v4sf)(__m128)(W), (__mmask8)(U))) // #define _mm_maskz_range_ps(U, A, B, C) \ // ((__m128) __builtin_ia32_rangeps128_mask ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), \ // (__v4sf)_mm_setzero_ps(), (__mmask8)(U))) // #define _mm256_mask_range_pd(W, U, A, B, C) \ // ((__m256d) __builtin_ia32_rangepd256_mask ((__v4df)(__m256d)(A), \ // (__v4df)(__m256d)(B), (int)(C), \ // (__v4df)(__m256d)(W), (__mmask8)(U))) // #define _mm_mask_range_pd(W, U, A, B, C) \ // ((__m128d) __builtin_ia32_rangepd128_mask ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), \ // (__v2df)(__m128d)(W), (__mmask8)(U))) // #define _mm_maskz_range_pd(U, A, B, C) \ // ((__m128d) __builtin_ia32_rangepd128_mask ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), \ // (__v2df)_mm_setzero_pd(), (__mmask8)(U))) // #define _mm256_mask_fpclass_pd_mask(u, X, C) \ // ((__mmask8) __builtin_ia32_fpclasspd256_mask ((__v4df) (__m256d) (X), \ // (int) (C),(__mmask8)(u))) // #define _mm256_mask_fpclass_ps_mask(u, X, C) \ // ((__mmask8) __builtin_ia32_fpclassps256_mask ((__v8sf) (__m256) (X), \ // (int) (C),(__mmask8)(u))) // #define _mm_mask_fpclass_pd_mask(u, X, C) \ // ((__mmask8) __builtin_ia32_fpclasspd128_mask ((__v2df) (__m128d) (X), \ // (int) (C),(__mmask8)(u))) // #define _mm_mask_fpclass_ps_mask(u, X, C) \ // ((__mmask8) __builtin_ia32_fpclassps128_mask ((__v4sf) (__m128) (X), \ // (int) (C),(__mmask8)(u))) // #define _mm256_fpclass_pd_mask(X, C) \ // ((__mmask8) __builtin_ia32_fpclasspd256_mask ((__v4df) (__m256d) (X), \ // (int) (C),(__mmask8)-1)) // #define _mm256_fpclass_ps_mask(X, C) \ // ((__mmask8) __builtin_ia32_fpclassps256_mask ((__v8sf) (__m256) (X), \ // (int) (C),(__mmask8)-1)) // #define _mm_fpclass_pd_mask(X, C) \ // ((__mmask8) __builtin_ia32_fpclasspd128_mask ((__v2df) (__m128d) (X), \ // (int) (C),(__mmask8)-1)) // #define _mm_fpclass_ps_mask(X, C) \ // ((__mmask8) __builtin_ia32_fpclassps128_mask ((__v4sf) (__m128) (X), \ // (int) (C),(__mmask8)-1)) // #endif #ifdef __DISABLE_AVX512VLDQ__ #undef __DISABLE_AVX512VLDQ__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VLDQ__ */ #endif /* _AVX512VLDQINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vlintrin.h000066400000000000000000016077421517770275000176260ustar00rootroot00000000000000/* Copyright (C) 2014-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512VLINTRIN_H_INCLUDED #define _AVX512VLINTRIN_H_INCLUDED #ifndef __AVX512VL__ #pragma GCC push_options #pragma GCC target("avx512vl") #define __DISABLE_AVX512VL__ #endif /* __AVX512VL__ */ /* Internal data types for implementing the intrinsics. */ typedef unsigned int __mmask32; // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mov_pd (__m256d __W, __mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_movapd256_mask ((__v4df) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mov_pd (__mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_movapd256_mask ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mov_pd (__m128d __W, __mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_movapd128_mask ((__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mov_pd (__mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_movapd128_mask ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_load_pd (__m256d __W, __mmask8 __U, void const *__P) // { // return (__m256d) __builtin_ia32_loadapd256_mask ((__v4df *) __P, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_load_pd (__mmask8 __U, void const *__P) // { // return (__m256d) __builtin_ia32_loadapd256_mask ((__v4df *) __P, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_load_pd (__m128d __W, __mmask8 __U, void const *__P) // { // return (__m128d) __builtin_ia32_loadapd128_mask ((__v2df *) __P, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_load_pd (__mmask8 __U, void const *__P) // { // return (__m128d) __builtin_ia32_loadapd128_mask ((__v2df *) __P, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_store_pd (void *__P, __mmask8 __U, __m256d __A) // { // __builtin_ia32_storeapd256_mask ((__v4df *) __P, // (__v4df) __A, // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_store_pd (void *__P, __mmask8 __U, __m128d __A) // { // __builtin_ia32_storeapd128_mask ((__v2df *) __P, // (__v2df) __A, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mov_ps (__m256 __W, __mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_movaps256_mask ((__v8sf) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mov_ps (__mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_movaps256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mov_ps (__m128 __W, __mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_movaps128_mask ((__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mov_ps (__mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_movaps128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_load_ps (__m256 __W, __mmask8 __U, void const *__P) // { // return (__m256) __builtin_ia32_loadaps256_mask ((__v8sf *) __P, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_load_ps (__mmask8 __U, void const *__P) // { // return (__m256) __builtin_ia32_loadaps256_mask ((__v8sf *) __P, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_load_ps (__m128 __W, __mmask8 __U, void const *__P) // { // return (__m128) __builtin_ia32_loadaps128_mask ((__v4sf *) __P, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_load_ps (__mmask8 __U, void const *__P) // { // return (__m128) __builtin_ia32_loadaps128_mask ((__v4sf *) __P, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_store_ps (void *__P, __mmask8 __U, __m256 __A) // { // __builtin_ia32_storeaps256_mask ((__v8sf *) __P, // (__v8sf) __A, // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_store_ps (void *__P, __mmask8 __U, __m128 __A) // { // __builtin_ia32_storeaps128_mask ((__v4sf *) __P, // (__v4sf) __A, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mov_epi64 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_movdqa64_256_mask ((__v4di) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mov_epi64 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_movdqa64_256_mask ((__v4di) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mov_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_movdqa64_128_mask ((__v2di) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mov_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_movdqa64_128_mask ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_load_epi64 (__m256i __W, __mmask8 __U, void const *__P) // { // return (__m256i) __builtin_ia32_movdqa64load256_mask ((__v4di *) __P, // (__v4di) __W, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_load_epi64 (__mmask8 __U, void const *__P) // { // return (__m256i) __builtin_ia32_movdqa64load256_mask ((__v4di *) __P, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_load_epi64 (__m128i __W, __mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_movdqa64load128_mask ((__v2di *) __P, // (__v2di) __W, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_load_epi64 (__mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_movdqa64load128_mask ((__v2di *) __P, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) // __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_store_epi64 (void *__P, __mmask8 __U, __m256i __A) // { // __builtin_ia32_movdqa64store256_mask ((__v4di *) __P, // (__v4di) __A, // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_store_epi64 (void *__P, __mmask8 __U, __m128i __A) // { // __builtin_ia32_movdqa64store128_mask ((__v2di *) __P, // (__v2di) __A, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mov_epi32 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_movdqa32_256_mask ((__v8si) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mov_epi32 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_movdqa32_256_mask ((__v8si) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mov_epi32 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_movdqa32_128_mask ((__v4si) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mov_epi32 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_movdqa32_128_mask ((__v4si) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_load_epi32 (__m256i __W, __mmask8 __U, void const *__P) // { // return (__m256i) __builtin_ia32_movdqa32load256_mask ((__v8si *) __P, // (__v8si) __W, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_load_epi32 (__mmask8 __U, void const *__P) // { // return (__m256i) __builtin_ia32_movdqa32load256_mask ((__v8si *) __P, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_load_epi32 (__m128i __W, __mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_movdqa32load128_mask ((__v4si *) __P, // (__v4si) __W, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_load_epi32 (__mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_movdqa32load128_mask ((__v4si *) __P, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) // __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_store_epi32 (void *__P, __mmask8 __U, __m256i __A) // { // __builtin_ia32_movdqa32store256_mask ((__v8si *) __P, // (__v8si) __A, // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_store_epi32 (void *__P, __mmask8 __U, __m128i __A) // { // __builtin_ia32_movdqa32store128_mask ((__v4si *) __P, // (__v4si) __A, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_add_pd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_addpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_add_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_addpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_add_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_addpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_add_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_addpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_add_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_addps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_add_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_addps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_add_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_addps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_add_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_addps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sub_pd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_subpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sub_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_subpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sub_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_subpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sub_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_subpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sub_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_subps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sub_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_subps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sub_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_subps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sub_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_subps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_store_epi64 (void *__P, __m256i __A) // { // *(__m256i *) __P = __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_store_epi64 (void *__P, __m128i __A) // { // *(__m128i *) __P = __A; // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_loadu_pd (__m256d __W, __mmask8 __U, void const *__P) // { // return (__m256d) __builtin_ia32_loadupd256_mask ((const double *) __P, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_loadu_pd (__mmask8 __U, void const *__P) // { // return (__m256d) __builtin_ia32_loadupd256_mask ((const double *) __P, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_loadu_pd (__m128d __W, __mmask8 __U, void const *__P) // { // return (__m128d) __builtin_ia32_loadupd128_mask ((const double *) __P, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_loadu_pd (__mmask8 __U, void const *__P) // { // return (__m128d) __builtin_ia32_loadupd128_mask ((const double *) __P, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_storeu_pd (void *__P, __mmask8 __U, __m256d __A) // { // __builtin_ia32_storeupd256_mask ((double *) __P, // (__v4df) __A, // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_storeu_pd (void *__P, __mmask8 __U, __m128d __A) // { // __builtin_ia32_storeupd128_mask ((double *) __P, // (__v2df) __A, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_loadu_ps (__m256 __W, __mmask8 __U, void const *__P) // { // return (__m256) __builtin_ia32_loadups256_mask ((const float *) __P, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_loadu_ps (__mmask8 __U, void const *__P) // { // return (__m256) __builtin_ia32_loadups256_mask ((const float *) __P, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_loadu_ps (__m128 __W, __mmask8 __U, void const *__P) // { // return (__m128) __builtin_ia32_loadups128_mask ((const float *) __P, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_loadu_ps (__mmask8 __U, void const *__P) // { // return (__m128) __builtin_ia32_loadups128_mask ((const float *) __P, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_storeu_ps (void *__P, __mmask8 __U, __m256 __A) // { // __builtin_ia32_storeups256_mask ((float *) __P, // (__v8sf) __A, // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_storeu_ps (void *__P, __mmask8 __U, __m128 __A) // { // __builtin_ia32_storeups128_mask ((float *) __P, // (__v4sf) __A, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_loadu_epi64 (__m256i __W, __mmask8 __U, void const *__P) // { // return (__m256i) __builtin_ia32_loaddqudi256_mask ((const long long *) __P, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_loadu_epi64 (__mmask8 __U, void const *__P) // { // return (__m256i) __builtin_ia32_loaddqudi256_mask ((const long long *) __P, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_loadu_epi64 (__m128i __W, __mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_loaddqudi128_mask ((const long long *) __P, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_loadu_epi64 (__mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_loaddqudi128_mask ((const long long *) __P, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_storeu_epi64 (void *__P, __m256i __A) // { // *(__m256i_u *) __P = (__m256i_u) __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_storeu_epi64 (void *__P, __mmask8 __U, __m256i __A) // { // __builtin_ia32_storedqudi256_mask ((long long *) __P, // (__v4di) __A, // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_storeu_epi64 (void *__P, __m128i __A) // { // *(__m128i_u *) __P = (__m128i_u) __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_storeu_epi64 (void *__P, __mmask8 __U, __m128i __A) // { // __builtin_ia32_storedqudi128_mask ((long long *) __P, // (__v2di) __A, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_loadu_epi32 (__m256i __W, __mmask8 __U, void const *__P) // { // return (__m256i) __builtin_ia32_loaddqusi256_mask ((const int *) __P, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_loadu_epi32 (__mmask8 __U, void const *__P) // { // return (__m256i) __builtin_ia32_loaddqusi256_mask ((const int *) __P, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_loadu_epi32 (__m128i __W, __mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_loaddqusi128_mask ((const int *) __P, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_loadu_epi32 (__mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_loaddqusi128_mask ((const int *) __P, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_storeu_epi32 (void *__P, __m256i __A) // { // *(__m256i_u *) __P = (__m256i_u) __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_storeu_epi32 (void *__P, __mmask8 __U, __m256i __A) // { // __builtin_ia32_storedqusi256_mask ((int *) __P, // (__v8si) __A, // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_storeu_epi32 (void *__P, __m128i __A) // { // *(__m128i_u *) __P = (__m128i_u) __A; // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_storeu_epi32 (void *__P, __mmask8 __U, __m128i __A) // { // __builtin_ia32_storedqusi128_mask ((int *) __P, // (__v4si) __A, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_abs_epi32 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_pabsd256_mask ((__v8si) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_abs_epi32 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_pabsd256_mask ((__v8si) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_abs_epi32 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pabsd128_mask ((__v4si) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_abs_epi32 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pabsd128_mask ((__v4si) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_abs_epi64 (__m256i __A) // { // return (__m256i) __builtin_ia32_pabsq256_mask ((__v4di) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_abs_epi64 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_pabsq256_mask ((__v4di) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_abs_epi64 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_pabsq256_mask ((__v4di) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_abs_epi64 (__m128i __A) // { // return (__m128i) __builtin_ia32_pabsq128_mask ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_abs_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pabsq128_mask ((__v2di) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_abs_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pabsq128_mask ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtpd_epu32 (__m256d __A) // { // return (__m128i) __builtin_ia32_cvtpd2udq256_mask ((__v4df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtpd_epu32 (__m128i __W, __mmask8 __U, __m256d __A) // { // return (__m128i) __builtin_ia32_cvtpd2udq256_mask ((__v4df) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtpd_epu32 (__mmask8 __U, __m256d __A) // { // return (__m128i) __builtin_ia32_cvtpd2udq256_mask ((__v4df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtpd_epu32 (__m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2udq128_mask ((__v2df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtpd_epu32 (__m128i __W, __mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2udq128_mask ((__v2df) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtpd_epu32 (__mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2udq128_mask ((__v2df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvttps_epi32 (__m256i __W, __mmask8 __U, __m256 __A) // { // return (__m256i) __builtin_ia32_cvttps2dq256_mask ((__v8sf) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvttps_epi32 (__mmask8 __U, __m256 __A) // { // return (__m256i) __builtin_ia32_cvttps2dq256_mask ((__v8sf) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvttps_epi32 (__m128i __W, __mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2dq128_mask ((__v4sf) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvttps_epi32 (__mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2dq128_mask ((__v4sf) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvttps_epu32 (__m256 __A) // { // return (__m256i) __builtin_ia32_cvttps2udq256_mask ((__v8sf) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvttps_epu32 (__m256i __W, __mmask8 __U, __m256 __A) // { // return (__m256i) __builtin_ia32_cvttps2udq256_mask ((__v8sf) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvttps_epu32 (__mmask8 __U, __m256 __A) // { // return (__m256i) __builtin_ia32_cvttps2udq256_mask ((__v8sf) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttps_epu32 (__m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2udq128_mask ((__v4sf) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvttps_epu32 (__m128i __W, __mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2udq128_mask ((__v4sf) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvttps_epu32 (__mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvttps2udq128_mask ((__v4sf) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvttpd_epi32 (__m128i __W, __mmask8 __U, __m256d __A) // { // return (__m128i) __builtin_ia32_cvttpd2dq256_mask ((__v4df) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvttpd_epi32 (__mmask8 __U, __m256d __A) // { // return (__m128i) __builtin_ia32_cvttpd2dq256_mask ((__v4df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvttpd_epi32 (__m128i __W, __mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2dq128_mask ((__v2df) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvttpd_epi32 (__mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2dq128_mask ((__v2df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvttpd_epu32 (__m256d __A) // { // return (__m128i) __builtin_ia32_cvttpd2udq256_mask ((__v4df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvttpd_epu32 (__m128i __W, __mmask8 __U, __m256d __A) // { // return (__m128i) __builtin_ia32_cvttpd2udq256_mask ((__v4df) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvttpd_epu32 (__mmask8 __U, __m256d __A) // { // return (__m128i) __builtin_ia32_cvttpd2udq256_mask ((__v4df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvttpd_epu32 (__m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2udq128_mask ((__v2df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvttpd_epu32 (__m128i __W, __mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2udq128_mask ((__v2df) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvttpd_epu32 (__mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvttpd2udq128_mask ((__v2df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtpd_epi32 (__m128i __W, __mmask8 __U, __m256d __A) // { // return (__m128i) __builtin_ia32_cvtpd2dq256_mask ((__v4df) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtpd_epi32 (__mmask8 __U, __m256d __A) // { // return (__m128i) __builtin_ia32_cvtpd2dq256_mask ((__v4df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtpd_epi32 (__m128i __W, __mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2dq128_mask ((__v2df) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtpd_epi32 (__mmask8 __U, __m128d __A) // { // return (__m128i) __builtin_ia32_cvtpd2dq128_mask ((__v2df) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi32_pd (__m256d __W, __mmask8 __U, __m128i __A) // { // return (__m256d) __builtin_ia32_cvtdq2pd256_mask ((__v4si) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi32_pd (__mmask8 __U, __m128i __A) // { // return (__m256d) __builtin_ia32_cvtdq2pd256_mask ((__v4si) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi32_pd (__m128d __W, __mmask8 __U, __m128i __A) // { // return (__m128d) __builtin_ia32_cvtdq2pd128_mask ((__v4si) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi32_pd (__mmask8 __U, __m128i __A) // { // return (__m128d) __builtin_ia32_cvtdq2pd128_mask ((__v4si) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepu32_pd (__m128i __A) // { // return (__m256d) __builtin_ia32_cvtudq2pd256_mask ((__v4si) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepu32_pd (__m256d __W, __mmask8 __U, __m128i __A) // { // return (__m256d) __builtin_ia32_cvtudq2pd256_mask ((__v4si) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepu32_pd (__mmask8 __U, __m128i __A) // { // return (__m256d) __builtin_ia32_cvtudq2pd256_mask ((__v4si) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepu32_pd (__m128i __A) // { // return (__m128d) __builtin_ia32_cvtudq2pd128_mask ((__v4si) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepu32_pd (__m128d __W, __mmask8 __U, __m128i __A) // { // return (__m128d) __builtin_ia32_cvtudq2pd128_mask ((__v4si) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepu32_pd (__mmask8 __U, __m128i __A) // { // return (__m128d) __builtin_ia32_cvtudq2pd128_mask ((__v4si) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi32_ps (__m256 __W, __mmask8 __U, __m256i __A) // { // return (__m256) __builtin_ia32_cvtdq2ps256_mask ((__v8si) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi32_ps (__mmask8 __U, __m256i __A) // { // return (__m256) __builtin_ia32_cvtdq2ps256_mask ((__v8si) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi32_ps (__m128 __W, __mmask8 __U, __m128i __A) // { // return (__m128) __builtin_ia32_cvtdq2ps128_mask ((__v4si) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi32_ps (__mmask8 __U, __m128i __A) // { // return (__m128) __builtin_ia32_cvtdq2ps128_mask ((__v4si) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepu32_ps (__m256i __A) // { // return (__m256) __builtin_ia32_cvtudq2ps256_mask ((__v8si) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepu32_ps (__m256 __W, __mmask8 __U, __m256i __A) // { // return (__m256) __builtin_ia32_cvtudq2ps256_mask ((__v8si) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepu32_ps (__mmask8 __U, __m256i __A) // { // return (__m256) __builtin_ia32_cvtudq2ps256_mask ((__v8si) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepu32_ps (__m128i __A) // { // return (__m128) __builtin_ia32_cvtudq2ps128_mask ((__v4si) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepu32_ps (__m128 __W, __mmask8 __U, __m128i __A) // { // return (__m128) __builtin_ia32_cvtudq2ps128_mask ((__v4si) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepu32_ps (__mmask8 __U, __m128i __A) // { // return (__m128) __builtin_ia32_cvtudq2ps128_mask ((__v4si) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtps_pd (__m256d __W, __mmask8 __U, __m128 __A) // { // return (__m256d) __builtin_ia32_cvtps2pd256_mask ((__v4sf) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtps_pd (__mmask8 __U, __m128 __A) // { // return (__m256d) __builtin_ia32_cvtps2pd256_mask ((__v4sf) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtps_pd (__m128d __W, __mmask8 __U, __m128 __A) // { // return (__m128d) __builtin_ia32_cvtps2pd128_mask ((__v4sf) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtps_pd (__mmask8 __U, __m128 __A) // { // return (__m128d) __builtin_ia32_cvtps2pd128_mask ((__v4sf) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepi32_epi8 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovdb128_mask ((__v4si) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi32_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovdb128mem_mask ((__v16qi *) __P, (__v4si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi32_epi8 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovdb128_mask ((__v4si) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi32_epi8 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovdb128_mask ((__v4si) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi32_epi8 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi32_epi8 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A, // (__v16qi) __O, __M); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi32_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovdb256mem_mask ((__v16qi *) __P, (__v8si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi32_epi8 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtsepi32_epi8 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovsdb128_mask ((__v4si) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi32_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovsdb128mem_mask ((__v16qi *) __P, (__v4si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi32_epi8 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsdb128_mask ((__v4si) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtsepi32_epi8 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsdb128_mask ((__v4si) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtsepi32_epi8 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovsdb256_mask ((__v8si) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi32_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovsdb256mem_mask ((__v16qi *) __P, (__v8si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi32_epi8 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovsdb256_mask ((__v8si) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtsepi32_epi8 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovsdb256_mask ((__v8si) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtusepi32_epi8 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovusdb128_mask ((__v4si) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi32_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovusdb128mem_mask ((__v16qi *) __P, (__v4si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi32_epi8 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovusdb128_mask ((__v4si) __A, // (__v16qi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtusepi32_epi8 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovusdb128_mask ((__v4si) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtusepi32_epi8 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovusdb256_mask ((__v8si) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi32_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovusdb256mem_mask ((__v16qi*) __P, (__v8si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi32_epi8 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovusdb256_mask ((__v8si) __A, // (__v16qi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtusepi32_epi8 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovusdb256_mask ((__v8si) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepi32_epi16 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovdw128_mask ((__v4si) __A, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi32_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovdw128mem_mask ((__v8hi *) __P, (__v4si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi32_epi16 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovdw128_mask ((__v4si) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi32_epi16 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovdw128_mask ((__v4si) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi32_epi16 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovdw256_mask ((__v8si) __A, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi32_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovdw256mem_mask ((__v8hi *) __P, (__v8si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi32_epi16 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovdw256_mask ((__v8si) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi32_epi16 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovdw256_mask ((__v8si) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtsepi32_epi16 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovsdw128_mask ((__v4si) __A, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi32_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovsdw128mem_mask ((__v8hi *) __P, (__v4si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi32_epi16 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsdw128_mask ((__v4si) __A, // (__v8hi)__O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtsepi32_epi16 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsdw128_mask ((__v4si) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtsepi32_epi16 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovsdw256_mask ((__v8si) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi32_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovsdw256mem_mask ((__v8hi *) __P, (__v8si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi32_epi16 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovsdw256_mask ((__v8si) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtsepi32_epi16 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovsdw256_mask ((__v8si) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtusepi32_epi16 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovusdw128_mask ((__v4si) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi32_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovusdw128mem_mask ((__v8hi *) __P, (__v4si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi32_epi16 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovusdw128_mask ((__v4si) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtusepi32_epi16 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovusdw128_mask ((__v4si) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtusepi32_epi16 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovusdw256_mask ((__v8si) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi32_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovusdw256mem_mask ((__v8hi *) __P, (__v8si) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi32_epi16 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovusdw256_mask ((__v8si) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtusepi32_epi16 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovusdw256_mask ((__v8si) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepi64_epi8 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovqb128_mask ((__v2di) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovqb128mem_mask ((__v16qi *) __P, (__v2di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi64_epi8 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovqb128_mask ((__v2di) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi64_epi8 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovqb128_mask ((__v2di) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi64_epi8 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovqb256_mask ((__v4di) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovqb256mem_mask ((__v16qi *) __P, (__v4di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi64_epi8 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovqb256_mask ((__v4di) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi64_epi8 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovqb256_mask ((__v4di) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtsepi64_epi8 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovsqb128_mask ((__v2di) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi64_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovsqb128mem_mask ((__v16qi *) __P, (__v2di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi64_epi8 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsqb128_mask ((__v2di) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtsepi64_epi8 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsqb128_mask ((__v2di) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtsepi64_epi8 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovsqb256_mask ((__v4di) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi64_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovsqb256mem_mask ((__v16qi *) __P, (__v4di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi64_epi8 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovsqb256_mask ((__v4di) __A, // (__v16qi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtsepi64_epi8 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovsqb256_mask ((__v4di) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtusepi64_epi8 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovusqb128_mask ((__v2di) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi64_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovusqb128mem_mask ((__v16qi *) __P, (__v2di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi64_epi8 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovusqb128_mask ((__v2di) __A, // (__v16qi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtusepi64_epi8 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovusqb128_mask ((__v2di) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtusepi64_epi8 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovusqb256_mask ((__v4di) __A, // (__v16qi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi64_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovusqb256mem_mask ((__v16qi *) __P, (__v4di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi64_epi8 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovusqb256_mask ((__v4di) __A, // (__v16qi) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtusepi64_epi8 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovusqb256_mask ((__v4di) __A, // (__v16qi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepi64_epi16 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovqw128_mask ((__v2di) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovqw128mem_mask ((__v8hi *) __P, (__v2di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi64_epi16 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovqw128_mask ((__v2di) __A, // (__v8hi)__O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi64_epi16 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovqw128_mask ((__v2di) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi64_epi16 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovqw256_mask ((__v4di) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi64_epi16 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovqw256_mask ((__v4di) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi64_epi16 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovqw256_mask ((__v4di) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtsepi64_epi16 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovsqw128_mask ((__v2di) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi64_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovsqw128mem_mask ((__v8hi *) __P, (__v2di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi64_epi16 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsqw128_mask ((__v2di) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtsepi64_epi16 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsqw128_mask ((__v2di) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtsepi64_epi16 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovsqw256_mask ((__v4di) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovsqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi64_epi16 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovsqw256_mask ((__v4di) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtsepi64_epi16 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovsqw256_mask ((__v4di) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtusepi64_epi16 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovusqw128_mask ((__v2di) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi64_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovusqw128mem_mask ((__v8hi *) __P, (__v2di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi64_epi16 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovusqw128_mask ((__v2di) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtusepi64_epi16 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovusqw128_mask ((__v2di) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtusepi64_epi16 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovusqw256_mask ((__v4di) __A, // (__v8hi) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovusqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi64_epi16 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovusqw256_mask ((__v4di) __A, // (__v8hi) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtusepi64_epi16 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovusqw256_mask ((__v4di) __A, // (__v8hi) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtepi64_epi32 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovqd128_mask ((__v2di) __A, // (__v4si) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi64_storeu_epi32 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovqd128mem_mask ((__v4si *) __P, (__v2di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi64_epi32 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovqd128_mask ((__v2di) __A, // (__v4si) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi64_epi32 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovqd128_mask ((__v2di) __A, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi64_epi32 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovqd256_mask ((__v4di) __A, // (__v4si) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi64_storeu_epi32 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovqd256mem_mask ((__v4si *) __P, (__v4di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi64_epi32 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovqd256_mask ((__v4di) __A, // (__v4si) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi64_epi32 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovqd256_mask ((__v4di) __A, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtsepi64_epi32 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovsqd128_mask ((__v2di) __A, // (__v4si) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi64_storeu_epi32 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovsqd128mem_mask ((__v4si *) __P, (__v2di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtsepi64_epi32 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsqd128_mask ((__v2di) __A, // (__v4si) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtsepi64_epi32 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsqd128_mask ((__v2di) __A, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtsepi64_epi32 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovsqd256_mask ((__v4di) __A, // (__v4si) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi64_storeu_epi32 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovsqd256mem_mask ((__v4si *) __P, (__v4di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtsepi64_epi32 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovsqd256_mask ((__v4di) __A, // (__v4si)__O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtsepi64_epi32 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovsqd256_mask ((__v4di) __A, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtusepi64_epi32 (__m128i __A) // { // return (__m128i) __builtin_ia32_pmovusqd128_mask ((__v2di) __A, // (__v4si) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi64_storeu_epi32 (void * __P, __mmask8 __M, __m128i __A) // { // __builtin_ia32_pmovusqd128mem_mask ((__v4si *) __P, (__v2di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtusepi64_epi32 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovusqd128_mask ((__v2di) __A, // (__v4si) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtusepi64_epi32 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovusqd128_mask ((__v2di) __A, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtusepi64_epi32 (__m256i __A) // { // return (__m128i) __builtin_ia32_pmovusqd256_mask ((__v4di) __A, // (__v4si) // _mm_undefined_si128 (), // (__mmask8) -1); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi64_storeu_epi32 (void * __P, __mmask8 __M, __m256i __A) // { // __builtin_ia32_pmovusqd256mem_mask ((__v4si *) __P, (__v4di) __A, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtusepi64_epi32 (__m128i __O, __mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovusqd256_mask ((__v4di) __A, // (__v4si) __O, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtusepi64_epi32 (__mmask8 __M, __m256i __A) // { // return (__m128i) __builtin_ia32_pmovusqd256_mask ((__v4di) __A, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcastss_ps (__m256 __O, __mmask8 __M, __m128 __A) // { // return (__m256) __builtin_ia32_broadcastss256_mask ((__v4sf) __A, // (__v8sf) __O, // __M); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcastss_ps (__mmask8 __M, __m128 __A) // { // return (__m256) __builtin_ia32_broadcastss256_mask ((__v4sf) __A, // (__v8sf) // _mm256_setzero_ps (), // __M); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_broadcastss_ps (__m128 __O, __mmask8 __M, __m128 __A) // { // return (__m128) __builtin_ia32_broadcastss128_mask ((__v4sf) __A, // (__v4sf) __O, // __M); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_broadcastss_ps (__mmask8 __M, __m128 __A) // { // return (__m128) __builtin_ia32_broadcastss128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // __M); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcastsd_pd (__m256d __O, __mmask8 __M, __m128d __A) // { // return (__m256d) __builtin_ia32_broadcastsd256_mask ((__v2df) __A, // (__v4df) __O, // __M); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcastsd_pd (__mmask8 __M, __m128d __A) // { // return (__m256d) __builtin_ia32_broadcastsd256_mask ((__v2df) __A, // (__v4df) // _mm256_setzero_pd (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcastd_epi32 (__m256i __O, __mmask8 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_pbroadcastd256_mask ((__v4si) __A, // (__v8si) __O, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcastd_epi32 (__mmask8 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_pbroadcastd256_mask ((__v4si) __A, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_set1_epi32 (__m256i __O, __mmask8 __M, int __A) // { // return (__m256i) __builtin_ia32_pbroadcastd256_gpr_mask (__A, (__v8si) __O, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_set1_epi32 (__mmask8 __M, int __A) // { // return (__m256i) __builtin_ia32_pbroadcastd256_gpr_mask (__A, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_broadcastd_epi32 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pbroadcastd128_mask ((__v4si) __A, // (__v4si) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_broadcastd_epi32 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pbroadcastd128_mask ((__v4si) __A, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_set1_epi32 (__m128i __O, __mmask8 __M, int __A) // { // return (__m128i) __builtin_ia32_pbroadcastd128_gpr_mask (__A, (__v4si) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_set1_epi32 (__mmask8 __M, int __A) // { // return (__m128i) // __builtin_ia32_pbroadcastd128_gpr_mask (__A, // (__v4si) _mm_setzero_si128 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcastq_epi64 (__m256i __O, __mmask8 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_pbroadcastq256_mask ((__v2di) __A, // (__v4di) __O, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcastq_epi64 (__mmask8 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_pbroadcastq256_mask ((__v2di) __A, // (__v4di) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_set1_epi64 (__m256i __O, __mmask8 __M, long long __A) // { // return (__m256i) __builtin_ia32_pbroadcastq256_gpr_mask (__A, (__v4di) __O, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_set1_epi64 (__mmask8 __M, long long __A) // { // return (__m256i) __builtin_ia32_pbroadcastq256_gpr_mask (__A, // (__v4di) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_broadcastq_epi64 (__m128i __O, __mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pbroadcastq128_mask ((__v2di) __A, // (__v2di) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_broadcastq_epi64 (__mmask8 __M, __m128i __A) // { // return (__m128i) __builtin_ia32_pbroadcastq128_mask ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_set1_epi64 (__m128i __O, __mmask8 __M, long long __A) // { // return (__m128i) __builtin_ia32_pbroadcastq128_gpr_mask (__A, (__v2di) __O, // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_set1_epi64 (__mmask8 __M, long long __A) // { // return (__m128i) // __builtin_ia32_pbroadcastq128_gpr_mask (__A, // (__v2di) _mm_setzero_si128 (), // __M); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcast_f32x4 (__m128 __A) // { // return (__m256) __builtin_ia32_broadcastf32x4_256_mask ((__v4sf) __A, // (__v8sf)_mm256_undefined_pd (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcast_f32x4 (__m256 __O, __mmask8 __M, __m128 __A) // { // return (__m256) __builtin_ia32_broadcastf32x4_256_mask ((__v4sf) __A, // (__v8sf) __O, // __M); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcast_f32x4 (__mmask8 __M, __m128 __A) // { // return (__m256) __builtin_ia32_broadcastf32x4_256_mask ((__v4sf) __A, // (__v8sf) // _mm256_setzero_ps (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcast_i32x4 (__m128i __A) // { // return (__m256i) __builtin_ia32_broadcasti32x4_256_mask ((__v4si) // __A, // (__v8si)_mm256_undefined_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_broadcast_i32x4 (__m256i __O, __mmask8 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_broadcasti32x4_256_mask ((__v4si) // __A, // (__v8si) // __O, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_broadcast_i32x4 (__mmask8 __M, __m128i __A) // { // return (__m256i) __builtin_ia32_broadcasti32x4_256_mask ((__v4si) // __A, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi8_epi32 (__m256i __W, __mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovsxbd256_mask ((__v16qi) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi8_epi32 (__mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovsxbd256_mask ((__v16qi) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi8_epi32 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsxbd128_mask ((__v16qi) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi8_epi32 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsxbd128_mask ((__v16qi) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi8_epi64 (__m256i __W, __mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovsxbq256_mask ((__v16qi) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi8_epi64 (__mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovsxbq256_mask ((__v16qi) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi8_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsxbq128_mask ((__v16qi) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi8_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsxbq128_mask ((__v16qi) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi16_epi32 (__m256i __W, __mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovsxwd256_mask ((__v8hi) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi16_epi32 (__mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovsxwd256_mask ((__v8hi) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi16_epi32 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsxwd128_mask ((__v8hi) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi16_epi32 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsxwd128_mask ((__v8hi) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi16_epi64 (__m256i __W, __mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovsxwq256_mask ((__v8hi) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi16_epi64 (__mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovsxwq256_mask ((__v8hi) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi16_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsxwq128_mask ((__v8hi) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi16_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovsxwq128_mask ((__v8hi) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepi32_epi64 (__m256i __W, __mmask8 __U, __m128i __X) // { // return (__m256i) __builtin_ia32_pmovsxdq256_mask ((__v4si) __X, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepi32_epi64 (__mmask8 __U, __m128i __X) // { // return (__m256i) __builtin_ia32_pmovsxdq256_mask ((__v4si) __X, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepi32_epi64 (__m128i __W, __mmask8 __U, __m128i __X) // { // return (__m128i) __builtin_ia32_pmovsxdq128_mask ((__v4si) __X, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepi32_epi64 (__mmask8 __U, __m128i __X) // { // return (__m128i) __builtin_ia32_pmovsxdq128_mask ((__v4si) __X, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepu8_epi32 (__m256i __W, __mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovzxbd256_mask ((__v16qi) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepu8_epi32 (__mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovzxbd256_mask ((__v16qi) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepu8_epi32 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovzxbd128_mask ((__v16qi) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepu8_epi32 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovzxbd128_mask ((__v16qi) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepu8_epi64 (__m256i __W, __mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovzxbq256_mask ((__v16qi) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepu8_epi64 (__mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovzxbq256_mask ((__v16qi) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepu8_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovzxbq128_mask ((__v16qi) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepu8_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovzxbq128_mask ((__v16qi) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepu16_epi32 (__m256i __W, __mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovzxwd256_mask ((__v8hi) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepu16_epi32 (__mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovzxwd256_mask ((__v8hi) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepu16_epi32 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovzxwd128_mask ((__v8hi) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepu16_epi32 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovzxwd128_mask ((__v8hi) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepu16_epi64 (__m256i __W, __mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovzxwq256_mask ((__v8hi) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepu16_epi64 (__mmask8 __U, __m128i __A) // { // return (__m256i) __builtin_ia32_pmovzxwq256_mask ((__v8hi) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepu16_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovzxwq128_mask ((__v8hi) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepu16_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_pmovzxwq128_mask ((__v8hi) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtepu32_epi64 (__m256i __W, __mmask8 __U, __m128i __X) // { // return (__m256i) __builtin_ia32_pmovzxdq256_mask ((__v4si) __X, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtepu32_epi64 (__mmask8 __U, __m128i __X) // { // return (__m256i) __builtin_ia32_pmovzxdq256_mask ((__v4si) __X, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtepu32_epi64 (__m128i __W, __mmask8 __U, __m128i __X) // { // return (__m128i) __builtin_ia32_pmovzxdq128_mask ((__v4si) __X, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtepu32_epi64 (__mmask8 __U, __m128i __X) // { // return (__m128i) __builtin_ia32_pmovzxdq128_mask ((__v4si) __X, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rcp14_pd (__m256d __A) // { // return (__m256d) __builtin_ia32_rcp14pd256_mask ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_rcp14_pd (__m256d __W, __mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_rcp14pd256_mask ((__v4df) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_rcp14_pd (__mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_rcp14pd256_mask ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rcp14_pd (__m128d __A) // { // return (__m128d) __builtin_ia32_rcp14pd128_mask ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rcp14_pd (__m128d __W, __mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_rcp14pd128_mask ((__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rcp14_pd (__mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_rcp14pd128_mask ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rcp14_ps (__m256 __A) // { // return (__m256) __builtin_ia32_rcp14ps256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_rcp14_ps (__m256 __W, __mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_rcp14ps256_mask ((__v8sf) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_rcp14_ps (__mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_rcp14ps256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rcp14_ps (__m128 __A) // { // return (__m128) __builtin_ia32_rcp14ps128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rcp14_ps (__m128 __W, __mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_rcp14ps128_mask ((__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rcp14_ps (__mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_rcp14ps128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rsqrt14_pd (__m256d __A) // { // return (__m256d) __builtin_ia32_rsqrt14pd256_mask ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_rsqrt14_pd (__m256d __W, __mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_rsqrt14pd256_mask ((__v4df) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_rsqrt14_pd (__mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_rsqrt14pd256_mask ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rsqrt14_pd (__m128d __A) // { // return (__m128d) __builtin_ia32_rsqrt14pd128_mask ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rsqrt14_pd (__m128d __W, __mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_rsqrt14pd128_mask ((__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rsqrt14_pd (__mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_rsqrt14pd128_mask ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rsqrt14_ps (__m256 __A) // { // return (__m256) __builtin_ia32_rsqrt14ps256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_rsqrt14_ps (__m256 __W, __mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_rsqrt14ps256_mask ((__v8sf) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_rsqrt14_ps (__mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_rsqrt14ps256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rsqrt14_ps (__m128 __A) // { // return (__m128) __builtin_ia32_rsqrt14ps128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rsqrt14_ps (__m128 __W, __mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_rsqrt14ps128_mask ((__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rsqrt14_ps (__mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_rsqrt14ps128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sqrt_pd (__m256d __W, __mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_sqrtpd256_mask ((__v4df) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sqrt_pd (__mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_sqrtpd256_mask ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sqrt_pd (__m128d __W, __mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_sqrtpd128_mask ((__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sqrt_pd (__mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_sqrtpd128_mask ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sqrt_ps (__m256 __W, __mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_sqrtps256_mask ((__v8sf) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sqrt_ps (__mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_sqrtps256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sqrt_ps (__m128 __W, __mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_sqrtps128_mask ((__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sqrt_ps (__mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_sqrtps128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_add_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_paddd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_add_epi32 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_paddd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_add_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_paddq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_add_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_paddq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sub_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psubd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sub_epi32 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psubd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sub_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_psubq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sub_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_psubq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_add_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_paddd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_add_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_paddd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_add_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_paddq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_add_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_paddq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sub_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psubd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sub_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psubd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sub_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psubq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sub_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psubq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_getexp_ps (__m256 __A) // { // return (__m256) __builtin_ia32_getexpps256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_getexp_ps (__m256 __W, __mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_getexpps256_mask ((__v8sf) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_getexp_ps (__mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_getexpps256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_getexp_pd (__m256d __A) // { // return (__m256d) __builtin_ia32_getexppd256_mask ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_getexp_pd (__m256d __W, __mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_getexppd256_mask ((__v4df) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_getexp_pd (__mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_getexppd256_mask ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getexp_ps (__m128 __A) // { // return (__m128) __builtin_ia32_getexpps128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getexp_ps (__m128 __W, __mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_getexpps128_mask ((__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getexp_ps (__mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_getexpps128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getexp_pd (__m128d __A) // { // return (__m128d) __builtin_ia32_getexppd128_mask ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getexp_pd (__m128d __W, __mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_getexppd128_mask ((__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getexp_pd (__mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_getexppd128_mask ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srl_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m128i __B) // { // return (__m256i) __builtin_ia32_psrld256_mask ((__v8si) __A, // (__v4si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srl_epi32 (__mmask8 __U, __m256i __A, __m128i __B) // { // return (__m256i) __builtin_ia32_psrld256_mask ((__v8si) __A, // (__v4si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srl_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psrld128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srl_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psrld128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srl_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m128i __B) // { // return (__m256i) __builtin_ia32_psrlq256_mask ((__v4di) __A, // (__v2di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srl_epi64 (__mmask8 __U, __m256i __A, __m128i __B) // { // return (__m256i) __builtin_ia32_psrlq256_mask ((__v4di) __A, // (__v2di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srl_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psrlq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srl_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psrlq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_and_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pandd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_and_epi32 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pandd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_scalef_pd (__m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_scalefpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_scalef_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_scalefpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_scalef_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_scalefpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_scalef_ps (__m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_scalefps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_scalef_ps (__m256 __W, __mmask8 __U, __m256 __A, // __m256 __B) // { // return (__m256) __builtin_ia32_scalefps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_scalefps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_scalef_pd (__m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_scalefpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_scalef_pd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B) // { // return (__m128d) __builtin_ia32_scalefpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_scalef_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_scalefpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_scalef_ps (__m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_scalefps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_scalef_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_scalefps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_scalef_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_scalefps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fmadd_pd (__m256d __A, __mmask8 __U, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fmadd_pd (__m256d __A, __m256d __B, __m256d __C, // __mmask8 __U) // { // return (__m256d) __builtin_ia32_vfmaddpd256_mask3 ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fmadd_pd (__mmask8 __U, __m256d __A, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddpd256_maskz ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmadd_pd (__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmadd_pd (__m128d __A, __m128d __B, __m128d __C, // __mmask8 __U) // { // return (__m128d) __builtin_ia32_vfmaddpd128_mask3 ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmadd_pd (__mmask8 __U, __m128d __A, __m128d __B, // __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddpd128_maskz ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fmadd_ps (__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fmadd_ps (__m256 __A, __m256 __B, __m256 __C, // __mmask8 __U) // { // return (__m256) __builtin_ia32_vfmaddps256_mask3 ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fmadd_ps (__mmask8 __U, __m256 __A, __m256 __B, // __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddps256_maskz ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmadd_ps (__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmadd_ps (__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) // { // return (__m128) __builtin_ia32_vfmaddps128_mask3 ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmadd_ps (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddps128_maskz ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fmsub_pd (__m256d __A, __mmask8 __U, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfmsubpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fmsub_pd (__m256d __A, __m256d __B, __m256d __C, // __mmask8 __U) // { // return (__m256d) __builtin_ia32_vfmsubpd256_mask3 ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fmsub_pd (__mmask8 __U, __m256d __A, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfmsubpd256_maskz ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmsub_pd (__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmsubpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmsub_pd (__m128d __A, __m128d __B, __m128d __C, // __mmask8 __U) // { // return (__m128d) __builtin_ia32_vfmsubpd128_mask3 ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmsub_pd (__mmask8 __U, __m128d __A, __m128d __B, // __m128d __C) // { // return (__m128d) __builtin_ia32_vfmsubpd128_maskz ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fmsub_ps (__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) // { // return (__m256) __builtin_ia32_vfmsubps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fmsub_ps (__m256 __A, __m256 __B, __m256 __C, // __mmask8 __U) // { // return (__m256) __builtin_ia32_vfmsubps256_mask3 ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fmsub_ps (__mmask8 __U, __m256 __A, __m256 __B, // __m256 __C) // { // return (__m256) __builtin_ia32_vfmsubps256_maskz ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmsub_ps (__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmsubps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmsub_ps (__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) // { // return (__m128) __builtin_ia32_vfmsubps128_mask3 ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmsub_ps (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmsubps128_maskz ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fmaddsub_pd (__m256d __A, __mmask8 __U, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddsubpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fmaddsub_pd (__m256d __A, __m256d __B, __m256d __C, // __mmask8 __U) // { // return (__m256d) __builtin_ia32_vfmaddsubpd256_mask3 ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) // __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fmaddsub_pd (__mmask8 __U, __m256d __A, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddsubpd256_maskz ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmaddsub_pd (__m128d __A, __mmask8 __U, __m128d __B, // __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsubpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmaddsub_pd (__m128d __A, __m128d __B, __m128d __C, // __mmask8 __U) // { // return (__m128d) __builtin_ia32_vfmaddsubpd128_mask3 ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmaddsub_pd (__mmask8 __U, __m128d __A, __m128d __B, // __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsubpd128_maskz ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) // __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fmaddsub_ps (__m256 __A, __mmask8 __U, __m256 __B, // __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddsubps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fmaddsub_ps (__m256 __A, __m256 __B, __m256 __C, // __mmask8 __U) // { // return (__m256) __builtin_ia32_vfmaddsubps256_mask3 ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fmaddsub_ps (__mmask8 __U, __m256 __A, __m256 __B, // __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddsubps256_maskz ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmaddsub_ps (__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddsubps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmaddsub_ps (__m128 __A, __m128 __B, __m128 __C, // __mmask8 __U) // { // return (__m128) __builtin_ia32_vfmaddsubps128_mask3 ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmaddsub_ps (__mmask8 __U, __m128 __A, __m128 __B, // __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddsubps128_maskz ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fmsubadd_pd (__m256d __A, __mmask8 __U, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddsubpd256_mask ((__v4df) __A, // (__v4df) __B, // -(__v4df) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fmsubadd_pd (__m256d __A, __m256d __B, __m256d __C, // __mmask8 __U) // { // return (__m256d) __builtin_ia32_vfmsubaddpd256_mask3 ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) // __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fmsubadd_pd (__mmask8 __U, __m256d __A, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddsubpd256_maskz ((__v4df) __A, // (__v4df) __B, // -(__v4df) __C, // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmsubadd_pd (__m128d __A, __mmask8 __U, __m128d __B, // __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsubpd128_mask ((__v2df) __A, // (__v2df) __B, // -(__v2df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmsubadd_pd (__m128d __A, __m128d __B, __m128d __C, // __mmask8 __U) // { // return (__m128d) __builtin_ia32_vfmsubaddpd128_mask3 ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmsubadd_pd (__mmask8 __U, __m128d __A, __m128d __B, // __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsubpd128_maskz ((__v2df) __A, // (__v2df) __B, // -(__v2df) __C, // (__mmask8) // __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fmsubadd_ps (__m256 __A, __mmask8 __U, __m256 __B, // __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddsubps256_mask ((__v8sf) __A, // (__v8sf) __B, // -(__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fmsubadd_ps (__m256 __A, __m256 __B, __m256 __C, // __mmask8 __U) // { // return (__m256) __builtin_ia32_vfmsubaddps256_mask3 ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fmsubadd_ps (__mmask8 __U, __m256 __A, __m256 __B, // __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddsubps256_maskz ((__v8sf) __A, // (__v8sf) __B, // -(__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fmsubadd_ps (__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddsubps128_mask ((__v4sf) __A, // (__v4sf) __B, // -(__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fmsubadd_ps (__m128 __A, __m128 __B, __m128 __C, // __mmask8 __U) // { // return (__m128) __builtin_ia32_vfmsubaddps128_mask3 ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fmsubadd_ps (__mmask8 __U, __m128 __A, __m128 __B, // __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddsubps128_maskz ((__v4sf) __A, // (__v4sf) __B, // -(__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fnmadd_pd (__m256d __A, __mmask8 __U, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfnmaddpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fnmadd_pd (__m256d __A, __m256d __B, __m256d __C, // __mmask8 __U) // { // return (__m256d) __builtin_ia32_vfnmaddpd256_mask3 ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fnmadd_pd (__mmask8 __U, __m256d __A, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfnmaddpd256_maskz ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmadd_pd (__m128d __A, __mmask8 __U, __m128d __B, // __m128d __C) // { // return (__m128d) __builtin_ia32_vfnmaddpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmadd_pd (__m128d __A, __m128d __B, __m128d __C, // __mmask8 __U) // { // return (__m128d) __builtin_ia32_vfnmaddpd128_mask3 ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmadd_pd (__mmask8 __U, __m128d __A, __m128d __B, // __m128d __C) // { // return (__m128d) __builtin_ia32_vfnmaddpd128_maskz ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fnmadd_ps (__m256 __A, __mmask8 __U, __m256 __B, // __m256 __C) // { // return (__m256) __builtin_ia32_vfnmaddps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fnmadd_ps (__m256 __A, __m256 __B, __m256 __C, // __mmask8 __U) // { // return (__m256) __builtin_ia32_vfnmaddps256_mask3 ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fnmadd_ps (__mmask8 __U, __m256 __A, __m256 __B, // __m256 __C) // { // return (__m256) __builtin_ia32_vfnmaddps256_maskz ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmadd_ps (__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfnmaddps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmadd_ps (__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) // { // return (__m128) __builtin_ia32_vfnmaddps128_mask3 ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmadd_ps (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfnmaddps128_maskz ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fnmsub_pd (__m256d __A, __mmask8 __U, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfnmsubpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fnmsub_pd (__m256d __A, __m256d __B, __m256d __C, // __mmask8 __U) // { // return (__m256d) __builtin_ia32_vfnmsubpd256_mask3 ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fnmsub_pd (__mmask8 __U, __m256d __A, __m256d __B, // __m256d __C) // { // return (__m256d) __builtin_ia32_vfnmsubpd256_maskz ((__v4df) __A, // (__v4df) __B, // (__v4df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmsub_pd (__m128d __A, __mmask8 __U, __m128d __B, // __m128d __C) // { // return (__m128d) __builtin_ia32_vfnmsubpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmsub_pd (__m128d __A, __m128d __B, __m128d __C, // __mmask8 __U) // { // return (__m128d) __builtin_ia32_vfnmsubpd128_mask3 ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmsub_pd (__mmask8 __U, __m128d __A, __m128d __B, // __m128d __C) // { // return (__m128d) __builtin_ia32_vfnmsubpd128_maskz ((__v2df) __A, // (__v2df) __B, // (__v2df) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fnmsub_ps (__m256 __A, __mmask8 __U, __m256 __B, // __m256 __C) // { // return (__m256) __builtin_ia32_vfnmsubps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask3_fnmsub_ps (__m256 __A, __m256 __B, __m256 __C, // __mmask8 __U) // { // return (__m256) __builtin_ia32_vfnmsubps256_mask3 ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fnmsub_ps (__mmask8 __U, __m256 __A, __m256 __B, // __m256 __C) // { // return (__m256) __builtin_ia32_vfnmsubps256_maskz ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fnmsub_ps (__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfnmsubps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask3_fnmsub_ps (__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) // { // return (__m128) __builtin_ia32_vfnmsubps128_mask3 ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fnmsub_ps (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfnmsubps128_maskz ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __C, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_and_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pandd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_and_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pandd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_andnot_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pandnd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_andnot_epi32 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pandnd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_andnot_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pandnd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_andnot_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pandnd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_or_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pord256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_or_epi32 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pord256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_or_epi32 (__m256i __A, __m256i __B) // { // return (__m256i) ((__v8su)__A | (__v8su)__B); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_or_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pord128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_or_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pord128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_or_epi32 (__m128i __A, __m128i __B) // { // return (__m128i) ((__v4su)__A | (__v4su)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_xor_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pxord256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_xor_epi32 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pxord256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_xor_epi32 (__m256i __A, __m256i __B) // { // return (__m256i) ((__v8su)__A ^ (__v8su)__B); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_xor_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pxord128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_xor_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pxord128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_xor_epi32 (__m128i __A, __m128i __B) // { // return (__m128i) ((__v4su)__A ^ (__v4su)__B); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtpd_ps (__m128 __W, __mmask8 __U, __m128d __A) // { // return (__m128) __builtin_ia32_cvtpd2ps_mask ((__v2df) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtpd_ps (__mmask8 __U, __m128d __A) // { // return (__m128) __builtin_ia32_cvtpd2ps_mask ((__v2df) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtpd_ps (__m128 __W, __mmask8 __U, __m256d __A) // { // return (__m128) __builtin_ia32_cvtpd2ps256_mask ((__v4df) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtpd_ps (__mmask8 __U, __m256d __A) // { // return (__m128) __builtin_ia32_cvtpd2ps256_mask ((__v4df) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtps_epi32 (__m256i __W, __mmask8 __U, __m256 __A) // { // return (__m256i) __builtin_ia32_cvtps2dq256_mask ((__v8sf) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtps_epi32 (__mmask8 __U, __m256 __A) // { // return (__m256i) __builtin_ia32_cvtps2dq256_mask ((__v8sf) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtps_epi32 (__m128i __W, __mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2dq128_mask ((__v4sf) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtps_epi32 (__mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2dq128_mask ((__v4sf) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtps_epu32 (__m256 __A) // { // return (__m256i) __builtin_ia32_cvtps2udq256_mask ((__v8sf) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtps_epu32 (__m256i __W, __mmask8 __U, __m256 __A) // { // return (__m256i) __builtin_ia32_cvtps2udq256_mask ((__v8sf) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtps_epu32 (__mmask8 __U, __m256 __A) // { // return (__m256i) __builtin_ia32_cvtps2udq256_mask ((__v8sf) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtps_epu32 (__m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2udq128_mask ((__v4sf) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtps_epu32 (__m128i __W, __mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2udq128_mask ((__v4sf) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtps_epu32 (__mmask8 __U, __m128 __A) // { // return (__m128i) __builtin_ia32_cvtps2udq128_mask ((__v4sf) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_movedup_pd (__m256d __W, __mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_movddup256_mask ((__v4df) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_movedup_pd (__mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_movddup256_mask ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_movedup_pd (__m128d __W, __mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_movddup128_mask ((__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_movedup_pd (__mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_movddup128_mask ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_movehdup_ps (__m256 __W, __mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_movshdup256_mask ((__v8sf) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_movehdup_ps (__mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_movshdup256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_movehdup_ps (__m128 __W, __mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_movshdup128_mask ((__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_movehdup_ps (__mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_movshdup128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_moveldup_ps (__m256 __W, __mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_movsldup256_mask ((__v8sf) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_moveldup_ps (__mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_movsldup256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_moveldup_ps (__m128 __W, __mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_movsldup128_mask ((__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_moveldup_ps (__mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_movsldup128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpackhi_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_punpckhdq128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpackhi_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_punpckhdq128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpackhi_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_punpckhdq256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpackhi_epi32 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_punpckhdq256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpackhi_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_punpckhqdq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpackhi_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_punpckhqdq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpackhi_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_punpckhqdq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpackhi_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_punpckhqdq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpacklo_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_punpckldq128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpacklo_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_punpckldq128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpacklo_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_punpckldq256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpacklo_epi32 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_punpckldq256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpacklo_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_punpcklqdq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpacklo_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_punpcklqdq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpacklo_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_punpcklqdq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpacklo_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_punpcklqdq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpeq_epu32_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __A, // (__v4si) __B, 0, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpeq_epi32_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqd128_mask ((__v4si) __A, // (__v4si) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpeq_epu32_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __A, // (__v4si) __B, 0, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpeq_epi32_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqd128_mask ((__v4si) __A, // (__v4si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpeq_epu32_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __A, // (__v8si) __B, 0, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpeq_epi32_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqd256_mask ((__v8si) __A, // (__v8si) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpeq_epu32_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __A, // (__v8si) __B, 0, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpeq_epi32_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqd256_mask ((__v8si) __A, // (__v8si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpeq_epu64_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __A, // (__v2di) __B, 0, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpeq_epi64_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqq128_mask ((__v2di) __A, // (__v2di) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpeq_epu64_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __A, // (__v2di) __B, 0, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpeq_epi64_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqq128_mask ((__v2di) __A, // (__v2di) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpeq_epu64_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __A, // (__v4di) __B, 0, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpeq_epi64_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqq256_mask ((__v4di) __A, // (__v4di) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpeq_epu64_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __A, // (__v4di) __B, 0, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpeq_epi64_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_pcmpeqq256_mask ((__v4di) __A, // (__v4di) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpgt_epu32_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __A, // (__v4si) __B, 6, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpgt_epi32_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtd128_mask ((__v4si) __A, // (__v4si) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpgt_epu32_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __A, // (__v4si) __B, 6, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpgt_epi32_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtd128_mask ((__v4si) __A, // (__v4si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpgt_epu32_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __A, // (__v8si) __B, 6, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpgt_epi32_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtd256_mask ((__v8si) __A, // (__v8si) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpgt_epu32_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __A, // (__v8si) __B, 6, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpgt_epi32_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtd256_mask ((__v8si) __A, // (__v8si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpgt_epu64_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __A, // (__v2di) __B, 6, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpgt_epi64_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtq128_mask ((__v2di) __A, // (__v2di) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpgt_epu64_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __A, // (__v2di) __B, 6, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpgt_epi64_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtq128_mask ((__v2di) __A, // (__v2di) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpgt_epu64_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __A, // (__v4di) __B, 6, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpgt_epi64_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtq256_mask ((__v4di) __A, // (__v4di) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpgt_epu64_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __A, // (__v4di) __B, 6, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpgt_epi64_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_pcmpgtq256_mask ((__v4di) __A, // (__v4di) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_test_epi32_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestmd128 ((__v4si) __A, // (__v4si) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_test_epi32_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestmd128 ((__v4si) __A, // (__v4si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_test_epi32_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ptestmd256 ((__v8si) __A, // (__v8si) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_test_epi32_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ptestmd256 ((__v8si) __A, // (__v8si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_test_epi64_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestmq128 ((__v2di) __A, // (__v2di) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_test_epi64_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestmq128 ((__v2di) __A, // (__v2di) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_test_epi64_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ptestmq256 ((__v4di) __A, // (__v4di) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_test_epi64_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ptestmq256 ((__v4di) __A, // (__v4di) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_testn_epi32_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestnmd128 ((__v4si) __A, // (__v4si) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_testn_epi32_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestnmd128 ((__v4si) __A, // (__v4si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testn_epi32_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ptestnmd256 ((__v8si) __A, // (__v8si) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_testn_epi32_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ptestnmd256 ((__v8si) __A, // (__v8si) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_testn_epi64_mask (__m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestnmq128 ((__v2di) __A, // (__v2di) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_testn_epi64_mask (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__mmask8) __builtin_ia32_ptestnmq128 ((__v2di) __A, // (__v2di) __B, __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testn_epi64_mask (__m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ptestnmq256 ((__v4di) __A, // (__v4di) __B, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_testn_epi64_mask (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__mmask8) __builtin_ia32_ptestnmq256 ((__v4di) __A, // (__v4di) __B, __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compress_pd (__m256d __W, __mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_compressdf256_mask ((__v4df) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_compress_pd (__mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_compressdf256_mask ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compressstoreu_pd (void *__P, __mmask8 __U, __m256d __A) // { // __builtin_ia32_compressstoredf256_mask ((__v4df *) __P, // (__v4df) __A, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compress_pd (__m128d __W, __mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_compressdf128_mask ((__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_compress_pd (__mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_compressdf128_mask ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compressstoreu_pd (void *__P, __mmask8 __U, __m128d __A) // { // __builtin_ia32_compressstoredf128_mask ((__v2df *) __P, // (__v2df) __A, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compress_ps (__m256 __W, __mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_compresssf256_mask ((__v8sf) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_compress_ps (__mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_compresssf256_mask ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compressstoreu_ps (void *__P, __mmask8 __U, __m256 __A) // { // __builtin_ia32_compressstoresf256_mask ((__v8sf *) __P, // (__v8sf) __A, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compress_ps (__m128 __W, __mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_compresssf128_mask ((__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_compress_ps (__mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_compresssf128_mask ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compressstoreu_ps (void *__P, __mmask8 __U, __m128 __A) // { // __builtin_ia32_compressstoresf128_mask ((__v4sf *) __P, // (__v4sf) __A, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compress_epi64 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_compressdi256_mask ((__v4di) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_compress_epi64 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_compressdi256_mask ((__v4di) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compressstoreu_epi64 (void *__P, __mmask8 __U, __m256i __A) // { // __builtin_ia32_compressstoredi256_mask ((__v4di *) __P, // (__v4di) __A, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compress_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_compressdi128_mask ((__v2di) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_compress_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_compressdi128_mask ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compressstoreu_epi64 (void *__P, __mmask8 __U, __m128i __A) // { // __builtin_ia32_compressstoredi128_mask ((__v2di *) __P, // (__v2di) __A, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compress_epi32 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_compresssi256_mask ((__v8si) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_compress_epi32 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_compresssi256_mask ((__v8si) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_compressstoreu_epi32 (void *__P, __mmask8 __U, __m256i __A) // { // __builtin_ia32_compressstoresi256_mask ((__v8si *) __P, // (__v8si) __A, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compress_epi32 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_compresssi128_mask ((__v4si) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_compress_epi32 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_compresssi128_mask ((__v4si) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_compressstoreu_epi32 (void *__P, __mmask8 __U, __m128i __A) // { // __builtin_ia32_compressstoresi128_mask ((__v4si *) __P, // (__v4si) __A, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expand_pd (__m256d __W, __mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_expanddf256_mask ((__v4df) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expand_pd (__mmask8 __U, __m256d __A) // { // return (__m256d) __builtin_ia32_expanddf256_maskz ((__v4df) __A, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expandloadu_pd (__m256d __W, __mmask8 __U, void const *__P) // { // return (__m256d) __builtin_ia32_expandloaddf256_mask ((__v4df *) __P, // (__v4df) __W, // (__mmask8) // __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expandloadu_pd (__mmask8 __U, void const *__P) // { // return (__m256d) __builtin_ia32_expandloaddf256_maskz ((__v4df *) __P, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expand_pd (__m128d __W, __mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_expanddf128_mask ((__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expand_pd (__mmask8 __U, __m128d __A) // { // return (__m128d) __builtin_ia32_expanddf128_maskz ((__v2df) __A, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expandloadu_pd (__m128d __W, __mmask8 __U, void const *__P) // { // return (__m128d) __builtin_ia32_expandloaddf128_mask ((__v2df *) __P, // (__v2df) __W, // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expandloadu_pd (__mmask8 __U, void const *__P) // { // return (__m128d) __builtin_ia32_expandloaddf128_maskz ((__v2df *) __P, // (__v2df) // _mm_setzero_pd (), // (__mmask8) // __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expand_ps (__m256 __W, __mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_expandsf256_mask ((__v8sf) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expand_ps (__mmask8 __U, __m256 __A) // { // return (__m256) __builtin_ia32_expandsf256_maskz ((__v8sf) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expandloadu_ps (__m256 __W, __mmask8 __U, void const *__P) // { // return (__m256) __builtin_ia32_expandloadsf256_mask ((__v8sf *) __P, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expandloadu_ps (__mmask8 __U, void const *__P) // { // return (__m256) __builtin_ia32_expandloadsf256_maskz ((__v8sf *) __P, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) // __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expand_ps (__m128 __W, __mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_expandsf128_mask ((__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expand_ps (__mmask8 __U, __m128 __A) // { // return (__m128) __builtin_ia32_expandsf128_maskz ((__v4sf) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expandloadu_ps (__m128 __W, __mmask8 __U, void const *__P) // { // return (__m128) __builtin_ia32_expandloadsf128_mask ((__v4sf *) __P, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expandloadu_ps (__mmask8 __U, void const *__P) // { // return (__m128) __builtin_ia32_expandloadsf128_maskz ((__v4sf *) __P, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expand_epi64 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_expanddi256_mask ((__v4di) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expand_epi64 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_expanddi256_maskz ((__v4di) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expandloadu_epi64 (__m256i __W, __mmask8 __U, // void const *__P) // { // return (__m256i) __builtin_ia32_expandloaddi256_mask ((__v4di *) __P, // (__v4di) __W, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expandloadu_epi64 (__mmask8 __U, void const *__P) // { // return (__m256i) __builtin_ia32_expandloaddi256_maskz ((__v4di *) __P, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expand_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_expanddi128_mask ((__v2di) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expand_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_expanddi128_maskz ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expandloadu_epi64 (__m128i __W, __mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_expandloaddi128_mask ((__v2di *) __P, // (__v2di) __W, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expandloadu_epi64 (__mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_expandloaddi128_maskz ((__v2di *) __P, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expand_epi32 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_expandsi256_mask ((__v8si) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expand_epi32 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_expandsi256_maskz ((__v8si) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_expandloadu_epi32 (__m256i __W, __mmask8 __U, // void const *__P) // { // return (__m256i) __builtin_ia32_expandloadsi256_mask ((__v8si *) __P, // (__v8si) __W, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_expandloadu_epi32 (__mmask8 __U, void const *__P) // { // return (__m256i) __builtin_ia32_expandloadsi256_maskz ((__v8si *) __P, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expand_epi32 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_expandsi128_mask ((__v4si) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expand_epi32 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_expandsi128_maskz ((__v4si) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_expandloadu_epi32 (__m128i __W, __mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_expandloadsi128_mask ((__v4si *) __P, // (__v4si) __W, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_expandloadu_epi32 (__mmask8 __U, void const *__P) // { // return (__m128i) __builtin_ia32_expandloadsi128_maskz ((__v4si *) __P, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) // __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutex2var_pd (__m256d __A, __m256i __I, __m256d __B) // { // return (__m256d) __builtin_ia32_vpermt2varpd256_mask ((__v4di) __I // /* idx */ , // (__v4df) __A, // (__v4df) __B, // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutex2var_pd (__m256d __A, __mmask8 __U, __m256i __I, // __m256d __B) // { // return (__m256d) __builtin_ia32_vpermt2varpd256_mask ((__v4di) __I // /* idx */ , // (__v4df) __A, // (__v4df) __B, // (__mmask8) // __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask2_permutex2var_pd (__m256d __A, __m256i __I, __mmask8 __U, // __m256d __B) // { // return (__m256d) __builtin_ia32_vpermi2varpd256_mask ((__v4df) __A, // (__v4di) __I // /* idx */ , // (__v4df) __B, // (__mmask8) // __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutex2var_pd (__mmask8 __U, __m256d __A, __m256i __I, // __m256d __B) // { // return (__m256d) __builtin_ia32_vpermt2varpd256_maskz ((__v4di) __I // /* idx */ , // (__v4df) __A, // (__v4df) __B, // (__mmask8) // __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutex2var_ps (__m256 __A, __m256i __I, __m256 __B) // { // return (__m256) __builtin_ia32_vpermt2varps256_mask ((__v8si) __I // /* idx */ , // (__v8sf) __A, // (__v8sf) __B, // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutex2var_ps (__m256 __A, __mmask8 __U, __m256i __I, // __m256 __B) // { // return (__m256) __builtin_ia32_vpermt2varps256_mask ((__v8si) __I // /* idx */ , // (__v8sf) __A, // (__v8sf) __B, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask2_permutex2var_ps (__m256 __A, __m256i __I, __mmask8 __U, // __m256 __B) // { // return (__m256) __builtin_ia32_vpermi2varps256_mask ((__v8sf) __A, // (__v8si) __I // /* idx */ , // (__v8sf) __B, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutex2var_ps (__mmask8 __U, __m256 __A, __m256i __I, // __m256 __B) // { // return (__m256) __builtin_ia32_vpermt2varps256_maskz ((__v8si) __I // /* idx */ , // (__v8sf) __A, // (__v8sf) __B, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permutex2var_epi64 (__m128i __A, __m128i __I, __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2varq128_mask ((__v2di) __I // /* idx */ , // (__v2di) __A, // (__v2di) __B, // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permutex2var_epi64 (__m128i __A, __mmask8 __U, __m128i __I, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2varq128_mask ((__v2di) __I // /* idx */ , // (__v2di) __A, // (__v2di) __B, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask2_permutex2var_epi64 (__m128i __A, __m128i __I, __mmask8 __U, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermi2varq128_mask ((__v2di) __A, // (__v2di) __I // /* idx */ , // (__v2di) __B, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permutex2var_epi64 (__mmask8 __U, __m128i __A, __m128i __I, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2varq128_maskz ((__v2di) __I // /* idx */ , // (__v2di) __A, // (__v2di) __B, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permutex2var_epi32 (__m128i __A, __m128i __I, __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2vard128_mask ((__v4si) __I // /* idx */ , // (__v4si) __A, // (__v4si) __B, // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permutex2var_epi32 (__m128i __A, __mmask8 __U, __m128i __I, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2vard128_mask ((__v4si) __I // /* idx */ , // (__v4si) __A, // (__v4si) __B, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask2_permutex2var_epi32 (__m128i __A, __m128i __I, __mmask8 __U, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermi2vard128_mask ((__v4si) __A, // (__v4si) __I // /* idx */ , // (__v4si) __B, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permutex2var_epi32 (__mmask8 __U, __m128i __A, __m128i __I, // __m128i __B) // { // return (__m128i) __builtin_ia32_vpermt2vard128_maskz ((__v4si) __I // /* idx */ , // (__v4si) __A, // (__v4si) __B, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutex2var_epi64 (__m256i __A, __m256i __I, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2varq256_mask ((__v4di) __I // /* idx */ , // (__v4di) __A, // (__v4di) __B, // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutex2var_epi64 (__m256i __A, __mmask8 __U, __m256i __I, // __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2varq256_mask ((__v4di) __I // /* idx */ , // (__v4di) __A, // (__v4di) __B, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask2_permutex2var_epi64 (__m256i __A, __m256i __I, // __mmask8 __U, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermi2varq256_mask ((__v4di) __A, // (__v4di) __I // /* idx */ , // (__v4di) __B, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutex2var_epi64 (__mmask8 __U, __m256i __A, // __m256i __I, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2varq256_maskz ((__v4di) __I // /* idx */ , // (__v4di) __A, // (__v4di) __B, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutex2var_epi32 (__m256i __A, __m256i __I, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2vard256_mask ((__v8si) __I // /* idx */ , // (__v8si) __A, // (__v8si) __B, // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutex2var_epi32 (__m256i __A, __mmask8 __U, __m256i __I, // __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2vard256_mask ((__v8si) __I // /* idx */ , // (__v8si) __A, // (__v8si) __B, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask2_permutex2var_epi32 (__m256i __A, __m256i __I, // __mmask8 __U, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermi2vard256_mask ((__v8si) __A, // (__v8si) __I // /* idx */ , // (__v8si) __B, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutex2var_epi32 (__mmask8 __U, __m256i __A, // __m256i __I, __m256i __B) // { // return (__m256i) __builtin_ia32_vpermt2vard256_maskz ((__v8si) __I // /* idx */ , // (__v8si) __A, // (__v8si) __B, // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permutex2var_pd (__m128d __A, __m128i __I, __m128d __B) // { // return (__m128d) __builtin_ia32_vpermt2varpd128_mask ((__v2di) __I // /* idx */ , // (__v2df) __A, // (__v2df) __B, // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permutex2var_pd (__m128d __A, __mmask8 __U, __m128i __I, // __m128d __B) // { // return (__m128d) __builtin_ia32_vpermt2varpd128_mask ((__v2di) __I // /* idx */ , // (__v2df) __A, // (__v2df) __B, // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask2_permutex2var_pd (__m128d __A, __m128i __I, __mmask8 __U, // __m128d __B) // { // return (__m128d) __builtin_ia32_vpermi2varpd128_mask ((__v2df) __A, // (__v2di) __I // /* idx */ , // (__v2df) __B, // (__mmask8) // __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permutex2var_pd (__mmask8 __U, __m128d __A, __m128i __I, // __m128d __B) // { // return (__m128d) __builtin_ia32_vpermt2varpd128_maskz ((__v2di) __I // /* idx */ , // (__v2df) __A, // (__v2df) __B, // (__mmask8) // __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permutex2var_ps (__m128 __A, __m128i __I, __m128 __B) // { // return (__m128) __builtin_ia32_vpermt2varps128_mask ((__v4si) __I // /* idx */ , // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permutex2var_ps (__m128 __A, __mmask8 __U, __m128i __I, // __m128 __B) // { // return (__m128) __builtin_ia32_vpermt2varps128_mask ((__v4si) __I // /* idx */ , // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask2_permutex2var_ps (__m128 __A, __m128i __I, __mmask8 __U, // __m128 __B) // { // return (__m128) __builtin_ia32_vpermi2varps128_mask ((__v4sf) __A, // (__v4si) __I // /* idx */ , // (__v4sf) __B, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permutex2var_ps (__mmask8 __U, __m128 __A, __m128i __I, // __m128 __B) // { // return (__m128) __builtin_ia32_vpermt2varps128_maskz ((__v4si) __I // /* idx */ , // (__v4sf) __A, // (__v4sf) __B, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_srav_epi64 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psravq128_mask ((__v2di) __X, // (__v2di) __Y, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srav_epi64 (__m128i __W, __mmask8 __U, __m128i __X, // __m128i __Y) // { // return (__m128i) __builtin_ia32_psravq128_mask ((__v2di) __X, // (__v2di) __Y, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srav_epi64 (__mmask8 __U, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psravq128_mask ((__v2di) __X, // (__v2di) __Y, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sllv_epi32 (__m256i __W, __mmask8 __U, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_psllv8si_mask ((__v8si) __X, // (__v8si) __Y, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sllv_epi32 (__mmask8 __U, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psllv8si_mask ((__v8si) __X, // (__v8si) __Y, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sllv_epi32 (__m128i __W, __mmask8 __U, __m128i __X, // __m128i __Y) // { // return (__m128i) __builtin_ia32_psllv4si_mask ((__v4si) __X, // (__v4si) __Y, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sllv_epi32 (__mmask8 __U, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psllv4si_mask ((__v4si) __X, // (__v4si) __Y, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sllv_epi64 (__m256i __W, __mmask8 __U, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_psllv4di_mask ((__v4di) __X, // (__v4di) __Y, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sllv_epi64 (__mmask8 __U, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psllv4di_mask ((__v4di) __X, // (__v4di) __Y, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sllv_epi64 (__m128i __W, __mmask8 __U, __m128i __X, // __m128i __Y) // { // return (__m128i) __builtin_ia32_psllv2di_mask ((__v2di) __X, // (__v2di) __Y, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sllv_epi64 (__mmask8 __U, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psllv2di_mask ((__v2di) __X, // (__v2di) __Y, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srav_epi32 (__m256i __W, __mmask8 __U, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_psrav8si_mask ((__v8si) __X, // (__v8si) __Y, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srav_epi32 (__mmask8 __U, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psrav8si_mask ((__v8si) __X, // (__v8si) __Y, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srav_epi32 (__m128i __W, __mmask8 __U, __m128i __X, // __m128i __Y) // { // return (__m128i) __builtin_ia32_psrav4si_mask ((__v4si) __X, // (__v4si) __Y, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srav_epi32 (__mmask8 __U, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psrav4si_mask ((__v4si) __X, // (__v4si) __Y, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srlv_epi32 (__m256i __W, __mmask8 __U, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_psrlv8si_mask ((__v8si) __X, // (__v8si) __Y, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srlv_epi32 (__mmask8 __U, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psrlv8si_mask ((__v8si) __X, // (__v8si) __Y, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srlv_epi32 (__m128i __W, __mmask8 __U, __m128i __X, // __m128i __Y) // { // return (__m128i) __builtin_ia32_psrlv4si_mask ((__v4si) __X, // (__v4si) __Y, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srlv_epi32 (__mmask8 __U, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psrlv4si_mask ((__v4si) __X, // (__v4si) __Y, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srlv_epi64 (__m256i __W, __mmask8 __U, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_psrlv4di_mask ((__v4di) __X, // (__v4di) __Y, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srlv_epi64 (__mmask8 __U, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psrlv4di_mask ((__v4di) __X, // (__v4di) __Y, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srlv_epi64 (__m128i __W, __mmask8 __U, __m128i __X, // __m128i __Y) // { // return (__m128i) __builtin_ia32_psrlv2di_mask ((__v2di) __X, // (__v2di) __Y, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srlv_epi64 (__mmask8 __U, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_psrlv2di_mask ((__v2di) __X, // (__v2di) __Y, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rolv_epi32 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_prolvd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_rolv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_prolvd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_rolv_epi32 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_prolvd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rolv_epi32 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_prolvd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rolv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_prolvd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rolv_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_prolvd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rorv_epi32 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_prorvd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_rorv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_prorvd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_rorv_epi32 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_prorvd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rorv_epi32 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_prorvd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rorv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_prorvd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rorv_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_prorvd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rolv_epi64 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_prolvq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_rolv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_prolvq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_rolv_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_prolvq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rolv_epi64 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_prolvq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rolv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_prolvq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rolv_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_prolvq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rorv_epi64 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_prorvq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_rorv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_prorvq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_rorv_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_prorvq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rorv_epi64 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_prorvq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rorv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_prorvq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rorv_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_prorvq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srav_epi64 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psravq256_mask ((__v4di) __X, // (__v4di) __Y, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srav_epi64 (__m256i __W, __mmask8 __U, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_psravq256_mask ((__v4di) __X, // (__v4di) __Y, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srav_epi64 (__mmask8 __U, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_psravq256_mask ((__v4di) __X, // (__v4di) __Y, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_and_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pandq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_and_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pandq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_pd (), // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_and_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pandq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_and_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pandq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_pd (), // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_andnot_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pandnq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_andnot_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pandnq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_pd (), // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_andnot_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pandnq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_andnot_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pandnq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_pd (), // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_or_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_porq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_or_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_porq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_or_epi64 (__m256i __A, __m256i __B) // { // return (__m256i) ((__v4du)__A | (__v4du)__B); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_or_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_porq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_or_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_porq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_or_epi64 (__m128i __A, __m128i __B) // { // return (__m128i) ((__v2du)__A | (__v2du)__B); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_xor_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pxorq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_xor_epi64 (__mmask8 __U, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pxorq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_xor_epi64 (__m256i __A, __m256i __B) // { // return (__m256i) ((__v4du)__A ^ (__v4du)__B); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_xor_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pxorq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_xor_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pxorq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_xor_epi64 (__m128i __A, __m128i __B) // { // return (__m128i) ((__v2du)__A ^ (__v2du)__B); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_max_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_maxpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_max_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_maxpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_max_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_maxps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_max_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_maxps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_div_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_divps_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_div_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_divps_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_div_pd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_divpd_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_div_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_divpd_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_min_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_minpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_div_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_divpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_min_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_minpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_min_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_minps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_div_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_divpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_div_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_divps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_min_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_minps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_div_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_divps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_minps_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mul_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_mulps_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_minps_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mul_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_mulps_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_maxps_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_maxps_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_pd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_minpd_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_minpd_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_pd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_maxpd_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_maxpd_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mul_pd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_mulpd_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mul_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_mulpd_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mul_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_mulps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mul_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_mulps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mul_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_mulpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mul_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_mulpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_max_epi64 (__mmask8 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxsq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_max_epi64 (__m256i __W, __mmask8 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxsq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_min_epi64 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pminsq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_min_epi64 (__m256i __W, __mmask8 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pminsq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_min_epi64 (__mmask8 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pminsq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_max_epu64 (__mmask8 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxuq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_max_epi64 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxsq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_max_epu64 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxuq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_max_epu64 (__m256i __W, __mmask8 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxuq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_min_epu64 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pminuq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_min_epu64 (__m256i __W, __mmask8 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pminuq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_min_epu64 (__mmask8 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pminuq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_max_epi32 (__mmask8 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxsd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_max_epi32 (__m256i __W, __mmask8 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxsd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_min_epi32 (__mmask8 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pminsd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_min_epi32 (__m256i __W, __mmask8 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pminsd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_max_epu32 (__mmask8 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxud256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_max_epu32 (__m256i __W, __mmask8 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmaxud256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_min_epu32 (__mmask8 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pminud256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_min_epu32 (__m256i __W, __mmask8 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pminud256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_epi64 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxsq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_epi64 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxsq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_min_epi64 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pminsq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_epi64 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pminsq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_epi64 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pminsq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_epu64 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxuq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_max_epi64 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxsq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_max_epu64 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxuq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_epu64 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxuq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_min_epu64 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pminuq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_epu64 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pminuq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_epu64 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pminuq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_epi32 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxsd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_epi32 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxsd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_epi32 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pminsd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_epi32 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pminsd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_max_epu32 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxud128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_max_epu32 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmaxud128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_min_epu32 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pminud128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_min_epu32 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pminud128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, __M); // } // #ifndef __AVX512CD__ // #pragma GCC push_options // #pragma GCC target("avx512vl,avx512cd") // #define __DISABLE_AVX512VLCD__ // #endif // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_broadcastmb_epi64 (__mmask8 __A) // { // return (__m128i) __builtin_ia32_broadcastmb128 (__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcastmb_epi64 (__mmask8 __A) // { // return (__m256i) __builtin_ia32_broadcastmb256 (__A); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_broadcastmw_epi32 (__mmask16 __A) // { // return (__m128i) __builtin_ia32_broadcastmw128 (__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcastmw_epi32 (__mmask16 __A) // { // return (__m256i) __builtin_ia32_broadcastmw256 (__A); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_lzcnt_epi32 (__m256i __A) // { // return (__m256i) __builtin_ia32_vplzcntd_256_mask ((__v8si) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_lzcnt_epi32 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vplzcntd_256_mask ((__v8si) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_lzcnt_epi32 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vplzcntd_256_mask ((__v8si) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_lzcnt_epi64 (__m256i __A) // { // return (__m256i) __builtin_ia32_vplzcntq_256_mask ((__v4di) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_lzcnt_epi64 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vplzcntq_256_mask ((__v4di) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_lzcnt_epi64 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vplzcntq_256_mask ((__v4di) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_conflict_epi64 (__m256i __A) // { // return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_conflict_epi64 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A, // (__v4di) __W, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_conflict_epi64 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_conflict_epi32 (__m256i __A) // { // return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_conflict_epi32 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A, // (__v8si) __W, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_conflict_epi32 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_lzcnt_epi32 (__m128i __A) // { // return (__m128i) __builtin_ia32_vplzcntd_128_mask ((__v4si) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_lzcnt_epi32 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vplzcntd_128_mask ((__v4si) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_lzcnt_epi32 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vplzcntd_128_mask ((__v4si) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_lzcnt_epi64 (__m128i __A) // { // return (__m128i) __builtin_ia32_vplzcntq_128_mask ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_lzcnt_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vplzcntq_128_mask ((__v2di) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_lzcnt_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vplzcntq_128_mask ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_conflict_epi64 (__m128i __A) // { // return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_conflict_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A, // (__v2di) __W, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_conflict_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_conflict_epi32 (__m128i __A) // { // return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_conflict_epi32 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A, // (__v4si) __W, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_conflict_epi32 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) // __U); // } // #ifdef __DISABLE_AVX512VLCD__ // #pragma GCC pop_options // #endif // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpacklo_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_unpcklpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpacklo_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_unpcklpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpacklo_pd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B) // { // return (__m128d) __builtin_ia32_unpcklpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpacklo_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_unpcklpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpacklo_ps (__m256 __W, __mmask8 __U, __m256 __A, // __m256 __B) // { // return (__m256) __builtin_ia32_unpcklps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpackhi_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B) // { // return (__m256d) __builtin_ia32_unpckhpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpackhi_pd (__mmask8 __U, __m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_unpckhpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpackhi_pd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B) // { // return (__m128d) __builtin_ia32_unpckhpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpackhi_pd (__mmask8 __U, __m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_unpckhpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_unpackhi_ps (__m256 __W, __mmask8 __U, __m256 __A, // __m256 __B) // { // return (__m256) __builtin_ia32_unpckhps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpackhi_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_unpckhps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpackhi_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_unpckhps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpackhi_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_unpckhps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtph_ps (__m128 __W, __mmask8 __U, __m128i __A) // { // return (__m128) __builtin_ia32_vcvtph2ps_mask ((__v8hi) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtph_ps (__mmask8 __U, __m128i __A) // { // return (__m128) __builtin_ia32_vcvtph2ps_mask ((__v8hi) __A, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_unpacklo_ps (__mmask8 __U, __m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_unpcklps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtph_ps (__m256 __W, __mmask8 __U, __m128i __A) // { // return (__m256) __builtin_ia32_vcvtph2ps256_mask ((__v8hi) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtph_ps (__mmask8 __U, __m128i __A) // { // return (__m256) __builtin_ia32_vcvtph2ps256_mask ((__v8hi) __A, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_unpacklo_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_unpcklps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_unpacklo_ps (__mmask8 __U, __m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_unpcklps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sra_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m128i __B) // { // return (__m256i) __builtin_ia32_psrad256_mask ((__v8si) __A, // (__v4si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sra_epi32 (__mmask8 __U, __m256i __A, __m128i __B) // { // return (__m256i) __builtin_ia32_psrad256_mask ((__v8si) __A, // (__v4si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sra_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psrad128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sra_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psrad128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sra_epi64 (__m256i __A, __m128i __B) // { // return (__m256i) __builtin_ia32_psraq256_mask ((__v4di) __A, // (__v2di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sra_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m128i __B) // { // return (__m256i) __builtin_ia32_psraq256_mask ((__v4di) __A, // (__v2di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sra_epi64 (__mmask8 __U, __m256i __A, __m128i __B) // { // return (__m256i) __builtin_ia32_psraq256_mask ((__v4di) __A, // (__v2di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sra_epi64 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psraq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sra_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psraq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sra_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psraq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sll_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pslld128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sll_epi32 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pslld128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_sll_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_psllq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_sll_epi64 (__mmask8 __U, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_psllq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sll_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m128i __B) // { // return (__m256i) __builtin_ia32_pslld256_mask ((__v8si) __A, // (__v4si) __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sll_epi32 (__mmask8 __U, __m256i __A, __m128i __B) // { // return (__m256i) __builtin_ia32_pslld256_mask ((__v8si) __A, // (__v4si) __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_sll_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m128i __B) // { // return (__m256i) __builtin_ia32_psllq256_mask ((__v4di) __A, // (__v2di) __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_sll_epi64 (__mmask8 __U, __m256i __A, __m128i __B) // { // return (__m256i) __builtin_ia32_psllq256_mask ((__v4di) __A, // (__v2di) __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutexvar_ps (__m256 __W, __mmask8 __U, __m256i __X, // __m256 __Y) // { // return (__m256) __builtin_ia32_permvarsf256_mask ((__v8sf) __Y, // (__v8si) __X, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutexvar_ps (__mmask8 __U, __m256i __X, __m256 __Y) // { // return (__m256) __builtin_ia32_permvarsf256_mask ((__v8sf) __Y, // (__v8si) __X, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutexvar_pd (__m256i __X, __m256d __Y) // { // return (__m256d) __builtin_ia32_permvardf256_mask ((__v4df) __Y, // (__v4di) __X, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutexvar_pd (__m256d __W, __mmask8 __U, __m256i __X, // __m256d __Y) // { // return (__m256d) __builtin_ia32_permvardf256_mask ((__v4df) __Y, // (__v4di) __X, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutexvar_pd (__mmask8 __U, __m256i __X, __m256d __Y) // { // return (__m256d) __builtin_ia32_permvardf256_mask ((__v4df) __Y, // (__v4di) __X, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutevar_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256i __C) // { // return (__m256d) __builtin_ia32_vpermilvarpd256_mask ((__v4df) __A, // (__v4di) __C, // (__v4df) __W, // (__mmask8) // __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutevar_pd (__mmask8 __U, __m256d __A, __m256i __C) // { // return (__m256d) __builtin_ia32_vpermilvarpd256_mask ((__v4df) __A, // (__v4di) __C, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) // __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutevar_ps (__m256 __W, __mmask8 __U, __m256 __A, // __m256i __C) // { // return (__m256) __builtin_ia32_vpermilvarps256_mask ((__v8sf) __A, // (__v8si) __C, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutevar_ps (__mmask8 __U, __m256 __A, __m256i __C) // { // return (__m256) __builtin_ia32_vpermilvarps256_mask ((__v8sf) __A, // (__v8si) __C, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permutevar_pd (__m128d __W, __mmask8 __U, __m128d __A, // __m128i __C) // { // return (__m128d) __builtin_ia32_vpermilvarpd_mask ((__v2df) __A, // (__v2di) __C, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permutevar_pd (__mmask8 __U, __m128d __A, __m128i __C) // { // return (__m128d) __builtin_ia32_vpermilvarpd_mask ((__v2df) __A, // (__v2di) __C, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permutevar_ps (__m128 __W, __mmask8 __U, __m128 __A, // __m128i __C) // { // return (__m128) __builtin_ia32_vpermilvarps_mask ((__v4sf) __A, // (__v4si) __C, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permutevar_ps (__mmask8 __U, __m128 __A, __m128i __C) // { // return (__m128) __builtin_ia32_vpermilvarps_mask ((__v4sf) __A, // (__v4si) __C, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mullo_epi32 (__mmask8 __M, __m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_pmulld256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutexvar_epi64 (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_permvardi256_mask ((__v4di) __Y, // (__v4di) __X, // (__v4di) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mullo_epi32 (__m256i __W, __mmask8 __M, __m256i __A, // __m256i __B) // { // return (__m256i) __builtin_ia32_pmulld256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mullo_epi32 (__mmask8 __M, __m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_pmulld128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) // _mm_setzero_si128 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mullo_epi32 (__m128i __W, __mmask8 __M, __m128i __A, // __m128i __B) // { // return (__m128i) __builtin_ia32_pmulld128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mul_epi32 (__m256i __W, __mmask8 __M, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_pmuldq256_mask ((__v8si) __X, // (__v8si) __Y, // (__v4di) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mul_epi32 (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_pmuldq256_mask ((__v8si) __X, // (__v8si) __Y, // (__v4di) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mul_epi32 (__m128i __W, __mmask8 __M, __m128i __X, // __m128i __Y) // { // return (__m128i) __builtin_ia32_pmuldq128_mask ((__v4si) __X, // (__v4si) __Y, // (__v2di) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mul_epi32 (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_pmuldq128_mask ((__v4si) __X, // (__v4si) __Y, // (__v2di) // _mm_setzero_si128 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutexvar_epi64 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_permvardi256_mask ((__v4di) __Y, // (__v4di) __X, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutexvar_epi64 (__m256i __W, __mmask8 __M, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_permvardi256_mask ((__v4di) __Y, // (__v4di) __X, // (__v4di) __W, // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_mul_epu32 (__m256i __W, __mmask8 __M, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_pmuludq256_mask ((__v8si) __X, // (__v8si) __Y, // (__v4di) __W, __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutexvar_epi32 (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_permvarsi256_mask ((__v8si) __Y, // (__v8si) __X, // (__v8si) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_mul_epu32 (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_pmuludq256_mask ((__v8si) __X, // (__v8si) __Y, // (__v4di) // _mm256_setzero_si256 (), // __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_mul_epu32 (__m128i __W, __mmask8 __M, __m128i __X, // __m128i __Y) // { // return (__m128i) __builtin_ia32_pmuludq128_mask ((__v4si) __X, // (__v4si) __Y, // (__v2di) __W, __M); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_mul_epu32 (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_pmuludq128_mask ((__v4si) __X, // (__v4si) __Y, // (__v2di) // _mm_setzero_si128 (), // __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutexvar_epi32 (__m256i __X, __m256i __Y) // { // return (__m256i) __builtin_ia32_permvarsi256_mask ((__v8si) __Y, // (__v8si) __X, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutexvar_epi32 (__m256i __W, __mmask8 __M, __m256i __X, // __m256i __Y) // { // return (__m256i) __builtin_ia32_permvarsi256_mask ((__v8si) __Y, // (__v8si) __X, // (__v8si) __W, // __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpneq_epu32_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __X, // (__v8si) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpneq_epu32_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __X, // (__v8si) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmplt_epu32_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __X, // (__v8si) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmplt_epu32_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __X, // (__v8si) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpge_epu32_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __X, // (__v8si) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpge_epu32_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __X, // (__v8si) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmple_epu32_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __X, // (__v8si) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmple_epu32_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __X, // (__v8si) __Y, 2, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpneq_epu64_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __X, // (__v4di) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpneq_epu64_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __X, // (__v4di) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmplt_epu64_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __X, // (__v4di) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmplt_epu64_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __X, // (__v4di) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpge_epu64_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __X, // (__v4di) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpge_epu64_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __X, // (__v4di) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmple_epu64_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __X, // (__v4di) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmple_epu64_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __X, // (__v4di) __Y, 2, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpneq_epi32_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpd256_mask ((__v8si) __X, // (__v8si) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpneq_epi32_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpd256_mask ((__v8si) __X, // (__v8si) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmplt_epi32_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpd256_mask ((__v8si) __X, // (__v8si) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmplt_epi32_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpd256_mask ((__v8si) __X, // (__v8si) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpge_epi32_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpd256_mask ((__v8si) __X, // (__v8si) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpge_epi32_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpd256_mask ((__v8si) __X, // (__v8si) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmple_epi32_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpd256_mask ((__v8si) __X, // (__v8si) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmple_epi32_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpd256_mask ((__v8si) __X, // (__v8si) __Y, 2, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpneq_epi64_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpq256_mask ((__v4di) __X, // (__v4di) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpneq_epi64_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpq256_mask ((__v4di) __X, // (__v4di) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmplt_epi64_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpq256_mask ((__v4di) __X, // (__v4di) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmplt_epi64_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpq256_mask ((__v4di) __X, // (__v4di) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmpge_epi64_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpq256_mask ((__v4di) __X, // (__v4di) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmpge_epi64_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpq256_mask ((__v4di) __X, // (__v4di) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmple_epi64_mask (__mmask8 __M, __m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpq256_mask ((__v4di) __X, // (__v4di) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmple_epi64_mask (__m256i __X, __m256i __Y) // { // return (__mmask8) __builtin_ia32_cmpq256_mask ((__v4di) __X, // (__v4di) __Y, 2, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpneq_epu32_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __X, // (__v4si) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpneq_epu32_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __X, // (__v4si) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmplt_epu32_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __X, // (__v4si) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmplt_epu32_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __X, // (__v4si) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpge_epu32_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __X, // (__v4si) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpge_epu32_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __X, // (__v4si) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmple_epu32_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __X, // (__v4si) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmple_epu32_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __X, // (__v4si) __Y, 2, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpneq_epu64_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __X, // (__v2di) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpneq_epu64_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __X, // (__v2di) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmplt_epu64_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __X, // (__v2di) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmplt_epu64_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __X, // (__v2di) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpge_epu64_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __X, // (__v2di) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpge_epu64_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __X, // (__v2di) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmple_epu64_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __X, // (__v2di) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmple_epu64_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __X, // (__v2di) __Y, 2, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpneq_epi32_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpd128_mask ((__v4si) __X, // (__v4si) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpneq_epi32_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpd128_mask ((__v4si) __X, // (__v4si) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmplt_epi32_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpd128_mask ((__v4si) __X, // (__v4si) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmplt_epi32_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpd128_mask ((__v4si) __X, // (__v4si) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpge_epi32_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpd128_mask ((__v4si) __X, // (__v4si) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpge_epi32_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpd128_mask ((__v4si) __X, // (__v4si) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmple_epi32_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpd128_mask ((__v4si) __X, // (__v4si) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmple_epi32_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpd128_mask ((__v4si) __X, // (__v4si) __Y, 2, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpneq_epi64_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpq128_mask ((__v2di) __X, // (__v2di) __Y, 4, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpneq_epi64_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpq128_mask ((__v2di) __X, // (__v2di) __Y, 4, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmplt_epi64_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpq128_mask ((__v2di) __X, // (__v2di) __Y, 1, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmplt_epi64_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpq128_mask ((__v2di) __X, // (__v2di) __Y, 1, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmpge_epi64_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpq128_mask ((__v2di) __X, // (__v2di) __Y, 5, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmpge_epi64_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpq128_mask ((__v2di) __X, // (__v2di) __Y, 5, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmple_epi64_mask (__mmask8 __M, __m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpq128_mask ((__v2di) __X, // (__v2di) __Y, 2, // (__mmask8) __M); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmple_epi64_mask (__m128i __X, __m128i __Y) // { // return (__mmask8) __builtin_ia32_cmpq128_mask ((__v2di) __X, // (__v2di) __Y, 2, // (__mmask8) -1); // } // #ifdef __OPTIMIZE__ // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutex_epi64 (__m256i __X, const int __I) // { // return (__m256i) __builtin_ia32_permdi256_mask ((__v4di) __X, // __I, // (__v4di) // _mm256_setzero_si256(), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutex_epi64 (__m256i __W, __mmask8 __M, // __m256i __X, const int __I) // { // return (__m256i) __builtin_ia32_permdi256_mask ((__v4di) __X, // __I, // (__v4di) __W, // (__mmask8) __M); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutex_epi64 (__mmask8 __M, __m256i __X, const int __I) // { // return (__m256i) __builtin_ia32_permdi256_mask ((__v4di) __X, // __I, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __M); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shuffle_pd (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B, const int __imm) // { // return (__m256d) __builtin_ia32_shufpd256_mask ((__v4df) __A, // (__v4df) __B, __imm, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shuffle_pd (__mmask8 __U, __m256d __A, __m256d __B, // const int __imm) // { // return (__m256d) __builtin_ia32_shufpd256_mask ((__v4df) __A, // (__v4df) __B, __imm, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shuffle_pd (__m128d __W, __mmask8 __U, __m128d __A, // __m128d __B, const int __imm) // { // return (__m128d) __builtin_ia32_shufpd128_mask ((__v2df) __A, // (__v2df) __B, __imm, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shuffle_pd (__mmask8 __U, __m128d __A, __m128d __B, // const int __imm) // { // return (__m128d) __builtin_ia32_shufpd128_mask ((__v2df) __A, // (__v2df) __B, __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shuffle_ps (__m256 __W, __mmask8 __U, __m256 __A, // __m256 __B, const int __imm) // { // return (__m256) __builtin_ia32_shufps256_mask ((__v8sf) __A, // (__v8sf) __B, __imm, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shuffle_ps (__mmask8 __U, __m256 __A, __m256 __B, // const int __imm) // { // return (__m256) __builtin_ia32_shufps256_mask ((__v8sf) __A, // (__v8sf) __B, __imm, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shuffle_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B, // const int __imm) // { // return (__m128) __builtin_ia32_shufps128_mask ((__v4sf) __A, // (__v4sf) __B, __imm, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shuffle_ps (__mmask8 __U, __m128 __A, __m128 __B, // const int __imm) // { // return (__m128) __builtin_ia32_shufps128_mask ((__v4sf) __A, // (__v4sf) __B, __imm, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_inserti32x4 (__m256i __A, __m128i __B, const int __imm) // { // return (__m256i) __builtin_ia32_inserti32x4_256_mask ((__v8si) __A, // (__v4si) __B, // __imm, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_inserti32x4 (__m256i __W, __mmask8 __U, __m256i __A, // __m128i __B, const int __imm) // { // return (__m256i) __builtin_ia32_inserti32x4_256_mask ((__v8si) __A, // (__v4si) __B, // __imm, // (__v8si) __W, // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_inserti32x4 (__mmask8 __U, __m256i __A, __m128i __B, // const int __imm) // { // return (__m256i) __builtin_ia32_inserti32x4_256_mask ((__v8si) __A, // (__v4si) __B, // __imm, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) // __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_insertf32x4 (__m256 __A, __m128 __B, const int __imm) // { // return (__m256) __builtin_ia32_insertf32x4_256_mask ((__v8sf) __A, // (__v4sf) __B, // __imm, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_insertf32x4 (__m256 __W, __mmask8 __U, __m256 __A, // __m128 __B, const int __imm) // { // return (__m256) __builtin_ia32_insertf32x4_256_mask ((__v8sf) __A, // (__v4sf) __B, // __imm, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_insertf32x4 (__mmask8 __U, __m256 __A, __m128 __B, // const int __imm) // { // return (__m256) __builtin_ia32_insertf32x4_256_mask ((__v8sf) __A, // (__v4sf) __B, // __imm, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_extracti32x4_epi32 (__m256i __A, const int __imm) // { // return (__m128i) __builtin_ia32_extracti32x4_256_mask ((__v8si) __A, // __imm, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_extracti32x4_epi32 (__m128i __W, __mmask8 __U, __m256i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_extracti32x4_256_mask ((__v8si) __A, // __imm, // (__v4si) __W, // (__mmask8) // __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_extracti32x4_epi32 (__mmask8 __U, __m256i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_extracti32x4_256_mask ((__v8si) __A, // __imm, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) // __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_extractf32x4_ps (__m256 __A, const int __imm) // { // return (__m128) __builtin_ia32_extractf32x4_256_mask ((__v8sf) __A, // __imm, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_extractf32x4_ps (__m128 __W, __mmask8 __U, __m256 __A, // const int __imm) // { // return (__m128) __builtin_ia32_extractf32x4_256_mask ((__v8sf) __A, // __imm, // (__v4sf) __W, // (__mmask8) // __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_extractf32x4_ps (__mmask8 __U, __m256 __A, // const int __imm) // { // return (__m128) __builtin_ia32_extractf32x4_256_mask ((__v8sf) __A, // __imm, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) // __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shuffle_i64x2 (__m256i __A, __m256i __B, const int __imm) // { // return (__m256i) __builtin_ia32_shuf_i64x2_256_mask ((__v4di) __A, // (__v4di) __B, // __imm, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shuffle_i64x2 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B, const int __imm) // { // return (__m256i) __builtin_ia32_shuf_i64x2_256_mask ((__v4di) __A, // (__v4di) __B, // __imm, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shuffle_i64x2 (__mmask8 __U, __m256i __A, __m256i __B, // const int __imm) // { // return (__m256i) __builtin_ia32_shuf_i64x2_256_mask ((__v4di) __A, // (__v4di) __B, // __imm, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shuffle_i32x4 (__m256i __A, __m256i __B, const int __imm) // { // return (__m256i) __builtin_ia32_shuf_i32x4_256_mask ((__v8si) __A, // (__v8si) __B, // __imm, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shuffle_i32x4 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B, const int __imm) // { // return (__m256i) __builtin_ia32_shuf_i32x4_256_mask ((__v8si) __A, // (__v8si) __B, // __imm, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shuffle_i32x4 (__mmask8 __U, __m256i __A, __m256i __B, // const int __imm) // { // return (__m256i) __builtin_ia32_shuf_i32x4_256_mask ((__v8si) __A, // (__v8si) __B, // __imm, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shuffle_f64x2 (__m256d __A, __m256d __B, const int __imm) // { // return (__m256d) __builtin_ia32_shuf_f64x2_256_mask ((__v4df) __A, // (__v4df) __B, // __imm, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shuffle_f64x2 (__m256d __W, __mmask8 __U, __m256d __A, // __m256d __B, const int __imm) // { // return (__m256d) __builtin_ia32_shuf_f64x2_256_mask ((__v4df) __A, // (__v4df) __B, // __imm, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shuffle_f64x2 (__mmask8 __U, __m256d __A, __m256d __B, // const int __imm) // { // return (__m256d) __builtin_ia32_shuf_f64x2_256_mask ((__v4df) __A, // (__v4df) __B, // __imm, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_shuffle_f32x4 (__m256 __A, __m256 __B, const int __imm) // { // return (__m256) __builtin_ia32_shuf_f32x4_256_mask ((__v8sf) __A, // (__v8sf) __B, // __imm, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shuffle_f32x4 (__m256 __W, __mmask8 __U, __m256 __A, // __m256 __B, const int __imm) // { // return (__m256) __builtin_ia32_shuf_f32x4_256_mask ((__v8sf) __A, // (__v8sf) __B, // __imm, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shuffle_f32x4 (__mmask8 __U, __m256 __A, __m256 __B, // const int __imm) // { // return (__m256) __builtin_ia32_shuf_f32x4_256_mask ((__v8sf) __A, // (__v8sf) __B, // __imm, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fixupimm_pd (__m256d __A, __m256d __B, __m256i __C, // const int __imm) // { // return (__m256d) __builtin_ia32_fixupimmpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4di) __C, // __imm, // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fixupimm_pd (__m256d __A, __mmask8 __U, __m256d __B, // __m256i __C, const int __imm) // { // return (__m256d) __builtin_ia32_fixupimmpd256_mask ((__v4df) __A, // (__v4df) __B, // (__v4di) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fixupimm_pd (__mmask8 __U, __m256d __A, __m256d __B, // __m256i __C, const int __imm) // { // return (__m256d) __builtin_ia32_fixupimmpd256_maskz ((__v4df) __A, // (__v4df) __B, // (__v4di) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fixupimm_ps (__m256 __A, __m256 __B, __m256i __C, // const int __imm) // { // return (__m256) __builtin_ia32_fixupimmps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8si) __C, // __imm, // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_fixupimm_ps (__m256 __A, __mmask8 __U, __m256 __B, // __m256i __C, const int __imm) // { // return (__m256) __builtin_ia32_fixupimmps256_mask ((__v8sf) __A, // (__v8sf) __B, // (__v8si) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_fixupimm_ps (__mmask8 __U, __m256 __A, __m256 __B, // __m256i __C, const int __imm) // { // return (__m256) __builtin_ia32_fixupimmps256_maskz ((__v8sf) __A, // (__v8sf) __B, // (__v8si) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fixupimm_pd (__m128d __A, __m128d __B, __m128i __C, // const int __imm) // { // return (__m128d) __builtin_ia32_fixupimmpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2di) __C, // __imm, // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fixupimm_pd (__m128d __A, __mmask8 __U, __m128d __B, // __m128i __C, const int __imm) // { // return (__m128d) __builtin_ia32_fixupimmpd128_mask ((__v2df) __A, // (__v2df) __B, // (__v2di) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fixupimm_pd (__mmask8 __U, __m128d __A, __m128d __B, // __m128i __C, const int __imm) // { // return (__m128d) __builtin_ia32_fixupimmpd128_maskz ((__v2df) __A, // (__v2df) __B, // (__v2di) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fixupimm_ps (__m128 __A, __m128 __B, __m128i __C, const int __imm) // { // return (__m128) __builtin_ia32_fixupimmps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4si) __C, // __imm, // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_fixupimm_ps (__m128 __A, __mmask8 __U, __m128 __B, // __m128i __C, const int __imm) // { // return (__m128) __builtin_ia32_fixupimmps128_mask ((__v4sf) __A, // (__v4sf) __B, // (__v4si) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_fixupimm_ps (__mmask8 __U, __m128 __A, __m128 __B, // __m128i __C, const int __imm) // { // return (__m128) __builtin_ia32_fixupimmps128_maskz ((__v4sf) __A, // (__v4sf) __B, // (__v4si) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srli_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_psrldi256_mask ((__v8si) __A, __imm, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srli_epi32 (__mmask8 __U, __m256i __A, const int __imm) // { // return (__m256i) __builtin_ia32_psrldi256_mask ((__v8si) __A, __imm, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srli_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_psrldi128_mask ((__v4si) __A, __imm, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srli_epi32 (__mmask8 __U, __m128i __A, const int __imm) // { // return (__m128i) __builtin_ia32_psrldi128_mask ((__v4si) __A, __imm, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srli_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_psrlqi256_mask ((__v4di) __A, __imm, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srli_epi64 (__mmask8 __U, __m256i __A, const int __imm) // { // return (__m256i) __builtin_ia32_psrlqi256_mask ((__v4di) __A, __imm, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srli_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_psrlqi128_mask ((__v2di) __A, __imm, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srli_epi64 (__mmask8 __U, __m128i __A, const int __imm) // { // return (__m128i) __builtin_ia32_psrlqi128_mask ((__v2di) __A, __imm, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_ternarylogic_epi64 (__m256i __A, __m256i __B, __m256i __C, // const int __imm) // { // return (__m256i) __builtin_ia32_pternlogq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __C, __imm, // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_ternarylogic_epi64 (__m256i __A, __mmask8 __U, // __m256i __B, __m256i __C, // const int __imm) // { // return (__m256i) __builtin_ia32_pternlogq256_mask ((__v4di) __A, // (__v4di) __B, // (__v4di) __C, __imm, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_ternarylogic_epi64 (__mmask8 __U, __m256i __A, // __m256i __B, __m256i __C, // const int __imm) // { // return (__m256i) __builtin_ia32_pternlogq256_maskz ((__v4di) __A, // (__v4di) __B, // (__v4di) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_ternarylogic_epi32 (__m256i __A, __m256i __B, __m256i __C, // const int __imm) // { // return (__m256i) __builtin_ia32_pternlogd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __C, __imm, // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_ternarylogic_epi32 (__m256i __A, __mmask8 __U, // __m256i __B, __m256i __C, // const int __imm) // { // return (__m256i) __builtin_ia32_pternlogd256_mask ((__v8si) __A, // (__v8si) __B, // (__v8si) __C, __imm, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_ternarylogic_epi32 (__mmask8 __U, __m256i __A, // __m256i __B, __m256i __C, // const int __imm) // { // return (__m256i) __builtin_ia32_pternlogd256_maskz ((__v8si) __A, // (__v8si) __B, // (__v8si) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_ternarylogic_epi64 (__m128i __A, __m128i __B, __m128i __C, // const int __imm) // { // return (__m128i) __builtin_ia32_pternlogq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __C, __imm, // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_ternarylogic_epi64 (__m128i __A, __mmask8 __U, // __m128i __B, __m128i __C, const int __imm) // { // return (__m128i) __builtin_ia32_pternlogq128_mask ((__v2di) __A, // (__v2di) __B, // (__v2di) __C, __imm, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_ternarylogic_epi64 (__mmask8 __U, __m128i __A, // __m128i __B, __m128i __C, const int __imm) // { // return (__m128i) __builtin_ia32_pternlogq128_maskz ((__v2di) __A, // (__v2di) __B, // (__v2di) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_ternarylogic_epi32 (__m128i __A, __m128i __B, __m128i __C, // const int __imm) // { // return (__m128i) __builtin_ia32_pternlogd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __C, __imm, // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_ternarylogic_epi32 (__m128i __A, __mmask8 __U, // __m128i __B, __m128i __C, const int __imm) // { // return (__m128i) __builtin_ia32_pternlogd128_mask ((__v4si) __A, // (__v4si) __B, // (__v4si) __C, __imm, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_ternarylogic_epi32 (__mmask8 __U, __m128i __A, // __m128i __B, __m128i __C, const int __imm) // { // return (__m128i) __builtin_ia32_pternlogd128_maskz ((__v4si) __A, // (__v4si) __B, // (__v4si) __C, // __imm, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_roundscale_ps (__m256 __A, const int __imm) // { // return (__m256) __builtin_ia32_rndscaleps_256_mask ((__v8sf) __A, // __imm, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_roundscale_ps (__m256 __W, __mmask8 __U, __m256 __A, // const int __imm) // { // return (__m256) __builtin_ia32_rndscaleps_256_mask ((__v8sf) __A, // __imm, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_roundscale_ps (__mmask8 __U, __m256 __A, const int __imm) // { // return (__m256) __builtin_ia32_rndscaleps_256_mask ((__v8sf) __A, // __imm, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_roundscale_pd (__m256d __A, const int __imm) // { // return (__m256d) __builtin_ia32_rndscalepd_256_mask ((__v4df) __A, // __imm, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_roundscale_pd (__m256d __W, __mmask8 __U, __m256d __A, // const int __imm) // { // return (__m256d) __builtin_ia32_rndscalepd_256_mask ((__v4df) __A, // __imm, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_roundscale_pd (__mmask8 __U, __m256d __A, const int __imm) // { // return (__m256d) __builtin_ia32_rndscalepd_256_mask ((__v4df) __A, // __imm, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_roundscale_ps (__m128 __A, const int __imm) // { // return (__m128) __builtin_ia32_rndscaleps_128_mask ((__v4sf) __A, // __imm, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_roundscale_ps (__m128 __W, __mmask8 __U, __m128 __A, // const int __imm) // { // return (__m128) __builtin_ia32_rndscaleps_128_mask ((__v4sf) __A, // __imm, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_roundscale_ps (__mmask8 __U, __m128 __A, const int __imm) // { // return (__m128) __builtin_ia32_rndscaleps_128_mask ((__v4sf) __A, // __imm, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_roundscale_pd (__m128d __A, const int __imm) // { // return (__m128d) __builtin_ia32_rndscalepd_128_mask ((__v2df) __A, // __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_roundscale_pd (__m128d __W, __mmask8 __U, __m128d __A, // const int __imm) // { // return (__m128d) __builtin_ia32_rndscalepd_128_mask ((__v2df) __A, // __imm, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_roundscale_pd (__mmask8 __U, __m128d __A, const int __imm) // { // return (__m128d) __builtin_ia32_rndscalepd_128_mask ((__v2df) __A, // __imm, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_getmant_ps (__m256 __A, _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m256) __builtin_ia32_getmantps256_mask ((__v8sf) __A, // (__C << 2) | __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_getmant_ps (__m256 __W, __mmask8 __U, __m256 __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m256) __builtin_ia32_getmantps256_mask ((__v8sf) __A, // (__C << 2) | __B, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_getmant_ps (__mmask8 __U, __m256 __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m256) __builtin_ia32_getmantps256_mask ((__v8sf) __A, // (__C << 2) | __B, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getmant_ps (__m128 __A, _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m128) __builtin_ia32_getmantps128_mask ((__v4sf) __A, // (__C << 2) | __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) -1); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getmant_ps (__m128 __W, __mmask8 __U, __m128 __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m128) __builtin_ia32_getmantps128_mask ((__v4sf) __A, // (__C << 2) | __B, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getmant_ps (__mmask8 __U, __m128 __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m128) __builtin_ia32_getmantps128_mask ((__v4sf) __A, // (__C << 2) | __B, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_getmant_pd (__m256d __A, _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m256d) __builtin_ia32_getmantpd256_mask ((__v4df) __A, // (__C << 2) | __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_getmant_pd (__m256d __W, __mmask8 __U, __m256d __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m256d) __builtin_ia32_getmantpd256_mask ((__v4df) __A, // (__C << 2) | __B, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_getmant_pd (__mmask8 __U, __m256d __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m256d) __builtin_ia32_getmantpd256_mask ((__v4df) __A, // (__C << 2) | __B, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_getmant_pd (__m128d __A, _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m128d) __builtin_ia32_getmantpd128_mask ((__v2df) __A, // (__C << 2) | __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) -1); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_getmant_pd (__m128d __W, __mmask8 __U, __m128d __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m128d) __builtin_ia32_getmantpd128_mask ((__v2df) __A, // (__C << 2) | __B, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_getmant_pd (__mmask8 __U, __m128d __A, // _MM_MANTISSA_NORM_ENUM __B, // _MM_MANTISSA_SIGN_ENUM __C) // { // return (__m128d) __builtin_ia32_getmantpd128_mask ((__v2df) __A, // (__C << 2) | __B, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mmask_i32gather_ps (__m256 __v1_old, __mmask8 __mask, // __m256i __index, void const *__addr, // int __scale) // { // return (__m256) __builtin_ia32_gather3siv8sf ((__v8sf) __v1_old, // __addr, // (__v8si) __index, // __mask, __scale); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mmask_i32gather_ps (__m128 __v1_old, __mmask8 __mask, // __m128i __index, void const *__addr, // int __scale) // { // return (__m128) __builtin_ia32_gather3siv4sf ((__v4sf) __v1_old, // __addr, // (__v4si) __index, // __mask, __scale); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mmask_i32gather_pd (__m256d __v1_old, __mmask8 __mask, // __m128i __index, void const *__addr, // int __scale) // { // return (__m256d) __builtin_ia32_gather3siv4df ((__v4df) __v1_old, // __addr, // (__v4si) __index, // __mask, __scale); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mmask_i32gather_pd (__m128d __v1_old, __mmask8 __mask, // __m128i __index, void const *__addr, // int __scale) // { // return (__m128d) __builtin_ia32_gather3siv2df ((__v2df) __v1_old, // __addr, // (__v4si) __index, // __mask, __scale); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mmask_i64gather_ps (__m128 __v1_old, __mmask8 __mask, // __m256i __index, void const *__addr, // int __scale) // { // return (__m128) __builtin_ia32_gather3div8sf ((__v4sf) __v1_old, // __addr, // (__v4di) __index, // __mask, __scale); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mmask_i64gather_ps (__m128 __v1_old, __mmask8 __mask, // __m128i __index, void const *__addr, // int __scale) // { // return (__m128) __builtin_ia32_gather3div4sf ((__v4sf) __v1_old, // __addr, // (__v2di) __index, // __mask, __scale); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mmask_i64gather_pd (__m256d __v1_old, __mmask8 __mask, // __m256i __index, void const *__addr, // int __scale) // { // return (__m256d) __builtin_ia32_gather3div4df ((__v4df) __v1_old, // __addr, // (__v4di) __index, // __mask, __scale); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mmask_i64gather_pd (__m128d __v1_old, __mmask8 __mask, // __m128i __index, void const *__addr, // int __scale) // { // return (__m128d) __builtin_ia32_gather3div2df ((__v2df) __v1_old, // __addr, // (__v2di) __index, // __mask, __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mmask_i32gather_epi32 (__m256i __v1_old, __mmask8 __mask, // __m256i __index, void const *__addr, // int __scale) // { // return (__m256i) __builtin_ia32_gather3siv8si ((__v8si) __v1_old, // __addr, // (__v8si) __index, // __mask, __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mmask_i32gather_epi32 (__m128i __v1_old, __mmask8 __mask, // __m128i __index, void const *__addr, // int __scale) // { // return (__m128i) __builtin_ia32_gather3siv4si ((__v4si) __v1_old, // __addr, // (__v4si) __index, // __mask, __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mmask_i32gather_epi64 (__m256i __v1_old, __mmask8 __mask, // __m128i __index, void const *__addr, // int __scale) // { // return (__m256i) __builtin_ia32_gather3siv4di ((__v4di) __v1_old, // __addr, // (__v4si) __index, // __mask, __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mmask_i32gather_epi64 (__m128i __v1_old, __mmask8 __mask, // __m128i __index, void const *__addr, // int __scale) // { // return (__m128i) __builtin_ia32_gather3siv2di ((__v2di) __v1_old, // __addr, // (__v4si) __index, // __mask, __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mmask_i64gather_epi32 (__m128i __v1_old, __mmask8 __mask, // __m256i __index, void const *__addr, // int __scale) // { // return (__m128i) __builtin_ia32_gather3div8si ((__v4si) __v1_old, // __addr, // (__v4di) __index, // __mask, __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mmask_i64gather_epi32 (__m128i __v1_old, __mmask8 __mask, // __m128i __index, void const *__addr, // int __scale) // { // return (__m128i) __builtin_ia32_gather3div4si ((__v4si) __v1_old, // __addr, // (__v2di) __index, // __mask, __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mmask_i64gather_epi64 (__m256i __v1_old, __mmask8 __mask, // __m256i __index, void const *__addr, // int __scale) // { // return (__m256i) __builtin_ia32_gather3div4di ((__v4di) __v1_old, // __addr, // (__v4di) __index, // __mask, __scale); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mmask_i64gather_epi64 (__m128i __v1_old, __mmask8 __mask, // __m128i __index, void const *__addr, // int __scale) // { // return (__m128i) __builtin_ia32_gather3div2di ((__v2di) __v1_old, // __addr, // (__v2di) __index, // __mask, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i32scatter_ps (void *__addr, __m256i __index, // __m256 __v1, const int __scale) // { // __builtin_ia32_scattersiv8sf (__addr, (__mmask8) 0xFF, // (__v8si) __index, (__v8sf) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i32scatter_ps (void *__addr, __mmask8 __mask, // __m256i __index, __m256 __v1, // const int __scale) // { // __builtin_ia32_scattersiv8sf (__addr, __mask, (__v8si) __index, // (__v8sf) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i32scatter_ps (void *__addr, __m128i __index, __m128 __v1, // const int __scale) // { // __builtin_ia32_scattersiv4sf (__addr, (__mmask8) 0xFF, // (__v4si) __index, (__v4sf) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i32scatter_ps (void *__addr, __mmask8 __mask, // __m128i __index, __m128 __v1, // const int __scale) // { // __builtin_ia32_scattersiv4sf (__addr, __mask, (__v4si) __index, // (__v4sf) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i32scatter_pd (void *__addr, __m128i __index, // __m256d __v1, const int __scale) // { // __builtin_ia32_scattersiv4df (__addr, (__mmask8) 0xFF, // (__v4si) __index, (__v4df) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i32scatter_pd (void *__addr, __mmask8 __mask, // __m128i __index, __m256d __v1, // const int __scale) // { // __builtin_ia32_scattersiv4df (__addr, __mask, (__v4si) __index, // (__v4df) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i32scatter_pd (void *__addr, __m128i __index, // __m128d __v1, const int __scale) // { // __builtin_ia32_scattersiv2df (__addr, (__mmask8) 0xFF, // (__v4si) __index, (__v2df) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i32scatter_pd (void *__addr, __mmask8 __mask, // __m128i __index, __m128d __v1, // const int __scale) // { // __builtin_ia32_scattersiv2df (__addr, __mask, (__v4si) __index, // (__v2df) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i64scatter_ps (void *__addr, __m256i __index, // __m128 __v1, const int __scale) // { // __builtin_ia32_scatterdiv8sf (__addr, (__mmask8) 0xFF, // (__v4di) __index, (__v4sf) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i64scatter_ps (void *__addr, __mmask8 __mask, // __m256i __index, __m128 __v1, // const int __scale) // { // __builtin_ia32_scatterdiv8sf (__addr, __mask, (__v4di) __index, // (__v4sf) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i64scatter_ps (void *__addr, __m128i __index, __m128 __v1, // const int __scale) // { // __builtin_ia32_scatterdiv4sf (__addr, (__mmask8) 0xFF, // (__v2di) __index, (__v4sf) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i64scatter_ps (void *__addr, __mmask8 __mask, // __m128i __index, __m128 __v1, // const int __scale) // { // __builtin_ia32_scatterdiv4sf (__addr, __mask, (__v2di) __index, // (__v4sf) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i64scatter_pd (void *__addr, __m256i __index, // __m256d __v1, const int __scale) // { // __builtin_ia32_scatterdiv4df (__addr, (__mmask8) 0xFF, // (__v4di) __index, (__v4df) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i64scatter_pd (void *__addr, __mmask8 __mask, // __m256i __index, __m256d __v1, // const int __scale) // { // __builtin_ia32_scatterdiv4df (__addr, __mask, (__v4di) __index, // (__v4df) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i64scatter_pd (void *__addr, __m128i __index, // __m128d __v1, const int __scale) // { // __builtin_ia32_scatterdiv2df (__addr, (__mmask8) 0xFF, // (__v2di) __index, (__v2df) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i64scatter_pd (void *__addr, __mmask8 __mask, // __m128i __index, __m128d __v1, // const int __scale) // { // __builtin_ia32_scatterdiv2df (__addr, __mask, (__v2di) __index, // (__v2df) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i32scatter_epi32 (void *__addr, __m256i __index, // __m256i __v1, const int __scale) // { // __builtin_ia32_scattersiv8si (__addr, (__mmask8) 0xFF, // (__v8si) __index, (__v8si) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i32scatter_epi32 (void *__addr, __mmask8 __mask, // __m256i __index, __m256i __v1, // const int __scale) // { // __builtin_ia32_scattersiv8si (__addr, __mask, (__v8si) __index, // (__v8si) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i32scatter_epi32 (void *__addr, __m128i __index, // __m128i __v1, const int __scale) // { // __builtin_ia32_scattersiv4si (__addr, (__mmask8) 0xFF, // (__v4si) __index, (__v4si) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i32scatter_epi32 (void *__addr, __mmask8 __mask, // __m128i __index, __m128i __v1, // const int __scale) // { // __builtin_ia32_scattersiv4si (__addr, __mask, (__v4si) __index, // (__v4si) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i32scatter_epi64 (void *__addr, __m128i __index, // __m256i __v1, const int __scale) // { // __builtin_ia32_scattersiv4di (__addr, (__mmask8) 0xFF, // (__v4si) __index, (__v4di) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i32scatter_epi64 (void *__addr, __mmask8 __mask, // __m128i __index, __m256i __v1, // const int __scale) // { // __builtin_ia32_scattersiv4di (__addr, __mask, (__v4si) __index, // (__v4di) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i32scatter_epi64 (void *__addr, __m128i __index, // __m128i __v1, const int __scale) // { // __builtin_ia32_scattersiv2di (__addr, (__mmask8) 0xFF, // (__v4si) __index, (__v2di) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i32scatter_epi64 (void *__addr, __mmask8 __mask, // __m128i __index, __m128i __v1, // const int __scale) // { // __builtin_ia32_scattersiv2di (__addr, __mask, (__v4si) __index, // (__v2di) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i64scatter_epi32 (void *__addr, __m256i __index, // __m128i __v1, const int __scale) // { // __builtin_ia32_scatterdiv8si (__addr, (__mmask8) 0xFF, // (__v4di) __index, (__v4si) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i64scatter_epi32 (void *__addr, __mmask8 __mask, // __m256i __index, __m128i __v1, // const int __scale) // { // __builtin_ia32_scatterdiv8si (__addr, __mask, (__v4di) __index, // (__v4si) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i64scatter_epi32 (void *__addr, __m128i __index, // __m128i __v1, const int __scale) // { // __builtin_ia32_scatterdiv4si (__addr, (__mmask8) 0xFF, // (__v2di) __index, (__v4si) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i64scatter_epi32 (void *__addr, __mmask8 __mask, // __m128i __index, __m128i __v1, // const int __scale) // { // __builtin_ia32_scatterdiv4si (__addr, __mask, (__v2di) __index, // (__v4si) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_i64scatter_epi64 (void *__addr, __m256i __index, // __m256i __v1, const int __scale) // { // __builtin_ia32_scatterdiv4di (__addr, (__mmask8) 0xFF, // (__v4di) __index, (__v4di) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_i64scatter_epi64 (void *__addr, __mmask8 __mask, // __m256i __index, __m256i __v1, // const int __scale) // { // __builtin_ia32_scatterdiv4di (__addr, __mask, (__v4di) __index, // (__v4di) __v1, __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_i64scatter_epi64 (void *__addr, __m128i __index, // __m128i __v1, const int __scale) // { // __builtin_ia32_scatterdiv2di (__addr, (__mmask8) 0xFF, // (__v2di) __index, (__v2di) __v1, // __scale); // } // extern __inline void // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_i64scatter_epi64 (void *__addr, __mmask8 __mask, // __m128i __index, __m128i __v1, // const int __scale) // { // __builtin_ia32_scatterdiv2di (__addr, __mask, (__v2di) __index, // (__v2di) __v1, __scale); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_shuffle_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // _MM_PERM_ENUM __mask) // { // return (__m256i) __builtin_ia32_pshufd256_mask ((__v8si) __A, __mask, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_shuffle_epi32 (__mmask8 __U, __m256i __A, // _MM_PERM_ENUM __mask) // { // return (__m256i) __builtin_ia32_pshufd256_mask ((__v8si) __A, __mask, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_shuffle_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // _MM_PERM_ENUM __mask) // { // return (__m128i) __builtin_ia32_pshufd128_mask ((__v4si) __A, __mask, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_shuffle_epi32 (__mmask8 __U, __m128i __A, // _MM_PERM_ENUM __mask) // { // return (__m128i) __builtin_ia32_pshufd128_mask ((__v4si) __A, __mask, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rol_epi32 (__m256i __A, const int __B) // { // return (__m256i) __builtin_ia32_prold256_mask ((__v8si) __A, __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_rol_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // const int __B) // { // return (__m256i) __builtin_ia32_prold256_mask ((__v8si) __A, __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_rol_epi32 (__mmask8 __U, __m256i __A, const int __B) // { // return (__m256i) __builtin_ia32_prold256_mask ((__v8si) __A, __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rol_epi32 (__m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_prold128_mask ((__v4si) __A, __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rol_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // const int __B) // { // return (__m128i) __builtin_ia32_prold128_mask ((__v4si) __A, __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rol_epi32 (__mmask8 __U, __m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_prold128_mask ((__v4si) __A, __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_ror_epi32 (__m256i __A, const int __B) // { // return (__m256i) __builtin_ia32_prord256_mask ((__v8si) __A, __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_ror_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // const int __B) // { // return (__m256i) __builtin_ia32_prord256_mask ((__v8si) __A, __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_ror_epi32 (__mmask8 __U, __m256i __A, const int __B) // { // return (__m256i) __builtin_ia32_prord256_mask ((__v8si) __A, __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_ror_epi32 (__m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_prord128_mask ((__v4si) __A, __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_ror_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // const int __B) // { // return (__m128i) __builtin_ia32_prord128_mask ((__v4si) __A, __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_ror_epi32 (__mmask8 __U, __m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_prord128_mask ((__v4si) __A, __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rol_epi64 (__m256i __A, const int __B) // { // return (__m256i) __builtin_ia32_prolq256_mask ((__v4di) __A, __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_rol_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // const int __B) // { // return (__m256i) __builtin_ia32_prolq256_mask ((__v4di) __A, __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_rol_epi64 (__mmask8 __U, __m256i __A, const int __B) // { // return (__m256i) __builtin_ia32_prolq256_mask ((__v4di) __A, __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rol_epi64 (__m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_prolq128_mask ((__v2di) __A, __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_rol_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // const int __B) // { // return (__m128i) __builtin_ia32_prolq128_mask ((__v2di) __A, __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_rol_epi64 (__mmask8 __U, __m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_prolq128_mask ((__v2di) __A, __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_ror_epi64 (__m256i __A, const int __B) // { // return (__m256i) __builtin_ia32_prorq256_mask ((__v4di) __A, __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_ror_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // const int __B) // { // return (__m256i) __builtin_ia32_prorq256_mask ((__v4di) __A, __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_ror_epi64 (__mmask8 __U, __m256i __A, const int __B) // { // return (__m256i) __builtin_ia32_prorq256_mask ((__v4di) __A, __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_ror_epi64 (__m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_prorq128_mask ((__v2di) __A, __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_ror_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // const int __B) // { // return (__m128i) __builtin_ia32_prorq128_mask ((__v2di) __A, __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_ror_epi64 (__mmask8 __U, __m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_prorq128_mask ((__v2di) __A, __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_alignr_epi32 (__m128i __A, __m128i __B, const int __imm) // { // return (__m128i) __builtin_ia32_alignd128_mask ((__v4si) __A, // (__v4si) __B, __imm, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_alignr_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B, const int __imm) // { // return (__m128i) __builtin_ia32_alignd128_mask ((__v4si) __A, // (__v4si) __B, __imm, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_alignr_epi32 (__mmask8 __U, __m128i __A, __m128i __B, // const int __imm) // { // return (__m128i) __builtin_ia32_alignd128_mask ((__v4si) __A, // (__v4si) __B, __imm, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_alignr_epi64 (__m128i __A, __m128i __B, const int __imm) // { // return (__m128i) __builtin_ia32_alignq128_mask ((__v2di) __A, // (__v2di) __B, __imm, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_alignr_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // __m128i __B, const int __imm) // { // return (__m128i) __builtin_ia32_alignq128_mask ((__v2di) __A, // (__v2di) __B, __imm, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_alignr_epi64 (__mmask8 __U, __m128i __A, __m128i __B, // const int __imm) // { // return (__m128i) __builtin_ia32_alignq128_mask ((__v2di) __A, // (__v2di) __B, __imm, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_alignr_epi32 (__m256i __A, __m256i __B, const int __imm) // { // return (__m256i) __builtin_ia32_alignd256_mask ((__v8si) __A, // (__v8si) __B, __imm, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_alignr_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B, const int __imm) // { // return (__m256i) __builtin_ia32_alignd256_mask ((__v8si) __A, // (__v8si) __B, __imm, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_alignr_epi32 (__mmask8 __U, __m256i __A, __m256i __B, // const int __imm) // { // return (__m256i) __builtin_ia32_alignd256_mask ((__v8si) __A, // (__v8si) __B, __imm, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_alignr_epi64 (__m256i __A, __m256i __B, const int __imm) // { // return (__m256i) __builtin_ia32_alignq256_mask ((__v4di) __A, // (__v4di) __B, __imm, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_alignr_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // __m256i __B, const int __imm) // { // return (__m256i) __builtin_ia32_alignq256_mask ((__v4di) __A, // (__v4di) __B, __imm, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_alignr_epi64 (__mmask8 __U, __m256i __A, __m256i __B, // const int __imm) // { // return (__m256i) __builtin_ia32_alignq256_mask ((__v4di) __A, // (__v4di) __B, __imm, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cvtps_ph (__m128i __W, __mmask8 __U, __m128 __A, // const int __I) // { // return (__m128i) __builtin_ia32_vcvtps2ph_mask ((__v4sf) __A, __I, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_cvtps_ph (__mmask8 __U, __m128 __A, const int __I) // { // return (__m128i) __builtin_ia32_vcvtps2ph_mask ((__v4sf) __A, __I, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cvtps_ph (__m128i __W, __mmask8 __U, __m256 __A, // const int __I) // { // return (__m128i) __builtin_ia32_vcvtps2ph256_mask ((__v8sf) __A, __I, // (__v8hi) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_cvtps_ph (__mmask8 __U, __m256 __A, const int __I) // { // return (__m128i) __builtin_ia32_vcvtps2ph256_mask ((__v8sf) __A, __I, // (__v8hi) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srai_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_psradi256_mask ((__v8si) __A, __imm, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srai_epi32 (__mmask8 __U, __m256i __A, const int __imm) // { // return (__m256i) __builtin_ia32_psradi256_mask ((__v8si) __A, __imm, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srai_epi32 (__m128i __W, __mmask8 __U, __m128i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_psradi128_mask ((__v4si) __A, __imm, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srai_epi32 (__mmask8 __U, __m128i __A, const int __imm) // { // return (__m128i) __builtin_ia32_psradi128_mask ((__v4si) __A, __imm, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_srai_epi64 (__m256i __A, const int __imm) // { // return (__m256i) __builtin_ia32_psraqi256_mask ((__v4di) __A, __imm, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) -1); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_srai_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // const int __imm) // { // return (__m256i) __builtin_ia32_psraqi256_mask ((__v4di) __A, __imm, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_srai_epi64 (__mmask8 __U, __m256i __A, const int __imm) // { // return (__m256i) __builtin_ia32_psraqi256_mask ((__v4di) __A, __imm, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_srai_epi64 (__m128i __A, const int __imm) // { // return (__m128i) __builtin_ia32_psraqi128_mask ((__v2di) __A, __imm, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) -1); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_srai_epi64 (__m128i __W, __mmask8 __U, __m128i __A, // const int __imm) // { // return (__m128i) __builtin_ia32_psraqi128_mask ((__v2di) __A, __imm, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_srai_epi64 (__mmask8 __U, __m128i __A, const int __imm) // { // return (__m128i) __builtin_ia32_psraqi128_mask ((__v2di) __A, __imm, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_slli_epi32 (__m128i __W, __mmask8 __U, __m128i __A, int __B) // { // return (__m128i) __builtin_ia32_pslldi128_mask ((__v4si) __A, __B, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_slli_epi32 (__mmask8 __U, __m128i __A, int __B) // { // return (__m128i) __builtin_ia32_pslldi128_mask ((__v4si) __A, __B, // (__v4si) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_slli_epi64 (__m128i __W, __mmask8 __U, __m128i __A, int __B) // { // return (__m128i) __builtin_ia32_psllqi128_mask ((__v2di) __A, __B, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_slli_epi64 (__mmask8 __U, __m128i __A, int __B) // { // return (__m128i) __builtin_ia32_psllqi128_mask ((__v2di) __A, __B, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_slli_epi32 (__m256i __W, __mmask8 __U, __m256i __A, // int __B) // { // return (__m256i) __builtin_ia32_pslldi256_mask ((__v8si) __A, __B, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_slli_epi32 (__mmask8 __U, __m256i __A, int __B) // { // return (__m256i) __builtin_ia32_pslldi256_mask ((__v8si) __A, __B, // (__v8si) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_slli_epi64 (__m256i __W, __mmask8 __U, __m256i __A, // int __B) // { // return (__m256i) __builtin_ia32_psllqi256_mask ((__v4di) __A, __B, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_slli_epi64 (__mmask8 __U, __m256i __A, int __B) // { // return (__m256i) __builtin_ia32_psllqi256_mask ((__v4di) __A, __B, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permutex_pd (__m256d __W, __mmask8 __U, __m256d __X, // const int __imm) // { // return (__m256d) __builtin_ia32_permdf256_mask ((__v4df) __X, __imm, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permutex_pd (__mmask8 __U, __m256d __X, const int __imm) // { // return (__m256d) __builtin_ia32_permdf256_mask ((__v4df) __X, __imm, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permute_pd (__m256d __W, __mmask8 __U, __m256d __X, // const int __C) // { // return (__m256d) __builtin_ia32_vpermilpd256_mask ((__v4df) __X, __C, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permute_pd (__mmask8 __U, __m256d __X, const int __C) // { // return (__m256d) __builtin_ia32_vpermilpd256_mask ((__v4df) __X, __C, // (__v4df) // _mm256_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permute_pd (__m128d __W, __mmask8 __U, __m128d __X, // const int __C) // { // return (__m128d) __builtin_ia32_vpermilpd_mask ((__v2df) __X, __C, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permute_pd (__mmask8 __U, __m128d __X, const int __C) // { // return (__m128d) __builtin_ia32_vpermilpd_mask ((__v2df) __X, __C, // (__v2df) // _mm_setzero_pd (), // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_permute_ps (__m256 __W, __mmask8 __U, __m256 __X, // const int __C) // { // return (__m256) __builtin_ia32_vpermilps256_mask ((__v8sf) __X, __C, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_permute_ps (__mmask8 __U, __m256 __X, const int __C) // { // return (__m256) __builtin_ia32_vpermilps256_mask ((__v8sf) __X, __C, // (__v8sf) // _mm256_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_permute_ps (__m128 __W, __mmask8 __U, __m128 __X, // const int __C) // { // return (__m128) __builtin_ia32_vpermilps_mask ((__v4sf) __X, __C, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_permute_ps (__mmask8 __U, __m128 __X, const int __C) // { // return (__m128) __builtin_ia32_vpermilps_mask ((__v4sf) __X, __C, // (__v4sf) // _mm_setzero_ps (), // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_blend_pd (__mmask8 __U, __m256d __A, __m256d __W) // { // return (__m256d) __builtin_ia32_blendmpd_256_mask ((__v4df) __A, // (__v4df) __W, // (__mmask8) __U); // } // extern __inline __m256 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_blend_ps (__mmask8 __U, __m256 __A, __m256 __W) // { // return (__m256) __builtin_ia32_blendmps_256_mask ((__v8sf) __A, // (__v8sf) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_blend_epi64 (__mmask8 __U, __m256i __A, __m256i __W) // { // return (__m256i) __builtin_ia32_blendmq_256_mask ((__v4di) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_blend_epi32 (__mmask8 __U, __m256i __A, __m256i __W) // { // return (__m256i) __builtin_ia32_blendmd_256_mask ((__v8si) __A, // (__v8si) __W, // (__mmask8) __U); // } // extern __inline __m128d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_blend_pd (__mmask8 __U, __m128d __A, __m128d __W) // { // return (__m128d) __builtin_ia32_blendmpd_128_mask ((__v2df) __A, // (__v2df) __W, // (__mmask8) __U); // } // extern __inline __m128 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_blend_ps (__mmask8 __U, __m128 __A, __m128 __W) // { // return (__m128) __builtin_ia32_blendmps_128_mask ((__v4sf) __A, // (__v4sf) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_blend_epi64 (__mmask8 __U, __m128i __A, __m128i __W) // { // return (__m128i) __builtin_ia32_blendmq_128_mask ((__v2di) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_blend_epi32 (__mmask8 __U, __m128i __A, __m128i __W) // { // return (__m128i) __builtin_ia32_blendmd_128_mask ((__v4si) __A, // (__v4si) __W, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmp_epi64_mask (__m256i __X, __m256i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpq256_mask ((__v4di) __X, // (__v4di) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmp_epi32_mask (__m256i __X, __m256i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpd256_mask ((__v8si) __X, // (__v8si) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmp_epu64_mask (__m256i __X, __m256i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __X, // (__v4di) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmp_epu32_mask (__m256i __X, __m256i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __X, // (__v8si) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmp_pd_mask (__m256d __X, __m256d __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmppd256_mask ((__v4df) __X, // (__v4df) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmp_ps_mask (__m256 __X, __m256 __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpps256_mask ((__v8sf) __X, // (__v8sf) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmp_epi64_mask (__mmask8 __U, __m256i __X, __m256i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_cmpq256_mask ((__v4di) __X, // (__v4di) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmp_epi32_mask (__mmask8 __U, __m256i __X, __m256i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_cmpd256_mask ((__v8si) __X, // (__v8si) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmp_epu64_mask (__mmask8 __U, __m256i __X, __m256i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di) __X, // (__v4di) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmp_epu32_mask (__mmask8 __U, __m256i __X, __m256i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si) __X, // (__v8si) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmp_pd_mask (__mmask8 __U, __m256d __X, __m256d __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_cmppd256_mask ((__v4df) __X, // (__v4df) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_cmp_ps_mask (__mmask8 __U, __m256 __X, __m256 __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_cmpps256_mask ((__v8sf) __X, // (__v8sf) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_epi64_mask (__m128i __X, __m128i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpq128_mask ((__v2di) __X, // (__v2di) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_epi32_mask (__m128i __X, __m128i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpd128_mask ((__v4si) __X, // (__v4si) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_epu64_mask (__m128i __X, __m128i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __X, // (__v2di) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_epu32_mask (__m128i __X, __m128i __Y, const int __P) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __X, // (__v4si) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_pd_mask (__m128d __X, __m128d __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmppd128_mask ((__v2df) __X, // (__v2df) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmp_ps_mask (__m128 __X, __m128 __Y, const int __P) // { // return (__mmask8) __builtin_ia32_cmpps128_mask ((__v4sf) __X, // (__v4sf) __Y, __P, // (__mmask8) -1); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_epi64_mask (__mmask8 __U, __m128i __X, __m128i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_cmpq128_mask ((__v2di) __X, // (__v2di) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_epi32_mask (__mmask8 __U, __m128i __X, __m128i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_cmpd128_mask ((__v4si) __X, // (__v4si) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_epu64_mask (__mmask8 __U, __m128i __X, __m128i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di) __X, // (__v2di) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_epu32_mask (__mmask8 __U, __m128i __X, __m128i __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si) __X, // (__v4si) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_pd_mask (__mmask8 __U, __m128d __X, __m128d __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_cmppd128_mask ((__v2df) __X, // (__v2df) __Y, __P, // (__mmask8) __U); // } // extern __inline __mmask8 // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_cmp_ps_mask (__mmask8 __U, __m128 __X, __m128 __Y, // const int __P) // { // return (__mmask8) __builtin_ia32_cmpps128_mask ((__v4sf) __X, // (__v4sf) __Y, __P, // (__mmask8) __U); // } // extern __inline __m256d // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutex_pd (__m256d __X, const int __M) // { // return (__m256d) __builtin_ia32_permdf256_mask ((__v4df) __X, __M, // (__v4df) // _mm256_undefined_pd (), // (__mmask8) -1); // } // #else // #define _mm256_permutex_pd(X, M) \ // ((__m256d) __builtin_ia32_permdf256_mask ((__v4df)(__m256d)(X), (int)(M), \ // (__v4df)(__m256d) \ // _mm256_undefined_pd (), \ // (__mmask8)-1)) // #define _mm256_permutex_epi64(X, I) \ // ((__m256i) __builtin_ia32_permdi256_mask ((__v4di)(__m256i)(X), \ // (int)(I), \ // (__v4di)(__m256i) \ // (_mm256_setzero_si256 ()),\ // (__mmask8) -1)) // #define _mm256_maskz_permutex_epi64(M, X, I) \ // ((__m256i) __builtin_ia32_permdi256_mask ((__v4di)(__m256i)(X), \ // (int)(I), \ // (__v4di)(__m256i) \ // (_mm256_setzero_si256 ()),\ // (__mmask8)(M))) // #define _mm256_mask_permutex_epi64(W, M, X, I) \ // ((__m256i) __builtin_ia32_permdi256_mask ((__v4di)(__m256i)(X), \ // (int)(I), \ // (__v4di)(__m256i)(W), \ // (__mmask8)(M))) // #define _mm256_insertf32x4(X, Y, C) \ // ((__m256) __builtin_ia32_insertf32x4_256_mask ((__v8sf)(__m256) (X), \ // (__v4sf)(__m128) (Y), (int) (C), \ // (__v8sf)(__m256)_mm256_setzero_ps (), \ // (__mmask8)-1)) // #define _mm256_mask_insertf32x4(W, U, X, Y, C) \ // ((__m256) __builtin_ia32_insertf32x4_256_mask ((__v8sf)(__m256) (X), \ // (__v4sf)(__m128) (Y), (int) (C), \ // (__v8sf)(__m256)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_insertf32x4(U, X, Y, C) \ // ((__m256) __builtin_ia32_insertf32x4_256_mask ((__v8sf)(__m256) (X), \ // (__v4sf)(__m128) (Y), (int) (C), \ // (__v8sf)(__m256)_mm256_setzero_ps (), \ // (__mmask8)(U))) // #define _mm256_inserti32x4(X, Y, C) \ // ((__m256i) __builtin_ia32_inserti32x4_256_mask ((__v8si)(__m256i) (X),\ // (__v4si)(__m128i) (Y), (int) (C), \ // (__v8si)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)-1)) // #define _mm256_mask_inserti32x4(W, U, X, Y, C) \ // ((__m256i) __builtin_ia32_inserti32x4_256_mask ((__v8si)(__m256i) (X),\ // (__v4si)(__m128i) (Y), (int) (C), \ // (__v8si)(__m256i)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_inserti32x4(U, X, Y, C) \ // ((__m256i) __builtin_ia32_inserti32x4_256_mask ((__v8si)(__m256i) (X),\ // (__v4si)(__m128i) (Y), (int) (C), \ // (__v8si)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)(U))) // #define _mm256_extractf32x4_ps(X, C) \ // ((__m128) __builtin_ia32_extractf32x4_256_mask ((__v8sf)(__m256) (X), \ // (int) (C), \ // (__v4sf)(__m128)_mm_setzero_ps (), \ // (__mmask8)-1)) // #define _mm256_mask_extractf32x4_ps(W, U, X, C) \ // ((__m128) __builtin_ia32_extractf32x4_256_mask ((__v8sf)(__m256) (X), \ // (int) (C), \ // (__v4sf)(__m128)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_extractf32x4_ps(U, X, C) \ // ((__m128) __builtin_ia32_extractf32x4_256_mask ((__v8sf)(__m256) (X), \ // (int) (C), \ // (__v4sf)(__m128)_mm_setzero_ps (), \ // (__mmask8)(U))) // #define _mm256_extracti32x4_epi32(X, C) \ // ((__m128i) __builtin_ia32_extracti32x4_256_mask ((__v8si)(__m256i) (X),\ // (int) (C), (__v4si)(__m128i)_mm_setzero_si128 (), (__mmask8)-1)) // #define _mm256_mask_extracti32x4_epi32(W, U, X, C) \ // ((__m128i) __builtin_ia32_extracti32x4_256_mask ((__v8si)(__m256i) (X),\ // (int) (C), (__v4si)(__m128i)(W), (__mmask8)(U))) // #define _mm256_maskz_extracti32x4_epi32(U, X, C) \ // ((__m128i) __builtin_ia32_extracti32x4_256_mask ((__v8si)(__m256i) (X),\ // (int) (C), (__v4si)(__m128i)_mm_setzero_si128 (), (__mmask8)(U))) // #define _mm256_shuffle_i64x2(X, Y, C) \ // ((__m256i) __builtin_ia32_shuf_i64x2_256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)(C), \ // (__v4di)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)-1)) // #define _mm256_mask_shuffle_i64x2(W, U, X, Y, C) \ // ((__m256i) __builtin_ia32_shuf_i64x2_256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)(C), \ // (__v4di)(__m256i)(W),\ // (__mmask8)(U))) // #define _mm256_maskz_shuffle_i64x2(U, X, Y, C) \ // ((__m256i) __builtin_ia32_shuf_i64x2_256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)(C), \ // (__v4di)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)(U))) // #define _mm256_shuffle_i32x4(X, Y, C) \ // ((__m256i) __builtin_ia32_shuf_i32x4_256_mask ((__v8si)(__m256i)(X), \ // (__v8si)(__m256i)(Y), (int)(C), \ // (__v8si)(__m256i) \ // _mm256_setzero_si256 (), \ // (__mmask8)-1)) // #define _mm256_mask_shuffle_i32x4(W, U, X, Y, C) \ // ((__m256i) __builtin_ia32_shuf_i32x4_256_mask ((__v8si)(__m256i)(X), \ // (__v8si)(__m256i)(Y), (int)(C), \ // (__v8si)(__m256i)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_shuffle_i32x4(U, X, Y, C) \ // ((__m256i) __builtin_ia32_shuf_i32x4_256_mask ((__v8si)(__m256i)(X), \ // (__v8si)(__m256i)(Y), (int)(C), \ // (__v8si)(__m256i) \ // _mm256_setzero_si256 (), \ // (__mmask8)(U))) // #define _mm256_shuffle_f64x2(X, Y, C) \ // ((__m256d) __builtin_ia32_shuf_f64x2_256_mask ((__v4df)(__m256d)(X), \ // (__v4df)(__m256d)(Y), (int)(C), \ // (__v4df)(__m256d)_mm256_setzero_pd (),\ // (__mmask8)-1)) // #define _mm256_mask_shuffle_f64x2(W, U, X, Y, C) \ // ((__m256d) __builtin_ia32_shuf_f64x2_256_mask ((__v4df)(__m256d)(X), \ // (__v4df)(__m256d)(Y), (int)(C), \ // (__v4df)(__m256d)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_shuffle_f64x2(U, X, Y, C) \ // ((__m256d) __builtin_ia32_shuf_f64x2_256_mask ((__v4df)(__m256d)(X), \ // (__v4df)(__m256d)(Y), (int)(C), \ // (__v4df)(__m256d)_mm256_setzero_pd( ),\ // (__mmask8)(U))) // #define _mm256_shuffle_f32x4(X, Y, C) \ // ((__m256) __builtin_ia32_shuf_f32x4_256_mask ((__v8sf)(__m256)(X), \ // (__v8sf)(__m256)(Y), (int)(C), \ // (__v8sf)(__m256)_mm256_setzero_ps (), \ // (__mmask8)-1)) // #define _mm256_mask_shuffle_f32x4(W, U, X, Y, C) \ // ((__m256) __builtin_ia32_shuf_f32x4_256_mask ((__v8sf)(__m256)(X), \ // (__v8sf)(__m256)(Y), (int)(C), \ // (__v8sf)(__m256)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_shuffle_f32x4(U, X, Y, C) \ // ((__m256) __builtin_ia32_shuf_f32x4_256_mask ((__v8sf)(__m256)(X), \ // (__v8sf)(__m256)(Y), (int)(C), \ // (__v8sf)(__m256)_mm256_setzero_ps (), \ // (__mmask8)(U))) // #define _mm256_mask_shuffle_pd(W, U, A, B, C) \ // ((__m256d)__builtin_ia32_shufpd256_mask ((__v4df)(__m256d)(A), \ // (__v4df)(__m256d)(B), (int)(C), \ // (__v4df)(__m256d)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_shuffle_pd(U, A, B, C) \ // ((__m256d)__builtin_ia32_shufpd256_mask ((__v4df)(__m256d)(A), \ // (__v4df)(__m256d)(B), (int)(C), \ // (__v4df)(__m256d) \ // _mm256_setzero_pd (), \ // (__mmask8)(U))) // #define _mm_mask_shuffle_pd(W, U, A, B, C) \ // ((__m128d)__builtin_ia32_shufpd128_mask ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), \ // (__v2df)(__m128d)(W), \ // (__mmask8)(U))) // #define _mm_maskz_shuffle_pd(U, A, B, C) \ // ((__m128d)__builtin_ia32_shufpd128_mask ((__v2df)(__m128d)(A), \ // (__v2df)(__m128d)(B), (int)(C), \ // (__v2df)(__m128d)_mm_setzero_pd (), \ // (__mmask8)(U))) // #define _mm256_mask_shuffle_ps(W, U, A, B, C) \ // ((__m256) __builtin_ia32_shufps256_mask ((__v8sf)(__m256)(A), \ // (__v8sf)(__m256)(B), (int)(C), \ // (__v8sf)(__m256)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_shuffle_ps(U, A, B, C) \ // ((__m256) __builtin_ia32_shufps256_mask ((__v8sf)(__m256)(A), \ // (__v8sf)(__m256)(B), (int)(C), \ // (__v8sf)(__m256)_mm256_setzero_ps (),\ // (__mmask8)(U))) // #define _mm_mask_shuffle_ps(W, U, A, B, C) \ // ((__m128) __builtin_ia32_shufps128_mask ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), \ // (__v4sf)(__m128)(W), \ // (__mmask8)(U))) // #define _mm_maskz_shuffle_ps(U, A, B, C) \ // ((__m128) __builtin_ia32_shufps128_mask ((__v4sf)(__m128)(A), \ // (__v4sf)(__m128)(B), (int)(C), \ // (__v4sf)(__m128)_mm_setzero_ps (), \ // (__mmask8)(U))) // #define _mm256_fixupimm_pd(X, Y, Z, C) \ // ((__m256d)__builtin_ia32_fixupimmpd256_mask ((__v4df)(__m256d)(X), \ // (__v4df)(__m256d)(Y), \ // (__v4di)(__m256i)(Z), (int)(C), \ // (__mmask8)(-1))) // #define _mm256_mask_fixupimm_pd(X, U, Y, Z, C) \ // ((__m256d)__builtin_ia32_fixupimmpd256_mask ((__v4df)(__m256d)(X), \ // (__v4df)(__m256d)(Y), \ // (__v4di)(__m256i)(Z), (int)(C), \ // (__mmask8)(U))) // #define _mm256_maskz_fixupimm_pd(U, X, Y, Z, C) \ // ((__m256d)__builtin_ia32_fixupimmpd256_maskz ((__v4df)(__m256d)(X), \ // (__v4df)(__m256d)(Y), \ // (__v4di)(__m256i)(Z), (int)(C),\ // (__mmask8)(U))) // #define _mm256_fixupimm_ps(X, Y, Z, C) \ // ((__m256)__builtin_ia32_fixupimmps256_mask ((__v8sf)(__m256)(X), \ // (__v8sf)(__m256)(Y), \ // (__v8si)(__m256i)(Z), (int)(C), \ // (__mmask8)(-1))) // #define _mm256_mask_fixupimm_ps(X, U, Y, Z, C) \ // ((__m256)__builtin_ia32_fixupimmps256_mask ((__v8sf)(__m256)(X), \ // (__v8sf)(__m256)(Y), \ // (__v8si)(__m256i)(Z), (int)(C), \ // (__mmask8)(U))) // #define _mm256_maskz_fixupimm_ps(U, X, Y, Z, C) \ // ((__m256)__builtin_ia32_fixupimmps256_maskz ((__v8sf)(__m256)(X), \ // (__v8sf)(__m256)(Y), \ // (__v8si)(__m256i)(Z), (int)(C),\ // (__mmask8)(U))) // #define _mm_fixupimm_pd(X, Y, Z, C) \ // ((__m128d)__builtin_ia32_fixupimmpd128_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), \ // (__v2di)(__m128i)(Z), (int)(C), \ // (__mmask8)(-1))) // #define _mm_mask_fixupimm_pd(X, U, Y, Z, C) \ // ((__m128d)__builtin_ia32_fixupimmpd128_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), \ // (__v2di)(__m128i)(Z), (int)(C), \ // (__mmask8)(U))) // #define _mm_maskz_fixupimm_pd(U, X, Y, Z, C) \ // ((__m128d)__builtin_ia32_fixupimmpd128_maskz ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), \ // (__v2di)(__m128i)(Z), (int)(C),\ // (__mmask8)(U))) // #define _mm_fixupimm_ps(X, Y, Z, C) \ // ((__m128)__builtin_ia32_fixupimmps128_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), \ // (__v4si)(__m128i)(Z), (int)(C), \ // (__mmask8)(-1))) // #define _mm_mask_fixupimm_ps(X, U, Y, Z, C) \ // ((__m128)__builtin_ia32_fixupimmps128_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), \ // (__v4si)(__m128i)(Z), (int)(C),\ // (__mmask8)(U))) // #define _mm_maskz_fixupimm_ps(U, X, Y, Z, C) \ // ((__m128)__builtin_ia32_fixupimmps128_maskz ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), \ // (__v4si)(__m128i)(Z), (int)(C),\ // (__mmask8)(U))) // #define _mm256_mask_srli_epi32(W, U, A, B) \ // ((__m256i) __builtin_ia32_psrldi256_mask ((__v8si)(__m256i)(A), \ // (int)(B), (__v8si)(__m256i)(W), (__mmask8)(U))) // #define _mm256_maskz_srli_epi32(U, A, B) \ // ((__m256i) __builtin_ia32_psrldi256_mask ((__v8si)(__m256i)(A), \ // (int)(B), (__v8si)_mm256_setzero_si256 (), (__mmask8)(U))) // #define _mm_mask_srli_epi32(W, U, A, B) \ // ((__m128i) __builtin_ia32_psrldi128_mask ((__v4si)(__m128i)(A), \ // (int)(B), (__v4si)(__m128i)(W), (__mmask8)(U))) // #define _mm_maskz_srli_epi32(U, A, B) \ // ((__m128i) __builtin_ia32_psrldi128_mask ((__v4si)(__m128i)(A), \ // (int)(B), (__v4si)_mm_setzero_si128 (), (__mmask8)(U))) // #define _mm256_mask_srli_epi64(W, U, A, B) \ // ((__m256i) __builtin_ia32_psrlqi256_mask ((__v4di)(__m256i)(A), \ // (int)(B), (__v4di)(__m256i)(W), (__mmask8)(U))) // #define _mm256_maskz_srli_epi64(U, A, B) \ // ((__m256i) __builtin_ia32_psrlqi256_mask ((__v4di)(__m256i)(A), \ // (int)(B), (__v4di)_mm256_setzero_si256 (), (__mmask8)(U))) // #define _mm_mask_srli_epi64(W, U, A, B) \ // ((__m128i) __builtin_ia32_psrlqi128_mask ((__v2di)(__m128i)(A), \ // (int)(B), (__v2di)(__m128i)(W), (__mmask8)(U))) // #define _mm_maskz_srli_epi64(U, A, B) \ // ((__m128i) __builtin_ia32_psrlqi128_mask ((__v2di)(__m128i)(A), \ // (int)(B), (__v2di)_mm_setzero_si128 (), (__mmask8)(U))) // #define _mm256_mask_slli_epi32(W, U, X, C) \ // ((__m256i)__builtin_ia32_pslldi256_mask ((__v8si)(__m256i)(X), (int)(C),\ // (__v8si)(__m256i)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_slli_epi32(U, X, C) \ // ((__m256i)__builtin_ia32_pslldi256_mask ((__v8si)(__m256i)(X), (int)(C),\ // (__v8si)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)(U))) // #define _mm256_mask_slli_epi64(W, U, X, C) \ // ((__m256i)__builtin_ia32_psllqi256_mask ((__v4di)(__m256i)(X), (int)(C),\ // (__v4di)(__m256i)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_slli_epi64(U, X, C) \ // ((__m256i)__builtin_ia32_psllqi256_mask ((__v4di)(__m256i)(X), (int)(C),\ // (__v4di)(__m256i)_mm256_setzero_si256 (), \ // (__mmask8)(U))) // #define _mm_mask_slli_epi32(W, U, X, C) \ // ((__m128i)__builtin_ia32_pslldi128_mask ((__v4si)(__m128i)(X), (int)(C),\ // (__v4si)(__m128i)(W),\ // (__mmask8)(U))) // #define _mm_maskz_slli_epi32(U, X, C) \ // ((__m128i)__builtin_ia32_pslldi128_mask ((__v4si)(__m128i)(X), (int)(C),\ // (__v4si)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)(U))) // #define _mm_mask_slli_epi64(W, U, X, C) \ // ((__m128i)__builtin_ia32_psllqi128_mask ((__v2di)(__m128i)(X), (int)(C),\ // (__v2di)(__m128i)(W),\ // (__mmask8)(U))) // #define _mm_maskz_slli_epi64(U, X, C) \ // ((__m128i)__builtin_ia32_psllqi128_mask ((__v2di)(__m128i)(X), (int)(C),\ // (__v2di)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)(U))) // #define _mm256_ternarylogic_epi64(A, B, C, I) \ // ((__m256i) __builtin_ia32_pternlogq256_mask ((__v4di)(__m256i)(A), \ // (__v4di)(__m256i)(B), (__v4di)(__m256i)(C), (int)(I), (__mmask8)-1)) // #define _mm256_mask_ternarylogic_epi64(A, U, B, C, I) \ // ((__m256i) __builtin_ia32_pternlogq256_mask ((__v4di)(__m256i)(A), \ // (__v4di)(__m256i)(B), (__v4di)(__m256i)(C), (int)(I), (__mmask8)(U))) // #define _mm256_maskz_ternarylogic_epi64(U, A, B, C, I) \ // ((__m256i) __builtin_ia32_pternlogq256_maskz ((__v4di)(__m256i)(A), \ // (__v4di)(__m256i)(B), (__v4di)(__m256i)(C), (int)(I), (__mmask8)(U))) // #define _mm256_ternarylogic_epi32(A, B, C, I) \ // ((__m256i) __builtin_ia32_pternlogd256_mask ((__v8si)(__m256i)(A), \ // (__v8si)(__m256i)(B), (__v8si)(__m256i)(C), (int)(I), (__mmask8)-1)) // #define _mm256_mask_ternarylogic_epi32(A, U, B, C, I) \ // ((__m256i) __builtin_ia32_pternlogd256_mask ((__v8si)(__m256i)(A), \ // (__v8si)(__m256i)(B), (__v8si)(__m256i)(C), (int)(I), (__mmask8)(U))) // #define _mm256_maskz_ternarylogic_epi32(U, A, B, C, I) \ // ((__m256i) __builtin_ia32_pternlogd256_maskz ((__v8si)(__m256i)(A), \ // (__v8si)(__m256i)(B), (__v8si)(__m256i)(C), (int)(I), (__mmask8)(U))) // #define _mm_ternarylogic_epi64(A, B, C, I) \ // ((__m128i) __builtin_ia32_pternlogq128_mask ((__v2di)(__m128i)(A), \ // (__v2di)(__m128i)(B), (__v2di)(__m128i)(C), (int)(I), (__mmask8)-1)) // #define _mm_mask_ternarylogic_epi64(A, U, B, C, I) \ // ((__m128i) __builtin_ia32_pternlogq128_mask ((__v2di)(__m128i)(A), \ // (__v2di)(__m128i)(B), (__v2di)(__m128i)(C), (int)(I), (__mmask8)(U))) // #define _mm_maskz_ternarylogic_epi64(U, A, B, C, I) \ // ((__m128i) __builtin_ia32_pternlogq128_maskz ((__v2di)(__m128i)(A), \ // (__v2di)(__m128i)(B), (__v2di)(__m128i)(C), (int)(I), (__mmask8)(U))) // #define _mm_ternarylogic_epi32(A, B, C, I) \ // ((__m128i) __builtin_ia32_pternlogd128_mask ((__v4si)(__m128i)(A), \ // (__v4si)(__m128i)(B), (__v4si)(__m128i)(C), (int)(I), (__mmask8)-1)) // #define _mm_mask_ternarylogic_epi32(A, U, B, C, I) \ // ((__m128i) __builtin_ia32_pternlogd128_mask ((__v4si)(__m128i)(A), \ // (__v4si)(__m128i)(B), (__v4si)(__m128i)(C), (int)(I), (__mmask8)(U))) // #define _mm_maskz_ternarylogic_epi32(U, A, B, C, I) \ // ((__m128i) __builtin_ia32_pternlogd128_maskz ((__v4si)(__m128i)(A), \ // (__v4si)(__m128i)(B), (__v4si)(__m128i)(C), (int)(I), (__mmask8)(U))) // #define _mm256_roundscale_ps(A, B) \ // ((__m256) __builtin_ia32_rndscaleps_256_mask ((__v8sf)(__m256)(A), \ // (int)(B), (__v8sf)(__m256)_mm256_setzero_ps (), (__mmask8)-1)) // #define _mm256_mask_roundscale_ps(W, U, A, B) \ // ((__m256) __builtin_ia32_rndscaleps_256_mask ((__v8sf)(__m256)(A), \ // (int)(B), (__v8sf)(__m256)(W), (__mmask8)(U))) // #define _mm256_maskz_roundscale_ps(U, A, B) \ // ((__m256) __builtin_ia32_rndscaleps_256_mask ((__v8sf)(__m256)(A), \ // (int)(B), (__v8sf)(__m256)_mm256_setzero_ps (), (__mmask8)(U))) // #define _mm256_roundscale_pd(A, B) \ // ((__m256d) __builtin_ia32_rndscalepd_256_mask ((__v4df)(__m256d)(A), \ // (int)(B), (__v4df)(__m256d)_mm256_setzero_pd (), (__mmask8)-1)) // #define _mm256_mask_roundscale_pd(W, U, A, B) \ // ((__m256d) __builtin_ia32_rndscalepd_256_mask ((__v4df)(__m256d)(A), \ // (int)(B), (__v4df)(__m256d)(W), (__mmask8)(U))) // #define _mm256_maskz_roundscale_pd(U, A, B) \ // ((__m256d) __builtin_ia32_rndscalepd_256_mask ((__v4df)(__m256d)(A), \ // (int)(B), (__v4df)(__m256d)_mm256_setzero_pd (), (__mmask8)(U))) // #define _mm_roundscale_ps(A, B) \ // ((__m128) __builtin_ia32_rndscaleps_128_mask ((__v4sf)(__m128)(A), \ // (int)(B), (__v4sf)(__m128)_mm_setzero_ps (), (__mmask8)-1)) // #define _mm_mask_roundscale_ps(W, U, A, B) \ // ((__m128) __builtin_ia32_rndscaleps_128_mask ((__v4sf)(__m128)(A), \ // (int)(B), (__v4sf)(__m128)(W), (__mmask8)(U))) // #define _mm_maskz_roundscale_ps(U, A, B) \ // ((__m128) __builtin_ia32_rndscaleps_128_mask ((__v4sf)(__m128)(A), \ // (int)(B), (__v4sf)(__m128)_mm_setzero_ps (), (__mmask8)(U))) // #define _mm_roundscale_pd(A, B) \ // ((__m128d) __builtin_ia32_rndscalepd_128_mask ((__v2df)(__m128d)(A), \ // (int)(B), (__v2df)(__m128d)_mm_setzero_pd (), (__mmask8)-1)) // #define _mm_mask_roundscale_pd(W, U, A, B) \ // ((__m128d) __builtin_ia32_rndscalepd_128_mask ((__v2df)(__m128d)(A), \ // (int)(B), (__v2df)(__m128d)(W), (__mmask8)(U))) // #define _mm_maskz_roundscale_pd(U, A, B) \ // ((__m128d) __builtin_ia32_rndscalepd_128_mask ((__v2df)(__m128d)(A), \ // (int)(B), (__v2df)(__m128d)_mm_setzero_pd (), (__mmask8)(U))) // #define _mm256_getmant_ps(X, B, C) \ // ((__m256) __builtin_ia32_getmantps256_mask ((__v8sf)(__m256) (X), \ // (int)(((C)<<2) | (B)), \ // (__v8sf)(__m256)_mm256_setzero_ps (), \ // (__mmask8)-1)) // #define _mm256_mask_getmant_ps(W, U, X, B, C) \ // ((__m256) __builtin_ia32_getmantps256_mask ((__v8sf)(__m256) (X), \ // (int)(((C)<<2) | (B)), \ // (__v8sf)(__m256)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_getmant_ps(U, X, B, C) \ // ((__m256) __builtin_ia32_getmantps256_mask ((__v8sf)(__m256) (X), \ // (int)(((C)<<2) | (B)), \ // (__v8sf)(__m256)_mm256_setzero_ps (), \ // (__mmask8)(U))) // #define _mm_getmant_ps(X, B, C) \ // ((__m128) __builtin_ia32_getmantps128_mask ((__v4sf)(__m128) (X), \ // (int)(((C)<<2) | (B)), \ // (__v4sf)(__m128)_mm_setzero_ps (), \ // (__mmask8)-1)) // #define _mm_mask_getmant_ps(W, U, X, B, C) \ // ((__m128) __builtin_ia32_getmantps128_mask ((__v4sf)(__m128) (X), \ // (int)(((C)<<2) | (B)), \ // (__v4sf)(__m128)(W), \ // (__mmask8)(U))) // #define _mm_maskz_getmant_ps(U, X, B, C) \ // ((__m128) __builtin_ia32_getmantps128_mask ((__v4sf)(__m128) (X), \ // (int)(((C)<<2) | (B)), \ // (__v4sf)(__m128)_mm_setzero_ps (), \ // (__mmask8)(U))) // #define _mm256_getmant_pd(X, B, C) \ // ((__m256d) __builtin_ia32_getmantpd256_mask ((__v4df)(__m256d) (X), \ // (int)(((C)<<2) | (B)), \ // (__v4df)(__m256d)_mm256_setzero_pd (),\ // (__mmask8)-1)) // #define _mm256_mask_getmant_pd(W, U, X, B, C) \ // ((__m256d) __builtin_ia32_getmantpd256_mask ((__v4df)(__m256d) (X), \ // (int)(((C)<<2) | (B)), \ // (__v4df)(__m256d)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_getmant_pd(U, X, B, C) \ // ((__m256d) __builtin_ia32_getmantpd256_mask ((__v4df)(__m256d) (X), \ // (int)(((C)<<2) | (B)), \ // (__v4df)(__m256d)_mm256_setzero_pd (),\ // (__mmask8)(U))) // #define _mm_getmant_pd(X, B, C) \ // ((__m128d) __builtin_ia32_getmantpd128_mask ((__v2df)(__m128d) (X), \ // (int)(((C)<<2) | (B)), \ // (__v2df)(__m128d)_mm_setzero_pd (), \ // (__mmask8)-1)) // #define _mm_mask_getmant_pd(W, U, X, B, C) \ // ((__m128d) __builtin_ia32_getmantpd128_mask ((__v2df)(__m128d) (X), \ // (int)(((C)<<2) | (B)), \ // (__v2df)(__m128d)(W), \ // (__mmask8)(U))) // #define _mm_maskz_getmant_pd(U, X, B, C) \ // ((__m128d) __builtin_ia32_getmantpd128_mask ((__v2df)(__m128d) (X), \ // (int)(((C)<<2) | (B)), \ // (__v2df)(__m128d)_mm_setzero_pd (), \ // (__mmask8)(U))) // #define _mm256_mmask_i32gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m256) __builtin_ia32_gather3siv8sf ((__v8sf)(__m256) (V1OLD), \ // (void const *) (ADDR), \ // (__v8si)(__m256i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm_mmask_i32gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m128) __builtin_ia32_gather3siv4sf ((__v4sf)(__m128) (V1OLD), \ // (void const *) (ADDR), \ // (__v4si)(__m128i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm256_mmask_i32gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m256d) __builtin_ia32_gather3siv4df ((__v4df)(__m256d) (V1OLD), \ // (void const *) (ADDR), \ // (__v4si)(__m128i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm_mmask_i32gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m128d) __builtin_ia32_gather3siv2df ((__v2df)(__m128d) (V1OLD), \ // (void const *) (ADDR), \ // (__v4si)(__m128i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm256_mmask_i64gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m128) __builtin_ia32_gather3div8sf ((__v4sf)(__m128) (V1OLD), \ // (void const *) (ADDR), \ // (__v4di)(__m256i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm_mmask_i64gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m128) __builtin_ia32_gather3div4sf ((__v4sf)(__m128) (V1OLD), \ // (void const *) (ADDR), \ // (__v2di)(__m128i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm256_mmask_i64gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m256d) __builtin_ia32_gather3div4df ((__v4df)(__m256d) (V1OLD), \ // (void const *) (ADDR), \ // (__v4di)(__m256i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm_mmask_i64gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m128d) __builtin_ia32_gather3div2df ((__v2df)(__m128d) (V1OLD), \ // (void const *) (ADDR), \ // (__v2di)(__m128i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm256_mmask_i32gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m256i) __builtin_ia32_gather3siv8si ((__v8si)(__m256i) (V1OLD), \ // (void const *) (ADDR), \ // (__v8si)(__m256i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm_mmask_i32gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m128i) __builtin_ia32_gather3siv4si ((__v4si)(__m128i) (V1OLD), \ // (void const *) (ADDR), \ // (__v4si)(__m128i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm256_mmask_i32gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m256i) __builtin_ia32_gather3siv4di ((__v4di)(__m256i) (V1OLD), \ // (void const *) (ADDR), \ // (__v4si)(__m128i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm_mmask_i32gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m128i) __builtin_ia32_gather3siv2di ((__v2di)(__m128i) (V1OLD), \ // (void const *) (ADDR), \ // (__v4si)(__m128i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm256_mmask_i64gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m128i) __builtin_ia32_gather3div8si ((__v4si)(__m128i) (V1OLD), \ // (void const *) (ADDR), \ // (__v4di)(__m256i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm_mmask_i64gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m128i) __builtin_ia32_gather3div4si ((__v4si)(__m128i) (V1OLD), \ // (void const *) (ADDR), \ // (__v2di)(__m128i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm256_mmask_i64gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m256i) __builtin_ia32_gather3div4di ((__v4di)(__m256i) (V1OLD), \ // (void const *) (ADDR), \ // (__v4di)(__m256i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm_mmask_i64gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \ // (__m128i) __builtin_ia32_gather3div2di ((__v2di)(__m128i) (V1OLD), \ // (void const *) (ADDR), \ // (__v2di)(__m128i) (INDEX), \ // (__mmask8) (MASK), \ // (int) (SCALE)) // #define _mm256_i32scatter_ps(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv8sf ((void *) (ADDR), (__mmask8)0xFF, \ // (__v8si)(__m256i) (INDEX), \ // (__v8sf)(__m256) (V1), (int) (SCALE)) // #define _mm256_mask_i32scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv8sf ((void *) (ADDR), (__mmask8) (MASK), \ // (__v8si)(__m256i) (INDEX), \ // (__v8sf)(__m256) (V1), (int) (SCALE)) // #define _mm_i32scatter_ps(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv4sf ((void *) (ADDR), (__mmask8)0xFF, \ // (__v4si)(__m128i) (INDEX), \ // (__v4sf)(__m128) (V1), (int) (SCALE)) // #define _mm_mask_i32scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv4sf ((void *) (ADDR), (__mmask8) (MASK), \ // (__v4si)(__m128i) (INDEX), \ // (__v4sf)(__m128) (V1), (int) (SCALE)) // #define _mm256_i32scatter_pd(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv4df ((void *) (ADDR), (__mmask8)0xFF, \ // (__v4si)(__m128i) (INDEX), \ // (__v4df)(__m256d) (V1), (int) (SCALE)) // #define _mm256_mask_i32scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv4df ((void *) (ADDR), (__mmask8) (MASK), \ // (__v4si)(__m128i) (INDEX), \ // (__v4df)(__m256d) (V1), (int) (SCALE)) // #define _mm_i32scatter_pd(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv2df ((void *) (ADDR), (__mmask8)0xFF, \ // (__v4si)(__m128i) (INDEX), \ // (__v2df)(__m128d) (V1), (int) (SCALE)) // #define _mm_mask_i32scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv2df ((void *) (ADDR), (__mmask8) (MASK), \ // (__v4si)(__m128i) (INDEX), \ // (__v2df)(__m128d) (V1), (int) (SCALE)) // #define _mm256_i64scatter_ps(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv8sf ((void *) (ADDR), (__mmask8)0xFF, \ // (__v4di)(__m256i) (INDEX), \ // (__v4sf)(__m128) (V1), (int) (SCALE)) // #define _mm256_mask_i64scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv8sf ((void *) (ADDR), (__mmask8) (MASK), \ // (__v4di)(__m256i) (INDEX), \ // (__v4sf)(__m128) (V1), (int) (SCALE)) // #define _mm_i64scatter_ps(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv4sf ((void *) (ADDR), (__mmask8)0xFF, \ // (__v2di)(__m128i) (INDEX), \ // (__v4sf)(__m128) (V1), (int) (SCALE)) // #define _mm_mask_i64scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv4sf ((void *) (ADDR), (__mmask8) (MASK), \ // (__v2di)(__m128i) (INDEX), \ // (__v4sf)(__m128) (V1), (int) (SCALE)) // #define _mm256_i64scatter_pd(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv4df ((void *) (ADDR), (__mmask8)0xFF, \ // (__v4di)(__m256i) (INDEX), \ // (__v4df)(__m256d) (V1), (int) (SCALE)) // #define _mm256_mask_i64scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv4df ((void *) (ADDR), (__mmask8) (MASK), \ // (__v4di)(__m256i) (INDEX), \ // (__v4df)(__m256d) (V1), (int) (SCALE)) // #define _mm_i64scatter_pd(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv2df ((void *) (ADDR), (__mmask8)0xFF, \ // (__v2di)(__m128i) (INDEX), \ // (__v2df)(__m128d) (V1), (int) (SCALE)) // #define _mm_mask_i64scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv2df ((void *) (ADDR), (__mmask8) (MASK), \ // (__v2di)(__m128i) (INDEX), \ // (__v2df)(__m128d) (V1), (int) (SCALE)) // #define _mm256_i32scatter_epi32(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv8si ((void *) (ADDR), (__mmask8)0xFF, \ // (__v8si)(__m256i) (INDEX), \ // (__v8si)(__m256i) (V1), (int) (SCALE)) // #define _mm256_mask_i32scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv8si ((void *) (ADDR), (__mmask8) (MASK), \ // (__v8si)(__m256i) (INDEX), \ // (__v8si)(__m256i) (V1), (int) (SCALE)) // #define _mm_i32scatter_epi32(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv4si ((void *) (ADDR), (__mmask8)0xFF, \ // (__v4si)(__m128i) (INDEX), \ // (__v4si)(__m128i) (V1), (int) (SCALE)) // #define _mm_mask_i32scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv4si ((void *) (ADDR), (__mmask8) (MASK), \ // (__v4si)(__m128i) (INDEX), \ // (__v4si)(__m128i) (V1), (int) (SCALE)) // #define _mm256_i32scatter_epi64(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv4di ((void *) (ADDR), (__mmask8)0xFF, \ // (__v4si)(__m128i) (INDEX), \ // (__v4di)(__m256i) (V1), (int) (SCALE)) // #define _mm256_mask_i32scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv4di ((void *) (ADDR), (__mmask8) (MASK), \ // (__v4si)(__m128i) (INDEX), \ // (__v4di)(__m256i) (V1), (int) (SCALE)) // #define _mm_i32scatter_epi64(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv2di ((void *) (ADDR), (__mmask8)0xFF, \ // (__v4si)(__m128i) (INDEX), \ // (__v2di)(__m128i) (V1), (int) (SCALE)) // #define _mm_mask_i32scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scattersiv2di ((void *) (ADDR), (__mmask8) (MASK), \ // (__v4si)(__m128i) (INDEX), \ // (__v2di)(__m128i) (V1), (int) (SCALE)) // #define _mm256_i64scatter_epi32(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv8si ((void *) (ADDR), (__mmask8)0xFF, \ // (__v4di)(__m256i) (INDEX), \ // (__v4si)(__m128i) (V1), (int) (SCALE)) // #define _mm256_mask_i64scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv8si ((void *) (ADDR), (__mmask8) (MASK), \ // (__v4di)(__m256i) (INDEX), \ // (__v4si)(__m128i) (V1), (int) (SCALE)) // #define _mm_i64scatter_epi32(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv4si ((void *) (ADDR), (__mmask8)0xFF, \ // (__v2di)(__m128i) (INDEX), \ // (__v4si)(__m128i) (V1), (int) (SCALE)) // #define _mm_mask_i64scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv4si ((void *) (ADDR), (__mmask8) (MASK), \ // (__v2di)(__m128i) (INDEX), \ // (__v4si)(__m128i) (V1), (int) (SCALE)) // #define _mm256_i64scatter_epi64(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv4di ((void *) (ADDR), (__mmask8)0xFF, \ // (__v4di)(__m256i) (INDEX), \ // (__v4di)(__m256i) (V1), (int) (SCALE)) // #define _mm256_mask_i64scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv4di ((void *) (ADDR), (__mmask8) (MASK), \ // (__v4di)(__m256i) (INDEX), \ // (__v4di)(__m256i) (V1), (int) (SCALE)) // #define _mm_i64scatter_epi64(ADDR, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv2di ((void *) (ADDR), (__mmask8)0xFF, \ // (__v2di)(__m128i) (INDEX), \ // (__v2di)(__m128i) (V1), (int) (SCALE)) // #define _mm_mask_i64scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \ // __builtin_ia32_scatterdiv2di ((void *) (ADDR), (__mmask8) (MASK), \ // (__v2di)(__m128i) (INDEX), \ // (__v2di)(__m128i) (V1), (int) (SCALE)) // #define _mm256_mask_shuffle_epi32(W, U, X, C) \ // ((__m256i) __builtin_ia32_pshufd256_mask ((__v8si)(__m256i)(X), (int)(C), \ // (__v8si)(__m256i)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_shuffle_epi32(U, X, C) \ // ((__m256i) __builtin_ia32_pshufd256_mask ((__v8si)(__m256i)(X), (int)(C), \ // (__v8si)(__m256i) \ // _mm256_setzero_si256 (), \ // (__mmask8)(U))) // #define _mm_mask_shuffle_epi32(W, U, X, C) \ // ((__m128i) __builtin_ia32_pshufd128_mask ((__v4si)(__m128i)(X), (int)(C), \ // (__v4si)(__m128i)(W), \ // (__mmask8)(U))) // #define _mm_maskz_shuffle_epi32(U, X, C) \ // ((__m128i) __builtin_ia32_pshufd128_mask ((__v4si)(__m128i)(X), (int)(C), \ // (__v4si)(__m128i)_mm_setzero_si128 (), \ // (__mmask8)(U))) // #define _mm256_rol_epi64(A, B) \ // ((__m256i)__builtin_ia32_prolq256_mask ((__v4di)(__m256i)(A), (int)(B), \ // (__v4di)(__m256i)_mm256_setzero_si256 (),\ // (__mmask8)-1)) // #define _mm256_mask_rol_epi64(W, U, A, B) \ // ((__m256i)__builtin_ia32_prolq256_mask ((__v4di)(__m256i)(A), (int)(B), \ // (__v4di)(__m256i)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_rol_epi64(U, A, B) \ // ((__m256i)__builtin_ia32_prolq256_mask ((__v4di)(__m256i)(A), (int)(B), \ // (__v4di)(__m256i)_mm256_setzero_si256 (),\ // (__mmask8)(U))) // #define _mm_rol_epi64(A, B) \ // ((__m128i)__builtin_ia32_prolq128_mask ((__v2di)(__m128i)(A), (int)(B), \ // (__v2di)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)-1)) // #define _mm_mask_rol_epi64(W, U, A, B) \ // ((__m128i)__builtin_ia32_prolq128_mask ((__v2di)(__m128i)(A), (int)(B), \ // (__v2di)(__m128i)(W), \ // (__mmask8)(U))) // #define _mm_maskz_rol_epi64(U, A, B) \ // ((__m128i)__builtin_ia32_prolq128_mask ((__v2di)(__m128i)(A), (int)(B), \ // (__v2di)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)(U))) // #define _mm256_ror_epi64(A, B) \ // ((__m256i)__builtin_ia32_prorq256_mask ((__v4di)(__m256i)(A), (int)(B), \ // (__v4di)(__m256i)_mm256_setzero_si256 (),\ // (__mmask8)-1)) // #define _mm256_mask_ror_epi64(W, U, A, B) \ // ((__m256i)__builtin_ia32_prorq256_mask ((__v4di)(__m256i)(A), (int)(B), \ // (__v4di)(__m256i)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_ror_epi64(U, A, B) \ // ((__m256i)__builtin_ia32_prorq256_mask ((__v4di)(__m256i)(A), (int)(B), \ // (__v4di)(__m256i)_mm256_setzero_si256 (),\ // (__mmask8)(U))) // #define _mm_ror_epi64(A, B) \ // ((__m128i)__builtin_ia32_prorq128_mask ((__v2di)(__m128i)(A), (int)(B), \ // (__v2di)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)-1)) // #define _mm_mask_ror_epi64(W, U, A, B) \ // ((__m128i)__builtin_ia32_prorq128_mask ((__v2di)(__m128i)(A), (int)(B), \ // (__v2di)(__m128i)(W), \ // (__mmask8)(U))) // #define _mm_maskz_ror_epi64(U, A, B) \ // ((__m128i)__builtin_ia32_prorq128_mask ((__v2di)(__m128i)(A), (int)(B), \ // (__v2di)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)(U))) // #define _mm256_rol_epi32(A, B) \ // ((__m256i)__builtin_ia32_prold256_mask ((__v8si)(__m256i)(A), (int)(B), \ // (__v8si)(__m256i)_mm256_setzero_si256 (),\ // (__mmask8)-1)) // #define _mm256_mask_rol_epi32(W, U, A, B) \ // ((__m256i)__builtin_ia32_prold256_mask ((__v8si)(__m256i)(A), (int)(B), \ // (__v8si)(__m256i)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_rol_epi32(U, A, B) \ // ((__m256i)__builtin_ia32_prold256_mask ((__v8si)(__m256i)(A), (int)(B), \ // (__v8si)(__m256i)_mm256_setzero_si256 (),\ // (__mmask8)(U))) // #define _mm_rol_epi32(A, B) \ // ((__m128i)__builtin_ia32_prold128_mask ((__v4si)(__m128i)(A), (int)(B), \ // (__v4si)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)-1)) // #define _mm_mask_rol_epi32(W, U, A, B) \ // ((__m128i)__builtin_ia32_prold128_mask ((__v4si)(__m128i)(A), (int)(B), \ // (__v4si)(__m128i)(W), \ // (__mmask8)(U))) // #define _mm_maskz_rol_epi32(U, A, B) \ // ((__m128i)__builtin_ia32_prold128_mask ((__v4si)(__m128i)(A), (int)(B), \ // (__v4si)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)(U))) // #define _mm256_ror_epi32(A, B) \ // ((__m256i)__builtin_ia32_prord256_mask ((__v8si)(__m256i)(A), (int)(B), \ // (__v8si)(__m256i)_mm256_setzero_si256 (),\ // (__mmask8)-1)) // #define _mm256_mask_ror_epi32(W, U, A, B) \ // ((__m256i)__builtin_ia32_prord256_mask ((__v8si)(__m256i)(A), (int)(B), \ // (__v8si)(__m256i)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_ror_epi32(U, A, B) \ // ((__m256i)__builtin_ia32_prord256_mask ((__v8si)(__m256i)(A), (int)(B), \ // (__v8si)(__m256i) \ // _mm256_setzero_si256 (), \ // (__mmask8)(U))) // #define _mm_ror_epi32(A, B) \ // ((__m128i)__builtin_ia32_prord128_mask ((__v4si)(__m128i)(A), (int)(B), \ // (__v4si)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)-1)) // #define _mm_mask_ror_epi32(W, U, A, B) \ // ((__m128i)__builtin_ia32_prord128_mask ((__v4si)(__m128i)(A), (int)(B), \ // (__v4si)(__m128i)(W), \ // (__mmask8)(U))) // #define _mm_maskz_ror_epi32(U, A, B) \ // ((__m128i)__builtin_ia32_prord128_mask ((__v4si)(__m128i)(A), (int)(B), \ // (__v4si)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)(U))) // #define _mm256_alignr_epi32(X, Y, C) \ // ((__m256i)__builtin_ia32_alignd256_mask ((__v8si)(__m256i)(X), \ // (__v8si)(__m256i)(Y), (int)(C), (__v8si)(__m256i)(X), (__mmask8)-1)) // #define _mm256_mask_alignr_epi32(W, U, X, Y, C) \ // ((__m256i)__builtin_ia32_alignd256_mask ((__v8si)(__m256i)(X), \ // (__v8si)(__m256i)(Y), (int)(C), (__v8si)(__m256i)(W), (__mmask8)(U))) // #define _mm256_maskz_alignr_epi32(U, X, Y, C) \ // ((__m256i)__builtin_ia32_alignd256_mask ((__v8si)(__m256i)(X), \ // (__v8si)(__m256i)(Y), (int)(C), (__v8si)(__m256i)_mm256_setzero_si256 (),\ // (__mmask8)(U))) // #define _mm256_alignr_epi64(X, Y, C) \ // ((__m256i)__builtin_ia32_alignq256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)(C), (__v4di)(__m256i)(X), (__mmask8)-1)) // #define _mm256_mask_alignr_epi64(W, U, X, Y, C) \ // ((__m256i)__builtin_ia32_alignq256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)(C), (__v4di)(__m256i)(W), (__mmask8)(U))) // #define _mm256_maskz_alignr_epi64(U, X, Y, C) \ // ((__m256i)__builtin_ia32_alignq256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)(C), (__v4di)(__m256i)_mm256_setzero_si256 (),\ // (__mmask8)(U))) // #define _mm_alignr_epi32(X, Y, C) \ // ((__m128i)__builtin_ia32_alignd128_mask ((__v4si)(__m128i)(X), \ // (__v4si)(__m128i)(Y), (int)(C), (__v4si)(__m128i)(X), (__mmask8)-1)) // #define _mm_mask_alignr_epi32(W, U, X, Y, C) \ // ((__m128i)__builtin_ia32_alignd128_mask ((__v4si)(__m128i)(X), \ // (__v4si)(__m128i)(Y), (int)(C), (__v4si)(__m128i)(W), (__mmask8)(U))) // #define _mm_maskz_alignr_epi32(U, X, Y, C) \ // ((__m128i)__builtin_ia32_alignd128_mask ((__v4si)(__m128i)(X), \ // (__v4si)(__m128i)(Y), (int)(C), (__v4si)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)(U))) // #define _mm_alignr_epi64(X, Y, C) \ // ((__m128i)__builtin_ia32_alignq128_mask ((__v2di)(__m128i)(X), \ // (__v2di)(__m128i)(Y), (int)(C), (__v2di)(__m128i)(X), (__mmask8)-1)) // #define _mm_mask_alignr_epi64(W, U, X, Y, C) \ // ((__m128i)__builtin_ia32_alignq128_mask ((__v2di)(__m128i)(X), \ // (__v2di)(__m128i)(Y), (int)(C), (__v2di)(__m128i)(X), (__mmask8)-1)) // #define _mm_maskz_alignr_epi64(U, X, Y, C) \ // ((__m128i)__builtin_ia32_alignq128_mask ((__v2di)(__m128i)(X), \ // (__v2di)(__m128i)(Y), (int)(C), (__v2di)(__m128i)_mm_setzero_si128 (),\ // (__mmask8)(U))) // #define _mm_mask_cvtps_ph(W, U, A, I) \ // ((__m128i) __builtin_ia32_vcvtps2ph_mask ((__v4sf)(__m128) (A), (int) (I), \ // (__v8hi)(__m128i) (W), (__mmask8) (U))) // #define _mm_maskz_cvtps_ph(U, A, I) \ // ((__m128i) __builtin_ia32_vcvtps2ph_mask ((__v4sf)(__m128) (A), (int) (I), \ // (__v8hi)(__m128i) _mm_setzero_si128 (), (__mmask8) (U))) // #define _mm256_mask_cvtps_ph(W, U, A, I) \ // ((__m128i) __builtin_ia32_vcvtps2ph256_mask ((__v8sf)(__m256) (A), (int) (I), \ // (__v8hi)(__m128i) (W), (__mmask8) (U))) // #define _mm256_maskz_cvtps_ph(U, A, I) \ // ((__m128i) __builtin_ia32_vcvtps2ph256_mask ((__v8sf)(__m256) (A), (int) (I), \ // (__v8hi)(__m128i) _mm_setzero_si128 (), (__mmask8) (U))) // #define _mm256_mask_srai_epi32(W, U, A, B) \ // ((__m256i) __builtin_ia32_psradi256_mask ((__v8si)(__m256i)(A), \ // (int)(B), (__v8si)(__m256i)(W), (__mmask8)(U))) // #define _mm256_maskz_srai_epi32(U, A, B) \ // ((__m256i) __builtin_ia32_psradi256_mask ((__v8si)(__m256i)(A), \ // (int)(B), (__v8si)_mm256_setzero_si256 (), (__mmask8)(U))) // #define _mm_mask_srai_epi32(W, U, A, B) \ // ((__m128i) __builtin_ia32_psradi128_mask ((__v4si)(__m128i)(A), \ // (int)(B), (__v4si)(__m128i)(W), (__mmask8)(U))) // #define _mm_maskz_srai_epi32(U, A, B) \ // ((__m128i) __builtin_ia32_psradi128_mask ((__v4si)(__m128i)(A), \ // (int)(B), (__v4si)_mm_setzero_si128 (), (__mmask8)(U))) // #define _mm256_srai_epi64(A, B) \ // ((__m256i) __builtin_ia32_psraqi256_mask ((__v4di)(__m256i)(A), \ // (int)(B), (__v4di)_mm256_setzero_si256 (), (__mmask8)-1)) // #define _mm256_mask_srai_epi64(W, U, A, B) \ // ((__m256i) __builtin_ia32_psraqi256_mask ((__v4di)(__m256i)(A), \ // (int)(B), (__v4di)(__m256i)(W), (__mmask8)(U))) // #define _mm256_maskz_srai_epi64(U, A, B) \ // ((__m256i) __builtin_ia32_psraqi256_mask ((__v4di)(__m256i)(A), \ // (int)(B), (__v4di)_mm256_setzero_si256 (), (__mmask8)(U))) // #define _mm_srai_epi64(A, B) \ // ((__m128i) __builtin_ia32_psraqi128_mask ((__v2di)(__m128i)(A), \ // (int)(B), (__v2di)_mm_setzero_si128 (), (__mmask8)-1)) // #define _mm_mask_srai_epi64(W, U, A, B) \ // ((__m128i) __builtin_ia32_psraqi128_mask ((__v2di)(__m128i)(A), \ // (int)(B), (__v2di)(__m128i)(W), (__mmask8)(U))) // #define _mm_maskz_srai_epi64(U, A, B) \ // ((__m128i) __builtin_ia32_psraqi128_mask ((__v2di)(__m128i)(A), \ // (int)(B), (__v2di)_mm_setzero_si128 (), (__mmask8)(U))) // #define _mm256_mask_permutex_pd(W, U, A, B) \ // ((__m256d) __builtin_ia32_permdf256_mask ((__v4df)(__m256d)(A), \ // (int)(B), (__v4df)(__m256d)(W), (__mmask8)(U))) // #define _mm256_maskz_permutex_pd(U, A, B) \ // ((__m256d) __builtin_ia32_permdf256_mask ((__v4df)(__m256d)(A), \ // (int)(B), (__v4df)(__m256d)_mm256_setzero_pd (), (__mmask8)(U))) // #define _mm256_mask_permute_pd(W, U, X, C) \ // ((__m256d) __builtin_ia32_vpermilpd256_mask ((__v4df)(__m256d)(X), (int)(C), \ // (__v4df)(__m256d)(W), \ // (__mmask8)(U))) // #define _mm256_maskz_permute_pd(U, X, C) \ // ((__m256d) __builtin_ia32_vpermilpd256_mask ((__v4df)(__m256d)(X), (int)(C), \ // (__v4df)(__m256d)_mm256_setzero_pd (),\ // (__mmask8)(U))) // #define _mm256_mask_permute_ps(W, U, X, C) \ // ((__m256) __builtin_ia32_vpermilps256_mask ((__v8sf)(__m256)(X), (int)(C), \ // (__v8sf)(__m256)(W), (__mmask8)(U))) // #define _mm256_maskz_permute_ps(U, X, C) \ // ((__m256) __builtin_ia32_vpermilps256_mask ((__v8sf)(__m256)(X), (int)(C), \ // (__v8sf)(__m256)_mm256_setzero_ps (), \ // (__mmask8)(U))) // #define _mm_mask_permute_pd(W, U, X, C) \ // ((__m128d) __builtin_ia32_vpermilpd_mask ((__v2df)(__m128d)(X), (int)(C), \ // (__v2df)(__m128d)(W), (__mmask8)(U))) // #define _mm_maskz_permute_pd(U, X, C) \ // ((__m128d) __builtin_ia32_vpermilpd_mask ((__v2df)(__m128d)(X), (int)(C), \ // (__v2df)(__m128d)_mm_setzero_pd (), \ // (__mmask8)(U))) // #define _mm_mask_permute_ps(W, U, X, C) \ // ((__m128) __builtin_ia32_vpermilps_mask ((__v4sf)(__m128)(X), (int)(C), \ // (__v4sf)(__m128)(W), (__mmask8)(U))) // #define _mm_maskz_permute_ps(U, X, C) \ // ((__m128) __builtin_ia32_vpermilps_mask ((__v4sf)(__m128)(X), (int)(C), \ // (__v4sf)(__m128)_mm_setzero_ps (), \ // (__mmask8)(U))) // #define _mm256_mask_blend_pd(__U, __A, __W) \ // ((__m256d) __builtin_ia32_blendmpd_256_mask ((__v4df) (__A), \ // (__v4df) (__W), \ // (__mmask8) (__U))) // #define _mm256_mask_blend_ps(__U, __A, __W) \ // ((__m256) __builtin_ia32_blendmps_256_mask ((__v8sf) (__A), \ // (__v8sf) (__W), \ // (__mmask8) (__U))) // #define _mm256_mask_blend_epi64(__U, __A, __W) \ // ((__m256i) __builtin_ia32_blendmq_256_mask ((__v4di) (__A), \ // (__v4di) (__W), \ // (__mmask8) (__U))) // #define _mm256_mask_blend_epi32(__U, __A, __W) \ // ((__m256i) __builtin_ia32_blendmd_256_mask ((__v8si) (__A), \ // (__v8si) (__W), \ // (__mmask8) (__U))) // #define _mm_mask_blend_pd(__U, __A, __W) \ // ((__m128d) __builtin_ia32_blendmpd_128_mask ((__v2df) (__A), \ // (__v2df) (__W), \ // (__mmask8) (__U))) // #define _mm_mask_blend_ps(__U, __A, __W) \ // ((__m128) __builtin_ia32_blendmps_128_mask ((__v4sf) (__A), \ // (__v4sf) (__W), \ // (__mmask8) (__U))) // #define _mm_mask_blend_epi64(__U, __A, __W) \ // ((__m128i) __builtin_ia32_blendmq_128_mask ((__v2di) (__A), \ // (__v2di) (__W), \ // (__mmask8) (__U))) // #define _mm_mask_blend_epi32(__U, __A, __W) \ // ((__m128i) __builtin_ia32_blendmd_128_mask ((__v4si) (__A), \ // (__v4si) (__W), \ // (__mmask8) (__U))) // #define _mm256_cmp_epu32_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si)(__m256i)(X), \ // (__v8si)(__m256i)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm256_cmp_epi64_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpq256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm256_cmp_epi32_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpd256_mask ((__v8si)(__m256i)(X), \ // (__v8si)(__m256i)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm256_cmp_epu64_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm256_cmp_pd_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmppd256_mask ((__v4df)(__m256d)(X), \ // (__v4df)(__m256d)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm256_cmp_ps_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpps256_mask ((__v8sf)(__m256)(X), \ // (__v8sf)(__m256)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm256_mask_cmp_epi64_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpq256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm256_mask_cmp_epi32_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpd256_mask ((__v8si)(__m256i)(X), \ // (__v8si)(__m256i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm256_mask_cmp_epu64_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpq256_mask ((__v4di)(__m256i)(X), \ // (__v4di)(__m256i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm256_mask_cmp_epu32_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpd256_mask ((__v8si)(__m256i)(X), \ // (__v8si)(__m256i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm256_mask_cmp_pd_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmppd256_mask ((__v4df)(__m256d)(X), \ // (__v4df)(__m256d)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm256_mask_cmp_ps_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpps256_mask ((__v8sf)(__m256)(X), \ // (__v8sf)(__m256)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm_cmp_epi64_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpq128_mask ((__v2di)(__m128i)(X), \ // (__v2di)(__m128i)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm_cmp_epi32_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpd128_mask ((__v4si)(__m128i)(X), \ // (__v4si)(__m128i)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm_cmp_epu64_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di)(__m128i)(X), \ // (__v2di)(__m128i)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm_cmp_epu32_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si)(__m128i)(X), \ // (__v4si)(__m128i)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm_cmp_pd_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmppd128_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm_cmp_ps_mask(X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpps128_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (int)(P),\ // (__mmask8)-1)) // #define _mm_mask_cmp_epi64_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpq128_mask ((__v2di)(__m128i)(X), \ // (__v2di)(__m128i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm_mask_cmp_epi32_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpd128_mask ((__v4si)(__m128i)(X), \ // (__v4si)(__m128i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm_mask_cmp_epu64_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpq128_mask ((__v2di)(__m128i)(X), \ // (__v2di)(__m128i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm_mask_cmp_epu32_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_ucmpd128_mask ((__v4si)(__m128i)(X), \ // (__v4si)(__m128i)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm_mask_cmp_pd_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmppd128_mask ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), (int)(P),\ // (__mmask8)(M))) // #define _mm_mask_cmp_ps_mask(M, X, Y, P) \ // ((__mmask8) __builtin_ia32_cmpps128_mask ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), (int)(P),\ // (__mmask8)(M))) // #endif #define _mm256_permutexvar_ps(A, B) _mm256_permutevar8x32_ps ((B), (A)) #ifdef __DISABLE_AVX512VL__ #undef __DISABLE_AVX512VL__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VL__ */ #endif /* _AVX512VLINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vnniintrin.h000066400000000000000000000121671517770275000201450ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef __AVX512VNNIINTRIN_H_INCLUDED #define __AVX512VNNIINTRIN_H_INCLUDED #if !defined(__AVX512VNNI__) #pragma GCC push_options #pragma GCC target("avx512vnni") #define __DISABLE_AVX512VNNI__ #endif /* __AVX512VNNI__ */ // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_dpbusd_epi32 (__m512i __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vpdpbusd_v16si ((__v16si)__A, (__v16si) __B, // (__v16si) __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_dpbusd_epi32 (__m512i __A, __mmask16 __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpdpbusd_v16si_mask ((__v16si)__A, // (__v16si) __C, (__v16si) __D, (__mmask16)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_dpbusd_epi32 (__mmask16 __A, __m512i __B, __m512i __C, // __m512i __D) // { // return (__m512i)__builtin_ia32_vpdpbusd_v16si_maskz ((__v16si)__B, // (__v16si) __C, (__v16si) __D, (__mmask16)__A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_dpbusds_epi32 (__m512i __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vpdpbusds_v16si ((__v16si)__A, (__v16si) __B, // (__v16si) __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_dpbusds_epi32 (__m512i __A, __mmask16 __B, __m512i __C, // __m512i __D) // { // return (__m512i)__builtin_ia32_vpdpbusds_v16si_mask ((__v16si)__A, // (__v16si) __C, (__v16si) __D, (__mmask16)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_dpbusds_epi32 (__mmask16 __A, __m512i __B, __m512i __C, // __m512i __D) // { // return (__m512i)__builtin_ia32_vpdpbusds_v16si_maskz ((__v16si)__B, // (__v16si) __C, (__v16si) __D, (__mmask16)__A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_dpwssd_epi32 (__m512i __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vpdpwssd_v16si ((__v16si)__A, (__v16si) __B, // (__v16si) __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_dpwssd_epi32 (__m512i __A, __mmask16 __B, __m512i __C, __m512i __D) // { // return (__m512i)__builtin_ia32_vpdpwssd_v16si_mask ((__v16si)__A, // (__v16si) __C, (__v16si) __D, (__mmask16)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_dpwssd_epi32 (__mmask16 __A, __m512i __B, __m512i __C, // __m512i __D) // { // return (__m512i)__builtin_ia32_vpdpwssd_v16si_maskz ((__v16si)__B, // (__v16si) __C, (__v16si) __D, (__mmask16)__A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_dpwssds_epi32 (__m512i __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vpdpwssds_v16si ((__v16si)__A, (__v16si) __B, // (__v16si) __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_dpwssds_epi32 (__m512i __A, __mmask16 __B, __m512i __C, // __m512i __D) // { // return (__m512i)__builtin_ia32_vpdpwssds_v16si_mask ((__v16si)__A, // (__v16si) __C, (__v16si) __D, (__mmask16)__B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_dpwssds_epi32 (__mmask16 __A, __m512i __B, __m512i __C, // __m512i __D) // { // return (__m512i)__builtin_ia32_vpdpwssds_v16si_maskz ((__v16si)__B, // (__v16si) __C, (__v16si) __D, (__mmask16)__A); // } #ifdef __DISABLE_AVX512VNNI__ #undef __DISABLE_AVX512VNNI__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VNNI__ */ #endif /* __AVX512VNNIINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vnnivlintrin.h000066400000000000000000000210621517770275000205010ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512VNNIVLINTRIN_H_INCLUDED #define _AVX512VNNIVLINTRIN_H_INCLUDED #if !defined(__AVX512VL__) || !defined(__AVX512VNNI__) #pragma GCC push_options #pragma GCC target("avx512vnni,avx512vl") #define __DISABLE_AVX512VNNIVL__ #endif /* __AVX512VNNIVL__ */ // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_dpbusd_epi32 (__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpdpbusd_v8si ((__v8si)__A, (__v8si) __B, // (__v8si) __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_dpbusd_epi32 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpdpbusd_v8si_mask ((__v8si)__A, (__v8si) __C, // (__v8si) __D, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_dpbusd_epi32 (__mmask8 __A, __m256i __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpdpbusd_v8si_maskz ((__v8si)__B, // (__v8si) __C, (__v8si) __D, (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_dpbusd_epi32 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpdpbusd_v4si ((__v4si)__A, (__v4si) __B, // (__v4si) __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_dpbusd_epi32 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpdpbusd_v4si_mask ((__v4si)__A, (__v4si) __C, // (__v4si) __D, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_dpbusd_epi32 (__mmask8 __A, __m128i __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpdpbusd_v4si_maskz ((__v4si)__B, // (__v4si) __C, (__v4si) __D, (__mmask8)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_dpbusds_epi32 (__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpdpbusds_v8si ((__v8si)__A, (__v8si) __B, // (__v8si) __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_dpbusds_epi32 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpdpbusds_v8si_mask ((__v8si)__A, // (__v8si) __C, (__v8si) __D, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_dpbusds_epi32 (__mmask8 __A, __m256i __B, __m256i __C, // __m256i __D) // { // return (__m256i)__builtin_ia32_vpdpbusds_v8si_maskz ((__v8si)__B, // (__v8si) __C, (__v8si) __D, (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_dpbusds_epi32 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpdpbusds_v4si ((__v4si)__A, (__v4si) __B, // (__v4si) __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_dpbusds_epi32 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpdpbusds_v4si_mask ((__v4si)__A, // (__v4si) __C, (__v4si) __D, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_dpbusds_epi32 (__mmask8 __A, __m128i __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpdpbusds_v4si_maskz ((__v4si)__B, // (__v4si) __C, (__v4si) __D, (__mmask8)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_dpwssd_epi32 (__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpdpwssd_v8si ((__v8si)__A, (__v8si) __B, // (__v8si) __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_dpwssd_epi32 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpdpwssd_v8si_mask ((__v8si)__A, (__v8si) __C, // (__v8si) __D, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_dpwssd_epi32 (__mmask8 __A, __m256i __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpdpwssd_v8si_maskz ((__v8si)__B, // (__v8si) __C, (__v8si) __D, (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_dpwssd_epi32 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpdpwssd_v4si ((__v4si)__A, (__v4si) __B, // (__v4si) __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_dpwssd_epi32 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpdpwssd_v4si_mask ((__v4si)__A, (__v4si) __C, // (__v4si) __D, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_dpwssd_epi32 (__mmask8 __A, __m128i __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpdpwssd_v4si_maskz ((__v4si)__B, // (__v4si) __C, (__v4si) __D, (__mmask8)__A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_dpwssds_epi32 (__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpdpwssds_v8si ((__v8si)__A, (__v8si) __B, // (__v8si) __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_dpwssds_epi32 (__m256i __A, __mmask8 __B, __m256i __C, __m256i __D) // { // return (__m256i)__builtin_ia32_vpdpwssds_v8si_mask ((__v8si)__A, // (__v8si) __C, (__v8si) __D, (__mmask8)__B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_dpwssds_epi32 (__mmask8 __A, __m256i __B, __m256i __C, // __m256i __D) // { // return (__m256i)__builtin_ia32_vpdpwssds_v8si_maskz ((__v8si)__B, // (__v8si) __C, (__v8si) __D, (__mmask8)__A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_dpwssds_epi32 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpdpwssds_v4si ((__v4si)__A, (__v4si) __B, // (__v4si) __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_dpwssds_epi32 (__m128i __A, __mmask8 __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpdpwssds_v4si_mask ((__v4si)__A, // (__v4si) __C, (__v4si) __D, (__mmask8)__B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_dpwssds_epi32 (__mmask8 __A, __m128i __B, __m128i __C, __m128i __D) // { // return (__m128i)__builtin_ia32_vpdpwssds_v4si_maskz ((__v4si)__B, // (__v4si) __C, (__v4si) __D, (__mmask8)__A); // } #ifdef __DISABLE_AVX512VNNIVL__ #undef __DISABLE_AVX512VNNIVL__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VNNIVL__ */ #endif /* __DISABLE_AVX512VNNIVL__ */ chibicc-1.0.24/include/avx512vp2intersectintrin.h000066400000000000000000000041431517770275000216160ustar00rootroot00000000000000/* Copyright (C) 2019-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512VP2INTERSECTINTRIN_H_INCLUDED #define _AVX512VP2INTERSECTINTRIN_H_INCLUDED #if !defined(__AVX512VP2INTERSECT__) #pragma GCC push_options #pragma GCC target("avx512vp2intersect") #define __DISABLE_AVX512VP2INTERSECT__ #endif /* __AVX512VP2INTERSECT__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_2intersect_epi32 (__m512i __A, __m512i __B, __mmask16 *__U, // __mmask16 *__M) // { // __builtin_ia32_2intersectd512 (__U, __M, (__v16si) __A, (__v16si) __B); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_2intersect_epi64 (__m512i __A, __m512i __B, __mmask8 *__U, // __mmask8 *__M) // { // __builtin_ia32_2intersectq512 (__U, __M, (__v8di) __A, (__v8di) __B); // } #ifdef __DISABLE_AVX512VP2INTERSECT__ #undef __DISABLE_AVX512VP2INTERSECT__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VP2INTERSECT__ */ #endif /* _AVX512VP2INTERSECTINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vp2intersectvlintrin.h000066400000000000000000000052341517770275000221620ustar00rootroot00000000000000/* Copyright (C) 2019-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _AVX512VP2INTERSECTVLINTRIN_H_INCLUDED #define _AVX512VP2INTERSECTVLINTRIN_H_INCLUDED #if !defined(__AVX512VP2INTERSECT__) || !defined(__AVX512VL__) #pragma GCC push_options #pragma GCC target("avx512vp2intersect,avx512vl") #define __DISABLE_AVX512VP2INTERSECTVL__ #endif /* __AVX512VP2INTERSECTVL__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_2intersect_epi32 (__m128i __A, __m128i __B, __mmask8 *__U, __mmask8 *__M) // { // __builtin_ia32_2intersectd128 (__U, __M, (__v4si) __A, (__v4si) __B); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_2intersect_epi32 (__m256i __A, __m256i __B, __mmask8 *__U, // __mmask8 *__M) // { // __builtin_ia32_2intersectd256 (__U, __M, (__v8si) __A, (__v8si) __B); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_2intersect_epi64 (__m128i __A, __m128i __B, __mmask8 *__U, __mmask8 *__M) // { // __builtin_ia32_2intersectq128 (__U, __M, (__v2di) __A, (__v2di) __B); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_2intersect_epi64 (__m256i __A, __m256i __B, __mmask8 *__U, // __mmask8 *__M) // { // __builtin_ia32_2intersectq256 (__U, __M, (__v4di) __A, (__v4di) __B); // } #ifdef __DISABLE_AVX512VP2INTERSECTVL__ #undef __DISABLE_AVX512VP2INTERSECTVL__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VP2INTERSECTVL__ */ #endif /* _AVX512VP2INTERSECTVLINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vpopcntdqintrin.h000066400000000000000000000062601517770275000212060ustar00rootroot00000000000000/* Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _AVX512VPOPCNTDQINTRIN_H_INCLUDED #define _AVX512VPOPCNTDQINTRIN_H_INCLUDED #ifndef __AVX512VPOPCNTDQ__ #pragma GCC push_options #pragma GCC target("avx512vpopcntdq") #define __DISABLE_AVX512VPOPCNTDQ__ #endif /* __AVX512VPOPCNTDQ__ */ // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_popcnt_epi32 (__m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountd_v16si ((__v16si) __A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_popcnt_epi32 (__m512i __W, __mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountd_v16si_mask ((__v16si) __A, // (__v16si) __W, // (__mmask16) __U); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_popcnt_epi32 (__mmask16 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountd_v16si_mask ((__v16si) __A, // (__v16si) // _mm512_setzero_si512 (), // (__mmask16) __U); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_popcnt_epi64 (__m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountq_v8di ((__v8di) __A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_popcnt_epi64 (__m512i __W, __mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountq_v8di_mask ((__v8di) __A, // (__v8di) __W, // (__mmask8) __U); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_popcnt_epi64 (__mmask8 __U, __m512i __A) // { // return (__m512i) __builtin_ia32_vpopcountq_v8di_mask ((__v8di) __A, // (__v8di) // _mm512_setzero_si512 (), // (__mmask8) __U); // } #ifdef __DISABLE_AVX512VPOPCNTDQ__ #undef __DISABLE_AVX512VPOPCNTDQ__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VPOPCNTDQ__ */ #endif /* _AVX512VPOPCNTDQINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avx512vpopcntdqvlintrin.h000066400000000000000000000115171517770275000215510ustar00rootroot00000000000000/* Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _AVX512VPOPCNTDQVLINTRIN_H_INCLUDED #define _AVX512VPOPCNTDQVLINTRIN_H_INCLUDED #if !defined(__AVX512VPOPCNTDQ__) || !defined(__AVX512VL__) #pragma GCC push_options #pragma GCC target("avx512vpopcntdq,avx512vl") #define __DISABLE_AVX512VPOPCNTDQVL__ #endif /* __AVX512VPOPCNTDQVL__ */ // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_popcnt_epi32 (__m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountd_v4si ((__v4si) __A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_popcnt_epi32 (__m128i __W, __mmask16 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountd_v4si_mask ((__v4si) __A, // (__v4si) __W, // (__mmask16) __U); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_popcnt_epi32 (__mmask16 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountd_v4si_mask ((__v4si) __A, // (__v4si) // _mm_setzero_si128 (), // (__mmask16) __U); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_popcnt_epi32 (__m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountd_v8si ((__v8si) __A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_popcnt_epi32 (__m256i __W, __mmask16 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountd_v8si_mask ((__v8si) __A, // (__v8si) __W, // (__mmask16) __U); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_popcnt_epi32 (__mmask16 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountd_v8si_mask ((__v8si) __A, // (__v8si) // _mm256_setzero_si256 (), // (__mmask16) __U); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_popcnt_epi64 (__m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountq_v2di ((__v2di) __A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_popcnt_epi64 (__m128i __W, __mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountq_v2di_mask ((__v2di) __A, // (__v2di) __W, // (__mmask8) __U); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_popcnt_epi64 (__mmask8 __U, __m128i __A) // { // return (__m128i) __builtin_ia32_vpopcountq_v2di_mask ((__v2di) __A, // (__v2di) // _mm_setzero_si128 (), // (__mmask8) __U); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_popcnt_epi64 (__m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountq_v4di ((__v4di) __A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_popcnt_epi64 (__m256i __W, __mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountq_v4di_mask ((__v4di) __A, // (__v4di) __W, // (__mmask8) __U); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_popcnt_epi64 (__mmask8 __U, __m256i __A) // { // return (__m256i) __builtin_ia32_vpopcountq_v4di_mask ((__v4di) __A, // (__v4di) // _mm256_setzero_si256 (), // (__mmask8) __U); // } #ifdef __DISABLE_AVX512VPOPCNTDQVL__ #undef __DISABLE_AVX512VPOPCNTDQVL__ #pragma GCC pop_options #endif /* __DISABLE_AVX512VPOPCNTDQVL__ */ #endif /* _AVX512VPOPCNTDQVLINTRIN_H_INCLUDED */ chibicc-1.0.24/include/avxintrin.h000066400000000000000000001523411517770275000170210ustar00rootroot00000000000000/* Copyright (C) 2008-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 11.0. */ #ifndef _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _AVXINTRIN_H_INCLUDED #define _AVXINTRIN_H_INCLUDED #ifndef __AVX__ #pragma GCC push_options #pragma GCC target("avx") #define __DISABLE_AVX__ #endif /* __AVX__ */ /* Internal data types for implementing the intrinsics. */ typedef double __v4df __attribute__ ((__vector_size__ (32))); typedef float __v8sf __attribute__ ((__vector_size__ (32))); typedef long long __v4di __attribute__ ((__vector_size__ (32))); typedef unsigned long long __v4du __attribute__ ((__vector_size__ (32))); typedef int __v8si __attribute__ ((__vector_size__ (32))); typedef unsigned int __v8su __attribute__ ((__vector_size__ (32))); typedef short __v16hi __attribute__ ((__vector_size__ (32))); typedef unsigned short __v16hu __attribute__ ((__vector_size__ (32))); typedef char __v32qi __attribute__ ((__vector_size__ (32))); typedef signed char __v32qs __attribute__ ((__vector_size__ (32))); typedef unsigned char __v32qu __attribute__ ((__vector_size__ (32))); /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef float __m256 __attribute__ ((__vector_size__ (32), __may_alias__)); typedef long long __m256i __attribute__ ((__vector_size__ (32), __may_alias__)); typedef double __m256d __attribute__ ((__vector_size__ (32), __may_alias__)); /* Unaligned version of the same types. */ typedef float __m256_u __attribute__ ((__vector_size__ (32), __may_alias__, __aligned__ (1))); typedef long long __m256i_u __attribute__ ((__vector_size__ (32), __may_alias__, __aligned__ (1))); typedef double __m256d_u __attribute__ ((__vector_size__ (32), __may_alias__, __aligned__ (1))); /* Compare predicates for scalar and packed compare intrinsics. */ /* Equal (ordered, non-signaling) */ #define _CMP_EQ_OQ 0x00 /* Less-than (ordered, signaling) */ #define _CMP_LT_OS 0x01 /* Less-than-or-equal (ordered, signaling) */ #define _CMP_LE_OS 0x02 /* Unordered (non-signaling) */ #define _CMP_UNORD_Q 0x03 /* Not-equal (unordered, non-signaling) */ #define _CMP_NEQ_UQ 0x04 /* Not-less-than (unordered, signaling) */ #define _CMP_NLT_US 0x05 /* Not-less-than-or-equal (unordered, signaling) */ #define _CMP_NLE_US 0x06 /* Ordered (nonsignaling) */ #define _CMP_ORD_Q 0x07 /* Equal (unordered, non-signaling) */ #define _CMP_EQ_UQ 0x08 /* Not-greater-than-or-equal (unordered, signaling) */ #define _CMP_NGE_US 0x09 /* Not-greater-than (unordered, signaling) */ #define _CMP_NGT_US 0x0a /* False (ordered, non-signaling) */ #define _CMP_FALSE_OQ 0x0b /* Not-equal (ordered, non-signaling) */ #define _CMP_NEQ_OQ 0x0c /* Greater-than-or-equal (ordered, signaling) */ #define _CMP_GE_OS 0x0d /* Greater-than (ordered, signaling) */ #define _CMP_GT_OS 0x0e /* True (unordered, non-signaling) */ #define _CMP_TRUE_UQ 0x0f /* Equal (ordered, signaling) */ #define _CMP_EQ_OS 0x10 /* Less-than (ordered, non-signaling) */ #define _CMP_LT_OQ 0x11 /* Less-than-or-equal (ordered, non-signaling) */ #define _CMP_LE_OQ 0x12 /* Unordered (signaling) */ #define _CMP_UNORD_S 0x13 /* Not-equal (unordered, signaling) */ #define _CMP_NEQ_US 0x14 /* Not-less-than (unordered, non-signaling) */ #define _CMP_NLT_UQ 0x15 /* Not-less-than-or-equal (unordered, non-signaling) */ #define _CMP_NLE_UQ 0x16 /* Ordered (signaling) */ #define _CMP_ORD_S 0x17 /* Equal (unordered, signaling) */ #define _CMP_EQ_US 0x18 /* Not-greater-than-or-equal (unordered, non-signaling) */ #define _CMP_NGE_UQ 0x19 /* Not-greater-than (unordered, non-signaling) */ #define _CMP_NGT_UQ 0x1a /* False (ordered, signaling) */ #define _CMP_FALSE_OS 0x1b /* Not-equal (ordered, signaling) */ #define _CMP_NEQ_OS 0x1c /* Greater-than-or-equal (ordered, non-signaling) */ #define _CMP_GE_OQ 0x1d /* Greater-than (ordered, non-signaling) */ #define _CMP_GT_OQ 0x1e /* True (unordered, signaling) */ #define _CMP_TRUE_US 0x1f extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_add_pd (__m256d __A, __m256d __B) { return (__m256d) ((__v4df)__A + (__v4df)__B); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_add_ps (__m256 __A, __m256 __B) { return (__m256) ((__v8sf)__A + (__v8sf)__B); } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_addsub_pd (__m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_addsubpd256 ((__v4df)__A, (__v4df)__B); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_addsub_ps (__m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_addsubps256 ((__v8sf)__A, (__v8sf)__B); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_and_pd (__m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_andpd256 ((__v4df)__A, (__v4df)__B); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_and_ps (__m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_andps256 ((__v8sf)__A, (__v8sf)__B); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_andnot_pd (__m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_andnpd256 ((__v4df)__A, (__v4df)__B); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_andnot_ps (__m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_andnps256 ((__v8sf)__A, (__v8sf)__B); // } /* Double/single precision floating point blend instructions - select data from 2 sources using constant/variable mask. */ #ifdef __OPTIMIZE__ extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_blend_pd (__m256d __X, __m256d __Y, const int __M) { return (__m256d) __builtin_ia32_blendpd256 ((__v4df)__X, (__v4df)__Y, __M); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_blend_ps (__m256 __X, __m256 __Y, const int __M) { return (__m256) __builtin_ia32_blendps256 ((__v8sf)__X, (__v8sf)__Y, __M); } #else #define _mm256_blend_pd(X, Y, M) \ ((__m256d) __builtin_ia32_blendpd256 ((__v4df)(__m256d)(X), \ (__v4df)(__m256d)(Y), (int)(M))) #define _mm256_blend_ps(X, Y, M) \ ((__m256) __builtin_ia32_blendps256 ((__v8sf)(__m256)(X), \ (__v8sf)(__m256)(Y), (int)(M))) #endif // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_blendv_pd (__m256d __X, __m256d __Y, __m256d __M) // { // return (__m256d) __builtin_ia32_blendvpd256 ((__v4df)__X, // (__v4df)__Y, // (__v4df)__M); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_blendv_ps (__m256 __X, __m256 __Y, __m256 __M) // { // return (__m256) __builtin_ia32_blendvps256 ((__v8sf)__X, // (__v8sf)__Y, // (__v8sf)__M); // } extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_div_pd (__m256d __A, __m256d __B) { return (__m256d) ((__v4df)__A / (__v4df)__B); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_div_ps (__m256 __A, __m256 __B) { return (__m256) ((__v8sf)__A / (__v8sf)__B); } /* Dot product instructions with mask-defined summing and zeroing parts of result. */ #ifdef __OPTIMIZE__ extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_dp_ps (__m256 __X, __m256 __Y, const int __M) { return (__m256) __builtin_ia32_dpps256 ((__v8sf)__X, (__v8sf)__Y, __M); } #else #define _mm256_dp_ps(X, Y, M) \ ((__m256) __builtin_ia32_dpps256 ((__v8sf)(__m256)(X), \ (__v8sf)(__m256)(Y), (int)(M))) #endif // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_hadd_pd (__m256d __X, __m256d __Y) // { // return (__m256d) __builtin_ia32_haddpd256 ((__v4df)__X, (__v4df)__Y); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_hadd_ps (__m256 __X, __m256 __Y) // { // return (__m256) __builtin_ia32_haddps256 ((__v8sf)__X, (__v8sf)__Y); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_hsub_pd (__m256d __X, __m256d __Y) // { // return (__m256d) __builtin_ia32_hsubpd256 ((__v4df)__X, (__v4df)__Y); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_hsub_ps (__m256 __X, __m256 __Y) // { // return (__m256) __builtin_ia32_hsubps256 ((__v8sf)__X, (__v8sf)__Y); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_max_pd (__m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_maxpd256 ((__v4df)__A, (__v4df)__B); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_max_ps (__m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_maxps256 ((__v8sf)__A, (__v8sf)__B); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_min_pd (__m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_minpd256 ((__v4df)__A, (__v4df)__B); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_min_ps (__m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_minps256 ((__v8sf)__A, (__v8sf)__B); // } extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_mul_pd (__m256d __A, __m256d __B) { return (__m256d) ((__v4df)__A * (__v4df)__B); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_mul_ps (__m256 __A, __m256 __B) { return (__m256) ((__v8sf)__A * (__v8sf)__B); } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_or_pd (__m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_orpd256 ((__v4df)__A, (__v4df)__B); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_or_ps (__m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_orps256 ((__v8sf)__A, (__v8sf)__B); // } #ifdef __OPTIMIZE__ extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_shuffle_pd (__m256d __A, __m256d __B, const int __mask) { return (__m256d) __builtin_ia32_shufpd256 ((__v4df)__A, (__v4df)__B, __mask); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_shuffle_ps (__m256 __A, __m256 __B, const int __mask) { return (__m256) __builtin_ia32_shufps256 ((__v8sf)__A, (__v8sf)__B, __mask); } #else #define _mm256_shuffle_pd(A, B, N) \ ((__m256d)__builtin_ia32_shufpd256 ((__v4df)(__m256d)(A), \ (__v4df)(__m256d)(B), (int)(N))) #define _mm256_shuffle_ps(A, B, N) \ ((__m256) __builtin_ia32_shufps256 ((__v8sf)(__m256)(A), \ (__v8sf)(__m256)(B), (int)(N))) #endif extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_sub_pd (__m256d __A, __m256d __B) { return (__m256d) ((__v4df)__A - (__v4df)__B); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_sub_ps (__m256 __A, __m256 __B) { return (__m256) ((__v8sf)__A - (__v8sf)__B); } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_xor_pd (__m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_xorpd256 ((__v4df)__A, (__v4df)__B); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_xor_ps (__m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_xorps256 ((__v8sf)__A, (__v8sf)__B); // } #ifdef __OPTIMIZE__ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmp_pd (__m128d __X, __m128d __Y, const int __P) { return (__m128d) __builtin_ia32_cmppd ((__v2df)__X, (__v2df)__Y, __P); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmp_ps (__m128 __X, __m128 __Y, const int __P) { return (__m128) __builtin_ia32_cmpps ((__v4sf)__X, (__v4sf)__Y, __P); } extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_cmp_pd (__m256d __X, __m256d __Y, const int __P) { return (__m256d) __builtin_ia32_cmppd256 ((__v4df)__X, (__v4df)__Y, __P); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_cmp_ps (__m256 __X, __m256 __Y, const int __P) { return (__m256) __builtin_ia32_cmpps256 ((__v8sf)__X, (__v8sf)__Y, __P); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmp_sd (__m128d __X, __m128d __Y, const int __P) { return (__m128d) __builtin_ia32_cmpsd ((__v2df)__X, (__v2df)__Y, __P); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmp_ss (__m128 __X, __m128 __Y, const int __P) { return (__m128) __builtin_ia32_cmpss ((__v4sf)__X, (__v4sf)__Y, __P); } #else #define _mm_cmp_pd(X, Y, P) \ ((__m128d) __builtin_ia32_cmppd ((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (int)(P))) #define _mm_cmp_ps(X, Y, P) \ ((__m128) __builtin_ia32_cmpps ((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (int)(P))) #define _mm256_cmp_pd(X, Y, P) \ ((__m256d) __builtin_ia32_cmppd256 ((__v4df)(__m256d)(X), \ (__v4df)(__m256d)(Y), (int)(P))) #define _mm256_cmp_ps(X, Y, P) \ ((__m256) __builtin_ia32_cmpps256 ((__v8sf)(__m256)(X), \ (__v8sf)(__m256)(Y), (int)(P))) #define _mm_cmp_sd(X, Y, P) \ ((__m128d) __builtin_ia32_cmpsd ((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (int)(P))) #define _mm_cmp_ss(X, Y, P) \ ((__m128) __builtin_ia32_cmpss ((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (int)(P))) #endif // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi32_pd (__m128i __A) // { // return (__m256d)__builtin_ia32_cvtdq2pd256 ((__v4si) __A); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtepi32_ps (__m256i __A) // { // return (__m256)__builtin_ia32_cvtdq2ps256 ((__v8si) __A); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtpd_ps (__m256d __A) // { // return (__m128)__builtin_ia32_cvtpd2ps256 ((__v4df) __A); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtps_epi32 (__m256 __A) // { // return (__m256i)__builtin_ia32_cvtps2dq256 ((__v8sf) __A); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtps_pd (__m128 __A) // { // return (__m256d)__builtin_ia32_cvtps2pd256 ((__v4sf) __A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvttpd_epi32 (__m256d __A) // { // return (__m128i)__builtin_ia32_cvttpd2dq256 ((__v4df) __A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtpd_epi32 (__m256d __A) // { // return (__m128i)__builtin_ia32_cvtpd2dq256 ((__v4df) __A); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvttps_epi32 (__m256 __A) // { // return (__m256i)__builtin_ia32_cvttps2dq256 ((__v8sf) __A); // } extern __inline double __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_cvtsd_f64 (__m256d __A) { return __A[0]; } extern __inline float __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_cvtss_f32 (__m256 __A) { return __A[0]; } #ifdef __OPTIMIZE__ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_extractf128_pd (__m256d __X, const int __N) { return (__m128d) __builtin_ia32_vextractf128_pd256 ((__v4df)__X, __N); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_extractf128_ps (__m256 __X, const int __N) { return (__m128) __builtin_ia32_vextractf128_ps256 ((__v8sf)__X, __N); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_extractf128_si256 (__m256i __X, const int __N) { return (__m128i) __builtin_ia32_vextractf128_si256 ((__v8si)__X, __N); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_extract_epi32 (__m256i __X, int const __N) { __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 2); return _mm_extract_epi32 (__Y, __N % 4); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_extract_epi16 (__m256i __X, int const __N) { __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 3); return _mm_extract_epi16 (__Y, __N % 8); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_extract_epi8 (__m256i __X, int const __N) { __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 4); return _mm_extract_epi8 (__Y, __N % 16); } #ifdef __x86_64__ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_extract_epi64 (__m256i __X, const int __N) { __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 1); return _mm_extract_epi64 (__Y, __N % 2); } #endif #else #define _mm256_extractf128_pd(X, N) \ ((__m128d) __builtin_ia32_vextractf128_pd256 ((__v4df)(__m256d)(X), \ (int)(N))) #define _mm256_extractf128_ps(X, N) \ ((__m128) __builtin_ia32_vextractf128_ps256 ((__v8sf)(__m256)(X), \ (int)(N))) #define _mm256_extractf128_si256(X, N) \ ((__m128i) __builtin_ia32_vextractf128_si256 ((__v8si)(__m256i)(X), \ (int)(N))) #define _mm256_extract_epi32(X, N) \ (__extension__ \ ({ \ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 2); \ _mm_extract_epi32 (__Y, (N) % 4); \ })) #define _mm256_extract_epi16(X, N) \ (__extension__ \ ({ \ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 3); \ _mm_extract_epi16 (__Y, (N) % 8); \ })) #define _mm256_extract_epi8(X, N) \ (__extension__ \ ({ \ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 4); \ _mm_extract_epi8 (__Y, (N) % 16); \ })) #ifdef __x86_64__ #define _mm256_extract_epi64(X, N) \ (__extension__ \ ({ \ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 1); \ _mm_extract_epi64 (__Y, (N) % 2); \ })) #endif #endif extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_zeroall (void) { __builtin_ia32_vzeroall (); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_zeroupper (void) { __builtin_ia32_vzeroupper (); } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permutevar_pd (__m128d __A, __m128i __C) // { // return (__m128d) __builtin_ia32_vpermilvarpd ((__v2df)__A, // (__v2di)__C); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutevar_pd (__m256d __A, __m256i __C) // { // return (__m256d) __builtin_ia32_vpermilvarpd256 ((__v4df)__A, // (__v4di)__C); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permutevar_ps (__m128 __A, __m128i __C) // { // return (__m128) __builtin_ia32_vpermilvarps ((__v4sf)__A, // (__v4si)__C); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permutevar_ps (__m256 __A, __m256i __C) // { // return (__m256) __builtin_ia32_vpermilvarps256 ((__v8sf)__A, // (__v8si)__C); // } #ifdef __OPTIMIZE__ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_permute_pd (__m128d __X, const int __C) { return (__m128d) __builtin_ia32_vpermilpd ((__v2df)__X, __C); } extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_permute_pd (__m256d __X, const int __C) { return (__m256d) __builtin_ia32_vpermilpd256 ((__v4df)__X, __C); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_permute_ps (__m128 __X, const int __C) { return (__m128) __builtin_ia32_vpermilps ((__v4sf)__X, __C); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_permute_ps (__m256 __X, const int __C) { return (__m256) __builtin_ia32_vpermilps256 ((__v8sf)__X, __C); } #else #define _mm_permute_pd(X, C) \ ((__m128d) __builtin_ia32_vpermilpd ((__v2df)(__m128d)(X), (int)(C))) #define _mm256_permute_pd(X, C) \ ((__m256d) __builtin_ia32_vpermilpd256 ((__v4df)(__m256d)(X), (int)(C))) #define _mm_permute_ps(X, C) \ ((__m128) __builtin_ia32_vpermilps ((__v4sf)(__m128)(X), (int)(C))) #define _mm256_permute_ps(X, C) \ ((__m256) __builtin_ia32_vpermilps256 ((__v8sf)(__m256)(X), (int)(C))) #endif #ifdef __OPTIMIZE__ extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_permute2f128_pd (__m256d __X, __m256d __Y, const int __C) { return (__m256d) __builtin_ia32_vperm2f128_pd256 ((__v4df)__X, (__v4df)__Y, __C); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_permute2f128_ps (__m256 __X, __m256 __Y, const int __C) { return (__m256) __builtin_ia32_vperm2f128_ps256 ((__v8sf)__X, (__v8sf)__Y, __C); } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_permute2f128_si256 (__m256i __X, __m256i __Y, const int __C) { return (__m256i) __builtin_ia32_vperm2f128_si256 ((__v8si)__X, (__v8si)__Y, __C); } #else #define _mm256_permute2f128_pd(X, Y, C) \ ((__m256d) __builtin_ia32_vperm2f128_pd256 ((__v4df)(__m256d)(X), \ (__v4df)(__m256d)(Y), \ (int)(C))) #define _mm256_permute2f128_ps(X, Y, C) \ ((__m256) __builtin_ia32_vperm2f128_ps256 ((__v8sf)(__m256)(X), \ (__v8sf)(__m256)(Y), \ (int)(C))) #define _mm256_permute2f128_si256(X, Y, C) \ ((__m256i) __builtin_ia32_vperm2f128_si256 ((__v8si)(__m256i)(X), \ (__v8si)(__m256i)(Y), \ (int)(C))) #endif // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_broadcast_ss (float const *__X) // { // return (__m128) __builtin_ia32_vbroadcastss (__X); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcast_sd (double const *__X) // { // return (__m256d) __builtin_ia32_vbroadcastsd256 (__X); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcast_ss (float const *__X) // { // return (__m256) __builtin_ia32_vbroadcastss256 (__X); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcast_pd (__m128d const *__X) // { // return (__m256d) __builtin_ia32_vbroadcastf128_pd256 (__X); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_broadcast_ps (__m128 const *__X) // { // return (__m256) __builtin_ia32_vbroadcastf128_ps256 (__X); // } #ifdef __OPTIMIZE__ extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_insertf128_pd (__m256d __X, __m128d __Y, const int __O) { return (__m256d) __builtin_ia32_vinsertf128_pd256 ((__v4df)__X, (__v2df)__Y, __O); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_insertf128_ps (__m256 __X, __m128 __Y, const int __O) { return (__m256) __builtin_ia32_vinsertf128_ps256 ((__v8sf)__X, (__v4sf)__Y, __O); } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_insertf128_si256 (__m256i __X, __m128i __Y, const int __O) { return (__m256i) __builtin_ia32_vinsertf128_si256 ((__v8si)__X, (__v4si)__Y, __O); } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_insert_epi32 (__m256i __X, int __D, int const __N) { __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 2); __Y = _mm_insert_epi32 (__Y, __D, __N % 4); return _mm256_insertf128_si256 (__X, __Y, __N >> 2); } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_insert_epi16 (__m256i __X, int __D, int const __N) { __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 3); __Y = _mm_insert_epi16 (__Y, __D, __N % 8); return _mm256_insertf128_si256 (__X, __Y, __N >> 3); } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_insert_epi8 (__m256i __X, int __D, int const __N) { __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 4); __Y = _mm_insert_epi8 (__Y, __D, __N % 16); return _mm256_insertf128_si256 (__X, __Y, __N >> 4); } #ifdef __x86_64__ extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_insert_epi64 (__m256i __X, long long __D, int const __N) { __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 1); __Y = _mm_insert_epi64 (__Y, __D, __N % 2); return _mm256_insertf128_si256 (__X, __Y, __N >> 1); } #endif #else #define _mm256_insertf128_pd(X, Y, O) \ ((__m256d) __builtin_ia32_vinsertf128_pd256 ((__v4df)(__m256d)(X), \ (__v2df)(__m128d)(Y), \ (int)(O))) #define _mm256_insertf128_ps(X, Y, O) \ ((__m256) __builtin_ia32_vinsertf128_ps256 ((__v8sf)(__m256)(X), \ (__v4sf)(__m128)(Y), \ (int)(O))) #define _mm256_insertf128_si256(X, Y, O) \ ((__m256i) __builtin_ia32_vinsertf128_si256 ((__v8si)(__m256i)(X), \ (__v4si)(__m128i)(Y), \ (int)(O))) #define _mm256_insert_epi32(X, D, N) \ (__extension__ \ ({ \ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 2); \ __Y = _mm_insert_epi32 (__Y, (D), (N) % 4); \ _mm256_insertf128_si256 ((X), __Y, (N) >> 2); \ })) #define _mm256_insert_epi16(X, D, N) \ (__extension__ \ ({ \ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 3); \ __Y = _mm_insert_epi16 (__Y, (D), (N) % 8); \ _mm256_insertf128_si256 ((X), __Y, (N) >> 3); \ })) #define _mm256_insert_epi8(X, D, N) \ (__extension__ \ ({ \ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 4); \ __Y = _mm_insert_epi8 (__Y, (D), (N) % 16); \ _mm256_insertf128_si256 ((X), __Y, (N) >> 4); \ })) #ifdef __x86_64__ #define _mm256_insert_epi64(X, D, N) \ (__extension__ \ ({ \ __m128i __Y = _mm256_extractf128_si256 ((X), (N) >> 1); \ __Y = _mm_insert_epi64 (__Y, (D), (N) % 2); \ _mm256_insertf128_si256 ((X), __Y, (N) >> 1); \ })) #endif #endif extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_load_pd (double const *__P) { return *(__m256d *)__P; } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_store_pd (double *__P, __m256d __A) { *(__m256d *)__P = __A; } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_load_ps (float const *__P) { return *(__m256 *)__P; } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_store_ps (float *__P, __m256 __A) { *(__m256 *)__P = __A; } extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_loadu_pd (double const *__P) { return *(__m256d_u *)__P; } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_storeu_pd (double *__P, __m256d __A) { *(__m256d_u *)__P = __A; } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_loadu_ps (float const *__P) { return *(__m256_u *)__P; } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_storeu_ps (float *__P, __m256 __A) { *(__m256_u *)__P = __A; } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_load_si256 (__m256i const *__P) { return *__P; } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_store_si256 (__m256i *__P, __m256i __A) { *__P = __A; } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_loadu_si256 (__m256i_u const *__P) { return *__P; } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_storeu_si256 (__m256i_u *__P, __m256i __A) { *__P = __A; } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskload_pd (double const *__P, __m128i __M) // { // return (__m128d) __builtin_ia32_maskloadpd ((const __v2df *)__P, // (__v2di)__M); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskstore_pd (double *__P, __m128i __M, __m128d __A) // { // __builtin_ia32_maskstorepd ((__v2df *)__P, (__v2di)__M, (__v2df)__A); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskload_pd (double const *__P, __m256i __M) // { // return (__m256d) __builtin_ia32_maskloadpd256 ((const __v4df *)__P, // (__v4di)__M); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskstore_pd (double *__P, __m256i __M, __m256d __A) // { // __builtin_ia32_maskstorepd256 ((__v4df *)__P, (__v4di)__M, (__v4df)__A); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskload_ps (float const *__P, __m128i __M) // { // return (__m128) __builtin_ia32_maskloadps ((const __v4sf *)__P, // (__v4si)__M); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskstore_ps (float *__P, __m128i __M, __m128 __A) // { // __builtin_ia32_maskstoreps ((__v4sf *)__P, (__v4si)__M, (__v4sf)__A); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskload_ps (float const *__P, __m256i __M) // { // return (__m256) __builtin_ia32_maskloadps256 ((const __v8sf *)__P, // (__v8si)__M); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskstore_ps (float *__P, __m256i __M, __m256 __A) // { // __builtin_ia32_maskstoreps256 ((__v8sf *)__P, (__v8si)__M, (__v8sf)__A); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movehdup_ps (__m256 __X) // { // return (__m256) __builtin_ia32_movshdup256 ((__v8sf)__X); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_moveldup_ps (__m256 __X) // { // return (__m256) __builtin_ia32_movsldup256 ((__v8sf)__X); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movedup_pd (__m256d __X) // { // return (__m256d) __builtin_ia32_movddup256 ((__v4df)__X); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_lddqu_si256 (__m256i const *__P) // { // return (__m256i) __builtin_ia32_lddqu256 ((char const *)__P); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_stream_si256 (__m256i *__A, __m256i __B) // { // __builtin_ia32_movntdq256 ((__v4di *)__A, (__v4di)__B); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_stream_pd (double *__A, __m256d __B) // { // __builtin_ia32_movntpd256 (__A, (__v4df)__B); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_stream_ps (float *__P, __m256 __A) // { // __builtin_ia32_movntps256 (__P, (__v8sf)__A); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rcp_ps (__m256 __A) // { // return (__m256) __builtin_ia32_rcpps256 ((__v8sf)__A); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_rsqrt_ps (__m256 __A) // { // return (__m256) __builtin_ia32_rsqrtps256 ((__v8sf)__A); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sqrt_pd (__m256d __A) // { // return (__m256d) __builtin_ia32_sqrtpd256 ((__v4df)__A); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_sqrt_ps (__m256 __A) // { // return (__m256) __builtin_ia32_sqrtps256 ((__v8sf)__A); // } // #ifdef __OPTIMIZE__ // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_round_pd (__m256d __V, const int __M) // { // return (__m256d) __builtin_ia32_roundpd256 ((__v4df)__V, __M); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_round_ps (__m256 __V, const int __M) // { // return (__m256) __builtin_ia32_roundps256 ((__v8sf)__V, __M); // } // #else // #define _mm256_round_pd(V, M) \ // ((__m256d) __builtin_ia32_roundpd256 ((__v4df)(__m256d)(V), (int)(M))) // #define _mm256_round_ps(V, M) \ // ((__m256) __builtin_ia32_roundps256 ((__v8sf)(__m256)(V), (int)(M))) // #endif // #define _mm256_ceil_pd(V) _mm256_round_pd ((V), _MM_FROUND_CEIL) // #define _mm256_floor_pd(V) _mm256_round_pd ((V), _MM_FROUND_FLOOR) // #define _mm256_ceil_ps(V) _mm256_round_ps ((V), _MM_FROUND_CEIL) // #define _mm256_floor_ps(V) _mm256_round_ps ((V), _MM_FROUND_FLOOR) // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpackhi_pd (__m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_unpckhpd256 ((__v4df)__A, (__v4df)__B); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpacklo_pd (__m256d __A, __m256d __B) // { // return (__m256d) __builtin_ia32_unpcklpd256 ((__v4df)__A, (__v4df)__B); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpackhi_ps (__m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_unpckhps256 ((__v8sf)__A, (__v8sf)__B); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_unpacklo_ps (__m256 __A, __m256 __B) // { // return (__m256) __builtin_ia32_unpcklps256 ((__v8sf)__A, (__v8sf)__B); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_testz_pd (__m128d __M, __m128d __V) // { // return __builtin_ia32_vtestzpd ((__v2df)__M, (__v2df)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_testc_pd (__m128d __M, __m128d __V) // { // return __builtin_ia32_vtestcpd ((__v2df)__M, (__v2df)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_testnzc_pd (__m128d __M, __m128d __V) // { // return __builtin_ia32_vtestnzcpd ((__v2df)__M, (__v2df)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_testz_ps (__m128 __M, __m128 __V) // { // return __builtin_ia32_vtestzps ((__v4sf)__M, (__v4sf)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_testc_ps (__m128 __M, __m128 __V) // { // return __builtin_ia32_vtestcps ((__v4sf)__M, (__v4sf)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_testnzc_ps (__m128 __M, __m128 __V) // { // return __builtin_ia32_vtestnzcps ((__v4sf)__M, (__v4sf)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testz_pd (__m256d __M, __m256d __V) // { // return __builtin_ia32_vtestzpd256 ((__v4df)__M, (__v4df)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testc_pd (__m256d __M, __m256d __V) // { // return __builtin_ia32_vtestcpd256 ((__v4df)__M, (__v4df)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testnzc_pd (__m256d __M, __m256d __V) // { // return __builtin_ia32_vtestnzcpd256 ((__v4df)__M, (__v4df)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testz_ps (__m256 __M, __m256 __V) // { // return __builtin_ia32_vtestzps256 ((__v8sf)__M, (__v8sf)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testc_ps (__m256 __M, __m256 __V) // { // return __builtin_ia32_vtestcps256 ((__v8sf)__M, (__v8sf)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testnzc_ps (__m256 __M, __m256 __V) // { // return __builtin_ia32_vtestnzcps256 ((__v8sf)__M, (__v8sf)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testz_si256 (__m256i __M, __m256i __V) // { // return __builtin_ia32_ptestz256 ((__v4di)__M, (__v4di)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testc_si256 (__m256i __M, __m256i __V) // { // return __builtin_ia32_ptestc256 ((__v4di)__M, (__v4di)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_testnzc_si256 (__m256i __M, __m256i __V) // { // return __builtin_ia32_ptestnzc256 ((__v4di)__M, (__v4di)__V); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movemask_pd (__m256d __A) // { // return __builtin_ia32_movmskpd256 ((__v4df)__A); // } // extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_movemask_ps (__m256 __A) // { // return __builtin_ia32_movmskps256 ((__v8sf)__A); // } extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_undefined_pd (void) { __m256d __Y = __Y; return __Y; } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_undefined_ps (void) { __m256 __Y = __Y; return __Y; } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_undefined_si256 (void) { __m256i __Y = __Y; return __Y; } extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_setzero_pd (void) { return __extension__ (__m256d){ 0.0, 0.0, 0.0, 0.0 }; } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_setzero_ps (void) { return __extension__ (__m256){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_setzero_si256 (void) { return __extension__ (__m256i)(__v4di){ 0, 0, 0, 0 }; } /* Create the vector [A B C D]. */ extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set_pd (double __A, double __B, double __C, double __D) { return __extension__ (__m256d){ __D, __C, __B, __A }; } /* Create the vector [A B C D E F G H]. */ extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set_ps (float __A, float __B, float __C, float __D, float __E, float __F, float __G, float __H) { return __extension__ (__m256){ __H, __G, __F, __E, __D, __C, __B, __A }; } /* Create the vector [A B C D E F G H]. */ extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set_epi32 (int __A, int __B, int __C, int __D, int __E, int __F, int __G, int __H) { return __extension__ (__m256i)(__v8si){ __H, __G, __F, __E, __D, __C, __B, __A }; } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set_epi16 (short __q15, short __q14, short __q13, short __q12, short __q11, short __q10, short __q09, short __q08, short __q07, short __q06, short __q05, short __q04, short __q03, short __q02, short __q01, short __q00) { return __extension__ (__m256i)(__v16hi){ __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07, __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15 }; } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set_epi8 (char __q31, char __q30, char __q29, char __q28, char __q27, char __q26, char __q25, char __q24, char __q23, char __q22, char __q21, char __q20, char __q19, char __q18, char __q17, char __q16, char __q15, char __q14, char __q13, char __q12, char __q11, char __q10, char __q09, char __q08, char __q07, char __q06, char __q05, char __q04, char __q03, char __q02, char __q01, char __q00) { return __extension__ (__m256i)(__v32qi){ __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07, __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15, __q16, __q17, __q18, __q19, __q20, __q21, __q22, __q23, __q24, __q25, __q26, __q27, __q28, __q29, __q30, __q31 }; } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set_epi64x (long long __A, long long __B, long long __C, long long __D) { return __extension__ (__m256i)(__v4di){ __D, __C, __B, __A }; } /* Create a vector with all elements equal to A. */ extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set1_pd (double __A) { return __extension__ (__m256d){ __A, __A, __A, __A }; } /* Create a vector with all elements equal to A. */ extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set1_ps (float __A) { return __extension__ (__m256){ __A, __A, __A, __A, __A, __A, __A, __A }; } /* Create a vector with all elements equal to A. */ extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set1_epi32 (int __A) { return __extension__ (__m256i)(__v8si){ __A, __A, __A, __A, __A, __A, __A, __A }; } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_set1_epi16 (short __A) // { // return _mm256_set_epi16 (__A, __A, __A, __A, __A, __A, __A, __A, // __A, __A, __A, __A, __A, __A, __A, __A); // } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set1_epi8 (char __A) { return _mm256_set_epi8 (__A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A); } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set1_epi64x (long long __A) { return __extension__ (__m256i)(__v4di){ __A, __A, __A, __A }; } // /* Create vectors of elements in the reversed order from the // _mm256_set_XXX functions. */ // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_setr_pd (double __A, double __B, double __C, double __D) // { // return _mm256_set_pd (__D, __C, __B, __A); // } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_setr_ps (float __A, float __B, float __C, float __D, float __E, float __F, float __G, float __H) { return _mm256_set_ps (__H, __G, __F, __E, __D, __C, __B, __A); } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_setr_epi32 (int __A, int __B, int __C, int __D, int __E, int __F, int __G, int __H) { return _mm256_set_epi32 (__H, __G, __F, __E, __D, __C, __B, __A); } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_setr_epi16 (short __q15, short __q14, short __q13, short __q12, // short __q11, short __q10, short __q09, short __q08, // short __q07, short __q06, short __q05, short __q04, // short __q03, short __q02, short __q01, short __q00) // { // return _mm256_set_epi16 (__q00, __q01, __q02, __q03, // __q04, __q05, __q06, __q07, // __q08, __q09, __q10, __q11, // __q12, __q13, __q14, __q15); // } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_setr_epi8 (char __q31, char __q30, char __q29, char __q28, char __q27, char __q26, char __q25, char __q24, char __q23, char __q22, char __q21, char __q20, char __q19, char __q18, char __q17, char __q16, char __q15, char __q14, char __q13, char __q12, char __q11, char __q10, char __q09, char __q08, char __q07, char __q06, char __q05, char __q04, char __q03, char __q02, char __q01, char __q00) { return _mm256_set_epi8 (__q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07, __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15, __q16, __q17, __q18, __q19, __q20, __q21, __q22, __q23, __q24, __q25, __q26, __q27, __q28, __q29, __q30, __q31); } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_setr_epi64x (long long __A, long long __B, long long __C, long long __D) { return _mm256_set_epi64x (__D, __C, __B, __A); } /* Casts between various SP, DP, INT vector types. Note that these do no conversion of values, they just change the type. */ extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_castpd_ps (__m256d __A) { return (__m256) __A; } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_castpd_si256 (__m256d __A) { return (__m256i) __A; } extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_castps_pd (__m256 __A) { return (__m256d) __A; } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_castps_si256(__m256 __A) { return (__m256i) __A; } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_castsi256_ps (__m256i __A) { return (__m256) __A; } extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_castsi256_pd (__m256i __A) { return (__m256d) __A; } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_castpd256_pd128 (__m256d __A) { return (__m128d) __builtin_ia32_pd_pd256 ((__v4df)__A); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_castps256_ps128 (__m256 __A) { return (__m128) __builtin_ia32_ps_ps256 ((__v8sf)__A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_castsi256_si128 (__m256i __A) { return (__m128i) __builtin_ia32_si_si256 ((__v8si)__A); } // /* When cast is done from a 128 to 256-bit type, the low 128 bits of // the 256-bit result contain source parameter value and the upper 128 // bits of the result are undefined. Those intrinsics shouldn't // generate any extra moves. */ // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_castpd128_pd256 (__m128d __A) // { // return (__m256d) __builtin_ia32_pd256_pd ((__v2df)__A); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_castps128_ps256 (__m128 __A) // { // return (__m256) __builtin_ia32_ps256_ps ((__v4sf)__A); // } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_castsi128_si256 (__m128i __A) { return (__m256i) __builtin_ia32_si256_si ((__v4si)__A); } // /* Similarly, but with zero extension instead of undefined values. */ // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_zextpd128_pd256 (__m128d __A) // { // return _mm256_insertf128_pd (_mm256_setzero_pd (), __A, 0); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_zextps128_ps256 (__m128 __A) // { // return _mm256_insertf128_ps (_mm256_setzero_ps (), __A, 0); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_zextsi128_si256 (__m128i __A) // { // return _mm256_insertf128_si256 (_mm256_setzero_si256 (), __A, 0); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_set_m128 ( __m128 __H, __m128 __L) // { // return _mm256_insertf128_ps (_mm256_castps128_ps256 (__L), __H, 1); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_set_m128d (__m128d __H, __m128d __L) // { // return _mm256_insertf128_pd (_mm256_castpd128_pd256 (__L), __H, 1); // } extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_set_m128i (__m128i __H, __m128i __L) { return _mm256_insertf128_si256 (_mm256_castsi128_si256 (__L), __H, 1); } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_setr_m128 (__m128 __L, __m128 __H) // { // return _mm256_set_m128 (__H, __L); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_setr_m128d (__m128d __L, __m128d __H) // { // return _mm256_set_m128d (__H, __L); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_setr_m128i (__m128i __L, __m128i __H) // { // return _mm256_set_m128i (__H, __L); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_loadu2_m128 (float const *__PH, float const *__PL) // { // return _mm256_insertf128_ps (_mm256_castps128_ps256 (_mm_loadu_ps (__PL)), // _mm_loadu_ps (__PH), 1); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_storeu2_m128 (float *__PH, float *__PL, __m256 __A) // { // _mm_storeu_ps (__PL, _mm256_castps256_ps128 (__A)); // _mm_storeu_ps (__PH, _mm256_extractf128_ps (__A, 1)); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_loadu2_m128d (double const *__PH, double const *__PL) // { // return _mm256_insertf128_pd (_mm256_castpd128_pd256 (_mm_loadu_pd (__PL)), // _mm_loadu_pd (__PH), 1); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_storeu2_m128d (double *__PH, double *__PL, __m256d __A) // { // _mm_storeu_pd (__PL, _mm256_castpd256_pd128 (__A)); // _mm_storeu_pd (__PH, _mm256_extractf128_pd (__A, 1)); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_loadu2_m128i (__m128i_u const *__PH, __m128i_u const *__PL) // { // return _mm256_insertf128_si256 (_mm256_castsi128_si256 (_mm_loadu_si128 (__PL)), // _mm_loadu_si128 (__PH), 1); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_storeu2_m128i (__m128i_u *__PH, __m128i_u *__PL, __m256i __A) // { // _mm_storeu_si128 (__PL, _mm256_castsi256_si128 (__A)); // _mm_storeu_si128 (__PH, _mm256_extractf128_si256 (__A, 1)); // } #ifdef __DISABLE_AVX__ #undef __DISABLE_AVX__ #pragma GCC pop_options #endif /* __DISABLE_AVX__ */ #endif /* _AVXINTRIN_H_INCLUDED */ chibicc-1.0.24/include/bmi2intrin.h000066400000000000000000000067441517770275000170610ustar00rootroot00000000000000/* Copyright (C) 2011-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _BMI2INTRIN_H_INCLUDED #define _BMI2INTRIN_H_INCLUDED #ifndef __BMI2__ #pragma GCC push_options #pragma GCC target("bmi2") #define __DISABLE_BMI2__ #endif /* __BMI2__ */ // extern __inline unsigned int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _bzhi_u32 (unsigned int __X, unsigned int __Y) // { // return __builtin_ia32_bzhi_si (__X, __Y); // } // extern __inline unsigned int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _pdep_u32 (unsigned int __X, unsigned int __Y) // { // return __builtin_ia32_pdep_si (__X, __Y); // } // extern __inline unsigned int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _pext_u32 (unsigned int __X, unsigned int __Y) // { // return __builtin_ia32_pext_si (__X, __Y); // } // #ifdef __x86_64__ // extern __inline unsigned long long // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _bzhi_u64 (unsigned long long __X, unsigned long long __Y) // { // return __builtin_ia32_bzhi_di (__X, __Y); // } // extern __inline unsigned long long // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _pdep_u64 (unsigned long long __X, unsigned long long __Y) // { // return __builtin_ia32_pdep_di (__X, __Y); // } // extern __inline unsigned long long // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _pext_u64 (unsigned long long __X, unsigned long long __Y) // { // return __builtin_ia32_pext_di (__X, __Y); // } // extern __inline unsigned long long // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mulx_u64 (unsigned long long __X, unsigned long long __Y, // unsigned long long *__P) // { // unsigned __int128 __res = (unsigned __int128) __X * __Y; // *__P = (unsigned long long) (__res >> 64); // return (unsigned long long) __res; // } // #else /* !__x86_64__ */ // extern __inline unsigned int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P) // { // unsigned long long __res = (unsigned long long) __X * __Y; // *__P = (unsigned int) (__res >> 32); // return (unsigned int) __res; // } // #endif /* !__x86_64__ */ #ifdef __DISABLE_BMI2__ #undef __DISABLE_BMI2__ #pragma GCC pop_options #endif /* __DISABLE_BMI2__ */ #endif /* _BMI2INTRIN_H_INCLUDED */ chibicc-1.0.24/include/bmiintrin.h000066400000000000000000000135331517770275000167710ustar00rootroot00000000000000/* Copyright (C) 2010-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _BMIINTRIN_H_INCLUDED #define _BMIINTRIN_H_INCLUDED #ifndef __BMI__ #pragma GCC push_options #pragma GCC target("bmi") #define __DISABLE_BMI__ #endif /* __BMI__ */ // extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __tzcnt_u16 (unsigned short __X) // { // return __builtin_ia32_tzcnt_u16 (__X); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __andn_u32 (unsigned int __X, unsigned int __Y) // { // return ~__X & __Y; // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __bextr_u32 (unsigned int __X, unsigned int __Y) // { // return __builtin_ia32_bextr_u32 (__X, __Y); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _bextr_u32 (unsigned int __X, unsigned int __Y, unsigned __Z) // { // return __builtin_ia32_bextr_u32 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8))); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __blsi_u32 (unsigned int __X) // { // return __X & -__X; // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _blsi_u32 (unsigned int __X) // { // return __blsi_u32 (__X); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __blsmsk_u32 (unsigned int __X) // { // return __X ^ (__X - 1); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _blsmsk_u32 (unsigned int __X) // { // return __blsmsk_u32 (__X); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __blsr_u32 (unsigned int __X) // { // return __X & (__X - 1); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _blsr_u32 (unsigned int __X) // { // return __blsr_u32 (__X); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __tzcnt_u32 (unsigned int __X) // { // return __builtin_ia32_tzcnt_u32 (__X); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _tzcnt_u32 (unsigned int __X) // { // return __builtin_ia32_tzcnt_u32 (__X); // } // #ifdef __x86_64__ // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __andn_u64 (unsigned long long __X, unsigned long long __Y) // { // return ~__X & __Y; // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __bextr_u64 (unsigned long long __X, unsigned long long __Y) // { // return __builtin_ia32_bextr_u64 (__X, __Y); // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _bextr_u64 (unsigned long long __X, unsigned int __Y, unsigned int __Z) // { // return __builtin_ia32_bextr_u64 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8))); // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __blsi_u64 (unsigned long long __X) // { // return __X & -__X; // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _blsi_u64 (unsigned long long __X) // { // return __blsi_u64 (__X); // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __blsmsk_u64 (unsigned long long __X) // { // return __X ^ (__X - 1); // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _blsmsk_u64 (unsigned long long __X) // { // return __blsmsk_u64 (__X); // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __blsr_u64 (unsigned long long __X) // { // return __X & (__X - 1); // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _blsr_u64 (unsigned long long __X) // { // return __blsr_u64 (__X); // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __tzcnt_u64 (unsigned long long __X) // { // return __builtin_ia32_tzcnt_u64 (__X); // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _tzcnt_u64 (unsigned long long __X) // { // return __builtin_ia32_tzcnt_u64 (__X); // } // #endif /* __x86_64__ */ #ifdef __DISABLE_BMI__ #undef __DISABLE_BMI__ #pragma GCC pop_options #endif /* __DISABLE_BMI__ */ #endif /* _BMIINTRIN_H_INCLUDED */ chibicc-1.0.24/include/bmmintrin.h000066400000000000000000000022021517770275000167640ustar00rootroot00000000000000/* Copyright (C) 2007-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _BMMINTRIN_H_INCLUDED #define _BMMINTRIN_H_INCLUDED # error "SSE5 instruction set removed from compiler" #endif /* _BMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/cetintrin.h000066400000000000000000000064051517770275000167750ustar00rootroot00000000000000/* Copyright (C) 2015-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _CETINTRIN_H_INCLUDED #define _CETINTRIN_H_INCLUDED #ifndef __SHSTK__ #pragma GCC push_options #pragma GCC target ("shstk") #define __DISABLE_SHSTK__ #endif /* __SHSTK__ */ #ifdef __x86_64__ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _get_ssp (void) { return __builtin_ia32_rdsspq (); } #else extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _get_ssp (void) { return __builtin_ia32_rdsspd (); } #endif extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _inc_ssp (unsigned int __B) { #ifdef __x86_64__ __builtin_ia32_incsspq ((unsigned long long) __B); #else __builtin_ia32_incsspd (__B); #endif } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _saveprevssp (void) { __builtin_ia32_saveprevssp (); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _rstorssp (void *__B) { __builtin_ia32_rstorssp (__B); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _wrssd (unsigned int __B, void *__C) { __builtin_ia32_wrssd (__B, __C); } #ifdef __x86_64__ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _wrssq (unsigned long long __B, void *__C) { __builtin_ia32_wrssq (__B, __C); } #endif extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _wrussd (unsigned int __B, void *__C) { __builtin_ia32_wrussd (__B, __C); } #ifdef __x86_64__ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _wrussq (unsigned long long __B, void *__C) { __builtin_ia32_wrussq (__B, __C); } #endif extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _setssbsy (void) { __builtin_ia32_setssbsy (); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _clrssbsy (void *__B) { __builtin_ia32_clrssbsy (__B); } #ifdef __DISABLE_SHSTK__ #undef __DISABLE_SHSTK__ #pragma GCC pop_options #endif /* __DISABLE_SHSTK__ */ #endif /* _CETINTRIN_H_INCLUDED. */ chibicc-1.0.24/include/cldemoteintrin.h000066400000000000000000000031401517770275000200070ustar00rootroot00000000000000/* Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _CLDEMOTE_H_INCLUDED #define _CLDEMOTE_H_INCLUDED #ifndef __CLDEMOTE__ #pragma GCC push_options #pragma GCC target("cldemote") #define __DISABLE_CLDEMOTE__ #endif /* __CLDEMOTE__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _cldemote (void *__A) // { // __builtin_ia32_cldemote (__A); // } #ifdef __DISABLE_CLDEMOTE__ #undef __DISABLE_CLDEMOTE__ #pragma GCC pop_options #endif /* __DISABLE_CLDEMOTE__ */ #endif /* _CLDEMOTE_H_INCLUDED */ chibicc-1.0.24/include/clflushoptintrin.h000066400000000000000000000032211517770275000203760ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _CLFLUSHOPTINTRIN_H_INCLUDED #define _CLFLUSHOPTINTRIN_H_INCLUDED #ifndef __CLFLUSHOPT__ #pragma GCC push_options #pragma GCC target("clflushopt") #define __DISABLE_CLFLUSHOPT__ #endif /* __CLFLUSHOPT__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_clflushopt (void *__A) // { // __builtin_ia32_clflushopt (__A); // } #ifdef __DISABLE_CLFLUSHOPT__ #undef __DISABLE_CLFLUSHOPT__ #pragma GCC pop_options #endif /* __DISABLE_CLFLUSHOPT__ */ #endif /* _CLFLUSHOPTINTRIN_H_INCLUDED */ chibicc-1.0.24/include/clwbintrin.h000066400000000000000000000031031517770275000171410ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _CLWBINTRIN_H_INCLUDED #define _CLWBINTRIN_H_INCLUDED #ifndef __CLWB__ #pragma GCC push_options #pragma GCC target("clwb") #define __DISABLE_CLWB__ #endif /* __CLWB__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_clwb (void *__A) // { // __builtin_ia32_clwb (__A); // } #ifdef __DISABLE_CLWB__ #undef __DISABLE_CLWB__ #pragma GCC pop_options #endif /* __DISABLE_CLWB__ */ #endif /* _CLWBINTRIN_H_INCLUDED */ chibicc-1.0.24/include/clzerointrin.h000066400000000000000000000027421517770275000175200ustar00rootroot00000000000000/* Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _CLZEROINTRIN_H_INCLUDED #define _CLZEROINTRIN_H_INCLUDED #ifndef __CLZERO__ #pragma GCC push_options #pragma GCC target("clzero") #define __DISABLE_CLZERO__ #endif /* __CLZERO__ */ // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_clzero (void * __I) // { // __builtin_ia32_clzero (__I); // } #ifdef __DISABLE_CLZERO__ #undef __DISABLE_CLZERO__ #pragma GCC pop_options #endif /* __DISABLE_CLZERO__ */ #endif /* _CLZEROINTRIN_H_INCLUDED */ chibicc-1.0.24/include/cpuid.h000066400000000000000000000261031517770275000160770ustar00rootroot00000000000000/* * Copyright (C) 2007-2025 Free Software Foundation, Inc. * * This file is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3, or (at your option) any * later version. * * This file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Under Section 7 of GPL version 3, you are granted additional * permissions described in the GCC Runtime Library Exception, version * 3.1, as published by the Free Software Foundation. * * You should have received a copy of the GNU General Public License and * a copy of the GCC Runtime Library Exception along with this program; * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see * . */ #ifndef _CPUID_H_INCLUDED #define _CPUID_H_INCLUDED /* %ecx */ #define bit_SSE3 (1 << 0) #define bit_PCLMUL (1 << 1) #define bit_LZCNT (1 << 5) #define bit_SSSE3 (1 << 9) #define bit_FMA (1 << 12) #define bit_CMPXCHG16B (1 << 13) #define bit_SSE4_1 (1 << 19) #define bit_SSE4_2 (1 << 20) #define bit_MOVBE (1 << 22) #define bit_POPCNT (1 << 23) #define bit_AES (1 << 25) #define bit_XSAVE (1 << 26) #define bit_OSXSAVE (1 << 27) #define bit_AVX (1 << 28) #define bit_F16C (1 << 29) #define bit_RDRND (1 << 30) /* %edx */ #define bit_CMPXCHG8B (1 << 8) #define bit_CMOV (1 << 15) #define bit_MMX (1 << 23) #define bit_FXSAVE (1 << 24) #define bit_SSE (1 << 25) #define bit_SSE2 (1 << 26) /* Extended Features (%eax == 0x80000001) */ /* %ecx */ #define bit_LAHF_LM (1 << 0) #define bit_ABM (1 << 5) #define bit_SSE4a (1 << 6) #define bit_PRFCHW (1 << 8) #define bit_XOP (1 << 11) #define bit_LWP (1 << 15) #define bit_FMA4 (1 << 16) #define bit_TBM (1 << 21) #define bit_MWAITX (1 << 29) /* %edx */ #define bit_MMXEXT (1 << 22) #define bit_LM (1 << 29) #define bit_3DNOWP (1 << 30) #define bit_3DNOW (1u << 31) /* %ebx */ #define bit_CLZERO (1 << 0) #define bit_WBNOINVD (1 << 9) /* Extended Features Leaf (%eax == 7, %ecx == 0) */ /* %ebx */ #define bit_FSGSBASE (1 << 0) #define bit_SGX (1 << 2) #define bit_BMI (1 << 3) #define bit_HLE (1 << 4) #define bit_AVX2 (1 << 5) #define bit_BMI2 (1 << 8) #define bit_RTM (1 << 11) #define bit_AVX512F (1 << 16) #define bit_AVX512DQ (1 << 17) #define bit_RDSEED (1 << 18) #define bit_ADX (1 << 19) #define bit_AVX512IFMA (1 << 21) #define bit_CLFLUSHOPT (1 << 23) #define bit_CLWB (1 << 24) #define bit_AVX512CD (1 << 28) #define bit_SHA (1 << 29) #define bit_AVX512BW (1 << 30) #define bit_AVX512VL (1u << 31) /* %ecx */ #define bit_AVX512VBMI (1 << 1) #define bit_PKU (1 << 3) #define bit_OSPKE (1 << 4) #define bit_WAITPKG (1 << 5) #define bit_AVX512VBMI2 (1 << 6) #define bit_SHSTK (1 << 7) #define bit_GFNI (1 << 8) #define bit_VAES (1 << 9) #define bit_VPCLMULQDQ (1 << 10) #define bit_AVX512VNNI (1 << 11) #define bit_AVX512BITALG (1 << 12) #define bit_AVX512VPOPCNTDQ (1 << 14) #define bit_RDPID (1 << 22) #define bit_KL (1 << 23) #define bit_CLDEMOTE (1 << 25) #define bit_MOVDIRI (1 << 27) #define bit_MOVDIR64B (1 << 28) #define bit_ENQCMD (1 << 29) /* %edx */ #define bit_UINTR (1 << 5) #define bit_AVX512VP2INTERSECT (1 << 8) #define bit_SERIALIZE (1 << 14) #define bit_TSXLDTRK (1 << 16) #define bit_PCONFIG (1 << 18) #define bit_IBT (1 << 20) #define bit_AMX_BF16 (1 << 22) #define bit_AVX512FP16 (1 << 23) #define bit_AMX_TILE (1 << 24) #define bit_AMX_INT8 (1 << 25) /* Extended Features Sub-leaf (%eax == 7, %ecx == 1) */ /* %eax */ #define bit_SHA512 (1 << 0) #define bit_SM3 (1 << 1) #define bit_SM4 (1 << 2) #define bit_RAOINT (1 << 3) #define bit_AVXVNNI (1 << 4) #define bit_AVX512BF16 (1 << 5) #define bit_CMPCCXADD (1 << 7) #define bit_AMX_COMPLEX (1 << 8) #define bit_AMX_FP16 (1 << 21) #define bit_HRESET (1 << 22) #define bit_AVXIFMA (1 << 23) #define bit_MOVRS (1 << 31) /* %edx */ #define bit_AVXVNNIINT8 (1 << 4) #define bit_AVXNECONVERT (1 << 5) #define bit_AVXVNNIINT16 (1 << 10) #define bit_PREFETCHI (1 << 14) #define bit_USER_MSR (1 << 15) #define bit_AVX10 (1 << 19) #define bit_APX_F (1 << 21) /* Extended State Enumeration Sub-leaf (%eax == 0xd, %ecx == 1) */ #define bit_XSAVEOPT (1 << 0) #define bit_XSAVEC (1 << 1) #define bit_XSAVES (1 << 3) /* PT sub leaf (%eax == 0x14, %ecx == 0) */ /* %ebx */ #define bit_PTWRITE (1 << 4) /* Keylocker leaf (%eax == 0x19) */ /* %ebx */ #define bit_AESKLE ( 1<<0 ) #define bit_WIDEKL ( 1<<2 ) /* AMX sub leaf (%eax == 0x1e, %ecx == 1) */ /* %eax */ #define bit_AMX_FP8 (1 << 4) #define bit_AMX_TRANSPOSE (1 << 5) #define bit_AMX_TF32 (1 << 6) #define bit_AMX_AVX512 (1 << 7) #define bit_AMX_MOVRS (1 << 8) /* Signatures for different CPU implementations as returned in uses of cpuid with level 0. */ #define signature_AMD_ebx 0x68747541 #define signature_AMD_ecx 0x444d4163 #define signature_AMD_edx 0x69746e65 #define signature_CENTAUR_ebx 0x746e6543 #define signature_CENTAUR_ecx 0x736c7561 #define signature_CENTAUR_edx 0x48727561 #define signature_CYRIX_ebx 0x69727943 #define signature_CYRIX_ecx 0x64616574 #define signature_CYRIX_edx 0x736e4978 #define signature_INTEL_ebx 0x756e6547 #define signature_INTEL_ecx 0x6c65746e #define signature_INTEL_edx 0x49656e69 #define signature_TM1_ebx 0x6e617254 #define signature_TM1_ecx 0x55504361 #define signature_TM1_edx 0x74656d73 #define signature_TM2_ebx 0x756e6547 #define signature_TM2_ecx 0x3638784d #define signature_TM2_edx 0x54656e69 #define signature_NSC_ebx 0x646f6547 #define signature_NSC_ecx 0x43534e20 #define signature_NSC_edx 0x79622065 #define signature_NEXGEN_ebx 0x4778654e #define signature_NEXGEN_ecx 0x6e657669 #define signature_NEXGEN_edx 0x72446e65 #define signature_RISE_ebx 0x65736952 #define signature_RISE_ecx 0x65736952 #define signature_RISE_edx 0x65736952 #define signature_SIS_ebx 0x20536953 #define signature_SIS_ecx 0x20536953 #define signature_SIS_edx 0x20536953 #define signature_UMC_ebx 0x20434d55 #define signature_UMC_ecx 0x20434d55 #define signature_UMC_edx 0x20434d55 #define signature_VIA_ebx 0x20414956 #define signature_VIA_ecx 0x20414956 #define signature_VIA_edx 0x20414956 #define signature_VORTEX_ebx 0x74726f56 #define signature_VORTEX_ecx 0x436f5320 #define signature_VORTEX_edx 0x36387865 #define signature_SHANGHAI_ebx 0x68532020 #define signature_SHANGHAI_ecx 0x20206961 #define signature_SHANGHAI_edx 0x68676e61 #ifndef __x86_64__ /* At least one cpu (Winchip 2) does not set %ebx and %ecx for cpuid leaf 1. Forcibly zero the two registers before calling cpuid as a precaution. */ #define __cpuid(level, a, b, c, d) \ do { \ if (__builtin_constant_p (level) && (level) != 1) \ __asm__ __volatile__ ("cpuid\n\t" \ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ : "0" (level)); \ else \ __asm__ __volatile__ ("cpuid\n\t" \ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ : "0" (level), "1" (0), "2" (0)); \ } while (0) #else #define __cpuid(level, a, b, c, d) \ __asm__ __volatile__ ("cpuid\n\t" \ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ : "0" (level)) #endif // #define __cpuid_count(level, count, a, b, c, d) \ // __asm__ __volatile__ ("cpuid\n\t" \ // : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ // : "0" (level), "2" (count)) static inline void __cpuid_count(int info, int subinfo, int eax, int ebx, int ecx, int edx) { int *peax = &eax; int *pebx = &ebx; int *pecx = &ecx; int *pedx = &edx; __asm__ __volatile__ ( "cpuid" : "=a" (*peax), "=b" (*pebx), "=c" (*pecx), "=d" (*pedx) : "0" (info), "2" (subinfo) ); } /* Return highest supported input value for cpuid instruction. ext can be either 0x0 or 0x80000000 to return highest supported value for basic or extended cpuid information. Function returns 0 if cpuid is not supported or whatever cpuid returns in eax register. If sig pointer is non-null, then first four bytes of the signature (as found in ebx register) are returned in location pointed by sig. */ static __inline unsigned int __get_cpuid_max (unsigned int __ext, unsigned int *__sig) { unsigned int __eax, __ebx, __ecx, __edx; #ifndef __x86_64__ /* See if we can use cpuid. On AMD64 we always can. */ #if __GNUC__ >= 3 __asm__ ("pushf{l|d}\n\t" "pushf{l|d}\n\t" "pop{l}\t%0\n\t" "mov{l}\t{%0, %1|%1, %0}\n\t" "xor{l}\t{%2, %0|%0, %2}\n\t" "push{l}\t%0\n\t" "popf{l|d}\n\t" "pushf{l|d}\n\t" "pop{l}\t%0\n\t" "popf{l|d}\n\t" : "=&r" (__eax), "=&r" (__ebx) : "i" (0x00200000)); #else /* Host GCCs older than 3.0 weren't supporting Intel asm syntax nor alternatives in i386 code. */ __asm__ ("pushfl\n\t" "pushfl\n\t" "popl\t%0\n\t" "movl\t%0, %1\n\t" "xorl\t%2, %0\n\t" "pushl\t%0\n\t" "popfl\n\t" "pushfl\n\t" "popl\t%0\n\t" "popfl\n\t" : "=&r" (__eax), "=&r" (__ebx) : "i" (0x00200000)); #endif if (__builtin_expect (!((__eax ^ __ebx) & 0x00200000), 0)) return 0; #endif /* Host supports cpuid. Return highest supported cpuid input value. */ __cpuid (__ext, __eax, __ebx, __ecx, __edx); if (__sig) *__sig = __ebx; return __eax; } /* Return cpuid data for requested cpuid leaf, as found in returned eax, ebx, ecx and edx registers. The function checks if cpuid is supported and returns 1 for valid cpuid information or 0 for unsupported cpuid leaf. All pointers are required to be non-null. */ static __inline int __get_cpuid (unsigned int __leaf, unsigned int *__eax, unsigned int *__ebx, unsigned int *__ecx, unsigned int *__edx) { unsigned int __ext = __leaf & 0x80000000; unsigned int __maxlevel = __get_cpuid_max (__ext, 0); if (__maxlevel == 0 || __maxlevel < __leaf) return 0; __cpuid (__leaf, *__eax, *__ebx, *__ecx, *__edx); return 1; } /* Same as above, but sub-leaf can be specified. */ static __inline int __get_cpuid_count (unsigned int __leaf, unsigned int __subleaf, unsigned int *__eax, unsigned int *__ebx, unsigned int *__ecx, unsigned int *__edx) { unsigned int __ext = __leaf & 0x80000000; unsigned int __maxlevel = __get_cpuid_max (__ext, 0); if (__builtin_expect (__maxlevel == 0, 0) || __maxlevel < __leaf) return 0; __cpuid_count (__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx); return 1; } static __inline void __cpuidex (int __cpuid_info[4], int __leaf, int __subleaf) { __cpuid_count (__leaf, __subleaf, __cpuid_info[0], __cpuid_info[1], __cpuid_info[2], __cpuid_info[3]); } #endif /* _CPUID_H_INCLUDED */chibicc-1.0.24/include/emmintrin.h000066400000000000000000001443241517770275000170030ustar00rootroot00000000000000/* Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 9.0. */ #ifndef _EMMINTRIN_H_INCLUDED #define _EMMINTRIN_H_INCLUDED /* We need definitions from the SSE header files*/ #include #ifndef __SSE2__ #pragma GCC push_options #pragma GCC target("sse2") #define __DISABLE_SSE2__ #endif /* __SSE2__ */ /* SSE2 */ typedef double __v2df __attribute__ ((__vector_size__ (16))); typedef long long __v2di __attribute__ ((__vector_size__ (16))); typedef unsigned long long __v2du __attribute__ ((__vector_size__ (16))); typedef int __v4si __attribute__ ((__vector_size__ (16))); typedef unsigned int __v4su __attribute__ ((__vector_size__ (16))); typedef short __v8hi __attribute__ ((__vector_size__ (16))); typedef unsigned short __v8hu __attribute__ ((__vector_size__ (16))); typedef char __v16qi __attribute__ ((__vector_size__ (16))); typedef signed char __v16qs __attribute__ ((__vector_size__ (16))); typedef unsigned char __v16qu __attribute__ ((__vector_size__ (16))); /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); /* Unaligned version of the same types. */ typedef long long __m128i_u __attribute__ ((__vector_size__ (16), __may_alias__, __aligned__ (1))); typedef double __m128d_u __attribute__ ((__vector_size__ (16), __may_alias__, __aligned__ (1))); /* Create a selector for use with the SHUFPD instruction. */ #define _MM_SHUFFLE2(fp1,fp0) \ (((fp1) << 1) | (fp0)) /* Create a vector with element 0 as F and the rest zero. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_sd (double __F) { return __extension__ (__m128d){ __F, 0.0 }; } /* Create a vector with both elements equal to F. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_pd (double __F) { return __extension__ (__m128d){ __F, __F }; } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pd1 (double __F) { return _mm_set1_pd (__F); } /* Create a vector with the lower value X and upper value W. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pd (double __W, double __X) { return __extension__ (__m128d){ __X, __W }; } /* Create a vector with the lower value W and upper value X. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_pd (double __W, double __X) { return __extension__ (__m128d){ __W, __X }; } /* Create an undefined vector. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_undefined_pd (void) { __m128d __Y = __Y; return __Y; } /* Create a vector of zeros. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setzero_pd (void) { return __extension__ (__m128d){ 0.0, 0.0 }; } /* Sets the low DPFP value of A from the low value of B. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_move_sd (__m128d __A, __m128d __B) { return __extension__ (__m128d) __builtin_shuffle ((__v2df)__A, (__v2df)__B, (__v2di){2, 1}); } /* Load two DPFP values from P. The address must be 16-byte aligned. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_load_pd (double const *__P) { return *(__m128d *)__P; } /* Load two DPFP values from P. The address need not be 16-byte aligned. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadu_pd (double const *__P) { return *(__m128d_u *)__P; } /* Create a vector with all two elements equal to *P. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_load1_pd (double const *__P) { return _mm_set1_pd (*__P); } /* Create a vector with element 0 as *P and the rest zero. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_load_sd (double const *__P) { return _mm_set_sd (*__P); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_load_pd1 (double const *__P) { return _mm_load1_pd (__P); } /* Load two DPFP values in reverse order. The address must be aligned. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadr_pd (double const *__P) { __m128d __tmp = _mm_load_pd (__P); return __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,1)); } /* Store two DPFP values. The address must be 16-byte aligned. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_store_pd (double *__P, __m128d __A) { *(__m128d *)__P = __A; } /* Store two DPFP values. The address need not be 16-byte aligned. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storeu_pd (double *__P, __m128d __A) { *(__m128d_u *)__P = __A; } /* Stores the lower DPFP value. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_store_sd (double *__P, __m128d __A) { *__P = ((__v2df)__A)[0]; } extern __inline double __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsd_f64 (__m128d __A) { return ((__v2df)__A)[0]; } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storel_pd (double *__P, __m128d __A) { _mm_store_sd (__P, __A); } /* Stores the upper DPFP value. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storeh_pd (double *__P, __m128d __A) { *__P = ((__v2df)__A)[1]; } /* Store the lower DPFP value across two words. The address must be 16-byte aligned. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_store1_pd (double *__P, __m128d __A) { _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, _MM_SHUFFLE2 (0,0))); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_store_pd1 (double *__P, __m128d __A) { _mm_store1_pd (__P, __A); } /* Store two DPFP values in reverse order. The address must be aligned. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storer_pd (double *__P, __m128d __A) { _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, _MM_SHUFFLE2 (0,1))); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi128_si32 (__m128i __A) { return __builtin_ia32_vec_ext_v4si ((__v4si)__A, 0); } #ifdef __x86_64__ /* Intel intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi128_si64 (__m128i __A) { return ((__v2di)__A)[0]; } /* Microsoft intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi128_si64x (__m128i __A) { return ((__v2di)__A)[0]; } #endif extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_pd (__m128d __A, __m128d __B) { return (__m128d) ((__v2df)__A + (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_addsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_pd (__m128d __A, __m128d __B) { return (__m128d) ((__v2df)__A - (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_subsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mul_pd (__m128d __A, __m128d __B) { return (__m128d) ((__v2df)__A * (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mul_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_mulsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_div_pd (__m128d __A, __m128d __B) { return (__m128d) ((__v2df)__A / (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_div_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_divsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sqrt_pd (__m128d __A) { return (__m128d)__builtin_ia32_sqrtpd ((__v2df)__A); } /* Return pair {sqrt (B[0]), A[1]}. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sqrt_sd (__m128d __A, __m128d __B) { __v2df __tmp = __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); return (__m128d)__builtin_ia32_sqrtsd ((__v2df)__tmp); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_minpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_minsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_maxpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_maxsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_and_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_andpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_andnot_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_andnpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_or_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_orpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_xor_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_xorpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpeqpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmplt_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpltpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmple_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmplepd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpgtpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpge_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpgepd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpneq_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpneqpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnlt_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpnltpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnle_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpnlepd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpngt_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpngtpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnge_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpngepd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpord_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpordpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpunord_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpunordpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpeqsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmplt_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpltsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmple_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmplesd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_movsd ((__v2df) __A, (__v2df) __builtin_ia32_cmpltsd ((__v2df) __B, (__v2df) __A)); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpge_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_movsd ((__v2df) __A, (__v2df) __builtin_ia32_cmplesd ((__v2df) __B, (__v2df) __A)); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpneq_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpneqsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnlt_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpnltsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnle_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpnlesd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpngt_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_movsd ((__v2df) __A, (__v2df) __builtin_ia32_cmpnltsd ((__v2df) __B, (__v2df) __A)); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnge_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_movsd ((__v2df) __A, (__v2df) __builtin_ia32_cmpnlesd ((__v2df) __B, (__v2df) __A)); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpord_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpordsd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpunord_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpunordsd ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comieq_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdeq ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comilt_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdlt ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comile_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdle ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comigt_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdgt ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comige_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdge ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comineq_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdneq ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomieq_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdeq ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomilt_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdlt ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomile_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdle ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomigt_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdgt ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomige_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdge ((__v2df)__A, (__v2df)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomineq_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdneq ((__v2df)__A, (__v2df)__B); } /* Create a vector of Qi, where i is the element number. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_epi64x (long long __q1, long long __q0) { return __extension__ (__m128i)(__v2di){ __q0, __q1 }; } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_epi64 (__m64 __q1, __m64 __q0) { return _mm_set_epi64x ((long long)__q1, (long long)__q0); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) { return __extension__ (__m128i)(__v4si){ __q0, __q1, __q2, __q3 }; } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, short __q3, short __q2, short __q1, short __q0) { return __extension__ (__m128i)(__v8hi){ __q0, __q1, __q2, __q3, __q4, __q5, __q6, __q7 }; } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, char __q11, char __q10, char __q09, char __q08, char __q07, char __q06, char __q05, char __q04, char __q03, char __q02, char __q01, char __q00) { return __extension__ (__m128i)(__v16qi){ __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07, __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15 }; } /* Set all of the elements of the vector to A. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_epi64x (long long __A) { return _mm_set_epi64x (__A, __A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_epi64 (__m64 __A) { return _mm_set_epi64 (__A, __A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_epi32 (int __A) { return _mm_set_epi32 (__A, __A, __A, __A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_epi16 (short __A) { return _mm_set_epi16 (__A, __A, __A, __A, __A, __A, __A, __A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_epi8 (char __A) { return _mm_set_epi8 (__A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A, __A); } /* Create a vector of Qi, where i is the element number. The parameter order is reversed from the _mm_set_epi* functions. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_epi64 (__m64 __q0, __m64 __q1) { return _mm_set_epi64 (__q1, __q0); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) { return _mm_set_epi32 (__q3, __q2, __q1, __q0); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, short __q4, short __q5, short __q6, short __q7) { return _mm_set_epi16 (__q7, __q6, __q5, __q4, __q3, __q2, __q1, __q0); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, char __q04, char __q05, char __q06, char __q07, char __q08, char __q09, char __q10, char __q11, char __q12, char __q13, char __q14, char __q15) { return _mm_set_epi8 (__q15, __q14, __q13, __q12, __q11, __q10, __q09, __q08, __q07, __q06, __q05, __q04, __q03, __q02, __q01, __q00); } /* Create a vector with element 0 as *P and the rest zero. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_load_si128 (__m128i const *__P) { return *__P; } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadu_si128 (__m128i_u const *__P) { return *__P; } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadl_epi64 (__m128i_u const *__P) { return _mm_set_epi64 ((__m64)0LL, *(__m64_u *)__P); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadu_si64 (void const *__P) { return _mm_loadl_epi64 ((__m128i_u *)__P); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_store_si128 (__m128i *__P, __m128i __B) { *__P = __B; } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storeu_si128 (__m128i_u *__P, __m128i __B) { *__P = __B; } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storel_epi64 (__m128i_u *__P, __m128i __B) { *(__m64_u *)__P = (__m64) ((__v2di)__B)[0]; } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storeu_si64 (void *__P, __m128i __B) { _mm_storel_epi64 ((__m128i_u *)__P, __B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movepi64_pi64 (__m128i __B) { return (__m64) ((__v2di)__B)[0]; } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movpi64_epi64 (__m64 __A) { return _mm_set_epi64 ((__m64)0LL, __A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_move_epi64 (__m128i __A) { return (__m128i)__builtin_ia32_movq128 ((__v2di) __A); } /* Create an undefined vector. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_undefined_si128 (void) { __m128i __Y = __Y; return __Y; } /* Create a vector of zeros. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setzero_si128 (void) { return __extension__ (__m128i)(__v4si){ 0, 0, 0, 0 }; } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepi32_pd (__m128i __A) { return (__m128d)__builtin_ia32_cvtdq2pd ((__v4si) __A); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepi32_ps (__m128i __A) { return (__m128)__builtin_ia32_cvtdq2ps ((__v4si) __A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtpd_epi32 (__m128d __A) { return (__m128i)__builtin_ia32_cvtpd2dq ((__v2df) __A); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtpd_pi32 (__m128d __A) { return (__m64)__builtin_ia32_cvtpd2pi ((__v2df) __A); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtpd_ps (__m128d __A) { return (__m128)__builtin_ia32_cvtpd2ps ((__v2df) __A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvttpd_epi32 (__m128d __A) { return (__m128i)__builtin_ia32_cvttpd2dq ((__v2df) __A); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvttpd_pi32 (__m128d __A) { return (__m64)__builtin_ia32_cvttpd2pi ((__v2df) __A); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtpi32_pd (__m64 __A) { return (__m128d)__builtin_ia32_cvtpi2pd ((__v2si) __A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtps_epi32 (__m128 __A) { return (__m128i)__builtin_ia32_cvtps2dq ((__v4sf) __A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvttps_epi32 (__m128 __A) { return (__m128i)__builtin_ia32_cvttps2dq ((__v4sf) __A); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtps_pd (__m128 __A) { return (__m128d)__builtin_ia32_cvtps2pd ((__v4sf) __A); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsd_si32 (__m128d __A) { return __builtin_ia32_cvtsd2si ((__v2df) __A); } #ifdef __x86_64__ /* Intel intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsd_si64 (__m128d __A) { return __builtin_ia32_cvtsd2si64 ((__v2df) __A); } /* Microsoft intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsd_si64x (__m128d __A) { return __builtin_ia32_cvtsd2si64 ((__v2df) __A); } #endif extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvttsd_si32 (__m128d __A) { return __builtin_ia32_cvttsd2si ((__v2df) __A); } #ifdef __x86_64__ /* Intel intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvttsd_si64 (__m128d __A) { return __builtin_ia32_cvttsd2si64 ((__v2df) __A); } /* Microsoft intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvttsd_si64x (__m128d __A) { return __builtin_ia32_cvttsd2si64 ((__v2df) __A); } #endif extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsd_ss (__m128 __A, __m128d __B) { return (__m128)__builtin_ia32_cvtsd2ss ((__v4sf) __A, (__v2df) __B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi32_sd (__m128d __A, int __B) { return (__m128d)__builtin_ia32_cvtsi2sd ((__v2df) __A, __B); } #ifdef __x86_64__ /* Intel intrinsic. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi64_sd (__m128d __A, long long __B) { return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B); } /* Microsoft intrinsic. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi64x_sd (__m128d __A, long long __B) { return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B); } #endif extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtss_sd (__m128d __A, __m128 __B) { return (__m128d)__builtin_ia32_cvtss2sd ((__v2df) __A, (__v4sf)__B); } #ifdef __OPTIMIZE__ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_shuffle_pd(__m128d __A, __m128d __B, const int __mask) { return (__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, __mask); } #else #define _mm_shuffle_pd(A, B, N) \ ((__m128d)__builtin_ia32_shufpd ((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), (int)(N))) #endif extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpackhi_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_unpckhpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpacklo_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_unpcklpd ((__v2df)__A, (__v2df)__B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadh_pd (__m128d __A, double const *__B) { return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, __B); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadl_pd (__m128d __A, double const *__B) { return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, __B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movemask_pd (__m128d __A) { return __builtin_ia32_movmskpd ((__v2df)__A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_packs_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_packsswb128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_packs_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_packssdw128 ((__v4si)__A, (__v4si)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_packus_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_packuswb128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpackhi_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpckhbw128 ((__v16qi)__A, (__v16qi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpackhi_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpckhwd128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpackhi_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpckhdq128 ((__v4si)__A, (__v4si)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpackhi_epi64 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpacklo_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpcklbw128 ((__v16qi)__A, (__v16qi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpacklo_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpcklwd128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpacklo_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpckldq128 ((__v4si)__A, (__v4si)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpacklo_epi64 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpcklqdq128 ((__v2di)__A, (__v2di)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_epi8 (__m128i __A, __m128i __B) { return (__m128i) ((__v16qu)__A + (__v16qu)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_epi16 (__m128i __A, __m128i __B) { return (__m128i) ((__v8hu)__A + (__v8hu)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_epi32 (__m128i __A, __m128i __B) { return (__m128i) ((__v4su)__A + (__v4su)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_epi64 (__m128i __A, __m128i __B) { return (__m128i) ((__v2du)__A + (__v2du)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_adds_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddsb128 ((__v16qi)__A, (__v16qi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_adds_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddsw128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_adds_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddusb128 ((__v16qi)__A, (__v16qi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_adds_epu16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddusw128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_epi8 (__m128i __A, __m128i __B) { return (__m128i) ((__v16qu)__A - (__v16qu)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_epi16 (__m128i __A, __m128i __B) { return (__m128i) ((__v8hu)__A - (__v8hu)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_epi32 (__m128i __A, __m128i __B) { return (__m128i) ((__v4su)__A - (__v4su)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_epi64 (__m128i __A, __m128i __B) { return (__m128i) ((__v2du)__A - (__v2du)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_subs_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubsb128 ((__v16qi)__A, (__v16qi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_subs_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubsw128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_subs_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubusb128 ((__v16qi)__A, (__v16qi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_subs_epu16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubusw128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_madd_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmaddwd128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mulhi_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmulhw128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mullo_epi16 (__m128i __A, __m128i __B) { return (__m128i) ((__v8hu)__A * (__v8hu)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mul_su32 (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pmuludq ((__v2si)__A, (__v2si)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mul_epu32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmuludq128 ((__v4si)__A, (__v4si)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_slli_epi16 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psllwi128 ((__v8hi)__A, __B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_slli_epi32 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_pslldi128 ((__v4si)__A, __B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_slli_epi64 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psllqi128 ((__v2di)__A, __B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srai_epi16 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psrawi128 ((__v8hi)__A, __B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srai_epi32 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psradi128 ((__v4si)__A, __B); } #ifdef __OPTIMIZE__ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_bsrli_si128 (__m128i __A, const int __N) { return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_bslli_si128 (__m128i __A, const int __N) { return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srli_si128 (__m128i __A, const int __N) { return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_slli_si128 (__m128i __A, const int __N) { return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8); } #else #define _mm_bsrli_si128(A, N) \ ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8)) #define _mm_bslli_si128(A, N) \ ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8)) #define _mm_srli_si128(A, N) \ ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8)) #define _mm_slli_si128(A, N) \ ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8)) #endif extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srli_epi16 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psrlwi128 ((__v8hi)__A, __B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srli_epi32 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psrldi128 ((__v4si)__A, __B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srli_epi64 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psrlqi128 ((__v2di)__A, __B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sll_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psllw128((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sll_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pslld128((__v4si)__A, (__v4si)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sll_epi64 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psllq128((__v2di)__A, (__v2di)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sra_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psraw128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sra_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psrad128 ((__v4si)__A, (__v4si)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srl_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psrlw128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srl_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psrld128 ((__v4si)__A, (__v4si)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srl_epi64 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psrlq128 ((__v2di)__A, (__v2di)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_and_si128 (__m128i __A, __m128i __B) { return (__m128i) ((__v2du)__A & (__v2du)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_andnot_si128 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pandn128 ((__v2di)__A, (__v2di)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_or_si128 (__m128i __A, __m128i __B) { return (__m128i) ((__v2du)__A | (__v2du)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_xor_si128 (__m128i __A, __m128i __B) { return (__m128i) ((__v2du)__A ^ (__v2du)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_epi8 (__m128i __A, __m128i __B) { return (__m128i) ((__v16qi)__A == (__v16qi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_epi16 (__m128i __A, __m128i __B) { return (__m128i) ((__v8hi)__A == (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_epi32 (__m128i __A, __m128i __B) { return (__m128i) ((__v4si)__A == (__v4si)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmplt_epi8 (__m128i __A, __m128i __B) { return (__m128i) ((__v16qs)__A < (__v16qs)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmplt_epi16 (__m128i __A, __m128i __B) { return (__m128i) ((__v8hi)__A < (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmplt_epi32 (__m128i __A, __m128i __B) { return (__m128i) ((__v4si)__A < (__v4si)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_epi8 (__m128i __A, __m128i __B) { return (__m128i) ((__v16qs)__A > (__v16qs)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_epi16 (__m128i __A, __m128i __B) { return (__m128i) ((__v8hi)__A > (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_epi32 (__m128i __A, __m128i __B) { return (__m128i) ((__v4si)__A > (__v4si)__B); } #ifdef __OPTIMIZE__ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_extract_epi16 (__m128i const __A, int const __N) { return (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)__A, __N); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_insert_epi16 (__m128i const __A, int const __D, int const __N) { return (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)__A, __D, __N); } #else #define _mm_extract_epi16(A, N) \ ((int) (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(A), (int)(N))) #define _mm_insert_epi16(A, D, N) \ ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(__m128i)(A), \ (int)(D), (int)(N))) #endif extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmaxsw128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmaxub128 ((__v16qi)__A, (__v16qi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pminsw128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pminub128 ((__v16qi)__A, (__v16qi)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movemask_epi8 (__m128i __A) { return __builtin_ia32_pmovmskb128 ((__v16qi)__A); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mulhi_epu16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B); } #ifdef __OPTIMIZE__ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_shufflehi_epi16 (__m128i __A, const int __mask) { return (__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __mask); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_shufflelo_epi16 (__m128i __A, const int __mask) { return (__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __mask); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_shuffle_epi32 (__m128i __A, const int __mask) { return (__m128i)__builtin_ia32_pshufd ((__v4si)__A, __mask); } #else #define _mm_shufflehi_epi16(A, N) \ ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(A), (int)(N))) #define _mm_shufflelo_epi16(A, N) \ ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(A), (int)(N))) #define _mm_shuffle_epi32(A, N) \ ((__m128i)__builtin_ia32_pshufd ((__v4si)(__m128i)(A), (int)(N))) #endif extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) { __builtin_ia32_maskmovdqu ((__v16qi)__A, (__v16qi)__B, __C); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_avg_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pavgb128 ((__v16qi)__A, (__v16qi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_avg_epu16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pavgw128 ((__v8hi)__A, (__v8hi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sad_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psadbw128 ((__v16qi)__A, (__v16qi)__B); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_stream_si32 (int *__A, int __B) { __builtin_ia32_movnti (__A, __B); } #ifdef __x86_64__ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_stream_si64 (long long int *__A, long long int __B) { __builtin_ia32_movnti64 (__A, __B); } #endif extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_stream_si128 (__m128i *__A, __m128i __B) { __builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_stream_pd (double *__A, __m128d __B) { __builtin_ia32_movntpd (__A, (__v2df)__B); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_clflush (void const *__A) { __builtin_ia32_clflush (__A); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_lfence (void) { __builtin_ia32_lfence (); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mfence (void) { __builtin_ia32_mfence (); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi32_si128 (int __A) { return _mm_set_epi32 (0, 0, 0, __A); } #ifdef __x86_64__ /* Intel intrinsic. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi64_si128 (long long __A) { return _mm_set_epi64x (0, __A); } /* Microsoft intrinsic. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi64x_si128 (long long __A) { return _mm_set_epi64x (0, __A); } #endif /* Casts between various SP, DP, INT vector types. Note that these do no conversion of values, they just change the type. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castpd_ps(__m128d __A) { return (__m128) __A; } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castpd_si128(__m128d __A) { return (__m128i) __A; } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castps_pd(__m128 __A) { return (__m128d) __A; } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castps_si128(__m128 __A) { return (__m128i) __A; } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castsi128_ps(__m128i __A) { return (__m128) __A; } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castsi128_pd(__m128i __A) { return (__m128d) __A; } #ifdef __DISABLE_SSE2__ #undef __DISABLE_SSE2__ #pragma GCC pop_options #endif /* __DISABLE_SSE2__ */ #endif /* _EMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/enqcmdintrin.h000066400000000000000000000034741517770275000174740ustar00rootroot00000000000000/* Copyright (C) 2019-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _ENQCMDINTRIN_H_INCLUDED #define _ENQCMDINTRIN_H_INCLUDED #ifndef __ENQCMD__ #pragma GCC push_options #pragma GCC target ("enqcmd") #define __DISABLE_ENQCMD__ #endif /* __ENQCMD__ */ // extern __inline int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _enqcmd (void * __P, const void * __Q) // { // return __builtin_ia32_enqcmd (__P, __Q); // } // extern __inline int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _enqcmds (void * __P, const void * __Q) // { // return __builtin_ia32_enqcmds (__P, __Q); // } #ifdef __DISABLE_ENQCMD__ #undef __DISABLE_ENQCMD__ #pragma GCC pop_options #endif /* __DISABLE_ENQCMD__ */ #endif /* _ENQCMDINTRIN_H_INCLUDED. */ chibicc-1.0.24/include/f16cintrin.h000066400000000000000000000067421517770275000167650ustar00rootroot00000000000000/* Copyright (C) 2011-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include or instead." #endif #ifndef _F16CINTRIN_H_INCLUDED #define _F16CINTRIN_H_INCLUDED #ifndef __F16C__ #pragma GCC push_options #pragma GCC target("f16c") #define __DISABLE_F16C__ #endif /* __F16C__ */ // extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _cvtsh_ss (unsigned short __S) // { // __v8hi __H = __extension__ (__v8hi){ (short) __S, 0, 0, 0, 0, 0, 0, 0 }; // __v4sf __A = __builtin_ia32_vcvtph2ps (__H); // return __builtin_ia32_vec_ext_v4sf (__A, 0); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtph_ps (__m128i __A) // { // return (__m128) __builtin_ia32_vcvtph2ps ((__v8hi) __A); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtph_ps (__m128i __A) // { // return (__m256) __builtin_ia32_vcvtph2ps256 ((__v8hi) __A); // } // #ifdef __OPTIMIZE__ // extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _cvtss_sh (float __F, const int __I) // { // __v4sf __A = __extension__ (__v4sf){ __F, 0, 0, 0 }; // __v8hi __H = __builtin_ia32_vcvtps2ph (__A, __I); // return (unsigned short) __builtin_ia32_vec_ext_v8hi (__H, 0); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cvtps_ph (__m128 __A, const int __I) // { // return (__m128i) __builtin_ia32_vcvtps2ph ((__v4sf) __A, __I); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cvtps_ph (__m256 __A, const int __I) // { // return (__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf) __A, __I); // } // #else // #define _cvtss_sh(__F, __I) \ // (__extension__ \ // ({ \ // __v4sf __A = __extension__ (__v4sf){ __F, 0, 0, 0 }; \ // __v8hi __H = __builtin_ia32_vcvtps2ph (__A, __I); \ // (unsigned short) __builtin_ia32_vec_ext_v8hi (__H, 0); \ // })) // #define _mm_cvtps_ph(A, I) \ // ((__m128i) __builtin_ia32_vcvtps2ph ((__v4sf)(__m128) (A), (int) (I))) // #define _mm256_cvtps_ph(A, I) \ // ((__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf)(__m256) (A), (int) (I))) // #endif /* __OPTIMIZE */ #ifdef __DISABLE_F16C__ #undef __DISABLE_F16C__ #pragma GCC pop_options #endif /* __DISABLE_F16C__ */ #endif /* _F16CINTRIN_H_INCLUDED */ chibicc-1.0.24/include/float.h000077500000000000000000000031461517770275000161050ustar00rootroot00000000000000#ifndef __STDFLOAT_H #define __STDFLOAT_H #define DECIMAL_DIG 21 #define FLT_EVAL_METHOD 0 // C11 5.2.4.2.2p9 #define FLT_RADIX 2 #define FLT_ROUNDS 1 // C11 5.2.4.2.2p8: to nearest #if defined(__has_include) #if __has_include() #include #define FLT_ROUNDS \ ({ \ int val = -1; \ switch (fegetround()) { \ case FE_TOWARDZERO: val = 0; break; \ case FE_TONEAREST: val = 1; break; \ case FE_UPWARD: val = 2; break; \ case FE_DOWNWARD: val = 3; break; \ }; \ val; \ }) #endif #endif #ifndef FLT_ROUND #define FLT_ROUND 1 #endif #define FLT_DIG 6 #define FLT_EPSILON 0x1p-23f #define FLT_MANT_DIG 24 #define FLT_MAX 0x1.fffffep+127f #define FLT_MAX_10_EXP 38 #define FLT_MAX_EXP 128 #define FLT_MIN 0x1p-126f #define FLT_MIN_10_EXP (-37) #define FLT_MIN_EXP (-125) #define FLT_TRUE_MIN 0x1p-149f #define DBL_DIG 15 #define DBL_EPSILON 0x1p-52 #define DBL_MANT_DIG 53 #define DBL_MAX 0x1.fffffffffffffp+1023 #define DBL_MAX_10_EXP 308 #define DBL_MAX_EXP 1024 #define DBL_MIN 0x1p-1022 #define DBL_MIN_10_EXP (-307) #define DBL_MIN_EXP (-1021) #define DBL_TRUE_MIN 0x1p-1074 #define LDBL_DIG 18 #define LDBL_EPSILON 0x1p-63L #define LDBL_MANT_DIG 64 #define LDBL_MAX 0x1.fffffffffffffffep+16383L #define LDBL_MAX_10_EXP 4932 #define LDBL_MAX_EXP 16384 #define LDBL_MIN 0x1p-16382L #define LDBL_MIN_10_EXP (-4931) #define LDBL_MIN_EXP (-16381) #define LDBL_TRUE_MIN 0x1p-16445L #endifchibicc-1.0.24/include/fma4intrin.h000066400000000000000000000226221517770275000170500ustar00rootroot00000000000000/* Copyright (C) 2007-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _X86INTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _FMA4INTRIN_H_INCLUDED #define _FMA4INTRIN_H_INCLUDED /* We need definitions from the SSE4A, SSE3, SSE2 and SSE header files. */ #include #ifndef __FMA4__ #pragma GCC push_options #pragma GCC target("fma4") #define __DISABLE_FMA4__ #endif /* __FMA4__ */ // /* 128b Floating point multiply/add type instructions. */ // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_macc_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddps ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_macc_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddpd ((__v2df)__A, (__v2df)__B, (__v2df)__C); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_macc_ss (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddss ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_macc_sd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsd ((__v2df)__A, (__v2df)__B, (__v2df)__C); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_msub_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddps ((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_msub_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddpd ((__v2df)__A, (__v2df)__B, -(__v2df)__C); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_msub_ss (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddss ((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_msub_sd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsd ((__v2df)__A, (__v2df)__B, -(__v2df)__C); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_nmacc_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddps (-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_nmacc_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddpd (-(__v2df)__A, (__v2df)__B, (__v2df)__C); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_nmacc_ss (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddss (-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_nmacc_sd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsd (-(__v2df)__A, (__v2df)__B, (__v2df)__C); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_nmsub_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddps (-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_nmsub_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddpd (-(__v2df)__A, (__v2df)__B, -(__v2df)__C); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_nmsub_ss (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddss (-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_nmsub_sd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsd (-(__v2df)__A, (__v2df)__B, -(__v2df)__C); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maddsub_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddsubps ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maddsub_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsubpd ((__v2df)__A, (__v2df)__B, (__v2df)__C); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_msubadd_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddsubps ((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_msubadd_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsubpd ((__v2df)__A, (__v2df)__B, -(__v2df)__C); // } // /* 256b Floating point multiply/add type instructions. */ // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_macc_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddps256 ((__v8sf)__A, (__v8sf)__B, (__v8sf)__C); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_macc_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddpd256 ((__v4df)__A, (__v4df)__B, (__v4df)__C); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_msub_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddps256 ((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_msub_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddpd256 ((__v4df)__A, (__v4df)__B, -(__v4df)__C); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_nmacc_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddps256 (-(__v8sf)__A, (__v8sf)__B, (__v8sf)__C); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_nmacc_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddpd256 (-(__v4df)__A, (__v4df)__B, (__v4df)__C); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_nmsub_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddps256 (-(__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_nmsub_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddpd256 (-(__v4df)__A, (__v4df)__B, -(__v4df)__C); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maddsub_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddsubps256 ((__v8sf)__A, (__v8sf)__B, (__v8sf)__C); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maddsub_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddsubpd256 ((__v4df)__A, (__v4df)__B, (__v4df)__C); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_msubadd_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256) __builtin_ia32_vfmaddsubps256 ((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_msubadd_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d) __builtin_ia32_vfmaddsubpd256 ((__v4df)__A, (__v4df)__B, -(__v4df)__C); // } #ifdef __DISABLE_FMA4__ #undef __DISABLE_FMA4__ #pragma GCC pop_options #endif /* __DISABLE_FMA4__ */ #endif chibicc-1.0.24/include/fmaintrin.h000066400000000000000000000250601517770275000167630ustar00rootroot00000000000000/* Copyright (C) 2011-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _FMAINTRIN_H_INCLUDED #define _FMAINTRIN_H_INCLUDED #ifndef __FMA__ #pragma GCC push_options #pragma GCC target("fma") #define __DISABLE_FMA__ #endif /* __FMA__ */ // extern __inline __m128d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmadd_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d)__builtin_ia32_vfmaddpd ((__v2df)__A, (__v2df)__B, // (__v2df)__C); // } // extern __inline __m256d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fmadd_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d)__builtin_ia32_vfmaddpd256 ((__v4df)__A, (__v4df)__B, // (__v4df)__C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmadd_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128)__builtin_ia32_vfmaddps ((__v4sf)__A, (__v4sf)__B, // (__v4sf)__C); // } // extern __inline __m256 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256)__builtin_ia32_vfmaddps256 ((__v8sf)__A, (__v8sf)__B, // (__v8sf)__C); // } // extern __inline __m128d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmadd_sd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d) __builtin_ia32_vfmaddsd3 ((__v2df)__A, (__v2df)__B, // (__v2df)__C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmadd_ss (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128) __builtin_ia32_vfmaddss3 ((__v4sf)__A, (__v4sf)__B, // (__v4sf)__C); // } // extern __inline __m128d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmsub_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d)__builtin_ia32_vfmsubpd ((__v2df)__A, (__v2df)__B, // (__v2df)__C); // } // extern __inline __m256d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fmsub_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d)__builtin_ia32_vfmsubpd256 ((__v4df)__A, (__v4df)__B, // (__v4df)__C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmsub_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128)__builtin_ia32_vfmsubps ((__v4sf)__A, (__v4sf)__B, // (__v4sf)__C); // } // extern __inline __m256 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fmsub_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256)__builtin_ia32_vfmsubps256 ((__v8sf)__A, (__v8sf)__B, // (__v8sf)__C); // } // extern __inline __m128d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmsub_sd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d)__builtin_ia32_vfmsubsd3 ((__v2df)__A, (__v2df)__B, // (__v2df)__C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmsub_ss (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128)__builtin_ia32_vfmsubss3 ((__v4sf)__A, (__v4sf)__B, // (__v4sf)__C); // } // extern __inline __m128d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmadd_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d)__builtin_ia32_vfnmaddpd ((__v2df)__A, (__v2df)__B, // (__v2df)__C); // } // extern __inline __m256d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fnmadd_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d)__builtin_ia32_vfnmaddpd256 ((__v4df)__A, (__v4df)__B, // (__v4df)__C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmadd_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128)__builtin_ia32_vfnmaddps ((__v4sf)__A, (__v4sf)__B, // (__v4sf)__C); // } // extern __inline __m256 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fnmadd_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256)__builtin_ia32_vfnmaddps256 ((__v8sf)__A, (__v8sf)__B, // (__v8sf)__C); // } // extern __inline __m128d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmadd_sd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d)__builtin_ia32_vfnmaddsd3 ((__v2df)__A, (__v2df)__B, // (__v2df)__C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmadd_ss (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128)__builtin_ia32_vfnmaddss3 ((__v4sf)__A, (__v4sf)__B, // (__v4sf)__C); // } // extern __inline __m128d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmsub_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d)__builtin_ia32_vfnmsubpd ((__v2df)__A, (__v2df)__B, // (__v2df)__C); // } // extern __inline __m256d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fnmsub_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d)__builtin_ia32_vfnmsubpd256 ((__v4df)__A, (__v4df)__B, // (__v4df)__C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmsub_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128)__builtin_ia32_vfnmsubps ((__v4sf)__A, (__v4sf)__B, // (__v4sf)__C); // } // extern __inline __m256 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fnmsub_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256)__builtin_ia32_vfnmsubps256 ((__v8sf)__A, (__v8sf)__B, // (__v8sf)__C); // } // extern __inline __m128d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmsub_sd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d)__builtin_ia32_vfnmsubsd3 ((__v2df)__A, (__v2df)__B, // (__v2df)__C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fnmsub_ss (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128)__builtin_ia32_vfnmsubss3 ((__v4sf)__A, (__v4sf)__B, // (__v4sf)__C); // } // extern __inline __m128d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmaddsub_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d)__builtin_ia32_vfmaddsubpd ((__v2df)__A, (__v2df)__B, // (__v2df)__C); // } // extern __inline __m256d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fmaddsub_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d)__builtin_ia32_vfmaddsubpd256 ((__v4df)__A, // (__v4df)__B, // (__v4df)__C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmaddsub_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128)__builtin_ia32_vfmaddsubps ((__v4sf)__A, (__v4sf)__B, // (__v4sf)__C); // } // extern __inline __m256 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fmaddsub_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256)__builtin_ia32_vfmaddsubps256 ((__v8sf)__A, // (__v8sf)__B, // (__v8sf)__C); // } // extern __inline __m128d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmsubadd_pd (__m128d __A, __m128d __B, __m128d __C) // { // return (__m128d)__builtin_ia32_vfmaddsubpd ((__v2df)__A, (__v2df)__B, // -(__v2df)__C); // } // extern __inline __m256d // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fmsubadd_pd (__m256d __A, __m256d __B, __m256d __C) // { // return (__m256d)__builtin_ia32_vfmaddsubpd256 ((__v4df)__A, // (__v4df)__B, // -(__v4df)__C); // } // extern __inline __m128 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_fmsubadd_ps (__m128 __A, __m128 __B, __m128 __C) // { // return (__m128)__builtin_ia32_vfmaddsubps ((__v4sf)__A, (__v4sf)__B, // -(__v4sf)__C); // } // extern __inline __m256 // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_fmsubadd_ps (__m256 __A, __m256 __B, __m256 __C) // { // return (__m256)__builtin_ia32_vfmaddsubps256 ((__v8sf)__A, // (__v8sf)__B, // -(__v8sf)__C); // } #ifdef __DISABLE_FMA__ #undef __DISABLE_FMA__ #pragma GCC pop_options #endif /* __DISABLE_FMA__ */ #endif chibicc-1.0.24/include/fxsrintrin.h000066400000000000000000000041261517770275000172020ustar00rootroot00000000000000/* Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _FXSRINTRIN_H_INCLUDED #define _FXSRINTRIN_H_INCLUDED #ifndef __FXSR__ #pragma GCC push_options #pragma GCC target("fxsr") #define __DISABLE_FXSR__ #endif /* __FXSR__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _fxsave (void *__P) // { // __builtin_ia32_fxsave (__P); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _fxrstor (void *__P) // { // __builtin_ia32_fxrstor (__P); // } // #ifdef __x86_64__ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _fxsave64 (void *__P) // { // __builtin_ia32_fxsave64 (__P); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _fxrstor64 (void *__P) // { // __builtin_ia32_fxrstor64 (__P); // } // #endif #ifdef __DISABLE_FXSR__ #undef __DISABLE_FXSR__ #pragma GCC pop_options #endif /* __DISABLE_FXSR__ */ #endif /* _FXSRINTRIN_H_INCLUDED */ chibicc-1.0.24/include/gfniintrin.h000066400000000000000000000373031517770275000171460ustar00rootroot00000000000000/* Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _GFNIINTRIN_H_INCLUDED #define _GFNIINTRIN_H_INCLUDED #if !defined(__GFNI__) || !defined(__SSE2__) #pragma GCC push_options #pragma GCC target("gfni,sse2") #define __DISABLE_GFNI__ #endif /* __GFNI__ */ // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_gf2p8mul_epi8 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vgf2p8mulb_v16qi((__v16qi) __A, // (__v16qi) __B); // } // #ifdef __OPTIMIZE__ // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_gf2p8affineinv_epi64_epi8 (__m128i __A, __m128i __B, const int __C) // { // return (__m128i) __builtin_ia32_vgf2p8affineinvqb_v16qi ((__v16qi) __A, // (__v16qi) __B, // __C); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_gf2p8affine_epi64_epi8 (__m128i __A, __m128i __B, const int __C) // { // return (__m128i) __builtin_ia32_vgf2p8affineqb_v16qi ((__v16qi) __A, // (__v16qi) __B, __C); // } // #else // #define _mm_gf2p8affineinv_epi64_epi8(A, B, C) \ // ((__m128i) __builtin_ia32_vgf2p8affineinvqb_v16qi((__v16qi)(__m128i)(A), \ // (__v16qi)(__m128i)(B), (int)(C))) // #define _mm_gf2p8affine_epi64_epi8(A, B, C) \ // ((__m128i) __builtin_ia32_vgf2p8affineqb_v16qi ((__v16qi)(__m128i)(A), \ // (__v16qi)(__m128i)(B), (int)(C))) // #endif // #ifdef __DISABLE_GFNI__ // #undef __DISABLE_GFNI__ // #pragma GCC pop_options // #endif /* __DISABLE_GFNI__ */ // #if !defined(__GFNI__) || !defined(__AVX__) // #pragma GCC push_options // #pragma GCC target("gfni,avx") // #define __DISABLE_GFNIAVX__ // #endif /* __GFNIAVX__ */ // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_gf2p8mul_epi8 (__m256i __A, __m256i __B) // { // return (__m256i) __builtin_ia32_vgf2p8mulb_v32qi ((__v32qi) __A, // (__v32qi) __B); // } // #ifdef __OPTIMIZE__ // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_gf2p8affineinv_epi64_epi8 (__m256i __A, __m256i __B, const int __C) // { // return (__m256i) __builtin_ia32_vgf2p8affineinvqb_v32qi ((__v32qi) __A, // (__v32qi) __B, // __C); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_gf2p8affine_epi64_epi8 (__m256i __A, __m256i __B, const int __C) // { // return (__m256i) __builtin_ia32_vgf2p8affineqb_v32qi ((__v32qi) __A, // (__v32qi) __B, __C); // } // #else // #define _mm256_gf2p8affineinv_epi64_epi8(A, B, C) \ // ((__m256i) __builtin_ia32_vgf2p8affineinvqb_v32qi((__v32qi)(__m256i)(A), \ // (__v32qi)(__m256i)(B), \ // (int)(C))) // #define _mm256_gf2p8affine_epi64_epi8(A, B, C) \ // ((__m256i) __builtin_ia32_vgf2p8affineqb_v32qi ((__v32qi)(__m256i)(A), \ // ( __v32qi)(__m256i)(B), (int)(C))) // #endif // #ifdef __DISABLE_GFNIAVX__ // #undef __DISABLE_GFNIAVX__ // #pragma GCC pop_options // #endif /* __GFNIAVX__ */ // #if !defined(__GFNI__) || !defined(__AVX512VL__) // #pragma GCC push_options // #pragma GCC target("gfni,avx512vl") // #define __DISABLE_GFNIAVX512VL__ // #endif /* __GFNIAVX512VL__ */ // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_gf2p8mul_epi8 (__m128i __A, __mmask16 __B, __m128i __C, __m128i __D) // { // return (__m128i) __builtin_ia32_vgf2p8mulb_v16qi_mask ((__v16qi) __C, // (__v16qi) __D, // (__v16qi)__A, __B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_gf2p8mul_epi8 (__mmask16 __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vgf2p8mulb_v16qi_mask ((__v16qi) __B, // (__v16qi) __C, (__v16qi) _mm_setzero_si128 (), __A); // } // #ifdef __OPTIMIZE__ // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_gf2p8affineinv_epi64_epi8 (__m128i __A, __mmask16 __B, __m128i __C, // __m128i __D, const int __E) // { // return (__m128i) __builtin_ia32_vgf2p8affineinvqb_v16qi_mask ((__v16qi) __C, // (__v16qi) __D, // __E, // (__v16qi)__A, // __B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_gf2p8affineinv_epi64_epi8 (__mmask16 __A, __m128i __B, __m128i __C, // const int __D) // { // return (__m128i) __builtin_ia32_vgf2p8affineinvqb_v16qi_mask ((__v16qi) __B, // (__v16qi) __C, __D, // (__v16qi) _mm_setzero_si128 (), // __A); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mask_gf2p8affine_epi64_epi8 (__m128i __A, __mmask16 __B, __m128i __C, // __m128i __D, const int __E) // { // return (__m128i) __builtin_ia32_vgf2p8affineqb_v16qi_mask ((__v16qi) __C, // (__v16qi) __D, __E, (__v16qi)__A, __B); // } // extern __inline __m128i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maskz_gf2p8affine_epi64_epi8 (__mmask16 __A, __m128i __B, __m128i __C, // const int __D) // { // return (__m128i) __builtin_ia32_vgf2p8affineqb_v16qi_mask ((__v16qi) __B, // (__v16qi) __C, __D, (__v16qi) _mm_setzero_si128 (), __A); // } // #else // #define _mm_mask_gf2p8affineinv_epi64_epi8(A, B, C, D, E) \ // ((__m128i) __builtin_ia32_vgf2p8affineinvqb_v16qi_mask( \ // (__v16qi)(__m128i)(C), (__v16qi)(__m128i)(D), \ // (int)(E), (__v16qi)(__m128i)(A), (__mmask16)(B))) // #define _mm_maskz_gf2p8affineinv_epi64_epi8(A, B, C, D) \ // ((__m128i) __builtin_ia32_vgf2p8affineinvqb_v16qi_mask( \ // (__v16qi)(__m128i)(B), (__v16qi)(__m128i)(C), \ // (int)(D), (__v16qi)(__m128i) _mm_setzero_si128 (), \ // (__mmask16)(A))) // #define _mm_mask_gf2p8affine_epi64_epi8(A, B, C, D, E) \ // ((__m128i) __builtin_ia32_vgf2p8affineqb_v16qi_mask((__v16qi)(__m128i)(C),\ // (__v16qi)(__m128i)(D), (int)(E), (__v16qi)(__m128i)(A), (__mmask16)(B))) // #define _mm_maskz_gf2p8affine_epi64_epi8(A, B, C, D) \ // ((__m128i) __builtin_ia32_vgf2p8affineqb_v16qi_mask((__v16qi)(__m128i)(B),\ // (__v16qi)(__m128i)(C), (int)(D), \ // (__v16qi)(__m128i) _mm_setzero_si128 (), (__mmask16)(A))) // #endif // #ifdef __DISABLE_GFNIAVX512VL__ // #undef __DISABLE_GFNIAVX512VL__ // #pragma GCC pop_options // #endif /* __GFNIAVX512VL__ */ // #if !defined(__GFNI__) || !defined(__AVX512VL__) || !defined(__AVX512BW__) // #pragma GCC push_options // #pragma GCC target("gfni,avx512vl,avx512bw") // #define __DISABLE_GFNIAVX512VLBW__ // #endif /* __GFNIAVX512VLBW__ */ // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_gf2p8mul_epi8 (__m256i __A, __mmask32 __B, __m256i __C, // __m256i __D) // { // return (__m256i) __builtin_ia32_vgf2p8mulb_v32qi_mask ((__v32qi) __C, // (__v32qi) __D, // (__v32qi)__A, __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_gf2p8mul_epi8 (__mmask32 __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vgf2p8mulb_v32qi_mask ((__v32qi) __B, // (__v32qi) __C, (__v32qi) _mm256_setzero_si256 (), __A); // } // #ifdef __OPTIMIZE__ // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_gf2p8affineinv_epi64_epi8 (__m256i __A, __mmask32 __B, // __m256i __C, __m256i __D, const int __E) // { // return (__m256i) __builtin_ia32_vgf2p8affineinvqb_v32qi_mask ((__v32qi) __C, // (__v32qi) __D, // __E, // (__v32qi)__A, // __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_gf2p8affineinv_epi64_epi8 (__mmask32 __A, __m256i __B, // __m256i __C, const int __D) // { // return (__m256i) __builtin_ia32_vgf2p8affineinvqb_v32qi_mask ((__v32qi) __B, // (__v32qi) __C, __D, // (__v32qi) _mm256_setzero_si256 (), __A); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_mask_gf2p8affine_epi64_epi8 (__m256i __A, __mmask32 __B, __m256i __C, // __m256i __D, const int __E) // { // return (__m256i) __builtin_ia32_vgf2p8affineqb_v32qi_mask ((__v32qi) __C, // (__v32qi) __D, // __E, // (__v32qi)__A, // __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_maskz_gf2p8affine_epi64_epi8 (__mmask32 __A, __m256i __B, // __m256i __C, const int __D) // { // return (__m256i) __builtin_ia32_vgf2p8affineqb_v32qi_mask ((__v32qi) __B, // (__v32qi) __C, __D, (__v32qi)_mm256_setzero_si256 (), __A); // } // #else // #define _mm256_mask_gf2p8affineinv_epi64_epi8(A, B, C, D, E) \ // ((__m256i) __builtin_ia32_vgf2p8affineinvqb_v32qi_mask( \ // (__v32qi)(__m256i)(C), (__v32qi)(__m256i)(D), (int)(E), \ // (__v32qi)(__m256i)(A), (__mmask32)(B))) // #define _mm256_maskz_gf2p8affineinv_epi64_epi8(A, B, C, D) \ // ((__m256i) __builtin_ia32_vgf2p8affineinvqb_v32qi_mask( \ // (__v32qi)(__m256i)(B), (__v32qi)(__m256i)(C), (int)(D), \ // (__v32qi)(__m256i) _mm256_setzero_si256 (), (__mmask32)(A))) // #define _mm256_mask_gf2p8affine_epi64_epi8(A, B, C, D, E) \ // ((__m256i) __builtin_ia32_vgf2p8affineqb_v32qi_mask((__v32qi)(__m256i)(C),\ // (__v32qi)(__m256i)(D), (int)(E), (__v32qi)(__m256i)(A), (__mmask32)(B))) // #define _mm256_maskz_gf2p8affine_epi64_epi8(A, B, C, D) \ // ((__m256i) __builtin_ia32_vgf2p8affineqb_v32qi_mask((__v32qi)(__m256i)(B),\ // (__v32qi)(__m256i)(C), (int)(D), \ // (__v32qi)(__m256i) _mm256_setzero_si256 (), (__mmask32)(A))) // #endif // #ifdef __DISABLE_GFNIAVX512VLBW__ // #undef __DISABLE_GFNIAVX512VLBW__ // #pragma GCC pop_options // #endif /* __GFNIAVX512VLBW__ */ // #if !defined(__GFNI__) || !defined(__AVX512F__) || !defined(__AVX512BW__) // #pragma GCC push_options // #pragma GCC target("gfni,avx512f,avx512bw") // #define __DISABLE_GFNIAVX512FBW__ // #endif /* __GFNIAVX512FBW__ */ // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_gf2p8mul_epi8 (__m512i __A, __mmask64 __B, __m512i __C, // __m512i __D) // { // return (__m512i) __builtin_ia32_vgf2p8mulb_v64qi_mask ((__v64qi) __C, // (__v64qi) __D, (__v64qi)__A, __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_gf2p8mul_epi8 (__mmask64 __A, __m512i __B, __m512i __C) // { // return (__m512i) __builtin_ia32_vgf2p8mulb_v64qi_mask ((__v64qi) __B, // (__v64qi) __C, (__v64qi) _mm512_setzero_si512 (), __A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_gf2p8mul_epi8 (__m512i __A, __m512i __B) // { // return (__m512i) __builtin_ia32_vgf2p8mulb_v64qi ((__v64qi) __A, // (__v64qi) __B); // } // #ifdef __OPTIMIZE__ // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_gf2p8affineinv_epi64_epi8 (__m512i __A, __mmask64 __B, __m512i __C, // __m512i __D, const int __E) // { // return (__m512i) __builtin_ia32_vgf2p8affineinvqb_v64qi_mask ((__v64qi) __C, // (__v64qi) __D, // __E, // (__v64qi)__A, // __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_gf2p8affineinv_epi64_epi8 (__mmask64 __A, __m512i __B, // __m512i __C, const int __D) // { // return (__m512i) __builtin_ia32_vgf2p8affineinvqb_v64qi_mask ((__v64qi) __B, // (__v64qi) __C, __D, // (__v64qi) _mm512_setzero_si512 (), __A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_gf2p8affineinv_epi64_epi8 (__m512i __A, __m512i __B, const int __C) // { // return (__m512i) __builtin_ia32_vgf2p8affineinvqb_v64qi ((__v64qi) __A, // (__v64qi) __B, __C); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_mask_gf2p8affine_epi64_epi8 (__m512i __A, __mmask64 __B, __m512i __C, // __m512i __D, const int __E) // { // return (__m512i) __builtin_ia32_vgf2p8affineqb_v64qi_mask ((__v64qi) __C, // (__v64qi) __D, __E, (__v64qi)__A, __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_maskz_gf2p8affine_epi64_epi8 (__mmask64 __A, __m512i __B, __m512i __C, // const int __D) // { // return (__m512i) __builtin_ia32_vgf2p8affineqb_v64qi_mask ((__v64qi) __B, // (__v64qi) __C, __D, (__v64qi) _mm512_setzero_si512 (), __A); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_gf2p8affine_epi64_epi8 (__m512i __A, __m512i __B, const int __C) // { // return (__m512i) __builtin_ia32_vgf2p8affineqb_v64qi ((__v64qi) __A, // (__v64qi) __B, __C); // } // #else // #define _mm512_mask_gf2p8affineinv_epi64_epi8(A, B, C, D, E) \ // ((__m512i) __builtin_ia32_vgf2p8affineinvqb_v64qi_mask( \ // (__v64qi)(__m512i)(C), (__v64qi)(__m512i)(D), (int)(E), \ // (__v64qi)(__m512i)(A), (__mmask64)(B))) // #define _mm512_maskz_gf2p8affineinv_epi64_epi8(A, B, C, D) \ // ((__m512i) __builtin_ia32_vgf2p8affineinvqb_v64qi_mask( \ // (__v64qi)(__m512i)(B), (__v64qi)(__m512i)(C), (int)(D), \ // (__v64qi)(__m512i) _mm512_setzero_si512 (), (__mmask64)(A))) // #define _mm512_gf2p8affineinv_epi64_epi8(A, B, C) \ // ((__m512i) __builtin_ia32_vgf2p8affineinvqb_v64qi ( \ // (__v64qi)(__m512i)(A), (__v64qi)(__m512i)(B), (int)(C))) // #define _mm512_mask_gf2p8affine_epi64_epi8(A, B, C, D, E) \ // ((__m512i) __builtin_ia32_vgf2p8affineqb_v64qi_mask((__v64qi)(__m512i)(C),\ // (__v64qi)(__m512i)(D), (int)(E), (__v64qi)(__m512i)(A), (__mmask64)(B))) // #define _mm512_maskz_gf2p8affine_epi64_epi8(A, B, C, D) \ // ((__m512i) __builtin_ia32_vgf2p8affineqb_v64qi_mask((__v64qi)(__m512i)(B),\ // (__v64qi)(__m512i)(C), (int)(D), \ // (__v64qi)(__m512i) _mm512_setzero_si512 (), (__mmask64)(A))) // #define _mm512_gf2p8affine_epi64_epi8(A, B, C) \ // ((__m512i) __builtin_ia32_vgf2p8affineqb_v64qi ((__v64qi)(__m512i)(A), \ // (__v64qi)(__m512i)(B), (int)(C))) // #endif #ifdef __DISABLE_GFNIAVX512FBW__ #undef __DISABLE_GFNIAVX512FBW__ #pragma GCC pop_options #endif /* __GFNIAVX512FBW__ */ #endif /* _GFNIINTRIN_H_INCLUDED */ chibicc-1.0.24/include/ia32intrin.h000066400000000000000000000173011517770275000167550ustar00rootroot00000000000000/* Copyright (C) 2009-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _X86INTRIN_H_INCLUDED # error "Never use directly; include instead." #endif /* 32bit bsf */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __bsfd (int __X) { return __builtin_ctz (__X); } /* 32bit bsr */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __bsrd (int __X) { return __builtin_ia32_bsrsi (__X); } /* 32bit bswap */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __bswapd (int __X) { return __builtin_bswap32 (__X); } #ifndef __iamcu__ #ifndef __SSE4_2__ #pragma GCC push_options #pragma GCC target("sse4.2") #define __DISABLE_SSE4_2__ #endif /* __SSE4_2__ */ /* 32bit accumulate CRC32 (polynomial 0x11EDC6F41) value. */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __crc32b (unsigned int __C, unsigned char __V) { return __builtin_ia32_crc32qi (__C, __V); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __crc32w (unsigned int __C, unsigned short __V) { return __builtin_ia32_crc32hi (__C, __V); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __crc32d (unsigned int __C, unsigned int __V) { return __builtin_ia32_crc32si (__C, __V); } #ifdef __DISABLE_SSE4_2__ #undef __DISABLE_SSE4_2__ #pragma GCC pop_options #endif /* __DISABLE_SSE4_2__ */ #endif /* __iamcu__ */ /* 32bit popcnt */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __popcntd (unsigned int __X) { return __builtin_popcount (__X); } #ifndef __iamcu__ /* rdpmc */ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rdpmc (int __S) { return __builtin_ia32_rdpmc (__S); } #endif /* __iamcu__ */ /* rdtsc */ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rdtsc (void) { return __builtin_ia32_rdtsc (); } #ifndef __iamcu__ /* rdtscp */ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rdtscp (unsigned int *__A) { return __builtin_ia32_rdtscp (__A); } #endif /* __iamcu__ */ /* 8bit rol */ extern __inline unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rolb (unsigned char __X, int __C) { return __builtin_ia32_rolqi (__X, __C); } /* 16bit rol */ extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rolw (unsigned short __X, int __C) { return __builtin_ia32_rolhi (__X, __C); } /* 32bit rol */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rold (unsigned int __X, int __C) { __C &= 31; return (__X << __C) | (__X >> (-__C & 31)); } /* 8bit ror */ extern __inline unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rorb (unsigned char __X, int __C) { return __builtin_ia32_rorqi (__X, __C); } /* 16bit ror */ extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rorw (unsigned short __X, int __C) { return __builtin_ia32_rorhi (__X, __C); } /* 32bit ror */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rord (unsigned int __X, int __C) { __C &= 31; return (__X >> __C) | (__X << (-__C & 31)); } /* Pause */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __pause (void) { __builtin_ia32_pause (); } #ifdef __x86_64__ /* 64bit bsf */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __bsfq (long long __X) { return __builtin_ctzll (__X); } /* 64bit bsr */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __bsrq (long long __X) { return __builtin_ia32_bsrdi (__X); } /* 64bit bswap */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __bswapq (long long __X) { return __builtin_bswap64 (__X); } #ifndef __SSE4_2__ #pragma GCC push_options #pragma GCC target("sse4.2") #define __DISABLE_SSE4_2__ #endif /* __SSE4_2__ */ /* 64bit accumulate CRC32 (polynomial 0x11EDC6F41) value. */ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __crc32q (unsigned long long __C, unsigned long long __V) { return __builtin_ia32_crc32di (__C, __V); } #ifdef __DISABLE_SSE4_2__ #undef __DISABLE_SSE4_2__ #pragma GCC pop_options #endif /* __DISABLE_SSE4_2__ */ /* 64bit popcnt */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __popcntq (unsigned long long __X) { return __builtin_popcountll (__X); } /* 64bit rol */ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rolq (unsigned long long __X, int __C) { __C &= 63; return (__X << __C) | (__X >> (-__C & 63)); } /* 64bit ror */ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rorq (unsigned long long __X, int __C) { __C &= 63; return (__X >> __C) | (__X << (-__C & 63)); } /* Read flags register */ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __readeflags (void) { return __builtin_ia32_readeflags_u64 (); } /* Write flags register */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __writeeflags (unsigned long long __X) { __builtin_ia32_writeeflags_u64 (__X); } #define _bswap64(a) __bswapq(a) #define _popcnt64(a) __popcntq(a) #else /* Read flags register */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __readeflags (void) { return __builtin_ia32_readeflags_u32 (); } /* Write flags register */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __writeeflags (unsigned int __X) { __builtin_ia32_writeeflags_u32 (__X); } #endif /* On LP64 systems, longs are 64-bit. Use the appropriate rotate * function. */ #ifdef __LP64__ #define _lrotl(a,b) __rolq((a), (b)) #define _lrotr(a,b) __rorq((a), (b)) #else #define _lrotl(a,b) __rold((a), (b)) #define _lrotr(a,b) __rord((a), (b)) #endif #define _bit_scan_forward(a) __bsfd(a) #define _bit_scan_reverse(a) __bsrd(a) #define _bswap(a) __bswapd(a) #define _popcnt32(a) __popcntd(a) #ifndef __iamcu__ #define _rdpmc(a) __rdpmc(a) #define _rdtscp(a) __rdtscp(a) #endif /* __iamcu__ */ #define _rdtsc() __rdtsc() #define _rotwl(a,b) __rolw((a), (b)) #define _rotwr(a,b) __rorw((a), (b)) #define _rotl(a,b) __rold((a), (b)) #define _rotr(a,b) __rord((a), (b)) chibicc-1.0.24/include/immintrin.h000066400000000000000000000152221517770275000170010ustar00rootroot00000000000000/* Copyright (C) 2008-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #define _IMMINTRIN_H_INCLUDED #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _wbinvd (void) { __builtin_ia32_wbinvd (); } #ifndef __RDRND__ #pragma GCC push_options #pragma GCC target("rdrnd") #define __DISABLE_RDRND__ #endif /* __RDRND__ */ // extern __inline int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _rdrand16_step (unsigned short *__P) // { // return __builtin_ia32_rdrand16_step (__P); // } // extern __inline int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _rdrand32_step (unsigned int *__P) // { // return __builtin_ia32_rdrand32_step (__P); // } #ifdef __DISABLE_RDRND__ #undef __DISABLE_RDRND__ #pragma GCC pop_options #endif /* __DISABLE_RDRND__ */ #ifndef __RDPID__ #pragma GCC push_options #pragma GCC target("rdpid") #define __DISABLE_RDPID__ #endif /* __RDPID__ */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _rdpid_u32 (void) { return __builtin_ia32_rdpid (); } #ifdef __DISABLE_RDPID__ #undef __DISABLE_RDPID__ #pragma GCC pop_options #endif /* __DISABLE_RDPID__ */ #ifdef __x86_64__ #ifndef __FSGSBASE__ #pragma GCC push_options #pragma GCC target("fsgsbase") #define __DISABLE_FSGSBASE__ #endif /* __FSGSBASE__ */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _readfsbase_u32 (void) { return __builtin_ia32_rdfsbase32 (); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _readfsbase_u64 (void) { return __builtin_ia32_rdfsbase64 (); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _readgsbase_u32 (void) { return __builtin_ia32_rdgsbase32 (); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _readgsbase_u64 (void) { return __builtin_ia32_rdgsbase64 (); } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _writefsbase_u32 (unsigned int __B) // { // __builtin_ia32_wrfsbase32 (__B); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _writefsbase_u64 (unsigned long long __B) // { // __builtin_ia32_wrfsbase64 (__B); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _writegsbase_u32 (unsigned int __B) // { // __builtin_ia32_wrgsbase32 (__B); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _writegsbase_u64 (unsigned long long __B) // { // __builtin_ia32_wrgsbase64 (__B); // } #ifdef __DISABLE_FSGSBASE__ #undef __DISABLE_FSGSBASE__ #pragma GCC pop_options #endif /* __DISABLE_FSGSBASE__ */ #ifndef __RDRND__ #pragma GCC push_options #pragma GCC target("rdrnd") #define __DISABLE_RDRND__ #endif /* __RDRND__ */ // extern __inline int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _rdrand64_step (unsigned long long *__P) // { // return __builtin_ia32_rdrand64_step (__P); // } #ifdef __DISABLE_RDRND__ #undef __DISABLE_RDRND__ #pragma GCC pop_options #endif /* __DISABLE_RDRND__ */ #endif /* __x86_64__ */ #ifndef __PTWRITE__ #pragma GCC push_options #pragma GCC target("ptwrite") #define __DISABLE_PTWRITE__ #endif // #ifdef __x86_64__ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _ptwrite64 (unsigned long long __B) // { // __builtin_ia32_ptwrite64 (__B); // } // #endif /* __x86_64__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _ptwrite32 (unsigned __B) // { // __builtin_ia32_ptwrite32 (__B); // } #ifdef __DISABLE_PTWRITE__ #undef __DISABLE_PTWRITE__ #pragma GCC pop_options #endif /* __DISABLE_PTWRITE__ */ #endif /* _IMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/limits.h000066400000000000000000000160551517770275000163010ustar00rootroot00000000000000/* Copyright (C) 1991-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types */ #ifndef _LIBC_LIMITS_H_ #define _LIBC_LIMITS_H_ 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include /* Maximum length of any multibyte character in any locale. We define this value here since the gcc header does not define the correct value. */ #define MB_LEN_MAX 16 /* Limits of integral types */ #define CHAR_BIT 8 /* Number of bits in a char */ #define SCHAR_MIN (-128) /* Minimum value of a signed char */ #define SCHAR_MAX 127 /* Maximum value of a signed char */ #define UCHAR_MAX 255 /* Maximum value of an unsigned char */ #define CHAR_MIN SCHAR_MIN /* Minimum value of a char */ #define CHAR_MAX SCHAR_MAX /* Maximum value of a char */ #define SHRT_MIN (-32768) /* Minimum value of a short int */ #define SHRT_MAX 32767 /* Maximum value of a short int */ #define USHRT_MAX 65535 /* Maximum value of an unsigned short int */ #define INT_MIN (-2147483648) /* Minimum value of an int */ #define INT_MAX 2147483647 /* Maximum value of an int */ #define UINT_MAX 4294967295U /* Maximum value of an unsigned int */ #define LONG_MIN (-9223372036854775808L) /* Minimum value of a long int */ #define LONG_MAX 9223372036854775807L /* Maximum value of a long int */ #define ULONG_MAX 18446744073709551615UL /* Maximum value of an unsigned long int */ /* Limits of other types */ #define LLONG_MIN (-9223372036854775808LL) /* Minimum value of a long long int */ #define LLONG_MAX 9223372036854775807LL /* Maximum value of a long long int */ #define ULLONG_MAX 18446744073709551615ULL /* Maximum value of an unsigned long long int */ /* If we are not using GNU CC we have to define all the symbols ourself. Otherwise use gcc's definitions (see below). */ #if !defined __GNUC__ || __GNUC__ < 2 /* We only protect from multiple inclusion here, because all the other #include's protect themselves, and in GCC 2 we may #include_next through multiple copies of this file before we get to GCC's. */ # ifndef _LIMITS_H # define _LIMITS_H 1 #include /* We don't have #include_next. Define ANSI for standard 32-bit words. */ /* These assume 8-bit `char's, 16-bit `short int's, and 32-bit `int's and `long int's. */ /* Number of bits in a `char'. */ # define CHAR_BIT 8 /* Minimum and maximum values a `signed char' can hold. */ # define SCHAR_MIN (-128) # define SCHAR_MAX 127 /* Maximum value an `unsigned char' can hold. (Minimum is 0.) */ # define UCHAR_MAX 255 /* Minimum and maximum values a `char' can hold. */ # ifdef __CHAR_UNSIGNED__ # define CHAR_MIN 0 # define CHAR_MAX UCHAR_MAX # else # define CHAR_MIN SCHAR_MIN # define CHAR_MAX SCHAR_MAX # endif /* Minimum and maximum values a `signed short int' can hold. */ # define SHRT_MIN (-32768) # define SHRT_MAX 32767 /* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */ # define USHRT_MAX 65535 /* Minimum and maximum values a `signed int' can hold. */ # define INT_MIN (-INT_MAX - 1) # define INT_MAX 2147483647 /* Maximum value an `unsigned int' can hold. (Minimum is 0.) */ # define UINT_MAX 4294967295U /* Minimum and maximum values a `signed long int' can hold. */ # if __WORDSIZE == 64 # define LONG_MAX 9223372036854775807L # else # define LONG_MAX 2147483647L # endif # define LONG_MIN (-LONG_MAX - 1L) /* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */ # if __WORDSIZE == 64 # define ULONG_MAX 18446744073709551615UL # else # define ULONG_MAX 4294967295UL # endif # ifdef __USE_ISOC99 /* Minimum and maximum values a `signed long long int' can hold. */ # define LLONG_MAX 9223372036854775807LL # define LLONG_MIN (-LLONG_MAX - 1LL) /* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */ # define ULLONG_MAX 18446744073709551615ULL # endif /* ISO C99 */ # endif /* limits.h */ #endif /* GCC 2. */ #endif /* !_LIBC_LIMITS_H_ */ /* Get the compiler's limits.h, which defines almost all the ISO constants. We put this #include_next outside the double inclusion check because it should be possible to include this file more than once and still get the definitions from gcc's header. */ // #if defined __GNUC__ && !defined _GCC_LIMITS_H_ // /* `_GCC_LIMITS_H_' is what GCC's file defines. */ // # include_next // #endif /* The files in some gcc versions don't define LLONG_MIN, LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for ages are available. */ #if defined __USE_ISOC99 && defined __GNUC__ # ifndef LLONG_MIN # define LLONG_MIN (-LLONG_MAX-1) # endif # ifndef LLONG_MAX # define LLONG_MAX __LONG_LONG_MAX__ # endif # ifndef ULLONG_MAX # define ULLONG_MAX (LLONG_MAX * 2ULL + 1) # endif #endif /* The integer width macros are not defined by GCC's before GCC 7, or if _GNU_SOURCE rather than __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature. */ #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) # ifndef CHAR_WIDTH # define CHAR_WIDTH 8 # endif # ifndef SCHAR_WIDTH # define SCHAR_WIDTH 8 # endif # ifndef UCHAR_WIDTH # define UCHAR_WIDTH 8 # endif # ifndef SHRT_WIDTH # define SHRT_WIDTH 16 # endif # ifndef USHRT_WIDTH # define USHRT_WIDTH 16 # endif # ifndef INT_WIDTH # define INT_WIDTH 32 # endif # ifndef UINT_WIDTH # define UINT_WIDTH 32 # endif # ifndef LONG_WIDTH # define LONG_WIDTH __WORDSIZE # endif # ifndef ULONG_WIDTH # define ULONG_WIDTH __WORDSIZE # endif # ifndef LLONG_WIDTH # define LLONG_WIDTH 64 # endif # ifndef ULLONG_WIDTH # define ULLONG_WIDTH 64 # endif #endif /* Use IEC_60559_BFP_EXT. */ /* The macros for _Bool are not defined by GCC's before GCC 11, or if _GNU_SOURCE is defined rather than enabling C2x support with -std. */ #if __GLIBC_USE (ISOC2X) # ifndef BOOL_MAX # define BOOL_MAX 1 # endif # ifndef BOOL_WIDTH # define BOOL_WIDTH 1 # endif #endif #ifdef __USE_POSIX /* POSIX adds things to . */ # include #endif #ifdef __USE_POSIX2 # include #endif #ifdef __USE_XOPEN # include #endifchibicc-1.0.24/include/lwpintrin.h000066400000000000000000000067661517770275000170360ustar00rootroot00000000000000/* Copyright (C) 2007-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _X86INTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _LWPINTRIN_H_INCLUDED #define _LWPINTRIN_H_INCLUDED #ifndef __LWP__ #pragma GCC push_options #pragma GCC target("lwp") #define __DISABLE_LWP__ #endif /* __LWP__ */ // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __llwpcb (void *__pcbAddress) // { // __builtin_ia32_llwpcb (__pcbAddress); // } // extern __inline void * __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __slwpcb (void) // { // return __builtin_ia32_slwpcb (); // } // #ifdef __OPTIMIZE__ // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __lwpval32 (unsigned int __data2, unsigned int __data1, unsigned int __flags) // { // __builtin_ia32_lwpval32 (__data2, __data1, __flags); // } // #ifdef __x86_64__ // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __lwpval64 (unsigned long long __data2, unsigned int __data1, // unsigned int __flags) // { // __builtin_ia32_lwpval64 (__data2, __data1, __flags); // } // #endif // #else // #define __lwpval32(D2, D1, F) \ // (__builtin_ia32_lwpval32 ((unsigned int) (D2), (unsigned int) (D1), \ // (unsigned int) (F))) // #ifdef __x86_64__ // #define __lwpval64(D2, D1, F) \ // (__builtin_ia32_lwpval64 ((unsigned long long) (D2), (unsigned int) (D1), \ // (unsigned int) (F))) // #endif // #endif // #ifdef __OPTIMIZE__ // extern __inline unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __lwpins32 (unsigned int __data2, unsigned int __data1, unsigned int __flags) // { // return __builtin_ia32_lwpins32 (__data2, __data1, __flags); // } // #ifdef __x86_64__ // extern __inline unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __lwpins64 (unsigned long long __data2, unsigned int __data1, // unsigned int __flags) // { // return __builtin_ia32_lwpins64 (__data2, __data1, __flags); // } // #endif // #else // #define __lwpins32(D2, D1, F) \ // (__builtin_ia32_lwpins32 ((unsigned int) (D2), (unsigned int) (D1), \ // (unsigned int) (F))) // #ifdef __x86_64__ // #define __lwpins64(D2, D1, F) \ // (__builtin_ia32_lwpins64 ((unsigned long long) (D2), (unsigned int) (D1), \ // (unsigned int) (F))) // #endif // #endif #ifdef __DISABLE_LWP__ #undef __DISABLE_LWP__ #pragma GCC pop_options #endif /* __DISABLE_LWP__ */ #endif /* _LWPINTRIN_H_INCLUDED */ chibicc-1.0.24/include/lzcntintrin.h000066400000000000000000000046571517770275000173630ustar00rootroot00000000000000/* Copyright (C) 2009-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _LZCNTINTRIN_H_INCLUDED #define _LZCNTINTRIN_H_INCLUDED #ifndef __LZCNT__ #pragma GCC push_options #pragma GCC target("lzcnt") #define __DISABLE_LZCNT__ #endif /* __LZCNT__ */ // extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __lzcnt16 (unsigned short __X) // { // return __builtin_ia32_lzcnt_u16 (__X); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __lzcnt32 (unsigned int __X) // { // return __builtin_ia32_lzcnt_u32 (__X); // } // extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _lzcnt_u32 (unsigned int __X) // { // return __builtin_ia32_lzcnt_u32 (__X); // } // #ifdef __x86_64__ // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // __lzcnt64 (unsigned long long __X) // { // return __builtin_ia32_lzcnt_u64 (__X); // } // extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _lzcnt_u64 (unsigned long long __X) // { // return __builtin_ia32_lzcnt_u64 (__X); // } // #endif #ifdef __DISABLE_LZCNT__ #undef __DISABLE_LZCNT__ #pragma GCC pop_options #endif /* __DISABLE_LZCNT__ */ #endif /* _LZCNTINTRIN_H_INCLUDED */ chibicc-1.0.24/include/math.h000066400000000000000000000142721517770275000157300ustar00rootroot00000000000000#ifndef CHIBICC_MATH_H #define CHIBICC_MATH_H // Trigonometric functions double sin(double x); double cos(double x); double tan(double x); double asin(double x); double acos(double x); double atan(double x); double atan2(double y, double x); int isunordered(double x, double y); #define isunordered(x, y) __builtin_isunordered(x, y) #define signbit(x) __builtin_signbit(x) #define signbitf(x) __builtin_signbit(x) #define signbitl(x) __builtin_signbit(x) // Hyperbolic functions double sinh(double x); double cosh(double x); double tanh(double x); long double tanhl(long double x); long double coshl(long double x); long double sinhl(long double x); // Exponential and logarithmic functions double exp(double x); double frexp(double x, int *exp); double ldexp(double x, int exp); double log(double x); double log10(double x); double modf(double x, double *iptr); float expf(float); long double expl(long double); extern float powf(float x, float y); extern double pow(double x, double y); extern long double powl(long double x, long double y); extern float log10f(float x); extern double log10(double x); extern long double log10l(long double x); extern long lroundf(float x); extern long lround(double x); extern long lroundl(long double x); // Power and absolute-value functions double pow(double x, double y); double sqrt(double x); double fabs(double x); double fmod(double x, double y); float sqrtf(float); long double sqrtl(long double); float fabsf(float x); long double fabsl(long double x); double cbrt(double x); float cbrtf(float x); long double cbrtl(long double x); double asinh(double x); float asinhf(float x); long double asinhl(long double x); double acosh(double x); float acoshf(float x); long double acoshl(long double x); double atanh(double x); float atanhf(float x); long double atanhl(long double x); double erf(double x); float erff(float x); long double erfl(long double x); double erfc(double x); float erfcf(float x); long double erfcl(long double x); double tgamma(double x); float tgammaf(float x); long double tgammal(long double x); double lgamma(double x); float lgammaf(float x); long double lgammal(long double x); double log1p(double); float log1pf(float); long double log1pl(long double); extern float fmodf(float x, float y); extern long double fmodl(long double x, long double y); extern long long llroundl(long double x); extern long long llround(double x); extern long long llroundf(float x); extern long long llrintl(long double x); extern long long llrint(double x); extern long long llrintf(float x); extern float roundf(float x); extern double round(double x); extern long double roundl(long double x); static inline int isless(double x, double y) { return x < y; } static inline int isgreater(double x, double y){ return x > y; } static inline int islessequal(double x, double y) { return x <= y; } static inline int isgreaterequal(double x, double y) { return x >= y; } static inline int islessf(float x, float y) { return x < y; } static inline int isgreaterf(float x, float y){ return x > y; } static inline int islessequalf(float x, float y) { return x <= y; } static inline int isgreaterequalf(float x, float y) { return x >= y; } extern float sinf(float x); extern float cosf(float x); extern float tanf(float x); extern float asinf(float x); extern float acosf(float x); extern float atanf(float x); extern float atan2f(float y, float x); float floorf(float); float ldexpf(float x, int exp); long double sinl(long double); long double cosl(long double); long double tanl(long double); long double asinl(long double); long double acosl(long double); long double atanl(long double); long double atan2l(long double y, long double x); long double logl(long double x); long double ldexpl(long double x, int exp); // Rounding and remainder double floor(double x); double ceil(double x); double trunc(double x); double round(double x); double nearbyint(double x); double rint(double x); long double floorl(long double); long double ceill(long double); double fma(double x, double y, double z); // fused multiply-add (optional, used in numerics) double copysign(double x, double y); // result has magnitude of x and sign of y double hypot(double x, double y); // sqrt(x*x + y*y) double log2(double x); // base-2 log double exp2(double x); // base-2 exponent double fmax(double x, double y); float fmaxf(float x, float y); long double fmaxl(long double x, long double y); double fmin(double x, double y); float fminf(float x, float y); long double fminl(long double x, long double y); double nextafter(double x, double y); float nextafterf(float x, float y); long double nextafterl(long double x, long double y); float nanf(const char *tagp); double expm1(double x); float expm1f(float x); long double expm1l(long double x); int isnormal(double x); // non-zero and not subnormal #define isnormal(x) ((fpclassify(x) == FP_NORMAL)) // Classification extern int __isnan(double __value); extern int __isinf(double __value); extern int __finite(double __value); // Add missing standard macros #define isnan(x) __isnan(x) #define isinf(x) __isinf(x) #define isfinite(x) __finite(x) #define fpclassify(x) \ __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x) // Constants #define HUGE_VAL (__builtin_huge_val()) #define HUGE_VALF (__builtin_huge_valf()) #define HUGE_VALL (__builtin_huge_vall()) #define NAN (__builtin_nan("")) #define INFINITY (__builtin_inff()) #define M_E 2.71828182845904523536 #define M_LOG2E 1.44269504088896340736 #define M_LOG10E 0.43429448190325182765 #define M_LN2 0.69314718055994530942 #define M_LN10 2.30258509299404568402 #define M_PI 3.14159265358979323846 #define M_PI_2 1.57079632679489661923 #define M_PI_4 0.78539816339744830962 #define M_1_PI 0.31830988618379067154 #define M_2_PI 0.63661977236758134308 #define M_2_SQRTPI 1.12837916709551257390 #define M_SQRT2 1.41421356237309504880 #define M_SQRT1_2 0.70710678118654752440 #define FP_INFINITE 1 #define FP_NAN 2 #define FP_NORMAL 3 #define FP_SUBNORMAL 4 #define FP_ZERO 5 typedef float float_t; typedef double double_t; #endif // CHIBICC_MATH_H chibicc-1.0.24/include/mm3dnow.h000066400000000000000000000165461517770275000163710ustar00rootroot00000000000000/* Copyright (C) 2004-2023 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the mm3dnow.h (of supposedly AMD origin) included with MSVC 7.1. */ #ifndef _MM3DNOW_H_INCLUDED #define _MM3DNOW_H_INCLUDED #include #include #if defined __x86_64__ && !defined __SSE__ || !defined __3dNOW__ #pragma GCC push_options #ifdef __x86_64__ #pragma GCC target("sse,3dnow") #else #pragma GCC target("3dnow") #endif #define __DISABLE_3dNOW__ #endif /* __3dNOW__ */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_femms (void) { __builtin_ia32_femms(); } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pavgusb (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pavgusb ((__v8qi)__A, (__v8qi)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pf2id (__m64 __A) // { // return (__m64)__builtin_ia32_pf2id ((__v2sf)__A); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfacc (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfacc ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfadd (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfadd ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfcmpeq (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfcmpeq ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfcmpge (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfcmpge ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfcmpgt (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfcmpgt ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfmax (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfmax ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfmin (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfmin ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfmul (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfmul ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfrcp (__m64 __A) // { // return (__m64)__builtin_ia32_pfrcp ((__v2sf)__A); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfrcpit1 (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfrcpit1 ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfrcpit2 (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfrcpit2 ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfrsqrt (__m64 __A) // { // return (__m64)__builtin_ia32_pfrsqrt ((__v2sf)__A); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfrsqit1 (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfrsqit1 ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfsub (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfsub ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfsubr (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfsubr ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pi2fd (__m64 __A) // { // return (__m64)__builtin_ia32_pi2fd ((__v2si)__A); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pmulhrw (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pmulhrw ((__v4hi)__A, (__v4hi)__B); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_prefetch (void *__P) // { // __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_from_float (float __A) // { // return __extension__ (__m64)(__v2sf){ __A, 0.0f }; // } // extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_to_float (__m64 __A) // { // union { __v2sf v; float a[2]; } __tmp; // __tmp.v = (__v2sf)__A; // return __tmp.a[0]; // } // #ifdef __DISABLE_3dNOW__ // #undef __DISABLE_3dNOW__ // #pragma GCC pop_options // #endif /* __DISABLE_3dNOW__ */ // #if defined __x86_64__ && !defined __SSE__ || !defined __3dNOW_A__ // #pragma GCC push_options // #ifdef __x86_64__ // #pragma GCC target("sse,3dnowa") // #else // #pragma GCC target("3dnowa") // #endif // #define __DISABLE_3dNOW_A__ // #endif /* __3dNOW_A__ */ // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pf2iw (__m64 __A) // { // return (__m64)__builtin_ia32_pf2iw ((__v2sf)__A); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfnacc (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfnacc ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pfpnacc (__m64 __A, __m64 __B) // { // return (__m64)__builtin_ia32_pfpnacc ((__v2sf)__A, (__v2sf)__B); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pi2fw (__m64 __A) // { // return (__m64)__builtin_ia32_pi2fw ((__v2si)__A); // } // extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _m_pswapd (__m64 __A) // { // return (__m64)__builtin_ia32_pswapdsf ((__v2sf)__A); // } #ifdef __DISABLE_3dNOW_A__ #undef __DISABLE_3dNOW_A__ #pragma GCC pop_options #endif /* __DISABLE_3dNOW_A__ */ #endif /* _MM3DNOW_H_INCLUDED */ chibicc-1.0.24/include/mm_malloc.h000066400000000000000000000033661517770275000167410ustar00rootroot00000000000000/* Copyright (C) 2004-2021 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _MM_MALLOC_H_INCLUDED #define _MM_MALLOC_H_INCLUDED #include /* We can't depend on since the prototype of posix_memalign may not be visible. */ #ifndef __cplusplus extern int posix_memalign (void **, size_t, size_t); #else extern "C" int posix_memalign (void **, size_t, size_t) throw (); #endif static __inline void * _mm_malloc (size_t __size, size_t __alignment) { void *__ptr; if (__alignment == 1) return malloc (__size); if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4)) __alignment = sizeof (void *); if (posix_memalign (&__ptr, __alignment, __size) == 0) return __ptr; else return NULL; } static __inline void _mm_free (void *__ptr) { free (__ptr); } #endif /* _MM_MALLOC_H_INCLUDED */ chibicc-1.0.24/include/mmintrin.h000066400000000000000000000754641517770275000166460ustar00rootroot00000000000000/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 9.0. */ #ifndef _MMINTRIN_H_INCLUDED #define _MMINTRIN_H_INCLUDED #if defined __x86_64__ && !defined __SSE__ || !defined __MMX__ #pragma GCC push_options #ifdef __MMX_WITH_SSE__ #pragma GCC target("sse2") #elif defined __x86_64__ #pragma GCC target("sse,mmx") #else #pragma GCC target("mmx") #endif #define __DISABLE_MMX__ #endif /* __MMX__ */ /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); /* Unaligned version of the same type */ typedef int __m64_u __attribute__ ((__vector_size__ (8), __may_alias__, __aligned__ (1))); /* Internal data types for implementing the intrinsics. */ typedef int __v2si __attribute__ ((__vector_size__ (8))); typedef short __v4hi __attribute__ ((__vector_size__ (8))); typedef char __v8qi __attribute__ ((__vector_size__ (8))); typedef long long __v1di __attribute__ ((__vector_size__ (8))); typedef float __v2sf __attribute__ ((__vector_size__ (8))); /* Empty the multimedia state. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_empty (void) { __builtin_ia32_emms (); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_empty (void) { _mm_empty (); } /* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi32_si64 (int __i) { return (__m64) __builtin_ia32_vec_init_v2si (__i, 0); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_from_int (int __i) { return _mm_cvtsi32_si64 (__i); } #ifdef __x86_64__ /* Convert I to a __m64 object. */ /* Intel intrinsic. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_from_int64 (long long __i) { return (__m64) __i; } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi64_m64 (long long __i) { return (__m64) __i; } /* Microsoft intrinsic. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi64x_si64 (long long __i) { return (__m64) __i; } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pi64x (long long __i) { return (__m64) __i; } #endif /* Convert the lower 32 bits of the __m64 object into an integer. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi64_si32 (__m64 __i) { return __builtin_ia32_vec_ext_v2si ((__v2si)__i, 0); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_to_int (__m64 __i) { return _mm_cvtsi64_si32 (__i); } #ifdef __x86_64__ /* Convert the __m64 object to a 64bit integer. */ /* Intel intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_to_int64 (__m64 __i) { return (long long)__i; } extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtm64_si64 (__m64 __i) { return (long long)__i; } /* Microsoft intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi64_si64x (__m64 __i) { return (long long)__i; } #endif /* Pack the four 16-bit values from M1 into the lower four 8-bit values of the result, and the four 16-bit values from M2 into the upper four 8-bit values of the result, all with signed saturation. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_packs_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_packsswb ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_packsswb (__m64 __m1, __m64 __m2) { return _mm_packs_pi16 (__m1, __m2); } /* Pack the two 32-bit values from M1 in to the lower two 16-bit values of the result, and the two 32-bit values from M2 into the upper two 16-bit values of the result, all with signed saturation. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_packs_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_packssdw ((__v2si)__m1, (__v2si)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_packssdw (__m64 __m1, __m64 __m2) { return _mm_packs_pi32 (__m1, __m2); } /* Pack the four 16-bit values from M1 into the lower four 8-bit values of the result, and the four 16-bit values from M2 into the upper four 8-bit values of the result, all with unsigned saturation. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_packs_pu16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_packuswb ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_packuswb (__m64 __m1, __m64 __m2) { return _mm_packs_pu16 (__m1, __m2); } /* Interleave the four 8-bit values from the high half of M1 with the four 8-bit values from the high half of M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpckhbw ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_punpckhbw (__m64 __m1, __m64 __m2) { return _mm_unpackhi_pi8 (__m1, __m2); } /* Interleave the two 16-bit values from the high half of M1 with the two 16-bit values from the high half of M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpckhwd ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_punpckhwd (__m64 __m1, __m64 __m2) { return _mm_unpackhi_pi16 (__m1, __m2); } /* Interleave the 32-bit value from the high half of M1 with the 32-bit value from the high half of M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpckhdq ((__v2si)__m1, (__v2si)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_punpckhdq (__m64 __m1, __m64 __m2) { return _mm_unpackhi_pi32 (__m1, __m2); } /* Interleave the four 8-bit values from the low half of M1 with the four 8-bit values from the low half of M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpcklbw ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_punpcklbw (__m64 __m1, __m64 __m2) { return _mm_unpacklo_pi8 (__m1, __m2); } /* Interleave the two 16-bit values from the low half of M1 with the two 16-bit values from the low half of M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpcklwd ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_punpcklwd (__m64 __m1, __m64 __m2) { return _mm_unpacklo_pi16 (__m1, __m2); } /* Interleave the 32-bit value from the low half of M1 with the 32-bit value from the low half of M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpckldq ((__v2si)__m1, (__v2si)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_punpckldq (__m64 __m1, __m64 __m2) { return _mm_unpacklo_pi32 (__m1, __m2); } /* Add the 8-bit values in M1 to the 8-bit values in M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddb ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_paddb (__m64 __m1, __m64 __m2) { return _mm_add_pi8 (__m1, __m2); } /* Add the 16-bit values in M1 to the 16-bit values in M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_paddw (__m64 __m1, __m64 __m2) { return _mm_add_pi16 (__m1, __m2); } /* Add the 32-bit values in M1 to the 32-bit values in M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddd ((__v2si)__m1, (__v2si)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_paddd (__m64 __m1, __m64 __m2) { return _mm_add_pi32 (__m1, __m2); } /* Add the 64-bit values in M1 to the 64-bit values in M2. */ #ifndef __SSE2__ #pragma GCC push_options #ifdef __MMX_WITH_SSE__ #pragma GCC target("sse2") #else #pragma GCC target("sse2,mmx") #endif #define __DISABLE_SSE2__ #endif /* __SSE2__ */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_si64 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddq ((__v1di)__m1, (__v1di)__m2); } #ifdef __DISABLE_SSE2__ #undef __DISABLE_SSE2__ #pragma GCC pop_options #endif /* __DISABLE_SSE2__ */ /* Add the 8-bit values in M1 to the 8-bit values in M2 using signed saturated arithmetic. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_adds_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddsb ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_paddsb (__m64 __m1, __m64 __m2) { return _mm_adds_pi8 (__m1, __m2); } /* Add the 16-bit values in M1 to the 16-bit values in M2 using signed saturated arithmetic. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_adds_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddsw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_paddsw (__m64 __m1, __m64 __m2) { return _mm_adds_pi16 (__m1, __m2); } /* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned saturated arithmetic. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_adds_pu8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddusb ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_paddusb (__m64 __m1, __m64 __m2) { return _mm_adds_pu8 (__m1, __m2); } /* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned saturated arithmetic. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_adds_pu16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddusw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_paddusw (__m64 __m1, __m64 __m2) { return _mm_adds_pu16 (__m1, __m2); } /* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubb ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psubb (__m64 __m1, __m64 __m2) { return _mm_sub_pi8 (__m1, __m2); } /* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psubw (__m64 __m1, __m64 __m2) { return _mm_sub_pi16 (__m1, __m2); } /* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubd ((__v2si)__m1, (__v2si)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psubd (__m64 __m1, __m64 __m2) { return _mm_sub_pi32 (__m1, __m2); } /* Add the 64-bit values in M1 to the 64-bit values in M2. */ #ifndef __SSE2__ #pragma GCC push_options #ifdef __MMX_WITH_SSE__ #pragma GCC target("sse2") #else #pragma GCC target("sse2,mmx") #endif #define __DISABLE_SSE2__ #endif /* __SSE2__ */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_si64 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubq ((__v1di)__m1, (__v1di)__m2); } #ifdef __DISABLE_SSE2__ #undef __DISABLE_SSE2__ #pragma GCC pop_options #endif /* __DISABLE_SSE2__ */ /* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed saturating arithmetic. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_subs_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubsb ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psubsb (__m64 __m1, __m64 __m2) { return _mm_subs_pi8 (__m1, __m2); } /* Subtract the 16-bit values in M2 from the 16-bit values in M1 using signed saturating arithmetic. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_subs_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubsw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psubsw (__m64 __m1, __m64 __m2) { return _mm_subs_pi16 (__m1, __m2); } /* Subtract the 8-bit values in M2 from the 8-bit values in M1 using unsigned saturating arithmetic. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_subs_pu8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubusb ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psubusb (__m64 __m1, __m64 __m2) { return _mm_subs_pu8 (__m1, __m2); } /* Subtract the 16-bit values in M2 from the 16-bit values in M1 using unsigned saturating arithmetic. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_subs_pu16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubusw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psubusw (__m64 __m1, __m64 __m2) { return _mm_subs_pu16 (__m1, __m2); } /* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing four 32-bit intermediate results, which are then summed by pairs to produce two 32-bit results. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_madd_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pmaddwd ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pmaddwd (__m64 __m1, __m64 __m2) { return _mm_madd_pi16 (__m1, __m2); } /* Multiply four signed 16-bit values in M1 by four signed 16-bit values in M2 and produce the high 16 bits of the 32-bit results. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mulhi_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pmulhw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pmulhw (__m64 __m1, __m64 __m2) { return _mm_mulhi_pi16 (__m1, __m2); } /* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce the low 16 bits of the results. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mullo_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pmullw (__m64 __m1, __m64 __m2) { return _mm_mullo_pi16 (__m1, __m2); } /* Shift four 16-bit values in M left by COUNT. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sll_pi16 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (__v4hi)__count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psllw (__m64 __m, __m64 __count) { return _mm_sll_pi16 (__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_slli_pi16 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psllwi ((__v4hi)__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psllwi (__m64 __m, int __count) { return _mm_slli_pi16 (__m, __count); } /* Shift two 32-bit values in M left by COUNT. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sll_pi32 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_pslld ((__v2si)__m, (__v2si)__count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pslld (__m64 __m, __m64 __count) { return _mm_sll_pi32 (__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_slli_pi32 (__m64 __m, int __count) { return (__m64) __builtin_ia32_pslldi ((__v2si)__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pslldi (__m64 __m, int __count) { return _mm_slli_pi32 (__m, __count); } /* Shift the 64-bit value in M left by COUNT. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sll_si64 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psllq ((__v1di)__m, (__v1di)__count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psllq (__m64 __m, __m64 __count) { return _mm_sll_si64 (__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_slli_si64 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psllqi ((__v1di)__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psllqi (__m64 __m, int __count) { return _mm_slli_si64 (__m, __count); } /* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sra_pi16 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (__v4hi)__count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psraw (__m64 __m, __m64 __count) { return _mm_sra_pi16 (__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srai_pi16 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psrawi ((__v4hi)__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psrawi (__m64 __m, int __count) { return _mm_srai_pi16 (__m, __count); } /* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sra_pi32 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psrad ((__v2si)__m, (__v2si)__count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psrad (__m64 __m, __m64 __count) { return _mm_sra_pi32 (__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srai_pi32 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psradi ((__v2si)__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psradi (__m64 __m, int __count) { return _mm_srai_pi32 (__m, __count); } /* Shift four 16-bit values in M right by COUNT; shift in zeros. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srl_pi16 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (__v4hi)__count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psrlw (__m64 __m, __m64 __count) { return _mm_srl_pi16 (__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srli_pi16 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psrlwi ((__v4hi)__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psrlwi (__m64 __m, int __count) { return _mm_srli_pi16 (__m, __count); } /* Shift two 32-bit values in M right by COUNT; shift in zeros. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srl_pi32 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psrld ((__v2si)__m, (__v2si)__count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psrld (__m64 __m, __m64 __count) { return _mm_srl_pi32 (__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srli_pi32 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psrldi ((__v2si)__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psrldi (__m64 __m, int __count) { return _mm_srli_pi32 (__m, __count); } /* Shift the 64-bit value in M left by COUNT; shift in zeros. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srl_si64 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psrlq ((__v1di)__m, (__v1di)__count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psrlq (__m64 __m, __m64 __count) { return _mm_srl_si64 (__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srli_si64 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psrlqi ((__v1di)__m, __count); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psrlqi (__m64 __m, int __count) { return _mm_srli_si64 (__m, __count); } /* Bit-wise AND the 64-bit values in M1 and M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_and_si64 (__m64 __m1, __m64 __m2) { return __builtin_ia32_pand (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pand (__m64 __m1, __m64 __m2) { return _mm_and_si64 (__m1, __m2); } /* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the 64-bit value in M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_andnot_si64 (__m64 __m1, __m64 __m2) { return __builtin_ia32_pandn (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pandn (__m64 __m1, __m64 __m2) { return _mm_andnot_si64 (__m1, __m2); } /* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_or_si64 (__m64 __m1, __m64 __m2) { return __builtin_ia32_por (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_por (__m64 __m1, __m64 __m2) { return _mm_or_si64 (__m1, __m2); } /* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_xor_si64 (__m64 __m1, __m64 __m2) { return __builtin_ia32_pxor (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pxor (__m64 __m1, __m64 __m2) { return _mm_xor_si64 (__m1, __m2); } /* Compare eight 8-bit values. The result of the comparison is 0xFF if the test is true and zero if false. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpeqb (__m64 __m1, __m64 __m2) { return _mm_cmpeq_pi8 (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpgtb ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpgtb (__m64 __m1, __m64 __m2) { return _mm_cmpgt_pi8 (__m1, __m2); } /* Compare four 16-bit values. The result of the comparison is 0xFFFF if the test is true and zero if false. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpeqw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpeqw (__m64 __m1, __m64 __m2) { return _mm_cmpeq_pi16 (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpgtw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpgtw (__m64 __m1, __m64 __m2) { return _mm_cmpgt_pi16 (__m1, __m2); } /* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if the test is true and zero if false. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpeqd ((__v2si)__m1, (__v2si)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpeqd (__m64 __m1, __m64 __m2) { return _mm_cmpeq_pi32 (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpgtd (__m64 __m1, __m64 __m2) { return _mm_cmpgt_pi32 (__m1, __m2); } /* Creates a 64-bit zero. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setzero_si64 (void) { return (__m64)0LL; } /* Creates a vector of two 32-bit values; I0 is least significant. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pi32 (int __i1, int __i0) { return (__m64) __builtin_ia32_vec_init_v2si (__i0, __i1); } /* Creates a vector of four 16-bit values; W0 is least significant. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) { return (__m64) __builtin_ia32_vec_init_v4hi (__w0, __w1, __w2, __w3); } /* Creates a vector of eight 8-bit values; B0 is least significant. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, char __b1, char __b0) { return (__m64) __builtin_ia32_vec_init_v8qi (__b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7); } /* Similar, but with the arguments in reverse order. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_pi32 (int __i0, int __i1) { return _mm_set_pi32 (__i1, __i0); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) { return _mm_set_pi16 (__w3, __w2, __w1, __w0); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, char __b6, char __b7) { return _mm_set_pi8 (__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0); } /* Creates a vector of two 32-bit values, both elements containing I. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_pi32 (int __i) { return _mm_set_pi32 (__i, __i); } /* Creates a vector of four 16-bit values, all elements containing W. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_pi16 (short __w) { return _mm_set_pi16 (__w, __w, __w, __w); } /* Creates a vector of eight 8-bit values, all elements containing B. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_pi8 (char __b) { return _mm_set_pi8 (__b, __b, __b, __b, __b, __b, __b, __b); } #ifdef __DISABLE_MMX__ #undef __DISABLE_MMX__ #pragma GCC pop_options #endif /* __DISABLE_MMX__ */ #endif /* _MMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/movdirintrin.h000066400000000000000000000046021517770275000175170ustar00rootroot00000000000000/* Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _MOVDIRINTRIN_H_INCLUDED #define _MOVDIRINTRIN_H_INCLUDED #ifndef __MOVDIRI__ #pragma GCC push_options #pragma GCC target ("movdiri") #define __DISABLE_MOVDIRI__ #endif /* __MOVDIRI__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _directstoreu_u32 (void * __P, unsigned int __A) // { // __builtin_ia32_directstoreu_u32 ((unsigned int *)__P, __A); // } // #ifdef __x86_64__ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _directstoreu_u64 (void * __P, unsigned long long __A) // { // __builtin_ia32_directstoreu_u64 ((unsigned long long *)__P, __A); // } // #endif // #ifdef __DISABLE_MOVDIRI__ // #undef __DISABLE_MOVDIRI__ // #pragma GCC pop_options // #endif /* __DISABLE_MOVDIRI__ */ // #ifndef __MOVDIR64B__ // #pragma GCC push_options // #pragma GCC target ("movdir64b") // #define __DISABLE_MOVDIR64B__ // #endif /* __MOVDIR64B__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _movdir64b (void * __P, const void * __Q) // { // __builtin_ia32_movdir64b (__P, __Q); // } #ifdef __DISABLE_MOVDIR64B__ #undef __DISABLE_MOVDIR64B__ #pragma GCC pop_options #endif /* __DISABLE_MOVDIR64B__ */ #endif /* _MOVDIRINTRIN_H_INCLUDED. */ chibicc-1.0.24/include/mwaitxintrin.h000066400000000000000000000033611517770275000175310ustar00rootroot00000000000000/* Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _MWAITXINTRIN_H_INCLUDED #define _MWAITXINTRIN_H_INCLUDED #ifndef __MWAITX__ #pragma GCC push_options #pragma GCC target("mwaitx") #define __DISABLE_MWAITX__ #endif /* __MWAITX__ */ // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_monitorx (void const * __P, unsigned int __E, unsigned int __H) // { // __builtin_ia32_monitorx (__P, __E, __H); // } // extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_mwaitx (unsigned int __E, unsigned int __H, unsigned int __C) // { // __builtin_ia32_mwaitx (__E, __H, __C); // } #ifdef __DISABLE_MWAITX__ #undef __DISABLE_MWAITX__ #pragma GCC pop_options #endif /* __DISABLE_MWAITX__ */ #endif /* _MWAITXINTRIN_H_INCLUDED */ chibicc-1.0.24/include/nmmintrin.h000066400000000000000000000024101517770275000170010ustar00rootroot00000000000000/* Copyright (C) 2007-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 10.0. */ #ifndef _NMMINTRIN_H_INCLUDED #define _NMMINTRIN_H_INCLUDED /* We just include SSE4.1 header file. */ #include #endif /* _NMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/pconfigintrin.h000066400000000000000000000044541517770275000176510ustar00rootroot00000000000000/* Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _PCONFIGINTRIN_H_INCLUDED #define _PCONFIGINTRIN_H_INCLUDED #ifndef __PCONFIG__ #pragma GCC push_options #pragma GCC target("pconfig") #define __DISABLE_PCONFIG__ #endif /* __PCONFIG__ */ #define __pconfig_b(leaf, b, retval) \ __asm__ __volatile__ ("pconfig\n\t" \ : "=a" (retval) \ : "a" (leaf), "b" (b) \ : "cc") #define __pconfig_generic(leaf, b, c, d, retval) \ __asm__ __volatile__ ("pconfig\n\t" \ : "=a" (retval), "=b" (b), "=c" (c), "=d" (d) \ : "a" (leaf), "b" (b), "c" (c), "d" (d) \ : "cc") extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _pconfig_u32 (const unsigned int __L, size_t __D[]) { enum __pconfig_type { __PCONFIG_KEY_PROGRAM = 0x01, }; unsigned int __R = 0; if (!__builtin_constant_p (__L)) __pconfig_generic (__L, __D[0], __D[1], __D[2], __R); else switch (__L) { case __PCONFIG_KEY_PROGRAM: __pconfig_b (__L, __D[0], __R); break; default: __pconfig_generic (__L, __D[0], __D[1], __D[2], __R); } return __R; } #ifdef __DISABLE_PCONFIG__ #undef __DISABLE_PCONFIG__ #pragma GCC pop_options #endif /* __DISABLE_PCONFIG__ */ #endif /* _PCONFIGINTRIN_H_INCLUDED */ chibicc-1.0.24/include/pkuintrin.h000066400000000000000000000033371517770275000170220ustar00rootroot00000000000000/* Copyright (C) 2015-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _PKUINTRIN_H_INCLUDED #define _PKUINTRIN_H_INCLUDED #ifndef __PKU__ #pragma GCC push_options #pragma GCC target("pku") #define __DISABLE_PKU__ #endif /* __PKU__ */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _rdpkru_u32 (void) { return __builtin_ia32_rdpkru (); } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _wrpkru (unsigned int __key) // { // __builtin_ia32_wrpkru (__key); // } #ifdef __DISABLE_PKU__ #undef __DISABLE_PKU__ #pragma GCC pop_options #endif /* __DISABLE_PKU__ */ #endif /* _PKUINTRIN_H_INCLUDED */ chibicc-1.0.24/include/pmmintrin.h000066400000000000000000000104201517770275000170030ustar00rootroot00000000000000/* Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 9.0. */ #ifndef _PMMINTRIN_H_INCLUDED #define _PMMINTRIN_H_INCLUDED /* We need definitions from the SSE2 and SSE header files*/ #include #ifndef __SSE3__ #pragma GCC push_options #pragma GCC target("sse3") #define __DISABLE_SSE3__ #endif /* __SSE3__ */ /* Additional bits in the MXCSR. */ #define _MM_DENORMALS_ZERO_MASK 0x0040 #define _MM_DENORMALS_ZERO_ON 0x0040 #define _MM_DENORMALS_ZERO_OFF 0x0000 #define _MM_SET_DENORMALS_ZERO_MODE(mode) \ _mm_setcsr ((_mm_getcsr () & ~_MM_DENORMALS_ZERO_MASK) | (mode)) #define _MM_GET_DENORMALS_ZERO_MODE() \ (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK) extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_addsub_ps (__m128 __X, __m128 __Y) { return (__m128) __builtin_ia32_addsubps ((__v4sf)__X, (__v4sf)__Y); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadd_ps (__m128 __X, __m128 __Y) { return (__m128) __builtin_ia32_haddps ((__v4sf)__X, (__v4sf)__Y); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsub_ps (__m128 __X, __m128 __Y) { return (__m128) __builtin_ia32_hsubps ((__v4sf)__X, (__v4sf)__Y); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movehdup_ps (__m128 __X) { return (__m128) __builtin_ia32_movshdup ((__v4sf)__X); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_moveldup_ps (__m128 __X) { return (__m128) __builtin_ia32_movsldup ((__v4sf)__X); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_addsub_pd (__m128d __X, __m128d __Y) { return (__m128d) __builtin_ia32_addsubpd ((__v2df)__X, (__v2df)__Y); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadd_pd (__m128d __X, __m128d __Y) { return (__m128d) __builtin_ia32_haddpd ((__v2df)__X, (__v2df)__Y); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsub_pd (__m128d __X, __m128d __Y) { return (__m128d) __builtin_ia32_hsubpd ((__v2df)__X, (__v2df)__Y); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loaddup_pd (double const *__P) { return _mm_load1_pd (__P); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movedup_pd (__m128d __X) { return _mm_shuffle_pd (__X, __X, _MM_SHUFFLE2 (0,0)); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_lddqu_si128 (__m128i const *__P) { return (__m128i) __builtin_ia32_lddqu ((char const *)__P); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_monitor (void const * __P, unsigned int __E, unsigned int __H) { __builtin_ia32_monitor (__P, __E, __H); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mwait (unsigned int __E, unsigned int __H) { __builtin_ia32_mwait (__E, __H); } #ifdef __DISABLE_SSE3__ #undef __DISABLE_SSE3__ #pragma GCC pop_options #endif /* __DISABLE_SSE3__ */ #endif /* _PMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/popcntintrin.h000066400000000000000000000033261517770275000175240ustar00rootroot00000000000000/* Copyright (C) 2009-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _POPCNTINTRIN_H_INCLUDED #define _POPCNTINTRIN_H_INCLUDED #ifndef __POPCNT__ #pragma GCC push_options #pragma GCC target("popcnt") #define __DISABLE_POPCNT__ #endif /* __POPCNT__ */ /* Calculate a number of bits set to 1. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_popcnt_u32 (unsigned int __X) { return __builtin_popcount (__X); } #ifdef __x86_64__ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_popcnt_u64 (unsigned long long __X) { return __builtin_popcountll (__X); } #endif #ifdef __DISABLE_POPCNT__ #undef __DISABLE_POPCNT__ #pragma GCC pop_options #endif /* __DISABLE_POPCNT__ */ #endif /* _POPCNTINTRIN_H_INCLUDED */ chibicc-1.0.24/include/prfchwintrin.h000066400000000000000000000026471517770275000175170ustar00rootroot00000000000000/* Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED && !defined _MM3DNOW_H_INCLUDED # error "Never use directly; include or instead." #endif #ifndef _PRFCHWINTRIN_H_INCLUDED #define _PRFCHWINTRIN_H_INCLUDED extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_prefetchw (void *__P) { __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */); } #endif /* _PRFCHWINTRIN_H_INCLUDED */ chibicc-1.0.24/include/rdseedintrin.h000066400000000000000000000040351517770275000174650ustar00rootroot00000000000000/* Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _RDSEEDINTRIN_H_INCLUDED #define _RDSEEDINTRIN_H_INCLUDED #ifndef __RDSEED__ #pragma GCC push_options #pragma GCC target("rdseed") #define __DISABLE_RDSEED__ #endif /* __RDSEED__ */ // extern __inline int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _rdseed16_step (unsigned short *__p) // { // return __builtin_ia32_rdseed_hi_step (__p); // } // extern __inline int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _rdseed32_step (unsigned int *__p) // { // return __builtin_ia32_rdseed_si_step (__p); // } // #ifdef __x86_64__ // extern __inline int // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _rdseed64_step (unsigned long long *__p) // { // return __builtin_ia32_rdseed_di_step (__p); // } // #endif #ifdef __DISABLE_RDSEED__ #undef __DISABLE_RDSEED__ #pragma GCC pop_options #endif /* __DISABLE_RDSEED__ */ #endif /* _RDSEEDINTRIN_H_INCLUDED */ chibicc-1.0.24/include/rtmintrin.h000066400000000000000000000052551517770275000170260ustar00rootroot00000000000000/* Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _RTMINTRIN_H_INCLUDED #define _RTMINTRIN_H_INCLUDED #ifndef __RTM__ #pragma GCC push_options #pragma GCC target("rtm") #define __DISABLE_RTM__ #endif /* __RTM__ */ #define _XBEGIN_STARTED (~0u) #define _XABORT_EXPLICIT (1 << 0) #define _XABORT_RETRY (1 << 1) #define _XABORT_CONFLICT (1 << 2) #define _XABORT_CAPACITY (1 << 3) #define _XABORT_DEBUG (1 << 4) #define _XABORT_NESTED (1 << 5) #define _XABORT_CODE(x) (((x) >> 24) & 0xFF) /* Start an RTM code region. Return _XBEGIN_STARTED on success and the abort condition otherwise. */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _xbegin (void) { return __builtin_ia32_xbegin (); } /* Specify the end of an RTM code region. If it corresponds to the outermost transaction, then attempts the transaction commit. If the commit fails, then control is transferred to the outermost transaction fallback handler. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _xend (void) { __builtin_ia32_xend (); } /* Force an RTM abort condition. The control is transferred to the outermost transaction fallback handler with the abort condition IMM. */ #ifdef __OPTIMIZE__ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _xabort (const unsigned int __imm) { __builtin_ia32_xabort (__imm); } #else #define _xabort(N) __builtin_ia32_xabort (N) #endif /* __OPTIMIZE__ */ #ifdef __DISABLE_RTM__ #undef __DISABLE_RTM__ #pragma GCC pop_options #endif /* __DISABLE_RTM__ */ #endif /* _RTMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/sgxintrin.h000066400000000000000000000156631517770275000170310ustar00rootroot00000000000000/* Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _SGXINTRIN_H_INCLUDED #define _SGXINTRIN_H_INCLUDED #ifndef __SGX__ #pragma GCC push_options #pragma GCC target("sgx") #define __DISABLE_SGX__ #endif /* __SGX__ */ #define __encls_bc(leaf, b, c, retval) \ __asm__ __volatile__ ("encls\n\t" \ : "=a" (retval) \ : "a" (leaf), "b" (b), "c" (c) \ : "cc") #define __encls_bcd(leaf, b, c, d, retval) \ __asm__ __volatile__("encls\n\t" \ : "=a" (retval) \ : "a" (leaf), "b" (b), "c" (c), "d" (d) \ : "cc") #define __encls_c(leaf, c, retval) \ __asm__ __volatile__("encls\n\t" \ : "=a" (retval) \ : "a" (leaf), "c" (c) \ : "cc") #define __encls_edbgrd(leaf, b, c, retval) \ __asm__ __volatile__("encls\n\t" \ : "=a" (retval), "=b" (b) \ : "a" (leaf), "c" (c)) #define __encls_generic(leaf, b, c, d, retval) \ __asm__ __volatile__("encls\n\t" \ : "=a" (retval), "=b" (b), "=c" (c), "=d" (d)\ : "a" (leaf), "b" (b), "c" (c), "d" (d) \ : "cc") #define __enclu_bc(leaf, b, c, retval) \ __asm__ __volatile__("enclu\n\t" \ : "=a" (retval) \ : "a" (leaf), "b" (b), "c" (c) \ : "cc") #define __enclu_bcd(leaf, b, c, d, retval) \ __asm__ __volatile__("enclu\n\t" \ : "=a" (retval) \ : "a" (leaf), "b" (b), "c" (c), "d" (d) \ : "cc") #define __enclu_eenter(leaf, b, c, retval) \ __asm__ __volatile__("enclu\n\t" \ : "=a" (retval), "=c" (c) \ : "a" (leaf), "b" (b), "c" (c) \ : "cc") #define __enclu_eexit(leaf, b, c, retval) \ __asm__ __volatile__("enclu\n\t" \ : "=a" (retval), "=c" (c) \ : "a" (leaf), "b" (b) \ : "cc") #define __enclu_generic(leaf, b, c, d, retval) \ __asm__ __volatile__("enclu\n\t" \ : "=a" (retval), "=b" (b), "=c" (c), "=d" (d)\ : "a" (leaf), "b" (b), "c" (c), "d" (d) \ : "cc") #define __enclv_bc(leaf, b, c, retval) \ __asm__ __volatile__("enclv\n\t" \ : "=a" (retval) \ : "a" (leaf), "b" (b), "c" (c) \ : "cc") #define __enclv_cd(leaf, c, d, retval) \ __asm__ __volatile__("enclv\n\t" \ : "=a" (retval) \ : "a" (leaf), "c" (c), "d" (d) \ : "cc") #define __enclv_generic(leaf, b, c, d, retval) \ __asm__ __volatile__("enclv\n\t" \ : "=a" (retval), "=b" (b), "=c" (b), "=d" (d)\ : "a" (leaf), "b" (b), "c" (c), "d" (d) \ : "cc") extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _encls_u32 (const unsigned int __L, size_t __D[]) { enum __encls_type { __SGX_ECREATE = 0x00, __SGX_EADD = 0x01, __SGX_EINIT = 0x02, __SGX_EREMOVE = 0x03, __SGX_EDBGRD = 0x04, __SGX_EDBGWR = 0x05, __SGX_EEXTEND = 0x06, __SGX_ELDB = 0x07, __SGX_ELDU = 0x08, __SGX_EBLOCK = 0x09, __SGX_EPA = 0x0A, __SGX_EWB = 0x0B, __SGX_ETRACK = 0x0C, __SGX_EAUG = 0x0D, __SGX_EMODPR = 0x0E, __SGX_EMODT = 0x0F, __SGX_ERDINFO = 0x10, __SGX_ETRACKC = 0x11, __SGX_ELDBC = 0x12, __SGX_ELDUC = 0x13 }; enum __encls_type __T = (enum __encls_type)__L; unsigned int __R = 0; if (!__builtin_constant_p (__T)) __encls_generic (__L, __D[0], __D[1], __D[2], __R); else switch (__T) { case __SGX_ECREATE: case __SGX_EADD: case __SGX_EDBGWR: case __SGX_EEXTEND: case __SGX_EPA: case __SGX_EMODPR: case __SGX_EMODT: case __SGX_EAUG: case __SGX_ERDINFO: __encls_bc (__L, __D[0], __D[1], __R); break; case __SGX_EINIT: case __SGX_ELDB: case __SGX_ELDU: case __SGX_EWB: case __SGX_ELDBC: case __SGX_ELDUC: __encls_bcd (__L, __D[0], __D[1], __D[2], __R); break; case __SGX_EREMOVE: case __SGX_EBLOCK: case __SGX_ETRACK: case __SGX_ETRACKC: __encls_c (__L, __D[1], __R); break; case __SGX_EDBGRD: __encls_edbgrd (__L, __D[0], __D[1], __R); break; default: __encls_generic (__L, __D[0], __D[1], __D[2], __R); } return __R; } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _enclu_u32 (const unsigned int __L, size_t __D[]) { enum __enclu_type { __SGX_EREPORT = 0x00, __SGX_EGETKEY = 0x01, __SGX_EENTER = 0x02, __SGX_ERESUME = 0x03, __SGX_EEXIT = 0x04, __SGX_EACCEPT = 0x05, __SGX_EMODPE = 0x06, __SGX_EACCEPTCOPY = 0x07 }; enum __enclu_type __T = (enum __enclu_type) __L; unsigned int __R = 0; if (!__builtin_constant_p (__T)) __enclu_generic (__L, __D[0], __D[1], __D[2], __R); else switch (__T) { case __SGX_EREPORT: case __SGX_EACCEPTCOPY: __enclu_bcd (__L, __D[0], __D[1], __D[2], __R); break; case __SGX_EGETKEY: case __SGX_ERESUME: case __SGX_EACCEPT: case __SGX_EMODPE: __enclu_bc (__L, __D[0], __D[1], __R); break; case __SGX_EENTER: __enclu_eenter (__L, __D[0], __D[1], __R); break; case __SGX_EEXIT: __enclu_eexit (__L, __D[0], __D[1], __R); break; default: __enclu_generic (__L, __D[0], __D[1], __D[2], __R); } return __R; } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _enclv_u32 (const unsigned int __L, size_t __D[]) { enum __enclv_type { __SGX_EDECVIRTCHILD = 0x00, __SGX_EINCVIRTCHILD = 0x01, __SGX_ESETCONTEXT = 0x02 }; unsigned int __R = 0; if (!__builtin_constant_p (__L)) __enclv_generic (__L, __D[0], __D[1], __D[2], __R); else switch (__L) { case __SGX_EDECVIRTCHILD: case __SGX_EINCVIRTCHILD: __enclv_bc (__L, __D[0], __D[1], __R); break; case __SGX_ESETCONTEXT: __enclv_cd (__L, __D[1], __D[2], __R); break; default: __enclv_generic (__L, __D[0], __D[1], __D[2], __R); } return __R; } #ifdef __DISABLE_SGX__ #undef __DISABLE_SGX__ #pragma GCC pop_options #endif /* __DISABLE_SGX__ */ #endif /* _SGXINTRIN_H_INCLUDED */ chibicc-1.0.24/include/shaintrin.h000066400000000000000000000064271517770275000170010ustar00rootroot00000000000000/* Copyright (C) 2013-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _SHAINTRIN_H_INCLUDED #define _SHAINTRIN_H_INCLUDED #ifndef __SHA__ #pragma GCC push_options #pragma GCC target("sha") #define __DISABLE_SHA__ #endif /* __SHA__ */ // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha1msg1_epu32 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_sha1msg1 ((__v4si) __A, (__v4si) __B); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha1msg2_epu32 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_sha1msg2 ((__v4si) __A, (__v4si) __B); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha1nexte_epu32 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_sha1nexte ((__v4si) __A, (__v4si) __B); // } // #ifdef __OPTIMIZE__ // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha1rnds4_epu32 (__m128i __A, __m128i __B, const int __I) // { // return (__m128i) __builtin_ia32_sha1rnds4 ((__v4si) __A, (__v4si) __B, __I); // } // #else // #define _mm_sha1rnds4_epu32(A, B, I) \ // ((__m128i) __builtin_ia32_sha1rnds4 ((__v4si)(__m128i)(A), \ // (__v4si)(__m128i)(B), (int)(I))) // #endif // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha256msg1_epu32 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_sha256msg1 ((__v4si) __A, (__v4si) __B); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha256msg2_epu32 (__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_sha256msg2 ((__v4si) __A, (__v4si) __B); // } // extern __inline __m128i // __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha256rnds2_epu32 (__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_sha256rnds2 ((__v4si) __A, (__v4si) __B, // (__v4si) __C); // } #ifdef __DISABLE_SHA__ #undef __DISABLE_SHA__ #pragma GCC pop_options #endif /* __DISABLE_SHA__ */ #endif /* _SHAINTRIN_H_INCLUDED */ chibicc-1.0.24/include/smmintrin.h000066400000000000000000000674221517770275000170240ustar00rootroot00000000000000/* Copyright (C) 2007-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 10.0. */ #ifndef _SMMINTRIN_H_INCLUDED #define _SMMINTRIN_H_INCLUDED /* We need definitions from the SSSE3, SSE3, SSE2 and SSE header files. */ #include #ifndef __SSE4_1__ #pragma GCC push_options #pragma GCC target("sse4.1") #define __DISABLE_SSE4_1__ #endif /* __SSE4_1__ */ /* Rounding mode macros. */ #define _MM_FROUND_TO_NEAREST_INT 0x00 #define _MM_FROUND_TO_NEG_INF 0x01 #define _MM_FROUND_TO_POS_INF 0x02 #define _MM_FROUND_TO_ZERO 0x03 #define _MM_FROUND_CUR_DIRECTION 0x04 #define _MM_FROUND_RAISE_EXC 0x00 #define _MM_FROUND_NO_EXC 0x08 #define _MM_FROUND_NINT \ (_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_RAISE_EXC) #define _MM_FROUND_FLOOR \ (_MM_FROUND_TO_NEG_INF | _MM_FROUND_RAISE_EXC) #define _MM_FROUND_CEIL \ (_MM_FROUND_TO_POS_INF | _MM_FROUND_RAISE_EXC) #define _MM_FROUND_TRUNC \ (_MM_FROUND_TO_ZERO | _MM_FROUND_RAISE_EXC) #define _MM_FROUND_RINT \ (_MM_FROUND_CUR_DIRECTION | _MM_FROUND_RAISE_EXC) #define _MM_FROUND_NEARBYINT \ (_MM_FROUND_CUR_DIRECTION | _MM_FROUND_NO_EXC) /* Test Instruction */ /* Packed integer 128-bit bitwise comparison. Return 1 if (__V & __M) == 0. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_testz_si128 (__m128i __M, __m128i __V) { return __builtin_ia32_ptestz128 ((__v2di)__M, (__v2di)__V); } /* Packed integer 128-bit bitwise comparison. Return 1 if (__V & ~__M) == 0. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_testc_si128 (__m128i __M, __m128i __V) { return __builtin_ia32_ptestc128 ((__v2di)__M, (__v2di)__V); } /* Packed integer 128-bit bitwise comparison. Return 1 if (__V & __M) != 0 && (__V & ~__M) != 0. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_testnzc_si128 (__m128i __M, __m128i __V) { return __builtin_ia32_ptestnzc128 ((__v2di)__M, (__v2di)__V); } /* Macros for packed integer 128-bit comparison intrinsics. */ #define _mm_test_all_zeros(M, V) _mm_testz_si128 ((M), (V)) #define _mm_test_all_ones(V) \ _mm_testc_si128 ((V), _mm_cmpeq_epi32 ((V), (V))) #define _mm_test_mix_ones_zeros(M, V) _mm_testnzc_si128 ((M), (V)) /* Packed/scalar double precision floating point rounding. */ #ifdef __OPTIMIZE__ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_round_pd (__m128d __V, const int __M) { return (__m128d) __builtin_ia32_roundpd ((__v2df)__V, __M); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_round_sd(__m128d __D, __m128d __V, const int __M) { return (__m128d) __builtin_ia32_roundsd ((__v2df)__D, (__v2df)__V, __M); } #else #define _mm_round_pd(V, M) \ ((__m128d) __builtin_ia32_roundpd ((__v2df)(__m128d)(V), (int)(M))) #define _mm_round_sd(D, V, M) \ ((__m128d) __builtin_ia32_roundsd ((__v2df)(__m128d)(D), \ (__v2df)(__m128d)(V), (int)(M))) #endif /* Packed/scalar single precision floating point rounding. */ #ifdef __OPTIMIZE__ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_round_ps (__m128 __V, const int __M) { return (__m128) __builtin_ia32_roundps ((__v4sf)__V, __M); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_round_ss (__m128 __D, __m128 __V, const int __M) { return (__m128) __builtin_ia32_roundss ((__v4sf)__D, (__v4sf)__V, __M); } #else #define _mm_round_ps(V, M) \ ((__m128) __builtin_ia32_roundps ((__v4sf)(__m128)(V), (int)(M))) #define _mm_round_ss(D, V, M) \ ((__m128) __builtin_ia32_roundss ((__v4sf)(__m128)(D), \ (__v4sf)(__m128)(V), (int)(M))) #endif /* Macros for ceil/floor intrinsics. */ #define _mm_ceil_pd(V) _mm_round_pd ((V), _MM_FROUND_CEIL) #define _mm_ceil_sd(D, V) _mm_round_sd ((D), (V), _MM_FROUND_CEIL) #define _mm_floor_pd(V) _mm_round_pd((V), _MM_FROUND_FLOOR) #define _mm_floor_sd(D, V) _mm_round_sd ((D), (V), _MM_FROUND_FLOOR) #define _mm_ceil_ps(V) _mm_round_ps ((V), _MM_FROUND_CEIL) #define _mm_ceil_ss(D, V) _mm_round_ss ((D), (V), _MM_FROUND_CEIL) #define _mm_floor_ps(V) _mm_round_ps ((V), _MM_FROUND_FLOOR) #define _mm_floor_ss(D, V) _mm_round_ss ((D), (V), _MM_FROUND_FLOOR) /* SSE4.1 */ /* Integer blend instructions - select data from 2 sources using constant/variable mask. */ #ifdef __OPTIMIZE__ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_blend_epi16 (__m128i __X, __m128i __Y, const int __M) { return (__m128i) __builtin_ia32_pblendw128 ((__v8hi)__X, (__v8hi)__Y, __M); } #else #define _mm_blend_epi16(X, Y, M) \ ((__m128i) __builtin_ia32_pblendw128 ((__v8hi)(__m128i)(X), \ (__v8hi)(__m128i)(Y), (int)(M))) #endif extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_blendv_epi8 (__m128i __X, __m128i __Y, __m128i __M) { return (__m128i) __builtin_ia32_pblendvb128 ((__v16qi)__X, (__v16qi)__Y, (__v16qi)__M); } /* Single precision floating point blend instructions - select data from 2 sources using constant/variable mask. */ #ifdef __OPTIMIZE__ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_blend_ps (__m128 __X, __m128 __Y, const int __M) { return (__m128) __builtin_ia32_blendps ((__v4sf)__X, (__v4sf)__Y, __M); } #else #define _mm_blend_ps(X, Y, M) \ ((__m128) __builtin_ia32_blendps ((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (int)(M))) #endif extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_blendv_ps (__m128 __X, __m128 __Y, __m128 __M) { return (__m128) __builtin_ia32_blendvps ((__v4sf)__X, (__v4sf)__Y, (__v4sf)__M); } /* Double precision floating point blend instructions - select data from 2 sources using constant/variable mask. */ #ifdef __OPTIMIZE__ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_blend_pd (__m128d __X, __m128d __Y, const int __M) { return (__m128d) __builtin_ia32_blendpd ((__v2df)__X, (__v2df)__Y, __M); } #else #define _mm_blend_pd(X, Y, M) \ ((__m128d) __builtin_ia32_blendpd ((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (int)(M))) #endif extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_blendv_pd (__m128d __X, __m128d __Y, __m128d __M) { return (__m128d) __builtin_ia32_blendvpd ((__v2df)__X, (__v2df)__Y, (__v2df)__M); } /* Dot product instructions with mask-defined summing and zeroing parts of result. */ #ifdef __OPTIMIZE__ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_dp_ps (__m128 __X, __m128 __Y, const int __M) { return (__m128) __builtin_ia32_dpps ((__v4sf)__X, (__v4sf)__Y, __M); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_dp_pd (__m128d __X, __m128d __Y, const int __M) { return (__m128d) __builtin_ia32_dppd ((__v2df)__X, (__v2df)__Y, __M); } #else #define _mm_dp_ps(X, Y, M) \ ((__m128) __builtin_ia32_dpps ((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (int)(M))) #define _mm_dp_pd(X, Y, M) \ ((__m128d) __builtin_ia32_dppd ((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (int)(M))) #endif /* Packed integer 64-bit comparison, zeroing or filling with ones corresponding parts of result. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_epi64 (__m128i __X, __m128i __Y) { return (__m128i) ((__v2di)__X == (__v2di)__Y); } /* Min/max packed integer instructions. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_epi8 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pminsb128 ((__v16qi)__X, (__v16qi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_epi8 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pmaxsb128 ((__v16qi)__X, (__v16qi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_epu16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pminuw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_epu16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pmaxuw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_epi32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pminsd128 ((__v4si)__X, (__v4si)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_epi32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pmaxsd128 ((__v4si)__X, (__v4si)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_epu32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pminud128 ((__v4si)__X, (__v4si)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_epu32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pmaxud128 ((__v4si)__X, (__v4si)__Y); } /* Packed integer 32-bit multiplication with truncation of upper halves of results. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mullo_epi32 (__m128i __X, __m128i __Y) { return (__m128i) ((__v4su)__X * (__v4su)__Y); } /* Packed integer 32-bit multiplication of 2 pairs of operands with two 64-bit results. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mul_epi32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pmuldq128 ((__v4si)__X, (__v4si)__Y); } /* Insert single precision float into packed single precision array element selected by index N. The bits [7-6] of N define S index, the bits [5-4] define D index, and bits [3-0] define zeroing mask for D. */ #ifdef __OPTIMIZE__ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_insert_ps (__m128 __D, __m128 __S, const int __N) { return (__m128) __builtin_ia32_insertps128 ((__v4sf)__D, (__v4sf)__S, __N); } #else #define _mm_insert_ps(D, S, N) \ ((__m128) __builtin_ia32_insertps128 ((__v4sf)(__m128)(D), \ (__v4sf)(__m128)(S), (int)(N))) #endif /* Helper macro to create the N value for _mm_insert_ps. */ #define _MM_MK_INSERTPS_NDX(S, D, M) (((S) << 6) | ((D) << 4) | (M)) /* Extract binary representation of single precision float from packed single precision array element of X selected by index N. */ #ifdef __OPTIMIZE__ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_extract_ps (__m128 __X, const int __N) { union { int __i; float __f; } __tmp; __tmp.__f = __builtin_ia32_vec_ext_v4sf ((__v4sf)__X, __N); return __tmp.__i; } #else #define _mm_extract_ps(X, N) \ (__extension__ \ ({ \ union { int __i; float __f; } __tmp; \ __tmp.__f = __builtin_ia32_vec_ext_v4sf ((__v4sf)(__m128)(X), \ (int)(N)); \ __tmp.__i; \ })) #endif /* Extract binary representation of single precision float into D from packed single precision array element of S selected by index N. */ #define _MM_EXTRACT_FLOAT(D, S, N) \ { (D) = __builtin_ia32_vec_ext_v4sf ((__v4sf)(S), (N)); } /* Extract specified single precision float element into the lower part of __m128. */ #define _MM_PICK_OUT_PS(X, N) \ _mm_insert_ps (_mm_setzero_ps (), (X), \ _MM_MK_INSERTPS_NDX ((N), 0, 0x0e)) /* Insert integer, S, into packed integer array element of D selected by index N. */ #ifdef __OPTIMIZE__ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_insert_epi8 (__m128i __D, int __S, const int __N) { return (__m128i) __builtin_ia32_vec_set_v16qi ((__v16qi)__D, __S, __N); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_insert_epi32 (__m128i __D, int __S, const int __N) { return (__m128i) __builtin_ia32_vec_set_v4si ((__v4si)__D, __S, __N); } #ifdef __x86_64__ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_insert_epi64 (__m128i __D, long long __S, const int __N) { return (__m128i) __builtin_ia32_vec_set_v2di ((__v2di)__D, __S, __N); } #endif #else #define _mm_insert_epi8(D, S, N) \ ((__m128i) __builtin_ia32_vec_set_v16qi ((__v16qi)(__m128i)(D), \ (int)(S), (int)(N))) #define _mm_insert_epi32(D, S, N) \ ((__m128i) __builtin_ia32_vec_set_v4si ((__v4si)(__m128i)(D), \ (int)(S), (int)(N))) #ifdef __x86_64__ #define _mm_insert_epi64(D, S, N) \ ((__m128i) __builtin_ia32_vec_set_v2di ((__v2di)(__m128i)(D), \ (long long)(S), (int)(N))) #endif #endif /* Extract integer from packed integer array element of X selected by index N. */ #ifdef __OPTIMIZE__ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_extract_epi8 (__m128i __X, const int __N) { return (unsigned char) __builtin_ia32_vec_ext_v16qi ((__v16qi)__X, __N); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_extract_epi32 (__m128i __X, const int __N) { return __builtin_ia32_vec_ext_v4si ((__v4si)__X, __N); } #ifdef __x86_64__ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_extract_epi64 (__m128i __X, const int __N) { return __builtin_ia32_vec_ext_v2di ((__v2di)__X, __N); } #endif #else #define _mm_extract_epi8(X, N) \ ((int) (unsigned char) __builtin_ia32_vec_ext_v16qi ((__v16qi)(__m128i)(X), (int)(N))) #define _mm_extract_epi32(X, N) \ ((int) __builtin_ia32_vec_ext_v4si ((__v4si)(__m128i)(X), (int)(N))) #ifdef __x86_64__ #define _mm_extract_epi64(X, N) \ ((long long) __builtin_ia32_vec_ext_v2di ((__v2di)(__m128i)(X), (int)(N))) #endif #endif /* Return horizontal packed word minimum and its index in bits [15:0] and bits [18:16] respectively. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_minpos_epu16 (__m128i __X) { return (__m128i) __builtin_ia32_phminposuw128 ((__v8hi)__X); } /* Packed integer sign-extension. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepi8_epi32 (__m128i __X) { return (__m128i) __builtin_ia32_pmovsxbd128 ((__v16qi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepi16_epi32 (__m128i __X) { return (__m128i) __builtin_ia32_pmovsxwd128 ((__v8hi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepi8_epi64 (__m128i __X) { return (__m128i) __builtin_ia32_pmovsxbq128 ((__v16qi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepi32_epi64 (__m128i __X) { return (__m128i) __builtin_ia32_pmovsxdq128 ((__v4si)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepi16_epi64 (__m128i __X) { return (__m128i) __builtin_ia32_pmovsxwq128 ((__v8hi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepi8_epi16 (__m128i __X) { return (__m128i) __builtin_ia32_pmovsxbw128 ((__v16qi)__X); } /* Packed integer zero-extension. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepu8_epi32 (__m128i __X) { return (__m128i) __builtin_ia32_pmovzxbd128 ((__v16qi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepu16_epi32 (__m128i __X) { return (__m128i) __builtin_ia32_pmovzxwd128 ((__v8hi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepu8_epi64 (__m128i __X) { return (__m128i) __builtin_ia32_pmovzxbq128 ((__v16qi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepu32_epi64 (__m128i __X) { return (__m128i) __builtin_ia32_pmovzxdq128 ((__v4si)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepu16_epi64 (__m128i __X) { return (__m128i) __builtin_ia32_pmovzxwq128 ((__v8hi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepu8_epi16 (__m128i __X) { return (__m128i) __builtin_ia32_pmovzxbw128 ((__v16qi)__X); } /* Pack 8 double words from 2 operands into 8 words of result with unsigned saturation. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_packus_epi32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_packusdw128 ((__v4si)__X, (__v4si)__Y); } /* Sum absolute 8-bit integer difference of adjacent groups of 4 byte integers in the first 2 operands. Starting offsets within operands are determined by the 3rd mask operand. */ #ifdef __OPTIMIZE__ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mpsadbw_epu8 (__m128i __X, __m128i __Y, const int __M) { return (__m128i) __builtin_ia32_mpsadbw128 ((__v16qi)__X, (__v16qi)__Y, __M); } #else #define _mm_mpsadbw_epu8(X, Y, M) \ ((__m128i) __builtin_ia32_mpsadbw128 ((__v16qi)(__m128i)(X), \ (__v16qi)(__m128i)(Y), (int)(M))) #endif /* Load double quadword using non-temporal aligned hint. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_stream_load_si128 (__m128i *__X) { return (__m128i) __builtin_ia32_movntdqa ((__v2di *) __X); } #ifndef __SSE4_2__ #pragma GCC push_options #pragma GCC target("sse4.2") #define __DISABLE_SSE4_2__ #endif /* __SSE4_2__ */ /* These macros specify the source data format. */ #define _SIDD_UBYTE_OPS 0x00 #define _SIDD_UWORD_OPS 0x01 #define _SIDD_SBYTE_OPS 0x02 #define _SIDD_SWORD_OPS 0x03 /* These macros specify the comparison operation. */ #define _SIDD_CMP_EQUAL_ANY 0x00 #define _SIDD_CMP_RANGES 0x04 #define _SIDD_CMP_EQUAL_EACH 0x08 #define _SIDD_CMP_EQUAL_ORDERED 0x0c /* These macros specify the polarity. */ #define _SIDD_POSITIVE_POLARITY 0x00 #define _SIDD_NEGATIVE_POLARITY 0x10 #define _SIDD_MASKED_POSITIVE_POLARITY 0x20 #define _SIDD_MASKED_NEGATIVE_POLARITY 0x30 /* These macros specify the output selection in _mm_cmpXstri (). */ #define _SIDD_LEAST_SIGNIFICANT 0x00 #define _SIDD_MOST_SIGNIFICANT 0x40 /* These macros specify the output selection in _mm_cmpXstrm (). */ #define _SIDD_BIT_MASK 0x00 #define _SIDD_UNIT_MASK 0x40 /* Intrinsics for text/string processing. */ #ifdef __OPTIMIZE__ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpistrm (__m128i __X, __m128i __Y, const int __M) { return (__m128i) __builtin_ia32_pcmpistrm128 ((__v16qi)__X, (__v16qi)__Y, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpistri (__m128i __X, __m128i __Y, const int __M) { return __builtin_ia32_pcmpistri128 ((__v16qi)__X, (__v16qi)__Y, __M); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpestrm (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M) { return (__m128i) __builtin_ia32_pcmpestrm128 ((__v16qi)__X, __LX, (__v16qi)__Y, __LY, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpestri (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M) { return __builtin_ia32_pcmpestri128 ((__v16qi)__X, __LX, (__v16qi)__Y, __LY, __M); } #else #define _mm_cmpistrm(X, Y, M) \ ((__m128i) __builtin_ia32_pcmpistrm128 ((__v16qi)(__m128i)(X), \ (__v16qi)(__m128i)(Y), (int)(M))) #define _mm_cmpistri(X, Y, M) \ ((int) __builtin_ia32_pcmpistri128 ((__v16qi)(__m128i)(X), \ (__v16qi)(__m128i)(Y), (int)(M))) #define _mm_cmpestrm(X, LX, Y, LY, M) \ ((__m128i) __builtin_ia32_pcmpestrm128 ((__v16qi)(__m128i)(X), \ (int)(LX), (__v16qi)(__m128i)(Y), \ (int)(LY), (int)(M))) #define _mm_cmpestri(X, LX, Y, LY, M) \ ((int) __builtin_ia32_pcmpestri128 ((__v16qi)(__m128i)(X), (int)(LX), \ (__v16qi)(__m128i)(Y), (int)(LY), \ (int)(M))) #endif /* Intrinsics for text/string processing and reading values of EFlags. */ #ifdef __OPTIMIZE__ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpistra (__m128i __X, __m128i __Y, const int __M) { return __builtin_ia32_pcmpistria128 ((__v16qi)__X, (__v16qi)__Y, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpistrc (__m128i __X, __m128i __Y, const int __M) { return __builtin_ia32_pcmpistric128 ((__v16qi)__X, (__v16qi)__Y, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpistro (__m128i __X, __m128i __Y, const int __M) { return __builtin_ia32_pcmpistrio128 ((__v16qi)__X, (__v16qi)__Y, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpistrs (__m128i __X, __m128i __Y, const int __M) { return __builtin_ia32_pcmpistris128 ((__v16qi)__X, (__v16qi)__Y, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpistrz (__m128i __X, __m128i __Y, const int __M) { return __builtin_ia32_pcmpistriz128 ((__v16qi)__X, (__v16qi)__Y, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpestra (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M) { return __builtin_ia32_pcmpestria128 ((__v16qi)__X, __LX, (__v16qi)__Y, __LY, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpestrc (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M) { return __builtin_ia32_pcmpestric128 ((__v16qi)__X, __LX, (__v16qi)__Y, __LY, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpestro (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M) { return __builtin_ia32_pcmpestrio128 ((__v16qi)__X, __LX, (__v16qi)__Y, __LY, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpestrs (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M) { return __builtin_ia32_pcmpestris128 ((__v16qi)__X, __LX, (__v16qi)__Y, __LY, __M); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpestrz (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M) { return __builtin_ia32_pcmpestriz128 ((__v16qi)__X, __LX, (__v16qi)__Y, __LY, __M); } #else #define _mm_cmpistra(X, Y, M) \ ((int) __builtin_ia32_pcmpistria128 ((__v16qi)(__m128i)(X), \ (__v16qi)(__m128i)(Y), (int)(M))) #define _mm_cmpistrc(X, Y, M) \ ((int) __builtin_ia32_pcmpistric128 ((__v16qi)(__m128i)(X), \ (__v16qi)(__m128i)(Y), (int)(M))) #define _mm_cmpistro(X, Y, M) \ ((int) __builtin_ia32_pcmpistrio128 ((__v16qi)(__m128i)(X), \ (__v16qi)(__m128i)(Y), (int)(M))) #define _mm_cmpistrs(X, Y, M) \ ((int) __builtin_ia32_pcmpistris128 ((__v16qi)(__m128i)(X), \ (__v16qi)(__m128i)(Y), (int)(M))) #define _mm_cmpistrz(X, Y, M) \ ((int) __builtin_ia32_pcmpistriz128 ((__v16qi)(__m128i)(X), \ (__v16qi)(__m128i)(Y), (int)(M))) #define _mm_cmpestra(X, LX, Y, LY, M) \ ((int) __builtin_ia32_pcmpestria128 ((__v16qi)(__m128i)(X), (int)(LX), \ (__v16qi)(__m128i)(Y), (int)(LY), \ (int)(M))) #define _mm_cmpestrc(X, LX, Y, LY, M) \ ((int) __builtin_ia32_pcmpestric128 ((__v16qi)(__m128i)(X), (int)(LX), \ (__v16qi)(__m128i)(Y), (int)(LY), \ (int)(M))) #define _mm_cmpestro(X, LX, Y, LY, M) \ ((int) __builtin_ia32_pcmpestrio128 ((__v16qi)(__m128i)(X), (int)(LX), \ (__v16qi)(__m128i)(Y), (int)(LY), \ (int)(M))) #define _mm_cmpestrs(X, LX, Y, LY, M) \ ((int) __builtin_ia32_pcmpestris128 ((__v16qi)(__m128i)(X), (int)(LX), \ (__v16qi)(__m128i)(Y), (int)(LY), \ (int)(M))) #define _mm_cmpestrz(X, LX, Y, LY, M) \ ((int) __builtin_ia32_pcmpestriz128 ((__v16qi)(__m128i)(X), (int)(LX), \ (__v16qi)(__m128i)(Y), (int)(LY), \ (int)(M))) #endif /* Packed integer 64-bit comparison, zeroing or filling with ones corresponding parts of result. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_epi64 (__m128i __X, __m128i __Y) { return (__m128i) ((__v2di)__X > (__v2di)__Y); } #ifdef __DISABLE_SSE4_2__ #undef __DISABLE_SSE4_2__ #pragma GCC pop_options #endif /* __DISABLE_SSE4_2__ */ #ifdef __DISABLE_SSE4_1__ #undef __DISABLE_SSE4_1__ #pragma GCC pop_options #endif /* __DISABLE_SSE4_1__ */ #include #ifndef __SSE4_1__ #pragma GCC push_options #pragma GCC target("sse4.1") #define __DISABLE_SSE4_1__ #endif /* __SSE4_1__ */ #ifndef __SSE4_2__ #pragma GCC push_options #pragma GCC target("sse4.2") #define __DISABLE_SSE4_2__ #endif /* __SSE4_1__ */ /* Accumulate CRC32 (polynomial 0x11EDC6F41) value. */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_crc32_u8 (unsigned int __C, unsigned char __V) { return __builtin_ia32_crc32qi (__C, __V); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_crc32_u16 (unsigned int __C, unsigned short __V) { return __builtin_ia32_crc32hi (__C, __V); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_crc32_u32 (unsigned int __C, unsigned int __V) { return __builtin_ia32_crc32si (__C, __V); } #ifdef __x86_64__ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_crc32_u64 (unsigned long long __C, unsigned long long __V) { return __builtin_ia32_crc32di (__C, __V); } #endif #ifdef __DISABLE_SSE4_2__ #undef __DISABLE_SSE4_2__ #pragma GCC pop_options #endif /* __DISABLE_SSE4_2__ */ #ifdef __DISABLE_SSE4_1__ #undef __DISABLE_SSE4_1__ #pragma GCC pop_options #endif /* __DISABLE_SSE4_1__ */ #endif /* _SMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/stdalign.h000077500000000000000000000002431517770275000166000ustar00rootroot00000000000000#ifndef __STDALIGN_H #define __STDALIGN_H #define alignas _Alignas #define alignof _Alignof #define __alignas_is_defined 1 #define __alignof_is_defined 1 #endif chibicc-1.0.24/include/stdarg.h000077500000000000000000000036151517770275000162650ustar00rootroot00000000000000#ifndef __STDARG_H #define __STDARG_H typedef struct { unsigned int gp_offset; unsigned int fp_offset; void *overflow_arg_area; void *reg_save_area; } __va_elem; typedef __va_elem va_list[1]; typedef unsigned long uintptr_t; extern int printf(const char *fmt, ...); #define va_start(ap, last) \ ({ *(ap) = *(__va_elem *)__va_area__; (void)0; }) #define va_end(ap) //for now alignment is not correctly managed by chibicc when we have variadic functions. //we store into the stack by substracting directly the sz of the component (aligned to 8 or 16) //but we need a more robust way to manage alignment and activate here the correct alignment. static void *__va_arg_mem(__va_elem *ap, int sz, int align) { void *p = ap->overflow_arg_area; if (align > 8) { p = (void *)(((uintptr_t)p + align - 1) & ~(align - 1)); } ap->overflow_arg_area = (void *)(((unsigned long)p + sz + 7) / 8 * 8); return p; } static void *__va_arg_gp(__va_elem *ap, int sz, int align) { if (ap->gp_offset >= 48) return __va_arg_mem(ap, sz, align); void *r = ap->reg_save_area + ap->gp_offset; ap->gp_offset += 8; return r; } static void *__va_arg_fp(__va_elem *ap, int sz, int align) { if (ap->fp_offset >= 176) return __va_arg_mem(ap, sz, align); void *r = ap->reg_save_area + ap->fp_offset; ap->fp_offset += 16; return r; } #define va_arg(ap, ty) \ ({ \ int klass = __builtin_reg_class(ty); \ *(ty *)(klass == 0 ? __va_arg_gp(ap, sizeof(ty), _Alignof(ty)) : \ klass == 1 ? __va_arg_fp(ap, sizeof(ty), _Alignof(ty)) : \ __va_arg_mem(ap, sizeof(ty), _Alignof(ty))); \ }) #define va_copy(dest, src) ((dest)[0] = (src)[0]) #define __GNUC_VA_LIST 1 typedef va_list __gnuc_va_list; #endifchibicc-1.0.24/include/stdatomic.h000077500000000000000000000122011517770275000167570ustar00rootroot00000000000000#ifndef __STDATOMIC_H #define __STDATOMIC_H #define __ATOMIC_RELAXED 0 #define __ATOMIC_CONSUME 1 #define __ATOMIC_ACQUIRE 2 #define __ATOMIC_RELEASE 3 #define __ATOMIC_ACQ_REL 4 #define __ATOMIC_SEQ_CST 5 #define ATOMIC_BOOL_LOCK_FREE 1 #define ATOMIC_CHAR_LOCK_FREE 1 #define ATOMIC_CHAR16_T_LOCK_FREE 1 #define ATOMIC_CHAR32_T_LOCK_FREE 1 #define ATOMIC_WCHAR_T_LOCK_FREE 1 #define ATOMIC_SHORT_LOCK_FREE 1 #define ATOMIC_INT_LOCK_FREE 1 #define ATOMIC_LONG_LOCK_FREE 1 #define ATOMIC_LLONG_LOCK_FREE 1 #define ATOMIC_POINTER_LOCK_FREE 1 #define ATOMIC_VAR_INIT(value) (value) typedef enum { memory_order_relaxed, memory_order_consume, memory_order_acquire, memory_order_release, memory_order_acq_rel, memory_order_seq_cst, } memory_order; #define true 1 #define false 0 //#define ATOMIC_FLAG_INIT(x) (x) #define ATOMIC_FLAG_INIT { 0 } #define atomic_init(addr, val) (*(addr) = (val)) #define kill_dependency(x) (x) #define atomic_thread_fence(order) __atomic_thread_fence(order) #define atomic_signal_fence(order) __atomic_signal_fence(order) #define atomic_is_lock_free(x) 1 #define atomic_fetch_add(addr, val) __builtin_atomic_fetch_add(addr, val) #define atomic_fetch_sub(addr, val) __builtin_atomic_fetch_sub(addr, val) #define atomic_fetch_or(addr, val) __builtin_atomic_fetch_or(addr, val) #define atomic_fetch_xor(addr, val) __builtin_atomic_fetch_xor(addr, val) #define atomic_fetch_and(addr, val) __builtin_atomic_fetch_and(addr, val) #define atomic_fetch_add_explicit(addr, val, order) __builtin_atomic_fetch_add(addr, val) #define atomic_fetch_sub_explicit(addr, val, order) __builtin_atomic_fetch_sub(addr, val) #define atomic_fetch_or_explicit(addr, val, order) __builtin_atomic_fetch_or(addr, val) #define atomic_fetch_xor_explicit(addr, val, order) __builtin_atomic_fetch_xor(addr, val) #define atomic_fetch_and_explicit(addr, val, order) __builtin_atomic_fetch_and(addr, val) #define atomic_compare_exchange_weak_explicit(obj, expected, desired, succ, fail) \ __atomic_compare_exchange_n((obj), (expected), (desired), true, (succ), (fail)) #define atomic_compare_exchange_strong_explicit(obj, expected, desired, succ, fail) \ __atomic_compare_exchange_n((obj), (expected), (desired), false, (succ), (fail)) #define atomic_compare_exchange_weak(p, old, new) \ __builtin_compare_and_swap((p), (old), (new)) #define atomic_compare_exchange_strong(p, old, new) \ __builtin_compare_and_swap((p), (old), (new)) #define atomic_exchange(obj, val) __builtin_atomic_exchange((obj), (val)) #define atomic_exchange_explicit(obj, val, order) __builtin_atomic_exchange((obj), (val)) // Other atomic operation macros #define atomic_load(obj) __builtin_atomic_load_n((obj)) #define atomic_load_explicit(obj, order) __builtin_atomic_load_n((obj), (order)) #define atomic_store(obj, val) __builtin_atomic_store_n((obj), (val)) #define atomic_store_explicit(obj, val, order) __builtin_atomic_store_n((obj), (val), (order)) #define atomic_test_and_set(obj) __builtin_atomic_test_and_set((obj)) #define atomic_test_and_set_explicit(obj, order) __builtin_atomic_test_and_set((obj), (order)) #define atomic_flag_test_and_set(obj) __sync_lock_test_and_set(obj, 1) #define atomic_flag_test_and_set_explicit(obj, order) __sync_lock_test_and_set(obj, 1) #define atomic_flag_clear(obj) atomic_clear(obj) #define atomic_flag_clear_explicit(obj, order) atomic_clear_explicit(obj, order) #define atomic_clear(obj) __builtin_atomic_clear((obj)) #define atomic_clear_explicit(obj, order) __builtin_atomic_clear((obj), (order)) typedef _Atomic _Bool atomic_flag; typedef _Atomic _Bool atomic_bool; typedef _Atomic char atomic_char; typedef _Atomic signed char atomic_schar; typedef _Atomic unsigned char atomic_uchar; typedef _Atomic short atomic_short; typedef _Atomic unsigned short atomic_ushort; typedef _Atomic int atomic_int; typedef _Atomic unsigned int atomic_uint; typedef _Atomic long atomic_long; typedef _Atomic unsigned long atomic_ulong; typedef _Atomic long long atomic_llong; typedef _Atomic unsigned long long atomic_ullong; typedef _Atomic unsigned short atomic_char16_t; typedef _Atomic unsigned atomic_char32_t; typedef _Atomic unsigned atomic_wchar_t; typedef _Atomic signed char atomic_int_least8_t; typedef _Atomic unsigned char atomic_uint_least8_t; typedef _Atomic short atomic_int_least16_t; typedef _Atomic unsigned short atomic_uint_least16_t; typedef _Atomic int atomic_int_least32_t; typedef _Atomic unsigned int atomic_uint_least32_t; typedef _Atomic long atomic_int_least64_t; typedef _Atomic unsigned long atomic_uint_least64_t; typedef _Atomic signed char atomic_int_fast8_t; typedef _Atomic unsigned char atomic_uint_fast8_t; typedef _Atomic short atomic_int_fast16_t; typedef _Atomic unsigned short atomic_uint_fast16_t; typedef _Atomic int atomic_int_fast32_t; typedef _Atomic unsigned int atomic_uint_fast32_t; typedef _Atomic long atomic_int_fast64_t; typedef _Atomic unsigned long atomic_uint_fast64_t; typedef _Atomic long atomic_intptr_t; typedef _Atomic unsigned long atomic_uintptr_t; typedef _Atomic unsigned long atomic_size_t; typedef _Atomic long atomic_ptrdiff_t; typedef _Atomic long atomic_intmax_t; typedef _Atomic unsigned long atomic_uintmax_t; #endif chibicc-1.0.24/include/stdbool.h000077500000000000000000000002131517770275000164360ustar00rootroot00000000000000#ifndef __STDBOOL_H #define __STDBOOL_H #define bool _Bool #define true 1 #define false 0 #define __bool_true_false_are_defined 1 #endif chibicc-1.0.24/include/stddef.h000077500000000000000000000033351517770275000162510ustar00rootroot00000000000000#ifndef __STDDEF_H #define __STDDEF_H #define NULL ((void *)0) // Define sizes of various types #define SIZEOF_CHAR 1 #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 // Ensure this is set to 4 #define SIZEOF_LONG 8 #define SIZEOF_LONG_LONG 8 #define SIZEOF_POINTER 8 #define LONG_MAX 9223372036854775807 #define INT_MIN -2147483648 #define INT_MAX 2147483647 typedef unsigned long size_t; typedef long ptrdiff_t; typedef unsigned int wchar_t; typedef struct { long long __max_align_ll __attribute__((__aligned__(__alignof__(long long)))); long double __max_align_ld __attribute__((__aligned__(__alignof__(long double)))); } max_align_t; #ifndef __has_attribute #define __has_attribute(x) 1 #endif #define _Pragma(message) //#define __builtin_choose_expr(cond, true_expr, false_expr) (cond ? true_expr : false_expr) //#define offsetof(type, member) ((size_t)&(((type *)0)->member)) #define offsetof(type, member) __builtin_offsetof(type, member) //#define static_assert(x, msg) extern char STATIC_MSG(msg, __LINE__) [(x)?1:-1] // #ifndef _Static_assert #define CONCAT_(prefix, suffix) prefix##suffix /// Concatenate `prefix, suffix` into `prefixsuffix` #define CONCAT(prefix, suffix) CONCAT_(prefix, suffix) #define MAKE_UNIQUE_VARIABLE_NAME(prefix) CONCAT(prefix##_, __LINE__) //#define static_assert(x, msg) extern char STATIC_MSG(msg, __LINE__) [(x)?1:-1] //#define _Static_assert static_assert #define _Static_assert STATIC_ASSERT #define StaticAssertDecl STATIC_ASSERT #define Assert STATIC_ASSERT #define STATIC_ASSERT(COND,MSG) static int MAKE_UNIQUE_VARIABLE_NAME(prefix)[(COND)?1:-1] #define STATIC_ASSERT(COND) static int MAKE_UNIQUE_VARIABLE_NAME(prefix)[(COND)?1:-1] #define STATIC_ASSERT(...) // #endif /* _Static_assert */ #endif chibicc-1.0.24/include/stdnoreturn.h000077500000000000000000000001241517770275000173600ustar00rootroot00000000000000#ifndef __STDNORETURN_H #define __STDNORETURN_H #define noreturn _Noreturn #endif chibicc-1.0.24/include/tbmintrin.h000066400000000000000000000121721517770275000170020ustar00rootroot00000000000000/* Copyright (C) 2010-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _X86INTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _TBMINTRIN_H_INCLUDED #define _TBMINTRIN_H_INCLUDED #ifndef __TBM__ #pragma GCC push_options #pragma GCC target("tbm") #define __DISABLE_TBM__ #endif /* __TBM__ */ #ifdef __OPTIMIZE__ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __bextri_u32 (unsigned int __X, const unsigned int __I) { return __builtin_ia32_bextri_u32 (__X, __I); } #else #define __bextri_u32(X, I) \ ((unsigned int)__builtin_ia32_bextri_u32 ((unsigned int)(X), \ (unsigned int)(I))) #endif /*__OPTIMIZE__ */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blcfill_u32 (unsigned int __X) { return __X & (__X + 1); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blci_u32 (unsigned int __X) { return __X | ~(__X + 1); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blcic_u32 (unsigned int __X) { return ~__X & (__X + 1); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blcmsk_u32 (unsigned int __X) { return __X ^ (__X + 1); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blcs_u32 (unsigned int __X) { return __X | (__X + 1); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blsfill_u32 (unsigned int __X) { return __X | (__X - 1); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blsic_u32 (unsigned int __X) { return ~__X | (__X - 1); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __t1mskc_u32 (unsigned int __X) { return ~__X | (__X + 1); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __tzmsk_u32 (unsigned int __X) { return ~__X & (__X - 1); } #ifdef __x86_64__ #ifdef __OPTIMIZE__ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __bextri_u64 (unsigned long long __X, const unsigned int __I) { return __builtin_ia32_bextri_u64 (__X, __I); } #else #define __bextri_u64(X, I) \ ((unsigned long long)__builtin_ia32_bextri_u64 ((unsigned long long)(X), \ (unsigned long long)(I))) #endif /*__OPTIMIZE__ */ extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blcfill_u64 (unsigned long long __X) { return __X & (__X + 1); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blci_u64 (unsigned long long __X) { return __X | ~(__X + 1); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blcic_u64 (unsigned long long __X) { return ~__X & (__X + 1); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blcmsk_u64 (unsigned long long __X) { return __X ^ (__X + 1); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blcs_u64 (unsigned long long __X) { return __X | (__X + 1); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blsfill_u64 (unsigned long long __X) { return __X | (__X - 1); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __blsic_u64 (unsigned long long __X) { return ~__X | (__X - 1); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __t1mskc_u64 (unsigned long long __X) { return ~__X | (__X + 1); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __tzmsk_u64 (unsigned long long __X) { return ~__X & (__X - 1); } #endif /* __x86_64__ */ #ifdef __DISABLE_TBM__ #undef __DISABLE_TBM__ #pragma GCC pop_options #endif /* __DISABLE_TBM__ */ #endif /* _TBMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/tmmintrin.h000066400000000000000000000202271517770275000170150ustar00rootroot00000000000000/* Copyright (C) 2006-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 9.1. */ #ifndef _TMMINTRIN_H_INCLUDED #define _TMMINTRIN_H_INCLUDED /* We need definitions from the SSE3, SSE2 and SSE header files*/ #include #ifndef __SSSE3__ #pragma GCC push_options #pragma GCC target("ssse3") #define __DISABLE_SSSE3__ #endif /* __SSSE3__ */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadd_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phaddw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadd_epi32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phaddd128 ((__v4si)__X, (__v4si)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadds_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phaddsw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadd_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phaddw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadd_pi32 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phaddd ((__v2si)__X, (__v2si)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadds_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phaddsw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsub_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phsubw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsub_epi32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phsubd128 ((__v4si)__X, (__v4si)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsubs_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phsubsw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsub_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phsubw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsub_pi32 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phsubd ((__v2si)__X, (__v2si)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsubs_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phsubsw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_maddubs_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pmaddubsw128 ((__v16qi)__X, (__v16qi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_maddubs_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_pmaddubsw ((__v8qi)__X, (__v8qi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mulhrs_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pmulhrsw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mulhrs_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_pmulhrsw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_shuffle_epi8 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pshufb128 ((__v16qi)__X, (__v16qi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_shuffle_pi8 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_pshufb ((__v8qi)__X, (__v8qi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_epi8 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_psignb128 ((__v16qi)__X, (__v16qi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_psignw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_epi32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_psignd128 ((__v4si)__X, (__v4si)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_pi8 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_psignb ((__v8qi)__X, (__v8qi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_psignw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_pi32 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_psignd ((__v2si)__X, (__v2si)__Y); } #ifdef __OPTIMIZE__ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_alignr_epi8(__m128i __X, __m128i __Y, const int __N) { return (__m128i) __builtin_ia32_palignr128 ((__v2di)__X, (__v2di)__Y, __N * 8); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_alignr_pi8(__m64 __X, __m64 __Y, const int __N) { return (__m64) __builtin_ia32_palignr ((__v1di)__X, (__v1di)__Y, __N * 8); } #else #define _mm_alignr_epi8(X, Y, N) \ ((__m128i) __builtin_ia32_palignr128 ((__v2di)(__m128i)(X), \ (__v2di)(__m128i)(Y), \ (int)(N) * 8)) #define _mm_alignr_pi8(X, Y, N) \ ((__m64) __builtin_ia32_palignr ((__v1di)(__m64)(X), \ (__v1di)(__m64)(Y), \ (int)(N) * 8)) #endif extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_epi8 (__m128i __X) { return (__m128i) __builtin_ia32_pabsb128 ((__v16qi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_epi16 (__m128i __X) { return (__m128i) __builtin_ia32_pabsw128 ((__v8hi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_epi32 (__m128i __X) { return (__m128i) __builtin_ia32_pabsd128 ((__v4si)__X); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_pi8 (__m64 __X) { return (__m64) __builtin_ia32_pabsb ((__v8qi)__X); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_pi16 (__m64 __X) { return (__m64) __builtin_ia32_pabsw ((__v4hi)__X); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_pi32 (__m64 __X) { return (__m64) __builtin_ia32_pabsd ((__v2si)__X); } #ifdef __DISABLE_SSSE3__ #undef __DISABLE_SSSE3__ #pragma GCC pop_options #endif /* __DISABLE_SSSE3__ */ #endif /* _TMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/vaesintrin.h000066400000000000000000000071101517770275000171520ustar00rootroot00000000000000/* Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef __VAESINTRIN_H_INCLUDED #define __VAESINTRIN_H_INCLUDED #if !defined(__VAES__) || !defined(__AVX__) #pragma GCC push_options #pragma GCC target("vaes,avx") #define __DISABLE_VAES__ #endif /* __VAES__ */ // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_aesdec_epi128 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_vaesdec_v32qi ((__v32qi) __A, (__v32qi) __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_aesdeclast_epi128 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_vaesdeclast_v32qi ((__v32qi) __A, // (__v32qi) __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_aesenc_epi128 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_vaesenc_v32qi ((__v32qi) __A, (__v32qi) __B); // } // extern __inline __m256i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_aesenclast_epi128 (__m256i __A, __m256i __B) // { // return (__m256i)__builtin_ia32_vaesenclast_v32qi ((__v32qi) __A, // (__v32qi) __B); // } // #ifdef __DISABLE_VAES__ // #undef __DISABLE_VAES__ // #pragma GCC pop_options // #endif /* __DISABLE_VAES__ */ // #if !defined(__VAES__) || !defined(__AVX512F__) // #pragma GCC push_options // #pragma GCC target("vaes,avx512f") // #define __DISABLE_VAESF__ // #endif /* __VAES__ */ // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_aesdec_epi128 (__m512i __A, __m512i __B) // { // return (__m512i)__builtin_ia32_vaesdec_v64qi ((__v64qi) __A, (__v64qi) __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_aesdeclast_epi128 (__m512i __A, __m512i __B) // { // return (__m512i)__builtin_ia32_vaesdeclast_v64qi ((__v64qi) __A, // (__v64qi) __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_aesenc_epi128 (__m512i __A, __m512i __B) // { // return (__m512i)__builtin_ia32_vaesenc_v64qi ((__v64qi) __A, (__v64qi) __B); // } // extern __inline __m512i // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm512_aesenclast_epi128 (__m512i __A, __m512i __B) // { // return (__m512i)__builtin_ia32_vaesenclast_v64qi ((__v64qi) __A, // (__v64qi) __B); // } #ifdef __DISABLE_VAESF__ #undef __DISABLE_VAESF__ #pragma GCC pop_options #endif /* __DISABLE_VAES__ */ #endif /* __VAESINTRIN_H_INCLUDED */ chibicc-1.0.24/include/vpclmulqdqintrin.h000066400000000000000000000052471517770275000204150ustar00rootroot00000000000000/* Copyright (C) 2014-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _VPCLMULQDQINTRIN_H_INCLUDED #define _VPCLMULQDQINTRIN_H_INCLUDED #if !defined(__VPCLMULQDQ__) || !defined(__AVX512F__) #pragma GCC push_options #pragma GCC target("vpclmulqdq,avx512f") #define __DISABLE_VPCLMULQDQF__ #endif /* __VPCLMULQDQF__ */ #ifdef __OPTIMIZE__ extern __inline __m512i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm512_clmulepi64_epi128 (__m512i __A, __m512i __B, const int __C) { return (__m512i) __builtin_ia32_vpclmulqdq_v8di ((__v8di)__A, (__v8di) __B, __C); } #else #define _mm512_clmulepi64_epi128(A, B, C) \ ((__m512i) __builtin_ia32_vpclmulqdq_v8di ((__v8di)(__m512i)(A), \ (__v8di)(__m512i)(B), (int)(C))) #endif #ifdef __DISABLE_VPCLMULQDQF__ #undef __DISABLE_VPCLMULQDQF__ #pragma GCC pop_options #endif /* __DISABLE_VPCLMULQDQF__ */ #if !defined(__VPCLMULQDQ__) || !defined(__AVX__) #pragma GCC push_options #pragma GCC target("vpclmulqdq,avx") #define __DISABLE_VPCLMULQDQ__ #endif /* __VPCLMULQDQ__ */ #ifdef __OPTIMIZE__ extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm256_clmulepi64_epi128 (__m256i __A, __m256i __B, const int __C) { return (__m256i) __builtin_ia32_vpclmulqdq_v4di ((__v4di)__A, (__v4di) __B, __C); } #else #define _mm256_clmulepi64_epi128(A, B, C) \ ((__m256i) __builtin_ia32_vpclmulqdq_v4di ((__v4di)(__m256i)(A), \ (__v4di)(__m256i)(B), (int)(C))) #endif #ifdef __DISABLE_VPCLMULQDQ__ #undef __DISABLE_VPCLMULQDQ__ #pragma GCC pop_options #endif /* __DISABLE_VPCLMULQDQ__ */ #endif /* _VPCLMULQDQINTRIN_H_INCLUDED */ chibicc-1.0.24/include/waitpkgintrin.h000066400000000000000000000040051517770275000176620ustar00rootroot00000000000000/* Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _WAITPKG_H_INCLUDED #define _WAITPKG_H_INCLUDED #ifndef __WAITPKG__ #pragma GCC push_options #pragma GCC target("waitpkg") #define __DISABLE_WAITPKG__ #endif /* __WAITPKG__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _umonitor (void *__A) // { // __builtin_ia32_umonitor (__A); // } // extern __inline unsigned char // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _umwait (unsigned int __A, unsigned long long __B) // { // return __builtin_ia32_umwait (__A, __B); // } // extern __inline unsigned char // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _tpause (unsigned int __A, unsigned long long __B) // { // return __builtin_ia32_tpause (__A, __B); // } #ifdef __DISABLE_WAITPKG__ #undef __DISABLE_WAITPKG__ #pragma GCC pop_options #endif /* __DISABLE_WAITPKG__ */ #endif /* _WAITPKG_H_INCLUDED. */ chibicc-1.0.24/include/wbnoinvdintrin.h000066400000000000000000000031241517770275000200430ustar00rootroot00000000000000/* Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED #error "Never use directly; include instead." #endif #ifndef _WBNOINVDINTRIN_H_INCLUDED #define _WBNOINVDINTRIN_H_INCLUDED #ifndef __WBNOINVD__ #pragma GCC push_options #pragma GCC target("wbnoinvd") #define __DISABLE_WBNOINVD__ #endif /* __WBNOINVD__ */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _wbnoinvd (void) { __builtin_ia32_wbnoinvd (); } #ifdef __DISABLE_WBNOINVD__ #undef __DISABLE_WBNOINVD__ #pragma GCC pop_options #endif /* __DISABLE_WBNOINVD__ */ #endif /* _WBNOINVDINTRIN_H_INCLUDED */ chibicc-1.0.24/include/wmmintrin.h000066400000000000000000000113061517770275000170160ustar00rootroot00000000000000/* Copyright (C) 2008-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 10.1. */ #ifndef _WMMINTRIN_H_INCLUDED #define _WMMINTRIN_H_INCLUDED /* We need definitions from the SSE2 header file. */ #include /* AES */ #if !defined(__AES__) || !defined(__SSE2__) #pragma GCC push_options #pragma GCC target("aes,sse2") #define __DISABLE_AES__ #endif /* __AES__ */ // /* Performs 1 round of AES decryption of the first m128i using // the second m128i as a round key. */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_aesdec_si128 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_aesdec128 ((__v2di)__X, (__v2di)__Y); // } // /* Performs the last round of AES decryption of the first m128i // using the second m128i as a round key. */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_aesdeclast_si128 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_aesdeclast128 ((__v2di)__X, // (__v2di)__Y); // } // /* Performs 1 round of AES encryption of the first m128i using // the second m128i as a round key. */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_aesenc_si128 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_aesenc128 ((__v2di)__X, (__v2di)__Y); // } // /* Performs the last round of AES encryption of the first m128i // using the second m128i as a round key. */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_aesenclast_si128 (__m128i __X, __m128i __Y) // { // return (__m128i) __builtin_ia32_aesenclast128 ((__v2di)__X, (__v2di)__Y); // } // /* Performs the InverseMixColumn operation on the source m128i // and stores the result into m128i destination. */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_aesimc_si128 (__m128i __X) // { // return (__m128i) __builtin_ia32_aesimc128 ((__v2di)__X); // } // /* Generates a m128i round key for the input m128i AES cipher key and // byte round constant. The second parameter must be a compile time // constant. */ // #ifdef __OPTIMIZE__ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_aeskeygenassist_si128 (__m128i __X, const int __C) // { // return (__m128i) __builtin_ia32_aeskeygenassist128 ((__v2di)__X, __C); // } // #else // #define _mm_aeskeygenassist_si128(X, C) \ // ((__m128i) __builtin_ia32_aeskeygenassist128 ((__v2di)(__m128i)(X), \ // (int)(C))) // #endif #ifdef __DISABLE_AES__ #undef __DISABLE_AES__ #pragma GCC pop_options #endif /* __DISABLE_AES__ */ /* PCLMUL */ #if !defined(__PCLMUL__) || !defined(__SSE2__) #pragma GCC push_options #pragma GCC target("pclmul,sse2") #define __DISABLE_PCLMUL__ #endif /* __PCLMUL__ */ /* Performs carry-less integer multiplication of 64-bit halves of 128-bit input operands. The third parameter inducates which 64-bit haves of the input parameters v1 and v2 should be used. It must be a compile time constant. */ #ifdef __OPTIMIZE__ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_clmulepi64_si128 (__m128i __X, __m128i __Y, const int __I) { return (__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)__X, (__v2di)__Y, __I); } #else #define _mm_clmulepi64_si128(X, Y, I) \ ((__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)(__m128i)(X), \ (__v2di)(__m128i)(Y), (int)(I))) #endif #ifdef __DISABLE_PCLMUL__ #undef __DISABLE_PCLMUL__ #pragma GCC pop_options #endif /* __DISABLE_PCLMUL__ */ #endif /* _WMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/x86intrin.h000066400000000000000000000026251517770275000166470ustar00rootroot00000000000000/* Copyright (C) 2008-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _X86INTRIN_H_INCLUDED #define _X86INTRIN_H_INCLUDED #include #ifndef __iamcu__ /* For including AVX instructions */ #include #include #include #include #include #include #include #include #include #endif /* __iamcu__ */ #endif /* _X86INTRIN_H_INCLUDED */ chibicc-1.0.24/include/xmmintrin.h000066400000000000000000001265251517770275000170310ustar00rootroot00000000000000/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 9.0. */ #ifndef _XMMINTRIN_H_INCLUDED #define _XMMINTRIN_H_INCLUDED /* We need type definitions from the MMX header file. */ #include /* Get _mm_malloc () and _mm_free (). */ #include /* Constants for use with _mm_prefetch. */ enum _mm_hint { /* _MM_HINT_ET is _MM_HINT_T with set 3rd bit. */ _MM_HINT_ET0 = 7, _MM_HINT_ET1 = 6, _MM_HINT_T0 = 3, _MM_HINT_T1 = 2, _MM_HINT_T2 = 1, _MM_HINT_NTA = 0 }; /* Loads one cache line from address P to a location "closer" to the processor. The selector I specifies the type of prefetch operation. */ #ifdef __OPTIMIZE__ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_prefetch (const void *__P, enum _mm_hint __I) { __builtin_prefetch (__P, (__I & 0x4) >> 2, __I & 0x3); } #else #define _mm_prefetch(P, I) \ __builtin_prefetch ((P), ((I & 0x4) >> 2), (I & 0x3)) #endif #ifndef __SSE__ #pragma GCC push_options #pragma GCC target("sse") #define __DISABLE_SSE__ #endif /* __SSE__ */ /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); /* Unaligned version of the same type. */ typedef float __m128_u __attribute__ ((__vector_size__ (16), __may_alias__, __aligned__ (1))); /* Internal data types for implementing the intrinsics. */ typedef float __v4sf __attribute__ ((__vector_size__ (16))); /* Create a selector for use with the SHUFPS instruction. */ #define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) /* Bits in the MXCSR. */ #define _MM_EXCEPT_MASK 0x003f #define _MM_EXCEPT_INVALID 0x0001 #define _MM_EXCEPT_DENORM 0x0002 #define _MM_EXCEPT_DIV_ZERO 0x0004 #define _MM_EXCEPT_OVERFLOW 0x0008 #define _MM_EXCEPT_UNDERFLOW 0x0010 #define _MM_EXCEPT_INEXACT 0x0020 #define _MM_MASK_MASK 0x1f80 #define _MM_MASK_INVALID 0x0080 #define _MM_MASK_DENORM 0x0100 #define _MM_MASK_DIV_ZERO 0x0200 #define _MM_MASK_OVERFLOW 0x0400 #define _MM_MASK_UNDERFLOW 0x0800 #define _MM_MASK_INEXACT 0x1000 #define _MM_ROUND_MASK 0x6000 #define _MM_ROUND_NEAREST 0x0000 #define _MM_ROUND_DOWN 0x2000 #define _MM_ROUND_UP 0x4000 #define _MM_ROUND_TOWARD_ZERO 0x6000 #define _MM_FLUSH_ZERO_MASK 0x8000 #define _MM_FLUSH_ZERO_ON 0x8000 #define _MM_FLUSH_ZERO_OFF 0x0000 /* Create an undefined vector. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_undefined_ps (void) { __m128 __Y = __Y; return __Y; } /* Create a vector of zeros. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setzero_ps (void) { return __extension__ (__m128){ 0.0f, 0.0f, 0.0f, 0.0f }; } /* Perform the respective operation on the lower SPFP (single-precision floating-point) values of A and B; the upper three SPFP values are passed through from A. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mul_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_div_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_divss ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sqrt_ss (__m128 __A) { return (__m128) __builtin_ia32_sqrtss ((__v4sf)__A); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_rcp_ss (__m128 __A) { return (__m128) __builtin_ia32_rcpss ((__v4sf)__A); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_rsqrt_ss (__m128 __A) { return (__m128) __builtin_ia32_rsqrtss ((__v4sf)__A); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_minss ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_maxss ((__v4sf)__A, (__v4sf)__B); } /* Perform the respective operation on the four SPFP values in A and B. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_add_ps (__m128 __A, __m128 __B) { return (__m128) ((__v4sf)__A + (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sub_ps (__m128 __A, __m128 __B) { return (__m128) ((__v4sf)__A - (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mul_ps (__m128 __A, __m128 __B) { return (__m128) ((__v4sf)__A * (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_div_ps (__m128 __A, __m128 __B) { return (__m128) ((__v4sf)__A / (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sqrt_ps (__m128 __A) { return (__m128) __builtin_ia32_sqrtps ((__v4sf)__A); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_rcp_ps (__m128 __A) { return (__m128) __builtin_ia32_rcpps ((__v4sf)__A); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_rsqrt_ps (__m128 __A) { return (__m128) __builtin_ia32_rsqrtps ((__v4sf)__A); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_minps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_maxps ((__v4sf)__A, (__v4sf)__B); } /* Perform logical bit-wise operations on 128-bit values. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_and_ps (__m128 __A, __m128 __B) { return __builtin_ia32_andps (__A, __B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_andnot_ps (__m128 __A, __m128 __B) { return __builtin_ia32_andnps (__A, __B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_or_ps (__m128 __A, __m128 __B) { return __builtin_ia32_orps (__A, __B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_xor_ps (__m128 __A, __m128 __B) { return __builtin_ia32_xorps (__A, __B); } /* Perform a comparison on the lower SPFP values of A and B. If the comparison is true, place a mask of all ones in the result, otherwise a mask of zeros. The upper three SPFP values are passed through from A. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmplt_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpltss ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmple_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpless ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movss ((__v4sf) __A, (__v4sf) __builtin_ia32_cmpltss ((__v4sf) __B, (__v4sf) __A)); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpge_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movss ((__v4sf) __A, (__v4sf) __builtin_ia32_cmpless ((__v4sf) __B, (__v4sf) __A)); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpneq_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpneqss ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnlt_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpnltss ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnle_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpnless ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpngt_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movss ((__v4sf) __A, (__v4sf) __builtin_ia32_cmpnltss ((__v4sf) __B, (__v4sf) __A)); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnge_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movss ((__v4sf) __A, (__v4sf) __builtin_ia32_cmpnless ((__v4sf) __B, (__v4sf) __A)); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpord_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpordss ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpunord_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpunordss ((__v4sf)__A, (__v4sf)__B); } /* Perform a comparison on the four SPFP values of A and B. For each element, if the comparison is true, place a mask of all ones in the result, otherwise a mask of zeros. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpeqps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmplt_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpltps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmple_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpleps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpgtps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpge_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpgeps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpneq_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpneqps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnlt_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpnltps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnle_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpnleps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpngt_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpngtps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpnge_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpngeps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpord_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpordps ((__v4sf)__A, (__v4sf)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpunord_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpunordps ((__v4sf)__A, (__v4sf)__B); } /* Compare the lower SPFP values of A and B and return 1 if true and 0 if false. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comieq_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comieq ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comilt_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comilt ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comile_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comile ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comigt_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comigt ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comige_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comige ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_comineq_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comineq ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomieq_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomieq ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomilt_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomilt ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomile_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomile ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomigt_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomigt ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomige_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomige ((__v4sf)__A, (__v4sf)__B); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_ucomineq_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomineq ((__v4sf)__A, (__v4sf)__B); } /* Convert the lower SPFP value to a 32-bit integer according to the current rounding mode. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtss_si32 (__m128 __A) { return __builtin_ia32_cvtss2si ((__v4sf) __A); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvt_ss2si (__m128 __A) { return _mm_cvtss_si32 (__A); } #ifdef __x86_64__ /* Convert the lower SPFP value to a 32-bit integer according to the current rounding mode. */ /* Intel intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtss_si64 (__m128 __A) { return __builtin_ia32_cvtss2si64 ((__v4sf) __A); } /* Microsoft intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtss_si64x (__m128 __A) { return __builtin_ia32_cvtss2si64 ((__v4sf) __A); } #endif /* Convert the two lower SPFP values to 32-bit integers according to the current rounding mode. Return the integers in packed form. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtps_pi32 (__m128 __A) { return (__m64) __builtin_ia32_cvtps2pi ((__v4sf) __A); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvt_ps2pi (__m128 __A) { return _mm_cvtps_pi32 (__A); } /* Truncate the lower SPFP value to a 32-bit integer. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvttss_si32 (__m128 __A) { return __builtin_ia32_cvttss2si ((__v4sf) __A); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtt_ss2si (__m128 __A) { return _mm_cvttss_si32 (__A); } #ifdef __x86_64__ /* Truncate the lower SPFP value to a 32-bit integer. */ /* Intel intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvttss_si64 (__m128 __A) { return __builtin_ia32_cvttss2si64 ((__v4sf) __A); } /* Microsoft intrinsic. */ extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvttss_si64x (__m128 __A) { return __builtin_ia32_cvttss2si64 ((__v4sf) __A); } #endif /* Truncate the two lower SPFP values to 32-bit integers. Return the integers in packed form. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvttps_pi32 (__m128 __A) { return (__m64) __builtin_ia32_cvttps2pi ((__v4sf) __A); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtt_ps2pi (__m128 __A) { return _mm_cvttps_pi32 (__A); } /* Convert B to a SPFP value and insert it as element zero in A. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi32_ss (__m128 __A, int __B) { return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvt_si2ss (__m128 __A, int __B) { return _mm_cvtsi32_ss (__A, __B); } #ifdef __x86_64__ /* Convert B to a SPFP value and insert it as element zero in A. */ /* Intel intrinsic. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi64_ss (__m128 __A, long long __B) { return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B); } /* Microsoft intrinsic. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtsi64x_ss (__m128 __A, long long __B) { return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B); } #endif /* Convert the two 32-bit values in B to SPFP form and insert them as the two lower elements in A. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtpi32_ps (__m128 __A, __m64 __B) { return (__m128) __builtin_ia32_cvtpi2ps ((__v4sf) __A, (__v2si)__B); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvt_pi2ps (__m128 __A, __m64 __B) { return _mm_cvtpi32_ps (__A, __B); } /* Convert the four signed 16-bit values in A to SPFP form. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtpi16_ps (__m64 __A) { __v4hi __sign; __v2si __hisi, __losi; __v4sf __zero, __ra, __rb; /* This comparison against zero gives us a mask that can be used to fill in the missing sign bits in the unpack operations below, so that we get signed values after unpacking. */ __sign = __builtin_ia32_pcmpgtw ((__v4hi)0LL, (__v4hi)__A); /* Convert the four words to doublewords. */ __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign); __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign); /* Convert the doublewords to floating point two at a time. */ __zero = (__v4sf) _mm_setzero_ps (); __ra = __builtin_ia32_cvtpi2ps (__zero, __losi); __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi); return (__m128) __builtin_ia32_movlhps (__ra, __rb); } /* Convert the four unsigned 16-bit values in A to SPFP form. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtpu16_ps (__m64 __A) { __v2si __hisi, __losi; __v4sf __zero, __ra, __rb; /* Convert the four words to doublewords. */ __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL); __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL); /* Convert the doublewords to floating point two at a time. */ __zero = (__v4sf) _mm_setzero_ps (); __ra = __builtin_ia32_cvtpi2ps (__zero, __losi); __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi); return (__m128) __builtin_ia32_movlhps (__ra, __rb); } /* Convert the low four signed 8-bit values in A to SPFP form. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtpi8_ps (__m64 __A) { __v8qi __sign; /* This comparison against zero gives us a mask that can be used to fill in the missing sign bits in the unpack operations below, so that we get signed values after unpacking. */ __sign = __builtin_ia32_pcmpgtb ((__v8qi)0LL, (__v8qi)__A); /* Convert the four low bytes to words. */ __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __sign); return _mm_cvtpi16_ps(__A); } /* Convert the low four unsigned 8-bit values in A to SPFP form. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtpu8_ps(__m64 __A) { __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, (__v8qi)0LL); return _mm_cvtpu16_ps(__A); } /* Convert the four signed 32-bit values in A and B to SPFP form. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtpi32x2_ps(__m64 __A, __m64 __B) { __v4sf __zero = (__v4sf) _mm_setzero_ps (); __v4sf __sfa = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__A); __v4sf __sfb = __builtin_ia32_cvtpi2ps (__sfa, (__v2si)__B); return (__m128) __builtin_ia32_movlhps (__sfa, __sfb); } /* Convert the four SPFP values in A to four signed 16-bit integers. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtps_pi16(__m128 __A) { __v4sf __hisf = (__v4sf)__A; __v4sf __losf = __builtin_ia32_movhlps (__hisf, __hisf); __v2si __hisi = __builtin_ia32_cvtps2pi (__hisf); __v2si __losi = __builtin_ia32_cvtps2pi (__losf); return (__m64) __builtin_ia32_packssdw (__hisi, __losi); } /* Convert the four SPFP values in A to four signed 8-bit integers. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtps_pi8(__m128 __A) { __v4hi __tmp = (__v4hi) _mm_cvtps_pi16 (__A); return (__m64) __builtin_ia32_packsswb (__tmp, (__v4hi)0LL); } /* Selects four specific SPFP values from A and B based on MASK. */ #ifdef __OPTIMIZE__ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_shuffle_ps (__m128 __A, __m128 __B, int const __mask) { return (__m128) __builtin_ia32_shufps ((__v4sf)__A, (__v4sf)__B, __mask); } #else #define _mm_shuffle_ps(A, B, MASK) \ ((__m128) __builtin_ia32_shufps ((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), (int)(MASK))) #endif /* Selects and interleaves the upper two SPFP values from A and B. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpackhi_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_unpckhps ((__v4sf)__A, (__v4sf)__B); } /* Selects and interleaves the lower two SPFP values from A and B. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_unpacklo_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_unpcklps ((__v4sf)__A, (__v4sf)__B); } /* Sets the upper two SPFP values with 64-bits of data loaded from P; the lower two values are passed through from A. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadh_pi (__m128 __A, __m64 const *__P) { return (__m128) __builtin_ia32_loadhps ((__v4sf)__A, (const __v2sf *)__P); } /* Stores the upper two SPFP values of A into P. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storeh_pi (__m64 *__P, __m128 __A) { __builtin_ia32_storehps ((__v2sf *)__P, (__v4sf)__A); } /* Moves the upper two values of B into the lower two values of A. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movehl_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movhlps ((__v4sf)__A, (__v4sf)__B); } /* Moves the lower two values of B into the upper two values of A. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movelh_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movlhps ((__v4sf)__A, (__v4sf)__B); } /* Sets the lower two SPFP values with 64-bits of data loaded from P; the upper two values are passed through from A. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadl_pi (__m128 __A, __m64 const *__P) { return (__m128) __builtin_ia32_loadlps ((__v4sf)__A, (const __v2sf *)__P); } /* Stores the lower two SPFP values of A into P. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storel_pi (__m64 *__P, __m128 __A) { __builtin_ia32_storelps ((__v2sf *)__P, (__v4sf)__A); } /* Creates a 4-bit mask from the most significant bits of the SPFP values. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movemask_ps (__m128 __A) { return __builtin_ia32_movmskps ((__v4sf)__A); } /* Return the contents of the control register. */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_getcsr (void) { return __builtin_ia32_stmxcsr (); } /* Read exception bits from the control register. */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _MM_GET_EXCEPTION_STATE (void) { return _mm_getcsr() & _MM_EXCEPT_MASK; } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _MM_GET_EXCEPTION_MASK (void) { return _mm_getcsr() & _MM_MASK_MASK; } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _MM_GET_ROUNDING_MODE (void) { return _mm_getcsr() & _MM_ROUND_MASK; } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _MM_GET_FLUSH_ZERO_MODE (void) { return _mm_getcsr() & _MM_FLUSH_ZERO_MASK; } /* Set the control register to I. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setcsr (unsigned int __I) { __builtin_ia32_ldmxcsr (__I); } /* Set exception bits in the control register. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _MM_SET_EXCEPTION_STATE(unsigned int __mask) { _mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | __mask); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _MM_SET_EXCEPTION_MASK (unsigned int __mask) { _mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | __mask); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _MM_SET_ROUNDING_MODE (unsigned int __mode) { _mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | __mode); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) { _mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | __mode); } /* Create a vector with element 0 as F and the rest zero. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_ss (float __F) { return __extension__ (__m128)(__v4sf){ __F, 0.0f, 0.0f, 0.0f }; } /* Create a vector with all four elements equal to F. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_ps (float __F) { return __extension__ (__m128)(__v4sf){ __F, __F, __F, __F }; } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_ps1 (float __F) { return _mm_set1_ps (__F); } /* Create a vector with element 0 as *P and the rest zero. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_load_ss (float const *__P) { return _mm_set_ss (*__P); } /* Create a vector with all four elements equal to *P. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_load1_ps (float const *__P) { return _mm_set1_ps (*__P); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_load_ps1 (float const *__P) { return _mm_load1_ps (__P); } /* Load four SPFP values from P. The address must be 16-byte aligned. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_load_ps (float const *__P) { return *(__m128 *)__P; } /* Load four SPFP values from P. The address need not be 16-byte aligned. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadu_ps (float const *__P) { return *(__m128_u *)__P; } /* Load four SPFP values in reverse order. The address must be aligned. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadr_ps (float const *__P) { __v4sf __tmp = *(__v4sf *)__P; return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,1,2,3)); } /* Create the vector [Z Y X W]. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) { return __extension__ (__m128)(__v4sf){ __W, __X, __Y, __Z }; } /* Create the vector [W X Y Z]. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_ps (float __Z, float __Y, float __X, float __W) { return __extension__ (__m128)(__v4sf){ __Z, __Y, __X, __W }; } /* Stores the lower SPFP value. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_store_ss (float *__P, __m128 __A) { *__P = ((__v4sf)__A)[0]; } extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtss_f32 (__m128 __A) { return ((__v4sf)__A)[0]; } /* Store four SPFP values. The address must be 16-byte aligned. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_store_ps (float *__P, __m128 __A) { *(__m128 *)__P = __A; } /* Store four SPFP values. The address need not be 16-byte aligned. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storeu_ps (float *__P, __m128 __A) { *(__m128_u *)__P = __A; } /* Store the lower SPFP value across four words. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_store1_ps (float *__P, __m128 __A) { __v4sf __va = (__v4sf)__A; __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,0,0,0)); _mm_storeu_ps (__P, __tmp); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_store_ps1 (float *__P, __m128 __A) { _mm_store1_ps (__P, __A); } /* Store four SPFP values in reverse order. The address must be aligned. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storer_ps (float *__P, __m128 __A) { __v4sf __va = (__v4sf)__A; __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,1,2,3)); _mm_store_ps (__P, __tmp); } /* Sets the low SPFP value of A from the low value of B. */ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_move_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_shuffle ((__v4sf)__A, (__v4sf)__B, __extension__ (__attribute__((__vector_size__ (16))) int) {4,1,2,3}); } /* Extracts one of the four words of A. The selector N must be immediate. */ #ifdef __OPTIMIZE__ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_extract_pi16 (__m64 const __A, int const __N) { return __builtin_ia32_vec_ext_v4hi ((__v4hi)__A, __N); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pextrw (__m64 const __A, int const __N) { return _mm_extract_pi16 (__A, __N); } #else #define _mm_extract_pi16(A, N) \ ((int) __builtin_ia32_vec_ext_v4hi ((__v4hi)(__m64)(A), (int)(N))) #define _m_pextrw(A, N) _mm_extract_pi16(A, N) #endif /* Inserts word D into one of four words of A. The selector N must be immediate. */ #ifdef __OPTIMIZE__ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_insert_pi16 (__m64 const __A, int const __D, int const __N) { return (__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)__A, __D, __N); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pinsrw (__m64 const __A, int const __D, int const __N) { return _mm_insert_pi16 (__A, __D, __N); } #else #define _mm_insert_pi16(A, D, N) \ ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(__m64)(A), \ (int)(D), (int)(N))) #define _m_pinsrw(A, D, N) _mm_insert_pi16(A, D, N) #endif /* Compute the element-wise maximum of signed 16-bit values. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_pi16 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pmaxsw ((__v4hi)__A, (__v4hi)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pmaxsw (__m64 __A, __m64 __B) { return _mm_max_pi16 (__A, __B); } /* Compute the element-wise maximum of unsigned 8-bit values. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_max_pu8 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pmaxub ((__v8qi)__A, (__v8qi)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pmaxub (__m64 __A, __m64 __B) { return _mm_max_pu8 (__A, __B); } /* Compute the element-wise minimum of signed 16-bit values. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_pi16 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pminsw ((__v4hi)__A, (__v4hi)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pminsw (__m64 __A, __m64 __B) { return _mm_min_pi16 (__A, __B); } /* Compute the element-wise minimum of unsigned 8-bit values. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_min_pu8 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pminub ((__v8qi)__A, (__v8qi)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pminub (__m64 __A, __m64 __B) { return _mm_min_pu8 (__A, __B); } /* Create an 8-bit mask of the signs of 8-bit values. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movemask_pi8 (__m64 __A) { return __builtin_ia32_pmovmskb ((__v8qi)__A); } extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pmovmskb (__m64 __A) { return _mm_movemask_pi8 (__A); } /* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values in B and produce the high 16 bits of the 32-bit results. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mulhi_pu16 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pmulhuw ((__v4hi)__A, (__v4hi)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pmulhuw (__m64 __A, __m64 __B) { return _mm_mulhi_pu16 (__A, __B); } /* Return a combination of the four 16-bit values in A. The selector must be an immediate. */ #ifdef __OPTIMIZE__ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_shuffle_pi16 (__m64 __A, int const __N) { return (__m64) __builtin_ia32_pshufw ((__v4hi)__A, __N); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pshufw (__m64 __A, int const __N) { return _mm_shuffle_pi16 (__A, __N); } #else #define _mm_shuffle_pi16(A, N) \ ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(A), (int)(N))) #define _m_pshufw(A, N) _mm_shuffle_pi16 (A, N) #endif /* Conditionally store byte elements of A into P. The high bit of each byte in the selector N determines whether the corresponding byte from A is stored. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) { #ifdef __MMX_WITH_SSE__ /* Emulate MMX maskmovq with SSE2 maskmovdqu and handle unmapped bits 64:127 at address __P. */ typedef long long __v2di __attribute__ ((__vector_size__ (16))); typedef char __v16qi __attribute__ ((__vector_size__ (16))); /* Zero-extend __A and __N to 128 bits. */ __v2di __A128 = __extension__ (__v2di) { ((__v1di) __A)[0], 0 }; __v2di __N128 = __extension__ (__v2di) { ((__v1di) __N)[0], 0 }; /* Check the alignment of __P. */ __SIZE_TYPE__ offset = ((__SIZE_TYPE__) __P) & 0xf; if (offset) { /* If the misalignment of __P > 8, subtract __P by 8 bytes. Otherwise, subtract __P by the misalignment. */ if (offset > 8) offset = 8; __P = (char *) (((__SIZE_TYPE__) __P) - offset); /* Shift __A128 and __N128 to the left by the adjustment. */ switch (offset) { case 1: __A128 = __builtin_ia32_pslldqi128 (__A128, 8); __N128 = __builtin_ia32_pslldqi128 (__N128, 8); break; case 2: __A128 = __builtin_ia32_pslldqi128 (__A128, 2 * 8); __N128 = __builtin_ia32_pslldqi128 (__N128, 2 * 8); break; case 3: __A128 = __builtin_ia32_pslldqi128 (__A128, 3 * 8); __N128 = __builtin_ia32_pslldqi128 (__N128, 3 * 8); break; case 4: __A128 = __builtin_ia32_pslldqi128 (__A128, 4 * 8); __N128 = __builtin_ia32_pslldqi128 (__N128, 4 * 8); break; case 5: __A128 = __builtin_ia32_pslldqi128 (__A128, 5 * 8); __N128 = __builtin_ia32_pslldqi128 (__N128, 5 * 8); break; case 6: __A128 = __builtin_ia32_pslldqi128 (__A128, 6 * 8); __N128 = __builtin_ia32_pslldqi128 (__N128, 6 * 8); break; case 7: __A128 = __builtin_ia32_pslldqi128 (__A128, 7 * 8); __N128 = __builtin_ia32_pslldqi128 (__N128, 7 * 8); break; case 8: __A128 = __builtin_ia32_pslldqi128 (__A128, 8 * 8); __N128 = __builtin_ia32_pslldqi128 (__N128, 8 * 8); break; default: break; } } __builtin_ia32_maskmovdqu ((__v16qi)__A128, (__v16qi)__N128, __P); #else __builtin_ia32_maskmovq ((__v8qi)__A, (__v8qi)__N, __P); #endif } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_maskmovq (__m64 __A, __m64 __N, char *__P) { _mm_maskmove_si64 (__A, __N, __P); } /* Compute the rounded averages of the unsigned 8-bit values in A and B. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_avg_pu8 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pavgb ((__v8qi)__A, (__v8qi)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pavgb (__m64 __A, __m64 __B) { return _mm_avg_pu8 (__A, __B); } /* Compute the rounded averages of the unsigned 16-bit values in A and B. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_avg_pu16 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pavgw ((__v4hi)__A, (__v4hi)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pavgw (__m64 __A, __m64 __B) { return _mm_avg_pu16 (__A, __B); } /* Compute the sum of the absolute differences of the unsigned 8-bit values in A and B. Return the value in the lower 16-bit word; the upper words are cleared. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sad_pu8 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_psadbw ((__v8qi)__A, (__v8qi)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_psadbw (__m64 __A, __m64 __B) { return _mm_sad_pu8 (__A, __B); } /* Stores the data in A to the address P without polluting the caches. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_stream_pi (__m64 *__P, __m64 __A) { __builtin_ia32_movntq ((unsigned long long *)__P, (unsigned long long)__A); } /* Likewise. The address must be 16-byte aligned. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_stream_ps (float *__P, __m128 __A) { __builtin_ia32_movntps (__P, (__v4sf)__A); } /* Guarantees that every preceding store is globally visible before any subsequent store. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sfence (void) { __builtin_ia32_sfence (); } /* Transpose the 4x4 matrix composed of row[0-3]. */ #define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ do { \ __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \ __v4sf __t0 = __builtin_ia32_unpcklps (__r0, __r1); \ __v4sf __t1 = __builtin_ia32_unpcklps (__r2, __r3); \ __v4sf __t2 = __builtin_ia32_unpckhps (__r0, __r1); \ __v4sf __t3 = __builtin_ia32_unpckhps (__r2, __r3); \ (row0) = __builtin_ia32_movlhps (__t0, __t1); \ (row1) = __builtin_ia32_movhlps (__t1, __t0); \ (row2) = __builtin_ia32_movlhps (__t2, __t3); \ (row3) = __builtin_ia32_movhlps (__t3, __t2); \ } while (0) /* For backward source compatibility. */ # include #ifdef __DISABLE_SSE__ #undef __DISABLE_SSE__ #pragma GCC pop_options #endif /* __DISABLE_SSE__ */ /* The execution of the next instruction is delayed by an implementation specific amount of time. The instruction does not modify the architectural state. This is after the pop_options pragma because it does not require SSE support in the processor--the encoding is a nop on processors that do not support it. */ extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_pause (void) { __builtin_ia32_pause (); } #endif /* _XMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/xopintrin.h000066400000000000000000000741031517770275000170300ustar00rootroot00000000000000/* Copyright (C) 2007-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _X86INTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _XOPMMINTRIN_H_INCLUDED #define _XOPMMINTRIN_H_INCLUDED #include #ifndef __XOP__ #pragma GCC push_options #pragma GCC target("xop") #define __DISABLE_XOP__ #endif /* __XOP__ */ // /* Integer multiply/add instructions. */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maccs_epi16(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmacssww ((__v8hi)__A,(__v8hi)__B, (__v8hi)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_macc_epi16(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmacsww ((__v8hi)__A, (__v8hi)__B, (__v8hi)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maccsd_epi16(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmacsswd ((__v8hi)__A, (__v8hi)__B, (__v4si)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maccd_epi16(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmacswd ((__v8hi)__A, (__v8hi)__B, (__v4si)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maccs_epi32(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmacssdd ((__v4si)__A, (__v4si)__B, (__v4si)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_macc_epi32(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmacsdd ((__v4si)__A, (__v4si)__B, (__v4si)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maccslo_epi32(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmacssdql ((__v4si)__A, (__v4si)__B, (__v2di)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_macclo_epi32(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmacsdql ((__v4si)__A, (__v4si)__B, (__v2di)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maccshi_epi32(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmacssdqh ((__v4si)__A, (__v4si)__B, (__v2di)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_macchi_epi32(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmacsdqh ((__v4si)__A, (__v4si)__B, (__v2di)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maddsd_epi16(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmadcsswd ((__v8hi)__A,(__v8hi)__B,(__v4si)__C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_maddd_epi16(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpmadcswd ((__v8hi)__A,(__v8hi)__B,(__v4si)__C); // } // /* Packed Integer Horizontal Add and Subtract */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddw_epi8(__m128i __A) // { // return (__m128i) __builtin_ia32_vphaddbw ((__v16qi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddd_epi8(__m128i __A) // { // return (__m128i) __builtin_ia32_vphaddbd ((__v16qi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddq_epi8(__m128i __A) // { // return (__m128i) __builtin_ia32_vphaddbq ((__v16qi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddd_epi16(__m128i __A) // { // return (__m128i) __builtin_ia32_vphaddwd ((__v8hi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddq_epi16(__m128i __A) // { // return (__m128i) __builtin_ia32_vphaddwq ((__v8hi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddq_epi32(__m128i __A) // { // return (__m128i) __builtin_ia32_vphadddq ((__v4si)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddw_epu8(__m128i __A) // { // return (__m128i) __builtin_ia32_vphaddubw ((__v16qi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddd_epu8(__m128i __A) // { // return (__m128i) __builtin_ia32_vphaddubd ((__v16qi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddq_epu8(__m128i __A) // { // return (__m128i) __builtin_ia32_vphaddubq ((__v16qi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddd_epu16(__m128i __A) // { // return (__m128i) __builtin_ia32_vphadduwd ((__v8hi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddq_epu16(__m128i __A) // { // return (__m128i) __builtin_ia32_vphadduwq ((__v8hi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_haddq_epu32(__m128i __A) // { // return (__m128i) __builtin_ia32_vphaddudq ((__v4si)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_hsubw_epi8(__m128i __A) // { // return (__m128i) __builtin_ia32_vphsubbw ((__v16qi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_hsubd_epi16(__m128i __A) // { // return (__m128i) __builtin_ia32_vphsubwd ((__v8hi)__A); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_hsubq_epi32(__m128i __A) // { // return (__m128i) __builtin_ia32_vphsubdq ((__v4si)__A); // } // /* Vector conditional move and permute */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_cmov_si128(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpcmov (__A, __B, __C); // } // extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_cmov_si256(__m256i __A, __m256i __B, __m256i __C) // { // return (__m256i) __builtin_ia32_vpcmov256 (__A, __B, __C); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_perm_epi8(__m128i __A, __m128i __B, __m128i __C) // { // return (__m128i) __builtin_ia32_vpperm ((__v16qi)__A, (__v16qi)__B, (__v16qi)__C); // } // /* Packed Integer Rotates and Shifts // Rotates - Non-Immediate form */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rot_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vprotb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rot_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vprotw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rot_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vprotd ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_rot_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vprotq ((__v2di)__A, (__v2di)__B); // } // /* Rotates - Immediate form */ // #ifdef __OPTIMIZE__ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_roti_epi8(__m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_vprotbi ((__v16qi)__A, __B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_roti_epi16(__m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_vprotwi ((__v8hi)__A, __B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_roti_epi32(__m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_vprotdi ((__v4si)__A, __B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_roti_epi64(__m128i __A, const int __B) // { // return (__m128i) __builtin_ia32_vprotqi ((__v2di)__A, __B); // } // #else // #define _mm_roti_epi8(A, N) \ // ((__m128i) __builtin_ia32_vprotbi ((__v16qi)(__m128i)(A), (int)(N))) // #define _mm_roti_epi16(A, N) \ // ((__m128i) __builtin_ia32_vprotwi ((__v8hi)(__m128i)(A), (int)(N))) // #define _mm_roti_epi32(A, N) \ // ((__m128i) __builtin_ia32_vprotdi ((__v4si)(__m128i)(A), (int)(N))) // #define _mm_roti_epi64(A, N) \ // ((__m128i) __builtin_ia32_vprotqi ((__v2di)(__m128i)(A), (int)(N))) // #endif // /* Shifts */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shl_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpshlb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shl_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpshlw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shl_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpshld ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_shl_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpshlq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpshab ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpshaw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpshad ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_sha_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpshaq ((__v2di)__A, (__v2di)__B); // } // /* Compare and Predicate Generation // pcom (integer, unsigned bytes) */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comlt_epu8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomltub ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comle_epu8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomleub ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comgt_epu8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgtub ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comge_epu8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgeub ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comeq_epu8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomequb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comneq_epu8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomnequb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comfalse_epu8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomfalseub ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comtrue_epu8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomtrueub ((__v16qi)__A, (__v16qi)__B); // } // /*pcom (integer, unsigned words) */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comlt_epu16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomltuw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comle_epu16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomleuw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comgt_epu16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgtuw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comge_epu16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgeuw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comeq_epu16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomequw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comneq_epu16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomnequw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comfalse_epu16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomfalseuw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comtrue_epu16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomtrueuw ((__v8hi)__A, (__v8hi)__B); // } // /*pcom (integer, unsigned double words) */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comlt_epu32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomltud ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comle_epu32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomleud ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comgt_epu32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgtud ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comge_epu32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgeud ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comeq_epu32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomequd ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comneq_epu32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomnequd ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comfalse_epu32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomfalseud ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comtrue_epu32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomtrueud ((__v4si)__A, (__v4si)__B); // } // /*pcom (integer, unsigned quad words) */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comlt_epu64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomltuq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comle_epu64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomleuq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comgt_epu64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgtuq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comge_epu64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgeuq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comeq_epu64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomequq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comneq_epu64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomnequq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comfalse_epu64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomfalseuq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comtrue_epu64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomtrueuq ((__v2di)__A, (__v2di)__B); // } // /*pcom (integer, signed bytes) */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comlt_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomltb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comle_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomleb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comgt_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgtb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comge_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgeb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comeq_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomeqb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comneq_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomneqb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comfalse_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomfalseb ((__v16qi)__A, (__v16qi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comtrue_epi8(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomtrueb ((__v16qi)__A, (__v16qi)__B); // } // /*pcom (integer, signed words) */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comlt_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomltw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comle_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomlew ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comgt_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgtw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comge_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgew ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comeq_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomeqw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comneq_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomneqw ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comfalse_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomfalsew ((__v8hi)__A, (__v8hi)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comtrue_epi16(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomtruew ((__v8hi)__A, (__v8hi)__B); // } // /*pcom (integer, signed double words) */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comlt_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomltd ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comle_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomled ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comgt_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgtd ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comge_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomged ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comeq_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomeqd ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comneq_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomneqd ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comfalse_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomfalsed ((__v4si)__A, (__v4si)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comtrue_epi32(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomtrued ((__v4si)__A, (__v4si)__B); // } // /*pcom (integer, signed quad words) */ // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comlt_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomltq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comle_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomleq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comgt_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgtq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comge_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomgeq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comeq_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomeqq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comneq_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomneqq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comfalse_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomfalseq ((__v2di)__A, (__v2di)__B); // } // extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_comtrue_epi64(__m128i __A, __m128i __B) // { // return (__m128i) __builtin_ia32_vpcomtrueq ((__v2di)__A, (__v2di)__B); // } // /* FRCZ */ // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_frcz_ps (__m128 __A) // { // return (__m128) __builtin_ia32_vfrczps ((__v4sf)__A); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_frcz_pd (__m128d __A) // { // return (__m128d) __builtin_ia32_vfrczpd ((__v2df)__A); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_frcz_ss (__m128 __A, __m128 __B) // { // return (__m128) __builtin_ia32_movss ((__v4sf)__A, // (__v4sf) // __builtin_ia32_vfrczss ((__v4sf)__B)); // } // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_frcz_sd (__m128d __A, __m128d __B) // { // return (__m128d) __builtin_ia32_movsd ((__v2df)__A, // (__v2df) // __builtin_ia32_vfrczsd ((__v2df)__B)); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_frcz_ps (__m256 __A) // { // return (__m256) __builtin_ia32_vfrczps256 ((__v8sf)__A); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_frcz_pd (__m256d __A) // { // return (__m256d) __builtin_ia32_vfrczpd256 ((__v4df)__A); // } // /* PERMIL2 */ // #ifdef __OPTIMIZE__ // extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permute2_pd (__m128d __X, __m128d __Y, __m128i __C, const int __I) // { // return (__m128d) __builtin_ia32_vpermil2pd ((__v2df)__X, // (__v2df)__Y, // (__v2di)__C, // __I); // } // extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permute2_pd (__m256d __X, __m256d __Y, __m256i __C, const int __I) // { // return (__m256d) __builtin_ia32_vpermil2pd256 ((__v4df)__X, // (__v4df)__Y, // (__v4di)__C, // __I); // } // extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm_permute2_ps (__m128 __X, __m128 __Y, __m128i __C, const int __I) // { // return (__m128) __builtin_ia32_vpermil2ps ((__v4sf)__X, // (__v4sf)__Y, // (__v4si)__C, // __I); // } // extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _mm256_permute2_ps (__m256 __X, __m256 __Y, __m256i __C, const int __I) // { // return (__m256) __builtin_ia32_vpermil2ps256 ((__v8sf)__X, // (__v8sf)__Y, // (__v8si)__C, // __I); // } // #else // #define _mm_permute2_pd(X, Y, C, I) \ // ((__m128d) __builtin_ia32_vpermil2pd ((__v2df)(__m128d)(X), \ // (__v2df)(__m128d)(Y), \ // (__v2di)(__m128i)(C), \ // (int)(I))) // #define _mm256_permute2_pd(X, Y, C, I) \ // ((__m256d) __builtin_ia32_vpermil2pd256 ((__v4df)(__m256d)(X), \ // (__v4df)(__m256d)(Y), \ // (__v4di)(__m256i)(C), \ // (int)(I))) // #define _mm_permute2_ps(X, Y, C, I) \ // ((__m128) __builtin_ia32_vpermil2ps ((__v4sf)(__m128)(X), \ // (__v4sf)(__m128)(Y), \ // (__v4si)(__m128i)(C), \ // (int)(I))) // #define _mm256_permute2_ps(X, Y, C, I) \ // ((__m256) __builtin_ia32_vpermil2ps256 ((__v8sf)(__m256)(X), \ // (__v8sf)(__m256)(Y), \ // (__v8si)(__m256i)(C), \ // (int)(I))) // #endif /* __OPTIMIZE__ */ #ifdef __DISABLE_XOP__ #undef __DISABLE_XOP__ #pragma GCC pop_options #endif /* __DISABLE_XOP__ */ #endif /* _XOPMMINTRIN_H_INCLUDED */ chibicc-1.0.24/include/xsavecintrin.h000066400000000000000000000035071517770275000175130ustar00rootroot00000000000000/* Copyright (C) 2014-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _XSAVECINTRIN_H_INCLUDED #define _XSAVECINTRIN_H_INCLUDED #ifndef __XSAVEC__ #pragma GCC push_options #pragma GCC target("xsavec") #define __DISABLE_XSAVEC__ #endif /* __XSAVEC__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xsavec (void *__P, long long __M) // { // __builtin_ia32_xsavec (__P, __M); // } // #ifdef __x86_64__ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xsavec64 (void *__P, long long __M) // { // __builtin_ia32_xsavec64 (__P, __M); // } // #endif #ifdef __DISABLE_XSAVEC__ #undef __DISABLE_XSAVEC__ #pragma GCC pop_options #endif /* __DISABLE_XSAVEC__ */ #endif /* _XSAVECINTRIN_H_INCLUDED */ chibicc-1.0.24/include/xsaveintrin.h000066400000000000000000000050321517770275000173430ustar00rootroot00000000000000/* Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _XSAVEINTRIN_H_INCLUDED #define _XSAVEINTRIN_H_INCLUDED #ifndef __XSAVE__ #pragma GCC push_options #pragma GCC target("xsave") #define __DISABLE_XSAVE__ #endif /* __XSAVE__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xsave (void *__P, long long __M) // { // __builtin_ia32_xsave (__P, __M); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xrstor (void *__P, long long __M) // { // __builtin_ia32_xrstor (__P, __M); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xsetbv (unsigned int __A, long long __V) // { // __builtin_ia32_xsetbv (__A, __V); // } // extern __inline long long // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xgetbv (unsigned int __A) // { // return __builtin_ia32_xgetbv (__A); // } // #ifdef __x86_64__ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xsave64 (void *__P, long long __M) // { // __builtin_ia32_xsave64 (__P, __M); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xrstor64 (void *__P, long long __M) // { // __builtin_ia32_xrstor64 (__P, __M); // } // #endif #ifdef __DISABLE_XSAVE__ #undef __DISABLE_XSAVE__ #pragma GCC pop_options #endif /* __DISABLE_XSAVE__ */ #endif /* _XSAVEINTRIN_H_INCLUDED */ chibicc-1.0.24/include/xsaveoptintrin.h000066400000000000000000000035451517770275000200750ustar00rootroot00000000000000/* Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _XSAVEOPTINTRIN_H_INCLUDED #define _XSAVEOPTINTRIN_H_INCLUDED #ifndef __XSAVEOPT__ #pragma GCC push_options #pragma GCC target("xsaveopt") #define __DISABLE_XSAVEOPT__ #endif /* __XSAVEOPT__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xsaveopt (void *__P, long long __M) // { // __builtin_ia32_xsaveopt (__P, __M); // } // #ifdef __x86_64__ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xsaveopt64 (void *__P, long long __M) // { // __builtin_ia32_xsaveopt64 (__P, __M); // } // #endif #ifdef __DISABLE_XSAVEOPT__ #undef __DISABLE_XSAVEOPT__ #pragma GCC pop_options #endif /* __DISABLE_XSAVEOPT__ */ #endif /* _XSAVEOPTINTRIN_H_INCLUDED */ chibicc-1.0.24/include/xsavesintrin.h000066400000000000000000000042731517770275000175340ustar00rootroot00000000000000/* Copyright (C) 2014-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #if !defined _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _XSAVESINTRIN_H_INCLUDED #define _XSAVESINTRIN_H_INCLUDED #ifndef __XSAVES__ #pragma GCC push_options #pragma GCC target("xsaves") #define __DISABLE_XSAVES__ #endif /* __XSAVES__ */ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xsaves (void *__P, long long __M) // { // __builtin_ia32_xsaves (__P, __M); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xrstors (void *__P, long long __M) // { // __builtin_ia32_xrstors (__P, __M); // } // #ifdef __x86_64__ // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xrstors64 (void *__P, long long __M) // { // __builtin_ia32_xrstors64 (__P, __M); // } // extern __inline void // __attribute__((__gnu_inline__, __always_inline__, __artificial__)) // _xsaves64 (void *__P, long long __M) // { // __builtin_ia32_xsaves64 (__P, __M); // } // #endif #ifdef __DISABLE_XSAVES__ #undef __DISABLE_XSAVES__ #pragma GCC pop_options #endif /* __DISABLE_XSAVES__ */ #endif /* _XSAVESINTRIN_H_INCLUDED */ chibicc-1.0.24/include/xtestintrin.h000066400000000000000000000032271517770275000173700ustar00rootroot00000000000000/* Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _IMMINTRIN_H_INCLUDED # error "Never use directly; include instead." #endif #ifndef _XTESTINTRIN_H_INCLUDED #define _XTESTINTRIN_H_INCLUDED #ifndef __RTM__ #pragma GCC push_options #pragma GCC target("rtm") #define __DISABLE_RTM__ #endif /* __RTM__ */ /* Return non-zero if the instruction executes inside an RTM or HLE code region. Return zero otherwise. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _xtest (void) { return __builtin_ia32_xtest (); } #ifdef __DISABLE_RTM__ #undef __DISABLE_RTM__ #pragma GCC pop_options #endif /* __DISABLE_RTM__ */ #endif /* _XTESTINTRIN_H_INCLUDED */ chibicc-1.0.24/issues/000077500000000000000000000000001517770275000145105ustar00rootroot00000000000000chibicc-1.0.24/issues/arch-x86.h000066400000000000000000000162651517770275000162330ustar00rootroot00000000000000/*------------------------------------------------------------------------- * * arch-x86.h * Atomic operations considerations specific to intel x86 * * Note that we actually require a 486 upwards because the 386 doesn't have * support for xadd and cmpxchg. Given that the 386 isn't supported anywhere * anymore that's not much of a restriction luckily. * * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * NOTES: * * src/include/port/atomics/arch-x86.h * *------------------------------------------------------------------------- */ /* * Both 32 and 64 bit x86 do not allow loads to be reordered with other loads, * or stores to be reordered with other stores, but a load can be performed * before a subsequent store. * * Technically, some x86-ish chips support uncached memory access and/or * special instructions that are weakly ordered. In those cases we'd need * the read and write barriers to be lfence and sfence. But since we don't * do those things, a compiler barrier should be enough. * * "lock; addl" has worked for longer than "mfence". It's also rumored to be * faster in many scenarios. */ #if defined(__GNUC__) || defined(__INTEL_COMPILER) #if defined(__i386__) || defined(__i386) #define pg_memory_barrier_impl() \ __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory", "cc") #elif defined(__x86_64__) #define pg_memory_barrier_impl() \ __asm__ __volatile__ ("lock; addl $0,0(%%rsp)" : : : "memory", "cc") #endif #endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */ #define pg_read_barrier_impl() pg_compiler_barrier_impl() #define pg_write_barrier_impl() pg_compiler_barrier_impl() /* * Provide implementation for atomics using inline assembly on x86 gcc. It's * nice to support older gcc's and the compare/exchange implementation here is * actually more efficient than the * __sync variant. */ #if defined(HAVE_ATOMICS) #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define PG_HAVE_ATOMIC_FLAG_SUPPORT typedef struct pg_atomic_flag { volatile char value; } pg_atomic_flag; #define PG_HAVE_ATOMIC_U32_SUPPORT typedef struct pg_atomic_uint32 { volatile uint32 value; } pg_atomic_uint32; /* * It's too complicated to write inline asm for 64bit types on 32bit and the * 486 can't do it anyway. */ #ifdef __x86_64__ #define PG_HAVE_ATOMIC_U64_SUPPORT typedef struct pg_atomic_uint64 { /* alignment guaranteed due to being on a 64bit platform */ volatile uint64 value; } pg_atomic_uint64; #endif /* __x86_64__ */ #endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */ #endif /* defined(HAVE_ATOMICS) */ #if !defined(PG_HAVE_SPIN_DELAY) /* * This sequence is equivalent to the PAUSE instruction ("rep" is * ignored by old IA32 processors if the following instruction is * not a string operation); the IA-32 Architecture Software * Developer's Manual, Vol. 3, Section 7.7.2 describes why using * PAUSE in the inner loop of a spin lock is necessary for good * performance: * * The PAUSE instruction improves the performance of IA-32 * processors supporting Hyper-Threading Technology when * executing spin-wait loops and other routines where one * thread is accessing a shared lock or semaphore in a tight * polling loop. When executing a spin-wait loop, the * processor can suffer a severe performance penalty when * exiting the loop because it detects a possible memory order * violation and flushes the core processor's pipeline. The * PAUSE instruction provides a hint to the processor that the * code sequence is a spin-wait loop. The processor uses this * hint to avoid the memory order violation and prevent the * pipeline flush. In addition, the PAUSE instruction * de-pipelines the spin-wait loop to prevent it from * consuming execution resources excessively. */ #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define PG_HAVE_SPIN_DELAY static __inline__ void pg_spin_delay_impl(void) { __asm__ __volatile__(" rep; nop \n"); } #elif defined(_MSC_VER) && defined(__x86_64__) #define PG_HAVE_SPIN_DELAY static __forceinline void pg_spin_delay_impl(void) { _mm_pause(); } #elif defined(_MSC_VER) #define PG_HAVE_SPIN_DELAY static __forceinline void pg_spin_delay_impl(void) { /* See comment for gcc code. Same code, MASM syntax */ __asm rep nop; } #endif #endif /* !defined(PG_HAVE_SPIN_DELAY) */ #if defined(HAVE_ATOMICS) #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define PG_HAVE_ATOMIC_TEST_SET_FLAG static inline bool pg_atomic_test_set_flag_impl(volatile pg_atomic_flag *ptr) { char _res = 1; __asm__ __volatile__( " lock \n" " xchgb %0,%1 \n" : "+q"(_res), "+m"(ptr->value) : : "memory"); return _res == 0; } #define PG_HAVE_ATOMIC_CLEAR_FLAG static inline void pg_atomic_clear_flag_impl(volatile pg_atomic_flag *ptr) { /* * On a TSO architecture like x86 it's sufficient to use a compiler * barrier to achieve release semantics. */ __asm__ __volatile__("" ::: "memory"); ptr->value = 0; } #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32 static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 *expected, uint32 newval) { char ret; /* * Perform cmpxchg and use the zero flag which it implicitly sets when * equal to measure the success. */ __asm__ __volatile__( " lock \n" " cmpxchgl %4,%5 \n" " setz %2 \n" : "=a" (*expected), "=m"(ptr->value), "=q" (ret) : "a" (*expected), "r" (newval), "m"(ptr->value) : "memory", "cc"); return (bool) ret; } #define PG_HAVE_ATOMIC_FETCH_ADD_U32 static inline uint32 pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int32 add_) { uint32 res; __asm__ __volatile__( " lock \n" " xaddl %0,%1 \n" : "=q"(res), "=m"(ptr->value) : "0" (add_), "m"(ptr->value) : "memory", "cc"); return res; } #ifdef __x86_64__ #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64 static inline bool pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 *expected, uint64 newval) { char ret; /* * Perform cmpxchg and use the zero flag which it implicitly sets when * equal to measure the success. */ __asm__ __volatile__( " lock \n" " cmpxchgq %4,%5 \n" " setz %2 \n" : "=a" (*expected), "=m"(ptr->value), "=q" (ret) : "a" (*expected), "r" (newval), "m"(ptr->value) : "memory", "cc"); return (bool) ret; } #define PG_HAVE_ATOMIC_FETCH_ADD_U64 static inline uint64 pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_) { uint64 res; __asm__ __volatile__( " lock \n" " xaddq %0,%1 \n" : "=q"(res), "=m"(ptr->value) : "0" (add_), "m"(ptr->value) : "memory", "cc"); return res; } #endif /* __x86_64__ */ #endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */ /* * 8 byte reads / writes have single-copy atomicity on 32 bit x86 platforms * since at least the 586. As well as on all x86-64 cpus. */ #if defined(__i568__) || defined(__i668__) || /* gcc i586+ */ \ (defined(_M_IX86) && _M_IX86 >= 500) || /* msvc i586+ */ \ defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) /* gcc, sunpro, msvc */ #define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY #endif /* 8 byte single-copy atomicity */ #endif /* HAVE_ATOMICS */ chibicc-1.0.24/issues/attr_aligned.c000066400000000000000000000332121517770275000173120ustar00rootroot00000000000000#include "test.h" #include #define A1 __attribute__((aligned(1024))) #define A2 __attribute__((aligned(4096))) #define B1 [[gnu::aligned(1024)]] #define P __attribute__((packed)) A1 struct { int i; } g0, g1; struct A1 { int i; } g2, g3; struct { int i; } A1 g4, g5; struct { int i; } g6, A1 g7; struct { int i; } g8, g9 A1; B1 struct { int i; } g20, g21; struct B1 { int i; } g22, g23; struct { int i; } g28, g29 B1; struct { int i; } *A1 g31; struct { int i; } g32 [1]A1; struct { int i; } g33 B1[1]; int main(int argc, char **argv) { ASSERT(0, (long)&g1 & 1023); ASSERT(0, (long)&g3 & 1023); ASSERT(0, (long)&g5 & 1023); ASSERT(0, (long)&g7 & 1023); ASSERT(0, (long)&g9 & 1023); ASSERT(0, (long)&g21 & 1023); ASSERT(0, (long)&g23 & 1023); ASSERT(0, (long)&g29 & 1023); ASSERT(0, (long)&g31 & 1023); ASSERT(0, (long)&g32[0] & 1023); ASSERT(0, (long)&g33[0] & 1023); ASSERT(4, (long)&g32[1] & 1023); ASSERT(4, (long)&g33[1] & 1023); ASSERT(0, ({ A1 struct { int i; } x, y; (long)&y & 1023; }) ); ASSERT(0, ({ struct A1 { int i; } x, y; (long)&y & 1023; }) ); ASSERT(0, ({ struct { int i; } A1 x, y; (long)&y & 1023; }) ); ASSERT(0, ({ struct { int i; } x, A1 y; (long)&y & 1023; }) ); ASSERT(0, ({ struct { int i; } x, y A1; (long)&y & 1023; }) ); ASSERT(0, ({ struct { int i; } A2 x, y A1; (long)&y & 4095; }) ); ASSERT(0, ({ struct { int i; } A1 x, y A2; (long)&y & 4095; }) ); ASSERT(0, ({ struct { A1 int i, j; } x; (long)&x.j & 1023; }) ); ASSERT(0, ({ struct { int A1 i, j; } x; (long)&x.j & 1023; }) ); #ifdef NOTGCC ASSERT(0, ({ struct { int i, A1 j; } x; (long)&x.j & 1023; }) ); #endif ASSERT(0, ({ struct { int i, j A1; } x; (long)&x.j & 1023; }) ); ASSERT(0, ({ struct { A1 struct { int i; }; } x, y; (long)&y & 1023; }) ); // clang behaviour ASSERT(0, ({ struct { struct A1 { int i; }; } x, y; (long)&y & 1023; }) ); ASSERT(0, ({ struct { struct { int i; } A1; } x, y; (long)&y & 1023; }) ); ASSERT(0, ({ B1 struct { int i; } x, y; (long)&y & 1023; }) ); ASSERT(0, ({ struct B1 { int i; } x, y; (long)&y & 1023; }) ); ASSERT(0, ({ struct { int i; } x, y B1; (long)&y & 1023; }) ); ASSERT(0, ({ struct { B1 int i, j; } x; (long)&x.j & 1023; }) ); ASSERT(0, ({ struct { int i, j B1; } x; (long)&x.j & 1023; }) ); ASSERT(0, ({ A1 static char x; (long)&x & 1023; }) ); ASSERT(0, ({ static A1 char x; (long)&x & 1023; }) ); ASSERT(0, ({ static char A1 x; (long)&x & 1023; }) ); ASSERT(0, ({ static char x A1; (long)&x & 1023; }) ); ASSERT(0, ({ A1 char x[argc]; (long)&x[0] & 1023; }) ); ASSERT(0, ({ char A1 x[argc]; (long)&x[0] & 1023; }) ); ASSERT(0, ({ char x[argc] A1; (long)&x[0] & 1023; }) ); ASSERT(1024, ({ A1 typedef char c; _Alignof(c); }) ); ASSERT(1024, ({ typedef A1 char c; _Alignof(c); }) ); ASSERT(1024, ({ typedef char A1 c; _Alignof(c); }) ); ASSERT(1024, ({ typedef char c A1; _Alignof(c); }) ); ASSERT(16, ({ [[gnu::aligned]] typedef char c; _Alignof(c); }) ); ASSERT(16, ({ typedef char c [[gnu::aligned]]; _Alignof(c); }) ); ASSERT(1, _Alignof(char)); ASSERT(0, ({ A1 typedef struct { int i; } S; S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef A1 struct { int i; } S; S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct A1 { int i; } S; S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct { int i; } A1 S; S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct { int i; } S A1; S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct { int i; } S; A1 S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct { int i; } S; S A1 x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct { int i; } S; S x A1; (long)&x & 1023; }) ); ASSERT(8, ({ struct S { char c; void*p; }; offsetof(struct S, p);}) ); ASSERT(16, ({ struct S { char c; void*p; }; sizeof(struct S);}) ); ASSERT(1, ({ struct S { char c; void*p; } P; offsetof(struct S, p);}) ); ASSERT(9, ({ struct S { char c; void*p; } P; sizeof(struct S);}) ); ASSERT(8, ({ struct S { char c; void*p [[gnu::aligned(2)]]; }; offsetof(struct S, p);}) ); ASSERT(16, ({ struct S { char c; void*p [[gnu::aligned(2)]]; }; sizeof(struct S);}) ); ASSERT(2, ({ struct S { char c; void*p [[gnu::aligned(2)]]; } P; offsetof(struct S, p);}) ); ASSERT(10, ({ struct S { char c; void*p [[gnu::aligned(2)]]; } P; sizeof(struct S);}) ); ASSERT(8, ({ struct S { char c; void*p [[gnu::aligned(4)]]; }; offsetof(struct S, p);}) ); ASSERT(16, ({ struct S { char c; void*p [[gnu::aligned(4)]]; }; sizeof(struct S);}) ); ASSERT(4, ({ struct S { char c; void*p [[gnu::aligned(4)]]; } P; offsetof(struct S, p);}) ); ASSERT(12, ({ struct S { char c; void*p [[gnu::aligned(4)]]; } P; sizeof(struct S);}) ); ASSERT(8, ({ struct S { char c; void*p [[gnu::aligned(8)]]; }; offsetof(struct S, p);}) ); ASSERT(16, ({ struct S { char c; void*p [[gnu::aligned(8)]]; }; sizeof(struct S);}) ); ASSERT(8, ({ struct S { char c; void*p [[gnu::aligned(8)]]; } P; offsetof(struct S, p);}) ); ASSERT(16, ({ struct S { char c; void*p [[gnu::aligned(8)]]; } P; sizeof(struct S);}) ); ASSERT(16, ({ struct S { char c; void*p [[gnu::aligned(16)]]; }; offsetof(struct S, p);}) ); ASSERT(32, ({ struct S { char c; void*p [[gnu::aligned(16)]]; }; sizeof(struct S);}) ); ASSERT(16, ({ struct S { char c; void*p [[gnu::aligned(16)]]; } P; offsetof(struct S, p);}) ); ASSERT(32, ({ struct S { char c; void*p [[gnu::aligned(16)]]; } P; sizeof(struct S);}) ); ASSERT(32, ({ struct S { char c; void*p [[gnu::aligned(32)]]; }; offsetof(struct S, p);}) ); ASSERT(64, ({ struct S { char c; void*p [[gnu::aligned(32)]]; }; sizeof(struct S);}) ); ASSERT(32, ({ struct S { char c; void*p [[gnu::aligned(32)]]; } P; offsetof(struct S, p);}) ); ASSERT(64, ({ struct S { char c; void*p [[gnu::aligned(32)]]; } P; sizeof(struct S);}) ); ASSERT(8192, ({ typedef struct { struct { long m3 A2; }; A1 short m4; } T; sizeof(T); })); ASSERT(4096, ({ typedef struct { struct { long m3 A2; }; A1 short m4; } T; offsetof(T, m4); })); ASSERT(32, ({ typedef struct { char m1; union { long double m6 __attribute__((aligned(4))); long m7; }; } T; sizeof(T); })); ASSERT(16, ({ typedef struct { char m1; union { long double m6 __attribute__((aligned(4))); long m7; }; } T; offsetof(T, m7); })); ASSERT(20, ({ typedef struct { char m1; union { long double m6 __attribute__((aligned(4))); long m7; } P; } T; sizeof(T); })); ASSERT(4, ({ typedef struct { char m1; union { long double m6 __attribute__((aligned(4))); long m7; } P; } T; offsetof(T, m7); })); ASSERT(1026, ({ typedef struct { short : 2, : 4 A1; char c; } T; sizeof(T); })); ASSERT(1025, ({ typedef struct { short : 2, : 4 A1; char c; } T; offsetof(T, c); })); ASSERT(17, ({ typedef struct { char : 6, : 0 __attribute__((aligned)), m6; } T; sizeof(T); })); ASSERT(16, ({ typedef struct { char : 6, : 0 __attribute__((aligned)), m6; } T; offsetof(T, m6); })); ASSERT(8, ({struct { long m1:5 __attribute__((aligned(4))); } T; sizeof(T); })); ASSERT(16, ({ typedef struct { short s; long m2 : 48 __attribute__((aligned(4))); } T; sizeof(T); })); #ifdef NOTCLANG ASSERT(14, ({ typedef struct { short s; long m2 : 48 __attribute__((aligned(4))); char c; } T; offsetof(T,c); })); #endif ASSERT(8, ({ typedef struct { char m1; int : 26 __attribute__((aligned(2))); } T; sizeof(T); })); ASSERT(8, ({ typedef struct { char m1; int : 26 __attribute__((aligned(2))); char c; } T; offsetof(T,c); })); ASSERT(16, ({ struct { int m1 __attribute__((aligned));} P t; sizeof(t); })); ASSERT(1028, ({ typedef struct { struct { char c; } A1; int m4; } P T; sizeof (T); })); ASSERT(1024, ({ typedef struct { struct { char c; } A1; int m4; } P T; offsetof (T, m4); })); ASSERT(1025, ({ typedef struct { struct { char m2; union { int m4; } A1; } P; } T; sizeof(T);})); ASSERT(1, ({ typedef struct { struct { char m2; union { int m4; } A1; } P; } T; offsetof(T,m4);})); ASSERT(1024, ({ typedef struct { A1 struct { char c; } j; char m6; } T; sizeof(T); })); ASSERT(1024, ({ typedef struct { A1 struct { char c; } j; } T; sizeof(T); })); ASSERT(1024, ({ typedef struct { A1 struct { char c; }; } T; sizeof(T); })); // clang behaviour #ifdef NOTCLANG ASSERT(1, ({ typedef struct { A1 struct { char c; }; } T; sizeof(T); })); // gcc behaviour #endif ASSERT(3, ({ A1 typedef struct { struct { char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(3, ({ typedef A1 struct { struct { char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(1024, ({ typedef struct A1 { struct { char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(2048, ({ typedef struct { A1 struct { char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(3072, ({ typedef struct { struct A1 { char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(3072, ({ typedef struct { struct { A1 char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(3072, ({ typedef struct { struct { char A1 c; } j, k; char m6; } T; sizeof(T); })); ASSERT(3072, ({ typedef struct { struct { char c A1; } j, k; char m6; } T; sizeof(T); })); ASSERT(3072, ({ typedef struct { struct { char c; } A1 j, k; char m6; } T; sizeof(T); })); ASSERT(1024, ({ typedef struct { struct { char c; } j A1, k; char m6; } T; sizeof(T); })); #ifdef NOTGCC ASSERT(2048, ({ typedef struct { struct { char c; } j, A1 k; char m6; } T; sizeof(T); })); #endif ASSERT(2048, ({ typedef struct { struct { char c; } j, k A1; char m6; } T; sizeof(T); })); ASSERT(2048, ({ typedef struct { struct { char c; } j, k; A1 char m6; } T; sizeof(T); })); ASSERT(2048, ({ typedef struct { struct { char c; } j, k; char A1 m6; } T; sizeof(T); })); ASSERT(2048, ({ typedef struct { struct { char c; } j, k; char m6 A1; } T; sizeof(T); })); ASSERT(1024, ({ typedef struct { struct { char c; } j, k; char m6; } A1 T; sizeof(T); })); ASSERT(3, ({ typedef struct { struct { char c; } j, k; char m6; } T A1; sizeof(T); })); ASSERT(1, ({ A1 typedef struct { struct { char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef A1 struct { struct { char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct A1 { struct { char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { A1 struct { char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { struct A1 { char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { struct { A1 char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { struct { char A1 c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { struct { char c A1; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { struct { char c; } A1 j, k; char m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j A1, k; char m6; } T; offsetof(T, k); })); #ifdef NOTGCC ASSERT(1024, ({ typedef struct { struct { char c; } j, A1 k; char m6; } T; offsetof(T, k); })); #endif ASSERT(1024, ({ typedef struct { struct { char c; } j, k A1; char m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j, k; A1 char m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j, k; char A1 m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j, k; char m6 A1; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j, k; char m6; } A1 T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j, k; char m6; } T A1; offsetof(T, k); })); ASSERT(2, ({ A1 typedef struct { struct { char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2, ({ typedef A1 struct { struct { char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2, ({ typedef struct A1 { struct { char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(1025, ({ typedef struct { A1 struct { char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2048, ({ typedef struct { struct A1 { char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2048, ({ typedef struct { struct { A1 char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2048, ({ typedef struct { struct { char A1 c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2048, ({ typedef struct { struct { char c A1; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2048, ({ typedef struct { struct { char c; } A1 j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2, ({ typedef struct { struct { char c; } j A1, k; char m6; } T; offsetof(T,m6); })); #ifdef NOTGCC ASSERT(1025, ({ typedef struct { struct { char c; } j, A1 k; char m6; } T; offsetof(T,m6); })); #endif ASSERT(1025, ({ typedef struct { struct { char c; } j, k A1; char m6; } T; offsetof(T,m6); })); ASSERT(1024, ({ typedef struct { struct { char c; } j, k; A1 char m6; } T; offsetof(T,m6); })); ASSERT(1024, ({ typedef struct { struct { char c; } j, k; char A1 m6; } T; offsetof(T,m6); })); ASSERT(1024, ({ typedef struct { struct { char c; } j, k; char m6 A1; } T; offsetof(T,m6); })); ASSERT(2, ({ typedef struct { struct { char c; } j, k; char m6; } A1 T; offsetof(T,m6); })); ASSERT(2, ({ typedef struct { struct { char c; } j, k; char m6; } T A1; offsetof(T,m6); })); ASSERT(2, ({ _Alignas(__attribute__((aligned(2))) long) char v; _Alignof(v); })); { typedef const int Ic; typedef A1 Ic Ica; typedef A1 int Ia; typedef volatile Ia Iav; Ica v1; Iav v2; SASSERT(__alignof(Ica) == 1024); SASSERT(__alignof(Iav) == 1024); SASSERT(__alignof(v1) == 1024); SASSERT(__alignof(v2) == 1024); SASSERT(_Generic(Ica, int const: 1)); SASSERT(_Generic(Iav, int volatile: 1)); SASSERT(_Generic(&v1, int const*: 1)); SASSERT(_Generic(&v2, int volatile*: 1)); ASSERT(0, 1023 & (int)&v1); ASSERT(0, 1023 & (int)&v2); } printf("OK\n"); } chibicc-1.0.24/issues/attr_cleanup.c000066400000000000000000000104551517770275000173420ustar00rootroot00000000000000#include "test.h" int rec_idx = 0; int rec[20]; void cln1(void *num) { rec[rec_idx++] = (*(long long*)num)++; } void cln2(void *num) { rec[rec_idx++] = 10 * (*(long long*)num)++; } #define A __attribute__((cleanup(cln1))) //#define B [[gnu::cleanup(cln2)]] void test_decl(void) { rec_idx = 0; //A long long p1 = 11; // long A long p2 = 22; long long A p3 = 33, p4 = 44; long long p5 A = 55, p6 = 66; long long p7 = 77, A p8 = 88, pz = 999; long long p9 = 99, p11 A = 111; // B long long p22 = 222; // long long p33 B = 333, p44 = 444; // long long p55 = 555, p66 B = 666; //A long long p77 = 777, p88 B = 888; } void test_decl2(void) { rec_idx = 0; //A long long *p1[1]; //long A long *p2[1]; long long A *p3[1]; long long *A p4[1]; long long *p5[1] A; // B long long *p6[1]; // long long *p7 B[1]; } void test_loop(void) { rec_idx = 0; // for(B long long i = 0; i < 3; i++) { // B long long j = 11; // switch (i) { // case 0: // continue; // case 1: // B long long j = 22; // continue; // } // } } void test_vla(int sz) { rec_idx = 0; long long i __attribute__((cleanup(cln1))) = 222; long long vla[sz * 2] __attribute__((cleanup(cln1))); vla[0] = 137; long long j __attribute__((cleanup(cln1))) = 444; long long vla2[sz * 3] __attribute__((cleanup(cln1))); vla2[0] = 248; long long k __attribute__((cleanup(cln1))) = 555; return; } void void_nortn(void) { long long j __attribute__((cleanup(cln1))) = 11; } void void_rtn(void) { long long j __attribute__((cleanup(cln1))) = 22; return; } int int_rtn(void) { long long j __attribute__((cleanup(cln1))) = 33; return j; } void float_cln(float* num) { rec[0] = (*num)++; } float float_rtn(void) { float f __attribute__((cleanup(float_cln))) = 44; return f; } void ldouble_cln(long double* num) { rec[0] = (*num)++; } long double ldouble_rtn(void) { long double f __attribute__((cleanup(ldouble_cln))) = 55; return f; } typedef struct { char c; } Small; void small_struct_cln(Small* s) { rec[0] = (s->c)++; } Small small_struct_rtn(void) { Small s __attribute__((cleanup(small_struct_cln))) = {66}; return s; } typedef struct { int i[33]; char c; } Large; void large_struct_cln(Large* s) { rec[0] = (s->c)++; } Large large_struct_rtn(void) { Large s __attribute__((cleanup(large_struct_cln))) = {.c = 77}; return s; } // static void small_bitint_cln(_BitInt(100)* s) { // rec[0] = ++(*s); // } // _BitInt(100) small_bitint_rtn(void) { // _BitInt(100) s __attribute__((cleanup(small_bitint_cln))) = -88; // return s; // } // static void large_bitint_cln(_BitInt(400)* s) { // rec[0] = ++(*s); // } // _BitInt(400) large_bitint_rtn(void) { // _BitInt(400) s __attribute__((cleanup(large_bitint_cln))) = 99; // return s; // } struct S { int j,i; }; void add(struct S* s) { ASSERT(11, s->i += 7); } int stmt_expr(void) { int i = ({ struct S s __attribute__((cleanup(add))) = {3,4}; s; }).i; ASSERT(4, i); return 1; } static inline void livefn(void*){ rec_idx = 33; } int main(void) { test_decl(); ASSERT(111, rec[0]); ASSERT(88, rec[1]); ASSERT(55, rec[2]); ASSERT(44, rec[3]); ASSERT(33, rec[4]); // ASSERT(0, rec[5]); // ASSERT(11, rec[6]); // ASSERT(88, rec[7]); // ASSERT(44, rec[8]); // ASSERT(33, rec[9]); // ASSERT(22, rec[10]); // ASSERT(11, rec[11]); test_decl2(); ASSERT(3, rec_idx); test_loop(); // ASSERT(110, rec[0]); // ASSERT(220, rec[1]); // ASSERT(110, rec[2]); // ASSERT(110, rec[3]); // ASSERT(30, rec[4]); test_vla(100); ASSERT(555, rec[0]); ASSERT(248, rec[1]); ASSERT(444, rec[2]); ASSERT(137, rec[3]); ASSERT(222, rec[4]); rec_idx = 0; void_nortn(); ASSERT(11, rec[0]); void_rtn(); ASSERT(22, rec[1]); ASSERT(33, int_rtn()); ASSERT(33, rec[2]); ASSERT(44, (int)float_rtn()); ASSERT(44, rec[0]); ASSERT(55, (int)ldouble_rtn()); ASSERT(55, rec[0]); ASSERT(66, small_struct_rtn().c); ASSERT(66, rec[0]); ASSERT(77, large_struct_rtn().c); ASSERT(77, rec[0]); // ASSERT(1, -88wb == small_bitint_rtn()); //ASSERT(-87, rec[0]); //ASSERT(1, 99wb == large_bitint_rtn()); //ASSERT(100, rec[0]); ASSERT(1, stmt_expr()); { rec_idx = 0; //int testlive [[gnu::cleanup(livefn)]]; } //ASSERT(33, rec_idx); printf("OK\n"); } chibicc-1.0.24/issues/attr_cleanup2.c000066400000000000000000000102311517770275000174140ustar00rootroot00000000000000#include "test.h" int rec_idx = 0; int rec[20]; void cln1(void *num) { rec[rec_idx++] = (*(long long*)num)++; } void cln2(void *num) { rec[rec_idx++] = 10 * (*(long long*)num)++; } #define A __attribute__((cleanup(cln1))) #define B [[gnu::cleanup(cln2)]] void test_decl(void) { rec_idx = 0; A long long p1 = 11; long A long p2 = 22; long long A p3 = 33, p4 = 44; long long p5 A = 55, p6 = 66; long long p7 = 77, A p8 = 88, pz = 999; long long p9 = 99, p11 A = 111; B long long p22 = 222; long long p33 B = 333, p44 = 444; long long p55 = 555, p66 B = 666; A long long p77 = 777, p88 B = 888; } void test_decl2(void) { rec_idx = 0; A long long *p1[1]; long A long *p2[1]; long long A *p3[1]; long long *A p4[1]; long long *p5[1] A; B long long *p6[1]; long long *p7 B[1]; } void test_loop(void) { rec_idx = 0; for(B long long i = 0; i < 3; i++) { B long long j = 11; switch (i) { case 0: continue; case 1: B long long j = 22; continue; } } } void test_vla(int sz) { rec_idx = 0; long long i __attribute__((cleanup(cln1))) = 222; long long vla[sz * 2] __attribute__((cleanup(cln1))); vla[0] = 137; long long j __attribute__((cleanup(cln1))) = 444; long long vla2[sz * 3] __attribute__((cleanup(cln1))); vla2[0] = 248; long long k __attribute__((cleanup(cln1))) = 555; return; } void void_nortn(void) { long long j __attribute__((cleanup(cln1))) = 11; } void void_rtn(void) { long long j __attribute__((cleanup(cln1))) = 22; return; } int int_rtn(void) { long long j __attribute__((cleanup(cln1))) = 33; return j; } void float_cln(float* num) { rec[0] = (*num)++; } float float_rtn(void) { float f __attribute__((cleanup(float_cln))) = 44; return f; } void ldouble_cln(long double* num) { rec[0] = (*num)++; } long double ldouble_rtn(void) { long double f __attribute__((cleanup(ldouble_cln))) = 55; return f; } typedef struct { char c; } Small; void small_struct_cln(Small* s) { rec[0] = (s->c)++; } Small small_struct_rtn(void) { Small s __attribute__((cleanup(small_struct_cln))) = {66}; return s; } typedef struct { int i[33]; char c; } Large; void large_struct_cln(Large* s) { rec[0] = (s->c)++; } Large large_struct_rtn(void) { Large s __attribute__((cleanup(large_struct_cln))) = {.c = 77}; return s; } static void small_bitint_cln(_BitInt(100)* s) { rec[0] = ++(*s); } _BitInt(100) small_bitint_rtn(void) { _BitInt(100) s __attribute__((cleanup(small_bitint_cln))) = -88; return s; } static void large_bitint_cln(_BitInt(400)* s) { rec[0] = ++(*s); } _BitInt(400) large_bitint_rtn(void) { _BitInt(400) s __attribute__((cleanup(large_bitint_cln))) = 99; return s; } struct S { int j,i; }; void add(struct S* s) { ASSERT(11, s->i += 7); } int stmt_expr(void) { int i = ({ struct S s __attribute__((cleanup(add))) = {3,4}; s; }).i; ASSERT(4, i); return 1; } static inline void livefn(void*){ rec_idx = 33; } int main(void) { test_decl(); ASSERT(111, rec[0]); ASSERT(88, rec[1]); ASSERT(55, rec[2]); ASSERT(44, rec[3]); ASSERT(33, rec[4]); ASSERT(0, rec[5]); ASSERT(11, rec[6]); ASSERT(88, rec[7]); ASSERT(44, rec[8]); ASSERT(33, rec[9]); ASSERT(22, rec[10]); ASSERT(11, rec[11]); test_decl2(); ASSERT(3, rec_idx); test_loop(); ASSERT(110, rec[0]); ASSERT(220, rec[1]); ASSERT(110, rec[2]); ASSERT(110, rec[3]); ASSERT(30, rec[4]); test_vla(100); ASSERT(555, rec[0]); ASSERT(248, rec[1]); ASSERT(444, rec[2]); ASSERT(137, rec[3]); ASSERT(222, rec[4]); rec_idx = 0; void_nortn(); ASSERT(11, rec[0]); void_rtn(); ASSERT(22, rec[1]); ASSERT(33, int_rtn()); ASSERT(33, rec[2]); ASSERT(44, (int)float_rtn()); ASSERT(44, rec[0]); ASSERT(55, (int)ldouble_rtn()); ASSERT(55, rec[0]); ASSERT(66, small_struct_rtn().c); ASSERT(66, rec[0]); ASSERT(77, large_struct_rtn().c); ASSERT(77, rec[0]); ASSERT(1, -88wb == small_bitint_rtn()); ASSERT(-87, rec[0]); ASSERT(1, 99wb == large_bitint_rtn()); ASSERT(100, rec[0]); ASSERT(1, stmt_expr()); { rec_idx = 0; int testlive [[gnu::cleanup(livefn)]]; } ASSERT(33, rec_idx); printf("OK\n"); } chibicc-1.0.24/issues/attribute2.c000066400000000000000000000026661517770275000167530ustar00rootroot00000000000000#include "test.h" #if !defined(__has_attribute) || !defined(__has_c_attribute) #error #endif #if !__has_attribute(packed) #error #endif #if __has_c_attribute(packed) #error #endif #define CAT(x,y) x##y int has_attr(void) { DASSERT(__has_attribute(packed) == 1); DASSERT( CAT(__has,_attribute)(packed) == 1); DASSERT(__has_c_attribute(gnu::packed) == 1); DASSERT(__has_c_attribute(gnu::__packed__) == 1); DASSERT(__has_c_attribute(clang::packed) == 0); } [[_Noreturn]] int fallthrough(int i) { switch (i){ case 3: [[fallthrough]]; default: } exit(0); } void packed(void) { ASSERT(0, offsetof(struct [[gnu::packed]] { char a; int b; }, a)); ASSERT(1, offsetof(struct [[gnu::__packed__]] { char a; int b; }, b)); ASSERT(5, ({ struct [[gnu::packed]] { char a; int b; } x; sizeof(x); })); ASSERT(9, ({ typedef struct [[gnu::packed]] { char a; int b[2]; } T; sizeof(T); })); ASSERT(1, offsetof(struct [[gnu::packed]] T { char a; int b[2]; }, b)); // no-op #ifndef __clang__ ASSERT(8, ({ struct { char a; int b; } [[gnu::packed]] x; sizeof(x); })); ASSERT(0, offsetof(struct { char a; int b; } [[gnu::packed]], a)); ASSERT(4, offsetof(struct { char a; int b; } [[gnu::packed]], b)); #endif ASSERT(12, ({ typedef struct [[packed]] { char a; int b[2]; } T; sizeof(T); })); ASSERT(4, offsetof(struct [[packed]] { char a; int b[2]; }, b)); } int main() { has_attr(); packed(); printf("OK\n"); return 0; }chibicc-1.0.24/issues/bitand_folding.c000066400000000000000000000014051517770275000176170ustar00rootroot00000000000000// test_int128_bitand_constfold.c // // Verifies: // - __int128 constant folding // - bitwise AND folding // - correct truncation semantics // - no accidental 64-bit truncation // // Expected: // exit code 0 typedef unsigned __int128 u128; int main(void) { // high 64-bit pattern u128 a = ((u128)0x123456789ABCDEF0ULL << 64) | (u128)0xFEDCBA9876543210ULL; u128 b = ((u128)0xFFFFFFFF00000000ULL << 64) | (u128)0x00000000FFFFFFFFULL; // should be fully constant-folded u128 c = a & b; unsigned long hi = (unsigned long)(c >> 64); unsigned long lo = (unsigned long)c; if (hi != 0x1234567800000000ULL) return 1; if (lo != 0x0000000076543210ULL) return 2; return 0; } chibicc-1.0.24/issues/builtin2.c000066400000000000000000000040011517770275000163770ustar00rootroot00000000000000#include "test.h" #include #ifndef __has_builtin #error #endif #if !__has_builtin(__builtin_offsetof) #error #endif struct ofs_S1 { char c; struct { struct { struct { struct { char k[7]; } n; char z; }; } m[7][7]; }; }; SASSERT(__builtin_offsetof(struct ofs_S1, m[1][2].n.k[3]) == 76); int va_expr_in_arg(int i, ...) { __builtin_va_list ap, ap2; __builtin_va_start(ap, (i += 7, i)); __builtin_va_copy(ap2, ap); ASSERT(1, !memcmp(ap,ap2,sizeof(__builtin_va_list))); // __builtin_c23_va_start(ap); // __builtin_c23_va_start(ap, i); __builtin_va_end((i += 13, ap)); return i; } int va_in_comma(int i, ...) { __builtin_va_list ap, ap2; return __builtin_va_start(ap, i), __builtin_va_copy(ap2, ap), i = __builtin_va_arg(ap2, int), __builtin_va_end(ap2), i; } static int garr[2]; static void va_fn1(void) { garr[0] = 111; } static void va_fn2(void) { garr[1] = 222; } static void va_fn0(int cnt, ...) { va_list ap; va_start(ap, cnt); for(int i = 0; i < cnt; i++) va_arg(ap, void(*)(void))(); va_end(ap); } SASSERT(__builtin_constant_p(1 ? 0 : 0)); int g; SASSERT(!__builtin_constant_p(g)); // static __auto_type builtin_constant_p_test = __builtin_constant_p(0); // SASSERT(_Generic(&builtin_constant_p_test, int *:1)); // static __auto_type builtin_expect_test = __builtin_expect(1.0f,1.0); // SASSERT(_Generic(&builtin_expect_test, long *:1)); int main(void) { ASSERT(30, va_expr_in_arg(17)); ASSERT(33, va_in_comma(0,33)); va_fn0(2, &va_fn1, &va_fn2); ASSERT(111, garr[0]); ASSERT(222, garr[1]); #define runtime_ofs(x,y,z) __builtin_offsetof(struct ofs_S1, m[x][y].n.k[z]) ASSERT(324, ({int x = 5, y = 3; runtime_ofs(x,5,y); })); ASSERT(100, ({int x = 1, y = 5, z = 3; runtime_ofs(x,y,z); })); ASSERT(222, ({int y = 6; runtime_ofs(3,y,5); })); { int i; SASSERT(0 == __builtin_types_compatible_p(int[4][i], int[2][i])); SASSERT(0 == __builtin_types_compatible_p(int[i][4], int[i][2])); } printf("OK\n"); } chibicc-1.0.24/issues/builtin_ia32_mwait_monitor.c000066400000000000000000000007771517770275000221230ustar00rootroot00000000000000#include "test.h" #include #include int main() { volatile int data = 0; // Address to monitor void *addr = &data; unsigned int ext = 0; unsigned int hints = 0; // Monitor the address __builtin_ia32_monitor(addr, ext, hints); // Wait until the monitored address is written to __builtin_ia32_mwait(ext, hints); // Write something afterwards data = 42; printf("Data after MWAIT: %d\n", data); printf("OK\n"); return data; } chibicc-1.0.24/issues/builtin_offsetof.c000066400000000000000000000012131517770275000202120ustar00rootroot00000000000000#include "test.h" #ifndef __has_builtin #error #endif #if !__has_builtin(__builtin_offsetof) #error #endif struct ofs_S1 { char c; struct { struct { struct { struct { char k[7]; } n; }; } m[4][4]; }; }; _Static_assert(__builtin_offsetof(struct ofs_S1, m[1][2].n.k[3]) == 46,""); int va(int i, ...) { __builtin_va_list ap, ap2; __builtin_va_start(ap, (i += 7, i)); __builtin_va_copy(ap2, ap); ASSERT(1, !memcmp(ap,ap2,sizeof(__builtin_va_list))); #ifdef __slimcc__ __builtin_va_start(ap); #endif __builtin_va_end((i += 13, ap)); return i; } int main(void) { ASSERT(30, va(17)); printf("OK\n"); }chibicc-1.0.24/issues/constant_folding2.c000066400000000000000000000231551517770275000202770ustar00rootroot00000000000000#include #include #include #include typedef unsigned __int128 u128; typedef __int128 i128; // --- Global constant expressions: chibicc must evaluate these at init time --- static const i128 C_ADD = (__int128)100 + 200; static const i128 C_MUL = (__int128)6 * 7; static const i128 C_SHL32 = (__int128)1 << 32; static const i128 C_SHL64 = (__int128)1 << 64; static const i128 C_SHL100 = (__int128)1 << 100; static const i128 C_CHAIN = ((__int128)3 * 7 + 1) << 4; static const i128 C_BIG = (__int128)0xDEADBEEFULL * 0xCAFEBABEULL; static const u128 C_OR = ((u128)0xFFFFFFFFFFFFFFFFULL << 64) | 0xAAAAAAAAAAAAAAAAULL; static const i128 C_NEG = -(__int128)42; int main(void) { int pass = 0, fail = 0; #define CHECK(label, cond) \ do { if (cond) { pass++; printf("PASS %s\n", label); } \ else { fail++; printf("FAIL %s\n", label); } } while (0) #define HI(x) ((uint64_t)((u128)(x) >> 64)) #define LO(x) ((uint64_t)(x)) /* ------------------------------------------------------------------ */ printf("=== __int128 : global constant initializers ===\n"); /* ------------------------------------------------------------------ */ CHECK("add : (i128)100 + 200 == 300", HI(C_ADD)==0 && LO(C_ADD)==300ULL); CHECK("mul : (i128)6 * 7 == 42", HI(C_MUL)==0 && LO(C_MUL)==42ULL); CHECK("shl32: (i128)1 << 32 — stays in lo word", HI(C_SHL32)==0 && LO(C_SHL32)==0x100000000ULL); CHECK("shl64: (i128)1 << 64 — crosses 64-bit word boundary", HI(C_SHL64)==1ULL && LO(C_SHL64)==0ULL); CHECK("shl100:(i128)1 << 100 — hi=2^36, lo=0", HI(C_SHL100)==(1ULL<<36) && LO(C_SHL100)==0ULL); CHECK("chain: ((i128)3*7+1)<<4 == 352", HI(C_CHAIN)==0 && LO(C_CHAIN)==352ULL); CHECK("bigmul:(i128)0xDEADBEEF * 0xCAFEBABE == 0xb092ab7b88cf5b62", HI(C_BIG)==0 && LO(C_BIG)==0xb092ab7b88cf5b62ULL); CHECK("or128 : hi=0xFFFF...F lo=0xAAAA...A", HI(C_OR)==0xFFFFFFFFFFFFFFFFULL && LO(C_OR)==0xAAAAAAAAAAAAAAAAULL); CHECK("neg : -(i128)42", HI(C_NEG)==0xFFFFFFFFFFFFFFFFULL && LO(C_NEG)==(uint64_t)(-42LL)); /* ------------------------------------------------------------------ */ printf("\n=== __int128 : local constant expressions ===\n"); /* ------------------------------------------------------------------ */ { i128 loc_big = (__int128)1000 * 1000 * 1000 * 1000; // 10^12 i128 loc_minval = (__int128)1 << 127; // INT128_MIN boundary i128 loc_div = (__int128)1000000 / 7; // 142857 i128 loc_mod = (__int128)1000000 % 7; // 1 i128 loc_and = (__int128)0xFFFF & 0xAAAA; // 0xAAAA i128 loc_xor = (__int128)0xFF00FF ^ 0x00FF00; // 0xFFFFFF i128 loc_not = ~(__int128)0; // all bits set i128 loc_tern = (1 ? (__int128)99 : (__int128)-1); // 99 i128 loc_sizeof = sizeof(__int128) * 8; // 128 CHECK("local 10^12", HI(loc_big)==0 && LO(loc_big)==1000000000000ULL); CHECK("local 1<<127 hi=2^63, lo=0", HI(loc_minval)==(1ULL<<63) && LO(loc_minval)==0ULL); CHECK("local 1000000/7 == 142857", HI(loc_div)==0 && LO(loc_div)==142857ULL); CHECK("local 1000000%7 == 1", HI(loc_mod)==0 && LO(loc_mod)==1ULL); CHECK("local 0xFFFF & 0xAAAA == 0xAAAA", HI(loc_and)==0 && LO(loc_and)==0xAAAAULL); CHECK("local 0xFF00FF ^ 0x00FF00 == 0xFFFFFF", HI(loc_xor)==0 && LO(loc_xor)==0xFFFFFFULL); CHECK("local ~(i128)0 all bits set", HI(loc_not)==0xFFFFFFFFFFFFFFFFULL && LO(loc_not)==0xFFFFFFFFFFFFFFFFULL); CHECK("local ternary (1?99:-1) == 99", HI(loc_tern)==0 && LO(loc_tern)==99ULL); CHECK("local sizeof(__int128)*8 == 128", HI(loc_sizeof)==0 && LO(loc_sizeof)==128ULL); } #ifdef __AVX2__ /* ------------------------------------------------------------------ */ printf("\n=== __m256 / __m256i : constant-expression lane values ===\n"); /* ------------------------------------------------------------------ */ #define CHECK_LANES_I32(label, vec, expected) \ do { \ int32_t _l[8]; memcpy(_l, &(vec), 32); \ int _ok = 1; \ for (int _i = 0; _i < 8; _i++) _ok &= (_l[_i]==(expected)); \ CHECK(label, _ok); \ } while (0) #define CHECK_LANES_F32(label, vec, expected) \ do { \ float _l[8]; memcpy(_l, &(vec), 32); \ int _ok = 1; \ for (int _i = 0; _i < 8; _i++) _ok &= (_l[_i]==(expected)); \ CHECK(label, _ok); \ } while (0) // setzero { __m256i z = _mm256_setzero_si256(); CHECK_LANES_I32("setzero_si256: all 8 int32 lanes == 0", z, 0); } // broadcast integer literal { __m256i v = _mm256_set1_epi32(42); CHECK_LANES_I32("set1_epi32(42): all 8 lanes == 42", v, 42); } // broadcast negative { __m256i v = _mm256_set1_epi32(-1); CHECK_LANES_I32("set1_epi32(-1): all 8 lanes == -1", v, -1); } // broadcast float literal { __m256 v = _mm256_set1_ps(1.0f); CHECK_LANES_F32("set1_ps(1.0f): all 8 lanes == 1.0f", v, 1.0f); } // distinct lane literals { __m256i v = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0); int32_t lanes[8]; memcpy(lanes, &v, 32); int ok = 1; for (int i = 0; i < 8; i++) ok &= (lanes[i] == i); CHECK("set_epi32(7..0): lanes[i] == i", ok); } // add with literal operands { __m256i a = _mm256_set1_epi32(10); __m256i b = _mm256_set1_epi32(20); __m256i c = _mm256_add_epi32(a, b); CHECK_LANES_I32("add_epi32(set1(10), set1(20)): all lanes == 30", c, 30); } // multiply with literal operands { __m256i a = _mm256_set1_epi32(6); __m256i b = _mm256_set1_epi32(7); __m256i c = _mm256_mullo_epi32(a, b); CHECK_LANES_I32("mullo_epi32(set1(6), set1(7)): all lanes == 42", c, 42); } // subtract { __m256i a = _mm256_set1_epi32(100); __m256i b = _mm256_set1_epi32(58); __m256i c = _mm256_sub_epi32(a, b); CHECK_LANES_I32("sub_epi32(set1(100), set1(58)): all lanes == 42", c, 42); } // bitwise AND { __m256i a = _mm256_set1_epi32(0xFF); __m256i b = _mm256_set1_epi32(0x0F); __m256i c = _mm256_and_si256(a, b); CHECK_LANES_I32("and_si256(set1(0xFF), set1(0x0F)): all lanes == 15", c, 15); } // bitwise OR { __m256i a = _mm256_set1_epi32(0xF0); __m256i b = _mm256_set1_epi32(0x0F); __m256i c = _mm256_or_si256(a, b); CHECK_LANES_I32("or_si256(set1(0xF0), set1(0x0F)): all lanes == 255", c, 255); } // bitwise XOR { __m256i a = _mm256_set1_epi32(0xFF); __m256i b = _mm256_set1_epi32(0x0F); __m256i c = _mm256_xor_si256(a, b); CHECK_LANES_I32("xor_si256(set1(0xFF), set1(0x0F)): all lanes == 0xF0==240", c, 0xF0); } // left shift immediate { __m256i a = _mm256_set1_epi32(1); __m256i c = _mm256_slli_epi32(a, 4); CHECK_LANES_I32("slli_epi32(set1(1), 4): all lanes == 16", c, 16); } // right shift immediate { __m256i a = _mm256_set1_epi32(256); __m256i c = _mm256_srli_epi32(a, 3); CHECK_LANES_I32("srli_epi32(set1(256), 3): all lanes == 32", c, 32); } // compare equal -> all-ones mask { __m256i a = _mm256_set1_epi32(42); __m256i b = _mm256_set1_epi32(42); __m256i c = _mm256_cmpeq_epi32(a, b); CHECK_LANES_I32("cmpeq_epi32(set1(42),set1(42)): all lanes == -1", c, -1); } // float add { __m256 a = _mm256_set1_ps(1.5f); __m256 b = _mm256_set1_ps(2.5f); __m256 c = _mm256_add_ps(a, b); CHECK_LANES_F32("add_ps(set1(1.5f), set1(2.5f)): all lanes == 4.0f", c, 4.0f); } // float multiply { __m256 a = _mm256_set1_ps(6.0f); __m256 b = _mm256_set1_ps(7.0f); __m256 c = _mm256_mul_ps(a, b); CHECK_LANES_F32("mul_ps(set1(6.0f), set1(7.0f)): all lanes == 42.0f", c, 42.0f); } // double broadcast { __m256d a = _mm256_set1_pd(3.14); double lanes[4]; memcpy(lanes, &a, 32); int ok = 1; for (int i = 0; i < 4; i++) ok &= (lanes[i] == 3.14); CHECK("set1_pd(3.14): all 4 double lanes == 3.14", ok); } // __int128 value split into two 64-bit halves loaded into __m256i { u128 val = ((u128)0xDEADBEEFULL << 32) | 0xCAFEBABEULL; uint64_t lo64 = (uint64_t)val; uint64_t hi64 = (uint64_t)(val >> 64); __m256i v = _mm256_set_epi64x((int64_t)hi64, (int64_t)lo64, (int64_t)hi64, (int64_t)lo64); uint64_t out[4]; memcpy(out, &v, 32); CHECK("__int128 hi/lo -> __m256i epi64 lanes match", out[0]==lo64 && out[1]==hi64 && out[2]==lo64 && out[3]==hi64); } #else printf("\n=== __m256/__m256i : SKIPPED (recompile with -mavx2) ===\n"); #endif printf("\n=== Results: %d passed, %d failed ===\n", pass, fail); return fail > 0 ? 1 : 0; } chibicc-1.0.24/issues/cpython_blake.c000066400000000000000000000035141517770275000175010ustar00rootroot00000000000000#define PY_SSIZE_T_CLEAN #include #include #include #define _Py_HACL_CAN_COMPILE_VEC128 0 #define _Py_HACL_CAN_COMPILE_VEC256 0 static void __cpuid_count(int info, int subinfo, int *eax, int *ebx, int *ecx, int *edx) { #if defined(__x86_64__) __asm__ volatile( "cpuid" : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx) : "a"(info), "c"(subinfo) ); #else *eax = *ebx = *ecx = *edx = 0; #endif } typedef struct { PyTypeObject *blake2b_type; PyTypeObject *blake2s_type; bool can_run_simd128; bool can_run_simd256; } Blake2State; static void blake2module_init_cpu_features(Blake2State *state) { int eax1 = 0, ebx1 = 0, ecx1 = 0, edx1 = 0; int eax7 = 0, ebx7 = 0, ecx7 = 0, edx7 = 0; __cpuid_count(1, 0, &eax1, &ebx1, &ecx1, &edx1); __cpuid_count(7, 0, &eax7, &ebx7, &ecx7, &edx7); bool avx = (ecx1 & (1 << 28)) != 0; bool avx2 = (ebx7 & (1 << 5)) != 0; bool sse = (edx1 & (1 << 25)) != 0; bool sse2 = (edx1 & (1 << 26)) != 0; bool cmov = (edx1 & (1 << 15)) != 0; bool sse3 = (ecx1 & (1 << 0)) != 0; bool sse41 = (ecx1 & (1 << 19)) != 0; bool sse42 = (ecx1 & (1 << 20)) != 0; state->can_run_simd128 = false; state->can_run_simd256 = false; } int main(void) { Blake2State st = {0}; blake2module_init_cpu_features(&st); printf("CPU feature detection result:\n"); printf(" can_run_simd128 = %s\n", st.can_run_simd128 ? "true" : "false"); printf(" can_run_simd256 = %s\n", st.can_run_simd256 ? "true" : "false"); if (st.can_run_simd256 && !st.can_run_simd128) { fprintf(stderr, "Invariant violated: SIMD256 requires SIMD128!\n"); return 1; } return 0; } chibicc-1.0.24/issues/cpython_extasm_o3_fp_repro.c000066400000000000000000000235271517770275000222270ustar00rootroot00000000000000#include #include #include #include int myglobal = 18; /* * Stronger CPython-like repro for -O3 + -fomit-frame-pointer + extended asm. * * Compile/run: * ./chibicc -std=c11 -O3 -fomit-frame-pointer \ * -o issues/cpython_extasm_o3_fp_repro.exe issues/cpython_extasm_o3_fp_repro.c * ./issues/cpython_extasm_o3_fp_repro.exe * * The test combines: * 1) deep-ish recursion * 2) dynamic alloca and post-call memory verification * 3) calls with >6 integer args (stack-passed args on SysV x86-64) * 4) function-pointer dispatch * 5) GNU extended asm that clobbers %rbx and uses r/w constraints * * With correct codegen the asm and pure-C paths must match exactly. * * If parse.c disables omit-frame-pointer when it sees asm, this repro can be masked. */ typedef struct Blob { uint64_t tag; uint64_t len; uint8_t data[64]; uint64_t tail; } Blob; typedef uint64_t (*mix_fn_t)(uint64_t, uint64_t, uint64_t, uint64_t *); typedef uint64_t (*step_fn_t)(uint64_t, uint64_t, uint64_t); static jmp_buf g_jb; static volatile uint64_t g_setjmp_sig; __attribute__((noinline)) static uint64_t consume10( uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8, uint64_t a9, uint64_t a10, Blob *b) { uint64_t x = a1 + a2 + a3 + a4 + a5; uint64_t y = a6 ^ a7 ^ a8 ^ a9 ^ a10; if (!b) return x ^ y; x ^= b->tag; y += b->tail; x += (uint64_t)b->data[(a1 + a8) & 63]; y ^= (uint64_t)b->data[(a2 + a9) & 63]; return (x << 7) ^ (x >> 11) ^ (y << 3) ^ (y >> 5); } __attribute__((noinline)) static uint64_t mix_ref( uint64_t x, uint64_t y, uint64_t z, uint64_t *acc) { uint64_t out = (x + y) ^ z; out = (out << 13) | (out >> (64 - 13)); *acc ^= out; return out + y; } __attribute__((noinline)) static uint64_t mix_extasm( uint64_t x, uint64_t y, uint64_t z, uint64_t *acc) { volatile uint64_t a __attribute__((aligned(32))) = x; volatile uint64_t b = y; uint64_t out = 0; __asm__ volatile( "add %2, %0\n\t" "xor %3, %0\n\t" "rol $13, %0\n\t" "xor %%rbx, %%rbx\n\t" : "=&r"(out) : "0"(a), "r"(b), "r"(z) : "rbx", "cc", "memory"); *acc ^= out; return out + b; } __attribute__((noinline)) static uint64_t worker( int depth, uint64_t seed, mix_fn_t mix, uint64_t salt) { volatile uint64_t anchor __attribute__((aligned(32))) = seed ^ 0x9e3779b97f4a7c15ULL ^ salt; if (depth <= 0) return anchor + salt; int sz = 96 + ((depth * 13) & 127); uint8_t *scratch = (uint8_t *)alloca((size_t)sz); for (int i = 0; i < sz; i++) scratch[i] = (uint8_t)((seed + salt + depth + i) & 0xff); uint64_t local = anchor + (uint64_t)scratch[depth % sz] + (uint64_t)depth; uint64_t mixed = mix(seed + (uint64_t)(depth * 3), local, (uint64_t)(uintptr_t)scratch ^ salt, (uint64_t *)&anchor); Blob b = {0}; b.tag = mixed ^ anchor; b.len = (uint64_t)sz; b.tail = seed + local + mixed + salt; for (int i = 0; i < 64; i++) b.data[i] = (uint8_t)(scratch[(i * 7 + depth) % sz] ^ (uint8_t)i); uint64_t c = consume10( (uint64_t)depth, mixed, local, anchor, b.tag, b.tail, (uint64_t)(uintptr_t)scratch, (uint64_t)sz, seed, salt, &b); for (int i = 0; i < sz; i++) { uint8_t want = (uint8_t)((seed + salt + depth + i) & 0xff); if (scratch[i] != want) { printf("stack corruption at depth=%d idx=%d got=%u want=%u\n", depth, i, (unsigned)scratch[i], (unsigned)want); return 0; } } return c ^ worker(depth - 1, mixed + c + (uint64_t)(depth * 17), mix, salt + 1); } __attribute__((noinline)) static uint64_t recursive_fold_ref( int depth, uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, uint64_t f, uint64_t g, uint64_t h) { volatile uint64_t guard = a ^ c ^ e ^ g ^ (uint64_t)depth; if (depth <= 0) return guard + b + d + f + h; uint64_t x = (a + b) ^ (c + d) ^ guard; uint64_t y = (e + f) ^ (g + h) ^ ((uint64_t)depth << 7); uint64_t z = ((x << 9) | (x >> (64 - 9))) ^ y; return z ^ recursive_fold_ref(depth - 1, b + z, c + x, d + y, e + z, f + x, g + y, h + z, a + y); } __attribute__((noinline)) static uint64_t recursive_fold_asm( int depth, uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, uint64_t f, uint64_t g, uint64_t h) { volatile uint64_t guard = a ^ c ^ e ^ g ^ (uint64_t)depth; if (depth <= 0) return guard + b + d + f + h; uint64_t x = (a + b) ^ (c + d) ^ guard; uint64_t y = (e + f) ^ (g + h) ^ ((uint64_t)depth << 7); uint64_t z = 0; __asm__ volatile( "mov %1, %0\n\t" "rol $9, %0\n\t" "xor %2, %0\n\t" "xor %%rbx, %%rbx\n\t" : "=&r"(z) : "r"(x), "r"(y) : "rbx", "cc", "memory"); return z ^ recursive_fold_asm(depth - 1, b + z, c + x, d + y, e + z, f + x, g + y, h + z, a + y); } __attribute__((noinline)) static uint64_t recursive_ref( int depth, uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, uint64_t f, uint64_t g, uint64_t h) { volatile uint64_t guard = a ^ c ^ e ^ g ^ (uint64_t)depth; if (depth <= 0) return guard + b + d + f + h; uint64_t x = (a + b) ^ (c + d) ^ guard; uint64_t y = (e + f) ^ (g + h) ^ ((uint64_t)depth << 7); uint64_t z = ((x << 9) | (x >> (64 - 9))) ^ y; return recursive_ref(depth - 1, b + z, c + x, d + y, e + z, f + x, g + y, h + z, a + y); } __attribute__((noinline)) static uint64_t step_ref( uint64_t x, uint64_t y, uint64_t z) { uint64_t out = (x + y) ^ z; out = (out << 17) | (out >> (64 - 17)); return out ^ (y << 3); } __attribute__((noinline)) static uint64_t step_asm( uint64_t x, uint64_t y, uint64_t z) { uint64_t out = 0; __asm__ volatile( "mov %1, %0\n\t" "add %2, %0\n\t" "xor %3, %0\n\t" "rol $17, %0\n\t" "xor %%rbx, %%rbx\n\t" : "=&r"(out) : "r"(x), "r"(y), "r"(z) : "rbx", "cc", "memory"); return out ^ (y << 3); } __attribute__((noinline)) static uint64_t recurse_with_jump( int depth, uint64_t s, uint64_t t, step_fn_t step, int jump_at) { volatile uint64_t local = s ^ t ^ (uint64_t)depth; int sz = 48 + ((depth * 11) & 63); uint8_t *p = (uint8_t *)alloca((size_t)sz); for (int i = 0; i < sz; i++) p[i] = (uint8_t)((s + t + depth + i) & 0xff); if (depth == jump_at) { g_setjmp_sig = local ^ (uint64_t)(uintptr_t)p ^ (uint64_t)sz; longjmp(g_jb, 1); } if (depth <= 0) return local + (uint64_t)p[0]; uint64_t u = step(s + local, t + (uint64_t)sz, (uint64_t)(uintptr_t)p ^ local); uint64_t v = recurse_with_jump(depth - 1, t + u, s + local + 1, step, jump_at); for (int i = 0; i < sz; i++) { uint8_t want = (uint8_t)((s + t + depth + i) & 0xff); if (p[i] != want) { printf("setjmp path stack corruption depth=%d idx=%d got=%u want=%u\n", depth, i, (unsigned)p[i], (unsigned)want); return 0; } } return u ^ v ^ local; } __attribute__((noinline)) static uint64_t run_setjmp_path( int depth, uint64_t s, uint64_t t, step_fn_t step, int jump_at) { g_setjmp_sig = 0; if (setjmp(g_jb) == 0) return recurse_with_jump(depth, s, t, step, jump_at); return g_setjmp_sig ^ s ^ t ^ (uint64_t)depth ^ (uint64_t)jump_at; } __attribute__((noinline)) static uint64_t vla_probe( int n, uint64_t seed, uint64_t salt) { int sz = 64 + (n & 127); volatile uint8_t vla[sz]; uint64_t acc = seed ^ salt ^ (uint64_t)sz; for (int i = 0; i < sz; i++) { vla[i] = (uint8_t)((seed + salt + (uint64_t)i + (uint64_t)n) & 0xff); acc ^= (uint64_t)vla[i] << (i & 7); } return acc ^ (uint64_t)vla[(n * 3) % sz]; } int main(void) { enum { DEPTH = 80, ROUNDS = 200, FOLD_DEPTH = 120, JUMP_DEPTH = 70 }; uint64_t seed = 0x0123456789abcdefULL; uint64_t salt = 0xfeedfacecafebeefULL; uint64_t acc_ref = 0; uint64_t acc_asm = 0; uint64_t fold_ref = 0; uint64_t fold_asm = 0; uint64_t jump_ref = 0; uint64_t jump_asm = 0; uint64_t vla_acc = 0; for (int i = 0; i < ROUNDS; i++) { uint64_t s = seed + (uint64_t)i * 0x100000001b3ULL; uint64_t t = salt ^ (uint64_t)i * 0x9e3779b97f4a7c15ULL; acc_ref ^= worker(DEPTH, s, mix_ref, t); acc_asm ^= worker(DEPTH, s, mix_extasm, t); fold_ref ^= recursive_fold_ref(FOLD_DEPTH, s + 1, s + 2, s + 3, s + 4, t + 5, t + 6, t + 7, t + 8); fold_asm ^= recursive_fold_asm(FOLD_DEPTH, s + 1, s + 2, s + 3, s + 4, t + 5, t + 6, t + 7, t + 8); jump_ref ^= run_setjmp_path(JUMP_DEPTH, s ^ 0x1111ULL, t ^ 0x2222ULL, step_ref, JUMP_DEPTH / 2); jump_asm ^= run_setjmp_path(JUMP_DEPTH, s ^ 0x1111ULL, t ^ 0x2222ULL, step_asm, JUMP_DEPTH / 2); vla_acc ^= vla_probe(DEPTH + i, s, t); } printf("acc_ref=0x%llx\n", (unsigned long long)acc_ref); printf("acc_asm=0x%llx\n", (unsigned long long)acc_asm); printf("fold_ref=0x%llx\n", (unsigned long long)fold_ref); printf("fold_asm=0x%llx\n", (unsigned long long)fold_asm); printf("jump_ref=0x%llx\n", (unsigned long long)jump_ref); printf("jump_asm=0x%llx\n", (unsigned long long)jump_asm); printf("vla_acc=0x%llx\n", (unsigned long long)vla_acc); if (acc_ref != acc_asm) { printf("BUG: asm path diverged from reference (DEPTH=%d ROUNDS=%d)\n", DEPTH, ROUNDS); return 1; } if (fold_ref != fold_asm) { printf("BUG: recursive asm fold diverged (FOLD_DEPTH=%d)\n", FOLD_DEPTH); return 1; } if (jump_ref != jump_asm) { printf("BUG: setjmp/longjmp asm path diverged (JUMP_DEPTH=%d)\n", JUMP_DEPTH); return 1; } if (vla_acc == 0) { printf("BUG: vla probe produced suspicious zero accumulator\n"); return 1; } uint64_t retx = recursive_ref(FOLD_DEPTH, seed + 1, seed + 2, seed + 3, seed + 4, seed + 5, seed + 6, seed + 7, seed + 8); printf("DONE\n"); return 0; } chibicc-1.0.24/issues/cpython_stack_margin_frame_address.c000066400000000000000000000037631517770275000237520ustar00rootroot00000000000000// Reproducer for CPython's stack margin check using __builtin_frame_address(0). // // This intentionally builds a stack-consuming call path and then applies the // same 25% safety rule as test_call.TestRecursion.test_margin_is_sufficient: // safe_margin = raw_delta * 5 / 4 // assert(safe_margin < 16384) // // Typical behavior on this machine: // - gcc -O2 -fno-omit-frame-pointer -fno-optimize-sibling-calls: PASS // - chibicc -fno-omit-frame-pointer: FAIL (safe_margin > 16384) // // Build/run: // gcc -O2 -fno-omit-frame-pointer -fno-optimize-sibling-calls \ // issues/cpython_stack_margin_frame_address.c -o /tmp/margin_gcc && /tmp/margin_gcc // ./chibicc -std=c11 -fno-omit-frame-pointer \ // -o /tmp/margin_chibicc issues/cpython_stack_margin_frame_address.c && /tmp/margin_chibicc #include #include #define STACK_MARGIN 16384 #define DEPTH 100 #define PAD 96 static uintptr_t addrs[DEPTH]; static volatile int sink; __attribute__((noinline)) static uintptr_t get_stack_pointer(void) { return (uintptr_t)__builtin_frame_address(0); } __attribute__((noinline)) static void recurse(int depth) { volatile char local[PAD]; local[0] = (char)depth; addrs[depth] = get_stack_pointer(); if (depth + 1 < DEPTH) recurse(depth + 1); // Keep this after the recursive call to block tail-call elimination. sink += local[0]; } int main(void) { recurse(0); uintptr_t min = addrs[0]; uintptr_t max = addrs[0]; for (int i = 1; i < DEPTH; i++) { if (addrs[i] < min) min = addrs[i]; if (addrs[i] > max) max = addrs[i]; } uintptr_t raw_delta = max - min; uintptr_t safe_margin = (raw_delta * 5) / 4; printf("raw_delta = %lu\n", (unsigned long)raw_delta); printf("safe_margin = %lu\n", (unsigned long)safe_margin); printf("stack_margin = %d\n", STACK_MARGIN); if (safe_margin < STACK_MARGIN) { printf("PASS: safe_margin < stack_margin\n"); return 0; } printf("REPRODUCED: safe_margin >= stack_margin\n"); return 1; } chibicc-1.0.24/issues/dead_code.c000066400000000000000000000042301517770275000165420ustar00rootroot00000000000000#include "test.h" #include extern void not_to_be_called(); void __attribute__((noreturn)) exit_w_0() { exit(0); } int test_unreach(int v) { void *p; for (int i = 0;;) { if (i++ == 0) { continue; not_to_be_called(); } p = &&end; break; not_to_be_called(); } F1: for (; v > 0;) { switch(v) { case 1: if (1) goto end; not_to_be_called(); case 2: if (1) { break F1; not_to_be_called(); } case 3: if (0) not_to_be_called(); v = -1; continue F1; not_to_be_called(); case 4: if (1) goto end; else not_to_be_called(); not_to_be_called(); case 5: if (0) not_to_be_called(); else { v = -1; break; } not_to_be_called(); case 6: case 7: if (v < 7) { v += 1; goto *p; not_to_be_called(); } else { v += 2; { goto *p; not_to_be_called(); } not_to_be_called(); } not_to_be_called(); } } end: return v; not_to_be_called(); } int test_reach(int v) { switch (v) { unreachable(); not_to_be_called(); case 1: return v; not_to_be_called(); case -2: if (0) { not_to_be_called(); case 2: return v; } case -3: if (1) return 999; not_to_be_called(); case 3: return v; not_to_be_called(); case -4: if (1) return 999; else case 4: return v; not_to_be_called(); do { case 5: return v; } while (0); } return 0; } int main(void) { ASSERT(1, test_unreach(1)); ASSERT(2, test_unreach(2)); ASSERT(-1, test_unreach(3)); ASSERT(4, test_unreach(4)); ASSERT(-1, test_unreach(5)); ASSERT(7, test_unreach(6)); ASSERT(9, test_unreach(7)); ASSERT(1, test_reach(1)); ASSERT(2, test_reach(2)); ASSERT(3, test_reach(3)); ASSERT(4, test_reach(4)); ASSERT(5, test_reach(5)); ASSERT(999, test_reach(-2)); ASSERT(999, test_reach(-3)); ASSERT(999, test_reach(-4)); printf("OK\n"); exit_w_0(); not_to_be_called(); return 0; } chibicc-1.0.24/issues/expr.h000066400000000000000000000250361517770275000156450ustar00rootroot00000000000000/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2002 Roman Zippel */ #ifndef EXPR_H #define EXPR_H #ifdef __cplusplus extern "C" { #endif #include #include #include "list.h" #ifndef __cplusplus #include #endif struct file { struct file *next; struct file *parent; const char *name; int lineno; }; typedef enum tristate { no, mod, yes } tristate; enum expr_type { E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_LTH, E_LEQ, E_GTH, E_GEQ, E_LIST, E_SYMBOL, E_RANGE }; union expr_data { struct expr *expr; struct symbol *sym; }; struct expr { enum expr_type type; union expr_data left, right; }; #define EXPR_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2)) #define EXPR_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2)) #define EXPR_NOT(dep) (2-(dep)) #define expr_list_for_each_sym(l, e, s) \ for (e = (l); e && (s = e->right.sym); e = e->left.expr) struct expr_value { struct expr *expr; tristate tri; }; struct symbol_value { void *val; tristate tri; }; enum symbol_type { S_UNKNOWN, S_BOOLEAN, S_TRISTATE, S_INT, S_HEX, S_STRING }; /* enum values are used as index to symbol.def[] */ enum { S_DEF_USER, /* main user value */ S_DEF_AUTO, /* values read from auto.conf */ S_DEF_DEF3, /* Reserved for UI usage */ S_DEF_DEF4, /* Reserved for UI usage */ S_DEF_COUNT }; /* * Represents a configuration symbol. * * Choices are represented as a special kind of symbol and have the * SYMBOL_CHOICE bit set in 'flags'. */ struct symbol { /* The next symbol in the same bucket in the symbol hash table */ struct symbol *next; /* The name of the symbol, e.g. "FOO" for 'config FOO' */ char *name; /* S_BOOLEAN, S_TRISTATE, ... */ enum symbol_type type; /* * The calculated value of the symbol. The SYMBOL_VALID bit is set in * 'flags' when this is up to date. Note that this value might differ * from the user value set in e.g. a .config file, due to visibility. */ struct symbol_value curr; /* * Values for the symbol provided from outside. def[S_DEF_USER] holds * the .config value. */ struct symbol_value def[S_DEF_COUNT]; /* * An upper bound on the tristate value the user can set for the symbol * if it is a boolean or tristate. Calculated from prompt dependencies, * which also inherit dependencies from enclosing menus, choices, and * ifs. If 'n', the user value will be ignored. * * Symbols lacking prompts always have visibility 'n'. */ tristate visible; /* SYMBOL_* flags */ int flags; /* List of properties. See prop_type. */ struct property *prop; /* Dependencies from enclosing menus, choices, and ifs */ struct expr_value dir_dep; /* Reverse dependencies through being selected by other symbols */ struct expr_value rev_dep; /* * "Weak" reverse dependencies through being implied by other symbols */ struct expr_value implied; }; #define for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) #define SYMBOL_CONST 0x0001 /* symbol is const */ #define SYMBOL_CHECK 0x0008 /* used during dependency checking */ #define SYMBOL_CHOICE 0x0010 /* start of a choice block (null name) */ #define SYMBOL_CHOICEVAL 0x0020 /* used as a value in a choice block */ #define SYMBOL_VALID 0x0080 /* set when symbol.curr is calculated */ #define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */ #define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */ #define SYMBOL_CHANGED 0x0400 /* ? */ #define SYMBOL_WRITTEN 0x0800 /* track info to avoid double-write to .config */ #define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */ #define SYMBOL_CHECKED 0x2000 /* used during dependency checking */ #define SYMBOL_WARNED 0x8000 /* warning has been issued */ /* Set when symbol.def[] is used */ #define SYMBOL_DEF 0x10000 /* First bit of SYMBOL_DEF */ #define SYMBOL_DEF_USER 0x10000 /* symbol.def[S_DEF_USER] is valid */ #define SYMBOL_DEF_AUTO 0x20000 /* symbol.def[S_DEF_AUTO] is valid */ #define SYMBOL_DEF3 0x40000 /* symbol.def[S_DEF_3] is valid */ #define SYMBOL_DEF4 0x80000 /* symbol.def[S_DEF_4] is valid */ /* choice values need to be set before calculating this symbol value */ #define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000 #define SYMBOL_MAXLENGTH 256 #define SYMBOL_HASHSIZE 9973 /* A property represent the config options that can be associated * with a config "symbol". * Sample: * config FOO * default y * prompt "foo prompt" * select BAR * config BAZ * int "BAZ Value" * range 1..255 * * Please, also check parser.y:print_symbol() when modifying the * list of property types! */ enum prop_type { P_UNKNOWN, P_PROMPT, /* prompt "foo prompt" or "BAZ Value" */ P_COMMENT, /* text associated with a comment */ P_MENU, /* prompt associated with a menu or menuconfig symbol */ P_DEFAULT, /* default y */ P_CHOICE, /* choice value */ P_SELECT, /* select BAR */ P_IMPLY, /* imply BAR */ P_RANGE, /* range 7..100 (for a symbol) */ P_SYMBOL, /* where a symbol is defined */ P_RESET, /* reset to defaults condition */ }; struct property { struct property *next; /* next property - null if last */ enum prop_type type; /* type of property */ const char *text; /* the prompt value - P_PROMPT, P_MENU, P_COMMENT */ struct expr_value visible; struct expr *expr; /* the optional conditional part of the property */ struct menu *menu; /* the menu the property are associated with * valid for: P_SELECT, P_RANGE, P_CHOICE, * P_PROMPT, P_DEFAULT, P_MENU, P_COMMENT */ struct file *file; /* what file was this property defined */ int lineno; /* what lineno was this property defined */ }; #define for_all_properties(sym, st, tok) \ for (st = sym->prop; st; st = st->next) \ if (st->type == (tok)) #define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT) #define for_all_choices(sym, st) for_all_properties(sym, st, P_CHOICE) #define for_all_prompts(sym, st) \ for (st = sym->prop; st; st = st->next) \ if (st->text) /* * Represents a node in the menu tree, as seen in e.g. menuconfig (though used * for all front ends). Each symbol, menu, etc. defined in the Kconfig files * gets a node. A symbol defined in multiple locations gets one node at each * location. */ struct menu { /* The next menu node at the same level */ struct menu *next; /* The parent menu node, corresponding to e.g. a menu or choice */ struct menu *parent; /* The first child menu node, for e.g. menus and choices */ struct menu *list; /* * The symbol associated with the menu node. Choices are implemented as * a special kind of symbol. NULL for menus, comments, and ifs. */ struct symbol *sym; /* * The prompt associated with the node. This holds the prompt for a * symbol as well as the text for a menu or comment, along with the * type (P_PROMPT, P_MENU, etc.) */ struct property *prompt; /* * 'visible if' dependencies. If more than one is given, they will be * ANDed together. */ struct expr *visibility; /* * Ordinary dependencies from e.g. 'depends on' and 'if', ANDed * together */ struct expr *dep; /* MENU_* flags */ unsigned int flags; /* Any help text associated with the node */ char *help; /* The location where the menu node appears in the Kconfig files */ struct file *file; int lineno; /* For use by front ends that need to store auxiliary data */ void *data; }; /* * Set on a menu node when the corresponding symbol changes state in some way. * Can be checked by front ends. */ #define MENU_CHANGED 0x0001 #define MENU_ROOT 0x0002 struct jump_key { struct list_head entries; size_t offset; struct menu *target; int index; }; extern struct file *file_list; extern struct file *current_file; struct file *lookup_file(const char *name); extern struct symbol symbol_yes, symbol_no, symbol_mod; extern struct symbol *modules_sym; extern int cdebug; struct expr *expr_alloc_symbol(struct symbol *sym); struct expr *expr_alloc_one(enum expr_type type, struct expr *ce); struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2); struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2); struct expr *expr_alloc_and(struct expr *e1, struct expr *e2); struct expr *expr_alloc_or(struct expr *e1, struct expr *e2); struct expr *expr_copy(const struct expr *org); void expr_free(struct expr *e); void expr_eliminate_eq(struct expr **ep1, struct expr **ep2); int expr_eq(struct expr *e1, struct expr *e2); tristate expr_calc_value(struct expr *e); struct expr *expr_trans_bool(struct expr *e); struct expr *expr_eliminate_dups(struct expr *e); struct expr *expr_transform(struct expr *e); int expr_contains_symbol(struct expr *dep, struct symbol *sym); bool expr_depends_symbol(struct expr *dep, struct symbol *sym); struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym); void expr_fprint(struct expr *e, FILE *out); struct gstr; /* forward */ void expr_gstr_print(struct expr *e, struct gstr *gs); void expr_gstr_print_revdep(struct expr *e, struct gstr *gs, tristate pr_type, const char *title); static inline int expr_is_yes(struct expr *e) { return !e || (e->type == E_SYMBOL && e->left.sym == &symbol_yes); } static inline int expr_is_no(struct expr *e) { return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no); } #ifdef __cplusplus } #endif #endif /* EXPR_H */chibicc-1.0.24/issues/frame_pointer_unwind_o3.c000066400000000000000000000034741517770275000215030ustar00rootroot00000000000000#include #include /* * Reproducer for manual frame-pointer unwinding under -O3. * * Run with: * ./chibicc -O3 -o issues/frame_pointer_unwind_o3.exe issues/frame_pointer_unwind_o3.c * ./issues/frame_pointer_unwind_o3.exe * * Expected (with frame pointers omitted in recur_no_fp): short unwind chain. * Current chibicc behavior: deep chain (~recursion depth), indicating that * unwinding does not stop where frame pointers should be missing. */ typedef struct Frame { struct Frame *next; void *ret; } Frame; typedef struct Stats { int length; } Stats; __attribute__((noinline)) static void manual_unwind(Stats *s) { Frame *fp = (Frame *)__builtin_frame_address(0); int n = 0; while (fp && n < 256) { Frame *next = fp->next; n++; if (!next) break; if ((uintptr_t)next <= (uintptr_t)fp) break; if ((uintptr_t)next - (uintptr_t)fp > (1u << 20)) break; fp = next; } s->length = n; } __attribute__((noinline)) static void leaf_unwind(Stats *s) { volatile void *fp = __builtin_frame_address(0); (void)fp; manual_unwind(s); } __attribute__((noinline)) static void recur_no_fp(int n, Stats *s) { volatile int keep = n; if (n == 0) { leaf_unwind(s); } else { recur_no_fp(n - 1, s); } if (keep == 123456789) printf("%d\n", n); } __attribute__((noinline)) static void outer_with_fp(int n, Stats *s) { volatile void *fp = __builtin_frame_address(0); (void)fp; recur_no_fp(n, s); } int main(void) { enum { DEPTH = 100, MAX_EXPECTED = 16 }; Stats s = {0}; outer_with_fp(DEPTH, &s); printf("{\"length\": %d, \"recur_depth\": %d}\n", s.length, DEPTH); if (s.length > MAX_EXPECTED) { printf("BUG: manual unwind ignored omitted frame pointers (length=%d)\n", s.length); return 1; } return 0; } chibicc-1.0.24/issues/inline_asm.c000066400000000000000000000153211517770275000167740ustar00rootroot00000000000000#include "test.h" void mem_operand_triival() { int i; __asm__ ("movl $11, %0" : "=m"(i)); ASSERT(11, i); struct { char c,d,e; } s; __asm__ ("movb $22, %0" : "=m"(s.d)); ASSERT(22, s.d); short arr[10]; __asm__ ("movw $33, %0" : "=m"(arr[7])); ASSERT(33, arr[7]); static struct { char c; struct { long long l[11]; } s[11]; } s2 [11]; __asm__ ("movq $44, %0" : "=m"(s2[3].s[7].l[5])); ASSERT(44, s2[3].s[7].l[5]); } void verify_123(int i, int j, int k) { ASSERT(11, i); ASSERT(22, j); ASSERT(33, k); } void reg_label() { register int i __asm__("di"), j __asm__("si"), k __asm__("dx"); __asm__ ("movl $11, %0;" "movl $22, %1;" "movl $33, %2;" "call verify_123" : "=r"(i), "=r"(j) : "r"(k)); } void i_constraint(int var) { static int v = 22; static struct { char c; long long i; } s = {.i = 33}; __asm__ volatile ( "movl %[lvar], %%edi;" "addl %[imm], %%edi;" #if !defined(__PIC__) "movabsq %[ptr], %%rsi; movl (%%rsi), %%esi;" "movabsq %[agg], %%rdx; movl (%%rdx), %%edx;" "movabsq %[fun], %%rax; callq *%%rax;" #else "movl $22, %%esi;" "movl $33, %%edx;" "call verify_123" #endif : : [imm]"i"(6), [lvar]"ir"(var) #if !defined(__PIC__) , [ptr]"i"(&v), [agg]"i"(&s.i), [fun]"i"(verify_123) #endif : "rsi", "rdi", "rdx", "rax" ); } void reg_assign(void) { int a,b,c,d,e,f,g; __asm__ volatile( "movl %%edx, %3;" "movl %%ebp, %6;" :"=a"(a), "=b"(b), "=c"(c), "=&r"(d), "=S"(e), "=D"(f), "=&r"(g) :"0"(0), "1"(0), "2"(0), "Q"(44), "4"(0), "5"(0), "R"(55) ); ASSERT(44, d); ASSERT(55, g); } long long *indir_flag(void) { static long long var; return &var; } int float_flag(float f) { float register fz __asm__("xmm3") = 0.0f; static int e; short np; char p; __asm__ ( "xorps %%xmm0, %%xmm0;" "ucomiss %[f_in], %%xmm3" : "=@ccp"(p), "=@ccnp"(np), "=@cce"(e), "=@ccne"(*indir_flag()) : [f_in]"x"(f), "x"(fz) : "xmm0", "cc" ); return p * 1000 + np * 100 + e * 10 + *indir_flag(); } int asm_goto(int arg){ __asm__ goto ( "subl $5, %0; je %l2;" "subl $2, %0; jl %l1;" : : "r"(arg) : : labA, labB ); return 11; labA:; return 22; labB:; return 33; } int asm_goto_output(int *arg){ __asm__ goto ( "subl $5, %0; je %l[labB];" "subl $2, %0; jl %l[labA];" "movq $0, %%rbp;" "movl $3, %0;" : "+r"(*arg) : : "rbp" : labA, labB ); return *arg + 10; labA:; return *arg + 20; labB:; return *arg + 30; } int asm_goto_local_label(void) { #define LE_OR_QUIT(_v) do { __label__ LE; \ __asm goto ("cmpl $10, %[val]; jle %l[LE]; jmp %l[QUIT]" \ ::[val]"r"(_v) : "cc" : LE, QUIT); \ LE: \ } while (0) int cnt = 0; LE_OR_QUIT(9); cnt += 1; LE_OR_QUIT(10); cnt += 10; LE_OR_QUIT(11); cnt += 100; QUIT: return cnt; } void x87_clobber(void) { volatile long double f1; volatile double f2; volatile float f3; __asm__ volatile ("":: "f"((float){11}), "t"((double){22}), "u"((long double){33}) : "%st", "st(1)" ); __asm__ volatile ("": "=t"(f1)); __asm__ volatile ("": "=t"(f2)); ASSERT(1, 33 == f1); ASSERT(1, 11 == f2); __asm__ volatile ("":: "u"((float){44}), "f"((double){55}), "t"((long double){66}) : "st" ); __asm__ volatile("": "=t"(f3)); ASSERT(1, 55 == f3); __asm__ volatile ("":: "f"((float){77}), "u"((double){88}), "t"((long double){99}) : "st", "st(1)", "st(2)" ); __asm__ volatile ("": "=t"(f1)); __asm__ volatile ("": "=t"(f2)); ASSERT(1, 88 == f1); ASSERT(1, 77 == f2); } int ptr_conversion(char *str) { int res; __asm__ volatile ( " leaq %3, %%rsi;" " call *%2" : "=a"(res) : "D"("bar"), "r"(strcmp), "m"(*str) : "rsi" ); return !res; } struct Large { char arr[33]; int i; }; int exhaust_inner2(struct Large s) { int i[] = {1,2,3,4,5,6,7,8,9,10}; _Alignas(1024) int res; ASSERT(0, 1023 & (intptr_t)&res); int register init __asm__("%bh") = 0; __asm__ volatile( "shl $4, %1;" "add %1, %%ebx;" "shl $3, %%eax;" "shl $3, %%ecx;" "shl $3, %%edx;" "add %%eax, %%ebx;" "add %%ecx, %%ebx;" "add %%edx, %%ebx;" "shl $2, %%esi;" "shl $2, %%edi;" "shl $2, %%ebp;" "add %%edi, %%ebx;" "add %%esi, %%ebx;" "add %%ebp, %%ebx;" "shl $1, %%r8d;" "shl $1, %%r9d;" "shl $1, %%r10d;" "shl $1, %%r11d;" "add %%r8d, %%ebx;" "add %%r9d, %%ebx;" "add %%r10d, %%ebx;" "add %%r11d, %%ebx;" : "=b"(res),"+r"(s.i), "+U"(i[6]),"+U"(i[7]),"+U"(i[8]),"+U"(i[9]), // r8,r9,r10,r11 "+R"(i[0]),"+R"(i[1]),"+R"(i[2]), // si,di,bp "+Q"(i[3]),"+Q"(i[4]),"+Q"(i[5]) // ax,cx,dx : "r"(init) ); ASSERT(68, i[6] + i[7] + i[8] + i[9]); ASSERT(120, i[3] + i[4] + i[5]); ASSERT(24, i[0] + i[1] + i[2]); ASSERT(272, s.i); return res; } int exhaust_inner(void) { struct Large s = {.i = 17}; return exhaust_inner2(s); } void exhaust(void) { void *(arr)[12]; int res; __asm__ volatile( "movq %%r12, %[arr];" "movq %%r13, 8+0%[arr];" "movq %%r14, 16+0%[arr];" "movq %%r15, 24+0%[arr];" "movq %%rbp, 32+0%[arr];" "movq %%rbx, 40+0%[arr];" "call exhaust_inner;" "movq %%r12, 48+0%[arr];" "movq %%r13, 56+0%[arr];" "movq %%r14, 64+0%[arr];" "movq %%r15, 72+0%[arr];" "movq %%rbp, 80+0%[arr];" "movq %%rbx, 88+0%[arr];" :"=a"(res), [arr]"=m"(arr) ); ASSERT(484, res); ASSERT(0, memcmp(&arr[0], &arr[6], 6 * 8)); } void bitfield_out() { struct S { int i:4, j:3, k:5, z:20; }; struct S s; s.z = -1; struct S *p = &s; __asm__ ( "mov $13, %b2;" "mov $6, %b0;" "mov $-2, %b1;" :"=r"(p->i), "=r"(p->j), "=r"(p->k) ); ASSERT(6, s.i); ASSERT(-2, s.j); ASSERT(13, s.k); ASSERT(-1, s.z); } void x87(void) { long double f1 = 11, f2 = 22; long double *p2 = &f2; __asm__ ( "fxch %1;" "fmul %2, %0;" :"+t"(f1), "+u"(*p2) :"f"(3.0L) ); ASSERT(1, 66 == f1); ASSERT(1, 11 == f2); } int main(void) { mem_operand_triival(); reg_label(); i_constraint(5); reg_assign(); x87(); x87_clobber(); exhaust(); bitfield_out(); ASSERT(0, ptr_conversion("foo")); ASSERT(1, ptr_conversion("bar")); ASSERT(101, float_flag(1.0f)); ASSERT(110, float_flag(0.0f)); ASSERT(1010, float_flag(0.0f/0.0f)); ASSERT(11, asm_goto(7)); ASSERT(22, asm_goto(6)); ASSERT(33, asm_goto(5)); ASSERT(13, asm_goto_output(&(int){7})); ASSERT(19, asm_goto_output(&(int){6})); ASSERT(30, asm_goto_output(&(int){5})); ASSERT(11, asm_goto_local_label()); printf("OK\n"); }chibicc-1.0.24/issues/issue126.c000066400000000000000000000012341517770275000162350ustar00rootroot00000000000000#include size_t strlcpy(dst, src, siz) char *dst; const char *src; size_t siz; { register char *d = dst; register const char *s = src; register size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return (s - src - 1); /* count does not include NUL */ } int main(void) { return 0; }chibicc-1.0.24/issues/issue137.c000066400000000000000000000006641517770275000162450ustar00rootroot00000000000000#include #include static const char hello[] = "hello, hello!"; void test_compress(compr, comprLen, uncompr, uncomprLen) char *compr, *uncompr; long comprLen, uncomprLen; { int err; long len = (long)strlen(hello) + 1; //strncpy(uncompr, "garbage", 8); printf("uncompress(): %s\n", (char *)uncompr); } int main(int argc, char **argv) { test_compress(&hello, 14, &hello, 14); return 0; } chibicc-1.0.24/issues/issue146.c000066400000000000000000000001561517770275000162410ustar00rootroot00000000000000#include int main (void) { if (sizeof (union semun)) return 0; ; return 0; } chibicc-1.0.24/issues/issue153.c000066400000000000000000000007421517770275000162400ustar00rootroot00000000000000#include #include #include #include typedef __UINTPTR_TYPE__ omp_uintptr_t; int main(int argc, char **argv) { int num_threads,tid; #pragma omp parallel //parallel execution begin { tid = omp_get_thread_num(); printf("Thread id: %d\n", tid); if (tid == 0) { num_threads = omp_get_num_threads(); printf("Number of threads: %d\n", num_threads); } } return 0; }chibicc-1.0.24/issues/issue170.c000066400000000000000000000006571517770275000162440ustar00rootroot00000000000000 #include #include #include #include struct named_init_test { int a; int b; }; extern void structfunc(struct named_init_test); int main(int argc, char **argv) { struct named_init_test nit = { .a = 3, .b = 5, }; for (int loop_var = 0; loop_var < 3; loop_var++) { nit.a += nit.b; } structfunc((struct named_init_test){1, 0}); return nit.a != 0; } chibicc-1.0.24/issues/issue188.c000066400000000000000000000015211517770275000162440ustar00rootroot00000000000000#include #include typedef struct internal_state { int x; int y; int w_size; int hash_size; char *head[10]; char *prev[10]; } FAR deflate_state; void slide_hash(s) deflate_state *s; { unsigned n, m; char *p; uint64_t wsize = s->w_size; n = s->hash_size; p = &s->head[n]; do { m = *--p; *p = (char *)(m >= wsize ? m - wsize : NULL); } while (--n); n = wsize; #ifndef FASTEST p = &s->prev[n]; do { m = *--p; *p = (char *)(m >= wsize ? m - wsize : NULL); /* If n is not on any hash chain, prev[n] is garbage but * its value will never be used. */ } while (--n); #endif } int main() { deflate_state s; s.x = 42; s.y = 17; printf("s.x = %d, s.y = %d\n", s.x, s.y); return 0; } chibicc-1.0.24/issues/issue28.c000077500000000000000000000001071517770275000161570ustar00rootroot00000000000000struct a { int; double d:10; }A; int main() { return 0; }chibicc-1.0.24/issues/issue35.c000077500000000000000000000007341517770275000161630ustar00rootroot00000000000000#include #include "test.h" #define SIZE 10 int myarr[SIZE]; int myarr[] = {11, 34, }; int main(void) { for(int i = 0; i < SIZE; i++) { printf("%d: %d\n", i, myarr[i]); } ASSERT(11, myarr[0]); ASSERT(34, myarr[1]); ASSERT(0, myarr[2]); ASSERT(0, myarr[3]); ASSERT(0, myarr[4]); ASSERT(0, myarr[5]); ASSERT(0, myarr[6]); ASSERT(0, myarr[7]); ASSERT(0, myarr[8]); ASSERT(0, myarr[9]); return 0; }chibicc-1.0.24/issues/issue40a.c000077500000000000000000000001671517770275000163200ustar00rootroot00000000000000// fails silently (pointer to VLA) int x = 10; void fun(char (*a)[x]) { sizeof *a; } int main(void) { return 0; }chibicc-1.0.24/issues/issue41a.c000077500000000000000000000000611517770275000163120ustar00rootroot00000000000000void foo() { } void bar() { int x = foo(); } chibicc-1.0.24/issues/issue41b.c000077500000000000000000000000271517770275000163150ustar00rootroot00000000000000int bar() { return; }chibicc-1.0.24/issues/issue41c.c000077500000000000000000000000541517770275000163160ustar00rootroot00000000000000void foo() {} int bar() { return foo(); }chibicc-1.0.24/issues/issue41d.c000077500000000000000000000000321517770275000163130ustar00rootroot00000000000000void foo() { return 1; }chibicc-1.0.24/issues/issue42.c000077500000000000000000000001251517770275000161530ustar00rootroot00000000000000#include int main() { return;} void foo() { } void bar() { 1 + foo(); }chibicc-1.0.24/issues/issue94.c000066400000000000000000000000741517770275000161620ustar00rootroot00000000000000#if !1u - 1 > 0 #error #endif int main() { return 0; }chibicc-1.0.24/issues/issue_vim.c000066400000000000000000000001361517770275000166570ustar00rootroot00000000000000#include int main() { execl("/bin/sh", "sh", "-c", "XXXX", NULL); return 0; } chibicc-1.0.24/issues/issue_vlcasm.c000066400000000000000000000047271517770275000173630ustar00rootroot00000000000000#include #include #include #include #include #define COPY16_SHIFTR(x) \ "psrlw "x", %%xmm1\n" #define COPY16_SHIFTL(x) \ "psllw "x", %%xmm1\n" #define COPY16_S(dstp, srcp, load, store, shiftstr) \ asm volatile ( \ load " 0(%[src]), %%xmm1\n" \ shiftstr \ store " %%xmm1, 0(%[dst])\n" \ : : [dst]"r"(dstp), [src]"r"(srcp) : "memory", "xmm1") #define COPY16(dstp, srcp, load, store) COPY16_S(dstp, srcp, load, store, "") #define COPY64_SHIFTR(x) \ "psrlw "x", %%xmm1\n" \ "psrlw "x", %%xmm2\n" \ "psrlw "x", %%xmm3\n" \ "psrlw "x", %%xmm4\n" #define COPY64_SHIFTL(x) \ "psllw "x", %%xmm1\n" \ "psllw "x", %%xmm2\n" \ "psllw "x", %%xmm3\n" \ "psllw "x", %%xmm4\n" #define COPY64_S(dstp, srcp, load, store, shiftstr) \ asm volatile ( \ load " 0(%[src]), %%xmm1\n" \ load " 16(%[src]), %%xmm2\n" \ load " 32(%[src]), %%xmm3\n" \ load " 48(%[src]), %%xmm4\n" \ shiftstr \ store " %%xmm1, 0(%[dst])\n" \ store " %%xmm2, 16(%[dst])\n" \ store " %%xmm3, 32(%[dst])\n" \ store " %%xmm4, 48(%[dst])\n" \ : : [dst]"r"(dstp), [src]"r"(srcp) : "memory", "xmm1", "xmm2", "xmm3", "xmm4") #define COPY64(dstp, srcp, load, store) \ COPY64_S(dstp, srcp, load, store, "") static void Copy2d(uint8_t *dst, size_t dst_pitch, const uint8_t *src, size_t src_pitch, unsigned width, unsigned height) { assert(((intptr_t)src & 0x0f) == 0 && (src_pitch & 0x0f) == 0); for (unsigned y = 0; y < height; y++) { unsigned x = 0; bool unaligned = ((intptr_t)dst & 0x0f) != 0; if (!unaligned) { for (; x+63 < width; x += 64) COPY64(&dst[x], &src[x], "movdqa", "movntdq"); } else { for (; x+63 < width; x += 64) COPY64(&dst[x], &src[x], "movdqa", "movdqu"); } for (; x < width; x++) dst[x] = src[x]; src += src_pitch; dst += dst_pitch; } } int main() { const int width = 64; uint8_t dst[width]; uint8_t src[width]; for(int i = 0; i < width; i++) { dst[i] = 1; src[i] = 1; } COPY16(dst, src, "movdqa", "movdqu"); printf("%d\n", dst[0]); printf("%d\n", src[0]); return 0; }chibicc-1.0.24/issues/limits.c000066400000000000000000000002731517770275000161570ustar00rootroot00000000000000#include #include int main() { printf("INT_MAX: %d\n", INT_MAX); printf("INT_MIN: %d\n", INT_MIN); printf("LONG_MAX: %ld\n", LONG_MAX); return 0; } chibicc-1.0.24/issues/list.h000066400000000000000000000100151517770275000156310ustar00rootroot00000000000000/* SPDX-License-Identifier: GPL-2.0-only */ #ifndef LIST_H #define LIST_H /* * Copied from include/linux/... */ #undef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) /** * container_of - cast a member of a structure out to the containing structure * @ptr: the pointer to the member. * @type: the type of the container struct this is embedded in. * @member: the name of the member within the struct. * */ #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) struct list_head { struct list_head *next, *prev; }; #define LIST_HEAD_INIT(name) { &(name), &(name) } #define LIST_HEAD(name) \ struct list_head name = LIST_HEAD_INIT(name) /** * list_entry - get the struct for this entry * @ptr: the &struct list_head pointer. * @type: the type of the struct this is embedded in. * @member: the name of the list_head within the struct. */ #define list_entry(ptr, type, member) \ container_of(ptr, type, member) /** * list_for_each_entry - iterate over list of given type * @pos: the type * to use as a loop cursor. * @head: the head for your list. * @member: the name of the list_head within the struct. */ #define list_for_each_entry(pos, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member); \ &pos->member != (head); \ pos = list_entry(pos->member.next, typeof(*pos), member)) /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry * @pos: the type * to use as a loop cursor. * @n: another type * to use as temporary storage * @head: the head for your list. * @member: the name of the list_head within the struct. */ #define list_for_each_entry_safe(pos, n, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member), \ n = list_entry(pos->member.next, typeof(*pos), member); \ &pos->member != (head); \ pos = n, n = list_entry(n->member.next, typeof(*n), member)) /** * list_empty - tests whether a list is empty * @head: the list to test. */ static inline int list_empty(const struct list_head *head) { return head->next == head; } /* * Insert a new entry between two known consecutive entries. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __list_add(struct list_head *_new, struct list_head *prev, struct list_head *next) { next->prev = _new; _new->next = next; _new->prev = prev; prev->next = _new; } /** * list_add_tail - add a new entry * @new: new entry to be added * @head: list head to add it before * * Insert a new entry before the specified head. * This is useful for implementing queues. */ static inline void list_add_tail(struct list_head *_new, struct list_head *head) { __list_add(_new, head->prev, head); } /* * Delete a list entry by making the prev/next entries * point to each other. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __list_del(struct list_head *prev, struct list_head *next) { next->prev = prev; prev->next = next; } #define LIST_POISON1 ((void *) 0x00100100) #define LIST_POISON2 ((void *) 0x00200200) /** * list_del - deletes entry from list. * @entry: the element to delete from the list. * Note: list_empty() on entry does not return true after this, the entry is * in an undefined state. */ static inline void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); entry->next = (struct list_head*)LIST_POISON1; entry->prev = (struct list_head*)LIST_POISON2; } #endifchibicc-1.0.24/issues/lj_arch.h000066400000000000000000000454731517770275000163000ustar00rootroot00000000000000/* ** Target architecture selection. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_ARCH_H #define _LJ_ARCH_H #include "lua.h" /* -- Target definitions -------------------------------------------------- */ /* Target endianess. */ #define LUAJIT_LE 0 #define LUAJIT_BE 1 /* Target architectures. */ #define LUAJIT_ARCH_X86 1 #define LUAJIT_ARCH_x86 1 #define LUAJIT_ARCH_X64 2 #define LUAJIT_ARCH_x64 2 #define LUAJIT_ARCH_ARM 3 #define LUAJIT_ARCH_arm 3 #define LUAJIT_ARCH_ARM64 4 #define LUAJIT_ARCH_arm64 4 #define LUAJIT_ARCH_PPC 5 #define LUAJIT_ARCH_ppc 5 #define LUAJIT_ARCH_MIPS 6 #define LUAJIT_ARCH_mips 6 #define LUAJIT_ARCH_MIPS32 6 #define LUAJIT_ARCH_mips32 6 #define LUAJIT_ARCH_MIPS64 7 #define LUAJIT_ARCH_mips64 7 /* Target OS. */ #define LUAJIT_OS_OTHER 0 #define LUAJIT_OS_WINDOWS 1 #define LUAJIT_OS_LINUX 2 #define LUAJIT_OS_OSX 3 #define LUAJIT_OS_BSD 4 #define LUAJIT_OS_POSIX 5 /* Number mode. */ #define LJ_NUMMODE_SINGLE 0 /* Single-number mode only. */ #define LJ_NUMMODE_SINGLE_DUAL 1 /* Default to single-number mode. */ #define LJ_NUMMODE_DUAL 2 /* Dual-number mode only. */ #define LJ_NUMMODE_DUAL_SINGLE 3 /* Default to dual-number mode. */ /* -- Target detection ---------------------------------------------------- */ /* Select native target if no target defined. */ #ifndef LUAJIT_TARGET #if defined(__i386) || defined(__i386__) || defined(_M_IX86) #define LUAJIT_TARGET LUAJIT_ARCH_X86 #elif defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) #define LUAJIT_TARGET LUAJIT_ARCH_X64 #elif defined(__arm__) || defined(__arm) || defined(__ARM__) || defined(__ARM) #define LUAJIT_TARGET LUAJIT_ARCH_ARM #elif defined(__aarch64__) || defined(_M_ARM64) #define LUAJIT_TARGET LUAJIT_ARCH_ARM64 #elif defined(__ppc__) || defined(__ppc) || defined(__PPC__) || defined(__PPC) || defined(__powerpc__) || defined(__powerpc) || defined(__POWERPC__) || defined(__POWERPC) || defined(_M_PPC) #define LUAJIT_TARGET LUAJIT_ARCH_PPC #elif defined(__mips64__) || defined(__mips64) || defined(__MIPS64__) || defined(__MIPS64) #define LUAJIT_TARGET LUAJIT_ARCH_MIPS64 #elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(__MIPS) #define LUAJIT_TARGET LUAJIT_ARCH_MIPS32 #else #error "Architecture not supported (in this version), see: https://luajit.org/status.html#architectures" #endif #endif /* Select native OS if no target OS defined. */ #ifndef LUAJIT_OS #if defined(_WIN32) && !defined(_XBOX_VER) #define LUAJIT_OS LUAJIT_OS_WINDOWS #elif defined(__linux__) #define LUAJIT_OS LUAJIT_OS_LINUX #elif defined(__MACH__) && defined(__APPLE__) #include "TargetConditionals.h" #define LUAJIT_OS LUAJIT_OS_OSX #elif (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ defined(__NetBSD__) || defined(__OpenBSD__) || \ defined(__DragonFly__)) && !defined(__ORBIS__) && !defined(__PROSPERO__) #define LUAJIT_OS LUAJIT_OS_BSD #elif (defined(__sun__) && defined(__svr4__)) #define LJ_TARGET_SOLARIS 1 #define LUAJIT_OS LUAJIT_OS_POSIX #elif defined(__HAIKU__) #define LUAJIT_OS LUAJIT_OS_POSIX #elif defined(__CYGWIN__) #define LJ_TARGET_CYGWIN 1 #define LUAJIT_OS LUAJIT_OS_POSIX #elif defined(__QNX__) #define LJ_TARGET_QNX 1 #define LUAJIT_OS LUAJIT_OS_POSIX #else #define LUAJIT_OS LUAJIT_OS_OTHER #endif #endif /* Set target OS properties. */ #if LUAJIT_OS == LUAJIT_OS_WINDOWS #define LJ_OS_NAME "Windows" #elif LUAJIT_OS == LUAJIT_OS_LINUX #define LJ_OS_NAME "Linux" #elif LUAJIT_OS == LUAJIT_OS_OSX #define LJ_OS_NAME "OSX" #elif LUAJIT_OS == LUAJIT_OS_BSD #define LJ_OS_NAME "BSD" #elif LUAJIT_OS == LUAJIT_OS_POSIX #define LJ_OS_NAME "POSIX" #else #define LJ_OS_NAME "Other" #endif #define LJ_TARGET_WINDOWS (LUAJIT_OS == LUAJIT_OS_WINDOWS) #define LJ_TARGET_LINUX (LUAJIT_OS == LUAJIT_OS_LINUX) #define LJ_TARGET_OSX (LUAJIT_OS == LUAJIT_OS_OSX) #define LJ_TARGET_BSD (LUAJIT_OS == LUAJIT_OS_BSD) #define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS) #define LJ_TARGET_DLOPEN LJ_TARGET_POSIX #if TARGET_OS_IPHONE #define LJ_TARGET_IOS 1 #else #define LJ_TARGET_IOS 0 #endif #ifdef __CELLOS_LV2__ #define LJ_TARGET_PS3 1 #define LJ_TARGET_CONSOLE 1 #endif #ifdef __ORBIS__ #define LJ_TARGET_PS4 1 #define LJ_TARGET_CONSOLE 1 #undef NULL #define NULL ((void*)0) #endif #ifdef __PROSPERO__ #define LJ_TARGET_PS5 1 #define LJ_TARGET_CONSOLE 1 #undef NULL #define NULL ((void*)0) #endif #ifdef __psp2__ #define LJ_TARGET_PSVITA 1 #define LJ_TARGET_CONSOLE 1 #endif #if _XBOX_VER >= 200 #define LJ_TARGET_XBOX360 1 #define LJ_TARGET_CONSOLE 1 #endif #ifdef _DURANGO #define LJ_TARGET_XBOXONE 1 #define LJ_TARGET_CONSOLE 1 #define LJ_TARGET_GC64 1 #endif #ifdef __NX__ #define LJ_TARGET_NX 1 #define LJ_TARGET_CONSOLE 1 #undef NULL #define NULL ((void*)0) #endif #ifdef _UWP #define LJ_TARGET_UWP 1 #if LUAJIT_TARGET == LUAJIT_ARCH_X64 #define LJ_TARGET_GC64 1 #endif #endif /* -- Arch-specific settings ---------------------------------------------- */ /* Set target architecture properties. */ #if LUAJIT_TARGET == LUAJIT_ARCH_X86 #define LJ_ARCH_NAME "x86" #define LJ_ARCH_BITS 32 #define LJ_ARCH_ENDIAN LUAJIT_LE #define LJ_TARGET_X86 1 #define LJ_TARGET_X86ORX64 1 #define LJ_TARGET_EHRETREG 0 #define LJ_TARGET_EHRAREG 8 #define LJ_TARGET_MASKSHIFT 1 #define LJ_TARGET_MASKROT 1 #define LJ_TARGET_UNALIGNED 1 #define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE_DUAL #elif LUAJIT_TARGET == LUAJIT_ARCH_X64 #define LJ_ARCH_NAME "x64" #define LJ_ARCH_BITS 64 #define LJ_ARCH_ENDIAN LUAJIT_LE #define LJ_TARGET_X64 1 #define LJ_TARGET_X86ORX64 1 #define LJ_TARGET_EHRETREG 0 #define LJ_TARGET_EHRAREG 16 #define LJ_TARGET_JUMPRANGE 31 /* +-2^31 = +-2GB */ #define LJ_TARGET_MASKSHIFT 1 #define LJ_TARGET_MASKROT 1 #define LJ_TARGET_UNALIGNED 1 #define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE_DUAL #ifndef LUAJIT_DISABLE_GC64 #define LJ_TARGET_GC64 1 #elif LJ_TARGET_OSX #error "macOS requires GC64 -- don't disable it" #endif #elif LUAJIT_TARGET == LUAJIT_ARCH_ARM #define LJ_ARCH_NAME "arm" #define LJ_ARCH_BITS 32 #define LJ_ARCH_ENDIAN LUAJIT_LE #if !defined(LJ_ARCH_HASFPU) && __SOFTFP__ #define LJ_ARCH_HASFPU 0 #endif #if !defined(LJ_ABI_SOFTFP) && !__ARM_PCS_VFP #define LJ_ABI_SOFTFP 1 #endif #define LJ_ABI_EABI 1 #define LJ_TARGET_ARM 1 #define LJ_TARGET_EHRETREG 0 #define LJ_TARGET_EHRAREG 14 #define LJ_TARGET_JUMPRANGE 25 /* +-2^25 = +-32MB */ #define LJ_TARGET_MASKSHIFT 0 #define LJ_TARGET_MASKROT 1 #define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ #define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL #if __ARM_ARCH >= 8 || __ARM_ARCH_8__ || __ARM_ARCH_8A__ #define LJ_ARCH_VERSION 80 #elif __ARM_ARCH == 7 || __ARM_ARCH_7__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH_7S__ || __ARM_ARCH_7VE__ #define LJ_ARCH_VERSION 70 #elif __ARM_ARCH_6T2__ #define LJ_ARCH_VERSION 61 #elif __ARM_ARCH == 6 || __ARM_ARCH_6__ || __ARM_ARCH_6J__ || __ARM_ARCH_6K__ || __ARM_ARCH_6Z__ || __ARM_ARCH_6ZK__ #define LJ_ARCH_VERSION 60 #else #define LJ_ARCH_VERSION 50 #endif #elif LUAJIT_TARGET == LUAJIT_ARCH_ARM64 #define LJ_ARCH_BITS 64 #if defined(__AARCH64EB__) #define LJ_ARCH_NAME "arm64be" #define LJ_ARCH_ENDIAN LUAJIT_BE #else #define LJ_ARCH_NAME "arm64" #define LJ_ARCH_ENDIAN LUAJIT_LE #endif #if !defined(LJ_ABI_PAUTH) && defined(__arm64e__) #define LJ_ABI_PAUTH 1 #endif #define LJ_TARGET_ARM64 1 #define LJ_TARGET_EHRETREG 0 #define LJ_TARGET_EHRAREG 30 #define LJ_TARGET_JUMPRANGE 27 /* +-2^27 = +-128MB */ #define LJ_TARGET_MASKSHIFT 1 #define LJ_TARGET_MASKROT 1 #define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ #define LJ_TARGET_GC64 1 #define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL #define LJ_ARCH_VERSION 80 #elif LUAJIT_TARGET == LUAJIT_ARCH_PPC #ifndef LJ_ARCH_ENDIAN #if __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__ #define LJ_ARCH_ENDIAN LUAJIT_LE #else #define LJ_ARCH_ENDIAN LUAJIT_BE #endif #endif #if _LP64 #define LJ_ARCH_BITS 64 #if LJ_ARCH_ENDIAN == LUAJIT_LE #define LJ_ARCH_NAME "ppc64le" #else #define LJ_ARCH_NAME "ppc64" #endif #else #define LJ_ARCH_BITS 32 #define LJ_ARCH_NAME "ppc" #if !defined(LJ_ARCH_HASFPU) #if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) #define LJ_ARCH_HASFPU 0 #else #define LJ_ARCH_HASFPU 1 #endif #endif #if !defined(LJ_ABI_SOFTFP) #if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) #define LJ_ABI_SOFTFP 1 #else #define LJ_ABI_SOFTFP 0 #endif #endif #endif #if LJ_ABI_SOFTFP #define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL #else #define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL_SINGLE #endif #define LJ_TARGET_PPC 1 #define LJ_TARGET_EHRETREG 3 #define LJ_TARGET_EHRAREG 65 #define LJ_TARGET_JUMPRANGE 25 /* +-2^25 = +-32MB */ #define LJ_TARGET_MASKSHIFT 0 #define LJ_TARGET_MASKROT 1 #define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */ #if LJ_TARGET_CONSOLE #define LJ_ARCH_PPC32ON64 1 #define LJ_ARCH_NOFFI 1 #elif LJ_ARCH_BITS == 64 #error "No support for PPC64" #undef LJ_TARGET_PPC #endif #if _ARCH_PWR7 #define LJ_ARCH_VERSION 70 #elif _ARCH_PWR6 #define LJ_ARCH_VERSION 60 #elif _ARCH_PWR5X #define LJ_ARCH_VERSION 51 #elif _ARCH_PWR5 #define LJ_ARCH_VERSION 50 #elif _ARCH_PWR4 #define LJ_ARCH_VERSION 40 #else #define LJ_ARCH_VERSION 0 #endif #if _ARCH_PPCSQ #define LJ_ARCH_SQRT 1 #endif #if _ARCH_PWR5X #define LJ_ARCH_ROUND 1 #endif #if __PPU__ #define LJ_ARCH_CELL 1 #endif #if LJ_TARGET_XBOX360 #define LJ_ARCH_XENON 1 #endif #elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 || LUAJIT_TARGET == LUAJIT_ARCH_MIPS64 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) #if __mips_isa_rev >= 6 #define LJ_TARGET_MIPSR6 1 #define LJ_TARGET_UNALIGNED 1 #endif #if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 #if LJ_TARGET_MIPSR6 #define LJ_ARCH_NAME "mips32r6el" #else #define LJ_ARCH_NAME "mipsel" #endif #else #if LJ_TARGET_MIPSR6 #define LJ_ARCH_NAME "mips64r6el" #else #define LJ_ARCH_NAME "mips64el" #endif #endif #define LJ_ARCH_ENDIAN LUAJIT_LE #else #if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 #if LJ_TARGET_MIPSR6 #define LJ_ARCH_NAME "mips32r6" #else #define LJ_ARCH_NAME "mips" #endif #else #if LJ_TARGET_MIPSR6 #define LJ_ARCH_NAME "mips64r6" #else #define LJ_ARCH_NAME "mips64" #endif #endif #define LJ_ARCH_ENDIAN LUAJIT_BE #endif #if !defined(LJ_ARCH_HASFPU) #ifdef __mips_soft_float #define LJ_ARCH_HASFPU 0 #else #define LJ_ARCH_HASFPU 1 #endif #endif #if !defined(LJ_ABI_SOFTFP) #ifdef __mips_soft_float #define LJ_ABI_SOFTFP 1 #else #define LJ_ABI_SOFTFP 0 #endif #endif #if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 #define LJ_ARCH_BITS 32 #define LJ_TARGET_MIPS32 1 #else #define LJ_ARCH_BITS 64 #define LJ_TARGET_MIPS64 1 #define LJ_TARGET_GC64 1 #endif #define LJ_TARGET_MIPS 1 #define LJ_TARGET_EHRETREG 4 #define LJ_TARGET_EHRAREG 31 #define LJ_TARGET_JUMPRANGE 27 /* 2*2^27 = 256MB-aligned region */ #define LJ_TARGET_MASKSHIFT 1 #define LJ_TARGET_MASKROT 1 #define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ #define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL #if LJ_TARGET_MIPSR6 #define LJ_ARCH_VERSION 60 #elif _MIPS_ARCH_MIPS32R2 || _MIPS_ARCH_MIPS64R2 #define LJ_ARCH_VERSION 20 #else #define LJ_ARCH_VERSION 10 #endif #else #error "No target architecture defined" #endif /* -- Checks for requirements --------------------------------------------- */ /* Check for minimum required compiler versions. */ #if defined(__GNUC__) #if LJ_TARGET_X86 #if (__GNUC__ < 3) || ((__GNUC__ == 3) && __GNUC_MINOR__ < 4) #error "Need at least GCC 3.4 or newer" #endif #elif LJ_TARGET_X64 #if __GNUC__ < 4 #error "Need at least GCC 4.0 or newer" #endif #elif LJ_TARGET_ARM #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 2) #error "Need at least GCC 4.2 or newer" #endif #elif LJ_TARGET_ARM64 #if __clang__ #if ((__clang_major__ < 3) || ((__clang_major__ == 3) && __clang_minor__ < 5)) && !defined(__NX_TOOLCHAIN_MAJOR__) #error "Need at least Clang 3.5 or newer" #endif #else #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 8) #error "Need at least GCC 4.8 or newer" #endif #endif #elif !LJ_TARGET_PS3 #if __clang__ #if ((__clang_major__ < 3) || ((__clang_major__ == 3) && __clang_minor__ < 5)) #error "Need at least Clang 3.5 or newer" #endif #else #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3) #error "Need at least GCC 4.3 or newer" #endif #endif #endif #endif /* Check target-specific constraints. */ #ifndef _BUILDVM_H #if LJ_TARGET_X64 #if __USING_SJLJ_EXCEPTIONS__ #error "Need a C compiler with native exception handling on x64" #endif #elif LJ_TARGET_ARM #if defined(__ARMEB__) #error "No support for big-endian ARM" #undef LJ_TARGET_ARM #endif #if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ #error "No support for Cortex-M CPUs" #undef LJ_TARGET_ARM #endif #if !(__ARM_EABI__ || LJ_TARGET_IOS) #error "Only ARM EABI or iOS 3.0+ ABI is supported" #undef LJ_TARGET_ARM #endif #elif LJ_TARGET_ARM64 #if defined(_ILP32) #error "No support for ILP32 model on ARM64" #undef LJ_TARGET_ARM64 #endif #elif LJ_TARGET_PPC #if defined(_LITTLE_ENDIAN) && (!defined(_BYTE_ORDER) || (_BYTE_ORDER == _LITTLE_ENDIAN)) #error "No support for little-endian PPC32" #undef LJ_TARGET_PPC #endif #if defined(__NO_FPRS__) && !defined(_SOFT_FLOAT) #error "No support for PPC/e500, use LuaJIT 2.0" #undef LJ_TARGET_PPC #endif #elif LJ_TARGET_MIPS32 #if !((defined(_MIPS_SIM_ABI32) && _MIPS_SIM == _MIPS_SIM_ABI32) || (defined(_ABIO32) && _MIPS_SIM == _ABIO32)) #error "Only o32 ABI supported for MIPS32" #undef LJ_TARGET_MIPS #endif #if LJ_TARGET_MIPSR6 /* Not that useful, since most available r6 CPUs are 64 bit. */ #error "No support for MIPS32R6" #undef LJ_TARGET_MIPS #endif #elif LJ_TARGET_MIPS64 #if !((defined(_MIPS_SIM_ABI64) && _MIPS_SIM == _MIPS_SIM_ABI64) || (defined(_ABI64) && _MIPS_SIM == _ABI64)) /* MIPS32ON64 aka n32 ABI support might be desirable, but difficult. */ #error "Only n64 ABI supported for MIPS64" #undef LJ_TARGET_MIPS #endif #endif #endif /* -- Derived defines ----------------------------------------------------- */ /* Enable or disable the dual-number mode for the VM. */ #if (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE && LUAJIT_NUMMODE == 2) || \ (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL && LUAJIT_NUMMODE == 1) #error "No support for this number mode on this architecture" #endif #if LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL || \ (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL_SINGLE && LUAJIT_NUMMODE != 1) || \ (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE_DUAL && LUAJIT_NUMMODE == 2) #define LJ_DUALNUM 1 #else #define LJ_DUALNUM 0 #endif #if LJ_TARGET_IOS || LJ_TARGET_CONSOLE /* Runtime code generation is restricted on iOS. Complain to Apple, not me. */ /* Ditto for the consoles. Complain to Sony or MS, not me. */ #ifndef LUAJIT_ENABLE_JIT #define LJ_OS_NOJIT 1 #endif #endif /* 64 bit GC references. */ #if LJ_TARGET_GC64 #define LJ_GC64 1 #else #define LJ_GC64 0 #endif /* 2-slot frame info. */ #if LJ_GC64 #define LJ_FR2 1 #else #define LJ_FR2 0 #endif /* Disable or enable the JIT compiler. */ #if defined(LUAJIT_DISABLE_JIT) || defined(LJ_ARCH_NOJIT) || defined(LJ_OS_NOJIT) #define LJ_HASJIT 0 #else #define LJ_HASJIT 1 #endif /* Disable or enable the FFI extension. */ #if defined(LUAJIT_DISABLE_FFI) || defined(LJ_ARCH_NOFFI) #define LJ_HASFFI 0 #else #define LJ_HASFFI 1 #endif /* Disable or enable the string buffer extension. */ #if defined(LUAJIT_DISABLE_BUFFER) #define LJ_HASBUFFER 0 #else #define LJ_HASBUFFER 1 #endif #if defined(LUAJIT_DISABLE_PROFILE) #define LJ_HASPROFILE 0 #elif LJ_TARGET_POSIX #define LJ_HASPROFILE 1 #define LJ_PROFILE_SIGPROF 1 #elif LJ_TARGET_PS3 #define LJ_HASPROFILE 1 #define LJ_PROFILE_PTHREAD 1 #elif LJ_TARGET_WINDOWS || LJ_TARGET_XBOX360 #define LJ_HASPROFILE 1 #define LJ_PROFILE_WTHREAD 1 #else #define LJ_HASPROFILE 0 #endif #ifndef LJ_ARCH_HASFPU #define LJ_ARCH_HASFPU 1 #endif #ifndef LJ_ABI_SOFTFP #define LJ_ABI_SOFTFP 0 #endif #define LJ_SOFTFP (!LJ_ARCH_HASFPU) #define LJ_SOFTFP32 (LJ_SOFTFP && LJ_32) #ifndef LJ_ABI_PAUTH #define LJ_ABI_PAUTH 0 #endif #if LJ_ARCH_ENDIAN == LUAJIT_BE #define LJ_LE 0 #define LJ_BE 1 #define LJ_ENDIAN_SELECT(le, be) be #define LJ_ENDIAN_LOHI(lo, hi) hi lo #else #define LJ_LE 1 #define LJ_BE 0 #define LJ_ENDIAN_SELECT(le, be) le #define LJ_ENDIAN_LOHI(lo, hi) lo hi #endif #if LJ_ARCH_BITS == 32 #define LJ_32 1 #define LJ_64 0 #else #define LJ_32 0 #define LJ_64 1 #endif #ifndef LJ_TARGET_UNALIGNED #define LJ_TARGET_UNALIGNED 0 #endif #ifndef LJ_PAGESIZE #define LJ_PAGESIZE 4096 #endif /* Various workarounds for embedded operating systems or weak C runtimes. */ #if defined(__ANDROID__) || defined(__symbian__) || LJ_TARGET_XBOX360 || LJ_TARGET_WINDOWS #define LUAJIT_NO_LOG2 #endif #if LJ_TARGET_CONSOLE || (LJ_TARGET_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0) #define LJ_NO_SYSTEM 1 #endif #if LJ_TARGET_WINDOWS || LJ_TARGET_CYGWIN #define LJ_ABI_WIN 1 #else #define LJ_ABI_WIN 0 #endif #if LJ_TARGET_WINDOWS #if LJ_TARGET_UWP #define LJ_WIN_VALLOC VirtualAllocFromApp #define LJ_WIN_VPROTECT VirtualProtectFromApp extern void *LJ_WIN_LOADLIBA(const char *path); #else #define LJ_WIN_VALLOC VirtualAlloc #define LJ_WIN_VPROTECT VirtualProtect #define LJ_WIN_LOADLIBA(path) LoadLibraryExA((path), NULL, 0) #endif #endif #if defined(LUAJIT_NO_UNWIND) || __GNU_COMPACT_EH__ || defined(__symbian__) || LJ_TARGET_IOS || LJ_TARGET_PS3 || LJ_TARGET_PS4 || LJ_TARGET_PS5 #define LJ_NO_UNWIND 1 #endif #if !LJ_NO_UNWIND && !defined(LUAJIT_UNWIND_INTERNAL) && (LJ_ABI_WIN || (defined(LUAJIT_UNWIND_EXTERNAL) && (defined(__GNUC__) || defined(__clang__)))) #define LJ_UNWIND_EXT 1 #else #define LJ_UNWIND_EXT 0 #endif #if LJ_UNWIND_EXT && LJ_HASJIT && !LJ_TARGET_ARM && !(LJ_ABI_WIN && LJ_TARGET_X86) #define LJ_UNWIND_JIT 1 #else #define LJ_UNWIND_JIT 0 #endif /* Compatibility with Lua 5.1 vs. 5.2. */ #ifdef LUAJIT_ENABLE_LUA52COMPAT #define LJ_52 1 #else #define LJ_52 0 #endif /* -- VM security --------------------------------------------------------- */ /* Don't make any changes here. Instead build with: ** make "XCFLAGS=-DLUAJIT_SECURITY_flag=value" ** ** Important note to distro maintainers: DO NOT change the defaults for a ** regular distro build -- neither upwards, nor downwards! ** These build-time configurable security flags are intended for embedders ** who may have specific needs wrt. security vs. performance. */ /* Security defaults. */ #ifndef LUAJIT_SECURITY_PRNG /* PRNG init: 0 = fixed/insecure, 1 = secure from OS. */ #define LUAJIT_SECURITY_PRNG 1 #endif #ifndef LUAJIT_SECURITY_STRHASH /* String hash: 0 = sparse only, 1 = sparse + dense. */ #define LUAJIT_SECURITY_STRHASH 1 #endif #ifndef LUAJIT_SECURITY_STRID /* String IDs: 0 = linear, 1 = reseed < 255, 2 = reseed < 15, 3 = random. */ #define LUAJIT_SECURITY_STRID 1 #endif #ifndef LUAJIT_SECURITY_MCODE /* Machine code page protection: 0 = insecure RWX, 1 = secure RW^X. */ #define LUAJIT_SECURITY_MCODE 1 #endif #define LJ_SECURITY_MODE \ ( 0u \ | ((LUAJIT_SECURITY_PRNG & 3) << 0) \ | ((LUAJIT_SECURITY_STRHASH & 3) << 2) \ | ((LUAJIT_SECURITY_STRID & 3) << 4) \ | ((LUAJIT_SECURITY_MCODE & 3) << 6) \ ) #define LJ_SECURITY_MODESTRING \ "\004prng\007strhash\005strid\005mcode" #endif chibicc-1.0.24/issues/loongarch.c000066400000000000000000000004751517770275000166360ustar00rootroot00000000000000//#include int main () { unsigned int crc = 0; crc = __crc32cb(crc, 0); crc = __crc32ch(crc, 0); crc = __crc32cw(crc, 0); crc = __crc32cd(crc, 0); /* return computed value, to prevent the above being optimized away */ return crc == 0; ; return undeclared_func(123); }chibicc-1.0.24/issues/lru_recursion.c000066400000000000000000000053731517770275000175570ustar00rootroot00000000000000// Reproducer for CPython-like LRU recursion stack-overflow failures. // // Build: // ./chibicc -O3 -fomit-frame-pointer -o issues/lru_recursion.exe issues/lru_recursion.c // gcc -O3 -fomit-frame-pointer -o issues/lru_recursion_gcc.exe issues/lru_recursion.c // // Run: // ./issues/lru_recursion.exe [depth] // // Default depth is 100000. The program emulates a recursive LRU-style wrapper // chain and aborts with a CPython-like fatal message if stack usage gets too // close to an 8 MiB limit with a 16 KiB safety margin. #include #include #include #include #include enum { STACK_LIMIT = 8 * 1024 * 1024, STACK_MARGIN = 16 * 1024, DEFAULT_DEPTH = 100000, }; static uintptr_t stack_base; static uintptr_t max_used; static int stack_overflow; static jmp_buf bailout; static int *memo; static unsigned char *seen; static uintptr_t get_sp(void) { return (uintptr_t)__builtin_frame_address(0); } static void check_stack(void) { uintptr_t sp = get_sp(); uintptr_t used = (stack_base >= sp) ? (stack_base - sp) : (sp - stack_base); if (used > max_used) max_used = used; if (used + STACK_MARGIN >= STACK_LIMIT) { stack_overflow = 1; longjmp(bailout, 1); } } static int fib_lru(int n); // Prevent TCO and mimic an extra wrapper frame like functools._lru_cache_wrapper. __attribute__((noinline)) static int lru_call(int n) { volatile int keep = n; int v = fib_lru(keep); return v + (keep - keep); } __attribute__((noinline)) static int fib_lru_impl(int n) { check_stack(); if (n < 2) return n; if (seen[n]) return memo[n]; int a = lru_call(n - 1); int b = lru_call(n - 2); int v = a + b; seen[n] = 1; memo[n] = v; return v; } __attribute__((noinline)) static int fib_lru(int n) { check_stack(); return fib_lru_impl(n); } int main(int argc, char **argv) { int depth = DEFAULT_DEPTH; if (argc > 1) depth = atoi(argv[1]); if (depth < 0) { fprintf(stderr, "depth must be >= 0\n"); return 2; } memo = calloc((size_t)depth + 1, sizeof(int)); seen = calloc((size_t)depth + 1, 1); if (!memo || !seen) { fprintf(stderr, "allocation failed\n"); return 2; } stack_base = get_sp(); max_used = 0; stack_overflow = 0; if (setjmp(bailout) == 0) { int r = fib_lru(depth); printf("depth=%d result=%d max_stack=%lu bytes\n", depth, r, (unsigned long)max_used); printf("OK\n"); } else { printf("Fatal Python error: _Py_CheckRecursiveCall: Unrecoverable stack overflow (used %lu kB)\n", (unsigned long)(max_used / 1024)); printf("Current thread [python] (most recent call first):\n"); printf(" File \"test_functools.py\", line 2151 in fib\n"); } free(memo); free(seen); return stack_overflow ? 1 : 0; } chibicc-1.0.24/issues/lua.h000066400000000000000000000300441517770275000154430ustar00rootroot00000000000000/* ** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $ ** Lua - An Extensible Extension Language ** Lua.org, PUC-Rio, Brazil (https://www.lua.org) ** See Copyright Notice at the end of this file */ #ifndef lua_h #define lua_h #include #include #include "luaconf.h" #define LUA_VERSION "Lua 5.1" #define LUA_RELEASE "Lua 5.1.4" #define LUA_VERSION_NUM 501 #define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" /* mark for precompiled code (`Lua') */ #define LUA_SIGNATURE "\033Lua" /* option for multiple returns in `lua_pcall' and `lua_call' */ #define LUA_MULTRET (-1) /* ** pseudo-indices */ #define LUA_REGISTRYINDEX (-10000) #define LUA_ENVIRONINDEX (-10001) #define LUA_GLOBALSINDEX (-10002) #define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) /* thread status */ #define LUA_OK 0 #define LUA_YIELD 1 #define LUA_ERRRUN 2 #define LUA_ERRSYNTAX 3 #define LUA_ERRMEM 4 #define LUA_ERRERR 5 typedef struct lua_State lua_State; typedef int (*lua_CFunction) (lua_State *L); /* ** functions that read/write blocks when loading/dumping Lua chunks */ typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud); /* ** prototype for memory-allocation functions */ typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); /* ** basic types */ #define LUA_TNONE (-1) #define LUA_TNIL 0 #define LUA_TBOOLEAN 1 #define LUA_TLIGHTUSERDATA 2 #define LUA_TNUMBER 3 #define LUA_TSTRING 4 #define LUA_TTABLE 5 #define LUA_TFUNCTION 6 #define LUA_TUSERDATA 7 #define LUA_TTHREAD 8 /* minimum Lua stack available to a C function */ #define LUA_MINSTACK 20 /* ** generic extra include file */ #if defined(LUA_USER_H) #include LUA_USER_H #endif /* type of numbers in Lua */ typedef LUA_NUMBER lua_Number; /* type for integer functions */ typedef LUA_INTEGER lua_Integer; /* ** state manipulation */ LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); LUA_API void (lua_close) (lua_State *L); LUA_API lua_State *(lua_newthread) (lua_State *L); LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); /* ** basic stack manipulation */ LUA_API int (lua_gettop) (lua_State *L); LUA_API void (lua_settop) (lua_State *L, int idx); LUA_API void (lua_pushvalue) (lua_State *L, int idx); LUA_API void (lua_remove) (lua_State *L, int idx); LUA_API void (lua_insert) (lua_State *L, int idx); LUA_API void (lua_replace) (lua_State *L, int idx); LUA_API int (lua_checkstack) (lua_State *L, int sz); LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); /* ** access functions (stack -> C) */ LUA_API int (lua_isnumber) (lua_State *L, int idx); LUA_API int (lua_isstring) (lua_State *L, int idx); LUA_API int (lua_iscfunction) (lua_State *L, int idx); LUA_API int (lua_isuserdata) (lua_State *L, int idx); LUA_API int (lua_type) (lua_State *L, int idx); LUA_API const char *(lua_typename) (lua_State *L, int tp); LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2); LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2); LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2); LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); LUA_API int (lua_toboolean) (lua_State *L, int idx); LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); LUA_API size_t (lua_objlen) (lua_State *L, int idx); LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); LUA_API void *(lua_touserdata) (lua_State *L, int idx); LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); LUA_API const void *(lua_topointer) (lua_State *L, int idx); /* ** push functions (C -> stack) */ LUA_API void (lua_pushnil) (lua_State *L); LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l); LUA_API void (lua_pushstring) (lua_State *L, const char *s); LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, va_list argp); LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...); LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n); LUA_API void (lua_pushboolean) (lua_State *L, int b); LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p); LUA_API int (lua_pushthread) (lua_State *L); /* ** get functions (Lua -> stack) */ LUA_API void (lua_gettable) (lua_State *L, int idx); LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); LUA_API void (lua_rawget) (lua_State *L, int idx); LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); LUA_API int (lua_getmetatable) (lua_State *L, int objindex); LUA_API void (lua_getfenv) (lua_State *L, int idx); /* ** set functions (stack -> Lua) */ LUA_API void (lua_settable) (lua_State *L, int idx); LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); LUA_API void (lua_rawset) (lua_State *L, int idx); LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); LUA_API int (lua_setmetatable) (lua_State *L, int objindex); LUA_API int (lua_setfenv) (lua_State *L, int idx); /* ** `load' and `call' functions (load and run Lua code) */ LUA_API void (lua_call) (lua_State *L, int nargs, int nresults); LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc); LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud); LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, const char *chunkname); LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); /* ** coroutine functions */ LUA_API int (lua_yield) (lua_State *L, int nresults); LUA_API int (lua_resume) (lua_State *L, int narg); LUA_API int (lua_status) (lua_State *L); /* ** garbage-collection function and options */ #define LUA_GCSTOP 0 #define LUA_GCRESTART 1 #define LUA_GCCOLLECT 2 #define LUA_GCCOUNT 3 #define LUA_GCCOUNTB 4 #define LUA_GCSTEP 5 #define LUA_GCSETPAUSE 6 #define LUA_GCSETSTEPMUL 7 #define LUA_GCISRUNNING 9 LUA_API int (lua_gc) (lua_State *L, int what, int data); /* ** miscellaneous functions */ LUA_API int (lua_error) (lua_State *L); LUA_API int (lua_next) (lua_State *L, int idx); LUA_API void (lua_concat) (lua_State *L, int n); LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); /* ** =============================================================== ** some useful macros ** =============================================================== */ #define lua_pop(L,n) lua_settop(L, -(n)-1) #define lua_newtable(L) lua_createtable(L, 0, 0) #define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) #define lua_strlen(L,i) lua_objlen(L, (i)) #define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION) #define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE) #define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA) #define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL) #define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN) #define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD) #define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) #define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) #define lua_pushliteral(L, s) \ lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1) #define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s)) #define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s)) #define lua_tostring(L,i) lua_tolstring(L, (i), NULL) /* ** compatibility macros and functions */ #define lua_open() luaL_newstate() #define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) #define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) #define lua_Chunkreader lua_Reader #define lua_Chunkwriter lua_Writer /* hack */ LUA_API void lua_setlevel (lua_State *from, lua_State *to); /* ** {====================================================================== ** Debug API ** ======================================================================= */ /* ** Event codes */ #define LUA_HOOKCALL 0 #define LUA_HOOKRET 1 #define LUA_HOOKLINE 2 #define LUA_HOOKCOUNT 3 #define LUA_HOOKTAILRET 4 /* ** Event masks */ #define LUA_MASKCALL (1 << LUA_HOOKCALL) #define LUA_MASKRET (1 << LUA_HOOKRET) #define LUA_MASKLINE (1 << LUA_HOOKLINE) #define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) typedef struct lua_Debug lua_Debug; /* activation record */ /* Functions to be called by the debuger in specific events */ typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n); LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n); LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count); LUA_API lua_Hook lua_gethook (lua_State *L); LUA_API int lua_gethookmask (lua_State *L); LUA_API int lua_gethookcount (lua_State *L); /* From Lua 5.2. */ LUA_API void *lua_upvalueid (lua_State *L, int idx, int n); LUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2); LUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt, const char *chunkname, const char *mode); LUA_API const lua_Number *lua_version (lua_State *L); LUA_API void lua_copy (lua_State *L, int fromidx, int toidx); LUA_API lua_Number lua_tonumberx (lua_State *L, int idx, int *isnum); LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *isnum); /* From Lua 5.3. */ LUA_API int lua_isyieldable (lua_State *L); struct lua_Debug { int event; const char *name; /* (n) */ const char *namewhat; /* (n) `global', `local', `field', `method' */ const char *what; /* (S) `Lua', `C', `main', `tail' */ const char *source; /* (S) */ int currentline; /* (l) */ int nups; /* (u) number of upvalues */ int linedefined; /* (S) */ int lastlinedefined; /* (S) */ char short_src[LUA_IDSIZE]; /* (S) */ /* private part */ int i_ci; /* active function */ }; /* }====================================================================== */ /****************************************************************************** * Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ #endif chibicc-1.0.24/issues/luaconf.h000066400000000000000000000107511517770275000163140ustar00rootroot00000000000000/* ** Configuration header. ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h */ #ifndef luaconf_h #define luaconf_h #ifndef WINVER #define WINVER 0x0501 #endif #include #include /* Default path for loading Lua and C modules with require(). */ #if defined(_WIN32) /* ** In Windows, any exclamation mark ('!') in the path is replaced by the ** path of the directory of the executable file of the current process. */ #define LUA_LDIR "!\\lua\\" #define LUA_CDIR "!\\" #define LUA_PATH_DEFAULT \ ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" #define LUA_CPATH_DEFAULT \ ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" #else /* ** Note to distribution maintainers: do NOT patch the following lines! ** Please read ../doc/install.html#distro and pass PREFIX=/usr instead. */ #ifndef LUA_MULTILIB #define LUA_MULTILIB "lib" #endif #ifndef LUA_LMULTILIB #define LUA_LMULTILIB "lib" #endif #define LUA_LROOT "/usr/local" #define LUA_LUADIR "/lua/5.1/" #define LUA_LJDIR "/luajit-2.1/" #ifdef LUA_ROOT #define LUA_JROOT LUA_ROOT #define LUA_RLDIR LUA_ROOT "/share" LUA_LUADIR #define LUA_RCDIR LUA_ROOT "/" LUA_MULTILIB LUA_LUADIR #define LUA_RLPATH ";" LUA_RLDIR "?.lua;" LUA_RLDIR "?/init.lua" #define LUA_RCPATH ";" LUA_RCDIR "?.so" #else #define LUA_JROOT LUA_LROOT #define LUA_RLPATH #define LUA_RCPATH #endif #define LUA_JPATH ";" LUA_JROOT "/share" LUA_LJDIR "?.lua" #define LUA_LLDIR LUA_LROOT "/share" LUA_LUADIR #define LUA_LCDIR LUA_LROOT "/" LUA_LMULTILIB LUA_LUADIR #define LUA_LLPATH ";" LUA_LLDIR "?.lua;" LUA_LLDIR "?/init.lua" #define LUA_LCPATH1 ";" LUA_LCDIR "?.so" #define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so" #define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH #define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2 #endif /* Environment variable names for path overrides and initialization code. */ #define LUA_PATH "LUA_PATH" #define LUA_CPATH "LUA_CPATH" #define LUA_INIT "LUA_INIT" /* Special file system characters. */ #if defined(_WIN32) #define LUA_DIRSEP "\\" #else #define LUA_DIRSEP "/" #endif #define LUA_PATHSEP ";" #define LUA_PATH_MARK "?" #define LUA_EXECDIR "!" #define LUA_IGMARK "-" #define LUA_PATH_CONFIG \ LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" \ LUA_EXECDIR "\n" LUA_IGMARK "\n" /* Quoting in error messages. */ #define LUA_QL(x) "'" x "'" #define LUA_QS LUA_QL("%s") /* Various tunables. */ #define LUAI_MAXSTACK 65500 /* Max. # of stack slots for a thread (<64K). */ #define LUAI_MAXCSTACK 8000 /* Max. # of stack slots for a C func (<10K). */ #define LUAI_GCPAUSE 200 /* Pause GC until memory is at 200%. */ #define LUAI_GCMUL 200 /* Run GC at 200% of allocation speed. */ #define LUA_MAXCAPTURES 32 /* Max. pattern captures. */ /* Configuration for the frontend (the luajit executable). */ #if defined(luajit_c) #define LUA_PROGNAME "luajit" /* Fallback frontend name. */ #define LUA_PROMPT "> " /* Interactive prompt. */ #define LUA_PROMPT2 ">> " /* Continuation prompt. */ #define LUA_MAXINPUT 512 /* Max. input line length. */ #endif /* Note: changing the following defines breaks the Lua 5.1 ABI. */ #define LUA_INTEGER ptrdiff_t #define LUA_IDSIZE 60 /* Size of lua_Debug.short_src. */ /* ** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using ** unreasonable amounts of stack space, but still retain ABI compatibility. ** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it. */ #define LUAL_BUFFERSIZE (BUFSIZ > 16384 ? 8192 : BUFSIZ) /* The following defines are here only for compatibility with luaconf.h ** from the standard Lua distribution. They must not be changed for LuaJIT. */ #define LUA_NUMBER_DOUBLE #define LUA_NUMBER double #define LUAI_UACNUMBER double #define LUA_NUMBER_SCAN "%lf" #define LUA_NUMBER_FMT "%.14g" #define lua_number2str(s, n) sprintf((s), LUA_NUMBER_FMT, (n)) #define LUAI_MAXNUMBER2STR 32 #define LUA_INTFRMLEN "l" #define LUA_INTFRM_T long /* Linkage of public API functions. */ #if defined(LUA_BUILD_AS_DLL) #if defined(LUA_CORE) || defined(LUA_LIB) #define LUA_API __declspec(dllexport) #else #define LUA_API __declspec(dllimport) #endif #else #define LUA_API extern #endif #define LUALIB_API LUA_API /* Compatibility support for assertions. */ #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) #include #endif #ifdef LUA_USE_ASSERT #define lua_assert(x) assert(x) #endif #ifdef LUA_USE_APICHECK #define luai_apicheck(L, o) { (void)L; assert(o); } #else #define luai_apicheck(L, o) { (void)L; } #endif #endif chibicc-1.0.24/issues/macro2.c000066400000000000000000000031331517770275000160370ustar00rootroot00000000000000#include "test.h" #ifndef __has_include #error #endif #if !__has_include("test.h") #error #endif #if !__has_include() #error #endif #define A B #define B C(test.h) #define C(x) STR(x) #define STR(x) #x #if !__has_include(A) #error #endif #define HASH(x) #x #define STR(x) HASH(x) #define STR_STUFF(X,...) #__VA_OPT__(X X ## X __VA_ARGS__ X ## ## X X) int main(void) { #define H(x) #x #define STR(x) H(x) #define M1(X) H(X) H(X) ASSERT(0, strcmp("00", M1(__COUNTER__)) ); #define M2(A,B,...) H(__VA_OPT__(A##B)) ASSERT(0, strcmp("XY", M2(X,Y,z)) ); #define M3(A,B,...) #__VA_OPT__(A##B) ASSERT(0, strcmp("XY", M3(X,Y,z)) ); #define EXPAND_PASTE(x,y) x + x##y #define i 5 ASSERT(107, ({ int i3=100; EXPAND_PASTE(1+i,3); })); #undef i #define M4(A,...) H((A,##__VA_ARGS__)) ASSERT(0, strcmp("(X,)", M4(X,) )); #define M5(x,...) b ## __VA_OPT__(x) ASSERT(0, strcmp("bbz", STR(M5(M5(z,a),b)) )); #define hash_hash # ## # #define mkstr(a) # a #define in_between(a) mkstr(a) #define join(c, d) in_between(c hash_hash d) ASSERT(0, strcmp("x ## y", join(x,y) )); #define M6(x,y,z) x ## ## y ## ## z ASSERT(0, strcmp("3", STR(M(,,3)))); ASSERT(0, strcmp("3", STR_STUFF(,M(,,3)))); #define M1(X) a X ## X ## b ASSERT(0, strcmp("a b", STR(M1()))); #define M2(X, ...) __VA_OPT__(a X) ## b ASSERT(0, strcmp("a b", STR(M2(,.)))); #define M3(X, ...) a ## __VA_OPT__(X b) ASSERT(0, strcmp("a b", STR(M3(,.)))); #define M4(X, ...) __VA_OPT__(a X ## X) ## b ASSERT(0, strcmp("a b", STR(M4(,.)))); #define M5(X, ...) a ## __VA_OPT__(X ## X b) ASSERT(0, strcmp("a b", STR(M5(,.)))); printf("OK\n"); }chibicc-1.0.24/issues/macro3.c000066400000000000000000000032331517770275000160410ustar00rootroot00000000000000#include "test.h" #include // adapted from David Mazières's "Recursive macros with C++20 __VA_OPT__" // https://www.scs.stanford.edu/~dm/blog/va-opt.html int E(int x) { return x * 17; } void rescan(void) { #define E(x) x int X = 3; ASSERT(51, E(E)(X) ); // E(X) #define T() E(X) #define PRNS () ASSERT(3, E(T()) ); // X ASSERT(51, E(T PRNS) ); // E(X) #define LPRN ( #define E2(arg) arg int x_0 = E(E2)(E)(X) ; // X int x_1 = E(E2 LPRN)E)(X) ; // X int x_2 = E(E2 LPRN E))(X) ; // E(X) int x_3 = E(E2 (E))(X) ; // E(X) ASSERT(3, x_0 ); ASSERT(3, x_1 ); ASSERT(51, x_2 ); ASSERT(51, x_3 ); #define F2() F #define F() __COUNTER__ F2 PRNS() #define H(x) #x #define STR(x) H(x) ASSERT(0, strcmp("0 F2 ()()", STR(F()) )); ASSERT(0, strcmp("1 2 F2 ()()", STR(E(F())) )); ASSERT(0, strcmp("3 4 5 F2 ()()", STR(E(E(F()))) )); } int arr[4]; void write_arr(int i) { static int idx = 0; if (idx >= 4) exit(1); arr[idx++] = i; } void foreach(void) { #define EXPAND(...) EXPAND2(EXPAND2(__VA_ARGS__)) #define EXPAND2(...) EXPAND1(EXPAND1(__VA_ARGS__)) #define EXPAND1(...) __VA_ARGS__ #define FOR_EACH_AGAIN() FOR_EACH_HELPER #define FOR_EACH(macro, ...) \ __VA_OPT__(EXPAND(FOR_EACH_HELPER(macro, __VA_ARGS__))) #define FOR_EACH_HELPER(macro, a1, ...) \ macro(a1); \ __VA_OPT__(FOR_EACH_AGAIN PRNS (macro, __VA_ARGS__)) FOR_EACH(write_arr, 11, 22, 33, 44) ; ASSERT(11, arr[0] ); ASSERT(22, arr[1] ); ASSERT(33, arr[2] ); ASSERT(44, arr[3] ); } int main(void) { rescan(); foreach(); printf("OK\n"); } chibicc-1.0.24/issues/macro_1.c000066400000000000000000000001031517770275000161670ustar00rootroot00000000000000#define hash # hash include int main() { return 0; }chibicc-1.0.24/issues/macro_directive.c000066400000000000000000000006251517770275000200160ustar00rootroot00000000000000 #define G(...) G( #define M1 33 #define M2 22 #define F(x, y) x * y * x##y #define M3 11 #define M23 5 ) static int a = M1 + M2 + M3; static int b = F(M2, 3); #ifdef G #define H(x,y) y + x static int c = H( #endif M1 , #ifdef F F(M2, 3) - #endif M3 #ifdef H G(99) ) #endif ; #include "test.h" int main(void) { ASSERT(66, a); ASSERT(330, b); ASSERT(352, c); printf("OK\n"); return 0; } chibicc-1.0.24/issues/macro_has_include.c000066400000000000000000000004571517770275000203210ustar00rootroot00000000000000#ifndef __has_include #error #endif #if !__has_include("test.h") #error #endif #if !__has_include() #error #endif #define A B #define B C(test.h) #define C(x) STR(x) #define STR(x) #x #if !__has_include(A) #error #endif #include "test.h" int main(void) { printf("OK\n"); return 0; } chibicc-1.0.24/issues/macro_pmarks.c000066400000000000000000000013101517770275000173250ustar00rootroot00000000000000#include "test.h" #define HASH(x) #x #define STR(x) HASH(x) #define STR_STUFF(X,...) #__VA_OPT__(X X ## X __VA_ARGS__ X ## ## X X) int main(void) { #define M(x,y,z) x ## ## y ## ## z ASSERT(0, strcmp("3", STR(M(,,3)))); ASSERT(0, strcmp("3", STR_STUFF(,M(,,3)))); #define M1(X) a X ## X ## b ASSERT(0, strcmp("a b", STR(M1()))); #define M2(X, ...) __VA_OPT__(a X) ## b ASSERT(0, strcmp("a b", STR(M2(,.)))); #define M3(X, ...) a ## __VA_OPT__(X b) ASSERT(0, strcmp("a b", STR(M3(,.)))); #define M4(X, ...) __VA_OPT__(a X ## X) ## b ASSERT(0, strcmp("a b", STR(M4(,.)))); #define M5(X, ...) a ## __VA_OPT__(X ## X b) ASSERT(0, strcmp("a b", STR(M5(,.)))); printf("OK\n"); return 0; } chibicc-1.0.24/issues/nfa.c000066400000000000000000000002731517770275000154220ustar00rootroot00000000000000#include "test.h" static int wants_nfa = 8; static int wants_nfa = 10; #define FALSE 0 #define TRUE 1 int main () { printf("%d\n", wants_nfa); wants_nfa = FALSE; return 0; }chibicc-1.0.24/issues/paramgcc1.c000066400000000000000000000004011517770275000165050ustar00rootroot00000000000000 extern int i; int i; int foo2(char * p) __attribute__((nonnull(1))); int foo( void ) { switch (0) { case 1: __attribute__((fallthrough)); case 2: break; } return 0; }; chibicc-1.0.24/issues/sqlite_crash.c000066400000000000000000000263571517770275000173520ustar00rootroot00000000000000/* * test_chibicc_funcptr.c * * Reproducer for chibicc miscompiling SQLite's aSyscall[] dispatch. * * HYPOTHESIS * ---------- * Inside unixOpen (sqlite3.c ~47122), SQLite does NOT call vfs->xOpen * directly. It calls OS functions through a global syscall-wrapper table: * * static struct unix_syscall { * const char *zName; * sqlite3_syscall_ptr pCurrent; // <-- function pointer * sqlite3_syscall_ptr pDefault; * } aSyscall[] = { * { "open", (sqlite3_syscall_ptr)open, 0 }, * ... * }; * #define osOpen ((int(*)(const char*,int,...))aSyscall[0].pCurrent) * * So every OS call inside unixOpen is a DOUBLE DEREFERENCE: * 1. load aSyscall[N].pCurrent (pointer stored in a struct array) * 2. cast & call it * * chibicc is likely miscompiling the struct-array initializer, storing * the wrong value in pCurrent (e.g. the zName pointer instead of the * function pointer, or an off-by-one in the struct layout). * * This file reproduces that exact pattern in isolation. * * BUILD * ----- * # reference build – must PASS: * gcc -o test_chibicc_funcptr test_chibicc_funcptr.c && ./test_chibicc_funcptr * clang -o test_chibicc_funcptr test_chibicc_funcptr.c && ./test_chibicc_funcptr * * # chibicc build – expected to CRASH or print CORRUPT pointer: * chibicc -o test_chibicc_funcptr test_chibicc_funcptr.c && ./test_chibicc_funcptr */ #include #include #include #include #include #include #include #include /* ------------------------------------------------------------------ */ /* Replicate SQLite's exact aSyscall pattern */ /* ------------------------------------------------------------------ */ /* SQLite typedef for the generic slot */ typedef void (*sqlite3_syscall_ptr)(void); /* Mirror of sqlite3's unix_syscall struct (same field order) */ struct unix_syscall { const char *zName; /* offset 0 : 8 bytes (ptr) */ sqlite3_syscall_ptr pCurrent; /* offset 8 : 8 bytes (fptr) */ sqlite3_syscall_ptr pDefault; /* offset 16 : 8 bytes (fptr) */ }; /* * Declare the real syscall wrappers we will put in the table. * We use actual libc functions so a bad pointer is immediately fatal. */ static int wrap_open (const char *path, int flags, ...) { return open(path, flags, 0666); } static int wrap_close(int fd) { return close(fd); } static int wrap_stat (const char *path, struct stat *s) { return stat(path, s); } static ssize_t wrap_read (int fd, void *buf, size_t n) { return read(fd, buf, n); } static ssize_t wrap_write(int fd, const void *buf, size_t n){ return write(fd, buf, n); } static int wrap_fstat(int fd, struct stat *s) { return fstat(fd, s); } static int wrap_ftruncate(int fd, off_t len) { return ftruncate(fd, len); } static int wrap_fcntl(int fd, int cmd, ...) { return fcntl(fd, cmd); } static int wrap_unlink(const char *p) { return unlink(p); } /* * The table — THIS is what chibicc miscompiles. * * SQLite initialises it with a compound literal / designated-initialiser * style in the amalgamation. We use the simplest possible form so that * even a minimal compiler must get it right. * * Key danger: chibicc may store &zName (a char*) into pCurrent's slot * because both are pointer-sized and the struct layout confuses its * code-gen for array-of-struct initializers. */ static struct unix_syscall aSyscall[] = { /* index 0 */ { "open", (sqlite3_syscall_ptr)wrap_open, 0 }, /* index 1 */ { "close", (sqlite3_syscall_ptr)wrap_close, 0 }, /* index 2 */ { "stat", (sqlite3_syscall_ptr)wrap_stat, 0 }, /* index 3 */ { "read", (sqlite3_syscall_ptr)wrap_read, 0 }, /* index 4 */ { "write", (sqlite3_syscall_ptr)wrap_write, 0 }, /* index 5 */ { "fstat", (sqlite3_syscall_ptr)wrap_fstat, 0 }, /* index 6 */ { "ftruncate", (sqlite3_syscall_ptr)wrap_ftruncate, 0 }, /* index 7 */ { "fcntl", (sqlite3_syscall_ptr)wrap_fcntl, 0 }, /* index 8 */ { "unlink", (sqlite3_syscall_ptr)wrap_unlink, 0 }, }; #define NSYSCALL ((int)(sizeof(aSyscall)/sizeof(aSyscall[0]))) /* Convenience macros – exact pattern SQLite uses with osOpen etc. */ #define osOpen ((int(*)(const char*,int,...)) aSyscall[0].pCurrent) #define osClose ((int(*)(int)) aSyscall[1].pCurrent) #define osStat ((int(*)(const char*,struct stat*)) aSyscall[2].pCurrent) #define osRead ((ssize_t(*)(int,void*,size_t)) aSyscall[3].pCurrent) #define osWrite ((ssize_t(*)(int,const void*,size_t))aSyscall[4].pCurrent) #define osFstat ((int(*)(int,struct stat*)) aSyscall[5].pCurrent) #define osFtruncate ((int(*)(int,off_t)) aSyscall[6].pCurrent) #define osFcntl ((int(*)(int,int,...)) aSyscall[7].pCurrent) #define osUnlink ((int(*)(const char*)) aSyscall[8].pCurrent) /* ------------------------------------------------------------------ */ /* Step 1 – audit the table before calling anything */ /* ------------------------------------------------------------------ */ static int audit_table(void) { int bad = 0; /* We'll compare stored pointers against the known-good addresses. */ sqlite3_syscall_ptr expected[] = { (sqlite3_syscall_ptr)wrap_open, (sqlite3_syscall_ptr)wrap_close, (sqlite3_syscall_ptr)wrap_stat, (sqlite3_syscall_ptr)wrap_read, (sqlite3_syscall_ptr)wrap_write, (sqlite3_syscall_ptr)wrap_fstat, (sqlite3_syscall_ptr)wrap_ftruncate, (sqlite3_syscall_ptr)wrap_fcntl, (sqlite3_syscall_ptr)wrap_unlink, }; printf("\n--- aSyscall[] pointer audit ---\n"); printf("%-12s %-18s %-18s %s\n", "name", "expected", "actual pCurrent", "status"); printf("%-12s %-18s %-18s %s\n", "----", "--------", "---------------", "------"); for (int i = 0; i < NSYSCALL; i++) { uintptr_t exp = (uintptr_t)expected[i]; uintptr_t got = (uintptr_t)aSyscall[i].pCurrent; int ok = (exp == got); if (!ok) bad++; printf("%-12s %#018lx %#018lx %s\n", aSyscall[i].zName, (unsigned long)exp, (unsigned long)got, ok ? "OK" : "*** CORRUPT ***"); } return bad; } /* ------------------------------------------------------------------ */ /* Step 2 – actually call through the double-dereference */ /* (mirrors what unixOpen does at sqlite3.c:47122) */ /* ------------------------------------------------------------------ */ static int exercise_calls(void) { const char *path = "/tmp/chibicc_syscall_test.db"; char buf[16] = {0}; struct stat st; int fd, failures = 0; printf("\n--- double-dereference call exercise ---\n"); /* osStat – index 2 */ printf("[TEST] osStat(\"/tmp\") ... "); fflush(stdout); if (osStat("/tmp", &st) == 0) { printf("OK (size=%lld)\n", (long long)st.st_size); } else { printf("FAIL errno=%d\n", errno); failures++; } /* osOpen – index 0: the exact call that crashes in unixOpen */ printf("[TEST] osOpen(\"%s\") ... ", path); fflush(stdout); fd = osOpen(path, O_RDWR | O_CREAT | O_TRUNC); if (fd < 0) { printf("FAIL errno=%d\n", errno); failures++; return failures; } printf("OK (fd=%d)\n", fd); /* osWrite – index 4 */ printf("[TEST] osWrite() ... "); fflush(stdout); const char *msg = "chibicc"; ssize_t nw = osWrite(fd, msg, strlen(msg)); if (nw != (ssize_t)strlen(msg)) { printf("FAIL nw=%zd errno=%d\n", nw, errno); failures++; } else { printf("OK\n"); } /* osFstat – index 5 */ printf("[TEST] osFstat() ... "); fflush(stdout); if (osFstat(fd, &st) != 0) { printf("FAIL errno=%d\n", errno); failures++; } else { printf("OK (size=%lld)\n", (long long)st.st_size); } /* osFcntl – index 7 */ printf("[TEST] osFcntl(F_GETFL) ... "); fflush(stdout); int flags = osFcntl(fd, F_GETFL); if (flags < 0) { printf("FAIL errno=%d\n", errno); failures++; } else { printf("OK (flags=0x%x)\n", flags); } /* osFtruncate – index 6 */ printf("[TEST] osFtruncate(0) ... "); fflush(stdout); if (osFtruncate(fd, 0) != 0) { printf("FAIL errno=%d\n", errno); failures++; } else { printf("OK\n"); } /* osRead – index 3 */ printf("[TEST] osRead() ... "); fflush(stdout); lseek(fd, 0, SEEK_SET); ssize_t nr = osRead(fd, buf, sizeof(buf)-1); /* after truncate we expect 0 bytes, just check it doesn't crash */ if (nr < 0) { printf("FAIL errno=%d\n", errno); failures++; } else { printf("OK (nr=%zd)\n", nr); } /* osClose – index 1 */ printf("[TEST] osClose() ... "); fflush(stdout); if (osClose(fd) != 0) { printf("FAIL errno=%d\n", errno); failures++; } else { printf("OK\n"); } /* osUnlink – index 8 */ printf("[TEST] osUnlink() ... "); fflush(stdout); if (osUnlink(path) != 0) { printf("FAIL errno=%d\n", errno); failures++; } else { printf("OK\n"); } return failures; } /* ------------------------------------------------------------------ */ /* Step 3 – stress the SAME pointer loaded in a loop */ /* chibicc bugs sometimes only appear after N dereferences */ /* ------------------------------------------------------------------ */ static int stress_loop(void) { printf("\n--- stress: 1000x indirect calls via aSyscall[2].pCurrent ---\n"); int (*fn)(const char*, struct stat*) = (int(*)(const char*, struct stat*))aSyscall[2].pCurrent; struct stat st; int failures = 0; for (int i = 0; i < 1000; i++) { /* reload through the table each iteration, same as SQLite macros */ int (*fp)(const char*, struct stat*) = (int(*)(const char*, struct stat*))aSyscall[2].pCurrent; if (fp("/tmp", &st) != 0) { fprintf(stderr, "[FAIL] stress iteration %d\n", i); failures++; break; } } (void)fn; /* suppress unused warning */ if (!failures) printf("[PASS] 1000 iterations OK\n"); return failures; } /* ------------------------------------------------------------------ */ /* main */ /* ------------------------------------------------------------------ */ int main(void) { int total = 0; printf("=== chibicc aSyscall double-dereference reproducer ===\n"); int corrupt = audit_table(); if (corrupt) { fprintf(stderr, "\n[!!!] %d corrupt pointer(s) detected in aSyscall[].\n" " Calling through them will likely SIGSEGV — stopping here\n" " so Valgrind / AddressSanitizer can report cleanly.\n", corrupt); return EXIT_FAILURE; } total += exercise_calls(); total += stress_loop(); printf("\n=== %s (%d failure(s)) ===\n", total == 0 ? "ALL PASS" : "FAILED", total); return total ? EXIT_FAILURE : EXIT_SUCCESS; } chibicc-1.0.24/issues/tco_recursive2.c000066400000000000000000000013411517770275000176110ustar00rootroot00000000000000#include "test.h" int factorial(int n, int acc) { if (n == 0) return acc; return factorial(n - 1, acc * n); } int sum_many(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int acc) { if (a1 == 0) return acc; return sum_many(a1 - 1, a2, a3, a4, a5, a6, a7, a8, acc + a1); } int main() { printf("Test: factorial(10, 1)\n"); ASSERT(3628800, factorial(10, 1)); printf("Test: sum_many(10, 2, 3, 4, 5, 6, 7, 8, 0)\n"); ASSERT(55, sum_many(10, 2, 3, 4, 5, 6, 7, 8, 0)); // Test deep recursion to ensure TCO is working (stack overflow > 60000 ) printf("Test: deep recursion sum_many(1000000, ...)\n"); ASSERT(1784293664, sum_many(1000000, 2, 3, 4, 5, 6, 7, 8, 0)); printf("OK\n"); return 0; } chibicc-1.0.24/issues/test_cpython_o3_repro.c000066400000000000000000000050501517770275000212070ustar00rootroot00000000000000#include #include // Reproducer for CPython -O3 regressions seen in: // - test_call.TestRecursion.test_margin_is_sufficient // - test_frame_pointer_unwind / faulthandler frame walking behavior // // Usage: // gcc -O3 -std=c11 issues/test_cpython_o3_repro.c -o /tmp/repro_gcc && /tmp/repro_gcc // ./chibicc -O3 -std=c11 issues/test_cpython_o3_repro.c -o /tmp/repro_chi && /tmp/repro_chi // // Expected today: // gcc: NOT_REPRODUCED (exit 0) // chibicc: REPRODUCED (exit 1) #define CPYTHON_STACK_MARGIN 16384 __attribute__((noinline)) static uintptr_t get_stack_pointer(void) { return (uintptr_t)__builtin_frame_address(0); } __attribute__((noinline)) static uintptr_t vectorcall_like(uintptr_t (*fn)(void)) { // GCC -O3 folds these temporaries away; chibicc currently keeps them on stack. char tmp1[8192]; char tmp2[8192]; for (int i = 0; i < 8192; i++) { tmp1[i] = (char)i; tmp2[i] = (char)(i + 1); } int guard = tmp1[0] + tmp2[8191]; if (guard == 123456) puts("impossible"); return fn(); } __attribute__((noinline)) static void *toggle_frame_pointer_mode(void) { // In chibicc parse.c this currently disables omit-frame-pointer globally // for the rest of the translation unit. return __builtin_frame_address(0); } __attribute__((noinline)) static int manual_unwind_len(void) { uintptr_t *fp = (uintptr_t *)__builtin_frame_address(0); int len = 0; for (int i = 0; i < 200 && fp; i++) { uintptr_t fp_addr = (uintptr_t)fp; uintptr_t *next_fp = (uintptr_t *)fp[0]; len++; if ((uintptr_t)next_fp < 4096) break; if ((uintptr_t)next_fp <= fp_addr) break; fp = next_fp; } return len; } __attribute__((noinline)) static int build_stack(int n) { volatile int keep = n; if (n == 0) return manual_unwind_len() + keep; int r = build_stack(n - 1); return r + (keep & 0); } int main(void) { uintptr_t sp0 = get_stack_pointer(); uintptr_t sp1 = vectorcall_like(get_stack_pointer); uintptr_t delta = (sp0 > sp1) ? (sp0 - sp1) : (sp1 - sp0); double safe_margin = delta * 5.0 / 4.0; void *p = toggle_frame_pointer_mode(); if (p == (void *)1) puts("unreachable"); int unwind = build_stack(40); printf("safe_margin=%.1f (limit=%d)\n", safe_margin, CPYTHON_STACK_MARGIN); printf("manual_unwind_len=%d\n", unwind); int reproduced = 0; if (safe_margin >= CPYTHON_STACK_MARGIN) reproduced = 1; if (unwind > 10) reproduced = 1; if (reproduced) { printf("REPRODUCED\n"); return 1; } printf("NOT_REPRODUCED\n"); return 0; } chibicc-1.0.24/issues/test_margin.c000066400000000000000000000024201517770275000171660ustar00rootroot00000000000000// test_stack_margin.c // gcc -O2 -fno-omit-frame-pointer test_stack_margin.c -o test_stack_margin #include #include #include #include #define STACK_MARGIN 16384 // Mimics _testinternalcapi.get_stack_margin() #define DEPTH 100 static uintptr_t stack_addrs[DEPTH]; __attribute__((noinline)) static void recurse(int depth) { volatile char local[256]; // simulate frame growth (void)local; uintptr_t sp; __asm__ volatile("mov %%rsp, %0" : "=r"(sp)); stack_addrs[depth] = sp; if (depth + 1 < DEPTH) recurse(depth + 1); } int main(void) { recurse(0); uintptr_t min = stack_addrs[0]; uintptr_t max = stack_addrs[0]; for (int i = 1; i < DEPTH; i++) { if (stack_addrs[i] < min) min = stack_addrs[i]; if (stack_addrs[i] > max) max = stack_addrs[i]; } size_t used = max - min; size_t safe_margin = used + 1024; // CPython-style safety buffer printf("stack used = %zu bytes\n", used); printf("safe margin = %zu bytes\n", safe_margin); printf("stack margin = %d bytes\n", STACK_MARGIN); assert(safe_margin < STACK_MARGIN && "safe_margin exceeds stack_margin (CPython invariant broken)"); return 0; } chibicc-1.0.24/issues/vla_dealloc.c000066400000000000000000000055031517770275000171240ustar00rootroot00000000000000#include "test.h" #define STRINGIFY2(x) #x #define STRINGIFY(x) STRINGIFY2(x) #define ASSERTL(x, y) assert(x, y, #y " line:" STRINGIFY(__LINE__)) int main(int argc, char** argv) { void *lv1, *lv2; { int vla[argc], vla2[argc]; lv1 = vla; lv2 = vla2; } { int vla[argc], vla2[argc]; ASSERTL(1, lv1 == vla); ASSERTL(1, lv2 == vla2); } { int i = 0; goto1:; int vla1[argc]; int vla2[argc]; ASSERTL(1, lv1 == vla1); ASSERTL(1, lv2 == vla2); if (i++ != argc) goto goto1; } { int i = 0; int vla1[argc]; ASSERTL(1, lv1 == vla1); { goto2:; int vla2[argc]; ASSERTL(1, lv2 == vla2); if (i++ != argc) goto goto2; else goto goto3; } goto3:; int vla2[argc]; ASSERTL(1, lv2 == vla2); } switch(argc) { default:; { int vla1[argc]; ASSERTL(1, lv1 == vla1); } int vla1[argc]; ASSERTL(1, lv1 == vla1); { int vla2[argc]; ASSERTL(1, lv2 == vla2); } int vla2[argc]; ASSERTL(1, lv2 == vla2); break; } int swctl = 0; goto4:; switch(swctl) { case 0: { int vla1[argc]; ASSERTL(1, lv1 == vla1); } case 1: { int vla1[argc]; ASSERTL(1, lv1 == vla1); swctl++; switch (swctl) { case 1: { int vla2[argc]; ASSERTL(1, lv2 == vla2); } case 2:; int vla2[argc]; ASSERTL(1, lv2 == vla2); if(swctl == 1) goto goto4; } int vla2[argc]; ASSERTL(1, lv2 == vla2); break; } default:; swctl++; int vla1[argc]; int vla2[argc]; ASSERTL(1, lv1 == vla1); ASSERTL(1, lv2 == vla2); } if (swctl == 2) goto goto4; switch(argc) { default: { int vla1[argc]; int vla2[argc]; ASSERTL(1, lv1 == vla1); ASSERTL(1, lv2 == vla2); break; } } int w0 = 0; while (w0++ != argc+1){ int vla1[argc]; int vla2[argc]; ASSERTL(1, lv1 == vla1); ASSERTL(1, lv2 == vla2); } int d0 = 0; do { int vla1[argc]; int vla2[argc]; ASSERTL(1, lv1 == vla1); ASSERTL(1, lv2 == vla2); } while (d0++ != argc+1); int i0 = 0; for (int vla1[argc]; i0 != argc+1; i0++){ ASSERTL(1, lv1 == vla1); int vla2[argc]; ASSERTL(1, lv2 == vla2); } int i1 = 0; for (int vla1[argc];; i1++){ ASSERTL(1, lv1 == vla1); int vla2[argc]; ASSERTL(1, lv2 == vla2); if (i1 != argc+1) continue; else break; } ASSERTL(1, ({int vla1[argc]; vla1;}) == lv1); ASSERTL(1, ({int vla1[argc], vla2[argc]; vla2; }) == lv2); ASSERTL(1, ({int vla1[argc]; vla1;}) == ({int vla1[argc]; &vla1[0];}) ); int vla1[argc], vla2[argc]; ASSERTL(1, lv1 == vla1); ASSERTL(1, lv2 == vla2); printf("OK\n"); return 0; }chibicc-1.0.24/issues/vla_fail.c000066400000000000000000000003271517770275000164330ustar00rootroot00000000000000#include int main(void) { unsigned int k = sizeof("z"); union { char b[k]; } w = { .b = "z" }; assert(w.b[0] == 'z' && w.b[1] == '\0'); return 0; }chibicc-1.0.24/issues/vla_params.c000066400000000000000000000041141517770275000170010ustar00rootroot00000000000000#include "test.h" #include typedef int32_t i32; typedef uint8_t u8; void fn1(i32 z, i32 a[z], i32 b1[sizeof(a)], i32 (*b2)[sizeof(a)]){ ASSERT(8, sizeof(a)); ASSERT(8, sizeof(b1)); ASSERT(32, sizeof(*b2)); } void fn2(i32 z, i32 (*a)[z], i32 b1[sizeof(*a)], i32 (*b2)[sizeof(*a)]){ ASSERT(28, sizeof(*a)); ASSERT(8, sizeof(b1)); ASSERT(112, sizeof(*b2)); } void fn3(i32 x, i32 y, u8 arr[++y][(x+=2,x)]){ ASSERT(9, x); ASSERT(12, y); ASSERT(8, sizeof arr); ASSERT(9, sizeof *arr); } void fn4(i32 x,i32,i32 y,i32,i32,i32 z,i32 a[x+y][y+z][z+x]) { ASSERT(8, sizeof(a)); ASSERT(1008, sizeof(a[0])); ASSERT(56, sizeof(a[0][0])); } int max(i32 a, i32 b) { return a > b ? a : b; } int fn5(i32 x, i32 y, i32 (*z) [max(x, y)]) { return sizeof *z; } int g; void fn6(i32 x, i32 (*a)[g += x], i32 y, i32(*b)[sizeof(*a) + y], i32 (*c)[sizeof(*b) + g], i32 as, i32 bs, i32 cs){ ASSERT(as, sizeof(*a)); ASSERT(bs, sizeof(*b)); ASSERT(cs, sizeof(*c)); } void fn7(i32 *x, i32(*a)[*(++x)], i32(*b)[*(++x)] ) { ASSERT(88, sizeof(*a)); ASSERT(132, sizeof(*b)); } void fn8(i32 x, i32 (*a)[sizeof(u8[x])], i32 (*b)[sizeof(*a)+sizeof(u8[sizeof(*a)+sizeof(u8[x])])]) { ASSERT(468, sizeof(*b)); ASSERT(52, sizeof(*a)); } void fn9(char* str, int b, i32 (*arr)[b == strcmp(str, "FOOBAR")]) { ASSERT(4, sizeof *arr); } _Bool z = 1; void fn_oldstyle(a, b, c, d, z) float c; register uint8_t b,d; int16_t (*a)[++b][(__typeof__(b))c][d++]; { #ifdef NOTGCC ASSERT(5, b); ASSERT(9, d); #endif ASSERT(720, sizeof(*a)); ASSERT(144, sizeof((*a)[0])); ASSERT(16, sizeof((*a)[1][2])); ASSERT(2, sizeof((*a)[1][2][3])); z = c; ASSERT(5, b); ASSERT(9, d); ASSERT(777, z); } int main(void){ fn1(7,0,0,0); fn2(7,0,0,0); fn3(7,11,0); fn4(3,0,7,0,0,11,0); ASSERT(28, fn5(3, 7, 0)); ASSERT(44, fn5(11, 5, 0)); g = 13; fn6(11,0,7,0,0,96,412,1744); g = 3; fn6(11,0,7,0,0,56,252,1064); i32 arr[3] = {11,22,33}; fn7((void*)&arr, 0, 0); fn8(13, 0, 0); fn9("FOOBAR", 0, 0); double f = 777.0; fn_oldstyle(0,260,f,264); printf("OK\n"); return 0; } chibicc-1.0.24/launch.json000066400000000000000000000025721517770275000153500ustar00rootroot00000000000000{ "version": "0.2.0", "configurations": [ { "name": "Debug chibicc", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/chibicc", "args": [ "-c", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}.exe", "-g", "-xc", "test/common", "-Itest" ], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "description": "Follow child process on fork", "text": "set follow-fork-mode child", "ignoreFailures": true } ] }, { "name": "Debug produced executable", "type": "cppdbg", "request": "launch", "program": "${fileDirname}/${fileBasenameNoExtension}.exe", "args": [], "stopAtEntry": true, "cwd": "${fileDirname}", "environment": [], "externalConsole": false, "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] } chibicc-1.0.24/main.c000077500000000000000000001266771517770275000143130ustar00rootroot00000000000000#include "chibicc.h" #ifndef PREFIX #define PREFIX "/usr/local" #endif typedef enum { FILE_NONE, FILE_C, FILE_ASM, FILE_OBJ, FILE_AR, FILE_DSO, FILE_RSP, } FileType; Standard current_std = STD_GNU89; // default like GCC StringArray include_paths; bool opt_fcommon = true; bool opt_fbuiltin = true; bool opt_fpic; bool opt_fpie; bool opt_shared; bool opt_sse; bool opt_sse2; bool opt_sse3; bool opt_sse4; bool opt_mmx; bool opt_crc32; bool opt_g; bool opt_implicit; bool opt_werror; bool opt_omit_frame_pointer = false; bool opt_optimize = false; bool opt_optimize_level1 = false; bool opt_optimize_level2 = false; bool opt_optimize_level3 = false; bool opt_avx2; bool opt_avx; static FileType opt_x; static StringArray opt_include; bool opt_E; static bool opt_A; static bool opt_M; static bool opt_MD; static bool opt_MMD; static bool opt_MP; static bool opt_S; static bool opt_c; static bool opt_cc1; static bool opt_hash_hash_hash; static bool opt_static; static bool isCc1input = false; static bool isCc1output = false; static char *opt_MF; static char *opt_MT; char *opt_o; static char *opt_linker; // static char *symbolic_name; static char *r_path; static bool opt_nostdinc; static bool opt_nostdlib; static bool opt_v; static bool opt_fstack_protector; static StringArray ld_extra_args; static StringArray std_include_paths; char *base_file; static char *output_file; FILE *f; FILE *ofile; // for dot diagrams FILE *dotf; char *dot_file; bool isDotfile = false; bool isDebug = false; bool isPrintMacro = false; bool printTokens = false; char *previousfile = " "; Context *ctx; char *weak_symbols[MAX_WEAK]; int weak_count = 0; static char logFile[] = "/tmp/chibicc.log"; static StringArray input_paths; static StringArray tmpfiles; static void enable_core_dump() { struct rlimit rl; rl.rlim_cur = RLIM_INFINITY; rl.rlim_max = RLIM_INFINITY; if (setrlimit(RLIMIT_CORE, &rl) == -1) { perror("setrlimit"); exit(EXIT_FAILURE); } } static void segfault_handler(int signum) { printf("Segmentation fault (signal %d)\n", signum); abort(); // Generate a core dump } static void setup_signal_handlers() { signal(SIGSEGV, segfault_handler); } // static void print_string_array(StringArray *arr) { // for (int i = 0; i < arr->len; i++) { // printf("=====ld_extra_args[%d]: %s\n", i, arr->data[i]); // } // } static void print_include_directories() { strarray_push(&include_paths, "./include"); // Add standard include paths. strarray_push(&include_paths, PREFIX "/include/x86_64-linux-gnu/chibicc"); strarray_push(&include_paths, "/usr/include/x86_64-linux-gnu"); strarray_push(&include_paths, "/usr/local/include"); strarray_push(&include_paths, "/usr/include"); #ifdef GCC_VERSION strarray_push(&include_paths, "/usr/lib/gcc/x86_64-linux-gnu/" GCC_VERSION "/include"); #endif //strarray_push(&include_paths, "/usr/include/chibicc/include"); #if defined(__APPLE__) && defined(__MACH__) strarray_push(&include_paths, "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"); define_macro("__GNUC__", "5"); // for MacOS SDK compatibility #endif // Keep a copy of the standard include paths for -MMD option. for (int i = 0; i < include_paths.len; i++) { strarray_push(&std_include_paths, include_paths.data[i]); } printf("#include \"...\" search starts here:\n"); printf("#include <...> search starts here:\n"); for (int i = 0; i < std_include_paths.len; i++) { char *dir = std_include_paths.data[i]; printf(" %s\n", dir); } printf("End of search list.\n"); } static void usage(int status) { fprintf(stdout, HELP); fprintf(stdout, USAGE); exit(status); } // print the version of the command static void printVersion() { printf("%s version : %s\n", PRODUCT, VERSION); } // check the length and validity of parameter to avoid non valid input values static void check_parms_length(char *arg) { if (strlen(arg) > MAXLEN) { error("%s:%d: error: in check_parms_length maximum length parameter overpassed", __FILE__, __LINE__); exit(EXIT_FAILURE); } } static bool take_arg(char *arg) { char *x[] = { "-o", "-I", "-idirafter", "-include", "-x", "-MF", "-MT", "-MQ", "-Xlinker", "-cc1-input", "-cc1-output", "-fuse-ld", "-soname", "-rpath", "--version-script", "-isystem"}; for (int i = 0; i < sizeof(x) / sizeof(*x); i++) { if (!strcmp(arg, x[i])) return true; } return false; } static void add_default_include_paths(char *argv0) { if (opt_nostdinc) return; // We expect that chibicc-specific include files are installed // to ./include relative to argv[0]. strarray_push(&include_paths, format("%s/include", dirname(strdup(argv0)))); // Add standard include paths. strarray_push(&include_paths, PREFIX "/include/x86_64-linux-gnu/chibicc"); strarray_push(&include_paths, "/usr/include"); strarray_push(&include_paths, "/usr/local/include"); strarray_push(&include_paths, "/usr/include/x86_64-linux-gnu"); #ifdef GCC_VERSION strarray_push(&include_paths, "/usr/lib/gcc/x86_64-linux-gnu/" GCC_VERSION "/include"); #endif //strarray_push(&include_paths, "/usr/include/chibicc/include"); #if defined(__APPLE__) && defined(__MACH__) strarray_push(&include_paths, "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"); define_macro("__GNUC__", "5"); // for MacOS SDK compatibility #endif // Keep a copy of the standard include paths for -MMD option. for (int i = 0; i < include_paths.len; i++) { strarray_push(&std_include_paths, include_paths.data[i]); } } static void define(char *str) { char *eq = strchr(str, '='); if (eq) define_macro(strndup(str, eq - str), eq + 1); else define_macro(str, "1"); } static FileType parse_opt_x(char *s) { if (!strcmp(s, "c")) return FILE_C; if (!strcmp(s, "assembler")) return FILE_ASM; if (!strcmp(s, "assembler-with-cpp")) return FILE_ASM; if (!strcmp(s, "none")) return FILE_NONE; error("%s:%d: error: in parse_opt_x : unknown argument for -x: %s", __FILE__, __LINE__, s); } static char *quote_makefile(char *s) { char *buf = calloc(1, strlen(s) * 2 + 1); if (buf == NULL) { error("%s:%d: error: in quote_makefile buf pointer is null!", __FILE__, __LINE__); } for (int i = 0, j = 0; s[i]; i++) { switch (s[i]) { case '$': buf[j++] = '$'; buf[j++] = '$'; break; case '#': buf[j++] = '\\'; buf[j++] = '#'; break; case ' ': case '\t': for (int k = i - 1; k >= 0 && s[k] == '\\'; k--) buf[j++] = '\\'; buf[j++] = '\\'; buf[j++] = s[i]; break; default: buf[j++] = s[i]; break; } } return buf; } static void parse_args(int argc, char **argv) { // Make sure that all command line options that take an argument // have an argument. for (int i = 1; i < argc; i++) if (take_arg(argv[i])) if (!argv[++i]) { printf("parameter without value! the following parameters need to be followed by a value :\n"); printf("-o, -I, -idirafter, -include, -x, -MF, -MQ, -MT, -Xlinker, -cc1-input, -cc1-output, -fuse-ld, -soname, -rpath, --version-script, -isystem\n"); usage(1); } StringArray idirafter = {}; for (int i = 1; i < argc; i++) { if (!strcmp(argv[i], "-###")) { opt_hash_hash_hash = true; continue; } if (!strcmp(argv[i], "-cc1")) { opt_cc1 = true; continue; } if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) { usage(0); continue; } if (!strcmp(argv[i], "--version") || !strcmp(argv[i], "-v") || !strcmp(argv[i], "-V") || !strcmp(argv[i], "-version")) { printVersion(); print_include_directories(); opt_v = true; //exit(0); continue; } if (!strcmp(argv[i], "-fuse-ld")) { opt_linker = argv[++i]; check_parms_length(opt_linker); continue; } if (startsWith(argv[i], "-march=")) { continue; } if (!strcmp(argv[i], "-mno-sse")) { opt_sse = false; continue; } if (!strcmp(argv[i], "-mno-sse2")) { opt_sse2 = false; continue; } if (!strcmp(argv[i], "-mno-sse3")) { opt_sse3 = false; continue; } if (startsWith(argv[i], "-mno-sse4")) { opt_sse4 = false; continue; } if (!strcmp(argv[i], "-mno-mmx")) { opt_mmx = false; continue; } if (!strcmp(argv[i], "-msse")) { opt_sse = true; continue; } if (!strcmp(argv[i], "-msse2")) { opt_sse2 = true; continue; } if (!strcmp(argv[i], "-msse3")) { opt_sse3 = true; continue; } if (startsWith(argv[i], "-msse4")) { opt_sse4 = true; continue; } if (!strcmp(argv[i], "-mmmx")) { opt_mmx = true; continue; } if (!strcmp(argv[i], "-mcrc32")) { opt_crc32 = true; continue; } if (!strcmp(argv[i], "-mavx2")) { opt_avx2 = true; continue; } if (!strcmp(argv[i], "-mavx")) { opt_avx = true; continue; } if (startsWith(argv[i], "-flto")) { continue; } if (startsWith(argv[i], "-mtune=")) { continue; } if (!strcmp(argv[i], "-o")) { opt_o = argv[++i]; check_parms_length(opt_o); continue; } if (!strncmp(argv[i], "-o", 2)) { opt_o = argv[i] + 2; continue; } if (!strcmp(argv[i], "-S")) { opt_S = true; continue; } if (!strcmp(argv[i], "-debug")) { isDebug = true; continue; } //to print all tokens if (!strcmp(argv[i], "-print")) { printTokens = true; continue; } if (!strcmp(argv[i], "-dM")) { isPrintMacro = true; continue; } if (!strcmp(argv[i], "-dotfile")) { isDotfile = true; continue; } if (!strcmp(argv[i], "-fcommon")) { opt_fcommon = true; continue; } if (!strcmp(argv[i], "-fno-common")) { opt_fcommon = false; continue; } if (!strcmp(argv[i], "-fno-builtin")) { opt_fbuiltin = false; continue; } if (!strcmp(argv[i], "-c")) { opt_c = true; continue; } if (!strcmp(argv[i], "-E")) { opt_E = true; continue; } // sometimes we can have -I dir or -Idir if (!strncmp(argv[i], "-I", 2)) { if (strlen(argv[i]) == 2) strarray_push(&include_paths, argv[++i]); else strarray_push(&include_paths, argv[i] + 2); continue; } // seems to be used to define macros ? if (!strcmp(argv[i], "-D")) { char *tmp = argv[++i]; // define(argv[++i]); check_parms_length(tmp); define(tmp); continue; } if (!strncmp(argv[i], "-D", 2)) { char *tmp = argv[i] + 2; check_parms_length(tmp); define(tmp); // define(argv[i] + 2); continue; } if (!strcmp(argv[i], "-U")) { char *tmp = argv[++i]; check_parms_length(tmp); undef_macro(tmp); // undef_macro(argv[++i]); continue; } if (!strncmp(argv[i], "-U", 2)) { char *tmp = argv[i] + 2; check_parms_length(tmp); undef_macro(tmp); // undef_macro(argv[i] + 2); continue; } if (!strcmp(argv[i], "-include")) { char *tmp = argv[++i]; check_parms_length(tmp); strarray_push(&opt_include, tmp); // strarray_push(&opt_include, argv[++i]); continue; } if (!strcmp(argv[i], "-x")) { char *tmp = argv[++i]; check_parms_length(tmp); opt_x = parse_opt_x(tmp); continue; } if (!strncmp(argv[i], "-x", 2)) { char *tmp = argv[i] + 2; check_parms_length(tmp); opt_x = parse_opt_x(tmp); continue; } if (!strncmp(argv[i], "-l", 2)) { strarray_push(&input_paths, argv[i]); continue; } if (!strncmp(argv[i], "-Wl,", 4)) { char *opt = argv[i] + 4; if (!strncmp(opt, "-z,", 3)) { strarray_push(&input_paths, argv[i]); continue; } if (!strncmp(opt, "-U,", 3)) { char *ptr = opt + 3; while (*ptr && weak_count < MAX_WEAK) { char *comma = strchr(ptr, ','); if (comma) *comma = '\0'; weak_symbols[weak_count] = strdup(ptr); weak_count++; strarray_push(&ld_extra_args, "-U"); strarray_push(&ld_extra_args, ptr); if (!comma) break; ptr = comma + 1; } continue; } strarray_push(&input_paths, argv[i]); continue; } if (!strcmp(argv[i], "-Xlinker")) { char *tmp = argv[++i]; check_parms_length(tmp); strarray_push(&ld_extra_args, tmp); // strarray_push(&ld_extra_args, argv[++i]); continue; } // not sure why the --version-script is interpreted as -version-script ? if (!strcmp(argv[i], "-version-script") || !strcmp(argv[i], "--version-script")) { char *tmp = argv[++i]; check_parms_length(tmp); strarray_push(&ld_extra_args, "--version-script"); strarray_push(&ld_extra_args, tmp); // strarray_push(&ld_extra_args, argv[++i]); continue; } if (!strcmp(argv[i], "-x")) { char *tmp = argv[++i]; check_parms_length(tmp); strarray_push(&ld_extra_args, tmp); // strarray_push(&ld_extra_args, argv[++i]); continue; } if (!strcmp(argv[i], "-s")) { strarray_push(&ld_extra_args, "-s"); continue; } if (!strcmp(argv[i], "-M")) { opt_M = true; continue; } if (!strcmp(argv[i], "-MF")) { opt_MF = argv[++i]; check_parms_length(opt_MF); continue; } if (!strcmp(argv[i], "-MP")) { opt_MP = true; continue; } if (!strcmp(argv[i], "-MT")) { if (opt_MT == NULL) opt_MT = argv[++i]; else opt_MT = format("%s %s", opt_MT, argv[++i]); check_parms_length(opt_MT); continue; } if (!strcmp(argv[i], "-MD")) { opt_MD = true; continue; } if (!strcmp(argv[i], "-MQ")) { if (opt_MT == NULL) opt_MT = quote_makefile(argv[++i]); else opt_MT = format("%s %s", opt_MT, quote_makefile(argv[++i])); check_parms_length(opt_MT); continue; } if (!strcmp(argv[i], "-MMD")) { opt_MD = opt_MMD = true; continue; } if (!strcmp(argv[i], "-fpic") || !strcmp(argv[i], "-fPIC")) { opt_fpic = true; continue; } //trying to fix -fpie parameter =====ISS-156 forcing shared if -pie is received if (!strcmp(argv[i], "-fpie") || !strcmp(argv[i], "-fPIE") || !strcmp(argv[i], "-pie")) { opt_fpie = true; strarray_push(&ld_extra_args, "-pie"); continue; } if (!strcmp(argv[i], "-fno-pic")) { opt_fpic = false; continue; } if (!strcmp(argv[i], "-cc1-input")) { base_file = argv[++i]; check_parms_length(base_file); isCc1input = true; continue; } if (!strcmp(argv[i], "-cc1-output")) { isCc1output = true; output_file = argv[++i]; check_parms_length(output_file); continue; } if (!strcmp(argv[i], "-idirafter")) { char *tmp = argv[i++]; check_parms_length(tmp); strarray_push(&idirafter, tmp); // strarray_push(&idirafter, argv[i++]); continue; } if (!strcmp(argv[i], "-static")) { opt_static = true; strarray_push(&ld_extra_args, "-static"); continue; } if (!strcmp(argv[i], "-shared")) { opt_shared = true; //opt_fpic = true; strarray_push(&ld_extra_args, "-shared"); continue; } if (!strcmp(argv[i], "-pthread")) { strarray_push(&ld_extra_args, "-lpthread"); continue; } if (!strncmp(argv[i], "-L", 2)) { //strarray_push(&ld_extra_args, "-L"); char *tmp = argv[i]; check_parms_length(tmp); strarray_push(&ld_extra_args, tmp); continue; } if (!strcmp(argv[i], "-L")) { strarray_push(&ld_extra_args, "-L"); char *tmp = argv[++i]; check_parms_length(tmp); strarray_push(&ld_extra_args, tmp); // strarray_push(&ld_extra_args, argv[++i]); continue; } if (!strncmp(argv[i], "-L", 2)) { strarray_push(&ld_extra_args, "-L"); char *tmp = argv[i] + 2; check_parms_length(tmp); strarray_push(&ld_extra_args, tmp); // strarray_push(&ld_extra_args, argv[i] + 2); continue; } if (!strcmp(argv[i], "-hashmap-test")) { hashmap_test(); exit(0); } if (!strcmp(argv[i], "-dumpmachine")) { dump_machine(); exit(0); } if (!strcmp(argv[i], "-dumpversion")) { dump_version(); exit(0); } //-soname create a symbolic link before calling the linker like in gcc -Wl,-soname,libcurl.so.4 -o libcurl.so.4.8.0 if (!strcmp(argv[i], "-soname")) { char *tmp = argv[++i]; check_parms_length(tmp); strarray_push(&ld_extra_args, "-soname"); strarray_push(&ld_extra_args, tmp); // symbolic_name = tmp; continue; } if (!strcmp(argv[i], "Wl,-rpath,") || !strcmp(argv[i], "-rpath")) { char *tmp = argv[++i]; check_parms_length(tmp); r_path = tmp; strarray_push(&ld_extra_args, "-rpath"); strarray_push(&ld_extra_args, r_path); continue; } //for printing AST if (!strcmp(argv[i], "-A")) { opt_A = true; continue; } if (!strcmp(argv[i], "-Werror-implicit-function-declaration")) { opt_implicit = true; continue; } if (!strcmp(argv[i], "-Werror")) { opt_werror = true; continue; } //other options -Axxx ignored if (startsWith(argv[i], "-A")) { continue; } if (!strcmp(argv[i], "-rdynamic")) { strarray_push(&input_paths, "-Wl,--export-dynamic"); continue; } if (!strncmp(argv[i], "-g", 2)) { opt_omit_frame_pointer = false; if (argv[i][2] == '0') opt_g = false; else opt_g = true; continue; } if (!strcmp(argv[i], "-nostdinc")) { opt_nostdinc = true; continue; } if (!strcmp(argv[i], "-nostdlib")) { opt_nostdlib = true; continue; } if (!strcmp(argv[i], "-fomit-frame-pointer")) { opt_omit_frame_pointer = true; continue; } if (!strcmp(argv[i], "-fno-omit-frame-pointer")) { opt_omit_frame_pointer = false; continue; } if (!strcmp(argv[i], "-O0")) { opt_omit_frame_pointer = false; opt_optimize = false; continue; } if (!strcmp(argv[i], "-O")) { opt_omit_frame_pointer = true; opt_optimize = true; opt_optimize_level1 = true; continue; } if (!strcmp(argv[i], "-O1")) { opt_omit_frame_pointer = true; opt_optimize = true; opt_optimize_level1 = true; continue; } if (!strcmp(argv[i], "-O2")) { opt_omit_frame_pointer = true; opt_optimize = true; opt_optimize_level1 = true; opt_optimize_level2 = true; continue; } if (!strcmp(argv[i], "-O3")) { opt_omit_frame_pointer = true; opt_optimize = true; opt_optimize_level1 = true; opt_optimize_level2 = true; opt_optimize_level3 = true; continue; } if (!strcmp(argv[i], "-foptimize-sibling-calls")) { opt_optimize = true; opt_optimize_level2 = true; continue; } if (!strcmp(argv[i], "-fstack-protector") || !strcmp(argv[i], "-fstack-protector-strong") || !strcmp(argv[i], "-fstack-clash-protection") ) { opt_fstack_protector = true; continue; } if (!strcmp(argv[i], "-print-search-dirs")) { printf("install: %s/bin\n", LIBDIR); printf("programs: =%s/bin\n", LIBDIR); printf("libraries: =%s/lib\n", LIBDIR); exit(0); } // if (!strcmp(argv[i], "-fp-model")) { // i++; // continue; // } if (!strcmp(argv[i], "-isystem")) { char *path; if (argv[i][8] != '\0') { path = argv[i] + 8; } else { if (i+1 >= argc) error("%s:%d: error: in parse_args expected argument after -isystem", __FILE__, __LINE__); path = argv[++i]; } strarray_push(&include_paths, path); continue; } if (!strcmp(argv[i], "-Werror=invalid-command-line-argument")) { error("%s:%d: error: in parse_args : argument not accepted : -Werror=invalid-command-line-argument", __FILE__, __LINE__); } if (!strcmp(argv[i], "-Werror=unknown-warning-option")) { error("%s:%d: error: in parse_args : argument not accepted : -Werror=unknown-warning-option", __FILE__, __LINE__); } // These options are ignored for now. if (!strcmp(argv[i], "-P") || !strcmp(argv[i], "-Wall") || !strcmp(argv[i], "-Wextra") || !strcmp(argv[i], "-Wpedantic") || !strcmp(argv[i], "-Wno-switch") || !strcmp(argv[i], "-Wno-clobbered") || !strcmp(argv[i], "-Wno-unused-variable") || !strcmp(argv[i], "-Wno-unused-parameter") || !strcmp(argv[i], "-Wno-sign-compare") || !strcmp(argv[i], "-Wno-format-y2k") || !strcmp(argv[i], "-Wmissing-prototypes") || !strcmp(argv[i], "-Wno-uninitialized") || !strcmp(argv[i], "-Wmissing-declarations") || !strcmp(argv[i], "-Wredundant-decls") || !strcmp(argv[i], "-Winit-self") || !strcmp(argv[i], "-fno-math-errno") || !strcmp(argv[i], "-fno-rounding-math") || !strcmp(argv[i], "-fno-signaling-nans") || !strcmp(argv[i], "-fcx-limited-range") || !strcmp(argv[i], "-funsafe-math-optimizations") || !strcmp(argv[i], "-funroll-loops") || !strcmp(argv[i], "-ffreestanding") || !strcmp(argv[i], "-funwind-tables") || !strcmp(argv[i], "-fno-stack-protector") || !strcmp(argv[i], "-fno-strict-aliasing") || !strcmp(argv[i], "-m64") || !strcmp(argv[i], "-m32") || !strcmp(argv[i], "--whole-archive") || !strcmp(argv[i], "--no-whole-archive") || !strcmp(argv[i], "-fsigned-char") || !strcmp(argv[i], "-Bsymbolic") || !strcmp(argv[i], "-pedantic") || !strcmp(argv[i], "-pedantic-errors") || !strcmp(argv[i], "-mno-red-zone") || !strcmp(argv[i], "-fvisibility=default") || !strcmp(argv[i], "-fvisibility=hidden") || !strcmp(argv[i], "-Wsign-compare") || !strcmp(argv[i], "-Wundef") || !strcmp(argv[i], "-Wpointer-arith") || !strcmp(argv[i], "-Wvolatile-register-var") || !strcmp(argv[i], "-Wformat") || !strcmp(argv[i], "-Wformat-security") || !strcmp(argv[i], "-Wduplicated-branches") || !strcmp(argv[i], "-Wduplicated-cond") || !strcmp(argv[i], "-Wbad-function-cast") || !strcmp(argv[i], "-Wwrite-strings") || !strcmp(argv[i], "-Wlogical-op") || !strcmp(argv[i], "-Wshadow=local") || !strcmp(argv[i], "-Wmultistatement-macros") || !strcmp(argv[i], "-fdiagnostics-show-option") || !strcmp(argv[i], "-fasynchronous-unwind-tables") || !strcmp(argv[i], "-fexceptions") || !strcmp(argv[i], "-w") || !strcmp(argv[i], "--param=ssp-buffer-size=4") || !strcmp(argv[i], "-fno-lto") || !strcmp(argv[i], "-fdiagnostics-color=always") || !strcmp(argv[i], "-mfpmath=sse") || !strcmp(argv[i], "-ffunction-sections") || !strcmp(argv[i], "-fdata-sections") || !strcmp(argv[i], "-fprofile-arcs") || !strcmp(argv[i], "-ftest-coverage") || !strcmp(argv[i], "-ffat-lto-objects") || !strcmp(argv[i], "-static-libstdc++") || !strcmp(argv[i], "-static-libgcc") || !strcmp(argv[i], "-pipe") || !strcmp(argv[i], "-Wno-missing-declarations") || !strcmp(argv[i], "-mindirect-branch-register") || !strcmp(argv[i], "-fno-fast-math") || !strcmp(argv[i], "-fno-strict-overflow") || !strcmp(argv[i], "-fexcess-precision=standard") || !strcmp(argv[i], "-Wno-shadow") || !strcmp(argv[i], "-Wno-unreachable-code") || !strcmp(argv[i], "-mpku") || !strcmp(argv[i], "-mshstk") || !strcmp(argv[i], "-mlwp") || !strcmp(argv[i], "-mrtm") || !strcmp(argv[i], "-mserialize") || !strcmp(argv[i], "-mtsxldtrk") || !strcmp(argv[i], "-muintr") || !strcmp(argv[i], "-mwbnoinvd") || !strcmp(argv[i], "-mrdpid") || !strcmp(argv[i], "-mfsgsbase") || !strcmp(argv[i], "-mavx") || !strcmp(argv[i], "-m3dnow") || !strcmp(argv[i], "-flax-vector-conversions") || startswith(argv[i], "-mavx") || startswith(argv[i], "-W") ) continue; if (startsWith(argv[i], "-std")) { char *stdver = argv[i] + 5; if (!strcmp(stdver, "c99")) { current_std = STD_C99; } else if (!strcmp(stdver, "gnu99")) { current_std = STD_GNU99; } else if (!strcmp(stdver, "c89")) { current_std = STD_C89; } else if (!strcmp(stdver, "gnu89")) { current_std = STD_GNU89; } else if (!strcmp(stdver, "c11")) { current_std = STD_C11; } else if (!strcmp(stdver, "gnu11")) { current_std = STD_GNU11; } else if (!strcmp(stdver, "c17")) { current_std = STD_C17; } else if (!strcmp(stdver, "gnu17")) { current_std = STD_GNU17; } else if (!strcmp(stdver, "c23")) { current_std = STD_C23; } else if (!strcmp(stdver, "gnu23")) { current_std = STD_GNU23; } else{ error("%s:%d: error: in parse_args : unsupported -std option: %s", __FILE__, __LINE__, stdver); exit(1); } continue; } if (argv[i][0] == '-' && argv[i][1] != '\0') error("%s:%d: error: in parse_args unknown argument: %s", __FILE__, __LINE__, argv[i]); strarray_push(&input_paths, argv[i]); } for (int i = 0; i < idirafter.len; i++) strarray_push(&include_paths, idirafter.data[i]); if (input_paths.len == 0) { if (!opt_v) error("%s:%d: error: in parse_args no input files", __FILE__, __LINE__); exit(0); } // -E implies that the input is the C macro language. if (opt_E) opt_x = FILE_C; } FILE *open_file(char *path) { if (!path || strcmp(path, "-") == 0) return stdout; FILE *out = fopen(path, "w"); if (!out) error("%s:%d: error: in open_file cannot open output file: %s: %s", __FILE__, __LINE__, path, strerror(errno)); return out; } static bool endswith(char *p, char *q) { int len1 = strlen(p); int len2 = strlen(q); return (len1 >= len2) && !strcmp(p + len1 - len2, q); } // returns filename example ./test/hello.c returns hello.c char *extract_filename(char *tmpl) { char *filename = basename(strdup(tmpl)); return format("%s", filename); } char * extract_path(char* tmpl) { char* parent = calloc(1, sizeof(char) * 300); int parentLen; char* last = strrchr(tmpl, '/'); if (last != NULL) { parentLen = strlen(tmpl) - strlen(last + 1); if (parentLen > 300) error("%s:%d: error: no enough size for parent in getParent function %d expected ", __FILE__, __LINE__, parentLen); strncpy(parent, tmpl, parentLen); } return parent; } // Replace file extension char *replace_extn(char *tmpl, char *extn) { char *filename = extract_filename(tmpl); char *dot = strrchr(filename, '.'); if (dot) *dot = '\0'; return format("%s%s", filename, extn); } static void cleanup(void) { if (!isDebug) { for (int i = 0; i < tmpfiles.len; i++) unlink(tmpfiles.data[i]); } if ((isDebug && f != NULL) || (printTokens && f != NULL)) fclose(f); // for dot diagrams if (isDotfile && dotf != NULL) { fprintf(dotf, "}\n"); fclose(dotf); } } static char *create_tmpfile(void) { char *path = strdup("/tmp/chibicc-XXXXXX"); if (path == NULL) error("%s:%d: error: in create_tmpfile path path is null", __FILE__, __LINE__); int fd = mkstemp(path); if (fd == -1) error("%s:%d: error: in create_tmpfile mkstemp failed: %s", __FILE__, __LINE__, strerror(errno)); close(fd); strarray_push(&tmpfiles, path); return path; } static void run_subprocess(char **argv) { // If -### or -debug is given, dump the subprocess's command line. if (opt_hash_hash_hash) { fprintf(stdout, "%s", argv[0]); for (int i = 1; argv[i]; i++) fprintf(stdout, " %s", argv[i]); fprintf(stdout, "\n"); } if (isDebug && f != NULL) { fprintf(f, "%s", argv[0]); for (int i = 1; argv[i]; i++) fprintf(f, " %s", argv[i]); fprintf(f, "\n"); } if (fork() == 0) { execvp(argv[0], argv); fprintf(stderr, "%s:%d: error: in run_subprocess exec failed: %s: %s\n", __FILE__, __LINE__, argv[0], strerror(errno)); _exit(1); } // Wait for the child process to finish. int status; while (wait(&status) > 0) ; if (status != 0) exit(1); } static void run_cc1(int argc, char **argv, char *input, char *output) { char **args = calloc(argc + 10, sizeof(char *)); if (args == NULL) error("%s:%d: error: in run_cc1 args is null", __FILE__, __LINE__); memcpy(args, argv, argc * sizeof(char *)); args[argc++] = "-cc1"; if (input) { args[argc++] = "-cc1-input"; args[argc++] = input; } if (output) { args[argc++] = "-cc1-output"; args[argc++] = output; } run_subprocess(args); free(args); } // Print tokens to stdout. Used for -E. static void print_tokens(Token *tok) { FILE *out = open_file(opt_o ? opt_o : "-"); int line = 1; for (; tok->kind != TK_EOF; tok = tok->next) { if (line > 1 && tok->at_bol) fprintf(out, "\n"); if (tok->has_space && !tok->at_bol) fprintf(out, " "); fprintf(out, "%.*s", tok->len, tok->loc); line++; } fprintf(out, "\n"); } static bool in_std_include_path(char *path) { for (int i = 0; i < std_include_paths.len; i++) { char *dir = std_include_paths.data[i]; int len = strlen(dir); if (strncmp(dir, path, len) == 0 && path[len] == '/') return true; } return false; } // If -M options is given, the compiler write a list of input files to // stdout in a format that "make" command can read. This feature is // used to automate file dependency management. static void print_dependencies(void) { char *path; if (opt_MF) path = opt_MF; else if (opt_MD) { // fixing the issue with file.d created in the current directory if no -o parameter or in the output directory define by -o parameter path = replace_extn(opt_o ? opt_o : base_file, ".d"); if (opt_o != NULL) { char *fullpath; //char *filename; //filename = extract_filename(opt_o); fullpath = extract_path(opt_o); strncat(fullpath, path, strlen(path)); path = fullpath; } } else if (opt_o) path = opt_o; else path = "-"; FILE *out = open_file(path); if (opt_MT) fprintf(out, "%s:", opt_MT); else fprintf(out, "%s:", quote_makefile(replace_extn(base_file, ".o"))); File **files = get_input_files(); for (int i = 0; files[i]; i++) { if (opt_MMD && in_std_include_path(files[i]->name)) continue; fprintf(out, " \\\n %s", files[i]->name); } fprintf(out, "\n\n"); if (opt_MP) { for (int i = 1; files[i]; i++) { if (opt_MMD && in_std_include_path(files[i]->name)) continue; fprintf(out, "%s:\n\n", quote_makefile(files[i]->name)); } } if (out != stdout) fclose(out); } static Token *must_tokenize_file(char *path) { Token *tok = tokenize_file(path); if (!tok) error("%s:%d: error: in must_tokenize_file %s: %s", __FILE__, __LINE__, path, strerror(errno)); return tok; } static Token *append_tokens(Token *tok1, Token *tok2) { if (!tok1 || tok1->kind == TK_EOF) return tok2; Token *t = tok1; while (t->next->kind != TK_EOF) t = t->next; t->next = tok2; return tok1; } static void cc1(void) { Token *tok = NULL; // Process -include option for (int i = 0; i < opt_include.len; i++) { char *incl = opt_include.data[i]; char *path; if (file_exists(incl)) { path = incl; } else { path = search_include_paths(incl); if (!path) error("%s:%d: error: in cc1 -include: %s: %s", __FILE__, __LINE__, incl, strerror(errno)); } Token *tok2 = must_tokenize_file(path); tok = append_tokens(tok, tok2); } // Tokenize and parse. Token *tok2 = must_tokenize_file(base_file); bool isReadLine = false; tok = append_tokens(tok, tok2); tok = preprocess(tok, isReadLine); // If -M or -MD are given, print file dependencies. if (opt_M || opt_MD) { print_dependencies(); if (opt_M) return; } if (isPrintMacro) { print_all_macros(); if (ofile) fclose(ofile); return; } // If -E is given, print out preprocessed C code as a result. if (opt_E) { print_tokens(tok); return; } Obj *prog = parse(tok); if (opt_A) { print_ast(f, prog); return; } // Open a temporary output buffer. char *buf; size_t buflen; FILE *output_buf = open_memstream(&buf, &buflen); // Traverse the AST to emit assembly. codegen(prog, output_buf); fclose(output_buf); // Write the asembly text to a file. FILE *out = open_file(output_file); fwrite(buf, buflen, 1, out); fclose(out); } static void assemble(char *input, char *output) { if (endswith(input, ".S")) { char *cmd[] = {"gcc", "-c", "-masm=intel", input, "-o", output, NULL}; run_subprocess(cmd); } else { char *cmd[] = {"as", "-c", input, "-o", output, NULL}; run_subprocess(cmd); } } // static void symbolic_link(char *input, char *output) { // char *cmd[] = {"ln", "-s", "-f", output, input, NULL}; // run_subprocess(cmd); // } void dump_machine(void) { fprintf(stdout, DEFAULT_TARGET_MACHINE "\n"); } void dump_version(void) { fprintf(stdout, VERSION "\n"); } static char *find_file(char *pattern) { char *path = NULL; glob_t buf = {}; glob(pattern, 0, NULL, &buf); if (buf.gl_pathc > 0) path = strdup(buf.gl_pathv[buf.gl_pathc - 1]); globfree(&buf); return path; } // Returns true if a given file exists. bool file_exists(char *path) { struct stat st; return !stat(path, &st); } static char *find_libpath(void) { if (file_exists("/usr/lib/x86_64-linux-gnu/crti.o")) return "/usr/lib/x86_64-linux-gnu"; if (file_exists("/usr/lib64/crti.o")) return "/usr/lib64"; error("%s:%d: error: in find_libpath library path is not found", __FILE__, __LINE__); } static char *find_gcc_libpath(void) { #ifdef GCC_VERSION char *paths[] = { "/usr/lib/gcc/x86_64-linux-gnu/" GCC_VERSION "/crtbegin.o", "/usr/lib/gcc/x86_64-*/" GCC_VERSION "/crtbegin.o", "/usr/lib/gcc/x86_64-pc-linux-gnu/" GCC_VERSION "/crtbegin.o", // For Gentoo "/usr/lib/gcc/x86_64-redhat-linux/" GCC_VERSION "/crtbegin.o", // For Fedora }; #else char *paths[] = { "/usr/lib/gcc/x86_64-linux-gnu/*/crtbegin.o", "/usr/lib/gcc/x86_64-*/*/crtbegin.o", "/usr/lib/gcc/x86_64-pc-linux-gnu/*/crtbegin.o", // For Gentoo "/usr/lib/gcc/x86_64-redhat-linux/*/crtbegin.o", // For Fedora }; #endif for (int i = 0; i < sizeof(paths) / sizeof(*paths); i++) { char *path = find_file(paths[i]); if (path) return dirname(path); } error("%s:%d: error: in find_gcc_libpath gcc library path is not found", __FILE__, __LINE__); } static void run_linker(StringArray *inputs, char *output) { StringArray arr = {}; if (opt_linker != NULL) { strarray_push(&arr, opt_linker); } else { strarray_push(&arr, "ld"); } strarray_push(&arr, "-o"); strarray_push(&arr, output); strarray_push(&arr, "-m"); strarray_push(&arr, "elf_x86_64"); strarray_push(&arr, "--allow-multiple-definition"); //for some projects like POSTGRES it seems that the specific path for the project //should be defined first for (int i = 0; i < ld_extra_args.len; i++) { //printf("====%s\n", ld_extra_args.data[i]); strarray_push(&arr, ld_extra_args.data[i]); } if (opt_shared) { opt_nostdlib = false; } else if (opt_fstack_protector) { opt_nostdlib = false; } //enabling verbose mode for linker in case of debug // if (isDebug) // strarray_push(&arr, "--verbose=1"); char *libpath = find_libpath(); char *gcc_libpath = find_gcc_libpath(); if (opt_shared && !opt_fpic) strarray_push(&ld_extra_args, "-fPIC"); // Only add startup files if not using -nostdlib if (!opt_nostdlib) { if (opt_shared) { strarray_push(&arr, format("%s/crti.o", libpath)); strarray_push(&arr, format("%s/crtbeginS.o", gcc_libpath)); } //trying to fix ====ISS-156 fpie parameter else if (opt_fpie) { strarray_push(&arr, format("%s/Scrt1.o", libpath)); strarray_push(&arr, format("%s/crti.o", libpath)); strarray_push(&arr, format("%s/crtbeginS.o", gcc_libpath)); //strarray_push(&arr, format("%s/crtendS.o", gcc_libpath)); } else { strarray_push(&arr, format("%s/crt1.o", libpath)); strarray_push(&arr, format("%s/crti.o", libpath)); strarray_push(&arr, format("%s/crtbegin.o", gcc_libpath)); } } strarray_push(&arr, format("-L%s", gcc_libpath)); strarray_push(&arr, "-L/usr/lib/x86_64-linux-gnu"); strarray_push(&arr, "-L/usr/lib64"); strarray_push(&arr, "-L/lib64"); strarray_push(&arr, "-L/usr/lib/x86_64-linux-gnu"); strarray_push(&arr, "-L/lib/x86_64-linux-gnu"); strarray_push(&arr, "-L/usr/lib/x86_64-pc-linux-gnu"); strarray_push(&arr, "-L/usr/lib/x86_64-redhat-linux"); strarray_push(&arr, "-L/usr/lib"); strarray_push(&arr, "-L/lib"); strarray_push(&arr, "-L."); if (!opt_static) { strarray_push(&arr, "-dynamic-linker"); strarray_push(&arr, "/lib64/ld-linux-x86-64.so.2"); } for (int i = 0; i < inputs->len; i++) { //printf("====%s\n", inputs->data[i]); strarray_push(&arr, inputs->data[i]); } if (opt_static) { strarray_push(&arr, "--start-group"); strarray_push(&arr, "-lgcc"); strarray_push(&arr, "-lgcc_eh"); strarray_push(&arr, "-lc"); strarray_push(&arr, "--end-group"); } else { strarray_push(&arr, "-lc"); strarray_push(&arr, "-lgcc"); strarray_push(&arr, "--as-needed"); strarray_push(&arr, "-lgcc_s"); //strarray_push(&arr, "--no-as-needed"); } if (!opt_nostdlib) { strarray_push(&arr, "-lm"); } // Add the ending object file if not using -nostdlib if (!opt_nostdlib) { if (opt_shared || opt_fpie) strarray_push(&arr, format("%s/crtendS.o", gcc_libpath)); else if(!opt_fpie) strarray_push(&arr, format("%s/crtend.o", gcc_libpath)); } strarray_push(&arr, format("%s/crtn.o", libpath)); strarray_push(&arr, NULL); // if (isDebug) // print_string_array(&arr); run_subprocess(arr.data); } static FileType get_file_type(char *filename) { if (endswith(filename, ".a")) return FILE_AR; if (endswith(filename, ".so") || strstr(filename, ".so.") || endswith(filename, ".dso")) return FILE_DSO; if (endswith(filename, ".lo")) return FILE_DSO; if (endswith(filename, ".o")) return FILE_OBJ; if (endswith(filename, ".c") ) return FILE_C; if (endswith(filename, ".s") || (endswith(filename, ".S")) || endswith(filename, ".asm")) return FILE_ASM; if (endswith(filename, ".so.4")) return FILE_DSO; if (endswith(filename, ".rsp")) return FILE_RSP; if (opt_x != FILE_NONE) return opt_x; error("%s:%d: error: in get_file_type : unknown file extension: %s", __FILE__, __LINE__, filename); } int main(int argc, char **argv) { int file_count = 0; // Enable core dumps and set up signal handlers enable_core_dump(); setup_signal_handlers(); atexit(cleanup); ctx = calloc(1, sizeof(Context)); parse_args(argc, argv); // the parsing need to be done before trying to open the log file if ((isDebug && f == NULL) || (printTokens && f == NULL) || opt_A) { f = fopen(logFile, "w"); if (f == NULL) { error("%s:%d: error: in main Issue with -debug or -printparameter, file not opened!", __FILE__, __LINE__); exit(1); } } //print macro in preprocess.c if (isPrintMacro) { ofile = open_file(opt_o); } // init_macros can call tokenize functions moving here to be able to print debug values init_macros(); if (opt_cc1 && !isCc1input) { error("%s:%d: error: in main with -cc1 parameter -cc1-input is mandatory!", __FILE__, __LINE__); usage(-1); } //from @fuhsnn fix if (input_paths.len > 1 && opt_o && (opt_c || opt_S || opt_E)) if (++file_count > 1) error("%s:%d: error: in main cannot specify '-o' with '-c,' '-S' or '-E' with multiple files", __FILE__, __LINE__); StringArray ld_args = {}; for (int i = 0; i < input_paths.len; i++) { char *input = input_paths.data[i]; if (!strncmp(input, "-l", 2)) { strarray_push(&ld_args, input); continue; } if (!strncmp(input, "-Wl,", 4)) { char *s = strdup(input + 4); char *arg = strtok(s, ","); while (arg) { strarray_push(&ld_args, arg); arg = strtok(NULL, ","); } continue; } char *output; if (opt_o) output = opt_o; else if (opt_S) output = replace_extn(input, ".s"); else output = replace_extn(input, ".o"); FileType type = get_file_type(input); // Handle .o or .a if (type == FILE_OBJ || type == FILE_AR || type == FILE_DSO) { strarray_push(&ld_args, input); continue; } // Handle .s, -S, .asm if (type == FILE_ASM) { if (!opt_S) { if (opt_c) { assemble(input, output); } else { char *tmp = create_tmpfile(); assemble(input, tmp); strarray_push(&ld_args, tmp); } } continue; } if (type == FILE_RSP) { continue; } if (opt_cc1) { add_default_include_paths(argv[0]); cc1(); return 0; } assert(type == FILE_C); // Just preprocess if (opt_E || opt_M) { run_cc1(argc, argv, input, NULL); continue; } // Compile if (opt_S) { run_cc1(argc, argv, input, output); continue; } if (opt_A) { run_cc1(argc, argv, input, NULL); continue; } // Compile and assemble if (opt_c) { char *tmp = create_tmpfile(); run_cc1(argc, argv, input, tmp); assemble(tmp, output); continue; } // Compile, assemble and link char *tmp1 = create_tmpfile(); char *tmp2 = create_tmpfile(); run_cc1(argc, argv, input, tmp1); assemble(tmp1, tmp2); strarray_push(&ld_args, tmp2); continue; } if (ld_args.len > 0) { // if (symbolic_name) // symbolic_link(symbolic_name, opt_o); run_linker(&ld_args, opt_o ? opt_o : "a.out"); } //free(opt_MT); return 0; } bool startsWith(const char *restrict string, const char *restrict prefix) { while(*prefix) { if(*prefix++ != *string++) return 0; } return 1; } bool is_gnu_mode(void) { return current_std == STD_GNU89 || current_std == STD_GNU11; } chibicc-1.0.24/parse.c000066400000000000000000011164021517770275000144600ustar00rootroot00000000000000// This file contains a recursive descent parser for C. // // Most functions in this file are named after the symbols they are // supposed to read from an input token list. For example, stmt() is // responsible for reading a statement from a token list. The function // then construct an AST node representing a statement. // // Each function conceptually returns two values, an AST node and // remaining part of the input tokens. Since C doesn't support // multiple return values, the remaining tokens are returned to the // caller via a pointer argument. // // Input tokens are represented by a linked list. Unlike many recursive // descent parsers, we don't have the notion of the "input token stream". // Most parsing functions don't change the global state of the parser. // So it is very easy to lookahead arbitrary number of tokens in this // parser. #include "chibicc.h" // Scope for local variables, global variables, typedefs // or enum constants // Represents a block scope. typedef struct Scope Scope; struct Scope { Scope *next; // C has two block scopes; one is for variables/typedefs and // the other is for struct/union/enum tags. HashMap vars; HashMap tags; }; typedef struct VarAttr VarAttr; // Variable attributes such as typedef or extern. struct VarAttr { bool is_typedef; bool is_static; bool is_extern; bool is_inline; bool is_tls; int align; int min_vector_width; //from COSMOPOLITAN adding some attributes bool is_weak; bool is_ms_abi; bool is_aligned; bool is_noreturn; bool is_destructor; bool is_constructor; bool is_externally_visible; bool is_no_instrument_function; bool is_force_align_arg_pointer; bool is_no_caller_saved_registers; char *section; char *visibility; char *alias_name; //to store alias name for function when weak attribute int destructor_priority; int constructor_priority; bool is_packed; }; // For local variable initializer. typedef struct InitDesg InitDesg; struct InitDesg { InitDesg *next; int idx; Member *member; Obj *var; }; typedef struct { const char *name; int node_kind; } BuiltinEntry; static int nbFunc = 0; static Type* ArrayType[50][50]; static Token* ArrayToken[50][50]; static Token* ArrayTokenOrder[50][50]; static int ArrayTokenOrderCount[50]; static int order = 0; static bool is_old_style = false; static Type * current_type; static VarAttr * current_attr; // All local variable instances created during parsing are // accumulated to this list. static Obj *locals; static char* current_section; // Likewise, global variables are accumulated to this list. static Obj *globals; static Scope *scope = &(Scope){}; // Points to the function object the parser is currently parsing. static Obj *current_fn; // Lists of all goto statements and labels in the curent function. static Node *gotos; static Node *labels; // Current "goto" and "continue" jump targets. static char *brk_label; static char *cont_label; // Points to a node representing a switch if we are parsing // a switch statement. Otherwise, NULL. static Node *current_switch; static Obj *builtin_alloca; DebugTypedef *debug_typedefs; extern Context *ctx; static bool is_typename(Token *tok); static Type *declspec(Token **rest, Token *tok, VarAttr *attr); static Type *typename(Token **rest, Token *tok); static Type *enum_specifier(Token **rest, Token *tok); static Type *typeof_specifier(Token **rest, Token *tok); static Type *type_suffix(Token **rest, Token *tok, Type *ty); static Type *declarator(Token **rest, Token *tok, Type *ty); static Node *declaration(Token **rest, Token *tok, Type *basety, VarAttr *attr); static void array_initializer2(Token **rest, Token *tok, Initializer *init, int i); static void struct_initializer2(Token **rest, Token *tok, Initializer *init, Member *mem, bool post_desig); static void initializer2(Token **rest, Token *tok, Initializer *init); static Initializer *initializer(Token **rest, Token *tok, Type *ty, Type **new_ty); static Node *lvar_initializer(Token **rest, Token *tok, Obj *var); static void gvar_initializer(Token **rest, Token *tok, Obj *var); static Node *compound_stmt(Token **rest, Token *tok, Node **last); static Node *stmt(Token **rest, Token *tok, bool chained); static Node *expr_stmt(Token **rest, Token *tok); static Node *expr(Token **rest, Token *tok); //static int64_t eval(Node *node); static int64_t eval2(Node *node, char ***label); static int64_t eval_rval(Node *node, char ***label); static Obj *eval_lval_obj(Node *node, int64_t *offset); static Node *assign(Token **rest, Token *tok); static Node *logor(Token **rest, Token *tok); static long double eval_double(Node *node); static Node *conditional(Token **rest, Token *tok); static Node *logand(Token **rest, Token *tok); static Node * bitor (Token * *rest, Token *tok); static Node *bitxor(Token **rest, Token *tok); static Node *bitand(Token **rest, Token *tok); static Node *equality(Token **rest, Token *tok); static Node *relational(Token **rest, Token *tok); static Node *shift(Token **rest, Token *tok); static Node *add(Token **rest, Token *tok); static Node *new_add(Node *lhs, Node *rhs, Token *tok, bool is_op); static Node *new_sub(Node *lhs, Node *rhs, Token *tok, bool is_op); static Node *mul(Token **rest, Token *tok); static Node *cast(Token **rest, Token *tok); static Member *get_struct_member(Type *ty, Token *tok); static Type *struct_decl(Token **rest, Token *tok); static Type *union_decl(Token **rest, Token *tok); static Node *postfix(Token **rest, Token *tok); static Node *funcall(Token **rest, Token *tok, Node *node); static Node *unary(Token **rest, Token *tok); static Node *primary(Token **rest, Token *tok); static Node *parse_typedef(Token **rest, Token *tok, Type *basety, VarAttr *attr); static bool is_function(Token *tok); static Token *function(Token *tok, Type *basety, VarAttr *attr); static Token *global_declaration(Token *tok, Type *basety, VarAttr *attr); //static void initializer3(Token **rest, Token *tok, Initializer *init); //from COSMOPOLITAN adding attribute for variable static Node *visit_all_vla(Node *node, Token *tok); static Node *sizeof_vla_type(Type *ty, Token *tok); static Token *thing_attributes(Token *tok, void *arg); static Token *attribute_list(Token *tok, void *arg, Token *(*f)(Token *, void *)); static Token *type_attributes(Token *tok, void *arg); static Token *static_assertion(Token *tok); //managing old C style function definition static bool check_old_style(Token **rest, Token *tok); //from cosmopolitan managing builtin functions static Node *ParseAtomic2(NodeKind kind, Token *tok, Token **rest); static Node *ParseAtomic3(NodeKind kind, Token *tok, Token **rest); static Node *ParseAtomicCompareExchangeN(NodeKind kind, Token *tok, Token **rest); static Node *ParseSyncBoolCAS(NodeKind kind, Token *tok, Token **rest); //for builtin functions static Node *parse_memcpy(Token *tok, Token **rest); static Node *parse_memset(Token *tok, Token **rest); static Node *ParseBuiltin(NodeKind kind, Token *tok, Token **rest); static Node *parse_overflow(NodeKind kind, Token *tok, Token **rest); static Node *parse_huge_val(double fval, Token *tok, Token **rest); static Token * old_style_params(Token **rest, Token *tok, Type *ty); static Type *old_params(Type *ty, int nbparms); //from @fuhsnn static int64_t eval_sign_extend(Type *ty, uint64_t val); static bool is_const_var(Obj *var); static int64_t eval_rval(Node *node, char ***label); static Obj *eval_var(Node *expr, bool allow_local); static bool is_const_var(Obj *var) ; static bool is_str_tok(Token **rest, Token *tok, Token **str_tok); static Node *compound_stmt2(Token **rest, Token *tok); static int builtin_enum(Token *tok); static Node *scalar_to_vector(Node *scalar, Type *vec_ty); static void promote_scalar_to_vector(Node *node); static char *token_to_string(Token *tok); static Node *ParseAtomicFetch(NodeKind kind, Token *tok, Token **rest); static Node *ParseSyncFetch(NodeKind kind, Token *tok, Token **rest); static Node *ParseAtomicBitwise(NodeKind kind, Token *tok, Token **rest); static Node *ParseAtomicFence(NodeKind kind, Token *tok, Token **rest); static Node *ParseAtomicClear(NodeKind kind, Token *tok, Token **rest); static Token *skip_choose_expr_arg(Token *tok); static bool is_c99_or_later(void) ; Obj *find_func(char *name); static Node *new_node(NodeKind kind, Token *tok); static Node *new_unary(NodeKind kind, Node *expr, Token *tok); static Node *new_var_node(Obj *var, Token *tok); static Obj *new_gvar(char *name, Type *ty); static Obj *new_lvar(char *name, Type *ty, char *funcname); static Node *new_binary(NodeKind kind, Node *lhs, Node *rhs, Token *tok); static Node *compute_vla_size(Type *ty, Token *tok); static Node *constant_folding(int kind, Node *lhs, Node *rhs, Token *tok); static int align_down(int n, int align) { return (n / align) * align; } static void enter_scope(void) { Scope *sc = calloc(1, sizeof(Scope)); if (sc == NULL) error("%s:%d: in enter_scope : sc pointer is null!", __FILE__, __LINE__ ); sc->next = scope; scope = sc; } static void leave_scope(void) { scope = scope->next; } // Find a variable by name. VarScope *find_var(Token *tok) { for (Scope *sc = scope; sc; sc = sc->next) { VarScope *sc2 = hashmap_get2(&sc->vars, tok->loc, tok->len); if (sc2) return sc2; } return NULL; } static Type *find_tag(Token *tok) { for (Scope *sc = scope; sc; sc = sc->next) { Type *ty = hashmap_get2(&sc->tags, tok->loc, tok->len); if (ty) return ty; } return NULL; } static Node *new_node(NodeKind kind, Token *tok) { static int count = 0; Node *node = calloc(1, sizeof(Node)); if (node == NULL) error("%s:%d: error: in new_node : node is null", __FILE__, __LINE__); node->kind = kind; node->unique_number = count++; node->tok = tok; return node; } static Node *new_binary(NodeKind kind, Node *lhs, Node *rhs, Token *tok) { Node *node = new_node(kind, tok); if (isDotfile && dotf != NULL) { fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(rhs->kind), rhs->unique_number); fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(lhs->kind), lhs->unique_number); } node->lhs = lhs; node->rhs = rhs; add_type(node->rhs); if (kind == ND_ASSIGN && node->rhs->ty->kind == TY_VOID ) { error_tok(node->rhs->tok, "%s:%d: in new_binary : Cannot assign void type expression", __FILE__, __LINE__); } // TODO type check other binary expressions, e.g., ND_ADD return node; } static Node *new_unary(NodeKind kind, Node *expr, Token *tok) { Node *node = new_node(kind, tok); if (isDotfile && dotf != NULL) fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(expr->kind), expr->unique_number); node->lhs = expr; add_type(node->lhs); return node; } static Node *new_double(double fval, Token *tok) { Node *node = new_node(ND_NUM, tok); node->fval = fval; node->ty = ty_double; return node; } static Node *new_num(int64_t val, Token *tok) { Node *node = new_node(ND_NUM, tok); node->val = val; return node; } static Node *new_long(int64_t val, Token *tok) { Node *node = new_node(ND_NUM, tok); node->val = val; node->ty = ty_long; return node; } static Node *new_ulong(long val, Token *tok) { Node *node = new_node(ND_NUM, tok); node->val = val; node->ty = ty_ulong; return node; } static Node *new_boolean(bool val, Token *tok) { Node *node = new_node(ND_NUM, tok); node->val = val; node->ty = ty_bool; return node; } static Node *new_var_node(Obj *var, Token *tok) { Node *node = new_node(ND_VAR, tok); node->var = var; return node; } static Node *new_vla_ptr(Obj *var, Token *tok) { Node *node = new_node(ND_VLA_PTR, tok); node->var = var; return node; } Node *new_cast(Node *expr, Type *ty) { //fix for case when cast has __attribute__ add_type(expr); ty = unqual(ty); Node *node = calloc(1, sizeof(Node)); if (node == NULL) error("%s:%d: error: in new_cast : node is null", __FILE__, __LINE__); node->kind = ND_CAST; node->tok = expr->tok; node->lhs = expr; if (!ty) error("%s:%d: error: in new_cast : type is null", __FILE__, __LINE__); node->ty = copy_type(ty); return node; } static void apply_cv_qualifier(Node *node, Type *ty2) { add_type(node); Type *ty = node->ty; if (ty->is_const < ty2->is_const || ty->is_volatile < ty2->is_volatile) { node->ty = new_qualified_type(ty); node->ty->is_const = ty->is_const | ty2->is_const; node->ty->is_volatile = ty->is_volatile | ty2->is_volatile; } } //force cast to bool commit slimcc 2e138bb Node *to_bool(Node *expr) { return new_cast(expr, ty_bool); } static VarScope *push_scope(char *name) { VarScope *sc = calloc(1, sizeof(VarScope)); if (sc == NULL) error("%s:%d: error: in push_scope : sc is null!", __FILE__, __LINE__); hashmap_put(&scope->vars, name, sc); return sc; } static Initializer *new_initializer(Type *ty, bool is_flexible) { Initializer *init = calloc(1, sizeof(Initializer)); if (init == NULL) error("%s:%d: error: in new_initializer : init is null", __FILE__, __LINE__); init->ty = ty; if (ty->kind == TY_ARRAY) { if (is_flexible && (ty->size < 0 || ty->array_len < 0)) { init->is_flexible = true; return init; } init->children = calloc(ty->array_len, sizeof(Initializer *)); if (init->children == NULL) error("%s:%d: error: in new_initializer : init->children is null %ld %ld", __FILE__, __LINE__, ty->array_len, ty->size); for (int i = 0; i < ty->array_len; i++) init->children[i] = new_initializer(ty->base, false); return init; } if (ty->kind == TY_VECTOR) { init->children = calloc(ty->array_len, sizeof(Initializer *)); if (init->children == NULL) error("%s:%d: error: in new_initializer : init->children is null %ld %ld", __FILE__, __LINE__, ty->array_len, ty->size); for (int i = 0; i < ty->array_len; i++) init->children[i] = new_initializer(ty->base, false); return init; } if (ty->kind == TY_STRUCT || ty->kind == TY_UNION) { // Count the number of struct members. int len = 0; for (Member *mem = ty->members; mem; mem = mem->next) mem->idx = len++; init->children = calloc(len, sizeof(Initializer *)); if (init->children == NULL) error("%s:%d: error: in new_initializer : init->children is null (bis)", __FILE__, __LINE__); for (Member *mem = ty->members; mem; mem = mem->next) { if (is_flexible && ty->is_flexible && !mem->next) { Initializer *child = calloc(1, sizeof(Initializer)); if (child == NULL) error("%s:%d: error: in new_initializer : child is null", __FILE__, __LINE__); child->ty = mem->ty; child->is_flexible = true; init->children[mem->idx] = child; } else { init->children[mem->idx] = new_initializer(mem->ty, false); } } return init; } return init; } static Obj *new_var(char *name, Type *ty) { Obj *var = calloc(1, sizeof(Obj)); if (var == NULL) error("%s:%d: error: in new_var : var is null", __FILE__, __LINE__); var->name = name; var->ty = ty; var->align = ty->align; push_scope(name)->var = var; return var; } static Obj *new_lvar(char *name, Type *ty, char *funcname) { Obj *var = new_var(name, ty); var->is_local = true; var->order = order; var->ptr = "%rbp"; // default, may be overridden by codegen var->is_weak = ty->is_weak; if (!funcname && current_fn) funcname = current_fn->funcname; var->funcname = funcname; if (var->ty->kind == TY_PTR) { var->ty->is_pointer = true; var->ty->pointertype = ty->base; var->ty->size = ty->size; } var->next = locals; locals = var; return var; } static Obj *new_gvar(char *name, Type *ty) { Obj *var = new_var(name, ty); var->next = globals; var->is_static = true; var->is_definition = true; globals = var; return var; } static char *new_unique_name(void) { static int id = 0; return format(".L..%d", id++); } static Obj *new_anon_gvar(Type *ty) { return new_gvar(new_unique_name(), ty); } static Obj *new_string_literal(char *p, Type *ty) { Obj *var = new_anon_gvar(ty); var->init_data = p; return var; } static char *get_ident(Token *tok) { if (tok->kind != TK_IDENT) error_tok(tok, "%s:%d: in get_ident : expected an identifier", __FILE__, __LINE__); return strndup(tok->loc, tok->len); } static void record_debug_typedef(Token *tok, Type *ty) { DebugTypedef *entry = calloc(1, sizeof(DebugTypedef)); entry->name = get_ident(tok); entry->ty = ty; entry->next = debug_typedefs; debug_typedefs = entry; } static Type *find_typedef(Token *tok) { if (tok->kind == TK_IDENT) { VarScope *sc = find_var(tok); if (sc) { if (sc->type_def) return sc->type_def; } } return NULL; } static void push_tag_scope(Token *tok, Type *ty) { ty->tag = tok; hashmap_put2(&scope->tags, tok->loc, tok->len, ty); } // declspec = ("void" | "_Bool" | "char" | "short" | "int" | "long" | "double" // | "typedef" | "static" | "extern" | "inline" // | "_Thread_local" | "__thread" // | "signed" | "unsigned" // | struct-decl | union-decl | typedef-name // | enum-specifier | typeof-specifier // | "const" | "volatile" | "auto" | "register" | "restrict" // | "__restrict" | "__restrict__" | "_Noreturn" | )+ // The order of typenames in a type-specifier doesn't matter. For // example, `int long static` means the same as `static long int`. // That can also be written as `static long` because you can omit // `int` if `long` or `short` are specified. However, something like // `char int` is not a valid type specifier. We have to accept only a // limited combinations of the typenames. // // In this function, we count the number of occurrences of each typename // while keeping the "current" type object that the typenames up // until that point represent. When we reach a non-typename token, // we returns the current type object. static Type *declspec(Token **rest, Token *tok, VarAttr *attr) { // We use a single integer as counters for all typenames. // For example, bits 0 and 1 represents how many times we saw the // keyword "void" so far. With this, we can use a switch statement // as you can see below. enum { VOID = 1 << 0, BOOL = 1 << 2, CHAR = 1 << 4, SHORT = 1 << 6, INT = 1 << 8, LONG = 1 << 10, FLOAT = 1 << 12, DOUBLE = 1 << 14, OTHER = 1 << 16, SIGNED = 1 << 17, UNSIGNED = 1 << 18, INT128 = 1 << 19, }; Type *ty = copy_type(ty_int); int counter = 0; bool is_atomic = false; bool is_const = false; bool is_restrict = false; bool is_volatile = false; while (is_typename(tok)) { if (attr) current_attr = attr; tok = attribute_list(tok, ty, type_attributes); current_attr = NULL; //fixing =====ISS-155 __label__ out; if (equal(tok, "__label__")) { consume(&tok, tok, "__label__"); //skip the label identifier tok = tok->next; SET_CTX(ctx); tok = skip(tok, ";", ctx); } // Handle storage class specifiers. if (equal(tok, "typedef") || equal(tok, "static") || equal(tok, "extern") || equal(tok, "__inline") || equal(tok, "inline") || equal(tok, "_Thread_local") || equal(tok, "__thread")) { if (!attr) error_tok(tok, "%s:%d: in declspec : storage class specifier is not allowed in this context", __FILE__, __LINE__); if (equal(tok, "typedef")) attr->is_typedef = true; else if (equal(tok, "static")) attr->is_static = true; else if (equal(tok, "extern")) attr->is_extern = true; else if (equal(tok, "inline") || equal(tok, "__inline")) attr->is_inline = true; else if (equal(tok, "_Thread_local") || equal(tok, "__thread")) attr->is_tls = true; else error_tok(tok, "%s:%d: in declspec : unknown storage class specifier", __FILE__, __LINE__); //fixing check for typedef specifier/attribute not strict enough #142 suggested by @samkho if (attr->is_typedef && attr->is_static + attr->is_extern + attr->is_inline + attr->is_tls >= 1) error_tok(tok, "%s:%d: in declspec : typedef may not be used together with static," " extern, inline, __thread or _Thread_local", __FILE__, __LINE__); tok = tok->next; //from COSMOPOLITAN adding other GNUC attributes tok = attribute_list(tok, attr, thing_attributes); continue; } // These keywords are recognized but ignored. // fixing issue #119 _Complex if (consume(&tok, tok, "auto") || consume(&tok, tok, "register") || consume(&tok, tok, "_Complex") || consume(&tok, tok, "_Noreturn")) { tok = attribute_list(tok, attr, thing_attributes); continue; } if (consume(&tok, tok, "const")) { is_const = true; tok = attribute_list(tok, attr, thing_attributes); continue; } if (consume(&tok, tok, "volatile")) { is_volatile = true; tok = attribute_list(tok, attr, thing_attributes); continue; } if (consume(&tok, tok, "restrict") || consume(&tok, tok, "__restrict") || consume(&tok, tok, "__restrict__")) { is_restrict = true; tok = attribute_list(tok, attr, thing_attributes); continue; } if (equal(tok, "_Atomic")) { tok = tok->next; if (equal(tok, "(")) { ty = typename(&tok, tok->next); SET_CTX(ctx); tok = skip(tok, ")", ctx); } is_atomic = true; tok = attribute_list(tok, attr, thing_attributes); continue; } if (equal(tok, "_Alignas")) { if (!attr) error_tok(tok, "%s:%d: in declspec : _Alignas is not allowed in this context", __FILE__, __LINE__); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); int align; if (is_typename(tok)) align = typename(&tok, tok)->align; else align = const_expr(&tok, tok); attr->align = MAX(attr->align, align); SET_CTX(ctx); tok = skip(tok, ")", ctx); tok = attribute_list(tok, attr, thing_attributes); continue; } if (attr && attr->is_typedef) { tok = attribute_list(tok, ty, type_attributes); } else if (attr) { tok = attribute_list(tok, attr, thing_attributes); } // Handle user-defined types. Type *ty2 = find_typedef(tok); if (attr) current_attr = attr; tok = attribute_list(tok, ty2, type_attributes); current_attr = NULL; if (equal(tok, "struct") || equal(tok, "union") || equal(tok, "enum") || equal(tok, "typeof") || equal(tok, "__typeof") || ty2) { if (counter) break; if (equal(tok, "struct")) { ty = struct_decl(&tok, tok->next); } else if (equal(tok, "union")) { ty = union_decl(&tok, tok->next); } else if (equal(tok, "enum")) { ty = enum_specifier(&tok, tok->next); } else if (equal(tok, "typeof") || equal(tok, "__typeof")) { ty = typeof_specifier(&tok, tok->next); } else { ty = ty2; tok = tok->next; } counter += OTHER; tok = attribute_list(tok, attr, thing_attributes); continue; } // Handle built-in types. if (equal(tok, "void")) counter += VOID; else if (equal(tok, "_Bool")) counter += BOOL; else if (equal(tok, "char")) counter += CHAR; else if (equal(tok, "short")) counter += SHORT; else if (equal(tok, "int")) counter += INT; else if (equal(tok, "long")) counter += LONG; else if (equal(tok, "float")) counter += FLOAT; else if (equal(tok, "double")) counter += DOUBLE; else if (equal(tok, "__int128")) counter += INT128; else if (equal(tok, "signed")) counter |= SIGNED; else if (equal(tok, "unsigned")) counter |= UNSIGNED; else unreachable(); switch (counter) { case VOID: ty = copy_type(ty_void); break; case BOOL: ty = copy_type(ty_bool); break; case CHAR: case SIGNED + CHAR: ty = copy_type(ty_char); break; case UNSIGNED + CHAR: ty = copy_type(ty_uchar); break; case SHORT: case SHORT + INT: case SIGNED + SHORT: case SIGNED + SHORT + INT: ty = copy_type(ty_short); break; case UNSIGNED + SHORT: case UNSIGNED + SHORT + INT: ty = copy_type(ty_ushort); break; case INT: case SIGNED: case SIGNED + INT: ty = copy_type(ty_int); break; case INT128: case SIGNED + INT128: ty = copy_type(ty_int128); break; case UNSIGNED: case UNSIGNED + INT: ty = copy_type(ty_uint); break; case LONG: case LONG + INT: case SIGNED + LONG: case SIGNED + LONG + INT: ty = copy_type(ty_long); break; case LONG + LONG: case LONG + LONG + INT: case SIGNED + LONG + LONG: case SIGNED + LONG + LONG + INT: ty = copy_type(ty_llong); break; case UNSIGNED + LONG: case UNSIGNED + LONG + INT: ty = copy_type(ty_ulong); break; case UNSIGNED + LONG + LONG: case UNSIGNED + LONG + LONG + INT: ty = copy_type(ty_ullong); break; case UNSIGNED + INT128: ty = copy_type(ty_uint128); break; case FLOAT: ty = copy_type(ty_float); break; case DOUBLE: ty = copy_type(ty_double); break; case LONG + DOUBLE: ty = copy_type(ty_ldouble); break; default: error_tok(tok, "%s:%d: in declspec : invalid type", __FILE__, __LINE__); } tok = tok->next; tok = attribute_list(tok, attr, thing_attributes); } *rest = tok; if (!ty) error_tok(tok, "%s:%d: in declspec : ty is null!", __FILE__, __LINE__); if (is_atomic || is_const || is_volatile || is_restrict) { Type *ty3 = new_qualified_type(ty); ty3->is_atomic = is_atomic; ty3->is_const = is_const; ty3->is_volatile = is_volatile; ty3->is_restrict = is_restrict; return ty3; } return ty; } // func-params = ("void" | param ("," param)* ("," "...")?)? ")" // param = declspec declarator static Type *func_params(Token **rest, Token *tok, Type *ty) { //tok = attribute_list(tok, ty, type_attributes); if (equal(tok, "void") && equal(tok->next, ")")) { *rest = tok->next->next; return func_type(ty); } Type head = {}; Type *cur = &head; bool is_variadic = false; bool has_ellipsis = false; int nbparms = 0; // Function prototype scope: a prior parameter name is visible in // subsequent parameter declarators (e.g. int f(int n, int a[n])). enter_scope(); while (!equal(tok, ")")) { tok = attribute_list(tok, ty, type_attributes); if (cur != &head) { if (equal(tok, ";")) { SET_CTX(ctx); tok = skip(tok, ";", ctx); } //fix for Static assert declaration ISS-165/ISS-166 else if (!equal(tok, ",")) { Node *node = expr(&tok, tok); if (eval(node->lhs) == 0) { error("%s:%d: static assert error : %s", __FILE__, __LINE__, node->rhs->tok->loc); } while(!equal(tok->next, ";")) tok = tok->next; break; } else { SET_CTX(ctx); tok = skip(tok, ",", ctx); } } tok = attribute_list(tok, ty, type_attributes); if (equal(tok, "...")) { is_variadic = true; has_ellipsis = true; tok = tok->next; SET_CTX(ctx); skip(tok, ")", ctx); break; } Type *ty2 = declspec(&tok, tok, NULL); tok = attribute_list(tok, ty2, type_attributes); //Type *backup = ty2; if (is_old_style) { Token *backup = tok; // Skip leading pointer stars: `int *name` or `int **name` while (equal(tok, "*")) tok = tok->next; // Also handle pointer-declarator form: `int (*name)[N]` // In that case tok is `(`, followed by optional stars, then the ident. if (equal(tok, "(")) { tok = tok->next; while (equal(tok, "*")) tok = tok->next; } if (equal(tok, "{")) break; if (tok->kind != TK_IDENT) error_tok(tok, "%s:%d: in func_params : expected identifier old source code not managed yet", __FILE__, __LINE__); ArrayToken[nbFunc][nbparms] = tok; tok = backup; } ty2 = declarator(&tok, tok, ty2); tok = attribute_list(tok, ty2, type_attributes); if (!ty2) error_tok(tok, "%s:%d: in func_params : ty2 is null", __FILE__, __LINE__); Token *name = ty2->name; if (is_array(ty2)) { Type *orig = ty2; // save before decay Type *ty3 = pointer_to(ty2->base); ty3->is_atomic = ty2->is_atomic; ty3->is_const = ty2->is_const; ty3->is_volatile = ty2->is_volatile; ty3->is_restrict = ty2->is_restrict; ty2 = ty3; ty2->name = name; // FIX: stash the pre-decay VLA type so size emission can find vla_len if (orig->kind == TY_VLA) ty2->vla_param_ty = orig; } else if (ty2->kind == TY_FUNC) { // Likewise, a function is converted to a pointer to a function // only in the parameter context. ty2 = pointer_to(ty2); ty2->name = name; } if (is_old_style) { if (name) ArrayToken[nbFunc][nbparms] = name; ArrayType[nbFunc][nbparms] = ty2; nbparms++; } char *var_name = name ? get_ident(name) : ""; ty2->param_var = new_lvar(var_name, ty2, NULL); cur = cur->next = copy_type(ty2); } leave_scope(); if (cur == &head) is_variadic = true; ty = func_type(ty); tok = attribute_list(tok, ty, type_attributes); //the goal here is to rearrange the correct parameter order type following the parameter order for old C style //example // void test_compress(compr, comprLen, uncompr, uncomprLen) char *compr, // *uncompr; // long comprLen, uncomprLen; // the order of parameters inside parenthesis doesn't correspond to the declaration of each parameter. if (is_old_style) { ty->params = old_params(head.next, nbparms); } else ty->params = head.next; ty->is_variadic = is_variadic; if ((cur == &head && !has_ellipsis) || is_old_style) ty->is_oldstyle = true; if (is_old_style && equal(tok, "{")) *rest = tok; else *rest = tok->next; if (!ty) error_tok(tok, "%s:%d: in func_params : ty is null!", __FILE__, __LINE__); return ty; } // array-dimensions = ("static" | "restrict")* const-expr? "]" type-suffix static Type *array_dimensions(Token **rest, Token *tok, Type *ty) { while (equal(tok, "static") || equal(tok, "restrict") || equal(tok, "__restrict") || equal(tok, "__restrict__") || equal(tok, "const") || equal(tok, "volatile")) tok = tok->next; if (consume(&tok, tok, "]") || (equal(tok, "*") && tok->next && equal(tok->next, "]"))) { if (equal(tok, "*")) tok = tok->next->next; if (equal(tok, "[")) ty = array_dimensions(&tok, tok->next, ty); tok = attribute_list(tok, ty, type_attributes); *rest = tok; return array_of(ty, -1); } Node *expr = assign(&tok, tok); add_type(expr); SET_CTX(ctx); tok = skip(tok, "]", ctx); if (equal(tok, "[")) ty = array_dimensions(&tok, tok->next, ty); *rest = tok; if (ty->kind != TY_VLA && is_const_expr(expr) ) return array_of(ty, eval(expr)); return vla_of(ty, expr); } static void pointer_qualifiers(Token **rest, Token *tok, Type *ty) { for (;; tok = tok->next) { if (equal(tok, "_Atomic")) ty->is_atomic = true; else if (equal(tok, "const")) ty->is_const = true; else if (equal(tok, "volatile")) ty->is_volatile = true; else if (equal(tok, "restrict") || equal(tok, "__restrict") || equal(tok, "__restrict__")) ty->is_restrict = true; else break; } *rest = tok; } // type-suffix = "(" func-params // | "[" array-dimensions // | ε static Type *type_suffix(Token **rest, Token *tok, Type *ty) { if (equal(tok, "(")) { //in case of old style K&R we omit the parameters inside parenthesis and we parse the parameters that //follow the old c style example // void test_compress(compr, comprLen, uncompr, uncomprLen) char *compr, // *uncompr; // long comprLen, uncomprLen; if (is_old_style) { nbFunc++; tok = old_style_params(rest, tok->next, ty); *rest = tok; return func_params(rest, tok, ty); } return func_params(rest, tok->next, ty); } if (equal(tok, "[")) return array_dimensions(rest, tok->next, ty); *rest = tok; if (!ty) error_tok(tok, "%s:%d: in type_suffix : ty is null!", __FILE__, __LINE__); return ty; } // pointers = ("*" ("const" | "volatile" | "restrict" | "_Complex" )*)* static Type *pointers(Token **rest, Token *tok, Type *ty) { while (consume(&tok, tok, "*")) { ty = pointer_to(ty); for (;;) { tok = attribute_list(tok, ty, type_attributes); pointer_qualifiers(&tok, tok, ty); if (equal(tok, "_Complex")) { tok = tok->next; } else { break; } } } tok = attribute_list(tok, ty, type_attributes); *rest = tok; if (!ty) error_tok(tok, "%s:%d: in pointers : ty is null!", __FILE__, __LINE__); return ty; } // declarator = pointers ("(" ident ")" | "(" declarator ")" | ident) type-suffix static Type *declarator(Token **rest, Token *tok, Type *ty) { tok = attribute_list(tok, ty, type_attributes); ty = pointers(&tok, tok, ty); if (equal(tok, "(") && !is_typename(tok->next) && !equal(tok->next, ")")) { Token *start = tok; Type dummy = {}; declarator(&tok, start->next, &dummy); if (equal(tok, ")")) { SET_CTX(ctx); tok = skip(tok, ")", ctx); } ty = type_suffix(rest, tok, ty); if (!ty) error_tok(tok, "%s:%d: in declarator : ty is null", __FILE__, __LINE__); return declarator(&tok, start->next, ty); } tok = attribute_list(tok, ty, type_attributes); Token *name = NULL; Token *name_pos = tok; if (tok->kind == TK_IDENT) { name = tok; tok = tok->next; } ty = type_suffix(rest, tok, ty); if (!ty) error_tok(tok, "%s:%d: in declarator : ty is null", __FILE__, __LINE__); ty->name = name; ty->name_pos = name_pos; return ty; } // abstract-declarator = pointers ("(" abstract-declarator ")")? type-suffix static Type *abstract_declarator(Token **rest, Token *tok, Type *ty) { tok = attribute_list(tok, ty, type_attributes); ty = pointers(&tok, tok, ty); if (equal(tok, "(") && !is_typename(tok->next) && !equal(tok->next, ")")) { Token *start = tok; Type dummy = {}; abstract_declarator(&tok, start->next, &dummy); SET_CTX(ctx); tok = skip(tok, ")", ctx); ty = type_suffix(rest, tok, ty); if (!ty) error_tok(tok, "%s:%d: in declarator : ty is null", __FILE__, __LINE__); return abstract_declarator(&tok, start->next, ty); } tok = attribute_list(tok, ty, type_attributes); return type_suffix(rest, tok, ty); } // type-name = declspec abstract-declarator static Type *typename(Token **rest, Token *tok) { Type *ty = declspec(&tok, tok, NULL); tok = attribute_list(tok, ty, type_attributes); return abstract_declarator(rest, tok, ty); } static bool is_end(Token *tok) { return equal(tok, "}") || (equal(tok, ",") && equal(tok->next, "}")) || equal(tok, ";"); } static bool consume_end(Token **rest, Token *tok) { if (equal(tok, "}")) { *rest = tok->next; return true; } if (equal(tok, ",") && equal(tok->next, "}")) { *rest = tok->next->next; return true; } return false; } // enum-specifier = ident? "{" enum-list? "}" // | ident ("{" enum-list? "}")? // // enum-list = ident ("=" num)? ("," ident ("=" num)?)* ","? static Type *enum_specifier(Token **rest, Token *tok) { Type *ty = enum_type(); tok = attribute_list(tok, ty, type_attributes); // Read a struct tag. Token *tag = NULL; if (tok->kind == TK_IDENT) { tag = tok; tok = tok->next; } tok = attribute_list(tok, ty, type_attributes); if (tag && !equal(tok, "{")) { Type *ty2 = find_tag(tag); if (!ty2) warn_tok(tag, "%s:%d: in enum_specifier : unknown enum type", __FILE__, __LINE__); if (ty2 && ty2->kind != TY_ENUM) error_tok(tag, "%s:%d: in enum_specifier : not an enum tag", __FILE__, __LINE__); *rest = tok; if (ty2) return ty2; if (!ty) error_tok(tok, "%s:%d: in enum_specifier : ty is null!", __FILE__, __LINE__); return ty; } SET_CTX(ctx); tok = skip(tok, "{", ctx); // Read an enum-list. int i = 0; int val = 0; while (!consume_end(rest, tok)) { //tok->next = attribute_list(tok->next, ty, type_attributes); if (i++ > 0) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } char *name = get_ident(tok); tok = tok->next; tok = attribute_list(tok, ty, type_attributes); if (equal(tok, "=")) val = const_expr(&tok, tok->next); tok = attribute_list(tok, ty, type_attributes); VarScope *sc = push_scope(name); sc->enum_ty = ty; sc->enum_val = val++; } if (tag) push_tag_scope(tag, ty); if (!ty) error_tok(tok, "%s:%d: in enum_specifier : ty is null!", __FILE__, __LINE__); return ty; } // typeof-specifier = "(" (expr | typename) ")" static Type *typeof_specifier(Token **rest, Token *tok) { SET_CTX(ctx); tok = skip(tok, "(", ctx); Type *ty; if (is_typename(tok)) { ty = typename(&tok, tok); } else { Node *node = expr(&tok, tok); add_type(node); ty = node->ty; } SET_CTX(ctx); *rest = skip(tok, ")", ctx); if (!ty) error_tok(tok, "%s:%d: in typeof_specifier : ty is null!", __FILE__, __LINE__); return ty; } static Node *visit_all_vla(Node *node, Token *tok) { if (!node) return new_node(ND_NULL_EXPR, tok); Node *res = new_node(ND_NULL_EXPR, tok); switch (node->kind) { case ND_VAR: if (node->var && node->var->vla_ty) res = new_binary(ND_COMMA, res, compute_vla_size(node->var->vla_ty, tok), tok); break; case ND_STMT_EXPR: case ND_BLOCK: for (Node *n = node->body; n; n = n->next) res = new_binary(ND_COMMA, res, visit_all_vla(n, tok), tok); break; case ND_FUNCALL: res = new_binary(ND_COMMA, res, visit_all_vla(node->lhs, tok), tok); for (Node *n = node->args; n; n = n->next) res = new_binary(ND_COMMA, res, visit_all_vla(n, tok), tok); break; case ND_COND: res = new_binary(ND_COMMA, res, visit_all_vla(node->cond, tok), tok); res = new_binary(ND_COMMA, res, visit_all_vla(node->then, tok), tok); res = new_binary(ND_COMMA, res, visit_all_vla(node->els, tok), tok); break; case ND_CAST: case ND_ADDR: case ND_DEREF: case ND_MEMBER: case ND_POS: case ND_NEG: case ND_NOT: case ND_BITNOT: res = new_binary(ND_COMMA, res, visit_all_vla(node->lhs, tok), tok); break; case ND_ADD: case ND_SUB: case ND_MUL: case ND_DIV: case ND_MOD: case ND_BITAND: case ND_BITOR: case ND_BITXOR: case ND_SHL: case ND_SHR: case ND_EQ: case ND_NE: case ND_LT: case ND_LE: case ND_LOGAND: case ND_LOGOR: case ND_ASSIGN: case ND_COMMA: res = new_binary(ND_COMMA, res, visit_all_vla(node->lhs, tok), tok); res = new_binary(ND_COMMA, res, visit_all_vla(node->rhs, tok), tok); break; default: break; } return res; } // Generate code for computing a VLA size. static Node *compute_vla_size(Type *ty, Token *tok) { Node *node = new_node(ND_NULL_EXPR, tok); // Function parameters that are arrays decay to pointers; vla_param_ty // holds the original array type so we can still compute its element size. if (ty->kind == TY_PTR && ty->vla_param_ty) { if (!current_fn) return node; Node *n = compute_vla_size(ty->vla_param_ty, tok); ty->vla_size = ty->vla_param_ty->vla_size; if (!ty->vla_size) error_tok(tok, "%s:%d: compute_vla_size: vla_size null after computation", __FILE__, __LINE__); return new_binary(ND_COMMA, node, n, tok); } // If already computed for this function, only recurse into base so child // sizes are available, but do not re-emit the assignment. if (ty->vla_size) { if (!current_fn) { if (ty->base) compute_vla_size(ty->base, tok); return new_var_node(ty->vla_size, tok); } if (ty->vla_size->funcname && !strcmp(ty->vla_size->funcname, current_fn->funcname)) { if (ty->base) { Node *n = compute_vla_size(ty->base, tok); if (n->kind != ND_NULL_EXPR) return new_binary(ND_COMMA, node, n, tok); } return new_var_node(ty->vla_size, tok); } // First time we see this vla_size in the current function: register it. if (!ty->vla_size->funcname) { ty->vla_size->funcname = current_fn->funcname; ty->vla_size->next = locals; locals = ty->vla_size; } else if (strcmp(ty->vla_size->funcname, current_fn->funcname)) { // Came from a different function – reset so we reallocate below. ty->vla_size = NULL; } } // Recurse into base type first so its vla_size is set before we need it. if (ty->base) node = new_binary(ND_COMMA, node, compute_vla_size(ty->base, tok), tok); // Nothing VLA-related at this level – done. if (ty->kind != TY_VLA && !ty->has_vla) return node; // Struct/union containing VLA members: sum member sizes dynamically. if (ty->kind == TY_STRUCT || ty->kind == TY_UNION) { if (!ty->has_vla) return node; // Allocate a runtime variable to hold the struct/union size. ty->vla_size = new_lvar("", ty_ulong, NULL); ty->vla_size->vla_ty = ty; Node *sz = new_num(0, tok); for (Member *mem = ty->members; mem; mem = mem->next) { Node *member_size; if (mem->ty->kind == TY_VLA || mem->ty->has_vla) { node = new_binary(ND_COMMA, node, compute_vla_size(mem->ty, tok), tok); member_size = new_var_node(mem->ty->vla_size, tok); } else { member_size = new_num(mem->ty->size, tok); } sz = new_binary(ND_ADD, sz, member_size, tok); } Node *expr = new_binary(ND_ASSIGN, new_var_node(ty->vla_size, tok), sz, tok); return new_binary(ND_COMMA, node, expr, tok); } // TY_VLA: compute size = vla_len * base_size. // base recursion above has already set ty->base->vla_size if base is also VLA. Node *base_sz = (ty->base->kind == TY_VLA) ? new_var_node(ty->base->vla_size, tok) : new_num(ty->base->size, tok); if (!ty->vla_size) { ty->vla_size = new_lvar("", ty_ulong, NULL); ty->vla_size->vla_ty = ty; } if (ty->vla_len) node = new_binary(ND_COMMA, node, visit_all_vla(ty->vla_len, tok), tok); if (!current_fn) return new_var_node(ty->vla_size, tok); if (!ty->vla_len) error_tok(tok, "%s:%d: in compute_vla_size : vla_len is null!", __FILE__, __LINE__); Node *expr = new_binary(ND_ASSIGN, new_var_node(ty->vla_size, tok), new_binary(ND_MUL, ty->vla_len, base_sz, tok), tok); return new_binary(ND_COMMA, node, expr, tok); } // Return the sizeof expression for a VLA or struct-with-VLA type. // Returns NULL if the type is a regular (compile-time) type. static Node *sizeof_vla_type(Type *ty, Token *tok) { if ((ty->kind == TY_STRUCT || ty->kind == TY_UNION) && ty->has_vla) { if (!ty->vla_size) { Node *lhs = compute_vla_size(ty, tok); return new_binary(ND_COMMA, lhs, new_var_node(ty->vla_size, tok), tok); } return new_var_node(ty->vla_size, tok); } if (ty->kind == TY_VLA) { if (ty->vla_size) return new_var_node(ty->vla_size, tok); return compute_vla_size(ty, tok); } return NULL; // not a runtime-sized type } static void need_alloca_bottom(void) { if (!current_fn) return; if (current_fn->alloca_bottom) return; //opt_omit_frame_pointer = false; current_fn->force_frame_pointer = true; current_fn->alloca_bottom = new_lvar("__alloca_size__", pointer_to(ty_char), current_fn->name); } static Node *new_alloca(Node *sz, int align) { need_alloca_bottom(); if (!builtin_alloca) { // Fallback implementation for alloca Node *node = new_node(ND_ALLOC, sz->tok); node->ty = pointer_to(ty_void); // Adjust the type as necessary node->lhs = sz; // `sz` is the size to allocate add_type(sz); return node; } Node *node = new_unary(ND_FUNCALL, new_var_node(builtin_alloca, sz->tok), sz->tok); node->func_ty = builtin_alloca->ty; node->ty = builtin_alloca->ty->return_ty; node->args = sz; node->val = align; add_type(sz); return node; } // declaration = declspec (declarator ("=" expr)? ("," declarator ("=" expr)?)*)? ";" static Node *declaration(Token **rest, Token *tok, Type *basety, VarAttr *attr) { Node head = {}; Node *cur = &head; int i = 0; while (!equal(tok, ";")) { if (i++ > 0) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } VarAttr decl_attr = attr ? *attr : (VarAttr){}; current_attr = &decl_attr; Type *ty = declarator(&tok, tok, basety); current_attr = NULL; if (!ty) error_tok(tok, "%s:%d: in declaration : ty is null", __FILE__, __LINE__); if (ty->kind == TY_VOID) error_tok(tok, "%s:%d: in declaration : variable declared void", __FILE__, __LINE__); if (!ty->name) error_tok(ty->name_pos, "%s:%d: in declaration : variable name omitted", __FILE__, __LINE__); tok = attribute_list(tok, &decl_attr, thing_attributes); int alt_align = decl_attr.align; if (decl_attr.is_static) { // static local variable if (ty->kind == TY_VLA) error_tok(tok, "%s:%d: in declaration: variable length arrays cannot be 'static'", __FILE__, __LINE__); Obj *var = new_anon_gvar(ty); //from @fuhsnn fix Handle local static _Thread_local var->is_tls = decl_attr.is_tls; if (alt_align) var->align = alt_align; push_scope(get_ident(ty->name))->var = var; if (equal(tok, "=")) gvar_initializer(&tok, tok->next, var); continue; } // Generate code for computing a VLA size. We need to do this // even if ty is not VLA because ty may be a pointer to VLA // (e.g. int (*foo)[n][m] where n and m are variables.) cur = cur->next = new_unary(ND_EXPR_STMT, compute_vla_size(ty, tok), tok); //from COSMOPOLITAN adding other GNUC attributes tok = attribute_list(tok, &decl_attr, thing_attributes); if (ty->kind == TY_VLA) { if (equal(tok, "=")) error_tok(tok, "%s:%d: in declaration: variable-sized object may not be initialized", __FILE__, __LINE__); // Variable length arrays (VLAs) are translated to alloca() calls. // For example, `int x[n+2]` is translated to `tmp = n + 2, // x = alloca(tmp)`. Obj *var = new_lvar(get_ident(ty->name), ty, NULL); Token *tok = ty->name; tok = attribute_list(tok, ty, type_attributes); int var_align = MAX(decl_attr.align, ty->align); var->align = var_align; var->ty->align = MAX(var->ty->align, var_align); int align = MAX(16, var_align); Node *expr = new_binary(ND_ASSIGN, new_vla_ptr(var, tok), new_alloca(new_var_node(ty->vla_size, tok), align), tok); cur = cur->next = new_unary(ND_EXPR_STMT, expr, tok); continue; } Obj *var = new_lvar(get_ident(ty->name), ty, NULL); if (alt_align) { var->align = alt_align; var->ty->align = MAX(var->ty->align, alt_align); } if (equal(tok, "=")) { tok = tok->next; Node *expr; expr = lvar_initializer(&tok, tok, var); if (expr->lhs && expr->lhs->var && expr->lhs->var->name) { cur = cur->next = new_unary(ND_EXPR_STMT, expr, tok); } } //ISS-146 if (var->ty->size < 0) error_tok(ty->name, "%s:%d: in declaration : variable has incomplete type", __FILE__, __LINE__); if (var->ty->kind == TY_VOID) error_tok(ty->name, "%s:%d: in declaration : variable declared void", __FILE__, __LINE__); } Node *node = new_node(ND_BLOCK, tok); node->body = head.next; *rest = tok->next; return node; } static Token *skip_excess_element(Token *tok) { if (equal(tok, "{")) { tok = skip_excess_element(tok->next); SET_CTX(ctx); return skip(tok, "}", ctx); } assign(&tok, tok); return tok; } // string-initializer = string-literal static void string_initializer(Token **rest, Token *tok, Initializer *init) { if (init->is_flexible) *init = *new_initializer(array_of(init->ty->base, tok->ty->array_len), false); int len = MIN(init->ty->array_len, tok->ty->array_len); switch (init->ty->base->size) { case 1: { char *str = tok->str; for (int i = 0; i < len; i++) init->children[i]->expr = new_num(str[i], tok); break; } case 2: { uint16_t *str = (uint16_t *)tok->str; for (int i = 0; i < len; i++) init->children[i]->expr = new_num(str[i], tok); break; } case 4: { uint32_t *str = (uint32_t *)tok->str; for (int i = 0; i < len; i++) init->children[i]->expr = new_num(str[i], tok); break; } case 8: { // Initialize array of 64-bit integers for (int i = 0; i < len; i++) { // We need to ensure that we are accessing the string in a manner suitable for 64-bit integers. // For simplicity, let's fill the 64-bit integer with repeated characters from the string. uint64_t value = 0; for (int j = 0; j < 8 && i * 8 + j < len; j++) { value |= (uint64_t)(unsigned char) tok->str[i * 8 + j] << (j * 8); } init->children[i]->expr = new_num(value, tok); } break; case 16: { // Initialize array of 128-bit integers for (int i = 0; i < len; i++) { __int128 value = 0; for (int j = 0; j < 16 && i * 16 + j < len; j++) { value |= (__int128)(unsigned char)tok->str[i * 16 + j] << (j * 8); } init->children[i]->expr = new_num(value, tok); } } break; } default: error_tok(tok, "%s:%d: in string_initializer : array of inappropriate type initialized from string constant", __FILE__, __LINE__); // unreachable(); } *rest = tok->next; } // array-designator = "[" const-expr "]" // // C99 added the designated initializer to the language, which allows // programmers to move the "cursor" of an initializer to any element. // The syntax looks like this: // // int x[10] = { 1, 2, [5]=3, 4, 5, 6, 7 }; // // `[5]` moves the cursor to the 5th element, so the 5th element of x // is set to 3. Initialization then continues forward in order, so // 6th, 7th, 8th and 9th elements are initialized with 4, 5, 6 and 7, // respectively. Unspecified elements (in this case, 3rd and 4th // elements) are initialized with zero. // // Nesting is allowed, so the following initializer is valid: // // int x[5][10] = { [5][8]=1, 2, 3 }; // // It sets x[5][8], x[5][9] and x[6][0] to 1, 2 and 3, respectively. // // Use `.fieldname` to move the cursor for a struct initializer. E.g. // // struct { int a, b, c; } x = { .c=5 }; // // The above initializer sets x.c to 5. static void array_designator(Token **rest, Token *tok, Type *ty, int *begin, int *end) { *begin = const_expr(&tok, tok->next); if (*begin >= ty->array_len) error_tok(tok, "%s:%d: in array_designator : array designator index exceeds array bounds", __FILE__, __LINE__); if (equal(tok, "...")) { *end = const_expr(&tok, tok->next); if (*end >= ty->array_len) error_tok(tok, "%s:%d: in array designator : index exceeds array bounds", __FILE__, __LINE__); if (*end < *begin) error_tok(tok, "%s:%d: in array designator : range [%d, %d] is empty", __FILE__, __LINE__, *begin, *end); } else { *end = *begin; } SET_CTX(ctx); *rest = skip(tok, "]", ctx); } // struct-designator = "." ident static Member *struct_designator(Token **rest, Token *tok, Type *ty) { Token *start = tok; if (equal(tok, ".")) { SET_CTX(ctx); tok = skip(tok, ".", ctx); } if (tok->kind != TK_IDENT) error_tok(tok, "%s:%d: in struct_designator : expected a field designator", __FILE__, __LINE__); for (Member *mem = ty->members; mem; mem = mem->next) { // Anonymous struct member if (!mem->name) { if (mem->ty->kind == TY_STRUCT || mem->ty->kind == TY_UNION) { tok = attribute_list(tok, ty, type_attributes); if (get_struct_member(mem->ty, tok)) { *rest = start; return mem; } } continue; } // Regular struct member if (mem->name->len == tok->len && !strncmp(mem->name->loc, tok->loc, tok->len)) { *rest = tok->next; return mem; } } error_tok(tok, "%s:%d: in struct_designator : struct has no such member", __FILE__, __LINE__); } // designation = ("[" const-expr "]" | "." ident)* "="? initializer static void designation(Token **rest, Token *tok, Initializer *init) { tok = attribute_list(tok, init->ty, type_attributes); if (equal(tok, "[")) { if (init->ty->kind != TY_ARRAY) error_tok(tok, "%s:%d: in designation : array index in non-array initializer", __FILE__, __LINE__); int begin, end; array_designator(&tok, tok, init->ty, &begin, &end); Token *tok2; for (int i = begin; i <= end; i++) designation(&tok2, tok, init->children[i]); //fix from @fuhsnn Fix array initializer post-designation offset //array_initializer2(rest, tok2, init, begin + 1); array_initializer2(rest, tok2, init, end + 1); return; } if (equal(tok, ".") && init->ty->kind == TY_STRUCT) { Member *mem = struct_designator(&tok, tok, init->ty); designation(&tok, tok, init->children[mem->idx]); init->expr = NULL; struct_initializer2(rest, tok, init, mem->next, true); return; } if (equal(tok, ".") && init->ty->kind == TY_UNION) { Member *mem = struct_designator(&tok, tok, init->ty); init->mem = mem; designation(rest, tok, init->children[mem->idx]); return; } if (equal(tok, ".")) error_tok(tok, "%s:%d: in designation: field name not in struct or union initializer", __FILE__, __LINE__); if (equal(tok, "=")) { SET_CTX(ctx); tok = skip(tok, "=", ctx); } // tok = tok->next; initializer2(rest, tok, init); } // An array length can be omitted if an array has an initializer // (e.g. `int x[] = {1,2,3}`). If it's omitted, count the number // of initializer elements. static int count_array_init_elements(Token *tok, Type *ty) { bool first = true; Initializer *dummy = new_initializer(ty->base, true); int i = 0, max = 0; while (!consume_end(&tok, tok)) { if (!first) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } first = false; if (equal(tok, "[")) { i = const_expr(&tok, tok->next); if (equal(tok, "...")) i = const_expr(&tok, tok->next); SET_CTX(ctx); tok = skip(tok, "]", ctx); designation(&tok, tok, dummy); } else { initializer2(&tok, tok, dummy); } i++; max = MAX(max, i); } return max; } // array-initializer1 = "{" initializer ("," initializer)* ","? "}" static void array_initializer1(Token **rest, Token *tok, Initializer *init) { SET_CTX(ctx); tok = skip(tok, "{", ctx); // if (init->is_flexible) // { // int len = count_array_init_elements(tok, init->ty); // *init = *new_initializer(array_of(init->ty->base, len), false); // } bool first = true; if (init->is_flexible) { int len = count_array_init_elements(tok, init->ty); *init = *new_initializer(array_of(init->ty->base, len), false); } for (int i = 0; !consume_end(rest, tok); i++) { if (!first) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } first = false; if (equal(tok, "[")) { int begin, end; array_designator(&tok, tok, init->ty, &begin, &end); Token *tok2; for (int j = begin; j <= end; j++) designation(&tok2, tok, init->children[j]); tok = tok2; i = end; continue; } if (i < init->ty->array_len) initializer2(&tok, tok, init->children[i]); else tok = skip_excess_element(tok); } } // array-initializer2 = initializer ("," initializer)* static void array_initializer2(Token **rest, Token *tok, Initializer *init, int i) { if (init->is_flexible) { int len = count_array_init_elements(tok, init->ty); *init = *new_initializer(array_of(init->ty->base, len), false); } for (; i < init->ty->array_len && !is_end(tok); i++) { Token *start = tok; if (i > 0) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } if (equal(tok, "[") || equal(tok, ".")) { *rest = start; return; } initializer2(&tok, tok, init->children[i]); } *rest = tok; } // struct-initializer1 = "{" initializer ("," initializer)* ","? "}" static void struct_initializer1(Token **rest, Token *tok, Initializer *init) { SET_CTX(ctx); tok = skip(tok, "{", ctx); Member *mem = init->ty->members; bool first = true; while (!consume_end(rest, tok)) { if (!first) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } first = false; if (equal(tok, ".")) { mem = struct_designator(&tok, tok, init->ty); designation(&tok, tok, init->children[mem->idx]); mem = mem->next; continue; } if (mem) { initializer2(&tok, tok, init->children[mem->idx]); mem = mem->next; } else { tok = skip_excess_element(tok); } } } // struct-initializer2 = initializer ("," initializer)* static void struct_initializer2(Token **rest, Token *tok, Initializer *init, Member *mem, bool post_desig) { bool first = true; for (; mem && !is_end(tok); mem = mem->next) { Token *start = tok; if (!first || post_desig) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } first = false; if (equal(tok, "[") || equal(tok, ".")) { *rest = start; return; } initializer2(&tok, tok, init->children[mem->idx]); } *rest = tok; } static void union_initializer(Token **rest, Token *tok, Initializer *init) { SET_CTX(ctx); tok = skip(tok, "{", ctx); bool first = true; for (; !consume_end(rest, tok); first = false) { if (!first) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } if (equal(tok, ".")) { init->mem = struct_designator(&tok, tok, init->ty); designation(&tok, tok, init->children[init->mem->idx]); continue; } if (first && init->ty->members) { init->mem = init->ty->members; initializer2(&tok, tok, init->children[0]); } else { tok = skip_excess_element(tok); } } } static void vector_initializer1(Token **rest, Token *tok, Initializer *init) { SET_CTX(ctx); tok = skip(tok, "{", ctx); for (int i = 0; i < init->ty->array_len && !equal(tok, "}"); i++) { init->children[i] = calloc(1, sizeof(Initializer)); init->children[i]->ty = init->ty->base; initializer2(&tok, tok, init->children[i]); if (equal(tok, ",")) tok = tok->next; } SET_CTX(ctx); *rest = skip(tok, "}", ctx); } // initializer = string-initializer | array-initializer // | struct-initializer | union-initializer // | assign static void initializer2(Token **rest, Token *tok, Initializer *init) { // trying to fix issue #62 if (equal(tok, ",")) return; if (!init) error("%s:%d: error: in initializer2 : init is null %s", __FILE__, __LINE__, tok->loc); if (init->ty->kind == TY_ARRAY && is_integer(init->ty->base)) { Token *start = tok; Token *str_tok; if (equal(tok, "{") && is_str_tok(&tok, tok->next, &str_tok)) { if (consume(rest, tok, "}")) { string_initializer(&tok, str_tok, init); return; } tok = start; } if (is_str_tok(rest, tok, &str_tok)) { string_initializer(&tok, str_tok, init); return; } } if (is_vector(init->ty)) { if (equal(tok, "{")) { vector_initializer1(rest, tok, init); return; } } if (init->ty->kind == TY_ARRAY) { if (equal(tok, "{")) array_initializer1(rest, tok, init); else array_initializer2(rest, tok, init, 0); return; } if (init->ty->kind == TY_STRUCT) { if (equal(tok, "{")) { struct_initializer1(rest, tok, init); return; } // A struct can be initialized with another struct. E.g. // `struct T x = y;` where y is a variable of type `struct T`. // Handle that case first. Node *expr = assign(rest, tok); add_type(expr); if (is_compatible(expr->ty, init->ty)) { init->expr = expr; return; } if (!init->ty->members) error_tok(tok, "%s:%d: error: in initializer2 : initializer for empty aggregate requires explicit braces", __FILE__, __LINE__); struct_initializer2(rest, tok, init, init->ty->members, false); return; } if (init->ty->kind == TY_UNION) { if (equal(tok, "{")) { union_initializer(rest, tok, init); return; } Node *expr = assign(rest, tok); add_type(expr); if (is_compatible(expr->ty, init->ty)) { init->expr = expr; return; } if (!init->ty->members) error_tok(tok, "%s:%d: error: in initializer2 : initializer for empty aggregate requires explicit braces", __FILE__, __LINE__); init->mem = init->ty->members; initializer2(rest, tok, init->children[0]); return; } if (equal(tok, "{")) { // An initializer for a scalar variable can be surrounded by // braces. E.g. `int x = {3};`. Handle that case. while (!equal(tok, "}")) { initializer2(&tok, tok->next, init); } SET_CTX(ctx); *rest = skip(tok, "}", ctx); return; } init->expr = assign(rest, tok); add_type(init->expr); } static Type *copy_struct_type(Type *ty) { ty = copy_type(ty); Member head = {}; Member *cur = &head; for (Member *mem = ty->members; mem; mem = mem->next) { Member *m = calloc(1, sizeof(Member)); if (m == NULL) error("%s:%d: error: in copy_struct_type : m is null", __FILE__, __LINE__); *m = *mem; cur = cur->next = m; } ty->members = head.next; if (!ty) error("%s:%d: in copy_struct_type : ty is null!", __FILE__, __LINE__); return ty; } static Initializer *initializer(Token **rest, Token *tok, Type *ty, Type **new_ty) { Initializer *init = new_initializer(ty, true); initializer2(rest, tok, init); if ((ty->kind == TY_STRUCT || ty->kind == TY_UNION) && ty->is_flexible) { ty = copy_struct_type(ty); Member *mem = ty->members; while (mem->next) mem = mem->next; mem->ty = init->children[mem->idx]->ty; ty->size += mem->ty->size; *new_ty = ty; return init; } *new_ty = init->ty; return init; } static Node *init_desg_expr(InitDesg *desg, Token *tok) { if (desg->var) return new_var_node(desg->var, tok); if (desg->member) { Node *node = new_unary(ND_MEMBER, init_desg_expr(desg->next, tok), tok); node->member = desg->member; return node; } Node *lhs = init_desg_expr(desg->next, tok); Node *rhs = new_num(desg->idx, tok); return new_unary(ND_DEREF, new_add(lhs, rhs, tok, false), tok); } static Node *create_lvar_init(Initializer *init, Type *ty, InitDesg *desg, Token *tok) { if (ty->kind == TY_ARRAY) { Node *node = new_node(ND_NULL_EXPR, tok); for (int i = 0; i < ty->array_len; i++) { InitDesg desg2 = {desg, i}; Node *rhs = create_lvar_init(init->children[i], ty->base, &desg2, tok); node = new_binary(ND_COMMA, node, rhs, tok); } return node; } //case of vectors two kinds of initialization possible : direct like {1.0f, 2.0f...} or from expressions like function call if (is_vector(ty)) { if (init->expr) { Node *lhs = init_desg_expr(desg, tok); return new_binary(ND_ASSIGN, lhs, init->expr, tok); } Node *node = new_node(ND_NULL_EXPR, tok); for (int i = 0; i < ty->array_len; i++) { InitDesg desg2 = {desg, i}; Node *rhs = create_lvar_init(init->children[i], ty->base, &desg2, tok); node = new_binary(ND_COMMA, node, rhs, tok); } return node; } if (init->expr) { Node *lhs = init_desg_expr(desg, tok); return new_binary(ND_ASSIGN, lhs, init->expr, tok); } if (ty->kind == TY_STRUCT && !init->expr) { Node *node = new_node(ND_NULL_EXPR, tok); for (Member *mem = ty->members; mem; mem = mem->next) { InitDesg desg2 = {desg, 0, mem}; Node *rhs = create_lvar_init(init->children[mem->idx], mem->ty, &desg2, tok); node = new_binary(ND_COMMA, node, rhs, tok); } return node; } if (ty->kind == TY_UNION) { if (!init->mem) return new_node(ND_NULL_EXPR, tok); Member *mem = init->mem ? init->mem : ty->members; InitDesg desg2 = {desg, 0, mem}; return create_lvar_init(init->children[mem->idx], mem->ty, &desg2, tok); } if (!init->expr) return new_node(ND_NULL_EXPR, tok); Node *lhs = init_desg_expr(desg, tok); return new_binary(ND_ASSIGN, lhs, init->expr, tok); } // A variable definition with an initializer is a shorthand notation // for a variable definition followed by assignments. This function // generates assignment expressions for an initializer. For example, // `int x[2][2] = {{6, 7}, {8, 9}}` is converted to the following // expressions: // // x[0][0] = 6; // x[0][1] = 7; // x[1][0] = 8; // x[1][1] = 9; static Node *lvar_initializer(Token **rest, Token *tok, Obj *var) { Initializer *init = initializer(rest, tok, var->ty, &var->ty); InitDesg desg = {NULL, 0, NULL, var}; // If a partial initializer list is given, the standard requires // that unspecified elements are set to 0. Here, we simply // zero-initialize the entire memory region of a variable before // initializing it with user-supplied values. Node *lhs = new_node(ND_MEMZERO, tok); lhs->var = var; lhs->var->init = init; Node *rhs = create_lvar_init(init, var->ty, &desg, tok); return new_binary(ND_COMMA, lhs, rhs, tok); } static uint64_t read_buf(char *buf, int sz) { if (sz == 1) return *buf; if (sz == 2) return *(uint16_t *)buf; if (sz == 4) return *(uint32_t *)buf; if (sz == 8) return *(uint64_t *)buf; if (sz == 16) return *(long double *)buf; unreachable(); } static void write_buf(char *buf, uint64_t val, int sz) { if (sz == 1) *buf = val; else if (sz == 2) *(uint16_t *)buf = val; else if (sz == 4) *(uint32_t *)buf = val; else if (sz == 8) *(uint64_t *)buf = val; else if (sz == 16) *(long double *)buf = val; else unreachable(); } static Relocation * write_gvar_data(Relocation *cur, Initializer *init, Type *ty, char *buf, int offset) { if (ty->kind == TY_ARRAY) { int elem_size = ty->base->size; memset(buf + offset, 0, elem_size * ty->array_len); if (init->expr) error_tok(init->expr->tok, "%s:%d: in write_gvar_data : array initializer must be an initializer list", __FILE__, __LINE__); int sz = ty->base->size; for (int i = 0; i < ty->array_len; i++) cur = write_gvar_data(cur, init->children[i], ty->base, buf, offset + sz * i); return cur; } if (is_vector(ty)) { int sz = ty->base->size; memset(buf + offset, 0, sz * ty->array_len); for (int i = 0; i < ty->array_len; i++) cur = write_gvar_data(cur, init->children[i], ty->base, buf, offset + sz * i); return cur; } if (!init->expr) { if (ty->kind == TY_STRUCT) { // Zero the whole struct first memset(buf + offset, 0, ty->size); for (Member *mem = ty->members; mem; mem = mem->next) { if (mem->is_bitfield) { Node *expr = init->children[mem->idx]->expr; if (!expr) continue; add_type(expr); char *loc = buf + offset + mem->offset; uint64_t oldval = read_buf(loc, mem->ty->size); uint64_t newval = eval(expr); uint64_t mask = (1L << mem->bit_width) - 1; uint64_t combined = oldval | ((newval & mask) << mem->bit_offset); write_buf(loc, combined, mem->ty->size); } else { cur = write_gvar_data(cur, init->children[mem->idx], mem->ty, buf, offset + mem->offset); } } return cur; } if (ty->kind == TY_UNION) { memset(buf + offset, 0, ty->size); if (!init->mem) return cur; return write_gvar_data(cur, init->children[init->mem->idx], init->mem->ty, buf, offset); } if (!init->expr) return cur; } add_type(init->expr); // Check if the initializer is a compound literal if (is_compatible(ty, init->expr->ty)) { int sofs = 0; Obj *var = eval_var(init->expr, false); if (var && var->init_data && !var->is_weak && (is_const_var(var) || var->is_compound_lit)) { // Don't memcpy raw bytes into a pointer; use relocation path instead. bool can_copy = (ty->kind != TY_PTR && ty->kind != TY_FUNC); if (can_copy) { Relocation *srel = var->rel; while (srel && srel->offset < sofs) srel = srel->next; for (int pos = 0; pos < ty->size && (pos + sofs) < var->ty->size;) { if (srel && srel->offset == (pos + sofs)) { // Create new relocation cur = cur->next = calloc(1, sizeof(Relocation)); cur->offset = (pos + offset); cur->label = srel->label; cur->addend = srel->addend; srel = srel->next; pos += ty->base ? ty->base->size : 8; } else { // Copy initialization data from compound literal buf[(pos + offset)] = var->init_data[(pos + sofs)]; pos++; } } return cur; } } } if (ty->kind == TY_FLOAT) { *(float *)(buf + offset) = eval_double(init->expr); return cur; } if (ty->kind == TY_DOUBLE) { *(double *)(buf + offset) = eval_double(init->expr); return cur; } if (ty->kind == TY_LDOUBLE) { *(long double *)(buf + offset) = eval_double(init->expr); return cur; } char **label = NULL; uint64_t val = eval2(init->expr, &label); if (!label) { if (ty->kind == TY_BOOL) val = !!val; write_buf(buf + offset, val, ty->size); return cur; } // For pointer types, check if the label refers to a const var whose // relocation at offset `val` can be copied directly (e.g. int *p = relo.c). if (ty->kind == TY_PTR && init->expr) { int64_t src_offset = 0; Obj *src_var = NULL; Node *expr = init->expr; while (expr && expr->kind == ND_CAST) expr = expr->lhs; if (expr && expr->kind == ND_MEMBER) { // int *p = s.member — copy relocation from inside const struct Node *base = expr->lhs; while (base && base->kind == ND_CAST) base = base->lhs; if (base && base->kind == ND_VAR && !base->var->is_local) { src_var = base->var; src_offset = (int64_t)expr->member->offset; } } else if (expr && expr->kind == ND_VAR && !expr->var->is_local && expr->var->ty->kind == TY_PTR) { // int *p = q — copy relocation from const pointer variable src_var = expr->var; src_offset = 0; } if (src_var && src_var->init_data && (is_const_var(src_var) || src_var->is_compound_lit)) { for (Relocation *srel = src_var->rel; srel; srel = srel->next) { if (srel->offset == (int)src_offset) { Relocation *rel = calloc(1, sizeof(Relocation)); rel->offset = offset; rel->label = srel->label; rel->addend = srel->addend; cur->next = rel; return cur->next; } } } } Relocation *rel = calloc(1, sizeof(Relocation)); if (rel == NULL) error("%s:%d: error: in write_gvar_data : rel is null", __FILE__, __LINE__); rel->offset = offset; rel->label = label; rel->addend = val; cur->next = rel; return cur->next; } // Initializers for global variables are evaluated at compile-time and // embedded to .data section. This function serializes Initializer // objects to a flat byte array. It is a compile error if an // initializer list contains a non-constant expression. static void gvar_initializer(Token **rest, Token *tok, Obj *var) { Initializer *init = initializer(rest, tok, var->ty, &var->ty); Relocation head = {}; char *buf = calloc(1, var->ty->size); if (buf == NULL) error("%s:%d: error: in gvar_initializer : buf is null!", __FILE__, __LINE__); write_gvar_data(&head, init, var->ty, buf, 0); var->init_data = buf; var->rel = head.next; } // Returns true if a given token represents a type. static bool is_typename(Token *tok) { static HashMap map; if (map.capacity == 0) { static char *kw[] = { "void", "_Bool", "char", "short", "int", "long", "struct", "union", "typedef", "enum", "static", "extern", "_Alignas", "signed", "unsigned", "const", "volatile", "auto", "register", "restrict", "__restrict", "__restrict__", "_Noreturn", "float", "double", "typeof", "inline", "__inline", "_Thread_local", "__thread", "_Atomic", "_Complex", "__label__", "__typeof", "__int128"}; for (int i = 0; i < sizeof(kw) / sizeof(*kw); i++) hashmap_put(&map, kw[i], (void *)1); } return hashmap_get2(&map, tok->loc, tok->len) || find_typedef(tok); } // asm-stmt = "asm" ("volatile" | "inline")* "(" string-literal ")" static Node *asm_stmt(Token **rest, Token *tok) { if (current_fn) { current_fn->force_frame_pointer = true; } Node *node = new_node(ND_ASM, tok); tok = tok->next; while (equal(tok, "volatile") || equal(tok, "inline") || equal(tok, "__inline")) tok = tok->next; SET_CTX(ctx); tok = skip(tok, "(", ctx); if (tok->kind != TK_STR || tok->ty->base->kind != TY_CHAR) error_tok(tok, "%s:%d: in asm_stmt : expected string literal", __FILE__, __LINE__); // extended assembly like asm ( assembler_template: output operands (optional) : input operands (optional) : list of clobbered registers (optional)) if (equal(tok->next, ":")) { //need_alloca_bottom(); opt_omit_frame_pointer = false; node->asm_str = extended_asm(node, rest, tok, locals); if (!node->asm_str) error_tok(tok, "%s:%d: in asm_stmt : error during extended_asm function null returned!", __FILE__, __LINE__); return node; } node->asm_str = tok->str; SET_CTX(ctx); *rest = skip(tok->next, ")", ctx); return node; } // stmt = "return" expr? ";" // | "if" "(" expr ")" stmt ("else" stmt)? // | "switch" "(" expr ")" stmt // | "case" const-expr ("..." const-expr)? ":" stmt // | "default" ":" stmt // | "for" "(" expr-stmt expr? ";" expr? ")" stmt // | "while" "(" expr ")" stmt // | "do" stmt "while" "(" expr ")" ";" // | "asm" asm-stmt // | "goto" (ident | "*" expr) ";" // | "break" ";" // | "continue" ";" // | ident ":" stmt // | "{" compound-stmt // | expr-stmt static Node *stmt(Token **rest, Token *tok, bool chained) { if (equal(tok, "return")) { Type *ret_ty = current_fn->ty->return_ty; Node *node = new_node(ND_RETURN, tok); if (consume(rest, tok->next, ";")) { if (ret_ty->kind != TY_VOID) { error_tok(tok, "%s:%d: in stmt : Non-void function must return something", __FILE__, __LINE__); } return node; } Node *exp = expr(&tok, tok->next); SET_CTX(ctx); *rest = skip(tok, ";", ctx); add_type(exp); // Type *ty = current_fn->ty->return_ty; // if (ty->kind != TY_STRUCT && ty->kind != TY_UNION) // exp = new_cast(exp, current_fn->ty->return_ty); if (!exp->ty) error_tok(exp->tok, "%s:%d: in stmt : exp->ty is null", __FILE__, __LINE__); if (ret_ty->kind == TY_VOID && exp->ty->kind != TY_VOID) { error_tok(exp->tok, "%s:%d: in stmt : Void function must return void type expression", __FILE__, __LINE__); } if (ret_ty->kind != TY_VOID && exp->ty->kind == TY_VOID) { error_tok(exp->tok, "%s:%d: in stmt : Non-void function cannot return void type expression", __FILE__, __LINE__); } if (ret_ty->kind != TY_STRUCT && ret_ty->kind != TY_UNION) exp = new_cast(exp, ret_ty); node->lhs = exp; return node; } if (equal(tok, "if")) { Node *node = new_node(ND_IF, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->cond = to_bool(expr(&tok, tok)); if (isDotfile && dotf != NULL) fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(node->cond->kind), node->cond->unique_number); SET_CTX(ctx); tok = skip(tok, ")", ctx); node->then = stmt(&tok, tok, true); if (isDotfile && dotf != NULL) fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(node->then->kind), node->then->unique_number); if (equal(tok, "else")) { node->els = stmt(&tok, tok->next, true); if (isDotfile && dotf != NULL) fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(node->els->kind), node->els->unique_number); } if (is_const_expr(node->cond)) { if (eval(node->cond)) { if (!contains_label(node->els)) { *rest = tok; return node->then; } } else { if (!contains_label(node->then)) { *rest = tok; return node->els ? node->els : new_node(ND_NULL_EXPR, tok); } } } *rest = tok; return node; } //from COSMOPOLITAN adding function static_assertion if (equal(tok, "_Static_assert")) { Token *start = tok; *rest = static_assertion(tok); return new_node(ND_BLOCK, start); } if (equal(tok, "switch")) { Node *node = new_node(ND_SWITCH, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->cond = expr(&tok, tok); add_type(node->cond); if (!is_integer(node->cond->ty)) error_tok(node->cond->tok, "%s:%d: in stmt : switch expression must have integer type", __FILE__, __LINE__); SET_CTX(ctx); tok = skip(tok, ")", ctx); Node *sw = current_switch; current_switch = node; char *brk = brk_label; brk_label = node->brk_label = new_unique_name(); node->then = stmt(rest, tok, true); current_switch = sw; brk_label = brk; return node; } if (equal(tok, "case")) { if (!current_switch) error_tok(tok, "%s:%d: in stmt : stray case", __FILE__, __LINE__); Node *node = new_node(ND_CASE, tok); int64_t begin = const_expr(&tok, tok->next); int64_t end; add_type(current_switch->cond); if (equal(tok, "...")) { // [GNU] Case ranges, e.g. "case 1 ... 5:" end = const_expr(&tok, tok->next); // if (end < begin) // error_tok(tok, "%s:%d: in stmt : empty case range specified", __FILE__, __LINE__); } else { end = begin; } if (current_switch->cond->ty->size == 4) { if (!current_switch->cond->ty->is_unsigned) { begin = (int32_t) begin; end = (int32_t) end; } else { begin = (uint32_t) begin; end = (uint32_t) end; } } if ((!current_switch->cond->ty->is_unsigned && (end < begin)) || ((current_switch->cond->ty->is_unsigned && ((uint64_t)end < begin)))) error_tok(tok, "%s:%d: in stmt : empty case range specified", __FILE__, __LINE__); SET_CTX(ctx); tok = skip(tok, ":", ctx); VarAttr attr = {}; tok = attribute_list(tok, &attr, thing_attributes); node->label = new_unique_name(); if (chained) { if (is_typename(tok)) { node->lhs = compound_stmt2(rest, tok); } else { node->lhs = stmt(rest, tok, true); } } else *rest = tok; //duplicate case value detection for (Node *c = current_switch->case_next; c; c = c->case_next) { if (!(end < c->begin || begin > c->end)) error_tok(tok, "%s:%d: in stmt : duplicated case value or overlapping range %ld", __FILE__, __LINE__, begin); } node->begin = begin; node->end = end; node->case_next = current_switch->case_next; current_switch->case_next = node; return node; } if (equal(tok, "default")) { if (!current_switch) error_tok(tok, "%s:%d: in stmt : stray default", __FILE__, __LINE__); Node *node = new_node(ND_CASE, tok); SET_CTX(ctx); tok = skip(tok->next, ":", ctx); node->label = new_unique_name(); if (chained) { if (is_typename(tok)) { node->lhs = compound_stmt2(rest, tok); } else { node->lhs = stmt(rest, tok, true); } } else *rest = tok; current_switch->default_case = node; return node; } if (equal(tok, "for")) { Node *node = new_node(ND_FOR, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); enter_scope(); char *brk = brk_label; char *cont = cont_label; brk_label = node->brk_label = new_unique_name(); cont_label = node->cont_label = new_unique_name(); if (is_typename(tok)) { Type *basety = declspec(&tok, tok, NULL); node->init = declaration(&tok, tok, basety, NULL); } else { node->init = expr_stmt(&tok, tok); } if (!equal(tok, ";")) { node->cond = expr(&tok, tok); if (isDotfile && dotf != NULL) fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(node->cond->kind), node->cond->unique_number); } SET_CTX(ctx); tok = skip(tok, ";", ctx); if (!equal(tok, ")")) { node->inc = expr(&tok, tok); if (isDotfile && dotf != NULL) fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(node->inc->kind), node->inc->unique_number); } SET_CTX(ctx); tok = skip(tok, ")", ctx); node->then = stmt(rest, tok, true); if (isDotfile && dotf != NULL) fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(node->then->kind), node->then->unique_number); leave_scope(); brk_label = brk; cont_label = cont; return node; } if (equal(tok, "while")) { Node *node = new_node(ND_FOR, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->cond = expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); char *brk = brk_label; char *cont = cont_label; brk_label = node->brk_label = new_unique_name(); cont_label = node->cont_label = new_unique_name(); node->then = stmt(rest, tok, true); brk_label = brk; cont_label = cont; return node; } if (equal(tok, "do")) { Node *node = new_node(ND_DO, tok); char *brk = brk_label; char *cont = cont_label; brk_label = node->brk_label = new_unique_name(); cont_label = node->cont_label = new_unique_name(); node->then = stmt(&tok, tok->next, true); brk_label = brk; cont_label = cont; SET_CTX(ctx); tok = skip(tok, "while", ctx); SET_CTX(ctx); tok = skip(tok, "(", ctx); node->cond = expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); SET_CTX(ctx); *rest = skip(tok, ";", ctx); return node; } if (equal(tok, "asm") || equal(tok, "__asm__") || equal(tok, "__asm")) return asm_stmt(rest, tok); if (equal(tok, "goto")) { if (equal(tok->next, "*")) { // [GNU] `goto *ptr` jumps to the address specified by `ptr`. Node *node = new_node(ND_GOTO_EXPR, tok); node->lhs = expr(&tok, tok->next->next); SET_CTX(ctx); *rest = skip(tok, ";", ctx); return node; } Node *node = new_node(ND_GOTO, tok); node->label = get_ident(tok->next); node->goto_next = gotos; gotos = node; SET_CTX(ctx); *rest = skip(tok->next->next, ";", ctx); return node; } if (equal(tok, "break")) { if (!brk_label) error_tok(tok, "%s:%d: in stmt : stray break", __FILE__, __LINE__); Node *node = new_node(ND_GOTO, tok); node->unique_label = brk_label; SET_CTX(ctx); *rest = skip(tok->next, ";", ctx); return node; } if (equal(tok, "continue")) { if (!cont_label) error_tok(tok, "%s:%d: in stmt : stray continue", __FILE__, __LINE__); Node *node = new_node(ND_GOTO, tok); node->unique_label = cont_label; SET_CTX(ctx); *rest = skip(tok->next, ";", ctx); return node; } if ((tok->kind == TK_IDENT && equal(tok->next, ":"))) { Node *node = new_node(ND_LABEL, tok); node->label = strndup(tok->loc, tok->len); node->unique_label = new_unique_name(); //node->lhs = stmt(rest, tok->next->next); tok = tok->next->next; if (chained) node->lhs = stmt(rest, tok, true); else *rest = tok; node->goto_next = labels; labels = node; return node; } if (equal(tok, "{")) return compound_stmt(rest, tok->next, NULL); return expr_stmt(rest, tok); } // compound-stmt = (typedef | declaration | stmt)* "}" static Node *compound_stmt(Token **rest, Token *tok, Node **last) { Node *node = new_node(ND_BLOCK, tok); Node head = {0}; Node *cur = &head; enter_scope(); //while (!equal(tok, "}")) for (; !equal(tok, "}"); add_type(cur)) { VarAttr attr = {}; tok = attribute_list(tok, &attr, thing_attributes); if (is_typename(tok) && !equal(tok->next, ":")) { //VarAttr attr = {}; Type *basety = declspec(&tok, tok, &attr); if (attr.is_typedef) { Node *vla_calc = parse_typedef(&tok, tok, basety, &attr); cur = cur->next = new_unary(ND_EXPR_STMT, vla_calc, tok); add_type(cur); continue; } if (is_function(tok)) { tok = function(tok, basety, &attr); continue; } if (attr.is_extern) { tok = global_declaration(tok, basety, &attr); continue; } cur = cur->next = declaration(&tok, tok, basety, &attr); } else { //case specific of fallthrough //VarAttr attr= {}; tok = attribute_list(tok, &attr, thing_attributes); cur = cur->next = stmt(&tok, tok, false); } add_type(cur); } if (last) *last = cur; leave_scope(); node->body = head.next; if (isDotfile && dotf != NULL) { if (node->body != NULL) fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(node->body->kind), node->body->unique_number); } *rest = tok->next; return node; } // compound-stmt = (typedef | declaration | stmt)* //case of missing braces for compound statement static Node *compound_stmt2(Token **rest, Token *tok) { Node *node = new_node(ND_BLOCK, tok); Node head = {}; Node *cur = &head; enter_scope(); while (!equal(tok, "}") && !equal(tok, "case") && !equal(tok, "default")) { VarAttr attr = {}; tok = attribute_list(tok, &attr, thing_attributes); if (is_typename(tok) && !equal(tok->next, ":")) { //VarAttr attr = {}; Type *basety = declspec(&tok, tok, &attr); if (attr.is_typedef) { Node *vla_calc = parse_typedef(&tok, tok, basety, &attr); cur = cur->next = new_unary(ND_EXPR_STMT, vla_calc, tok); add_type(cur); continue; } if (is_function(tok)) { tok = function(tok, basety, &attr); continue; } if (attr.is_extern) { tok = global_declaration(tok, basety, &attr); continue; } //cur = cur->next = declaration(&tok, tok, basety, &attr); Node *expr = declaration(&tok, tok, basety, &attr); if (expr) cur = cur->next = new_unary(ND_EXPR_STMT, expr, tok); continue; } else { //case specific of fallthrough //VarAttr attr= {}; tok = attribute_list(tok, &attr, thing_attributes); cur = cur->next = stmt(&tok, tok, false); } //add_type(cur); } leave_scope(); node->body = head.next; if (isDotfile && dotf != NULL) { if (node->body != NULL) fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(node->body->kind), node->body->unique_number); } *rest = tok; return node; } // expr-stmt = expr? ";" static Node *expr_stmt(Token **rest, Token *tok) { if (equal(tok, ";")) { *rest = tok->next; return new_node(ND_BLOCK, tok); } Node *node = new_node(ND_EXPR_STMT, tok); node->lhs = expr(&tok, tok); if (isDotfile && dotf != NULL) fprintf(dotf, "%s%d -> %s%d\n", nodekind2str(node->kind), node->unique_number, nodekind2str(node->lhs->kind), node->lhs->unique_number); SET_CTX(ctx); *rest = skip(tok, ";", ctx); return node; } // expr = assign ("," expr)? static Node *expr(Token **rest, Token *tok) { Node *node = assign(&tok, tok); if (equal(tok, ",")) return new_binary(ND_COMMA, node, expr(rest, tok->next), tok); *rest = tok; return node; } int64_t eval(Node *node) { return eval2(node, NULL); } // Evaluate a given node as a constant expression. // // A constant expression is either just a number or ptr+n where ptr // is a pointer to a global variable and n is a postiive/negative // number. The latter form is accepted only as an initialization // expression for a global variable. static int64_t eval2(Node *node, char ***label) { add_type(node); if (is_flonum(node->ty)) return eval_double(node); switch (node->kind) { case ND_ADD: if (label) { char **l1 = NULL; char **l2 = NULL; int64_t v1 = eval2(node->lhs, &l1); int64_t v2 = eval2(node->rhs, &l2); if (l1 && l2) error_tok(node->tok, "%s:%d: in eval2 : invalid constant address expression", __FILE__, __LINE__); if (l2) { *label = l2; return v1 + v2; } if (l1) *label = l1; return v1 + v2; } return eval2(node->lhs, label) + eval(node->rhs); case ND_SUB: if (label) { char **l1 = NULL; char **l2 = NULL; int64_t v1 = eval2(node->lhs, &l1); int64_t v2 = eval2(node->rhs, &l2); if (l2) error_tok(node->tok, "%s:%d: in eval2 : invalid constant address expression", __FILE__, __LINE__); if (l1) *label = l1; return v1 - v2; } return eval2(node->lhs, label) - eval(node->rhs); case ND_MUL: return eval(node->lhs) * eval(node->rhs); case ND_DIV: // Check for division overflow if (eval(node->lhs) == LLONG_MIN && eval(node->rhs) == -1) { warn_tok(node->tok, "in eval2: %s:%d: integer overflow!", __FILE__, __LINE__); return 0; // Return 0 or any other value you think is appropriate } if (eval(node->rhs) == 0) error_tok(node->tok, "%s %d: in eval2 : eval(node->rhs) caused a division by zero!", __FILE__, __LINE__ ); if (node->ty && node->ty->is_unsigned) return (uint64_t)eval(node->lhs) / (uint64_t)eval(node->rhs); return eval(node->lhs) / eval(node->rhs); case ND_POS: return eval(node->lhs); case ND_NEG: if (node->ty->size == 4) { if (node->ty->is_unsigned) return (uint32_t)-eval(node->lhs); return (int32_t)-eval(node->lhs); } return -eval(node->lhs); case ND_MOD: // Check for division overflow if (eval(node->lhs) == LLONG_MIN && eval(node->rhs) == -1) { warn_tok(node->tok, "in eval2: %s:%d: integer overflow!", __FILE__, __LINE__); return 0; } if (eval(node->rhs) == 0) error_tok(node->tok, "%s %d: in eval2 : eval(node->rhs) caused a division by zero!", __FILE__, __LINE__ ); if (node->ty && node->ty->is_unsigned) return (uint64_t)eval(node->lhs) % eval(node->rhs); return eval(node->lhs) % eval(node->rhs); case ND_BITAND: return eval(node->lhs) & eval(node->rhs); case ND_BITOR: return eval(node->lhs) | eval(node->rhs); case ND_BITXOR: return eval(node->lhs) ^ eval(node->rhs); case ND_SHL: { int64_t lhs = eval(node->lhs); int64_t rhs = eval(node->rhs); int width = node->ty->size * 8; if (rhs >= width || rhs < 0) return 0; return lhs << rhs; } case ND_SHR: { int64_t lhs = eval(node->lhs); int64_t rhs = eval(node->rhs); int width = node->ty->size * 8; if (rhs >= width || rhs < 0) { if (node->ty->is_unsigned || lhs >= 0) return 0; return -1; } if (node->ty->is_unsigned) { if (node->ty->size == 4) return (uint32_t)lhs >> rhs; return (uint64_t)lhs >> rhs; } if (node->ty->size == 4) return (int32_t)lhs >> rhs; return lhs >> rhs; } case ND_EQ: //from @fuhsnn fixing when lhs is a float if (is_flonum(node->lhs->ty)) return eval_double(node->lhs) == eval_double(node->rhs); return eval(node->lhs) == eval(node->rhs); case ND_NE: //from @fuhsnn fixing when lhs is a float if (is_flonum(node->lhs->ty)) return eval_double(node->lhs) != eval_double(node->rhs); return eval(node->lhs) != eval(node->rhs); case ND_LT: //from @fuhsnn fixing when lhs is a float if (is_flonum(node->lhs->ty)) return eval_double(node->lhs) < eval_double(node->rhs); if (node->lhs->ty->is_unsigned) return (uint64_t)eval(node->lhs) < eval(node->rhs); return eval(node->lhs) < eval(node->rhs); case ND_LE: //from @fuhsnn fixing when lhs is a float if (is_flonum(node->lhs->ty)) return eval_double(node->lhs) <= eval_double(node->rhs); if (node->lhs->ty->is_unsigned) return (uint64_t)eval(node->lhs) <= eval(node->rhs); return eval(node->lhs) <= eval(node->rhs); case ND_COND: return eval(node->cond) ? eval2(node->then, label) : eval2(node->els, label); case ND_COMMA: eval2(node->lhs, label); return eval2(node->rhs, label); case ND_NOT: //from @fuhsnn fixing when lhs is a float if (is_flonum(node->lhs->ty)) return !eval_double(node->lhs); return !eval(node->lhs); case ND_BITNOT: if (node->ty->size == 4) { if (node->ty->is_unsigned) return (uint32_t)~eval(node->lhs); return (int32_t)~eval(node->lhs); } return ~eval(node->lhs); case ND_LOGAND: return eval(node->lhs) && eval(node->rhs); case ND_LOGOR: return eval(node->lhs) || eval(node->rhs); case ND_CAST: { if (is_flonum(node->lhs->ty)) { if (node->ty->kind == TY_BOOL) return !!eval_double(node->lhs); if (node->ty->size == 8 && node->ty->is_unsigned) return (uint64_t)eval_double(node->lhs); return eval_sign_extend(node->ty, eval_double(node->lhs)); } if (node->ty->kind == TY_BOOL) { if (node->lhs->kind == ND_VAR && is_array(node->lhs->ty)) return 1; return !!eval2(node->lhs, label); } int64_t val = eval2(node->lhs, label); if (is_integer(node->ty)) return eval_sign_extend(node->ty, val); return val; } case ND_ADDR: return eval_rval(node->lhs, label); case ND_LABEL_VAL: *label = &node->unique_label; return 0; // fixing issue #115 // case ND_DEREF: // return eval2(node->lhs, label); //from @fuhsnn eval2():Evaluate ND_DEREF for TY_ARRAY case ND_DEREF: // If dereferencing to an integer type from a const array, read the value. if (is_integer(node->ty)) { int64_t byte_offset = 0; Obj *var = eval_lval_obj(node->lhs, &byte_offset); if (var && var->init_data && !var->rel && is_const_var(var) && byte_offset >= 0 && byte_offset + node->ty->size <= var->ty->size) { // Resolved to a constant: clear label so caller treats it as a plain integer. if (label) *label = NULL; return eval_sign_extend(node->ty, read_buf(var->init_data + byte_offset, node->ty->size)); } } return eval2(node->lhs, label); case ND_MEMBER: if (!label) { error_tok(node->tok, "%s:%d: in eval2 : not a compile-time constant", __FILE__, __LINE__ ); } // if (node->ty->kind != TY_ARRAY) { // error_tok(node->tok, "%s:%d: in eval2 : invalid initializer", __FILE__, __LINE__); // } return eval_rval(node->lhs, label) + node->member->offset; case ND_VAR: if (is_vector(node->var->ty)) return 0; if (!label && is_const_var(node->var) && node->var->init_data && !node->var->rel) { if (is_integer(node->var->ty)) return eval_sign_extend(node->var->ty, read_buf(node->var->init_data, node->var->ty->size)); } if (node->var->is_static || node->var->is_definition) { if (label) *label = &node->var->name; return 0; } //trying to fix ======ISS-145 compiling util-linux failed with invalid initalizer2 // if (node->var->ty->kind != TY_ARRAY && node->var->ty->kind != TY_FUNC && node->var->ty->kind != TY_INT) { // error_tok(node->tok, "%s:%d: in eval2 : invalid initializer2 %d", __FILE__, __LINE__, node->var->ty->kind); // } //trying to fix ======ISS-145 compiling util-linux failed with invalid initalizer2 if (is_integer(node->var->ty)) return 0; if (!label) { error_tok(node->tok, "%s:%d : in eval2 : not a compile-time constant %d", __FILE__, __LINE__, node->var->ty->kind); } *label = &node->var->name; return 0; case ND_NUM: return node->val; } error_tok(node->tok, "%s:%d: in eval2 : not a compile-time constant3", __FILE__, __LINE__); } static int64_t eval_rval(Node *node, char ***label) { switch (node->kind) { case ND_VAR: if (node->var->is_local) error_tok(node->tok, "%s:%d: in eval2 : not a compile-time constant4", __FILE__, __LINE__); // Use the symbol name that will be emitted for this variable. // For variables/functions with an `asm` label, the emitted symbol // differs from the C identifier. *label = node->var->asmname ? &node->var->asmname : &node->var->name; return 0; case ND_DEREF: return eval2(node->lhs, label); case ND_MEMBER: return eval_rval(node->lhs, label) + node->member->offset; case ND_ADDR: return 1; } error_tok(node->tok, "%s:%d: in eval2 : invalid initializer3", __FILE__, __LINE__); } // Walk an lvalue expression and return the underlying global Obj and byte offset. // Returns NULL if the expression is not a constant lvalue into a global. static Obj *eval_lval_obj(Node *node, int64_t *offset) { switch (node->kind) { case ND_VAR: if (node->var->is_local) return NULL; *offset = 0; return node->var; case ND_ADD: { // ptr + index (pointer arithmetic, already byte-scaled by new_add) int64_t base_off = 0; Obj *var = eval_lval_obj(node->lhs, &base_off); if (!var) return NULL; *offset = base_off + eval(node->rhs); return var; } case ND_DEREF: { // *(ptr) — evaluate ptr as lvalue int64_t base_off = 0; Obj *var = eval_lval_obj(node->lhs, &base_off); if (!var) return NULL; *offset = base_off; return var; } case ND_CAST: // Array-to-pointer decay and other pointer casts: pass through return eval_lval_obj(node->lhs, offset); default: return NULL; } } bool is_const_expr(Node *node) { add_type(node); switch (node->kind) { case ND_ADD: case ND_SUB: case ND_MUL: case ND_DIV: case ND_MOD: case ND_BITAND: case ND_BITOR: case ND_BITXOR: case ND_SHL: case ND_SHR: case ND_EQ: case ND_NE: case ND_LT: case ND_LE: case ND_LOGAND: case ND_LOGOR: return is_const_expr(node->lhs) && is_const_expr(node->rhs); case ND_COND: if (!is_const_expr(node->cond)) return false; return is_const_expr(eval(node->cond) ? node->then : node->els); case ND_COMMA: return is_const_expr(node->rhs) && is_const_expr(node->lhs); case ND_POS: case ND_NEG: case ND_NOT: case ND_BITNOT: case ND_CAST: return is_const_expr(node->lhs); case ND_NUM: return true; case ND_MEMBER: case ND_ADDR: case ND_DEREF: return is_const_expr(node->lhs); } return false; } bool contains_label(Node *node) { if (!node) return false; if (node->kind == ND_LABEL || node->kind == ND_CASE) return true; if (contains_label(node->lhs) || contains_label(node->rhs) || contains_label(node->cond) || contains_label(node->then) || contains_label(node->els) || contains_label(node->init) || contains_label(node->body) || contains_label(node->next) || contains_label(node->case_next)) return true; return false; } int64_t const_expr(Token **rest, Token *tok) { Node *node = conditional(rest, tok); add_type(node); return eval(node); } static long double eval_double(Node *node) { add_type(node); if (is_integer(node->ty)) { if (node->ty->is_unsigned) return (unsigned long)eval(node); return eval(node); } switch (node->kind) { case ND_ADD: return eval_double(node->lhs) + eval_double(node->rhs); case ND_SUB: return eval_double(node->lhs) - eval_double(node->rhs); case ND_MUL: return eval_double(node->lhs) * eval_double(node->rhs); case ND_DIV: return eval_double(node->lhs) / eval_double(node->rhs); case ND_POS: return eval_double(node->lhs); case ND_NEG: return -eval_double(node->lhs); case ND_COND: return eval_double(node->cond) ? eval_double(node->then) : eval_double(node->els); case ND_COMMA: eval_double(node->lhs); return eval_double(node->rhs); case ND_CAST: if (is_flonum(node->lhs->ty)) { if (node->ty->size == 4) return (float)eval_double(node->lhs); if (node->ty->size == 8) return (double)eval_double(node->lhs); return eval_double(node->lhs); } if (node->lhs->ty->size == 8 && node->lhs->ty->is_unsigned) return (uint64_t)eval(node->lhs); return eval(node->lhs); case ND_BUILTIN_NAN: case ND_BUILTIN_NANF: case ND_BUILTIN_INFF: case ND_FPCLASSIFY: case ND_NUM: return node->fval; case ND_VAR: if (node->var->init_data && !node->var->rel) { if (node->ty->kind == TY_FLOAT) return *(float *)node->var->init_data; if (node->ty->kind == TY_DOUBLE) return *(double *)node->var->init_data; if (node->ty->kind == TY_LDOUBLE) return *(long double *)node->var->init_data; } break; } error_tok(node->tok, "%s:%d: in eval_double : not a compile-time constant %d", __FILE__, __LINE__, node->kind); } // Check if it is safe to re-evaluate an lvalue without introducing a temp. // This intentionally accepts only address-stable forms rooted in variables. static bool is_safe_lvalue(Node *node) { if (!node) return false; if (node->kind == ND_VAR) return true; if (node->kind == ND_MEMBER && !is_bitfield(node)) return is_safe_lvalue(node->lhs); return false; } static Node *atomic_op(Node *binary, bool return_old) { Token *tok = binary->tok; Node head = {0}; Node *cur = &head; Obj *addr = new_lvar("", pointer_to(binary->lhs->ty), NULL); Obj *val = new_lvar("", binary->rhs->ty, NULL); Obj *old = new_lvar("", binary->lhs->ty, NULL); Obj *new = new_lvar("", binary->lhs->ty, NULL); cur = cur->next = new_unary(ND_EXPR_STMT, new_binary(ND_ASSIGN, new_var_node(addr, tok), new_unary(ND_ADDR, binary->lhs, tok), tok), tok); cur = cur->next = new_unary(ND_EXPR_STMT, new_binary(ND_ASSIGN, new_var_node(val, tok), binary->rhs, tok), tok); cur = cur->next = new_unary(ND_EXPR_STMT, new_binary(ND_ASSIGN, new_var_node(old, tok), new_unary(ND_DEREF, new_var_node(addr, tok), tok), tok), tok); Node *loop = new_node(ND_DO, tok); loop->brk_label = new_unique_name(); loop->cont_label = new_unique_name(); Node *body = new_binary(ND_ASSIGN, new_var_node(new, tok), new_binary(binary->kind, new_var_node(old, tok), new_var_node(val, tok), tok), tok); loop->then = new_node(ND_BLOCK, tok); loop->then->body = new_unary(ND_EXPR_STMT, body, tok); Node *cas = new_node(ND_CAS, tok); cas->cas_addr = new_var_node(addr, tok); cas->cas_old = new_unary(ND_ADDR, new_var_node(old, tok), tok); cas->cas_new = new_var_node(new, tok); loop->cond = new_unary(ND_NOT, cas, tok); cur = cur->next = loop; if (return_old) cur->next = new_unary(ND_EXPR_STMT, new_var_node(old, tok), tok); else cur->next = new_unary(ND_EXPR_STMT, new_var_node(new, tok), tok); Node *node = new_node(ND_STMT_EXPR, tok); node->body = head.next; return node; } // Convert op= operators to expressions containing an assignment. // // In general, `A op= C` is converted to ``tmp = &A, *tmp = *tmp op B`. // However, if a given expression is of form `A.x op= C`, the input is // converted to `tmp = &A, (*tmp).x = (*tmp).x op C` to handle assignments // to bitfields. static Node *to_assign(Node *binary) { add_type(binary->lhs); add_type(binary->rhs); Token *tok = binary->tok; if (!current_fn) return new_binary(ND_ASSIGN, binary->lhs, new_binary(binary->kind, binary->lhs, binary->rhs, tok), tok); // -O1+: for simple lvalues, avoid creating a hidden pointer temp for op= // lowering. This reduces stack-frame pressure in recursive hot paths. if (opt_optimize_level1 && !binary->lhs->ty->is_atomic && is_safe_lvalue(binary->lhs)) { return new_binary(ND_ASSIGN, binary->lhs, new_binary(binary->kind, binary->lhs, binary->rhs, tok), tok); } // If A is an atomic type, Convert `A op= B` to // // ({ // T1 *addr = &A; T2 val = (B); T1 old = *addr; T1 new; // do { // new = old op val; // } while (!atomic_compare_exchange_strong(addr, &old, new)); // new; // }) // If A is an atomic type, Convert `A op= B` to atomic_op_fetch(&A, B) if (binary->lhs->ty->is_atomic) return atomic_op(binary, false); // Convert `A.x op= C` to `tmp = &A, (*tmp).x = (*tmp).x op C`. if (binary->lhs->kind == ND_MEMBER) { Obj *var = new_lvar("", pointer_to(binary->lhs->lhs->ty), NULL); Node *expr1 = new_binary(ND_ASSIGN, new_var_node(var, tok), new_unary(ND_ADDR, binary->lhs->lhs, tok), tok); Node *expr2 = new_unary(ND_MEMBER, new_unary(ND_DEREF, new_var_node(var, tok), tok), tok); expr2->member = binary->lhs->member; Node *expr3 = new_unary(ND_MEMBER, new_unary(ND_DEREF, new_var_node(var, tok), tok), tok); expr3->member = binary->lhs->member; Node *expr4 = new_binary(ND_ASSIGN, expr2, new_binary(binary->kind, expr3, binary->rhs, tok), tok); return new_binary(ND_COMMA, expr1, expr4, tok); } // Convert `A op= B` to ``tmp = &A, *tmp = *tmp op B`. Obj *var = new_lvar("", pointer_to(binary->lhs->ty), NULL); Node *expr1 = new_binary(ND_ASSIGN, new_var_node(var, tok), new_unary(ND_ADDR, binary->lhs, tok), tok); Node *expr2 = new_binary(ND_ASSIGN, new_unary(ND_DEREF, new_var_node(var, tok), tok), new_binary(binary->kind, new_unary(ND_DEREF, new_var_node(var, tok), tok), binary->rhs, tok), tok); return new_binary(ND_COMMA, expr1, expr2, tok); } // assign = conditional (assign-op assign)? // assign-op = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "&=" | "|=" | "^=" // | "<<=" | ">>=" static Node *assign(Token **rest, Token *tok) { Node *node = conditional(&tok, tok); if (equal(tok, "=")) return new_binary(ND_ASSIGN, node, assign(rest, tok->next), tok); if (equal(tok, "+=")) return to_assign(new_add(node, assign(rest, tok->next), tok, false)); if (equal(tok, "-=")) return to_assign(new_sub(node, assign(rest, tok->next), tok, false)); if (equal(tok, "*=")) return to_assign(new_binary(ND_MUL, node, assign(rest, tok->next), tok)); if (equal(tok, "/=")) return to_assign(new_binary(ND_DIV, node, assign(rest, tok->next), tok)); if (equal(tok, "%=")) return to_assign(new_binary(ND_MOD, node, assign(rest, tok->next), tok)); if (equal(tok, "&=")) return to_assign(new_binary(ND_BITAND, node, assign(rest, tok->next), tok)); if (equal(tok, "|=")) return to_assign(new_binary(ND_BITOR, node, assign(rest, tok->next), tok)); if (equal(tok, "^=")) return to_assign(new_binary(ND_BITXOR, node, assign(rest, tok->next), tok)); if (equal(tok, "<<=")) return to_assign(new_binary(ND_SHL, node, assign(rest, tok->next), tok)); if (equal(tok, ">>=")) return to_assign(new_binary(ND_SHR, node, assign(rest, tok->next), tok)); *rest = tok; return node; } // conditional = logor ("?" expr? ":" conditional)? static Node *conditional(Token **rest, Token *tok) { Node *cond = logor(&tok, tok); if (!equal(tok, "?")) { *rest = tok; return cond; } if (equal(tok->next, ":") || equal(tok, ",")) { // [GNU] Compile `a ?: b` as `tmp = a, tmp ? tmp : b`. add_type(cond); Obj *var = new_lvar("", cond->ty, NULL); Node *lhs = new_binary(ND_ASSIGN, new_var_node(var, tok), cond, tok); Node *rhs = new_node(ND_COND, tok); //commit 2e138bb from slimcc rhs->cond = to_bool(new_var_node(var, tok)); rhs->then = new_var_node(var, tok); rhs->els = conditional(rest, tok->next->next); return new_binary(ND_COMMA, lhs, rhs, tok); } Node *node = new_node(ND_COND, tok); //commit 2e138bb from slimcc node->cond = to_bool(cond); node->then = expr(&tok, tok->next); SET_CTX(ctx); tok = skip(tok, ":", ctx); node->els = conditional(rest, tok); return node; } // logor = logand ("||" logand)* static Node *logor(Token **rest, Token *tok) { Node *node = logand(&tok, tok); while (equal(tok, "||")) { Token *start = tok; //commit 2e138bb from slimcc node = new_binary(ND_LOGOR, to_bool(node), to_bool(logand(&tok, tok->next)), start); } *rest = tok; return node; } // logand = bitor ("&&" bitor)* static Node *logand(Token **rest, Token *tok) { Node *node = bitor (&tok, tok); while (equal(tok, "&&")) { Token *start = tok; //commit 2e138bb from slimcc node = new_binary(ND_LOGAND, to_bool(node), to_bool(bitor(&tok, tok->next)), start); } *rest = tok; return node; } // bitor = bitxor ("|" bitxor)* static Node * bitor (Token * *rest, Token *tok) { Node *node = bitxor(&tok, tok); while (equal(tok, "|")) { Token *start = tok; node = new_binary(ND_BITOR, node, bitxor(&tok, tok->next), start); promote_scalar_to_vector(node); } *rest = tok; return node; } // bitxor = bitand ("^" bitand)* static Node *bitxor(Token **rest, Token *tok) { Node *node = bitand(&tok, tok); while (equal(tok, "^")) { Token *start = tok; node = new_binary(ND_BITXOR, node, bitand(&tok, tok->next), start); promote_scalar_to_vector(node); } *rest = tok; return node; } // bitand = equality ("&" equality)* static Node *bitand(Token **rest, Token *tok) { Node *node = equality(&tok, tok); while (equal(tok, "&")) { Token *start = tok; node = new_binary(ND_BITAND, node, equality(&tok, tok->next), start); promote_scalar_to_vector(node); } *rest = tok; return node; } // equality = relational ("==" relational | "!=" relational)* static Node *equality(Token **rest, Token *tok) { Node *node = relational(&tok, tok); for (;;) { Token *start = tok; if (equal(tok, "==")) { node = new_binary(ND_EQ, node, relational(&tok, tok->next), start); continue; } if (equal(tok, "!=")) { node = new_binary(ND_NE, node, relational(&tok, tok->next), start); continue; } *rest = tok; return node; } } // relational = shift ("<" shift | "<=" shift | ">" shift | ">=" shift)* static Node *relational(Token **rest, Token *tok) { Node *node = shift(&tok, tok); for (;;) { Token *start = tok; if (equal(tok, "<")) { node = new_binary(ND_LT, node, shift(&tok, tok->next), start); continue; } if (equal(tok, "<=")) { node = new_binary(ND_LE, node, shift(&tok, tok->next), start); continue; } if (equal(tok, ">")) { node = new_binary(ND_LT, shift(&tok, tok->next), node, start); continue; } if (equal(tok, ">=")) { node = new_binary(ND_LE, shift(&tok, tok->next), node, start); continue; } *rest = tok; return node; } } // shift = add ("<<" add | ">>" add)* static Node *shift(Token **rest, Token *tok) { Node *node = add(&tok, tok); for (;;) { Token *start = tok; if (equal(tok, "<<")) { node = new_binary(ND_SHL, node, add(&tok, tok->next), start); continue; } if (equal(tok, ">>")) { node = new_binary(ND_SHR, node, add(&tok, tok->next), start); continue; } *rest = tok; return node; } } // In C, `+` operator is overloaded to perform the pointer arithmetic. // If p is a pointer, p+n adds not n but sizeof(*p)*n to the value of p, // so that p+n points to the location n elements (not bytes) ahead of p. // In other words, we need to scale an integer value before adding to a // pointer value. This function takes care of the scaling. static Node *new_add(Node *lhs, Node *rhs, Token *tok, bool is_op) { add_type(lhs); add_type(rhs); //case of vectors + scalars if (is_op && (is_vector(lhs->ty) || is_vector(rhs->ty))) { if (is_vector(lhs->ty) && !is_vector(rhs->ty)) { rhs = scalar_to_vector(rhs, lhs->ty); rhs->ty = lhs->ty; } else if (is_vector(rhs->ty) && !is_vector(lhs->ty)) { lhs = scalar_to_vector(lhs, rhs->ty); lhs->ty = rhs->ty; } } // case of vectors if (is_vector(lhs->ty) && is_vector(rhs->ty)) { if (lhs->ty->array_len != rhs->ty->array_len) error_tok(tok, "%s:%d: in new_add: incompatible vector types", __FILE__, __LINE__); Node *node = new_binary(ND_ADD, lhs, rhs, tok); node->ty = lhs->ty; return node; } // num + num if (is_numeric(lhs->ty) && is_numeric(rhs->ty)) { Node *folded = constant_folding(ND_ADD, lhs, rhs, tok); if (folded) return folded; return new_binary(ND_ADD, lhs, rhs, tok); } if ((lhs->ty->base == NULL && rhs->ty->base == NULL) || (lhs->ty->base != NULL && rhs->ty->base != NULL)) { error_tok(tok, "%s:%d: in new_add : invalid operands", __FILE__, __LINE__); } // Canonicalize `num + ptr` to `ptr + num`. if (!lhs->ty->base && rhs->ty->base) { Node *tmp = lhs; lhs = rhs; rhs = tmp; } // VLA + num if (lhs->ty->base->kind == TY_VLA) { if (!lhs->ty->base->vla_size) rhs = new_binary(ND_MUL, rhs, new_long(lhs->ty->base->base->size, tok), tok); else rhs = new_binary(ND_MUL, rhs, new_var_node(lhs->ty->base->vla_size, tok), tok); return new_binary(ND_ADD, lhs, rhs, tok); } // ptr + num rhs = new_binary(ND_MUL, rhs, new_long(lhs->ty->base->size, tok), tok); return new_binary(ND_ADD, lhs, rhs, tok); } // Like `+`, `-` is overloaded for the pointer type. static Node *new_sub(Node *lhs, Node *rhs, Token *tok, bool is_op) { add_type(lhs); add_type(rhs); //case of vectors + scalars if (is_op && (is_vector(lhs->ty) || is_vector(rhs->ty))) { if (is_vector(lhs->ty) && !is_vector(rhs->ty)) { rhs = scalar_to_vector(rhs, lhs->ty); rhs->ty = lhs->ty; } else if (is_vector(rhs->ty) && !is_vector(lhs->ty)) { lhs = scalar_to_vector(lhs, rhs->ty); lhs->ty = rhs->ty; } } // case of vectors if (is_vector(lhs->ty) && is_vector(rhs->ty)) { if (lhs->ty->array_len != rhs->ty->array_len || lhs->ty->base->kind != rhs->ty->base->kind) error_tok(tok, "%s:%d: in new_sub : incompatible vector types", __FILE__, __LINE__); Node *node = new_binary(ND_SUB, lhs, rhs, tok); node->ty = lhs->ty; return node; } // num - num if (is_numeric(lhs->ty) && is_numeric(rhs->ty)) { Node *folded = constant_folding(ND_SUB, lhs, rhs, tok); if (folded) return folded; return new_binary(ND_SUB, lhs, rhs, tok); } // VLA + num if (lhs->ty->base->kind == TY_VLA) { rhs = new_binary(ND_MUL, rhs, new_var_node(lhs->ty->base->vla_size, tok), tok); add_type(rhs); Node *node = new_binary(ND_SUB, lhs, rhs, tok); node->ty = lhs->ty; return node; } // ptr - num if (lhs->ty->base && is_integer(rhs->ty)) { rhs = new_binary(ND_MUL, rhs, new_long(lhs->ty->base->size, tok), tok); add_type(rhs); Node *node = new_binary(ND_SUB, lhs, rhs, tok); node->ty = lhs->ty; return node; } // ptr - ptr, which returns how many elements are between the two. if (lhs->ty->base && rhs->ty->base) { Node *node = new_binary(ND_SUB, lhs, rhs, tok); node->ty = ty_long; return new_binary(ND_DIV, node, new_num(lhs->ty->base->size, tok), tok); } error_tok(tok, "%s:%d: in new_sub : invalid operands", __FILE__, __LINE__); } // add = mul ("+" mul | "-" mul)* static Node *add(Token **rest, Token *tok) { Node *node = mul(&tok, tok); for (;;) { Token *start = tok; if (equal(tok, "+")) { node = new_add(node, mul(&tok, tok->next), start, true); continue; } if (equal(tok, "-")) { node = new_sub(node, mul(&tok, tok->next), start, true); continue; } *rest = tok; return node; } } // mul = cast ("*" cast | "/" cast | "%" cast)* static Node *mul(Token **rest, Token *tok) { Node *node = cast(&tok, tok); add_type(node); for (;;) { Token *start = tok; if (equal(tok, "*")) { Node *rhs = cast(&tok, tok->next); Node *folded = constant_folding(ND_MUL, node, rhs, start); if (folded) { node = folded; } else { node = new_binary(ND_MUL, node, rhs, start); promote_scalar_to_vector(node); } continue; } if (equal(tok, "/")) { Node *rhs = cast(&tok, tok->next); Node *folded = constant_folding(ND_DIV, node, rhs, start); if (folded) { node = folded; } else { node = new_binary(ND_DIV, node, rhs, start); promote_scalar_to_vector(node); } continue; } if (equal(tok, "%")) { Node *rhs = cast(&tok, tok->next); Node *folded = constant_folding(ND_MOD, node, rhs, start); if (folded) { node = folded; } else { node = new_binary(ND_MOD, node, rhs, start); promote_scalar_to_vector(node); } continue; } *rest = tok; return node; } } // cast = "(" type-name ")" cast | unary static Node *cast(Token **rest, Token *tok) { Token *start = tok; //fix for the following cast case : //(__attribute__((__vector_size__ (16))) int) if (equal(tok, "(") && equal(tok->next, "__attribute__")) { while(tok->kind != TK_KEYWORD) tok = tok->next; Type *tmp = typename(&tok, tok); tok = attribute_list(start->next, tmp, type_attributes); start->next = tok; Type *ty = typename(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); // compound literal if (equal(tok, "{")) return unary(rest, start); // type cast Node *node = new_cast(cast(rest, tok), ty); node->tok = start; return node; } if (equal(tok, "(") && is_typename(tok->next)) { //Token *start = tok; Type *ty = typename(&tok, tok->next); SET_CTX(ctx); tok = skip(tok, ")", ctx); // compound literal if (equal(tok, "{")) return unary(rest, start); // type cast Node *node = new_cast(cast(rest, tok), ty); node->tok = start; return node; } return unary(rest, tok); } static void mark_var_address_taken(Node *node) { while (node->kind == ND_MEMBER) node = node->lhs; if (node->kind == ND_VAR && node->var) node->var->is_address_used = true; } // unary = ("+" | "-" | "*" | "&" | "!" | "~") cast // | ("++" | "--") unary // | "&&" ident // | postfix static Node *unary(Token **rest, Token *tok) { if (equal(tok, "+")) return new_unary(ND_POS, cast(rest, tok->next), tok); //return cast(rest, tok->next); if (equal(tok, "-")) return new_unary(ND_NEG, cast(rest, tok->next), tok); if (equal(tok, "&")) { Node *lhs = cast(rest, tok->next); add_type(lhs); //if (lhs->kind == ND_MEMBER && lhs->member->is_bitfield) if (is_bitfield(lhs)) error_tok(tok, "%s:%d: in unary : cannot take address of bitfield", __FILE__, __LINE__); if (lhs->kind == ND_VAR && lhs->var && lhs->var->is_function) { lhs->var->is_address_used = true; } mark_var_address_taken(lhs); return new_unary(ND_ADDR, lhs, tok); } if (equal(tok, "*")) { // [https://www.sigbus.info/n1570#6.5.3.2p4] This is an oddity // in the C spec, but dereferencing a function shouldn't do // anything. If foo is a function, `*foo`, `**foo` or `*****foo` // are all equivalent to just `foo`. Node *node = cast(rest, tok->next); add_type(node); if (node->ty->kind == TY_FUNC) return node; Type *ty = node->ty; node = new_unary(ND_DEREF, node, tok); if (is_array(ty)) apply_cv_qualifier(node, ty); return node; //return new_unary(ND_DEREF, node, tok); } if (equal(tok, "!")) return new_unary(ND_NOT, to_bool(cast(rest, tok->next)), tok); //commit slimcc 2e138bb if (equal(tok, "~")) return new_unary(ND_BITNOT, cast(rest, tok->next), tok); // Read ++i as i+=1 if (equal(tok, "++")) return to_assign(new_add(unary(rest, tok->next), new_num(1, tok), tok, false)); // Read --i as i-=1 if (equal(tok, "--")) return to_assign(new_sub(unary(rest, tok->next), new_num(1, tok), tok, false)); // [GNU] labels-as-values if (equal(tok, "&&")) { Node *node = new_node(ND_LABEL_VAL, tok); node->label = get_ident(tok->next); node->goto_next = gotos; gotos = node; *rest = tok->next->next; return node; } return postfix(rest, tok); } // struct-members = (declspec declarator ("," declarator)* ";")* static void struct_members(Token **rest, Token *tok, Type *ty) { Member head = {}; Member *cur = &head; //int idx = 0; while (!equal(tok, "}")) { VarAttr attr = {}; tok = attribute_list(tok, &attr, thing_attributes); Type *basety = declspec(&tok, tok, &attr); // Attributes placed between the type and the declarator list apply to // the whole declaration (i.e. to all declarators), like GCC. tok = attribute_list(tok, &attr, thing_attributes); bool first = true; // Anonymous struct member if ((basety->kind == TY_STRUCT || basety->kind == TY_UNION) && consume(&tok, tok, ";")) { Member *mem = calloc(1, sizeof(Member)); if (mem == NULL) error("%s:%d: error: in struct_members : mem is null", __FILE__, __LINE__); mem->ty = basety; //mem->idx = idx++; mem->align = mem->ty->align; mem->attr_align = attr.align; cur = cur->next = mem; continue; } // Regular struct members while (!consume(&tok, tok, ";")) { if (!first) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } first = false; VarAttr mem_attr = attr; tok = attribute_list(tok, &mem_attr, thing_attributes); if (equal(tok, ";")) break; Member *mem = calloc(1, sizeof(Member)); if (mem == NULL) error("%s:%d: error: in struct_members : mem is null", __FILE__, __LINE__); mem->ty = declarator(&tok, tok, basety); tok = attribute_list(tok, &mem_attr, thing_attributes); mem->name = mem->ty->name; //mem->idx = idx++; mem->align = mem->ty->align; if (consume(&tok, tok, ":")) { if (!is_integer(mem->ty)) { error_tok(tok, "%s:%d: in struct_members : only integers can be bitfields", __FILE__, __LINE__); } mem->is_bitfield = true; mem->bit_width = const_expr(&tok, tok); if (mem->bit_width < 0) { error_tok(tok, "%s:%d: in struct_members : bitfield width must be positive", __FILE__, __LINE__); } // Attributes can appear after the bitfield width (e.g. `int : 4 __attribute__((aligned(2)))`). tok = attribute_list(tok, &mem_attr, thing_attributes); } mem->attr_align = mem_attr.align; cur = cur->next = mem; } } // If the last element is an array of incomplete type, it's // called a "flexible array member". It should behave as if // if were a zero-sized array. if (cur != &head && cur->ty->kind == TY_ARRAY && cur->ty->array_len < 0) { cur->ty = array_of(cur->ty->base, 0); ty->is_flexible = true; cur->ty->is_flexible = true; } //Check for VLA-containing members for (Member *mem = head.next; mem; mem = mem->next) { if (mem->ty->has_vla) { ty->has_vla = true; break; } } *rest = tok->next; ty->members = head.next; } //from COSMOPOLITAN adding attribute management static Token *attribute_list(Token *tok, void *arg, Token *(*f)(Token *, void *)) { while (consume(&tok, tok, "__attribute__") || consume(&tok, tok, "__attribute")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); SET_CTX(ctx); tok = skip(tok, "(", ctx); bool first = true; while (!consume(&tok, tok, ")")) { if (!first) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } first = false; tok = f(tok, arg); } SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } // attribute = ("__attribute__" "(" "(" "packed" ")" ")")* static Token *type_attributes(Token *tok, void *arg) { Type *ty = arg; if (!ty) { warn_tok(tok, "in type_attributes: %s:%d: ty is null", __FILE__, __LINE__); return tok; } if (consume(&tok, tok, "packed") || consume(&tok, tok, "__packed__")) { ty->is_packed = true; return tok; } if (consume(&tok, tok, "aligned") || consume(&tok, tok, "__aligned__")) { ty->is_aligned = true; int align = 16; if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); //from COSMOPOLITAN adding is_aligned align = const_expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); } // GCC/Clang: aligned(N) must not reduce alignment, except vector // types where __attribute__((aligned(N))) can override vector_size. if (ty->kind == TY_VECTOR || ty->is_vector) ty->align = align; else ty->align = MAX(ty->align, align); return tok; } //from COSMOPOLITAN adding ms_abi if (consume(&tok, tok, "ms_abi") || consume(&tok, tok, "__ms_abi__")) { ty->is_ms_abi = true; return tok; } if (consume(&tok, tok, "constructor") || consume(&tok, tok, "__constructor__")) { ty->is_constructor = true; ty->constructor_priority = 65535; // Default GCC priority if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(",ctx); // Parse the priority integer constant if present if (tok->kind == TK_NUM) { ty->constructor_priority = tok->val; tok = tok->next; } else { warn_tok(tok, "in type_attributes: %s:%d: expected integer priority in constructor attribute", __FILE__, __LINE__); } SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } // if (consume(&tok, tok, "destructor") || consume(&tok, tok, "__destructor__")) { // ty->is_destructor = true; // return tok; // } if (consume(&tok, tok, "destructor") || consume(&tok, tok, "__destructor__")) { ty->is_destructor = true; ty->destructor_priority = 65535; // Default GCC priority if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(",ctx); // Parse the priority integer constant if present if (tok->kind == TK_NUM) { ty->destructor_priority = tok->val; tok = tok->next; } else { warn_tok(tok, "in type_attributes: %s:%d: expected integer priority in destructor attribute", __FILE__, __LINE__); } SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } if (consume(&tok, tok, "vector_size") || consume(&tok, tok, "__vector_size__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); int vs = const_expr(&tok, tok); if (vs != 2 && vs != 4 && vs != 8 && vs != 16 && vs != 32 && vs != 64) { error_tok(tok, "%s:%d: unsupported vector_size %d; only 2, 4, 8, 16, 32 and 64 are supported", __FILE__, __LINE__, vs); } if (vs != ty->vector_size) { //ty->size = vs; ty->vector_size = vs; if (!ty->is_aligned) ty->align = vs; } int base_size = ty->size; if (base_size == 0) { error_tok(tok, "%s:%d: in types_attributes: incorrect base size %d;", __FILE__, __LINE__, base_size); } int n = vs / base_size; ty->is_vector = true; ty = vector_of(ty, n); SET_CTX(ctx); tok = skip(tok, ")", ctx); return tok; } //from COSMOPOLITAN adding warn_if_not_aligned if (consume(&tok, tok, "warn_if_not_aligned") || consume(&tok, tok, "__warn_if_not_aligned__") ) { SET_CTX(ctx); tok = skip(tok, "(", ctx); const_expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); return tok; } if (equal(tok->next, "(") && (consume(&tok, tok, "__deprecated__") || consume(&tok, tok, "deprecated"))) { SET_CTX(ctx); tok = skip(tok, "(", ctx); ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "__target__") || consume(&tok, tok, "target")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "section") || consume(&tok, tok, "__section__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); ty->section = ConsumeStringLiteral(&tok, tok); current_section = ty->section; SET_CTX(ctx); return skip(tok, ")", ctx); } //from COSMOPOLITAN adding deprecated, may_alias, unused if (consume(&tok, tok, "deprecated") || consume(&tok, tok, "__deprecated__") || consume(&tok, tok, "may_alias") || consume(&tok, tok, "__may_alias__") || consume(&tok, tok, "__transparent_union__") || consume(&tok, tok, "transparent_union")) { return tok; } // Handle __cleanup__ attribute if (consume(&tok, tok, "cleanup") || consume(&tok, tok, "__cleanup__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); if (tok->kind != TK_IDENT) error_tok(tok, "%s:%d: in type_attributes: expected identifier in __cleanup__", __FILE__, __LINE__); // Store the cleanup function name current_type = copy_type(ty); tok = tok->next; SET_CTX(ctx); tok = skip(tok, ")", ctx); return tok; } if (consume(&tok, tok, "cold") || consume(&tok, tok, "__cold__")) { return tok; } if (consume(&tok, tok, "hot") || consume(&tok, tok, "__hot__")) { return tok; } if (consume(&tok, tok, "malloc") || consume(&tok, tok, "__malloc__")) { // Check for optional parameters: e.g., __malloc__(rpl_free, 1) if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); // Parse the deallocator function name (e.g., rpl_free) if (tok->kind != TK_IDENT) error_tok(tok, "%s:%d: expected identifier in __malloc__ attribute", __FILE__, __LINE__); tok = tok->next; // Optionally consume comma and size argument if (equal(tok, ",")) { tok = tok->next; const_expr(&tok, tok); // size index (e.g., 1) } SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } if (consume(&tok, tok, "null_terminated_string_arg")) { // GCC syntax: __attribute__((null_terminated_string_arg(index))) if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); const_expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } if (consume(&tok, tok, "noinline") || consume(&tok, tok, "__noinline__") || consume(&tok, tok, "noclone") || consume(&tok, tok, "__noclone__") || consume(&tok, tok, "const") || consume(&tok, tok, "__const__") || consume(&tok, tok, "pure") || consume(&tok, tok, "__pure__") || consume(&tok, tok, "dontclone") || consume(&tok, tok, "__dontclone__") || consume(&tok, tok, "may_alias") || consume(&tok, tok, "__may_alias__") || consume(&tok, tok, "warn_unused_result") || consume(&tok, tok, "__warn_unused_result__") || consume(&tok, tok, "flatten") || consume(&tok, tok, "__flatten__") || consume(&tok, tok, "leaf") || consume(&tok, tok, "__leaf__") || consume(&tok, tok, "no_reorder") || consume(&tok, tok, "__no_reorder__") || consume(&tok, tok, "dontthrow") || consume(&tok, tok, "__dontthrow__") || consume(&tok, tok, "optnone") || consume(&tok, tok, "__optnone__") || consume(&tok, tok, "returns_twice") || consume(&tok, tok, "__returns_twice__") || consume(&tok, tok, "nodebug") || consume(&tok, tok, "__nodebug__") || consume(&tok, tok, "artificial") || consume(&tok, tok, "__artificial__") || consume(&tok, tok, "returns_nonnull") || consume(&tok, tok, "__returns_nonnull__") || consume(&tok, tok, "deprecated") || consume(&tok, tok, "__deprecated__") || consume(&tok, tok, "__transparent_union__") || consume(&tok, tok, "transparent_union") || consume(&tok, tok, "gnu_inline") || consume(&tok, tok, "__gnu_inline__") || consume(&tok, tok, "used") || consume(&tok, tok, "__used__") || consume(&tok, tok, "unused") || consume(&tok, tok, "__unused__") || consume(&tok, tok, "no_icf") || consume(&tok, tok, "__no_icf__") || consume(&tok, tok, "noipa") || consume(&tok, tok, "__noipa__") || consume(&tok, tok, "noplt") || consume(&tok, tok, "__noplt__") || consume(&tok, tok, "stack_protect") || consume(&tok, tok, "__stack_protect__") || consume(&tok, tok, "no_sanitize_address") || consume(&tok, tok, "__no_sanitize_address__") || consume(&tok, tok, "no_sanitize_thread") || consume(&tok, tok, "__no_sanitize_thread__") || consume(&tok, tok, "no_split_stack") || consume(&tok, tok, "__no_split_stack__") || consume(&tok, tok, "no_stack_limit") || consume(&tok, tok, "__no_stack_limit__") || consume(&tok, tok, "no_sanitize_undefined") || consume(&tok, tok, "__no_sanitize_undefined__") || consume(&tok, tok, "__nonstring__") || consume(&tok, tok, "nonstring") || consume(&tok, tok, "no_profile_instrument_function") || consume(&tok, tok, "stdcall") || consume(&tok, tok, "ms_struct") || consume(&tok, tok, "__stub__") || consume(&tok, tok, "__retain__") || consume(&tok, tok, "transaction_pure") || consume(&tok, tok, "transaction_may_cancel_outer") || consume(&tok, tok, "transaction_callable") || consume(&tok, tok, "tainted_args") || consume(&tok, tok, "__designated_init__") || consume(&tok, tok, "__flag_enum__") || consume(&tok, tok, "__no_profile_instrument_function__")) { return tok; } //fallthrough is the last instruction in case: followed by a semicolon if (consume(&tok, tok, "fallthrough") || consume(&tok, tok, "__fallthrough__") ) { return tok; } if (consume(&tok, tok, "__diagnose_if__") || consume(&tok, tok, "diagnose_if") || consume(&tok, tok, "__no_sanitize__") || consume(&tok, tok, "no_sanitize")) { tok = skip(tok, "(", ctx); int depth = 1; while (depth > 0) { if (equal(tok, "(")) depth++; else if (equal(tok, ")")) depth--; tok = tok->next; } return tok; } if (consume(&tok, tok, "format") || consume(&tok, tok, "__format__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); consume(&tok, tok, "printf") ; consume(&tok, tok, "__printf__"); consume(&tok, tok, "scanf"); consume(&tok, tok, "__scanf__"); consume(&tok, tok, "strftime"); consume(&tok, tok, "__strftime__"); consume(&tok, tok, "strfmon"); consume(&tok, tok, "__strfmon__"); consume(&tok, tok, "gnu_printf"); consume(&tok, tok, "__gnu_printf__"); consume(&tok, tok, "gnu_scanf"); consume(&tok, tok, "__gnu_scanf__"); consume(&tok, tok, "gnu_strftime"); consume(&tok, tok, "__gnu_strftime__"); SET_CTX(ctx); tok = skip(tok, ",", ctx); const_expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); const_expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); return tok; } if (consume(&tok, tok, "format_arg") || consume(&tok, tok, "__format_arg__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); const_expr(&tok, tok); SET_CTX(ctx); tok =skip(tok, ")", ctx); return tok; } if (consume(&tok, tok, "mode") || consume(&tok, tok, "__mode__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); if (consume(&tok, tok, "__QI__") || consume(&tok, tok, "__HI__") || consume(&tok, tok, "__SI__") || consume(&tok, tok, "__DI__") || consume(&tok, tok, "__TI__") || consume(&tok, tok, "__SF__") || consume(&tok, tok, "__DF__") || consume(&tok, tok, "__XF__") || consume(&tok, tok, "__TF__") || consume(&tok, tok, "__SQ__") || consume(&tok, tok, "__HQ__") || consume(&tok, tok, "__SA__") || consume(&tok, tok, "__DA__") || consume(&tok, tok, "__TQ__") || consume(&tok, tok, "__V2SI__") || consume(&tok, tok, "__V4SI__") || consume(&tok, tok, "__V8HI__") || consume(&tok, tok, "__V16QI__") || consume(&tok, tok, "__word__") || consume(&tok, tok, "__pointer__") || consume(&tok, tok, "__CQI__") || consume(&tok, tok, "__CHI__") || consume(&tok, tok, "__CDF__") || consume(&tok, tok, "__TC__") ||consume(&tok, tok, "__BI__")) { SET_CTX(ctx); return skip(tok, ")", ctx); } SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "nothrow") || consume(&tok, tok, "__nothrow__")) { return tok; } if (consume(&tok, tok, "noreturn") || consume(&tok, tok, "__noreturn__")) { return tok; } if (consume(&tok, tok, "__noescape__") || consume(&tok, tok, "noescape")) { return tok; } if (consume(&tok, tok, "__common__")) { return tok; } if (consume(&tok, tok, "const") || consume(&tok, tok, "__const__")) { ty->is_const = true; return tok; } if (consume(&tok, tok, "always_inline") || consume(&tok, tok, "__always_inline__")) { ty->is_inline = true; return tok; } if (consume(&tok, tok, "__min_vector_width__")) { ty->min_vector_width = const_expr(&tok, tok); return tok; } if (consume(&tok, tok, "nonnull") || consume(&tok, tok, "__nonnull__")) { if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(",ctx); while (!equal(tok, ")")) { if (tok->kind != TK_NUM) { error_tok(tok, "%s:%d: expected parameter index in __nonnull__", __FILE__, __LINE__); } tok = tok->next; if (equal(tok, ",")) tok = tok->next; else break; } SET_CTX(ctx); tok = skip(tok, ")",ctx); } return tok; } if (consume(&tok, tok, "enum_extensibility") || consume(&tok, tok, "__enum_extensibility__")) { tok = skip(tok, "(", ctx); if (consume(&tok, tok, "open")) { // } else if (consume(&tok, tok, "closed")) { // } tok = skip(tok, ")", ctx); return tok; } if (consume(&tok, tok, "sentinel") || consume(&tok, tok, "__sentinel__") || consume(&tok, tok, "optimize") || consume(&tok, tok, "__optimize__") || consume(&tok, tok, "assume_aligned") || consume(&tok, tok, "__assume_aligned__") || consume(&tok, tok, "alloc_size") || consume(&tok, tok, "__alloc_size__") || consume(&tok, tok, "attribute_alloc_size") || consume(&tok, tok, "__attribute_alloc_size__") || consume(&tok, tok, "alloc_align") || consume(&tok, tok, "__alloc_align__")) { if (consume(&tok, tok, "(")) { for (;;) { const_expr(&tok, tok); if (consume(&tok, tok, ")")) break; SET_CTX(ctx); tok = skip(tok, ",", ctx); } } return tok; } if (consume(&tok, tok, "error") || consume(&tok, tok, "__error__") || consume(&tok, tok, "warning") || consume(&tok, tok, "__warning__") || consume(&tok, tok, "__access__") ) { bool two_parent= false; SET_CTX(ctx); tok = skip(tok, "(", ctx); if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); two_parent = true; } ConsumeStringLiteral(&tok, tok); if (two_parent) { SET_CTX(ctx); tok = skip(tok, ")", ctx); } SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "no_sanitize")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "weak") || consume(&tok, tok, "__weak__")) { //int __attribute__((weak, alias("lxc_attach_main"))) main(int argc, char *argv[]); ty->is_weak = true; consume(&tok, tok, ","); if (consume(&tok, tok, "alias")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); ty->alias_name = ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } if (consume(&tok, tok, "__weakref__")) { ty->is_weak = true; SET_CTX(ctx); tok = skip(tok, "(", ctx); ty->alias_name = ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); return tok; } if (consume(&tok, tok, "alias")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); ty->alias_name = ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); return tok; } if (consume(&tok, tok, "visibility") || consume(&tok, tok, "__visibility__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); ty->visibility = ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } return tok; } //from COSMOPOLITAN adding attribute for variable static Token *thing_attributes(Token *tok, void *arg) { VarAttr *attr = arg; if (!attr) { warn_tok(tok, "in thing_attributes: %s:%d: attr is null", __FILE__, __LINE__); return tok; } if (consume(&tok, tok, "packed") || consume(&tok, tok, "__packed__")) { attr->is_packed = true; return tok; } if (consume(&tok, tok, "weak") || consume(&tok, tok, "__weak__")) { //int __attribute__((weak, alias("lxc_attach_main"))) main(int argc, char *argv[]); attr->is_weak = true; consume(&tok, tok, ","); if (consume(&tok, tok, "alias")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); attr->alias_name = ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } if (consume(&tok, tok, "__weakref__")) { attr->is_weak = true; SET_CTX(ctx); tok = skip(tok, "(", ctx); attr->alias_name = ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); return tok; } if (consume(&tok, tok, "alias")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); attr->alias_name = ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); return tok; } if (consume(&tok, tok, "hot") || consume(&tok, tok, "__hot__")) { attr->section = ".text.likely"; return tok; } if (consume(&tok, tok, "cold") || consume(&tok, tok, "__cold__")) { attr->section = ".text.unlikely"; return tok; } if (consume(&tok, tok, "__target__") || consume(&tok, tok, "target")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "section") || consume(&tok, tok, "__section__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); attr->section = ConsumeStringLiteral(&tok, tok); current_section = attr->section; SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "noreturn") || consume(&tok, tok, "__noreturn__")) { attr->is_noreturn = true; return tok; } if (consume(&tok, tok, "__noescape__") || consume(&tok, tok, "noescape")) { return tok; } if (consume(&tok, tok, "__common__")) { return tok; } if (consume(&tok, tok, "nothrow") || consume(&tok, tok, "__nothrow__")) { return tok; } if (consume(&tok, tok, "always_inline") || consume(&tok, tok, "__always_inline__")) { attr->is_inline = true; return tok; } if (consume(&tok, tok, "__min_vector_width__")) { attr->min_vector_width = const_expr(&tok, tok); return tok; } if (consume(&tok, tok, "const") || consume(&tok, tok, "__const__")) { return tok; } if (consume(&tok, tok, "visibility") || consume(&tok, tok, "__visibility__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); attr->visibility = ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "externally_visible") || consume(&tok, tok, "__externally_visible__")) { attr->is_externally_visible = true; return tok; } if (consume(&tok, tok, "no_instrument_function") || consume(&tok, tok, "__no_instrument_function__")) { attr->is_no_instrument_function = true; return tok; } if (consume(&tok, tok, "force_align_arg_pointer") || consume(&tok, tok, "__force_align_arg_pointer__")) { attr->is_force_align_arg_pointer = true; return tok; } if (consume(&tok, tok, "no_caller_saved_registers") || consume(&tok, tok, "__no_caller_saved_registers__")) { attr->is_no_caller_saved_registers = true; return tok; } if (consume(&tok, tok, "ms_abi")) { attr->is_ms_abi = true; return tok; } if (consume(&tok, tok, "constructor") || consume(&tok, tok, "__constructor__")) { attr->is_constructor = true; attr->constructor_priority = 65535; // Default GCC priority if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(",ctx); // Parse the priority integer constant if present if (tok->kind == TK_NUM) { attr->constructor_priority = tok->val; tok = tok->next; } else { warn_tok(tok, "in thing_attributes: %s:%d: expected integer priority in constructor attribute", __FILE__, __LINE__); } SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } if (consume(&tok, tok, "destructor") || consume(&tok, tok, "__destructor__")) { attr->is_destructor = true; attr->destructor_priority = 65535; // Default GCC priority if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(",ctx); // Parse the priority integer constant if present if (tok->kind == TK_NUM) { attr->destructor_priority = tok->val; tok = tok->next; } else { warn_tok(tok, "in thing_attributes: %s:%d: expected integer priority in destructor attribute", __FILE__, __LINE__); } SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } if (consume(&tok, tok, "aligned") || consume(&tok, tok, "__aligned__")) { attr->is_aligned = true; if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); //from COSMOPOLITAN adding is_aligned attr->align = const_expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); } else { attr->align = 16; } return tok; } if (consume(&tok, tok, "warn_if_not_aligned") || consume(&tok, tok, "__warn_if_not_aligned__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); const_expr(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "error") || consume(&tok, tok, "__error__") || consume(&tok, tok, "warning") || consume(&tok, tok, "__warning__") || consume(&tok, tok, "__access__") ) { bool two_parent= false; SET_CTX(ctx); tok = skip(tok, "(", ctx); if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); two_parent = true; } ConsumeStringLiteral(&tok, tok); if (two_parent) { SET_CTX(ctx); tok = skip(tok, ")", ctx); } SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "mode") || consume(&tok, tok, "__mode__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); if (consume(&tok, tok, "__QI__") || consume(&tok, tok, "__HI__") || consume(&tok, tok, "__SI__") || consume(&tok, tok, "__DI__") || consume(&tok, tok, "__TI__") || consume(&tok, tok, "__SF__") || consume(&tok, tok, "__DF__") || consume(&tok, tok, "__XF__") || consume(&tok, tok, "__TF__") || consume(&tok, tok, "__SQ__") || consume(&tok, tok, "__HQ__") || consume(&tok, tok, "__SA__") || consume(&tok, tok, "__DA__") || consume(&tok, tok, "__TQ__") || consume(&tok, tok, "__V2SI__") || consume(&tok, tok, "__V4SI__") || consume(&tok, tok, "__V8HI__") || consume(&tok, tok, "__V16QI__") || consume(&tok, tok, "__word__") || consume(&tok, tok, "__pointer__") || consume(&tok, tok, "__CQI__") || consume(&tok, tok, "__CHI__") || consume(&tok, tok, "__CDF__") || consume(&tok, tok, "__TC__") || consume(&tok, tok, "__BI__")) { SET_CTX(ctx); return skip(tok, ")", ctx); } SET_CTX(ctx); return skip(tok, ")", ctx); } if (equal(tok->next, "(") && (consume(&tok, tok, "__deprecated__") || consume(&tok, tok, "deprecated"))) { SET_CTX(ctx); tok = skip(tok, "(", ctx); ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } // Handle __cleanup__ attribute if (consume(&tok, tok, "cleanup") || consume(&tok, tok, "__cleanup__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); if (tok->kind != TK_IDENT) error_tok(tok, "%s:%d: expected identifier in __cleanup__", __FILE__, __LINE__); // Store the cleanup function name current_attr = attr; tok = tok->next; SET_CTX(ctx); tok = skip(tok, ")", ctx); return tok; } if (consume(&tok, tok, "malloc") || consume(&tok, tok, "__malloc__")) { if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); if (tok->kind != TK_IDENT) error_tok(tok, "%s:%d: expected identifier in __malloc__ attribute", __FILE__, __LINE__); tok = tok->next; if (equal(tok, ",")) { tok = tok->next; const_expr(&tok, tok); } SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } if (consume(&tok, tok, "null_terminated_string_arg")) { if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); const_expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); } return tok; } if (consume(&tok, tok, "noinline") || consume(&tok, tok, "__noinline__") || consume(&tok, tok, "noclone") || consume(&tok, tok, "__noclone__") || consume(&tok, tok, "const") || consume(&tok, tok, "__const__") || consume(&tok, tok, "pure") || consume(&tok, tok, "__pure__") || consume(&tok, tok, "dontclone") || consume(&tok, tok, "__dontclone__") || consume(&tok, tok, "may_alias") || consume(&tok, tok, "__may_alias__") || consume(&tok, tok, "warn_unused_result") || consume(&tok, tok, "__warn_unused_result__") || consume(&tok, tok, "flatten") || consume(&tok, tok, "__flatten__") || consume(&tok, tok, "leaf") || consume(&tok, tok, "__leaf__") || consume(&tok, tok, "no_reorder") || consume(&tok, tok, "__no_reorder__") || consume(&tok, tok, "dontthrow") || consume(&tok, tok, "__dontthrow__") || consume(&tok, tok, "optnone") || consume(&tok, tok, "__optnone__") || consume(&tok, tok, "returns_twice") || consume(&tok, tok, "__returns_twice__") || consume(&tok, tok, "nodebug") || consume(&tok, tok, "__nodebug__") || consume(&tok, tok, "artificial") || consume(&tok, tok, "__artificial__") || consume(&tok, tok, "returns_nonnull") || consume(&tok, tok, "__returns_nonnull__") || consume(&tok, tok, "deprecated") || consume(&tok, tok, "__deprecated__") || consume(&tok, tok, "__transparent_union__") || consume(&tok, tok, "transparent_union") || consume(&tok, tok, "gnu_inline") || consume(&tok, tok, "__gnu_inline__") || consume(&tok, tok, "used") || consume(&tok, tok, "__used__") || consume(&tok, tok, "unused") || consume(&tok, tok, "__unused__") || consume(&tok, tok, "no_icf") || consume(&tok, tok, "__no_icf__") || consume(&tok, tok, "noipa") || consume(&tok, tok, "__noipa__") || consume(&tok, tok, "noplt") || consume(&tok, tok, "__noplt__") || consume(&tok, tok, "stack_protect") || consume(&tok, tok, "__stack_protect__") || consume(&tok, tok, "no_sanitize_address") || consume(&tok, tok, "__no_sanitize_address__") || consume(&tok, tok, "no_sanitize_thread") || consume(&tok, tok, "__no_sanitize_thread__") || consume(&tok, tok, "no_split_stack") || consume(&tok, tok, "__no_split_stack__") || consume(&tok, tok, "no_stack_limit") || consume(&tok, tok, "__no_stack_limit__") || consume(&tok, tok, "no_sanitize_undefined") || consume(&tok, tok, "__no_sanitize_undefined__") || consume(&tok, tok, "__nonstring__") || consume(&tok, tok, "nonstring") || consume(&tok, tok, "no_profile_instrument_function") || consume(&tok, tok, "stdcall") || consume(&tok, tok, "__stub__") || consume(&tok, tok, "__retain__") || consume(&tok, tok, "transaction_pure") || consume(&tok, tok, "transaction_may_cancel_outer") || consume(&tok, tok, "transaction_callable") || consume(&tok, tok, "tainted_args") || consume(&tok, tok, "__designated_init__") || consume(&tok, tok, "__flag_enum__") || consume(&tok, tok, "__no_profile_instrument_function__")) { return tok; } if (consume(&tok, tok, "always_inline") || consume(&tok, tok, "__always_inline__")) { attr->is_inline = true; return tok; } //fallthrough is the last instruction in case: followed by a semicolon if (consume(&tok, tok, "fallthrough") || consume(&tok, tok, "__fallthrough__") ) { return tok; } if (consume(&tok, tok, "__diagnose_if__") || consume(&tok, tok, "diagnose_if") || consume(&tok, tok, "__no_sanitize__") || consume(&tok, tok, "no_sanitize")) { tok = skip(tok, "(", ctx); int depth = 1; while (depth > 0) { if (equal(tok, "(")) depth++; else if (equal(tok, ")")) depth--; tok = tok->next; } return tok; } if (consume(&tok, tok, "nonnull") || consume(&tok, tok, "__nonnull__")) { if (equal(tok, "(")) { SET_CTX(ctx); tok = skip(tok, "(",ctx); while (!equal(tok, ")")) { if (tok->kind != TK_NUM) { error_tok(tok, "%s:%d: expected parameter index in __nonnull__", __FILE__, __LINE__); } tok = tok->next; if (equal(tok, ",")) tok = tok->next; else break; } SET_CTX(ctx); tok = skip(tok, ")",ctx); } return tok; } if (consume(&tok, tok, "enum_extensibility") || consume(&tok, tok, "__enum_extensibility__")) { tok = skip(tok, "(", ctx); if (consume(&tok, tok, "open")) { // } else if (consume(&tok, tok, "closed")) { // } tok = skip(tok, ")", ctx); return tok; } if (consume(&tok, tok, "sentinel") || consume(&tok, tok, "__sentinel__") || consume(&tok, tok, "optimize") || consume(&tok, tok, "__optimize__") || consume(&tok, tok, "assume_aligned") || consume(&tok, tok, "__assume_aligned__") || consume(&tok, tok, "alloc_size") || consume(&tok, tok, "__alloc_size__") || consume(&tok, tok, "attribute_alloc_size") || consume(&tok, tok, "__attribute_alloc_size__") || consume(&tok, tok, "alloc_align") || consume(&tok, tok, "__alloc_align__")) { if (consume(&tok, tok, "(")) { for (;;) { const_expr(&tok, tok); if (consume(&tok, tok, ")")) break; SET_CTX(ctx); tok = skip(tok, ",", ctx); } } return tok; } if (consume(&tok, tok, "format") || consume(&tok, tok, "__format__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); consume(&tok, tok, "printf"); consume(&tok, tok, "__printf__"); consume(&tok, tok, "scanf"); consume(&tok, tok, "__scanf__"); consume(&tok, tok, "strftime"); consume(&tok, tok, "__strftime__"); consume(&tok, tok, "strfmon"); consume(&tok, tok, "__strfmon__"); consume(&tok, tok, "gnu_printf"); consume(&tok, tok, "__gnu_printf__"); consume(&tok, tok, "gnu_scanf"); consume(&tok, tok, "__gnu_scanf__"); consume(&tok, tok, "gnu_strftime"); consume(&tok, tok, "__gnu_strftime__"); SET_CTX(ctx); tok = skip(tok, ",", ctx); const_expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); const_expr(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "format_arg") || consume(&tok, tok, "__format_arg__")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); const_expr(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } if (consume(&tok, tok, "no_sanitize")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); return skip(tok, ")", ctx); } return tok; } bool equal_tok(Token *a, Token *b) { return a->len == b->len && !memcmp(a->loc, b->loc, b->len); } // struct-union-decl = attribute? ident? ("{" struct-members)? static Type *struct_union_decl(Token **rest, Token *tok, bool *no_list) { Type *ty = struct_type(); ty->size = -1; tok = attribute_list(tok, ty, type_attributes); // Read a tag. Token *tag = NULL; if (tok->kind == TK_IDENT) { tag = tok; ty->name = tag; ty->tag_name = tag; tok = tok->next; } if (tag && !equal(tok, "{")) { *rest = tok; *no_list = true; Type *ty2 = find_tag(tag); if (ty2) return ty2; ty->size = -1; push_tag_scope(tag, ty); if (!ty) error_tok(tok, "%s:%d: in struct_union_decl : ty is null!", __FILE__, __LINE__); return ty; } SET_CTX(ctx); tok = skip(tok, "{", ctx); // Construct a struct object. struct_members(&tok, tok, ty); *rest = attribute_list(tok, ty, type_attributes); if (tag) { // If this is a redefinition, overwrite a previous type. // Otherwise, register the struct type. Type *ty2 = hashmap_get2(&scope->tags, tag->loc, tag->len); if (ty2) { for (Type *t = ty2; t; t = t->decl_next) { t->size = ty->size; t->align = MAX(t->align, ty->align); t->members = ty->members; t->is_flexible = ty->is_flexible; t->is_packed = ty->is_packed; t->tag_name = ty->tag_name; } return ty2; } ty->tag = tag; push_tag_scope(tag, ty); } if (!ty) error_tok(tok, "%s:%d: in struct_union_decl : ty is null!", __FILE__, __LINE__); return ty; } // struct-decl = struct-union-decl static Type *struct_decl(Token **rest, Token *tok) { bool no_list = false; Type *ty = struct_union_decl(rest, tok, &no_list); tok = attribute_list(tok, ty, type_attributes); ty->kind = TY_STRUCT; if (no_list) return ty; int pack_align = ty->is_packed ? 1 : tok->pack_align; //ty->size = MAX(ty->size, 0); // Assign offsets within the struct to members. int bits = 0; Member head = {0}; Member *cur = &head; for (Member *mem = ty->members; mem; mem = mem->next) { int mem_align = mem->align; if (pack_align > 0) mem_align = MIN(mem_align, pack_align); if (mem->attr_align) mem_align = MAX(mem_align, mem->attr_align); if (mem->is_bitfield && mem->bit_width == 0) { // Zero-width anonymous bitfield has a special meaning. // It affects only alignment. bits = align_to(bits, mem_align * 8); } else if (mem->is_bitfield) { if (mem->attr_align) bits = align_to(bits, mem_align * 8); int sz = mem->ty->size; if (bits / (sz * 8) != (bits + mem->bit_width - 1) / (sz * 8)) bits = align_to(bits, sz * 8); mem->offset = align_down(bits / 8, sz); mem->bit_offset = bits % (sz * 8); bits += mem->bit_width; } else { bits = align_to(bits, mem_align * 8); mem->offset = bits / 8; bits += mem->ty->size * 8; } if (!mem->name && mem->is_bitfield ) { cur->next = NULL; continue; } //from COSMOPOLITAN adding is_aligned if (ty->align < mem_align) ty->align = mem_align; cur = cur->next = mem; } ty->members = head.next; ty->size = align_to(bits, ty->align * 8) / 8; for (Type *t = ty->decl_next; t; t = t->decl_next) { t->size = ty->size; t->align = ty->align; t->is_packed = ty->is_packed; t->members = ty->members; } if (!ty) error_tok(tok, "%s:%d: in struct_decl : ty is null!", __FILE__, __LINE__); return ty; } // union-decl = struct-union-decl static Type *union_decl(Token **rest, Token *tok) { bool no_list = false; Type *ty = struct_union_decl(rest, tok, &no_list); tok = attribute_list(tok, ty, type_attributes); ty->kind = TY_UNION; if (no_list) return ty; int pack_align = ty->is_packed ? 1 : tok->pack_align; Member head = {0}; Member *cur = &head; for (Member *mem = ty->members; mem; mem = mem->next) { int mem_align = mem->align; if (pack_align > 0) mem_align = MIN(mem_align, pack_align); if (mem->attr_align) mem_align = MAX(mem_align, mem->attr_align); int sz; if (mem->is_bitfield) sz = align_to(mem->bit_width, 8) / 8; else sz = mem->ty->size; ty->size = MAX(ty->size, sz); if (!mem->name && mem->is_bitfield) { cur->next = NULL; continue; } if (ty->align < mem_align) ty->align = mem_align; cur = cur->next = mem; } ty->members = head.next; ty->size = align_to(ty->size, ty->align); for (Type *t = ty->decl_next; t; t = t->decl_next) { t->size = ty->size; t->align = ty->align; t->is_packed = ty->is_packed; t->members = ty->members; } if (!ty) error_tok(tok, "%s:%d: in union_decl : ty is null!", __FILE__, __LINE__); return ty; } // Find a struct member by name. static Member *get_struct_member(Type *ty, Token *tok) { for (Member *mem = ty->members; mem; mem = mem->next) { // Anonymous struct member if (!mem->name) { //if (mem->ty->kind == TY_STRUCT || mem->ty->kind == TY_UNION) if (get_struct_member(mem->ty, tok)) return mem; continue; } // Regular struct member if (mem->name->len == tok->len && !strncmp(mem->name->loc, tok->loc, tok->len)) return mem; } return NULL; } // Create a node representing a struct member access, such as foo.bar // where foo is a struct and bar is a member name. // // C has a feature called "anonymous struct" which allows a struct to // have another unnamed struct as a member like this: // // struct { struct { int a; }; int b; } x; // // The members of an anonymous struct belong to the outer struct's // member namespace. Therefore, in the above example, you can access // member "a" of the anonymous struct as "x.a". // // This function takes care of anonymous structs. static Node *struct_ref(Node *node, Token *tok) { add_type(node); if (node->ty->kind != TY_STRUCT && node->ty->kind != TY_UNION) error_tok(node->tok, "%s:%d: in struct_ref : not a struct nor a union", __FILE__, __LINE__); Type *ty = node->ty; for (;;) { Member *mem = get_struct_member(ty, tok); if (!mem) error_tok(tok, "%s:%d: in struct_ref : no such member", __FILE__, __LINE__); node = new_unary(ND_MEMBER, node, tok); node->member = mem; if (mem->name) break; ty = mem->ty; } return node; } static void chain_expr(Node **lhs, Node *rhs) { if (rhs) *lhs = !*lhs ? rhs : new_binary(ND_COMMA, *lhs, rhs, rhs->tok); } // Convert A++ to `(typeof A)((A += 1) - 1)` // static Node *new_inc_dec(Node *node, Token *tok, int addend) // { // add_type(node); // return new_cast(new_add(to_assign(new_add(node, new_num(addend, tok), tok, false)), // new_num(-addend, tok), tok, false), // node->ty); // } static Node *new_inc_dec(Node *node, Token *tok, int addend) { add_type(node); if (!current_fn) { return new_cast(new_add(to_assign(new_add(node, new_num(addend, tok), tok, false)), new_num(-addend, tok), tok, false), node->ty); } // -O1+: for simple variable postfix inc/dec, avoid hidden pointer temp. // `_Bool` is special: `(b += 1) - 1` does not preserve old value semantics. if (opt_optimize_level1 && !node->ty->is_atomic && node->ty->kind != TY_BOOL && is_safe_lvalue(node)) { return new_cast(new_add(to_assign(new_add(node, new_num(addend, tok), tok, false)), new_num(-addend, tok), tok, false), node->ty); } enter_scope(); if (is_bitfield(node)) { Obj *tmp = new_lvar("", node->ty, NULL); Obj *ptr = new_lvar("", pointer_to(node->lhs->ty), NULL); Node *expr = new_binary(ND_ASSIGN, new_var_node(ptr, tok), new_unary(ND_ADDR, node->lhs, tok), tok); Node *memref1 = new_unary(ND_MEMBER, new_unary(ND_DEREF, new_var_node(ptr, tok), tok), tok); memref1->member = node->member; Node *memref2 = new_unary(ND_MEMBER, new_unary(ND_DEREF, new_var_node(ptr, tok), tok), tok); memref2->member = node->member; chain_expr(&expr, new_binary(ND_ASSIGN, new_var_node(tmp, tok), memref1, tok)); chain_expr(&expr, to_assign(new_add(memref2, new_num(addend, tok), tok, false))); chain_expr(&expr, new_var_node(tmp, tok)); leave_scope(); return expr; } Obj *tmp = new_lvar("", node->ty, NULL); Obj *ptr = new_lvar("", pointer_to(node->ty), NULL); Node *expr = new_binary(ND_ASSIGN, new_var_node(ptr, tok), new_unary(ND_ADDR, node, tok), tok); chain_expr(&expr, new_binary(ND_ASSIGN, new_var_node(tmp, tok), new_unary(ND_DEREF, new_var_node(ptr, tok), tok), tok)); chain_expr(&expr, to_assign(new_add(new_unary(ND_DEREF, new_var_node(ptr, tok), tok), new_num(addend, tok), tok, false))); chain_expr(&expr, new_var_node(tmp, tok)); leave_scope(); return expr; } // postfix = "(" type-name ")" "{" initializer-list "}" postfix-tail* // = ident "(" func-args ")" postfix-tail* // | primary postfix-tail* // // postfix-tail = "[" expr "]" // | "(" func-args ")" // | "." ident // | "->" ident // | "++" // | "--" static Node *postfix(Token **rest, Token *tok) { Node *node; if (equal(tok, "(") && is_typename(tok->next)) { // Compound literal Token *start = tok; Type *ty = typename(&tok, tok->next); tok = attribute_list(tok, ty, type_attributes); if (ty->kind == TY_VLA) error_tok(tok, "%s:%d: in postfix : compound literals cannot be VLA", __FILE__, __LINE__); SET_CTX(ctx); tok = skip(tok, ")", ctx); if (scope->next == NULL) { Obj *var = new_anon_gvar(ty); var->is_compound_lit = true; gvar_initializer(&tok, tok, var); node = new_var_node(var, start); } else { Obj *var = new_lvar("", ty, NULL); var->is_compound_lit = true; Node *lhs = lvar_initializer(&tok, tok, var); Node *rhs = new_var_node(var, tok); node = new_binary(ND_COMMA, lhs, rhs, start); } } else { node = primary(&tok, tok); } // Node *node = primary(&tok, tok); for (;;) { if (equal(tok, "(")) { node = funcall(&tok, tok->next, node); continue; } if (equal(tok, "[")) { // x[y] is short for *(x+y) Token *start = tok; Node *idx = expr(&tok, tok->next); SET_CTX(ctx); tok = skip(tok, "]", ctx); add_type(node); Type *ty = node->ty; node = new_unary(ND_DEREF, new_add(node, idx, start, false), start); if (is_array(ty)) apply_cv_qualifier(node, ty); continue; } if (equal(tok, ".")) { node = struct_ref(node, tok->next); tok = tok->next->next; continue; } if (equal(tok, "->")) { // x->y is short for (*x).y add_type(node); Type *ty = node->ty; node = new_unary(ND_DEREF, node, tok); node = struct_ref(node, tok->next); if (is_array(ty)) apply_cv_qualifier(node, ty); tok = tok->next->next; continue; } if (equal(tok, "++")) { node = new_inc_dec(node, tok, 1); tok = tok->next; continue; } if (equal(tok, "--")) { node = new_inc_dec(node, tok, -1); tok = tok->next; continue; } *rest = tok; return node; } } static char *token_to_string(Token *tok) { char *buf = calloc(tok->len + 1, 1); // allocate and zero-initialize memcpy(buf, tok->loc, tok->len); return buf; } static bool is_returned_twice(char *name) { return !strcmp(name, "setjmp") || !strcmp(name, "_setjmp") || !strcmp(name, "sigsetjmp") || !strcmp(name, "__sigsetjmp") || !strcmp(name, "__builtin_setjmp") || !strcmp(name, "savectx") || !strcmp(name, "vfork") || !strcmp(name, "getcontext"); } // funcall = (assign ("," assign)*)? ")" static Node *funcall(Token **rest, Token *tok, Node *fn) { add_type(fn); if (fn->kind == ND_VAR && (!strcmp(fn->var->name, "alloca") || !strcmp(fn->var->name, "__builtin_alloca"))) need_alloca_bottom(); if (fn->ty->kind != TY_FUNC && (fn->ty->kind != TY_PTR || fn->ty->base->kind != TY_FUNC)) error_tok(fn->tok, "%s:%d: in funcall : not a function %d %s", __FILE__, __LINE__, fn->ty->kind, tok->loc); Type *ty = (fn->ty->kind == TY_FUNC) ? fn->ty : fn->ty->base; Type *param_ty = ty->params; Node head = {}; Node *cur = &head; while (!equal(tok, ")")) { if (cur != &head) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } Node *arg = assign(&tok, tok); add_type(arg); if (!param_ty && !ty->is_variadic && !ty->is_oldstyle) error_tok(tok, "%s:%d: in funcall : too many arguments", __FILE__, __LINE__); //can't be done later because param_ty will be set to the next value //if param_ty is null it means that it's a variadic argument. if (!param_ty){ arg->ty->is_variadic = true; } if (param_ty) { if (param_ty->kind != TY_STRUCT && param_ty->kind != TY_UNION) arg = new_cast(arg, param_ty); param_ty = param_ty->next; } else if (arg->ty->kind == TY_FLOAT) { // If parameter type is omitted (e.g. in "..."), float // arguments are promoted to double. arg = new_cast(arg, ty_double); } else if (is_array(arg->ty)) arg = new_cast(arg, pointer_to(arg->ty->base)); else if (arg->ty->kind == TY_FUNC) arg = new_cast(arg, pointer_to(arg->ty)); cur = cur->next = arg; } if (param_ty && !ty->is_oldstyle) error_tok(tok, "%s:%d: in funcall : too few arguments", __FILE__, __LINE__); SET_CTX(ctx); *rest = skip(tok, ")", ctx); Node *node = new_unary(ND_FUNCALL, fn, tok); node->func_ty = ty; node->ty = ty->return_ty; node->args = head.next; // If a function returns a struct, it is caller's responsibility // to allocate a space for the return value. if (node->ty->kind == TY_STRUCT || node->ty->kind == TY_UNION) node->ret_buffer = new_lvar("", node->ty, NULL); return node; } // generic-selection = "(" assign "," generic-assoc ("," generic-assoc)* ")" // // generic-assoc = type-name ":" assign // | "default" ":" assign static Node *generic_selection(Token **rest, Token *tok) { // Token *start = tok; SET_CTX(ctx); tok = skip(tok, "(", ctx); Node *ctrl = assign(&tok, tok); add_type(ctrl); Type *t1 = ctrl->ty; if (t1->kind == TY_FUNC) t1 = pointer_to(t1); else if (is_array(t1)) t1 = pointer_to(t1->base); else t1 = unqual(t1); // try to fix issue with VLC Node *ret = NULL; while (!consume(rest, tok, ")")) { SET_CTX(ctx); tok = skip(tok, ",", ctx); if (equal(tok, "default")) { SET_CTX(ctx); tok = skip(tok->next, ":", ctx); Node *node = assign(&tok, tok); if (!ret) ret = node; continue; } Type *t2 = typename(&tok, tok); SET_CTX(ctx); tok = skip(tok, ":", ctx); Node *node = assign(&tok, tok); if (is_compatible2(t1, t2)) ret = node; } if (!ret) { ret = ctrl; // error_tok(start, "controlling expression type not compatible with" // " any generic association type"); } return ret; } static Token *skip_choose_expr_arg(Token *tok) { int paren = 0; int bracket = 0; int brace = 0; for (; tok->kind != TK_EOF; tok = tok->next) { if (paren == 0 && bracket == 0 && brace == 0 && (equal(tok, ",") || equal(tok, ")"))) return tok; if (equal(tok, "(")) { paren++; continue; } if (equal(tok, "[")) { bracket++; continue; } if (equal(tok, "{")) { brace++; continue; } if (equal(tok, ")")) { if (paren > 0) { paren--; continue; } error_tok(tok, "%s:%d: in skip_choose_expr_arg : unbalanced ')'", __FILE__, __LINE__); } if (equal(tok, "]")) { if (bracket > 0) { bracket--; continue; } error_tok(tok, "%s:%d: in skip_choose_expr_arg : unbalanced ']'", __FILE__, __LINE__); } if (equal(tok, "}")) { if (brace > 0) { brace--; continue; } error_tok(tok, "%s:%d: in skip_choose_expr_arg : unbalanced '}'", __FILE__, __LINE__); } } error_tok(tok, "%s:%d: in skip_choose_expr_arg : unexpected end of input", __FILE__, __LINE__); return tok; } // primary = "(" "{" stmt+ "}" ")" // | "(" expr ")" // | "sizeof" "(" type-name ")" // | "sizeof" unary // | "_Alignof" "(" type-name ")" // | "_Alignof" unary // | "_Generic" generic-selection // | "__builtin_types_compatible_p" "(" type-name, type-name, ")" // | "__builtin_reg_class" "(" type-name ")" // | ident // | str // | num static Node *primary(Token **rest, Token *tok) { Token *start = tok; if ((equal(tok, "(") && equal(tok->next, "{"))) { // This is a GNU statement expresssion. // Node *node = new_node(ND_STMT_EXPR, tok); // node->body = compound_stmt(&tok, tok->next->next)->body; Node *stmt = NULL; Node *node = compound_stmt(&tok, tok->next->next, &stmt); node->kind = ND_STMT_EXPR; if (stmt && stmt->kind == ND_EXPR_STMT) { Node *expr = stmt->lhs; if (expr->ty->kind == TY_STRUCT || expr->ty->kind == TY_UNION) { Obj *var = new_lvar("", expr->ty, NULL); expr = new_binary(ND_ASSIGN, new_var_node(var, tok), expr, tok); add_type(expr); stmt->lhs = expr; } else if (is_array(expr->ty)) { stmt->lhs = new_cast(expr, pointer_to(expr->ty->base)); } } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "(")) { Node *node = expr(&tok, tok->next); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "sizeof")) { if (equal(tok->next, "(") && is_typename(tok->next->next)) { // sizeof(type-name) enter_scope(); Type *ty = typename(&tok, tok->next->next); leave_scope(); SET_CTX(ctx); *rest = skip(tok, ")", ctx); // Runtime-sized types (VLA / struct-with-VLA). Node *vla_node = sizeof_vla_type(ty, tok); if (vla_node) return vla_node; // Flexible array member: exclude the last (unsized) member. if (ty->kind == TY_STRUCT && ty->is_flexible) { Member *mem = ty->members; while (mem->next) mem = mem->next; if (mem->ty->kind == TY_ARRAY) return new_ulong((ty->size - mem->ty->size), tok); } if ((ty->kind == TY_UNION || ty->kind == TY_STRUCT) && ty->size < 0) error_tok(tok, "%s:%d: in primary : incomplete type for sizeof", __FILE__, __LINE__); return new_ulong(ty->size, start); } else { // sizeof expr Node *node = unary(rest, tok->next); add_type(node); // GCC: array in comma-expr decays (unless compound literal). if (node->kind == ND_COMMA && node->rhs && is_array(node->rhs->ty) && node->rhs->var && !node->rhs->var->is_compound_lit) if (is_array(node->ty) && ((node->kind == ND_COMMA && node->rhs && node->rhs->var && !node->rhs->var->is_compound_lit) || (node->kind == ND_COND))) { node->ty = pointer_to(node->ty->base); } // Runtime-sized types (VLA / struct-with-VLA). Node *vla_node = sizeof_vla_type(node->ty, tok); if (vla_node) return vla_node; if ((node->ty->kind == TY_UNION || node->ty->kind == TY_STRUCT) && node->ty->size < 0) error_tok(tok, "%s:%d: in primary : incomplete type for sizeof", __FILE__, __LINE__); if (node->ty->kind == TY_STRUCT && node->ty->is_flexible) { Member *mem = node->ty->members; while (mem->next) mem = mem->next; if (mem->ty->kind == TY_ARRAY) return new_ulong((node->ty->size - mem->ty->size), tok); } if (node->ty->size < 0) error_tok(tok, "%s:%d: in primary : incomplete type for sizeof", __FILE__, __LINE__); return new_ulong(node->ty->size, start); } } //from @fuhsnn merging alignof if (equal(tok, "_Alignof") || equal(tok, "alignof") || equal(tok, "__alignof__")) { Token *start = tok; Type *ty; if (equal(tok->next, "(") && is_typename(tok->next->next)) { Token *start_paren = tok->next; enter_scope(); ty = typename(&tok, tok->next->next); leave_scope(); SET_CTX(ctx); *rest = skip(tok, ")", ctx); if (equal(*rest, "{")) { Node *node = unary(rest, start_paren); add_type(node); ty = node->ty; } } else { Node *node = unary(rest, tok->next); switch (node->kind) { case ND_MEMBER: return new_ulong(MAX(node->member->align, node->member->attr_align), start); case ND_VAR: return new_ulong(node->var->align, start); } add_type(node); ty = node->ty; } // _Alignof does not apply array-to-pointer decay for expressions. // Preserve array alignment (including _Alignas/aligned on arrays). return new_ulong(ty->align, start); } if (equal(tok, "_Generic")) return generic_selection(rest, tok->next); if (equal(tok, "__builtin_types_compatible_p")) { SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Type *t1 = typename(&tok, tok); if (equal(tok, ",")) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } Type *t2 = typename(&tok, tok); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return new_num(is_compatible(unqual(t1), unqual(t2)), start); } if (equal(tok, "__builtin_constant_p")) { SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Node *expr = assign(&tok, tok); SET_CTX(ctx); *rest = skip(tok, ")", ctx); bool is_constant = false; Node *e = expr; while (e->kind == ND_CAST) e = e->lhs; if (e->tok->kind == TK_NUM || e->tok->kind == TK_STR || is_const_expr(e)) { // Consider numeric and character literals as constants is_constant = true; } return new_num(is_constant ? 1 : 0, start); } if (equal(tok, "__builtin_choose_expr")) { SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Node *cond_node = conditional(&tok, tok); if (!is_const_expr(cond_node)) error_tok(cond_node->tok, "%s:%d: in primary : __builtin_choose_expr condition is not constant", __FILE__, __LINE__); int64_t cond = eval(cond_node); SET_CTX(ctx); tok = skip(tok, ",", ctx); if (cond) { Node *node = assign(&tok, tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); tok = skip_choose_expr_arg(tok); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } tok = skip_choose_expr_arg(tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); Node *node = assign(&tok, tok); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_rotateleft32")) { SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Node *x = assign(&tok, tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); Node *y = assign(&tok, tok); SET_CTX(ctx); *rest = skip(tok, ")", ctx); Node *x_u = new_cast(x, ty_uint); Node *y_u = new_cast(y, ty_uint); Node *mask1 = new_num(31, start); Node *mask2 = new_num(31, start); Node *y_mask1 = new_binary(ND_BITAND, y_u, mask1, start); Node *y_mask2 = new_binary(ND_BITAND, y_u, mask2, start); Node *left = new_binary(ND_SHL, x_u, y_mask1, start); Node *sub = new_binary(ND_SUB, new_num(32, start), y_mask2, start); Node *sub_mask = new_binary(ND_BITAND, sub, new_num(31, start), start); Node *right = new_binary(ND_SHR, x_u, sub_mask, start); return new_binary(ND_BITOR, left, right, start); } if (equal(tok, "__builtin_rotateleft64")) { SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Node *x = assign(&tok, tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); Node *y = assign(&tok, tok); SET_CTX(ctx); *rest = skip(tok, ")", ctx); Node *x_u = new_cast(x, ty_ulong); Node *y_u = new_cast(y, ty_ulong); Node *mask1 = new_num(63, start); Node *mask2 = new_num(63, start); Node *y_mask1 = new_binary(ND_BITAND, y_u, mask1, start); Node *y_mask2 = new_binary(ND_BITAND, y_u, mask2, start); Node *left = new_binary(ND_SHL, x_u, y_mask1, start); Node *sub = new_binary(ND_SUB, new_num(64, start), y_mask2, start); Node *sub_mask = new_binary(ND_BITAND, sub, new_num(63, start), start); Node *right = new_binary(ND_SHR, x_u, sub_mask, start); return new_binary(ND_BITOR, left, right, start); } if (equal(tok, "__builtin_offsetof") || equal(tok, "offsetof")) { SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Type *ty = typename(&tok, tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); Node *node = NULL; int offset = 0; do { Member *mem; do { mem = struct_designator(&tok, tok, ty); offset += mem->offset; ty = mem->ty; } while (!mem->name); SET_CTX(ctx); for (; ty->base && consume(&tok, tok, "["); tok = skip(tok, "]", ctx)) { ty = ty->base; Node *expr = conditional(&tok, tok); if (!node) node = new_binary(ND_MUL, expr, new_long(ty->size, tok), tok); else node = new_binary(ND_ADD, node, new_binary(ND_MUL, expr, new_long(ty->size, tok), tok), tok); } } while (consume(&tok, tok, ".")); SET_CTX(ctx); *rest = skip(tok, ")", ctx); if (!node) return new_ulong(offset, tok); return new_binary(ND_ADD, node, new_ulong(offset, tok), tok); } //trying to fix ===== some builtin functions linked to mmx/emms if (equal(tok, "__builtin_ia32_emms") || equal(tok, "__builtin_ia32_rdtsc") || equal(tok, "__builtin_ia32_readeflags_u64") || equal(tok, "__builtin_ia32_rdsspq") || equal(tok, "__builtin_ia32_saveprevssp") || equal(tok, "__builtin_ia32_setssbsy") || equal(tok, "__builtin_ia32_xbegin") || equal(tok, "__builtin_ia32_xend") || equal(tok, "__builtin_ia32_serialize") || equal(tok, "__builtin_ia32_xsusldtrk") || equal(tok, "__builtin_ia32_xresldtrk") || equal(tok, "__builtin_ia32_clui") || equal(tok, "__builtin_ia32_stui") || equal(tok, "__builtin_ia32_testui") || equal(tok, "__builtin_ia32_wbnoinvd") || equal(tok, "__builtin_ia32_xtest") || equal(tok, "__builtin_ia32_wbinvd") || equal(tok, "__builtin_ia32_rdpid") || equal(tok, "__builtin_ia32_slwpcb") || equal(tok, "__builtin_ia32_rdpkru") || equal(tok, "__builtin_ia32_rdfsbase32") || equal(tok, "__builtin_ia32_rdfsbase64") || equal(tok, "__builtin_ia32_rdgsbase32") || equal(tok, "__builtin_ia32_rdgsbase64") || equal(tok, "__builtin_ia32_vzeroall") || equal(tok, "__builtin_ia32_vzeroupper") || equal(tok, "__builtin_ia32_femms") || equal(tok, "__builtin_ia32_sfence") || equal(tok, "__builtin_ia32_pause") || equal(tok, "__builtin_ia32_lfence") || equal(tok, "__builtin_ia32_mfence")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } if (equal(tok, "__builtin_ia32_stmxcsr")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); if (!equal(tok, ")")) { node->lhs = assign(&tok, tok); add_type(node->lhs); } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } if (equal(tok, "__builtin_ia32_cvtss2si") || equal(tok, "__builtin_ia32_cvttss2si") || equal(tok, "__builtin_ia32_cvttss2si64") || equal(tok, "__builtin_ia32_movmskps") || equal(tok, "__builtin_ia32_ldmxcsr") || equal(tok, "__builtin_ia32_sqrtpd") || equal(tok, "__builtin_ia32_sqrtsd") || equal(tok, "__builtin_ia32_movq128") || equal(tok, "__builtin_ia32_cvtdq2pd") || equal(tok, "__builtin_ia32_cvtdq2ps") || equal(tok, "__builtin_ia32_cvtpd2dq") || equal(tok, "__builtin_ia32_cvtpd2ps") || equal(tok, "__builtin_ia32_cvttpd2dq") || equal(tok, "__builtin_ia32_cvtps2dq") || equal(tok, "__builtin_ia32_cvttps2dq") || equal(tok, "__builtin_ia32_cvtps2pd") || equal(tok, "__builtin_ia32_cvtsd2si") || equal(tok, "__builtin_ia32_cvtsd2si64") || equal(tok, "__builtin_ia32_cvttsd2si") || equal(tok, "__builtin_ia32_cvttsd2si64") || equal(tok, "__builtin_ia32_movmskpd") || equal(tok, "__builtin_ia32_pmovmskb128") || equal(tok, "__builtin_ia32_cvtss2si64") || equal(tok, "__builtin_ia32_cvtps2pi") || equal(tok, "__builtin_ia32_cvttps2pi") || equal(tok, "__builtin_ia32_cvttpd2pi") || equal(tok, "__builtin_ia32_cvtpi2pd") || equal(tok, "__builtin_ia32_cvtpd2pi") || equal(tok, "__builtin_ia32_sqrtss") || equal(tok, "__builtin_ia32_rcpss") || equal(tok, "__builtin_ia32_rcpps") || equal(tok, "__builtin_ia32_rsqrtps") || equal(tok, "__builtin_ia32_clflush") || equal(tok, "_mm_clflush") || equal(tok, "__builtin_ia32_pmovmskb") || equal(tok, "__builtin_ia32_sqrtps") || equal(tok, "__builtin_parity") || equal(tok, "__builtin_parityl") || equal(tok, "__builtin_parityll") || equal(tok, "__builtin_ia32_movshdup") || equal(tok, "__builtin_ia32_movsldup") || equal(tok, "__builtin_ia32_lddqu") || equal(tok, "__builtin_ia32_pabsb128") || equal(tok, "__builtin_ia32_pabsw128") || equal(tok, "__builtin_ia32_pabsd128") || equal(tok, "__builtin_ia32_pabsb") || equal(tok, "__builtin_ia32_pabsw") || equal(tok, "__builtin_ia32_pabsd") || equal(tok, "__builtin_ia32_phminposuw128") || equal(tok, "__builtin_ia32_pmovsxbd128") || equal(tok, "__builtin_ia32_pmovsxwd128") || equal(tok, "__builtin_ia32_pmovsxbq128") || equal(tok, "__builtin_ia32_pmovsxdq128") || equal(tok, "__builtin_ia32_pmovsxwq128") || equal(tok, "__builtin_ia32_pmovsxbw128") || equal(tok, "__builtin_ia32_pmovzxbd128") || equal(tok, "__builtin_ia32_pmovzxwd128") || equal(tok, "__builtin_ia32_pmovzxbq128") || equal(tok, "__builtin_ia32_pmovzxdq128") || equal(tok, "__builtin_ia32_pmovzxwq128") || equal(tok, "__builtin_ia32_pmovzxbw128") || equal(tok, "__builtin_ia32_movntdqa") || equal(tok, "__builtin_ia32_bsrsi") || equal(tok, "__builtin_ia32_rdpmc") || equal(tok, "__builtin_ia32_bsrdi") || equal(tok, "__builtin_ia32_rdtscp") || equal(tok, "__builtin_ia32_writeeflags_u64") || equal(tok, "__builtin_ia32_incsspq") || equal(tok, "__builtin_ia32_rstorssp") || equal(tok, "__builtin_ia32_clrssbsy") || equal(tok, "__builtin_ia32_rsqrtss") || equal(tok, "__builtin_ia32_tzcnt_u16") || equal(tok, "__builtin_ia32_si256_si") || equal(tok, "__builtin_ia32_si_si256") || equal(tok, "__builtin_ia32_pd_pd256") || equal(tok, "__builtin_ia32_ps_ps256")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } if (equal(tok, "__builtin_ia32_pblendvb128") || equal(tok, "__builtin_ia32_blendvpd") || equal(tok, "__builtin_ia32_blendvps") || equal(tok, "__builtin_ia32_pcmpgtb256_mask") || equal(tok, "__builtin_ia32_pblendvb256") || equal(tok, "__builtin_ia32_vinsertf128_si256") || equal(tok, "__builtin_ia32_palignr256") || equal(tok, "__builtin_ia32_permti256") || equal(tok, "__builtin_ia32_pblendd256")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->builtin_args[0] = assign(&tok, tok); add_type(node->builtin_args[0]); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_args[1] = assign(&tok, tok); add_type(node->builtin_args[1]); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_args[2] = assign(&tok, tok); add_type(node->builtin_args[2]); node->builtin_nargs = 3; SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } //builtin shuffle can have two forms : //builtin_shuffle(a, b, mask) or //builtin_shuffle(a, mask) where B defaults to A if (equal(tok, "__builtin_shuffle")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Node *a = assign(&tok, tok); add_type(a); SET_CTX(ctx); tok = skip(tok, ",", ctx); Node *second = assign(&tok, tok); add_type(second); SET_CTX(ctx); if (equal(tok, ",")) { tok = tok->next; Node *mask = assign(&tok, tok); add_type(mask); node->builtin_args[0] = a; node->builtin_args[1] = second; node->builtin_args[2] = mask; } else { node->builtin_args[0] = a; node->builtin_args[1] = a; node->builtin_args[2] = second; } node->builtin_nargs = 3; SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } if (equal(tok, "__builtin_ia32_maskmovq")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->builtin_args[0] = assign(&tok, tok); add_type(node->builtin_args[0]); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_args[1] = assign(&tok, tok); add_type(node->builtin_args[1]); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_args[2] = assign(&tok, tok); add_type(node->builtin_args[2]); node->builtin_nargs = 3; SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } if (equal(tok, "__builtin_ia32_monitor") || equal(tok, "__builtin_ia32_mwait")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->builtin_args[0] = assign(&tok, tok); add_type(node->builtin_args[0]); tok = skip(tok, ",", ctx); node->builtin_args[1] = assign(&tok, tok); add_type(node->builtin_args[1]); if (builtin == ND_MONITOR) { // third argument only for monitor tok = skip(tok, ",", ctx); node->builtin_args[2] = assign(&tok, tok); add_type(node->builtin_args[2]); node->builtin_nargs = 3; } else { node->builtin_nargs = 2; } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } if (equal(tok, "__builtin_ia32_maskmovdqu") || equal(tok, "__builtin_prefetch")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->builtin_args[0] = assign(&tok, tok); add_type(node->builtin_args[0]); int nargs = 1; while (equal(tok, ",")) { tok = tok->next; if (nargs < 16) { node->builtin_args[nargs] = assign(&tok, tok); add_type(node->builtin_args[nargs]); nargs++; } else { error_tok(tok, "too many arguments to builtin"); } } node->builtin_nargs = nargs; SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } if (equal(tok, "__builtin_ia32_vec_init_v4hi") || equal(tok, "__builtin_ia32_sbb_u32") || equal(tok, "__builtin_ia32_addcarryx_u32") || equal(tok, "__builtin_ia32_sbb_u64") || equal(tok, "__builtin_ia32_addcarryx_u64")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->builtin_args[0] = assign(&tok, tok); add_type(node->builtin_args[0]); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_args[1] = assign(&tok, tok); add_type(node->builtin_args[1]); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_args[2] = assign(&tok, tok); add_type(node->builtin_args[2]); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_args[3] = assign(&tok, tok); add_type(node->builtin_args[3]); node->builtin_nargs = 4; SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } if (equal(tok, "__builtin_ia32_shufps") || equal(tok, "__builtin_ia32_shufpd")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->rhs = assign(&tok, tok); add_type(node->rhs); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->rhs->val = const_expr(&tok, tok); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } if (equal(tok, "__builtin_ia32_vec_init_v8qi")) { int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->builtin_args[0] = assign(&tok, tok); add_type(node->builtin_args[0]); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_args[1] = assign(&tok, tok); add_type(node->builtin_args[1]); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_args[2] = assign(&tok, tok); add_type(node->builtin_args[2]); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_args[3] = assign(&tok, tok); add_type(node->builtin_args[3]); tok = skip(tok, ",", ctx); node->builtin_args[4] = assign(&tok, tok); add_type(node->builtin_args[4]); tok = skip(tok, ",", ctx); node->builtin_args[5] = assign(&tok, tok); add_type(node->builtin_args[5]); tok = skip(tok, ",", ctx); node->builtin_args[6] = assign(&tok, tok); add_type(node->builtin_args[6]); tok = skip(tok, ",", ctx); node->builtin_args[7] = assign(&tok, tok); add_type(node->builtin_args[7]); node->builtin_nargs = 8; SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } } //managing lots of builtin_ia32 that needs two args // defined in builtin_table[] int builtin = builtin_enum(tok); if (builtin != -1) { Node *node = new_node(builtin, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->rhs = assign(&tok, tok); add_type(node->rhs); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_reg_class")) { SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Type *ty = typename(&tok, tok); SET_CTX(ctx); *rest = skip(tok, ")", ctx); if (is_integer(ty) || ty->kind == TY_PTR) return new_num(0, start); if (ty->kind == TY_FLOAT || ty->kind == TY_DOUBLE || ty->kind == TY_VECTOR) return new_num(1, start); return new_num(2, start); } if (equal(tok, "__atomic_is_lock_free")) { Node *node = new_node(ND_ATOMIC_IS_LOCK_FREE, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); SET_CTX(ctx); if (consume(&tok, tok, ",")) { node->rhs = assign(&tok, tok); } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_compare_and_swap")) { Node *node = new_node(ND_CAS, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->cas_addr = assign(&tok, tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->cas_old = assign(&tok, tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->cas_new = assign(&tok, tok); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_atomic_exchange")) { Node *node = new_node(ND_EXCH, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->rhs = assign(&tok, tok); add_type(node->rhs); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__sync_val_compare_and_swap")) { Node *node = new_node(ND_CAS_N, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->cas_addr = assign(&tok, tok); add_type(node->cas_addr); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->cas_old = assign(&tok, tok); add_type(node->cas_old); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->cas_new = assign(&tok, tok); add_type(node->cas_new); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } // Extend the parser to recognize __sync_synchronize() if (equal(tok, "__sync_synchronize")) { Node *node = new_node(ND_SYNC, tok); SET_CTX(ctx); *rest = skip(tok->next, "(", ctx); SET_CTX(ctx); *rest = skip(*rest, ")", ctx); return node; } if (equal(tok, "__builtin_memcpy") && equal(tok->next, "(")) { return parse_memcpy(tok, rest); } if (equal(tok, "__builtin_memset") && equal(tok->next, "(")) { return parse_memset(tok, rest); } if (equal(tok, "__builtin_huge_valf")) { Node *node = new_node(ND_BUILTIN_HUGE_VALF, tok); node->ty = ty_float; node->fval = INFINITY; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_inf")) { Node *node = new_node(ND_BUILTIN_INF, tok); node->ty = ty_double; node->fval = INFINITY; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_huge_val")) { Node *node = new_node(ND_BUILTIN_HUGE_VAL, tok); node->ty = ty_double; node->fval = INFINITY; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_huge_vall")) { Node *node = new_node(ND_BUILTIN_HUGE_VALL, tok); node->ty = ty_ldouble; node->fval = INFINITY; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_fpclassify")) { Node *node = new_node(ND_FPCLASSIFY, tok); node->fpc = calloc(1, sizeof(FpClassify)); node->ty = ty_int; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); for (int i = 0; i < 5; ++i) { node->fpc->args[i] = const_expr(&tok, tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); } node->fpc->node = expr(&tok, tok); add_type(node->fpc->node); if (!is_flonum(node->fpc->node->ty)) { error_tok(tok, "%s:%d: in primary : need floating point", __FILE__, __LINE__); } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_inff")) { Node *node = new_node(ND_BUILTIN_INFF, tok); node->ty = ty_float; node->fval = INFINITY; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_nan")) { Node *node = new_node(ND_BUILTIN_NAN, tok); node->ty = ty_double; node->fval = NAN; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); if (tok->kind == TK_STR) tok = tok->next; SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_nanf")) { Node *node = new_node(ND_BUILTIN_NANF, tok); node->ty = ty_float; node->fval = NAN; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); if (tok->kind == TK_STR) tok = tok->next; SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_nanl")) { Node *node = new_node(ND_BUILTIN_NANL, tok); node->ty = ty_ldouble; node->fval = NAN; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); if (tok->kind == TK_STR) tok = tok->next; SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_isnan")) { return ParseBuiltin(ND_BUILTIN_ISNAN, tok, rest); } if (equal(tok, "__builtin_clz")) { return ParseBuiltin(ND_BUILTIN_CLZ, tok, rest); } if (equal(tok, "__builtin_clzl")) { return ParseBuiltin(ND_BUILTIN_CLZL, tok, rest); } if (equal(tok, "__builtin_clzll")) { return ParseBuiltin(ND_BUILTIN_CLZLL, tok, rest); } if (equal(tok, "__builtin_stdc_leading_zeros")) { return ParseBuiltin(ND_BUILTIN_CLZLL, tok, rest); } if (equal(tok, "__builtin_ctz")) { return ParseBuiltin(ND_BUILTIN_CTZ, tok, rest); } if (equal(tok, "__builtin_ctzl")) { return ParseBuiltin(ND_BUILTIN_CTZL, tok, rest); } if (equal(tok, "__builtin_ctzll")) { return ParseBuiltin(ND_BUILTIN_CTZLL, tok, rest); } if (equal(tok, "__builtin_stdc_trailing_zeros")) { return ParseBuiltin(ND_BUILTIN_CTZLL, tok, rest); } if (equal(tok, "__builtin_stdc_count_ones")) { return ParseBuiltin(ND_POPCOUNTLL, tok, rest); } if (equal(tok, "__builtin_stdc_has_single_bit")) { Node *node = ParseBuiltin(ND_POPCOUNTLL, tok, rest); node->builtin_val = new_cast(node->builtin_val, ty_ulong); add_type(node->builtin_val); add_type(node); Node *one = new_num(1, tok); one = new_cast(one, node->ty); add_type(one); return new_binary(ND_EQ, node, one, tok); } if (equal(tok, "__builtin_stdc_bit_width")) { Token *start = tok; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Node *arg = assign(&tok, tok); SET_CTX(ctx); *rest = skip(tok, ")", ctx); add_type(arg); Obj *var = new_lvar("", ty_ulong, NULL); Node *init = new_unary(ND_EXPR_STMT, new_binary(ND_ASSIGN, new_var_node(var, start), new_cast(arg, ty_ulong), start), start); Node *clz = new_node(ND_BUILTIN_CLZLL, start); clz->builtin_val = new_var_node(var, start); Node *cond_node = new_node(ND_COND, start); cond_node->cond = to_bool(new_var_node(var, start)); cond_node->then = new_binary(ND_SUB, new_num(64, start), clz, start); cond_node->els = new_num(0, start); Node *node = new_node(ND_STMT_EXPR, start); node->body = init; init->next = new_unary(ND_EXPR_STMT, cond_node, start); return node; } if (equal(tok, "__builtin_bswap16")) { return ParseBuiltin(ND_BUILTIN_BSWAP16, tok, rest); } if (equal(tok, "__builtin_bswap32")) { return ParseBuiltin(ND_BUILTIN_BSWAP32, tok, rest); } if (equal(tok, "__builtin_bswap64")) { return ParseBuiltin(ND_BUILTIN_BSWAP64, tok, rest); } if (equal(tok, "__builtin_popcount")) { Node *node = ParseBuiltin(ND_POPCOUNT, tok, rest); node->builtin_val = new_cast(node->builtin_val, ty_uint); return node; } if (equal(tok, "__builtin_popcountl")) { Node *node = ParseBuiltin(ND_POPCOUNTL, tok, rest); node->builtin_val = new_cast(node->builtin_val, ty_ulong); add_type(node); add_type(node->builtin_val); return node; } if (equal(tok, "__builtin_popcountll")) { Node *node = ParseBuiltin(ND_POPCOUNTLL, tok, rest); node->builtin_val = new_cast(node->builtin_val, ty_ullong); add_type(node); add_type(node->builtin_val); return node; } if (equal(tok, "__builtin_isunordered")) { Node *node = new_node(ND_ISUNORDERED, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->rhs = assign(&tok, tok); add_type(node->rhs); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_signbit")) { Node *node = new_node(ND_SIGNBIT, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_signbitf")) { Node *node = new_node(ND_SIGNBITF, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_signbitl")) { Node *node = new_node(ND_SIGNBITL, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_expect")) { Node *node = new_node(ND_EXPECT, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->rhs = assign(&tok, tok); add_type(node->rhs); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_assume_aligned")) { SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Node *node = assign(&tok, tok); add_type(node); SET_CTX(ctx); tok = skip(tok, ",", ctx); assign(&tok, tok); if (consume(&tok, tok, ",")) { assign(&tok, tok); } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_abort")) { Node *node = new_node(ND_ABORT, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_return_address")) { if (current_fn) current_fn->force_frame_pointer = true; Node *node = new_node(ND_RETURN_ADDR, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); if (opt_omit_frame_pointer && is_const_expr(node->lhs) && eval(node->lhs) > 0) { opt_omit_frame_pointer = false; } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_frame_address")) { if (current_fn) current_fn->force_frame_pointer = true; Node *node = new_node(ND_BUILTIN_FRAME_ADDRESS, tok); add_type(node); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); if (opt_omit_frame_pointer && (!is_const_expr(node->lhs) || eval(node->lhs) > 0)) { opt_omit_frame_pointer = false; } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_add_overflow")) { return parse_overflow(ND_BUILTIN_ADD_OVERFLOW, tok, rest); } if (equal(tok, "__builtin_uadd_overflow")) { return parse_overflow(ND_UADD_OVERFLOW, tok, rest); } if (equal(tok, "__builtin_uaddll_overflow")) { return parse_overflow(ND_UADDLL_OVERFLOW, tok, rest); } if (equal(tok, "__builtin_uaddl_overflow")) { return parse_overflow(ND_UADDL_OVERFLOW, tok, rest); } if (equal(tok, "__builtin_umul_overflow")) { return parse_overflow(ND_UMUL_OVERFLOW, tok, rest); } if (equal(tok, "__builtin_umulll_overflow")) { return parse_overflow(ND_UMULLL_OVERFLOW, tok, rest); } if (equal(tok, "__builtin_umull_overflow")) { return parse_overflow(ND_UMULL_OVERFLOW, tok, rest); } if (equal(tok, "__builtin_sub_overflow")) { return parse_overflow(ND_BUILTIN_SUB_OVERFLOW, tok, rest); } if (equal(tok, "__builtin_mul_overflow")) { return parse_overflow(ND_BUILTIN_MUL_OVERFLOW, tok, rest); } if (equal(tok, "__builtin_unreachable")) { Node *node = new_node(ND_UNREACHABLE, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__builtin_atomic_exchange_n") || equal(tok, "__atomic_exchange_n")) { return ParseAtomic3(ND_EXCH_N, tok, rest); } if (equal(tok, "__builtin_atomic_compare_exchange") || equal(tok, "__atomic_compare_exchange")) { return ParseAtomicCompareExchangeN(ND_CMPEXCH, tok, rest); } if (equal(tok, "__builtin_atomic_compare_exchange_n") || equal(tok, "__atomic_compare_exchange_n")) { return ParseAtomicCompareExchangeN(ND_CMPEXCH_N, tok, rest); } if (equal(tok, "__builtin_atomic_load") || equal(tok, "__atomic_load")) { return ParseAtomic3(ND_LOAD, tok, rest); } if (equal(tok, "__builtin_atomic_store") || equal(tok, "__atomic_store")) { return ParseAtomic3(ND_STORE, tok, rest); } if (equal(tok, "__builtin_atomic_load_n") || equal(tok, "__atomic_load_n")) { return ParseAtomic2(ND_LOAD_N, tok, rest); } if (equal(tok, "__builtin_atomic_store_n") || equal(tok, "__atomic_store_n")) { return ParseAtomic3(ND_STORE_N, tok, rest); } if (equal(tok, "__builtin_atomic_fetch_add")) { return ParseAtomicFetch(ND_FETCHADD, tok, rest); } if (equal(tok, "__atomic_fetch_add")) { return ParseAtomic3(ND_FETCHADD, tok, rest); } if (equal(tok, "__atomic_add_fetch")) { return ParseAtomic3(ND_ADDFETCH, tok, rest); } if (equal(tok, "__atomic_fetch_sub")) { return ParseAtomic3(ND_FETCHSUB, tok, rest); } if (equal(tok, "__atomic_sub_fetch")) { return ParseAtomic3(ND_SUBFETCH, tok, rest); } if (equal(tok, "__builtin_atomic_fetch_sub")) { return ParseAtomicFetch(ND_FETCHSUB, tok, rest); } if (equal(tok, "__builtin_atomic_fetch_xor")) { return ParseAtomicFetch(ND_FETCHXOR, tok, rest); } if (equal(tok, "__atomic_fetch_xor")) { return ParseAtomic3(ND_FETCHXOR, tok, rest); } if (equal(tok, "__atomic_xor_fetch")) { return ParseAtomic3(ND_XORFETCH, tok, rest); } if (equal(tok, "__builtin_atomic_fetch_and")) { return ParseAtomicFetch(ND_FETCHAND, tok, rest); } if (equal(tok, "__atomic_fetch_and")) { return ParseAtomic3(ND_FETCHAND, tok, rest); } if (equal(tok, "__atomic_and_fetch")) { return ParseAtomic3(ND_ANDFETCH, tok, rest); } if (equal(tok, "__builtin_atomic_fetch_or")) { return ParseAtomicFetch(ND_FETCHOR, tok, rest); } if (equal(tok, "__atomic_fetch_or")) { return ParseAtomic3(ND_FETCHOR, tok, rest); } if (equal(tok, "__atomic_or_fetch")) { return ParseAtomic3(ND_ORFETCH, tok, rest); } if (equal(tok, "__builtin_atomic_test_and_set")) { return ParseAtomic2(ND_TESTANDSETA, tok, rest); } if (equal(tok, "__atomic_test_and_set")) { return ParseAtomic2(ND_TESTANDSETA, tok, rest); } if (equal(tok, "__atomic_clear")) { return ParseAtomicClear(ND_CLEAR, tok, rest); } if (equal(tok, "__sync_add_and_fetch")) { return ParseAtomic3(ND_ADD_AND_FETCH, tok, rest); } if (equal(tok, "__sync_sub_and_fetch")) { return ParseAtomic3(ND_SUB_AND_FETCH, tok, rest); } if (equal(tok, "__sync_bool_compare_and_swap")) { return ParseSyncBoolCAS(ND_BOOL_CAS, tok, rest); } if (equal(tok, "__builtin_atomic_fetch_nand") || equal(tok, "__atomic_fetch_nand")) return ParseAtomicBitwise(ND_FETCHNAND, tok, rest); if (equal(tok, "__atomic_nand_fetch")) return ParseAtomicBitwise(ND_NANDFETCH, tok, rest); if (equal(tok, "__builtin_atomic_clear")) { return ParseAtomic2(ND_CLEAR, tok, rest); } if (equal(tok, "__atomic_thread_fence")) { return ParseAtomicFence(ND_MEMBARRIER, tok, rest); } if (equal(tok, "__atomic_signal_fence")) { return ParseAtomicFence(ND_MEMBARRIER, tok, rest); } if (equal(tok, "__sync_lock_test_and_set")) { Node *node = new_node(ND_TESTANDSET, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); node->ty = node->lhs->ty->base; SET_CTX(ctx); tok = skip(tok, ",", ctx); node->rhs = assign(&tok, tok); add_type(node->rhs); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__sync_lock_release")) { Node *node = new_node(ND_RELEASE, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); node->ty = node->lhs->ty->base; SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } if (equal(tok, "__sync_fetch_and_add")) return ParseSyncFetch(ND_FETCHADD, tok, rest); if (equal(tok, "__sync_add_and_fetch")) return ParseSyncFetch(ND_ADDFETCH, tok, rest); if (equal(tok, "__sync_fetch_and_sub")) return ParseSyncFetch(ND_FETCHSUB, tok, rest); if (equal(tok, "__sync_sub_and_fetch")) return ParseSyncFetch(ND_SUBFETCH, tok, rest); if (equal(tok, "__sync_fetch_and_or")) return ParseSyncFetch(ND_FETCHOR, tok, rest); if (equal(tok, "__sync_or_and_fetch")) return ParseSyncFetch(ND_ORFETCH, tok, rest); if (equal(tok, "__sync_fetch_and_and")) return ParseSyncFetch(ND_FETCHAND, tok, rest); if (equal(tok, "__sync_and_and_fetch")) return ParseSyncFetch(ND_ANDFETCH, tok, rest); if (equal(tok, "__sync_fetch_and_xor")) return ParseSyncFetch(ND_FETCHXOR, tok, rest); if (equal(tok, "__sync_xor_and_fetch")) return ParseSyncFetch(ND_XORFETCH, tok, rest); if (equal(tok, "__sync_fetch_and_nand")) return ParseSyncFetch(ND_FETCHNAND, tok, rest); if (equal(tok, "__sync_nand_and_fetch")) return ParseSyncFetch(ND_NANDFETCH, tok, rest); if (equal(tok, "__builtin_atomic_fetch_op")) { SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Node *obj = new_unary(ND_DEREF, assign(&tok, tok), tok); SET_CTX(ctx); tok = skip(tok, ",", ctx); Node *val = assign(&tok, tok); add_type(val); SET_CTX(ctx); tok = skip(tok, ",", ctx); Node *node; if (equal(tok, "0")) node = new_add(obj, val, tok, false); else if (equal(tok, "1")) node = new_sub(obj, val, tok, false); else if (equal(tok, "2")) node = new_binary(ND_BITOR, obj, val, tok); else if (equal(tok, "3")) node = new_binary(ND_BITXOR, obj, val, tok); else if (equal(tok, "4")) node = new_binary(ND_BITAND, obj, val, tok); else error_tok(tok, "%s:%d: in primary : invalid fetch operator", __FILE__, __LINE__); node->atomic_fetch = true; SET_CTX(ctx); *rest = skip(tok->next, ")", ctx); return to_assign(node); } // Handle __builtin_huge_valf if (equal(tok, "__builtin_huge_valf")) { return parse_huge_val(HUGE_VALF, tok, rest); } // Handle __builtin_huge_vall if (equal(tok, "__builtin_huge_vall")) { return parse_huge_val(HUGE_VALL, tok, rest); } // Handle __builtin_huge_val if (equal(tok, "__builtin_huge_val")) { return parse_huge_val(HUGE_VAL, tok, rest); } if (tok->kind == TK_IDENT) { // Variable or enum constant VarScope *sc = find_var(tok); *rest = tok->next; // For "static inline" function if (sc && sc->var && sc->var->is_function) { if (current_fn) strarray_push(¤t_fn->refs, sc->var->name); else { sc->var->is_root = true; } if (sc->var->is_address_used) { sc->var->is_root = true; } char *name = sc->var->name; if (is_returned_twice(name)) { dont_reuse_stack = true; if (current_fn) current_fn->force_frame_pointer = true; } } if (sc) { if (sc->var) return new_var_node(sc->var, tok); if (sc->enum_ty) return new_num(sc->enum_val, tok); } if (equal(tok->next, "(")) { Obj *fn = find_func(token_to_string(tok)); if (!fn && (is_c99_or_later() || opt_implicit)) { error_tok(tok, "%s:%d: in primary : implicit declaration of function", __FILE__, __LINE__); } if (!fn) { warn_tok(tok, "%s:%d: in primary : implicit declaration of function", __FILE__, __LINE__); Type *ty = func_type(ty_int); ty->is_variadic = true; fn = new_gvar(token_to_string(tok), ty); fn->name = token_to_string(tok); fn->is_function = true; fn->is_definition = false; fn->is_tentative = true; fn->is_static = false; fn->is_extern = true; } // Node *node = unary(rest, tok->next); // return node; *rest = tok->next; return new_var_node(fn, tok); } //printf("=======%s:%d\n", tok->loc, __LINE__); error_tok(tok, "%s:%d: in primary : error: undefined variable %.*s", __FILE__, __LINE__, tok->len, tok->loc); } if (tok->kind == TK_STR) { Type *ty = copy_type(tok->ty); ty->is_const = true; Obj *var = new_string_literal(tok->str, ty); *rest = tok->next; return new_var_node(var, tok); } if (equal(tok, "false")) { *rest = tok->next; return new_boolean(0, tok); } if (equal(tok, "true")) { *rest = tok->next; return new_boolean(1, tok); } if (tok->kind == TK_NUM) { Node *node; if (is_flonum(tok->ty)) { node = new_node(ND_NUM, tok); node->fval = tok->fval; } else { node = new_num(tok->val, tok); } node->ty = tok->ty; *rest = tok->next; return node; } error_tok(tok, "%s:%d: in primary : expected an expression %s", __FILE__, __LINE__, tok->loc); } static Node *parse_typedef(Token **rest, Token *tok, Type *basety, VarAttr *attr) { bool first = true; Node *node = new_node(ND_NULL_EXPR, tok); while (!consume(rest, tok, ";")) { if (!first) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } first = false; Type *ty = declarator(&tok, tok, basety); if (!ty) error_tok(tok, "%s:%d: in parse_typedef : ty is null", __FILE__, __LINE__); if (!ty->name) error_tok(ty->name_pos, "%s:%d: in parse_typedef : typedef name omitted", __FILE__, __LINE__); //from COSMOPOLITAN adding other GNUC attributes tok = attribute_list(tok, ty, type_attributes); if (attr && attr->align) { ty->is_aligned = true; ty->align = MAX(ty->align, attr->align); } if (ty->is_vector && !is_vector(ty)) { int len = ty->vector_size / ty->size; Token *name = ty->name; ty = vector_of(ty, len); ty->name = name; } record_debug_typedef(ty->name, ty); push_scope(get_ident(ty->name))->type_def = ty; node = new_binary(ND_COMMA, node, compute_vla_size(ty, tok), tok); } return node; } static void create_param_lvars(Type *param, char *funcname) { if (!param) return; // from @fuhsnn Adjust ABI with unnamed function parameter #2 create_param_lvars(param->next, funcname); //if (!param->name) // return; // error_tok(param->name_pos, "parameter name omitted"); //new_lvar(get_ident(param->name), param, funcname); if (param->param_var) { param->param_var->next = locals; locals = param->param_var; param->param_var->funcname = funcname; param->param_var->order = order; if (param->name) push_scope(get_ident(param->name))->var = param->param_var; } else { if (!param->name) new_lvar("", param, funcname); else new_lvar(get_ident(param->name), param, funcname); } order++; } // This function matches gotos or labels-as-values with labels. // // We cannot resolve gotos as we parse a function because gotos // can refer a label that appears later in the function. // So, we need to do this after we parse the entire function. static void resolve_goto_labels(void) { for (Node *x = gotos; x; x = x->goto_next) { for (Node *y = labels; y; y = y->goto_next) { if (!strcmp(x->label, y->label)) { x->unique_label = y->unique_label; break; } } if (x->unique_label == NULL) error_tok(x->tok->next, "%s:%d: in resolve_goto_labels : use of undeclared label", __FILE__, __LINE__); } gotos = labels = NULL; } Obj *find_func(char *name) { Scope *sc = scope; while (sc->next) sc = sc->next; VarScope *sc2 = hashmap_get(&sc->vars, name); if (sc2 && sc2->var && sc2->var->is_function) return sc2->var; return NULL; } static void mark_live(Obj *var) { if (!var->is_function || var->is_live) return; var->is_live = true; for (int i = 0; i < var->refs.len; i++) { Obj *fn = find_func(var->refs.data[i]); if (fn) mark_live(fn); } } //implementing tail call optimization. Marking tails calls. static void mark_tail_calls(Node *node) { if (!node) return; switch (node->kind) { case ND_BLOCK: if (!node->body) return; Node *last = node->body; while (last->next) last = last->next; mark_tail_calls(last); break; case ND_IF: mark_tail_calls(node->then); mark_tail_calls(node->els); break; case ND_RETURN: mark_tail_calls(node->lhs); break; case ND_EXPR_STMT: mark_tail_calls(node->lhs); break; case ND_CAST: mark_tail_calls(node->lhs); break; case ND_COMMA: mark_tail_calls(node->rhs); break; case ND_FUNCALL: node->is_tail = true; break; } } static Token *function(Token *tok, Type *basety, VarAttr *attr) { Type *ty = declarator(&tok, tok, basety); tok = attribute_list(tok, attr, thing_attributes); if (!ty) error_tok(tok, "%s:%d: in function : ty is null", __FILE__, __LINE__); if (!ty->name) error_tok(ty->name_pos, "%s:%d: in function : function name omitted", __FILE__, __LINE__); char *name_str = get_ident(ty->name); Obj *fn = find_func(name_str); if (fn) { // Redeclaration if (!fn->is_function) error_tok(tok, "%s:%d: in function : redeclared as a different kind of symbol", __FILE__, __LINE__); if (fn->is_definition && equal(tok, "{")) error_tok(tok, "%s:%d: in function : redefinition of %s", __FILE__, __LINE__, name_str); if (!fn->is_static && attr->is_static) error_tok(tok, "%s:%d: in function : static declaration follows a non-static declaration", __FILE__, __LINE__); fn->is_definition = fn->is_definition || equal(tok, "{"); } else { fn = new_gvar(name_str, ty); fn->funcname = name_str; fn->is_function = true; fn->is_definition = equal(tok, "{"); fn->is_static = attr->is_static || (attr->is_inline && !attr->is_extern); fn->is_inline = attr->is_inline; } //from COSMOPOLITAN adding other GNUC attributes fn->alias_name = attr->alias_name; fn->is_extern |= attr->is_extern; fn->is_weak |= attr->is_weak; fn->section = attr->section; fn->is_ms_abi |= attr->is_ms_abi; fn->visibility = fn->visibility ?: attr->visibility; fn->is_aligned |= attr->is_aligned; fn->is_noreturn |= attr->is_noreturn; fn->is_destructor |= attr->is_destructor; fn->is_constructor |= attr->is_constructor; if (attr->destructor_priority > 0) fn->destructor_priority = attr->destructor_priority; if (attr->constructor_priority > 0) fn->constructor_priority = attr->constructor_priority; fn->is_externally_visible |= attr->is_externally_visible; fn->is_no_instrument_function |= attr->is_no_instrument_function; fn->is_force_align_arg_pointer |= attr->is_force_align_arg_pointer; fn->is_no_caller_saved_registers |= attr->is_no_caller_saved_registers; fn->file_no = tok->file->file_no; fn->line_no = tok->line_no; fn->is_root |= !(fn->is_static && fn->is_inline); if (consume(&tok, tok, "asm") || consume(&tok, tok, "__asm__") || consume(&tok, tok, "__asm")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); fn->asmname = ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); } //from COSMOPOLITAN adding other GNUC attributes tok = attribute_list(tok, attr, thing_attributes); if (consume(&tok, tok, ";") || consume(&tok, tok, ",")) return tok; current_fn = fn; locals = NULL; enter_scope(); // if it's a pointer we don't know the size of the type of pointer int ? char ? create_param_lvars(ty->params, name_str); if (is_old_style) { int n = ArrayTokenOrderCount[nbFunc]; for (int i = 0; i < n; i++) { Token *name = ArrayTokenOrder[nbFunc][i]; VarScope *sc = name ? find_var(name) : NULL; if (!sc || !sc->var) { Type *t = copy_type(ty_int); t->name = name; new_lvar(get_ident(name), t, name_str); order++; } } } // store the number of function parameters to be used for extended assembly fn->nbparm = order; // A buffer for a struct/union return value is passed // as the hidden first parameter. Type *rty = ty->return_ty; if ((rty->kind == TY_STRUCT || rty->kind == TY_UNION) && rty->size > 16) new_lvar("", pointer_to(rty), name_str); fn->params = locals; //to fix issue with complex vla in parameters Node vla_head = {}; Node *vla_cur = &vla_head; for (Type *t = ty->params; t; t = t->next) { Node *comp = compute_vla_size(t, t->name_pos ? t->name_pos : tok); if (comp->kind != ND_NULL_EXPR) vla_cur = vla_cur->next = new_unary(ND_EXPR_STMT, comp, t->name_pos ? t->name_pos : tok); } if (ty->is_variadic) { fn->va_area = new_lvar("__va_area__", array_of(ty_char, 208), name_str); fn->va_area->align = 16; } //from COSMOPOLITAN adding other GNUC attributes tok = attribute_list(tok, ty, type_attributes); if (consume(&tok, tok, ";") || consume(&tok, tok, ",")) return tok; SET_CTX(ctx); tok = skip(tok, "{", ctx); is_old_style = false; // [https://www.sigbus.info/n1570#6.4.2.2p1] "__func__" is // automatically defined as a local variable containing the // current function name. //tok = attribute_list(tok, ty, type_attributes); push_scope("__func__")->var = new_string_literal(fn->name, array_of(ty_char, strlen(fn->name) + 1)); //in assert.h __PRETTY_FUNCTION__ is an alias for __func__ for the current function push_scope("__PRETTY_FUNCTION__")->var = new_string_literal(fn->name, array_of(ty_char, strlen(fn->name) + 1)); // [GNU] __FUNCTION__ is yet another name of __func__. push_scope("__FUNCTION__")->var = new_string_literal(fn->name, array_of(ty_char, strlen(fn->name) + 1)); fn->body = compound_stmt(&tok, tok, NULL); if (vla_head.next) { vla_cur->next = fn->body->body; fn->body->body = vla_head.next; } //implementing tail call optimization. mark_tail_calls(fn->body); fn->locals = locals; order = 0; leave_scope(); resolve_goto_labels(); return tok; } static Token *global_declaration(Token *tok, Type *basety, VarAttr *attr) { bool first = true; while (!consume(&tok, tok, ";")) { if (!first) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } first = false; Type *ty = declarator(&tok, tok, basety); if (!ty) error_tok(tok, "%s:%d: in global_declaration : ty is null", __FILE__, __LINE__); if (!ty->name) error_tok(ty->name_pos, "%s:%d: in global_declaration : variable name omitted", __FILE__, __LINE__); if (ty->name) { VarScope *sc = find_var(ty->name); if (sc && sc->var) { if (sc->var->is_definition && !sc->var->is_tentative && !sc->var->is_extern && equal(tok, "=") ) error_tok(ty->name, "%s:%d: in global_declaration : redefinition of the variable %s", __FILE__, __LINE__, token_to_string(ty->name)); } } Obj *var = new_gvar(get_ident(ty->name), ty); if (ty->kind == TY_FUNC) var->is_function = true; //from COSMOPOLITAN adding other GNUC attributes VarAttr decl_attr = attr ? *attr : (VarAttr){}; while (true) { if (consume(&tok, tok, "asm") || consume(&tok, tok, "__asm__") || consume(&tok, tok, "__asm")) { SET_CTX(ctx); tok = skip(tok, "(", ctx); var->asmname = ConsumeStringLiteral(&tok, tok); SET_CTX(ctx); tok = skip(tok, ")", ctx); continue; } Token *old2 = tok; tok = attribute_list(tok, &decl_attr, thing_attributes); if (tok != old2) continue; break; } var->is_weak = decl_attr.is_weak; var->alias_name = decl_attr.alias_name; var->section = decl_attr.section; if (!decl_attr.section && current_section) { var->section = current_section; } var->visibility = decl_attr.visibility; var->is_aligned = var->is_aligned | decl_attr.is_aligned; var->is_externally_visible = decl_attr.is_externally_visible; var->is_definition = !decl_attr.is_extern && ty->kind != TY_FUNC; var->is_static = decl_attr.is_static; var->is_tls = decl_attr.is_tls; if (decl_attr.align) var->align = MAX(var->align, decl_attr.align); if (equal(tok, "=")) gvar_initializer(&tok, tok->next, var); else if (!decl_attr.is_extern) var->is_tentative = true; current_section=NULL; } return tok; } // Lookahead tokens and returns true if a given token is a start // of a function definition or declaration. static bool is_function(Token *tok) { if (equal(tok, ";")) return false; Type dummy = {}; Type *ty = declarator(&tok, tok, &dummy); return ty->kind == TY_FUNC; } // Remove redundant tentative definitions. // works fine when we have tentative and definition but didn't work when we have multiple tentatives. // that's why here we're doing two passes and managed the case of duplicate tentatives. static void scan_globals(void) { Obj head; Obj *cur = &head; //the first pass skipped the duplicated tentative and stores in an Array of objects duplicated tentative for (Obj *var = globals; var; var = var->next) { if (!var->is_tentative) { cur = cur->next = var; continue; } // Find another definition of the same identifier. Obj *var2 = globals; for (; var2; var2 = var2->next) { if (var != var2 && var2->is_definition && !strcmp(var->name, var2->name)) { // If there's another definition, the tentative definition is redundant, // but we should ensure the definition has the largest size seen. if (var->ty->size > var2->ty->size) { if (var2->init_data) { char *new_buf = calloc(1, var->ty->size); memcpy(new_buf, var2->init_data, var2->ty->size); var2->init_data = new_buf; } var2->ty = copy_type(var2->ty); var2->ty->size = var->ty->size; } break; } } // If there's another definition, the tentative definition // is redundant if (!var2) cur = cur->next = var; } cur->next = NULL; globals = head.next; } static char *prefix_builtin(const char *name) { const char *prefix = "__builtin_"; size_t len = strlen(prefix) + strlen(name) + 1; char *buf = malloc(len); if (!buf) return NULL; strcpy(buf, prefix); strcat(buf, name); return buf; } // static Obj *declare0(char *name, Type *ret) { // if (!opt_fbuiltin) new_gvar(name, func_type(ret)); // return new_gvar(prefix_builtin(name), func_type(ret)); // } // static Obj *declare1(char *name, Type *ret, Type *p1) { // Type *ty = func_type(ret); // ty->params = copy_type(p1); // if (!opt_fbuiltin) new_gvar(name, ty); // return new_gvar(prefix_builtin(name), ty); // } // static Obj *declare2(char *name, Type *ret, Type *p1, Type *p2) { // Type *ty = func_type(ret); // ty->params = copy_type(p1); // ty->params->next = copy_type(p2); // if (!opt_fbuiltin) new_gvar(name, ty); // return new_gvar(prefix_builtin(name), ty); // } static Obj *declare3(char *s, Type *r, Type *a, Type *b, Type *c) { Type *ty = func_type(r); ty->params = copy_type(a); ty->params->next = copy_type(b); ty->params->next->next = copy_type(c); if (!opt_fbuiltin) new_gvar(s, ty); return new_gvar(prefix_builtin(s), ty); } static void declare_builtin_functions(void) { Type *ty = func_type(pointer_to(ty_void)); ty->params = copy_type(ty_int); builtin_alloca = new_gvar("alloca", ty); builtin_alloca->is_definition = false; Obj *builtin = new_gvar("__builtin_alloca", ty); builtin->is_definition = false; Type *pvoid = pointer_to(ty_void); //Type *pchar = pointer_to(ty_char); declare3("memcpy", pvoid, pvoid, pvoid, ty_ulong); declare3("memset", pvoid, pvoid, ty_int, ty_ulong); } // program = (typedef | function-definition | global-variable)* Obj *parse(Token *tok) { char *path; char *fullpath = calloc(1, sizeof(char) * 400);; //char *filename; if (isDotfile && dotf == NULL) { if (base_file == NULL && opt_o == NULL) { fprintf(stderr, "%s: in parse base_file and opt_o are null!\n", __FILE__); exit(1); } path = replace_extn(opt_o ? opt_o : base_file, ".dot"); if (opt_o != NULL) { //filename = extract_filename(opt_o); fullpath = extract_path(opt_o); strncat(fullpath, path, strlen(path)); } //printf("%s %s %s\n", fullpath, filename, path); dotf = fopen(fullpath, "w"); if (dotf == NULL) { fprintf(stderr, "%s: in parse dot file cannot be opend\n", __FILE__); exit(1); } fprintf(dotf, "digraph A { \n"); } if (opt_fbuiltin) declare_builtin_functions(); globals = NULL; while (tok->kind != TK_EOF) { current_fn = NULL; locals = NULL; if (equal(tok, "_Static_assert")) { tok = static_assertion(tok); continue; } //fixing ISS-192 found during php-src compile if (equal(tok, "asm") || equal(tok, "__asm__") || equal(tok, "__asm")) { Node *node = asm_stmt(&tok, tok); add_type(node); continue; } VarAttr attr = {}; //from COSMOPOLITAN adding other GNUC attributes tok = attribute_list(tok, &attr, thing_attributes); Type *basety = declspec(&tok, tok, &attr); tok = attribute_list(tok, &attr, thing_attributes); // Typedef if (attr.is_typedef) { parse_typedef(&tok, tok, basety, &attr); continue; } // Function if (is_function(tok)) { if (check_old_style(&tok, tok)) { is_old_style = true; tok = function(tok, basety, &attr); continue; } is_old_style = false; tok = function(tok, basety, &attr); continue; } // Global variable tok = global_declaration(tok, basety, &attr); } for (Obj *var = globals; var; var = var->next) if (var->is_root || var->is_address_used) mark_live(var); // Remove redundant tentative definitions. scan_globals(); return globals; } // for dot diagram char *nodekind2str(NodeKind kind) { switch (kind) { case ND_NULL_EXPR: return "NULL_EXPR"; case ND_ADD: return "ADD"; case ND_SUB: return "SUB"; case ND_MUL: return "MUL"; case ND_DIV: return "DIV"; case ND_POS: return "POS"; case ND_NEG: return "NEG"; case ND_MOD: return "MOD"; case ND_BITAND: return "BITAND"; case ND_BITOR: return "BITOR"; case ND_BITXOR: return "BITXOR"; case ND_SHL: return "SHL"; case ND_SHR: return "SHR"; case ND_EQ: return "EQ"; case ND_NE: return "NE"; case ND_LT: return "LT"; case ND_LE: return "LE"; case ND_ASSIGN: return "ASSIGN"; case ND_COND: return "COND"; case ND_COMMA: return "COMMA"; case ND_MEMBER: return "MEMBER"; case ND_ADDR: return "ADDR"; case ND_DEREF: return "DEREF"; case ND_NOT: return "NOT"; case ND_BITNOT: return "BITNOT"; case ND_LOGAND: return "LOGAND"; case ND_LOGOR: return "LOGOR"; case ND_RETURN: return "RETURN"; case ND_IF: return "IF"; case ND_FOR: return "FOR"; case ND_DO: return "DO"; case ND_SWITCH: return "SWITCH"; case ND_CASE: return "CASE"; case ND_BLOCK: return "BLOCK"; case ND_GOTO: return "GOTO"; case ND_GOTO_EXPR: return "GOTO_EXPR"; case ND_LABEL: return "LABEL"; case ND_LABEL_VAL: return "LABEL_VAL"; case ND_FUNCALL: return "FUNCALL"; case ND_EXPR_STMT: return "EXPRSTMR"; case ND_STMT_EXPR: return "STMTEXPR"; case ND_VAR: return "VAR"; case ND_VLA_PTR: return "VLAPTR"; case ND_NUM: return "NUM"; case ND_CAST: return "CAST"; case ND_MEMZERO: return "MEMZERO"; case ND_ASM: return "ASM"; case ND_CAS: return "CAS"; case ND_CAS_N: return "CAS_N"; case ND_EXCH: return "EXCHANGE"; case ND_EXCH_N: return "EXCHANGE_N"; case ND_CMPEXCH: return "COMPARE_EXCHANGE"; case ND_CMPEXCH_N: return "COMPARE_EXCHANGE_N"; case ND_LOAD: return "LOAD"; case ND_LOAD_N: return "LOAD_N"; case ND_STORE: return "STORE"; case ND_STORE_N: return "STORE_N"; case ND_TESTANDSET: return "TESTANDSET"; case ND_TESTANDSETA: return "TESTANDSETA"; case ND_CLEAR: return "CLEAR"; case ND_RELEASE: return "RELEASE"; case ND_FETCHADD: return "FETCHADD"; case ND_FETCHSUB: return "FETCHSUB"; case ND_FETCHXOR: return "FETCHXOR"; case ND_FETCHAND: return "FETCHAND"; case ND_FETCHOR: return "FETCHOR"; case ND_SUBFETCH: return "SUBFETCH"; case ND_SYNC: return "SYNC"; case ND_MEMBARRIER: return "MEMBARRIER"; case ND_BUILTIN_MEMCPY: return "MEMCPY"; case ND_BUILTIN_MEMSET: return "MEMSET"; case ND_BUILTIN_CLZ: return "CLZ"; case ND_BUILTIN_CLZL: return "CLZL"; case ND_BUILTIN_CLZLL: return "CLZLL"; case ND_BUILTIN_CTZ: return "CTZ"; case ND_BUILTIN_CTZL: return "CTZL"; case ND_BUILTIN_CTZLL: return "CTZLL"; case ND_BUILTIN_INFF: return "INFF"; case ND_BUILTIN_INF: return "INFF"; case ND_BUILTIN_NAN: return "NAN"; case ND_BUILTIN_NANF: return "NANF"; case ND_BUILTIN_NANL: return "NANL"; case ND_BUILTIN_ISNAN: return "ISNAN"; case ND_BUILTIN_HUGE_VAL: return "ISNAN"; case ND_BUILTIN_HUGE_VALF: return "ISNAN"; case ND_BUILTIN_HUGE_VALL: return "ISNAN"; case ND_POPCOUNT: return "POPCOUNT"; case ND_POPCOUNTL: return "POPCOUNTL"; case ND_POPCOUNTLL: return "POPCOUNTLL"; case ND_RETURN_ADDR: return "RETURN_ADDRESS"; case ND_BUILTIN_FRAME_ADDRESS: return "FRAME_ADDRESS"; case ND_BUILTIN_ADD_OVERFLOW: return "ADD_OVERFLOW"; case ND_BUILTIN_SUB_OVERFLOW: return "SUB_OVERFLOW"; case ND_BUILTIN_MUL_OVERFLOW: return "MUL_OVERFLOW"; case ND_UADD_OVERFLOW: return "UADD_OVERFLOW"; case ND_UADDL_OVERFLOW: return "UADDL_OVERFLOW"; case ND_UADDLL_OVERFLOW: return "UADDLL_OVERFLOW"; case ND_UMUL_OVERFLOW: return "UMUL_OVERFLOW"; case ND_UMULL_OVERFLOW: return "UMULL_OVERFLOW"; case ND_UMULLL_OVERFLOW: return "UMULLL_OVERFLOW"; case ND_BUILTIN_BSWAP16: return "BSWAP16"; case ND_BUILTIN_BSWAP32: return "BSWAP32"; case ND_BUILTIN_BSWAP64: return "BSWAP64"; case ND_ALLOC: return "ALLOCA"; case ND_ABORT: return "ABORT"; case ND_EXPECT: return "EXPECT"; case ND_EMMS: return "EMMS"; case ND_LFENCE: return "LFENCE"; case ND_MFENCE: return "MFENCE"; case ND_SFENCE: return "SFENCE"; case ND_PAUSE: return "PAUSE"; case ND_STMXCSR: return "STMXCSR"; case ND_LDMXCSR: return "LDMXCSR"; case ND_CVTPI2PS: return "CVTPI2PS"; case ND_CVTPS2PI: return "CVTPS2PI"; case ND_CLFLUSH: return "CLFLUSH"; case ND_VECINITV2SI: return "VEC_INIT_V2SI"; case ND_VECEXTV2SI: return "VEC_EXT_V2SI"; case ND_VECEXTV4SI: return "VEC_EXT_V4SI"; case ND_VECINITV8QI: return "VEC_INIT_V8QI"; case ND_VECINITV4HI: return "VEC_INIT_V4HI"; case ND_PACKSSWB: return "PACKSSWB"; case ND_PACKSSDW: return "PACKSSDW"; case ND_PACKUSWB: return "PACKUSWB"; case ND_PUNPCKHBW: return "PUNPCKHBW"; case ND_PUNPCKHWD: return "PUNPCKHWD"; case ND_PUNPCKHDQ: return "PUNPCKHDQ"; case ND_PUNPCKLBW: return "PUNPCKLBW"; case ND_PUNPCKLWD: return "PUNPCKLWD"; case ND_PUNPCKLDQ: return "PUNPCKLDQ"; case ND_PADDB: return "PADDB"; case ND_PADDW: return "PADDW"; case ND_PADDD: return "PADDD"; case ND_PADDQ: return "PADDQ"; case ND_PADDSB: return "PADDSB"; case ND_PADDSW: return "PADDSW"; case ND_PADDUSB: return "PADDUSB"; case ND_PADDUSW: return "PADDUSW"; case ND_PSUBB: return "PSUBB"; case ND_PSUBW: return "PSUBW"; case ND_PSUBD: return "PSUBD"; case ND_PSUBQ: return "PSUBQ"; case ND_PSUBSB: return "PSUBSB"; case ND_PSUBSW: return "PSUBSW"; case ND_PSUBUSB: return "PSUBUSB"; case ND_PSUBUSW: return "PSUBUSW"; case ND_PMADDWD: return "PMADDWD"; case ND_PMULHW: return "PMULHW"; case ND_PMULLW: return "PMULLW"; case ND_PSLLW: return "PSLLW"; case ND_PSLLWI: return "PSLLWI"; case ND_PSLLD: return "PSLLD"; case ND_PSLLDI: return "PSLLDI"; case ND_PSLLQ: return "PSLLQ"; case ND_PSLLQI: return "PSLLQI"; case ND_PSRAW: return "PSRAW"; case ND_PSRAWI: return "PSRAWI"; case ND_PSRAD: return "PSRAD"; case ND_PSRADI: return "PSRADI"; case ND_PSRLW: return "PSRLW"; case ND_PSRLWI: return "PSRLWI"; case ND_PSRLD: return "PSRLD"; case ND_PSRLDI: return "PSRLDI"; case ND_PSRLQ: return "PSRLQ"; case ND_PSRLQI: return "PSRLQI"; case ND_PAND: return "PAND"; case ND_PANDN: return "PANDN"; case ND_POR: return "POR"; case ND_PXOR: return "PXOR"; case ND_PCMPEQB: return "PCMPEQB"; case ND_PCMPGTB: return "PCMPGTB"; case ND_PCMPEQW: return "PCMPEQW"; case ND_PCMPEQD: return "PCMPEQD"; case ND_PCMPGTW: return "PCMPGTW"; case ND_PCMPGTD: return "PCMPGTD"; case ND_ADDSS: return "ADDSS"; case ND_SUBSS: return "SUBSS"; case ND_MULSS: return "MULSS"; case ND_DIVSS: return "DIVSS"; case ND_SQRTSS: return "SQRTSS"; case ND_SQRTPS: return "SQRTPS"; case ND_RSQRTSS: return "RSQRTSS"; case ND_RSQRTPS: return "RSQRTPS"; case ND_RCPSS: return "RCPSS"; case ND_RCPPS: return "RCPPS"; case ND_MINSS: return "MINSS"; case ND_MINPS: return "MINPS"; case ND_MAXPS: return "MAXPS"; case ND_MAXSS: return "MAXSS"; case ND_ANDPS: return "ANDPS"; case ND_ANDNPS: return "ANDNPS"; case ND_ORPS: return "ORPS"; case ND_XORPS: return "XORPS"; case ND_CMPEQSS: return "CMPEQSS"; case ND_CMPLTSS: return "CMPLTSS"; case ND_CMPLESS: return "CMPLESS"; case ND_MOVSS: return "MOVSS"; case ND_CMPNEQSS: return "CMPNEQSS"; case ND_CMPNLTSS: return "CMPNLTSS"; case ND_CMPNLESS: return "CMPNLESS"; case ND_CMPORDSS: return "CMPORDSS"; case ND_CMPUNORDSS: return "CMPUNORDSS"; case ND_CMPEQPS: return "CMPEQPS"; case ND_CMPLTPS: return "CMPLTPS"; case ND_CMPLEPS: return "CMPLEPS"; case ND_CMPGTPS: return "CMPGTPS"; case ND_CMPGEPS: return "CMPGEPS"; case ND_CMPNEQPS: return "CMPNEQPS"; case ND_CMPNLTPS: return "CMPNLTPS"; case ND_CMPNLEPS: return "CMPNLEPS"; case ND_CMPNGTPS: return "CMPNGTPS"; case ND_CMPNGEPS: return "CMPNGEPS"; case ND_CMPORDPS: return "CMPORDPS"; case ND_CMPUNORDPS: return "CMPUNORDPS"; case ND_COMIEQ: return "COMIEQ"; case ND_COMILT: return "COMILT"; case ND_COMILE: return "COMILE"; case ND_COMIGT: return "COMIGT"; case ND_COMIGE: return "COMIGE"; case ND_COMINEQ: return "COMINEQ"; case ND_UCOMIEQ: return "UCOMIEQ"; case ND_UCOMILT: return "UCOMILT"; case ND_UCOMILE: return "UCOMILE"; case ND_UCOMIGT: return "UCOMIGT"; case ND_UCOMIGE: return "UCOMIGE"; case ND_UCOMINEQ: return "UCOMINEQ"; case ND_CVTSS2SI: return "CVTSS2SI"; case ND_CVTSS2SI64: return "CVTSS2SI64"; case ND_CVTTSS2SI: return "CVTTSS2SI"; case ND_CVTTSS2SI64: return "CVTTSS2SI64"; case ND_CVTTPS2PI: return "CVTTPS2PI"; case ND_CVTSI2SS: return "CVTSI2SS"; case ND_CVTSI642SS: return "CVTSI642SS"; case ND_MOVLHPS: return "MOVLHPS"; case ND_MOVHLPS: return "MOVHLPS"; case ND_UNPCKHPS: return "UNPCKHPS"; case ND_UNPCKLPS: return "UNPCKLPS"; case ND_LOADHPS: return "LOADHPS"; case ND_STOREHPS: return "STOREHPS"; case ND_LOADLPS: return "LOADLPS"; case ND_STORELPS: return "STORELPS"; case ND_MOVMSKPS: return "MOVMSKPS"; case ND_SHUFPS: return "SHUFPS"; case ND_SHUFFLE: return "SHUFFLE"; case ND_PMAXSW: return "PMAXSW"; case ND_PMAXUB: return "PMAXUB"; case ND_PMINSW: return "PMINSW"; case ND_PMINUB: return "PMINUB"; case ND_PMOVMSKB: return "PMOVMSKB"; case ND_PMULHUW: return "PMULHUW"; case ND_MASKMOVQ: return "MASKMOVQ"; case ND_PAVGB: return "PAVGB"; case ND_PAVGW: return "PAVGW"; case ND_PSADBW: return "PSADBW"; case ND_MOVNTQ: return "MOVNTQ"; case ND_MOVNTPS: return "MOVNTPS"; case ND_SHUFPD: return "SHUFPD"; case ND_ADDSD: return "ADDSD"; case ND_SUBSD: return "SUBSD"; case ND_MULSD: return "MULSD"; case ND_DIVSD: return "DIVSD"; case ND_SQRTPD: return "SQRTPD"; case ND_SQRTSD: return "SQRTSD"; case ND_MOVSD: return "MOVSD"; case ND_MINPD: return "MINPD"; case ND_MINSD: return "MINSD"; case ND_MAXPD: return "MAXPD"; case ND_MAXSD: return "MAXSD"; case ND_ANDPD: return "ANDPD"; case ND_ANDNPD: return "ANDNPD"; case ND_ORPD: return "ORPD"; case ND_XORPD: return "XORPD"; case ND_CMPEQPD: return "CMPEQPD"; case ND_CMPLTPD: return "CMPLTPD"; case ND_CMPLEPD: return "CMPLEPD"; case ND_CMPGTPD: return "CMPGTPD"; case ND_CMPGEPD: return "CMPGEPD"; case ND_CMPNEQPD: return "CMPNEQPD"; case ND_CMPNLTPD: return "CMPNLTPD"; case ND_CMPNLEPD: return "CMPNLEPD"; case ND_CMPNGTPD: return "CMPNGTPD"; case ND_CMPNGEPD: return "CMPNGEPD"; case ND_CMPORDPD: return "CMPORDPD"; case ND_CMPUNORDPD: return "CMPUNORDPD"; case ND_CMPEQSD: return "CMPEQSD"; case ND_CMPLTSD: return "CMPLTSD"; case ND_CMPLESD: return "CMPLESD"; case ND_CMPNEQSD: return "CMPNEQSD"; case ND_CMPNLTSD: return "CMPNLTSD"; case ND_CMPNLESD: return "CMPNLESD"; case ND_CMPORDSD: return "CMPORDSD"; case ND_CMPUNORDSD: return "CMPUNORDSD"; case ND_COMISDEQ: return "COMISDEQ"; case ND_COMISDLT: return "COMISDLT"; case ND_COMISDLE: return "COMISDLE"; case ND_COMISDGT: return "COMISDGT"; case ND_COMISDGE: return "COMISDGE"; case ND_COMISDNEQ: return "COMISDNEQ"; case ND_UCOMISDEQ: return "UCOMISDEQ"; case ND_UCOMISDLT: return "UCOMISDLT"; case ND_UCOMISDLE: return "UCOMISDLE"; case ND_UCOMISDGT: return "UCOMISDGT"; case ND_UCOMISDGE: return "UCOMISDGE"; case ND_UCOMISDNEQ: return "UCOMISDNEQ"; case ND_MOVQ128: return "MOVQ128"; case ND_CVTDQ2PD: return "CVTDQ2PD"; case ND_CVTDQ2PS: return "CVTDQ2PS"; case ND_CVTPD2DQ: return "CVTPD2DQ"; case ND_CVTPD2PI: return "CVTPD2PI"; case ND_CVTPD2PS: return "CVTPD2PS"; case ND_CVTTPD2DQ: return "CVTTPD2DQ"; case ND_CVTTPD2PI: return "CVTTPD2PI"; case ND_CVTPI2PD: return "CVTPI2PD"; case ND_CVTPS2DQ: return "CVTPS2DQ"; case ND_CVTTPS2DQ: return "CVTTPS2DQ"; case ND_CVTPS2PD: return "CVTPS2PD"; case ND_CVTSD2SI: return "CVTSD2SI"; case ND_CVTSD2SI64: return "CVTSD2SI64"; case ND_CVTTSD2SI: return "CVTTSD2SI"; case ND_CVTTSD2SI64: return "CVTTSD2SI64"; case ND_CVTSD2SS: return "CVTSD2SS"; case ND_CVTSI2SD: return "CVTSI2SD"; case ND_CVTSI642SD: return "CVTSI642SD"; case ND_CVTSS2SD: return "CVTSS2SD"; case ND_UNPCKHPD: return "UNPCKHPD"; case ND_UNPCKLPD: return "UNPCKLPD"; case ND_LOADHPD: return "LOADHPD"; case ND_LOADLPD: return "LOADLPD"; case ND_MOVMSKPD: return "MOVMSKPD"; case ND_PACKSSWB128: return "PACKSSWB128"; case ND_PACKSSDW128: return "PACKSSDW128"; case ND_PACKUSWB128: return "PACKUSWB128"; case ND_PUNPCKHBW128: return "PUNPCKHB128"; case ND_PUNPCKHWD128: return "PUNPCKHWD128"; case ND_PUNPCKHDQ128: return "PUNPCKHDQ128"; case ND_PUNPCKHQDQ128: return "PUNPCKHQDQ128"; case ND_PUNPCKLBW128: return "PUNPCKLBW128"; case ND_PUNPCKLWD128: return "PUNPCKLWD128"; case ND_PUNPCKLDQ128: return "PUNPCKLDQ128"; case ND_PUNPCKLQDQ128: return "PUNPCKLQDQ128"; case ND_PADDSB128: return "PADDSB128"; case ND_PADDSW128: return "PADDSW128"; case ND_PADDUSB128: return "PADDUSB128"; case ND_PADDUSW128: return "PADDUSW128"; case ND_PSUBSB128: return "PSUBSB128"; case ND_PSUBSW128: return "PSUBSW128"; case ND_PSUBUSB128: return "PSUBUSB128"; case ND_PSUBUSW128: return "PSUBUSW128"; case ND_PMADDWD128: return "PMADDWD128"; case ND_PMULHW128: return "PMULHW128"; case ND_PMULUDQ: return "PMULUDQ"; case ND_PMULUDQ128: return "PMULUDQ128"; case ND_PSLLWI128: return "PSLLWI128"; case ND_PSLLDI128: return "PSLLDI128"; case ND_PSLLQI128: return "PSLLQI128"; case ND_PSRAWI128: return "PSRAWI128"; case ND_PSRADI128: return "PSRADI128"; case ND_PSRLWI128: return "PSRLWI128"; case ND_PSRLDI128: return "PSRLDI128"; case ND_PSRLQI128: return "PSRLQI128"; case ND_PSLLW128: return "PSLLW128"; case ND_PSLLD128: return "PSLLD128"; case ND_PSLLQ128: return "PSLLQ128"; case ND_PSRAW128: return "PSRAW128"; case ND_PSRAD128: return "PSRAD128"; case ND_PSRLW128: return "PSRLW128"; case ND_PSRLD128: return "PSRLD128"; case ND_PSRLQ128: return "PSRLQ128"; case ND_PANDN128: return "PANDN128"; case ND_PMAXSW128: return "PMAXSW128"; case ND_PMAXUB128: return "PMAXUB128"; case ND_PMINSW128: return "PMINSW128"; case ND_PMINUB128: return "PMINUB128"; case ND_PMOVMSKB128: return "PMOVMSKB128"; case ND_PMULHUW128: return "PMULHUW128"; case ND_MASKMOVDQU: return "MASKMOVDQU"; case ND_PAVGB128: return "PAVGB128"; case ND_PAVGW128: return "PAVGW128"; case ND_PSADBW128: return "PSADBW128"; case ND_MOVNTI: return "MOVNTI"; case ND_MOVNTI64: return "MOVNTI64"; case ND_MOVNTDQ: return "MOVNTDQ"; case ND_MOVNTPD: return "MOVNTPD"; case ND_PARITY: return "PARITY"; case ND_PARITYL: return "PARITYL"; case ND_PARITYLL: return "PARITYLL"; case ND_MWAIT: return "MWAIT"; case ND_MONITOR: return "MONITOR"; case ND_ADDSUBPS: return "ADDSUBPS"; case ND_HADDPS: return "HADDPS"; case ND_HSUBPS: return "HSUBPS"; case ND_MOVSHDUP: return "MOVSHDUP"; case ND_MOVSLDUP: return "MOVSLDUP"; case ND_ADDSUBPD: return "ADDSUBPD"; case ND_HADDPD: return "HADDPD"; case ND_HSUBPD: return "HSUBPD"; case ND_PHADDW128: return "PHADDW128"; case ND_PHADDD128: return "PHADDD128"; case ND_PHADDSW128: return "PHADDSW128"; case ND_PHADDW: return "PHADDW"; case ND_PHADDD: return "PHADDD"; case ND_PHADDSW: return "PHADDSW"; case ND_PHSUBW128: return "PHSUBW128"; case ND_PHSUBD128: return "PHSUBD128"; case ND_PHSUBSW128: return "PHSUBSW128"; case ND_PHSUBW: return "PHSUBW"; case ND_PHSUBD: return "PHSUBD"; case ND_PHSUBSW: return "PHSUBSW"; case ND_PMADDUBSW128: return "PMADDUBSW128"; case ND_PMADDUBSW: return "PMADDUBSW"; case ND_PMULHRSW128: return "PMULHRSW128"; case ND_PMULHRSW: return "PMULHRSW"; case ND_PSHUFB128: return "PSHUFB128"; case ND_PSHUFB: return "PSHUFB"; case ND_PSIGNB128: return "PSIGNB128"; case ND_PSIGNW128: return "PSIGNW128"; case ND_PSIGND128: return "PSIGND128"; case ND_PSIGNB: return "PSIGNB"; case ND_PSIGNW: return "PSIGNW"; case ND_PSIGND: return "PSIGND"; case ND_PABSB128: return "PABSB128"; case ND_PABSW128: return "PABSW128"; case ND_PABSD128: return "PABSD128"; case ND_PABSB: return "PABSB"; case ND_PABSW: return "PABSW"; case ND_PABSD: return "PABSD"; case ND_PTESTZ128: return "PTESTZ128"; case ND_PTESTC128: return "PTESTC128"; case ND_PTESTNZC128: return "PTESTNZC128"; case ND_PBLENDVB128: return "PBLENDVB128"; case ND_BLENDVPS: return "BLENDVPS"; case ND_BLENDVPD: return "BLENDVPD"; case ND_PMINSB128: return "PMINSB128"; case ND_PMAXSB128: return "PMAXSB128"; case ND_PMINUW128: return "PMINUW128"; case ND_PMAXUW128: return "PMAXUW128"; case ND_PMINSD128: return "PMINSD128"; case ND_PMAXSD128: return "PMAXSD128"; case ND_PMINUD128: return "PMINUD128"; case ND_PMAXUD128: return "PMAXUD128"; case ND_PMULDQ128: return "PMULDQ128"; case ND_PHMINPOSUW128: return "PHMINPOSUW128"; case ND_PMOVSXBD128: return "PMOVSXBD128"; case ND_PMOVSXWD128: return "PMOVSXWD128"; case ND_PMOVSXBQ128: return "PMOVSXBQ128"; case ND_PMOVSXDQ128: return "PMOVSXDQ128"; case ND_PMOVSXWQ128: return "PMOVSXWQ128"; case ND_PMOVSXBW128: return "PMOVSXBW128"; case ND_PMOVZXBD128: return "PMOVZXBD128"; case ND_PMOVZXWD128: return "PMOVZXWD128"; case ND_PMOVZXBQ128: return "PMOVZXBQ128"; case ND_PMOVZXDQ128: return "PMOVZXDQ128"; case ND_PMOVZXWQ128: return "PMOVZXWQ128"; case ND_PMOVZXBW128: return "PMOVZXBW128"; case ND_PACKUSDW128: return "PACKUSDW128"; case ND_MOVNTDQA: return "MOVNTDQA"; case ND_CRC32QI: return "CRC32QI"; case ND_CRC32HI: return "CRC32HI"; case ND_CRC32SI: return "CRC32SI"; case ND_CRC32DI: return "CRC32DI"; case ND_PSHUFD: return "PSHUFD"; case ND_FETCHNAND: return "FETCHNAND"; case ND_ADD_AND_FETCH: return "ADD_AND_FETCH"; case ND_SUB_AND_FETCH: return "SUB_AND_FETCH"; case ND_BOOL_CAS: return "BOOL_CAS"; case ND_PREFETCH: return "PREFETCH"; case ND_RDTSC: return "RDTSC"; case ND_READEFLAGS_U64: return "READEFLAGS_U64"; case ND_RDSSPQ: return "RDSSPQ"; case ND_SAVEPREVSSP: return "SAVEPREVSSP"; case ND_SETSSBSY: return "SETSSBSY"; case ND_SLWPCB: return "SLWPCB"; case ND_RDPKRU: return "RDPKRU"; case ND_XBEGIN: return "XBEGIN"; case ND_XEND: return "XEND"; case ND_SERIALIZE: return "SERIALIZE"; case ND_XSUSLDTRK: return "XSUSLDTRK"; case ND_XRESLDTRK: return "XRESLDTRK"; case ND_CLUI: return "CLUI"; case ND_STUI: return "STUI"; case ND_TESTUI: return "TESTUI"; case ND_WBNOINVD: return "WBNOINVD"; case ND_XTEST: return "XTEST"; case ND_WBINVD: return "WBINVD"; case ND_RDPID: return "RDPID"; case ND_RDFSBASE32: return "RDFSBASE32"; case ND_RDFSBASE64: return "RDFSBASE64"; case ND_RDGSBASE32: return "RDGSBASE32"; case ND_RDGSBASE64: return "RDGSBASE64"; case ND_VZEROALL: return "VZEROALL"; case ND_VZEROUPPER: return "VZEROUPPER"; case ND_FEMMS: return "FEMMS"; case ND_BSRSI: return "BSRSI"; case ND_RDPMC: return "RDPMC"; case ND_RDTSCP: return "RDTSCP"; case ND_ROLQI: return "ROLQI"; case ND_ROLHI: return "ROLHI"; case ND_RORQI: return "RORQI"; case ND_RORHI: return "RORHI"; case ND_BSRDI: return "BSRDI"; case ND_WRITEEFLAGS_U64: return "WRITEEFLAGS_U64"; case ND_INCSSPQ: return "INCSSPQ"; case ND_RSTORSSP: return "RSTORSSP"; case ND_WRSSD: return "WRSSD"; case ND_WRSSQ: return "WRSSQ"; case ND_WRUSSD: return "WRUSSD"; case ND_WRUSSQ: return "WRUSSQ"; case ND_CLRSSBSY: return "CLRSSBSY"; case ND_SBB_U32: return "SBB_U32"; case ND_ADDCARRYX_U32: return "ADDCARRYX_U32"; case ND_SBB_U64: return "SBB_U64"; case ND_ADDCARRYX_U64: return "ADDCARRYX_U64"; case ND_TZCNT_U16: return "TZCNT_U16"; case ND_BEXTR_U32: return "BEXTR_U32"; case ND_ADDFETCH: return "ADDFETCH"; case ND_FPCLASSIFY: return "FPCLASSIFY"; case ND_ISUNORDERED: return "ISUNORDERED"; case ND_SIGNBIT: return "SIGNBIT"; case ND_SIGNBITF: return "SIGNBITF"; case ND_SIGNBITL: return "SIGNBITL"; case ND_ATOMIC_IS_LOCK_FREE: return "ATOMIC_IS_LOCK_FREE"; case ND_PSUBUSB256: return "PSUBUSB256"; case ND_PCMPGTB256_MASK: return "PCMPGTB256_MASK"; case ND_PSHUFB256: return "PSHUFB256"; case ND_PBLENDVB256: return "PBLENDVB256"; case ND_PSRLDQI256: return "PSRLDQI256"; case ND_PSLLDQI256: return "PSLLDQI256"; case ND_VINSERTF128_SI256: return "VINSERTF128_SI256"; case ND_SI256_SI: return "SI256_SI"; case ND_SI_SI256: return "SI_SI256"; case ND_PALIGNR256: return "PALIGNR256"; case ND_VPERM2I128_SI256: return "VPERM2I128_SI256"; case ND_PBLENDD256: return "PBLENDD256"; case ND_VEXTRACTF128_SI256: return "VEXTRACTF128_SI256"; case ND_VECEXTV16QI: return "VEC_EXT_V16QI"; case ND_VECEXTV8HI: return "VEC_EXT_V8HI"; case ND_ANDNOTSI256: return "ANDNOTSI256"; case ND_VECEXTV2DI: return "VEC_EXT_V2DI"; case ND_PMULHUW256: return "PMULHUW256"; case ND_PD256_PD: return "PD256_PD"; case ND_PS256_PS: return "PS256_PS"; case ND_PSRLQI256: return "PSRLQI256"; case ND_PSLLQI256: return "PSLLQI256"; case ND_PERMDI256: return "PERMDI256"; case ND_PSLLDI256: return "PSLLDI256"; case ND_PSRLDI256: return "PSRLDI256"; case ND_PSRADI256: return "PSRADI256"; default: return "UNREACHABLE"; } } //from COSMOPOLITAN adding function ConsumeStringLiteral char *ConsumeStringLiteral(Token **rest, Token *tok) { char *s; if (tok->kind != TK_STR || tok->ty->base->kind != TY_CHAR) { error_tok(tok, "%s:%d: in ConsumeStringLiteral : expected string literal but got tok->kind %d", __FILE__, __LINE__, tok->kind); } s = tok->str; *rest = tok->next; return s; } //from COSMOPOLITAN adding function static_assertion static Token *static_assertion(Token *tok) { char *msg; Token *start = tok; Token *errmsg = tok; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); int64_t cond = const_expr(&tok, tok); if (consume(&tok, tok, ",")) { errmsg = tok; msg = ConsumeStringLiteral(&tok, tok); } else { msg = "static assertion failed"; } SET_CTX(ctx); tok = skip(tok, ")", ctx); SET_CTX(ctx); tok = skip(tok, ";", ctx); if (!cond) { error_tok(start, "%s:%d: in static_assertion : %s %s", __FILE__, __LINE__, msg, errmsg->loc); } return tok; } // this function checks if we have an old C style function declaration static bool check_old_style(Token **rest, Token *tok) { Token *start = tok; is_old_style = false; while (tok->kind != TK_EOF && !equal(tok, "{")) { //found a function body if (equal(tok, ";") && equal(tok->next, "{")) { tok = start; return true; } //if function declaration ending with ";" exit if (equal(tok, ")") && equal(tok->next, ";")) { break; } if (equal(tok, "}")) { break; } tok = tok->next; } tok = start; return false; } static Token * old_style_params(Token **rest, Token *tok, Type *ty) { int nbparms = 0; bool first = true; while(!equal(tok, ")")) { //first count the number of parameters if (!first) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } first = false; ArrayTokenOrder[nbFunc][nbparms] = tok; nbparms++; tok = tok->next; } ArrayTokenOrderCount[nbFunc] = nbparms; tok = tok->next; return tok; } static Node *ParseBuiltin(NodeKind kind, Token *tok, Token **rest) { Node *node = new_node(kind, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->builtin_val = assign(&tok, tok); add_type(node->builtin_val); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } //from cosmopolitan managing builtin atomics static Node *ParseAtomic2(NodeKind kind, Token *tok, Token **rest) { Node *node = new_node(kind, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); node->ty = node->lhs->ty->base; if (equal(tok, ",")) { SET_CTX(ctx); tok = skip(tok, ",", ctx); node->memorder = const_expr(&tok, tok); } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } static Node *ParseAtomic3(NodeKind kind, Token *tok, Token **rest) { Node *node = new_node(kind, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); node->ty = node->lhs->ty->base; SET_CTX(ctx); tok = skip(tok, ",", ctx); node->rhs = assign(&tok, tok); add_type(node->rhs); // Check if there's a comma, indicating a memory order argument if (equal(tok, ",")) { SET_CTX(ctx); tok = skip(tok, ",", ctx); node->memorder = const_expr(&tok, tok); } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } static Node *ParseAtomicFetch(NodeKind kind, Token *tok, Token **rest) { Token *start = tok; SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Node *obj = new_unary(ND_DEREF, assign(&tok, tok), start); SET_CTX(ctx); tok = skip(tok, ",", ctx); Node *val = assign(&tok, tok); int memorder = __ATOMIC_SEQ_CST; if (equal(tok, ",")) { tok = skip(tok, ",", ctx); memorder = const_expr(&tok, tok); } SET_CTX(ctx); *rest = skip(tok, ")", ctx); Node *binary; char *loc = start->loc + 23; int len = start->len - 23; if (!strncmp("add", loc, len)) binary = new_add(obj, val, start, false); else if (!strncmp("sub", loc, len)) binary = new_sub(obj, val, start, false); else if (!strncmp("and", loc, len)) binary = new_binary(ND_BITAND, obj, val, start); else if (!strncmp("or", loc, len)) binary = new_binary(ND_BITOR, obj, val, start); else if (!strncmp("xor", loc, len)) binary = new_binary(ND_BITXOR, obj, val, start); else error_tok(start, "%s:%d: in ParseAtomicFetch: unsupported atomic fetch op!", __FILE__, __LINE__); binary->memorder = memorder; add_type(binary->lhs); add_type(binary->rhs); return atomic_op(binary, true); } static Node *ParseAtomicCompareExchangeN(NodeKind kind, Token *tok, Token **rest) { Node *node = new_node(kind, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->cas_ptr = assign(&tok, tok); add_type(node->cas_ptr); tok = skip(tok, ",", ctx); node->cas_expected = assign(&tok, tok); add_type(node->cas_expected); tok = skip(tok, ",", ctx); node->cas_desired = assign(&tok, tok); add_type(node->cas_desired); tok = skip(tok, ",", ctx); node->cas_weak = assign(&tok, tok); add_type(node->cas_weak); tok = skip(tok, ",", ctx); node->cas_success = assign(&tok, tok); add_type(node->cas_success); tok = skip(tok, ",", ctx); node->cas_failure = assign(&tok, tok); add_type(node->cas_failure); *rest = skip(tok, ")", ctx); node->ty = ty_bool; return node; } //builtin function memcpy static Node *parse_memcpy(Token *tok, Token **rest) { Node *node = new_node(ND_BUILTIN_MEMCPY, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->builtin_dest = assign(&tok, tok); add_type(node->builtin_dest); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_src = assign(&tok, tok); add_type(node->builtin_src); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_size = assign(&tok, tok); add_type(node->builtin_size); node->builtin_size = new_cast(node->builtin_size, ty_ulong); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } static Node *parse_memset(Token *tok, Token **rest) { Node *node = new_node(ND_BUILTIN_MEMSET, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->builtin_dest = assign(&tok, tok); add_type(node->builtin_dest); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_val = assign(&tok, tok); add_type(node->builtin_val); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_size = assign(&tok, tok); add_type(node->builtin_size); node->builtin_size = new_cast(node->builtin_size, ty_ulong); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } static Node *ParseAtomicFence(NodeKind kind, Token *tok, Token **rest) { Node *node = new_node(kind, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); // memory order add_type(node->lhs); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } static Node *ParseAtomicClear(NodeKind kind, Token *tok, Token **rest) { Node *node = new_node(kind, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); // pointer add_type(node->lhs); node->ty = node->lhs->ty->base; // __atomic_clear has a second argument for memory order if (equal(tok, ",")) { SET_CTX(ctx); tok = skip(tok, ",", ctx); node->memorder = const_expr(&tok, tok); } SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } static Node *parse_overflow(NodeKind kind, Token *tok, Token **rest) { // Parse the arguments for __builtin_add_overflow Node *node = new_node(kind, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->lhs = assign(&tok, tok); add_type(node->lhs); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->rhs = assign(&tok, tok); add_type(node->rhs); SET_CTX(ctx); tok = skip(tok, ",", ctx); node->builtin_dest = assign(&tok, tok); add_type(node->builtin_dest); SET_CTX(ctx); *rest = skip(tok, ")", ctx); return node; } // //the goal of this function is to put the correct type for the correct parameter order in case of old C style K&R // // example : // // void test_compress(compr, comprLen, uncompr, uncomprLen) char *compr, // // *uncompr; // // long comprLen, uncomprLen; // // the order of parameters inside parenthesis doesn't correspond to the declaration of each parameter. // // that's why this function found the parameter order and update the type for this order and returns new ty->params following // // the expected order and not the declaration order. It's quite complex and probably we can find an easiest way to do it static Type *old_params(Type *ty, int nbparms) { Type head = {}; Type *cur = &head; bool isOrdered = true; int nborder = ArrayTokenOrderCount[nbFunc]; // Check if parameters are already in order for (int i = 0; i < nbparms && i < nborder; i++) { if (strncmp(ArrayTokenOrder[nbFunc][i]->loc, ArrayToken[nbFunc][i]->loc, ArrayToken[nbFunc][i]->len) != 0) { isOrdered = false; break; } } // If parameters are already in order, return the original type list if (isOrdered) { return ty; } // If not in order, create a new Type list with parameters in correct order for (int i = 0; i < nborder; i++) { bool found = false; for (int j = 0; j < nbparms; j++) { if (strncmp(ArrayTokenOrder[nbFunc][i]->loc, ArrayToken[nbFunc][j]->loc, ArrayTokenOrder[nbFunc][i]->len) == 0) { cur = cur->next = copy_type(ArrayType[nbFunc][j]); found = true; break; } } if (!found) { Type *t = copy_type(ty_int); t->name = ArrayTokenOrder[nbFunc][i]; cur = cur->next = t; } } return head.next; } static Node *parse_huge_val(double fval, Token *tok, Token **rest) { Node *node = new_double(fval, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); SET_CTX(ctx); tok = skip(tok, ")", ctx); *rest = tok; return node; } static int64_t eval_sign_extend(Type *ty, uint64_t val) { switch (ty->size) { case 1: return ty->is_unsigned ? (uint8_t)val : (int64_t)(int8_t)val; case 2: return ty->is_unsigned ? (uint16_t)val : (int64_t)(int16_t)val; case 4: return ty->is_unsigned ? (uint32_t)val : (int64_t)(int32_t)val; case 8: return val; case 16: return ty->is_unsigned ? (uint64_t)val : (int64_t)val; } printf("====FATAL ERROR %ld\n", ty->size ); unreachable(); } static bool is_const_var(Obj *var) { Type *ty = var->ty; for (; ty && ty->kind == TY_ARRAY; ty = ty->base) if (ty->is_const) return true; return ty->is_const; } static Obj *eval_var(Node *expr, bool allow_local) { if (expr->kind != ND_VAR) return NULL; Obj *var = expr->var; if (!var) return NULL; if (var->is_compound_lit) return var; if (!allow_local && (var->is_static || var->is_definition) && var->init_data && is_const_var(var)) return var; return NULL; } static bool is_str_tok(Token **rest, Token *tok, Token **str_tok) { if (equal(tok, "(") && is_str_tok(&tok, tok->next, str_tok) && consume(rest, tok, ")")) return true; if (tok->kind == TK_STR) { *str_tok = tok; *rest = tok->next; return true; } return false; } static BuiltinEntry builtin_table[] = { { "__builtin_ia32_packssdw", ND_PACKSSDW }, { "__builtin_ia32_packsswb", ND_PACKSSWB }, { "__builtin_ia32_packuswb", ND_PACKUSWB }, { "__builtin_ia32_punpckhbw", ND_PUNPCKHBW }, { "__builtin_ia32_punpckhwd", ND_PUNPCKHWD }, { "__builtin_ia32_punpckhdq", ND_PUNPCKHDQ }, { "__builtin_ia32_punpcklbw", ND_PUNPCKLBW }, { "__builtin_ia32_punpcklwd", ND_PUNPCKLWD }, { "__builtin_ia32_punpckldq", ND_PUNPCKLDQ }, { "__builtin_ia32_paddb", ND_PADDB }, { "__builtin_ia32_paddw", ND_PADDW }, { "__builtin_ia32_paddd", ND_PADDD }, { "__builtin_ia32_paddq", ND_PADDQ }, { "__builtin_ia32_paddsb", ND_PADDSB }, { "__builtin_ia32_paddsw", ND_PADDSW }, { "__builtin_ia32_paddusb", ND_PADDUSB }, { "__builtin_ia32_paddusw", ND_PADDUSW }, { "__builtin_ia32_psubb", ND_PSUBB }, { "__builtin_ia32_psubw", ND_PSUBW }, { "__builtin_ia32_psubd", ND_PSUBD }, { "__builtin_ia32_psubq", ND_PSUBQ }, { "__builtin_ia32_psubsb", ND_PSUBSB }, { "__builtin_ia32_psubsw", ND_PSUBSW }, { "__builtin_ia32_psubusb", ND_PSUBUSB }, { "__builtin_ia32_psubusw", ND_PSUBUSW }, { "__builtin_ia32_pmaddwd", ND_PMADDWD }, { "__builtin_ia32_pmulhw", ND_PMULHW }, { "__builtin_ia32_pmullw", ND_PMULLW }, { "__builtin_ia32_psllw", ND_PSLLW }, { "__builtin_ia32_psllwi", ND_PSLLWI }, { "__builtin_ia32_pslld", ND_PSLLD }, { "__builtin_ia32_pslldi", ND_PSLLDI }, { "__builtin_ia32_psllq", ND_PSLLQ }, { "__builtin_ia32_psllqi", ND_PSLLQI }, { "__builtin_ia32_psraw", ND_PSRAW }, { "__builtin_ia32_psrawi", ND_PSRAWI }, { "__builtin_ia32_psrad", ND_PSRAD }, { "__builtin_ia32_psradi", ND_PSRADI }, { "__builtin_ia32_psrlw", ND_PSRLW }, { "__builtin_ia32_psrlwi", ND_PSRLWI }, { "__builtin_ia32_psrld", ND_PSRLD }, { "__builtin_ia32_psrldi", ND_PSRLDI }, { "__builtin_ia32_psrlq", ND_PSRLQ }, { "__builtin_ia32_psrlqi", ND_PSRLQI }, { "__builtin_ia32_pand", ND_PAND }, { "__builtin_ia32_pandn", ND_PANDN }, { "__builtin_ia32_por", ND_POR }, { "__builtin_ia32_pxor", ND_PXOR }, { "__builtin_ia32_pcmpeqb", ND_PCMPEQB }, { "__builtin_ia32_pcmpgtb", ND_PCMPGTB }, { "__builtin_ia32_pcmpeqw", ND_PCMPEQW }, { "__builtin_ia32_pcmpgtw", ND_PCMPGTW }, { "__builtin_ia32_pcmpeqd", ND_PCMPEQD }, { "__builtin_ia32_pcmpgtd", ND_PCMPGTD }, { "__builtin_ia32_vec_init_v4hi", ND_VECINITV4HI }, { "__builtin_ia32_vec_init_v8qi", ND_VECINITV8QI }, { "__builtin_ia32_vec_init_v2si", ND_VECINITV2SI }, { "__builtin_ia32_vec_ext_v2si", ND_VECEXTV2SI }, { "__builtin_ia32_vec_ext_v4si", ND_VECEXTV4SI }, { "__builtin_ia32_emms", ND_EMMS }, { "__builtin_ia32_sfence", ND_SFENCE }, { "__builtin_ia32_lfence", ND_LFENCE }, { "__builtin_ia32_mfence", ND_MFENCE }, { "__builtin_ia32_pause", ND_PAUSE }, { "__builtin_ia32_stmxcsr", ND_STMXCSR }, { "__builtin_ia32_ldmxcsr", ND_LDMXCSR }, { "__builtin_ia32_cvtpi2ps", ND_CVTPI2PS }, { "__builtin_ia32_cvtps2pi", ND_CVTPS2PI }, { "__builtin_ia32_addss", ND_ADDSS }, { "__builtin_ia32_subss", ND_SUBSS }, { "__builtin_ia32_mulss", ND_MULSS }, { "__builtin_ia32_divss", ND_DIVSS }, { "__builtin_ia32_sqrtss", ND_SQRTSS }, { "__builtin_ia32_sqrtps", ND_SQRTPS }, { "__builtin_ia32_rcpss", ND_RCPSS }, { "__builtin_ia32_rsqrtss", ND_RSQRTSS }, { "__builtin_ia32_rsqrtps", ND_RSQRTPS }, { "__builtin_ia32_minss", ND_MINSS }, { "__builtin_ia32_minps", ND_MINPS }, { "__builtin_ia32_maxss", ND_MAXSS }, { "__builtin_ia32_maxps", ND_MAXPS }, { "__builtin_ia32_rcpps", ND_RCPPS }, { "__builtin_ia32_andps", ND_ANDPS }, { "__builtin_ia32_andnps", ND_ANDNPS }, { "__builtin_ia32_orps", ND_ORPS }, { "__builtin_ia32_xorps", ND_XORPS }, { "__builtin_ia32_cmpeqss", ND_CMPEQSS }, { "__builtin_ia32_cmpltss", ND_CMPLTSS }, { "__builtin_ia32_cmpless", ND_CMPLESS }, { "__builtin_ia32_movss", ND_MOVSS }, { "__builtin_ia32_cmpneqss", ND_CMPNEQSS }, { "__builtin_ia32_cmpnltss", ND_CMPNLTSS }, { "__builtin_ia32_cmpnless", ND_CMPNLESS }, { "__builtin_ia32_cmpordss", ND_CMPORDSS }, { "__builtin_ia32_cmpunordss", ND_CMPUNORDSS }, { "__builtin_ia32_cmpeqps", ND_CMPEQPS }, { "__builtin_ia32_cmpltps", ND_CMPLTPS }, { "__builtin_ia32_cmpleps", ND_CMPLEPS }, { "__builtin_ia32_cmpgtps", ND_CMPGTPS }, { "__builtin_ia32_cmpgeps", ND_CMPGEPS }, { "__builtin_ia32_cmpneqps", ND_CMPNEQPS }, { "__builtin_ia32_cmpnltps", ND_CMPNLTPS }, { "__builtin_ia32_cmpnleps", ND_CMPNLEPS }, { "__builtin_ia32_cmpngtps", ND_CMPNGTPS }, { "__builtin_ia32_cmpngeps", ND_CMPNGEPS }, { "__builtin_ia32_cmpordps", ND_CMPORDPS }, { "__builtin_ia32_cmpunordps", ND_CMPUNORDPS }, { "__builtin_ia32_comieq", ND_COMIEQ }, { "__builtin_ia32_comilt", ND_COMILT }, { "__builtin_ia32_comile", ND_COMILE }, { "__builtin_ia32_comigt", ND_COMIGT }, { "__builtin_ia32_comige", ND_COMIGE }, { "__builtin_ia32_comineq", ND_COMINEQ }, { "__builtin_ia32_ucomieq", ND_UCOMIEQ }, { "__builtin_ia32_ucomilt", ND_UCOMILT }, { "__builtin_ia32_ucomile", ND_UCOMILE }, { "__builtin_ia32_ucomigt", ND_UCOMIGT }, { "__builtin_ia32_ucomige", ND_UCOMIGE }, { "__builtin_ia32_ucomineq", ND_UCOMINEQ }, { "__builtin_ia32_cvtss2si", ND_CVTSS2SI }, { "__builtin_ia32_cvtss2si64", ND_CVTSS2SI64 }, { "__builtin_ia32_cvttss2si", ND_CVTTSS2SI }, { "__builtin_ia32_cvttss2si64", ND_CVTTSS2SI64 }, { "__builtin_ia32_cvttps2pi", ND_CVTTPS2PI }, { "__builtin_ia32_cvtsi2ss", ND_CVTSI2SS }, { "__builtin_ia32_cvtsi642ss", ND_CVTSI642SS }, { "__builtin_ia32_movlhps", ND_MOVLHPS }, { "__builtin_ia32_movhlps", ND_MOVHLPS }, { "__builtin_ia32_unpckhps", ND_UNPCKHPS }, { "__builtin_ia32_unpcklps", ND_UNPCKLPS }, { "__builtin_ia32_loadhps", ND_LOADHPS }, { "__builtin_ia32_storehps", ND_STOREHPS }, { "__builtin_ia32_loadlps", ND_LOADLPS }, { "__builtin_ia32_storelps", ND_STORELPS }, { "__builtin_ia32_movmskps", ND_MOVMSKPS }, { "__builtin_ia32_shufps", ND_SHUFPS }, { "__builtin_shuffle", ND_SHUFFLE }, { "__builtin_ia32_pmaxsw", ND_PMAXSW }, { "__builtin_ia32_pmaxub", ND_PMAXUB }, { "__builtin_ia32_pminsw", ND_PMINSW }, { "__builtin_ia32_pminub", ND_PMINUB }, { "__builtin_ia32_clflush", ND_CLFLUSH }, { "_mm_clflush", ND_CLFLUSH }, { "__builtin_ia32_pmovmskb", ND_PMOVMSKB }, { "__builtin_ia32_pmulhuw", ND_PMULHUW }, { "__builtin_ia32_maskmovq", ND_MASKMOVQ }, { "__builtin_ia32_pavgb", ND_PAVGB }, { "__builtin_ia32_pavgw", ND_PAVGW }, { "__builtin_ia32_psadbw", ND_PSADBW }, { "__builtin_ia32_movntq", ND_MOVNTQ }, { "__builtin_ia32_movntps", ND_MOVNTPS }, { "__builtin_ia32_shufpd", ND_SHUFPD }, { "__builtin_ia32_addsd", ND_ADDSD }, { "__builtin_ia32_subsd", ND_SUBSD }, { "__builtin_ia32_mulsd", ND_MULSD }, { "__builtin_ia32_divsd", ND_DIVSD }, { "__builtin_ia32_sqrtpd", ND_SQRTPD }, { "__builtin_ia32_movsd", ND_MOVSD }, { "__builtin_ia32_sqrtsd", ND_SQRTSD }, { "__builtin_ia32_minpd", ND_MINPD }, { "__builtin_ia32_minsd", ND_MINSD }, { "__builtin_ia32_maxpd", ND_MAXPD }, { "__builtin_ia32_maxsd", ND_MAXSD }, { "__builtin_ia32_andpd", ND_ANDPD }, { "__builtin_ia32_andnpd", ND_ANDNPD }, { "__builtin_ia32_orpd", ND_ORPD }, { "__builtin_ia32_xorpd", ND_XORPD }, { "__builtin_ia32_cmpeqpd", ND_CMPEQPD }, { "__builtin_ia32_cmpltpd", ND_CMPLTPD }, { "__builtin_ia32_cmplepd", ND_CMPLEPD }, { "__builtin_ia32_cmpgtpd", ND_CMPGTPD }, { "__builtin_ia32_cmpgepd", ND_CMPGEPD }, { "__builtin_ia32_cmpneqpd", ND_CMPNEQPD }, { "__builtin_ia32_cmpnltpd", ND_CMPNLTPD }, { "__builtin_ia32_cmpnlepd", ND_CMPNLEPD }, { "__builtin_ia32_cmpngtpd", ND_CMPNGTPD }, { "__builtin_ia32_cmpngepd", ND_CMPNGEPD }, { "__builtin_ia32_cmpordpd", ND_CMPORDPD }, { "__builtin_ia32_cmpunordpd", ND_CMPUNORDPD }, { "__builtin_ia32_cmpeqsd", ND_CMPEQSD }, { "__builtin_ia32_cmpltsd", ND_CMPLTSD }, { "__builtin_ia32_cmplesd", ND_CMPLESD }, { "__builtin_ia32_cmpneqsd", ND_CMPNEQSD }, { "__builtin_ia32_cmpnltsd", ND_CMPNLTSD }, { "__builtin_ia32_cmpnlesd", ND_CMPNLESD }, { "__builtin_ia32_cmpordsd", ND_CMPORDSD }, { "__builtin_ia32_cmpunordsd", ND_CMPUNORDSD }, { "__builtin_ia32_comisdeq", ND_COMISDEQ }, { "__builtin_ia32_comisdlt", ND_COMISDLT}, { "__builtin_ia32_comisdle", ND_COMISDLE}, { "__builtin_ia32_comisdgt", ND_COMISDGT}, { "__builtin_ia32_comisdge", ND_COMISDGE}, { "__builtin_ia32_comisdneq", ND_COMISDNEQ}, { "__builtin_ia32_ucomisdeq", ND_UCOMISDEQ }, { "__builtin_ia32_ucomisdlt", ND_UCOMISDLT}, { "__builtin_ia32_ucomisdle", ND_UCOMISDLE}, { "__builtin_ia32_ucomisdgt", ND_UCOMISDGT}, { "__builtin_ia32_ucomisdge", ND_UCOMISDGE}, { "__builtin_ia32_ucomisdneq", ND_UCOMISDNEQ}, { "__builtin_ia32_movq128", ND_MOVQ128}, { "__builtin_ia32_cvtdq2pd", ND_CVTDQ2PD}, { "__builtin_ia32_cvtdq2ps", ND_CVTDQ2PS}, { "__builtin_ia32_cvtpd2dq", ND_CVTPD2DQ}, { "__builtin_ia32_cvtpd2pi", ND_CVTPD2PI}, { "__builtin_ia32_cvtpd2ps", ND_CVTPD2PS}, { "__builtin_ia32_cvttpd2dq", ND_CVTTPD2DQ}, { "__builtin_ia32_cvttpd2pi", ND_CVTTPD2PI}, { "__builtin_ia32_cvtpi2pd", ND_CVTPI2PD}, { "__builtin_ia32_cvtps2dq", ND_CVTPS2DQ}, { "__builtin_ia32_cvttps2dq", ND_CVTTPS2DQ}, { "__builtin_ia32_cvtps2pd", ND_CVTPS2PD}, { "__builtin_ia32_cvtsd2si", ND_CVTSD2SI}, { "__builtin_ia32_cvtsd2si64", ND_CVTSD2SI64}, { "__builtin_ia32_cvttsd2si", ND_CVTTSD2SI}, { "__builtin_ia32_cvttsd2si64", ND_CVTTSD2SI64}, { "__builtin_ia32_cvtsd2ss", ND_CVTSD2SS}, { "__builtin_ia32_cvtsi2sd", ND_CVTSI2SD}, { "__builtin_ia32_cvtsi642sd", ND_CVTSI642SD}, { "__builtin_ia32_cvtss2sd", ND_CVTSS2SD}, { "__builtin_ia32_unpckhpd", ND_UNPCKHPD}, { "__builtin_ia32_unpcklpd", ND_UNPCKLPD}, { "__builtin_ia32_loadhpd", ND_LOADHPD }, { "__builtin_ia32_loadlpd", ND_LOADLPD }, { "__builtin_ia32_movmskpd", ND_MOVMSKPD }, { "__builtin_ia32_packsswb128", ND_PACKSSWB128 }, { "__builtin_ia32_packssdw128", ND_PACKSSDW128 }, { "__builtin_ia32_packuswb128", ND_PACKUSWB128 }, { "__builtin_ia32_punpckhbw128", ND_PUNPCKHBW128 }, { "__builtin_ia32_punpckhwd128", ND_PUNPCKHWD128 }, { "__builtin_ia32_punpckhdq128", ND_PUNPCKHDQ128 }, { "__builtin_ia32_punpckhqdq128", ND_PUNPCKHQDQ128 }, { "__builtin_ia32_punpcklbw128", ND_PUNPCKLBW128 }, { "__builtin_ia32_punpcklwd128", ND_PUNPCKLWD128 }, { "__builtin_ia32_punpckldq128", ND_PUNPCKLDQ128 }, { "__builtin_ia32_punpcklqdq128", ND_PUNPCKLQDQ128 }, { "__builtin_ia32_paddsb128", ND_PADDSB128 }, { "__builtin_ia32_paddsw128", ND_PADDSW128 }, { "__builtin_ia32_paddusb128", ND_PADDUSB128 }, { "__builtin_ia32_paddusw128", ND_PADDUSW128 }, { "__builtin_ia32_psubsb128", ND_PSUBSB128 }, { "__builtin_ia32_psubsw128", ND_PSUBSW128 }, { "__builtin_ia32_psubusb128", ND_PSUBUSB128 }, { "__builtin_ia32_psubusw128", ND_PSUBUSW128 }, { "__builtin_ia32_pmaddwd128", ND_PMADDWD128 }, { "__builtin_ia32_pmulhw128", ND_PMULHW128 }, { "__builtin_ia32_pmuludq", ND_PMULUDQ }, { "__builtin_ia32_pmuludq128", ND_PMULUDQ128 }, { "__builtin_ia32_psllwi128", ND_PSLLWI128 }, { "__builtin_ia32_pslldi128", ND_PSLLDI128 }, { "__builtin_ia32_psllqi128", ND_PSLLQI128 }, { "__builtin_ia32_psrawi128", ND_PSRAWI128 }, { "__builtin_ia32_psradi128", ND_PSRADI128 }, { "__builtin_ia32_psrlwi128", ND_PSRLWI128 }, { "__builtin_ia32_psrldi128", ND_PSRLDI128 }, { "__builtin_ia32_psrlqi128", ND_PSRLQI128 }, { "__builtin_ia32_psllw128", ND_PSLLW128 }, { "__builtin_ia32_pslld128", ND_PSLLD128 }, { "__builtin_ia32_psllq128", ND_PSLLQ128 }, { "__builtin_ia32_psraw128", ND_PSRAW128 }, { "__builtin_ia32_psrad128", ND_PSRAD128 }, { "__builtin_ia32_psrlw128", ND_PSRLW128 }, { "__builtin_ia32_psrld128", ND_PSRLD128 }, { "__builtin_ia32_psrlq128", ND_PSRLQ128 }, { "__builtin_ia32_pandn128", ND_PANDN128 }, { "__builtin_ia32_pmaxsw128", ND_PMAXSW128 }, { "__builtin_ia32_pmaxub128", ND_PMAXUB128 }, { "__builtin_ia32_pminsw128", ND_PMINSW128 }, { "__builtin_ia32_pminub128", ND_PMINUB128 }, { "__builtin_ia32_pmovmskb128", ND_PMOVMSKB128 }, { "__builtin_ia32_pmulhuw128", ND_PMULHUW128 }, { "__builtin_ia32_maskmovdqu", ND_MASKMOVDQU }, { "__builtin_ia32_pavgb128", ND_PAVGB128 }, { "__builtin_ia32_pavgw128", ND_PAVGW128 }, { "__builtin_ia32_psadbw128", ND_PSADBW128 }, { "__builtin_ia32_movnti", ND_MOVNTI }, { "__builtin_ia32_movnti64", ND_MOVNTI64 }, { "__builtin_ia32_movntdq", ND_MOVNTDQ }, { "__builtin_ia32_movntpd", ND_MOVNTPD }, { "__builtin_parity", ND_PARITY }, { "__builtin_parityl", ND_PARITYL }, { "__builtin_parityll", ND_PARITYLL }, { "__builtin_ia32_mwait", ND_MWAIT }, { "__builtin_ia32_monitor", ND_MONITOR }, { "__builtin_ia32_addsubps", ND_ADDSUBPS }, { "__builtin_ia32_haddps", ND_HADDPS }, { "__builtin_ia32_hsubps", ND_HSUBPS }, { "__builtin_ia32_movshdup", ND_MOVSHDUP }, { "__builtin_ia32_movsldup", ND_MOVSLDUP }, { "__builtin_ia32_addsubpd", ND_ADDSUBPD }, { "__builtin_ia32_haddpd", ND_HADDPD }, { "__builtin_ia32_hsubpd", ND_HSUBPD }, { "__builtin_ia32_lddqu", ND_LDDQU }, { "__builtin_ia32_phaddw128", ND_PHADDW128 }, { "__builtin_ia32_phaddd128", ND_PHADDD128 }, { "__builtin_ia32_phaddsw128", ND_PHADDSW128 }, { "__builtin_ia32_phaddw", ND_PHADDW }, { "__builtin_ia32_phaddd", ND_PHADDD }, { "__builtin_ia32_phaddsw", ND_PHADDSW }, { "__builtin_ia32_phsubw128", ND_PHSUBW128 }, { "__builtin_ia32_phsubd128", ND_PHSUBD128 }, { "__builtin_ia32_phsubsw128", ND_PHSUBSW128 }, { "__builtin_ia32_phsubw", ND_PHSUBW }, { "__builtin_ia32_phsubd", ND_PHSUBD }, { "__builtin_ia32_phsubsw", ND_PHSUBSW }, { "__builtin_ia32_pmaddubsw128", ND_PMADDUBSW128 }, { "__builtin_ia32_pmaddubsw", ND_PMADDUBSW }, { "__builtin_ia32_pmulhrsw128", ND_PMULHRSW128 }, { "__builtin_ia32_pmulhrsw", ND_PMULHRSW }, { "__builtin_ia32_pshufb128", ND_PSHUFB128 }, { "__builtin_ia32_pshufb", ND_PSHUFB }, { "__builtin_ia32_psignb128", ND_PSIGNB128 }, { "__builtin_ia32_psignw128", ND_PSIGNW128 }, { "__builtin_ia32_psignd128", ND_PSIGND128 }, { "__builtin_ia32_psignb", ND_PSIGNB }, { "__builtin_ia32_psignw", ND_PSIGNW }, { "__builtin_ia32_psignd", ND_PSIGND }, { "__builtin_ia32_pabsb128", ND_PABSB128 }, { "__builtin_ia32_pabsw128", ND_PABSW128 }, { "__builtin_ia32_pabsd128", ND_PABSD128 }, { "__builtin_ia32_pabsb", ND_PABSB }, { "__builtin_ia32_pabsw", ND_PABSW }, { "__builtin_ia32_pabsd", ND_PABSD }, { "__builtin_ia32_ptestz128", ND_PTESTZ128 }, { "__builtin_ia32_ptestc128", ND_PTESTC128 }, { "__builtin_ia32_ptestnzc128", ND_PTESTNZC128 }, { "__builtin_ia32_pblendvb128", ND_PBLENDVB128 }, { "__builtin_ia32_blendvps", ND_BLENDVPS }, { "__builtin_ia32_blendvpd", ND_BLENDVPD }, { "__builtin_ia32_pminsb128", ND_PMINSB128 }, { "__builtin_ia32_pmaxsb128", ND_PMAXSB128 }, { "__builtin_ia32_pminuw128", ND_PMINUW128 }, { "__builtin_ia32_pmaxuw128", ND_PMAXUW128 }, { "__builtin_ia32_pminsd128", ND_PMINSD128 }, { "__builtin_ia32_pmaxsd128", ND_PMAXSD128 }, { "__builtin_ia32_pminud128", ND_PMINUD128 }, { "__builtin_ia32_pmaxud128", ND_PMAXUD128 }, { "__builtin_ia32_pmuldq128", ND_PMULDQ128 }, { "__builtin_ia32_phminposuw128", ND_PHMINPOSUW128 }, { "__builtin_ia32_pmovsxbd128", ND_PMOVSXBD128 }, { "__builtin_ia32_pmovsxwd128", ND_PMOVSXWD128 }, { "__builtin_ia32_pmovsxbq128", ND_PMOVSXBQ128 }, { "__builtin_ia32_pmovsxdq128", ND_PMOVSXDQ128 }, { "__builtin_ia32_pmovsxwq128", ND_PMOVSXWQ128 }, { "__builtin_ia32_pmovsxbw128", ND_PMOVSXBW128 }, { "__builtin_ia32_pmovzxbd128", ND_PMOVZXBD128 }, { "__builtin_ia32_pmovzxwd128", ND_PMOVZXWD128 }, { "__builtin_ia32_pmovzxbq128", ND_PMOVZXBQ128 }, { "__builtin_ia32_pmovzxdq128", ND_PMOVZXDQ128 }, { "__builtin_ia32_pmovzxwq128", ND_PMOVZXWQ128 }, { "__builtin_ia32_pmovzxbw128", ND_PMOVZXBW128 }, { "__builtin_ia32_packusdw128", ND_PACKUSDW128 }, { "__builtin_ia32_movntdqa", ND_MOVNTDQA }, { "__builtin_ia32_crc32qi", ND_CRC32QI }, { "__builtin_ia32_crc32hi", ND_CRC32HI }, { "__builtin_ia32_crc32si", ND_CRC32SI }, { "__builtin_ia32_crc32di", ND_CRC32DI }, { "__builtin_ia32_pshufd", ND_PSHUFD }, { "__builtin_prefetch", ND_PREFETCH }, { "__builtin_ia32_rdtsc", ND_RDTSC }, { "__builtin_ia32_readeflags_u64", ND_READEFLAGS_U64 }, { "__builtin_ia32_rdsspq", ND_RDSSPQ }, { "__builtin_ia32_saveprevssp", ND_SAVEPREVSSP }, { "__builtin_ia32_setssbsy", ND_SETSSBSY }, { "__builtin_ia32_slwpcb", ND_SLWPCB }, { "__builtin_ia32_rdpkru", ND_RDPKRU }, { "__builtin_ia32_xbegin", ND_XBEGIN }, { "__builtin_ia32_xend", ND_XEND }, { "__builtin_ia32_serialize", ND_SERIALIZE }, { "__builtin_ia32_xsusldtrk", ND_XSUSLDTRK }, { "__builtin_ia32_xresldtrk", ND_XRESLDTRK }, { "__builtin_ia32_clui", ND_CLUI }, { "__builtin_ia32_stui", ND_STUI }, { "__builtin_ia32_testui", ND_TESTUI }, { "__builtin_ia32_wbnoinvd", ND_WBNOINVD }, { "__builtin_ia32_xtest", ND_XTEST }, { "__builtin_ia32_wbinvd", ND_WBINVD }, { "__builtin_ia32_rdpid", ND_RDPID }, { "__builtin_ia32_rdfsbase32", ND_RDFSBASE32 }, { "__builtin_ia32_rdfsbase64", ND_RDFSBASE64 }, { "__builtin_ia32_rdgsbase32", ND_RDGSBASE32 }, { "__builtin_ia32_rdgsbase64", ND_RDGSBASE64 }, { "__builtin_ia32_vzeroall", ND_VZEROALL }, { "__builtin_ia32_vzeroupper", ND_VZEROUPPER }, { "__builtin_ia32_femms", ND_FEMMS }, { "__builtin_ia32_bsrsi", ND_BSRSI }, { "__builtin_ia32_rdpmc", ND_RDPMC }, { "__builtin_ia32_rdtscp", ND_RDTSCP }, { "__builtin_ia32_rolqi", ND_ROLQI }, { "__builtin_ia32_rolhi", ND_ROLHI }, { "__builtin_ia32_rorqi", ND_RORQI }, { "__builtin_ia32_rorhi", ND_RORHI }, { "__builtin_ia32_bsrdi", ND_BSRDI }, { "__builtin_ia32_writeeflags_u64", ND_WRITEEFLAGS_U64 }, { "__builtin_ia32_incsspq", ND_INCSSPQ }, { "__builtin_ia32_rstorssp", ND_RSTORSSP }, { "__builtin_ia32_wrssd", ND_WRSSD }, { "__builtin_ia32_wrssq", ND_WRSSQ }, { "__builtin_ia32_wrussd", ND_WRUSSD }, { "__builtin_ia32_wrussq", ND_WRUSSQ }, { "__builtin_ia32_clrssbsy", ND_CLRSSBSY }, { "__builtin_ia32_sbb_u32", ND_SBB_U32 }, { "__builtin_ia32_addcarryx_u32", ND_ADDCARRYX_U32 }, { "__builtin_ia32_sbb_u64", ND_SBB_U64 }, { "__builtin_ia32_addcarryx_u64", ND_ADDCARRYX_U64 }, { "__builtin_ia32_tzcnt_u16", ND_TZCNT_U16 }, { "__builtin_ia32_bextr_u32", ND_BEXTR_U32 }, { "__builtin_ia32_psubusb256", ND_PSUBUSB256 }, { "__builtin_ia32_pcmpgtb256_mask", ND_PCMPGTB256_MASK }, { "__builtin_ia32_pshufb256", ND_PSHUFB256 }, { "__builtin_ia32_pblendvb256", ND_PBLENDVB256 }, { "__builtin_ia32_psrldqi256", ND_PSRLDQI256 }, { "__builtin_ia32_pslldqi256", ND_PSLLDQI256 }, { "__builtin_ia32_vinsertf128_si256", ND_VINSERTF128_SI256 }, { "__builtin_ia32_si256_si", ND_SI256_SI }, { "__builtin_ia32_si_si256", ND_SI_SI256 }, { "__builtin_ia32_palignr256", ND_PALIGNR256 }, { "__builtin_ia32_permti256", ND_VPERM2I128_SI256 }, { "__builtin_ia32_pblendd256", ND_PBLENDD256 }, { "__builtin_ia32_vextractf128_si256", ND_VEXTRACTF128_SI256 }, { "__builtin_ia32_vec_ext_v16qi", ND_VECEXTV16QI }, { "__builtin_ia32_vec_ext_v8hi", ND_VECEXTV8HI }, { "__builtin_ia32_andnotsi256", ND_ANDNOTSI256 }, { "__builtin_ia32_vec_ext_v2di", ND_VECEXTV2DI }, { "__builtin_ia32_pmulhuw256", ND_PMULHUW256 }, { "__builtin_ia32_pd_pd256", ND_PD256_PD }, { "__builtin_ia32_ps_ps256", ND_PS256_PS }, { "__builtin_ia32_psrlqi256", ND_PSRLQI256 }, { "__builtin_ia32_psllqi256", ND_PSLLQI256 }, { "__builtin_ia32_permdi256", ND_PERMDI256 }, { "__builtin_ia32_pslldi256", ND_PSLLDI256 }, { "__builtin_ia32_psrldi256", ND_PSRLDI256 }, { "__builtin_ia32_psradi256", ND_PSRADI256 }, }; static int builtin_enum(Token *tok) { for (size_t i = 0; i < sizeof(builtin_table) / sizeof(builtin_table[0]); i++) { if (equal(tok, builtin_table[i].name)) return builtin_table[i].node_kind; } return -1; // not found } // scalar_to_vector now marks the node as a scalar promotion static Node *scalar_to_vector(Node *scalar, Type *vec_ty) { Node *n = new_unary(ND_CAST, scalar, scalar->tok); n->ty = vec_ty; // target vector type n->is_scalar_promoted = true; // renamed flag for clarity return n; } // Promote scalars to vectors for a binary operation static void promote_scalar_to_vector(Node *node) { if (!node->lhs) return; if (!node->rhs) return; add_type(node->lhs); add_type(node->rhs); if (is_vector(node->rhs->ty) && !is_vector(node->lhs->ty)) { node->lhs = scalar_to_vector(node->lhs, node->rhs->ty); node->lhs->is_scalar_promoted = true; } if (is_vector(node->lhs->ty) && !is_vector(node->rhs->ty)) { node->rhs = scalar_to_vector(node->rhs, node->lhs->ty); node->rhs->is_scalar_promoted = true; } } static Node *ParseSyncBoolCAS(NodeKind kind, Token *tok, Token **rest) { Node *node = new_node(kind, tok); SET_CTX(ctx); tok = skip(tok->next, "(", ctx); node->cas_ptr = assign(&tok, tok); add_type(node->cas_ptr); tok = skip(tok, ",", ctx); node->cas_expected = assign(&tok, tok); add_type(node->cas_expected); tok = skip(tok, ",", ctx); node->cas_desired = assign(&tok, tok); add_type(node->cas_desired); *rest = skip(tok, ")", ctx); node->ty = ty_bool; return node; } static Node *ParseSyncFetch(NodeKind kind, Token *tok, Token **rest) { tok = skip(tok->next, "(", ctx); Node *ptr = assign(&tok, tok); tok = skip(tok, ",", ctx); Node *val = assign(&tok, tok); add_type(val); int memorder = __ATOMIC_SEQ_CST; if (equal(tok, ",")) { tok = skip(tok, ",", ctx); memorder = const_expr(&tok, tok); } Node *node = new_node(kind, tok); node->lhs = ptr; node->rhs = val; node->memorder = memorder; node->atomic_fetch = true; *rest = skip(tok, ")", ctx); return node; } static Node *ParseAtomicBitwise(NodeKind kind, Token *tok, Token **rest) { SET_CTX(ctx); tok = skip(tok->next, "(", ctx); Node *ptr = assign(&tok, tok); tok = skip(tok, ",", ctx); Node *val = assign(&tok, tok); add_type(val); int memorder = __ATOMIC_SEQ_CST; if (equal(tok, ",")) { tok = skip(tok, ",", ctx); memorder = const_expr(&tok, tok); } Node *node = new_node(kind, tok); node->lhs = ptr; node->rhs = val; node->memorder = memorder; node->atomic_fetch = true; *rest = skip(tok, ")", ctx); return node; } static bool is_c99_or_later(void) { switch (current_std) { case STD_C99: case STD_C11: case STD_C17: case STD_C23: case STD_GNU99: case STD_GNU11: case STD_GNU17: case STD_GNU23: return true; default: return false; } } static Node *constant_folding(int kind, Node *lhs, Node *rhs, Token *tok) { add_type(lhs); add_type(rhs); if (lhs->kind != ND_NUM || rhs->kind != ND_NUM) return NULL; Node *node; // If either operand is floating → promote to double bool is_float = is_flonum(lhs->ty) || is_flonum(rhs->ty); if (is_float) { double a = is_flonum(lhs->ty) ? lhs->fval : lhs->val; double b = is_flonum(rhs->ty) ? rhs->fval : rhs->val; switch (kind) { case ND_ADD: node = new_double(a + b, tok); break; case ND_SUB: node = new_double(a - b, tok); break; case ND_MUL: node = new_double(a * b, tok); break; case ND_DIV: if (b == 0.0) return NULL; node = new_double(a / b, tok); break; default: return NULL; } } else { // integer path // Determine if unsigned arithmetic is needed bool is_unsigned = lhs->ty->is_unsigned || rhs->ty->is_unsigned; uint64_t u_a = lhs->val; uint64_t u_b = rhs->val; int64_t s_a = lhs->val; int64_t s_b = rhs->val; switch (kind) { case ND_ADD: node = new_num(is_unsigned ? (u_a + u_b) : (s_a + s_b), tok); break; case ND_SUB: node = new_num(is_unsigned ? (u_a - u_b) : (s_a - s_b), tok); break; case ND_MUL: node = new_num(is_unsigned ? (u_a * u_b) : (s_a * s_b), tok); break; case ND_DIV: if (is_unsigned ? (u_b == 0) : (s_b == 0)) return NULL; node = new_num(is_unsigned ? (u_a / u_b) : (s_a / s_b), tok); break; case ND_MOD: if (is_unsigned ? (u_b == 0) : (s_b == 0)) return NULL; node = new_num(is_unsigned ? (u_a % u_b) : (s_a % s_b), tok); break; default: return NULL; } } // Assign correct type using a dummy node to trigger usual arithmetic conversions Node dummy = {kind, .lhs = lhs, .rhs = rhs, .tok = tok}; add_type(&dummy); node->ty = dummy.ty; // Truncate the result according to the type's size to simulate overflow behavior. if (!is_float) node->val = eval_sign_extend(node->ty, node->val); else if (node->ty->kind == TY_FLOAT) node->fval = (float)node->fval; return node; } chibicc-1.0.24/preprocess.c000077500000000000000000001464241517770275000155440ustar00rootroot00000000000000// This file implements the C preprocessor. // // The preprocessor takes a list of tokens as an input and returns a // new list of tokens as an output. // // The preprocessing language is designed in such a way that that's // guaranteed to stop even if there is a recursive macro. // Informally speaking, a macro is applied only once for each token. // That is, if a macro token T appears in a result of direct or // indirect macro expansion of T, T won't be expanded any further. // For example, if T is defined as U, and U is defined as T, then // token T is expanded to U and then to T and the macro expansion // stops at that point. // // To achieve the above behavior, we attach for each token a set of // macro names from which the token is expanded. The set is called // "hideset". Hideset is initially empty, and every time we expand a // macro, the macro name is added to the resulting tokens' hidesets. // // The above macro expansion algorithm is explained in this document // written by Dave Prossor, which is used as a basis for the // standard's wording: // https://github.com/rui314/chibicc/wiki/cpp.algo.pdf #include "chibicc.h" typedef struct MacroParam MacroParam; struct MacroParam { MacroParam *next; char *name; }; typedef struct MacroArg MacroArg; struct MacroArg { MacroArg *next; char *name; bool is_va_args; Token *tok; }; typedef Token *macro_handler_fn(Token *); typedef struct Macro Macro; struct Macro { char *name; bool is_objlike; // Object-like or function-like or attribut-like MacroParam *params; char *va_args_name; Token *body; macro_handler_fn *handler; }; // `#if` can be nested, so we use a stack to manage nested `#if`s. typedef struct CondIncl CondIncl; struct CondIncl { CondIncl *next; enum { IN_THEN, IN_ELIF, IN_ELSE } ctx; Token *tok; bool included; }; typedef struct Hideset Hideset; struct Hideset { Hideset *next; char *name; }; static HashMap macros; static CondIncl *cond_incl; static HashMap pragma_once; static int include_next_idx; static int pragma_pack_current; static int pragma_pack_stack[128]; static int pragma_pack_depth; //ISS-142 extern bool opt_E; extern bool opt_fbuiltin; extern Context *ctx; static Token *preprocess2(Token *tok); static Macro *find_macro(Token *tok); static void join_adjacent_string_literals(Token *tok); static Token *paste(Token *lhs, Token *rhs); static Token *skip_line(Token *tok); static int include_next_start_idx(Token *tok); static bool has_include_in_paths(char *filename, int start_idx); static bool handle_pragma_pack(Token **rest, Token *tok) { if (!equal(tok, "pack")) return false; char *p = tok->loc + tok->len; while (*p == ' ' || *p == '\t') p++; if (*p != '(') { *rest = tok->next; while (!(*rest)->at_bol) *rest = (*rest)->next; return true; } p++; while (*p == ' ' || *p == '\t') p++; if (*p == ')') { pragma_pack_current = 0; p++; } else if (!strncmp(p, "push", 4) && !is_ident2(p[4])) { if (pragma_pack_depth < (int)(sizeof(pragma_pack_stack) / sizeof(pragma_pack_stack[0]))) pragma_pack_stack[pragma_pack_depth++] = pragma_pack_current; p += 4; while (*p == ' ' || *p == '\t') p++; if (*p == ',') { p++; while (*p == ' ' || *p == '\t') p++; char *end = NULL; long n = strtol(p, &end, 10); if (end != p && (n == 0 || n == 1 || n == 2 || n == 4 || n == 8 || n == 16)) { pragma_pack_current = (int)n; p = end; } } while (*p == ' ' || *p == '\t') p++; if (*p == ')') p++; } else if (!strncmp(p, "pop", 3) && !is_ident2(p[3])) { if (pragma_pack_depth > 0) pragma_pack_current = pragma_pack_stack[--pragma_pack_depth]; else pragma_pack_current = 0; p += 3; while (*p == ' ' || *p == '\t') p++; if (*p == ',') { p++; while (*p == ' ' || *p == '\t') p++; char *end = NULL; long n = strtol(p, &end, 10); if (end != p && (n == 0 || n == 1 || n == 2 || n == 4 || n == 8 || n == 16)) { pragma_pack_current = (int)n; p = end; } } while (*p == ' ' || *p == '\t') p++; if (*p == ')') p++; } else { char *end = NULL; long n = strtol(p, &end, 10); if (end != p && (n == 0 || n == 1 || n == 2 || n == 4 || n == 8 || n == 16)) { pragma_pack_current = (int)n; p = end; while (*p == ' ' || *p == '\t') p++; if (*p == ')') p++; } } *rest = tok->next; while (!(*rest)->at_bol) *rest = (*rest)->next; return true; } //begin static bool is_hash(Token *tok) // [https://www.sigbus.info/n1570#6.10.3.4p3] tok->origin is checked here // because "#" can appear in object-like macro, and after expansion of that // macro, it's not a preprocessing directive even it resembles one. // For example: // 1. #define H # // 2. #define I include // 3. // 4. H I // Line 4 produces these tokens: // {#} {include} {} // which are not treated as preprocessing directive. { return tok->at_bol && equal(tok, "#") && !tok->origin; } // Some preprocessor directives such as #include allow extraneous // tokens before newline. This function skips such tokens. static Token *skip_line(Token *tok) { if (tok->at_bol) return tok; warn_tok(tok, "extra token"); while (!tok->at_bol) tok = tok->next; return tok; } static Token *copy_token(Token *tok) { Token *t = calloc(1, sizeof(Token)); if (t == NULL) error("%s:%d: error: in copy_token : t is null", __FILE__, __LINE__); *t = *tok; t->next = NULL; return t; } static Token *new_eof(Token *tok) { Token *t = copy_token(tok); t->at_bol = true; t->kind = TK_EOF; t->len = 0; return t; } static Hideset *new_hideset(char *name) { Hideset *hs = calloc(1, sizeof(Hideset)); if (hs == NULL) error("%s:%d: error: in new_hideset : hs is null", __FILE__, __LINE__); hs->name = name; return hs; } static Hideset *hideset_union(Hideset *hs1, Hideset *hs2) { Hideset head = {}; Hideset *cur = &head; for (; hs1; hs1 = hs1->next) cur = cur->next = new_hideset(hs1->name); cur->next = hs2; return head.next; } static bool hideset_contains(Hideset *hs, char *s, int len) { for (; hs; hs = hs->next) if (strlen(hs->name) == len && !strncmp(hs->name, s, len)) return true; return false; } static Hideset *hideset_intersection(Hideset *hs1, Hideset *hs2) { Hideset head = {}; Hideset *cur = &head; for (; hs1; hs1 = hs1->next) if (hideset_contains(hs2, hs1->name, strlen(hs1->name))) cur = cur->next = new_hideset(hs1->name); return head.next; } static Token *add_hideset(Token *tok, Hideset *hs) { Token head = {}; Token *cur = &head; for (; tok; tok = tok->next) { Token *t = copy_token(tok); t->hideset = hideset_union(t->hideset, hs); cur = cur->next = t; } return head.next; } // Append tok2 to the end of tok1. static Token *append(Token *tok1, Token *tok2) { if (tok1->kind == TK_EOF) return tok2; Token head = {}; Token *cur = &head; for (; tok1->kind != TK_EOF; tok1 = tok1->next) cur = cur->next = copy_token(tok1); cur->next = tok2; return head.next; } static Token *skip_cond_incl2(Token *tok) { while (tok->kind != TK_EOF) { if (is_hash(tok) && (equal(tok->next, "if") || equal(tok->next, "ifdef") || equal(tok->next, "ifndef"))) { tok = skip_cond_incl2(tok->next->next); continue; } if (is_hash(tok) && equal(tok->next, "endif")) return tok->next->next; tok = tok->next; } return tok; } // Skip until next `#else`, `#elif` or `#endif`. // Nested `#if` and `#endif` are skipped. static Token *skip_cond_incl(Token *tok) { while (tok->kind != TK_EOF) { if (is_hash(tok) && (equal(tok->next, "if") || equal(tok->next, "ifdef") || equal(tok->next, "ifndef"))) { tok = skip_cond_incl2(tok->next->next); continue; } if (is_hash(tok) && (equal(tok->next, "elif") || equal(tok->next, "else") || equal(tok->next, "endif"))) break; tok = tok->next; } return tok; } // Double-quote a given string and returns it. static char *quote_string(char *str) { int bufsize = 3; for (int i = 0; str[i]; i++) { if (str[i] == '\\' || str[i] == '"') bufsize++; bufsize++; } char *buf = calloc(1, bufsize); if (buf == NULL) error("%s:%d: error: in quote_string : buf is null", __FILE__, __LINE__); char *p = buf; *p++ = '"'; for (int i = 0; str[i]; i++) { if (str[i] == '\\' || str[i] == '"') *p++ = '\\'; *p++ = str[i]; } *p++ = '"'; *p++ = '\0'; return buf; } static Token *new_str_token(char *str, Token *tmpl) { char *buf = quote_string(str); return tokenize(new_file(tmpl->file->name, tmpl->file->file_no, buf)); } // Copy all tokens until the next newline, terminate them with // an EOF token and then returns them. This function is used to // create a new list of tokens for `#if` arguments. static Token *copy_line(Token **rest, Token *tok) { Token head = {}; Token *cur = &head; for (; !tok->at_bol; tok = tok->next) cur = cur->next = copy_token(tok); cur->next = new_eof(tok); *rest = tok; return head.next; } static Token *new_num_token(int val, Token *tmpl) { char *buf = format("%d\n", val); if (!buf) error_tok(tmpl, "%s:%d: in new_num_token : buf is null", __FILE__, __LINE__); return tokenize(new_file(tmpl->file->name, tmpl->file->file_no, buf)); } static int include_next_start_idx(Token *tok) { if (!tok || !tok->file || !tok->file->name) return 0; char *dir = dirname(strdup(tok->file->name)); int best = -1; size_t best_len = 0; for (int i = 0; i < include_paths.len; i++) { char *inc = include_paths.data[i]; size_t n = strlen(inc); if (n < best_len) continue; if (!strncmp(dir, inc, n) && (dir[n] == '\0' || dir[n] == '/')) { best = i; best_len = n; } } return best >= 0 ? best + 1 : 0; } static bool has_include_in_paths(char *filename, int start_idx) { for (int i = start_idx; i < include_paths.len; i++) { char *path = format("%s/%s", include_paths.data[i], filename); if (file_exists(path)) return true; } return false; } static bool is_builtin_name(Token *tok) { static const char prefix[] = "__builtin_"; if (!tok || tok->kind != TK_IDENT) return false; if (tok->len < (int)sizeof(prefix) - 1) return false; return !strncmp(tok->loc, prefix, sizeof(prefix) - 1); } static MacroArg *read_macro_arg_one(Token **rest, Token *tok, bool read_rest); static Token *read_const_expr(Token **rest, Token *tok) { tok = copy_line(rest, tok); Token head = {}; Token *cur = &head; while (tok->kind != TK_EOF) { // "defined(foo)" or "defined foo" becomes "1" if macro "foo" // is defined. Otherwise "0". if (equal(tok, "defined") || equal(tok, "__has_attribute") || equal(tok, "__has_builtin")) { Token *start = tok; bool is_has_builtin = equal(tok, "__has_builtin"); bool has_paren = consume(&tok, tok->next, "("); if (tok->kind != TK_IDENT) error_tok(start, "%s:%d: in read_const_expr : macro name must be an identifier", __FILE__, __LINE__); bool found = false; if (is_has_builtin) { if (has_paren) { MacroArg *arg = read_macro_arg_one(&tok, tok, true); Token *argtok = preprocess2(arg->tok); if (argtok->kind != TK_IDENT || argtok->next->kind != TK_EOF) error_tok(start, "%s:%d: in read_const_expr : __has_builtin expects a single identifier", __FILE__, __LINE__); found = is_builtin_name(argtok) || find_macro(argtok); SET_CTX(ctx); tok = skip(tok, ")", ctx); } else { found = is_builtin_name(tok) || find_macro(tok); tok = tok->next; } } else { found = !!find_macro(tok); tok = tok->next; } if (!is_has_builtin && has_paren) { SET_CTX(ctx); tok = skip(tok, ")", ctx); } cur = cur->next = new_num_token(found ? 1 : 0, start); continue; } else if (equal(tok, "__has_include") || equal(tok, "__has_include_next")) { Token *start = tok; bool is_next = equal(tok, "__has_include_next"); bool has_paren = consume(&tok, tok->next, "("); if (tok->kind != TK_STR && !equal(tok, "<")) error_tok(start, "%s:%d: in read_const_expr : __has_include expects a filename", __FILE__, __LINE__); char filename[PATH_MAX] = {}; bool is_dquote = (tok->kind == TK_STR); if (is_dquote) { // __has_include("header.h") snprintf(filename, sizeof(filename), "%s", tok->str); tok = tok->next; } else { // __has_include() tok = tok->next; const char *start_str = tok->loc; const char *end = start_str; while (!equal(tok, ">") && tok->kind != TK_EOF) { end = tok->loc + tok->len; tok = tok->next; } if (!equal(tok, ">")) error_tok(start, "%s:%d: in read_const_expr : expected closing > in __has_include", __FILE__, __LINE__); int len = (int)(end - start_str); if (len < 0) len = 0; if (len >= (int)sizeof(filename)) len = (int)sizeof(filename) - 1; memcpy(filename, start_str, len); filename[len] = '\0'; tok = tok->next; // consume '>' } if (has_paren) { SET_CTX(ctx); tok = skip(tok, ")", ctx); } bool found = false; // Match #include search behavior for quoted headers. if (!is_next && is_dquote && filename[0] != '/') { char *path = format("%s/%s", dirname(strdup(start->file->name)), filename); if (file_exists(path)) found = true; } if (!found) { if (is_next) found = has_include_in_paths(filename, include_next_start_idx(start)); else found = has_include_in_paths(filename, 0); } cur = cur->next = new_num_token(found ? 1 : 0, start); continue; } cur = cur->next = tok; tok = tok->next; } cur->next = tok; return head.next; } // Read and evaluate a constant expression. static long eval_const_expr(Token **rest, Token *tok) { Token *start = tok; Token *expr = read_const_expr(rest, tok->next); expr = preprocess2(expr); if (expr->kind == TK_EOF) error_tok(start, "%s:%d: in eval_const_expr : no expression", __FILE__, __LINE__); // [https://www.sigbus.info/n1570#6.10.1p4] The standard requires // we replace remaining non-macro identifiers with "0" before // evaluating a constant expression. For example, `#if foo` is // equivalent to `#if 0` if foo is not defined. for (Token *t = expr; t->kind != TK_EOF; t = t->next) { if (t->kind == TK_IDENT) { Token *next = t->next; *t = *new_num_token(0, t); t->next = next; } } // Convert pp-numbers to regular numbers convert_pp_tokens(expr); if (expr->ty && is_flonum(expr->ty)) error_tok(expr, "%s:%d: in eval_const_expr : floating constant in preprocessor expression", __FILE__, __LINE__); Token *rest2; long val = const_expr(&rest2, expr); if (rest2->kind != TK_EOF) error_tok(rest2, "%s:%d: in eval_const_expr : extra token", __FILE__, __LINE__); return val; } static CondIncl *push_cond_incl(Token *tok, bool included) { CondIncl *ci = calloc(1, sizeof(CondIncl)); if (ci == NULL) error("%s:%d: error: in push_cond_incl : ci is null", __FILE__, __LINE__); ci->next = cond_incl; ci->ctx = IN_THEN; ci->tok = tok; ci->included = included; cond_incl = ci; return ci; } static Macro *find_macro(Token *tok) { if (tok->kind != TK_IDENT) return NULL; return hashmap_get2(¯os, tok->loc, tok->len); } static Macro *add_macro(char *name, bool is_objlike, Token *body) { Macro *m = calloc(1, sizeof(Macro)); if (m == NULL) error("%s:%d: error: in add_macro : m is null", __FILE__, __LINE__); m->name = name; m->is_objlike = is_objlike; m->body = body; hashmap_put(¯os, name, m); return m; } static MacroParam *read_macro_params(Token **rest, Token *tok, char **va_args_name) { MacroParam head = {}; MacroParam *cur = &head; while (!equal(tok, ")")) { if (cur != &head) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } if (equal(tok, "...")) { *va_args_name = "__VA_ARGS__"; SET_CTX(ctx); *rest = skip(tok->next, ")", ctx); return head.next; } if (tok->kind != TK_IDENT) error_tok(tok, "%s in read_macro_params : expected an identifier", __FILE__); if (equal(tok->next, "...")) { *va_args_name = strndup(tok->loc, tok->len); SET_CTX(ctx); *rest = skip(tok->next->next, ")", ctx); return head.next; } MacroParam *m = calloc(1, sizeof(MacroParam)); if (m == NULL) error("%s:%d: error: in read_macro_params : m is null", __FILE__, __LINE__); m->name = strndup(tok->loc, tok->len); cur = cur->next = m; tok = tok->next; } *rest = tok->next; return head.next; } static void read_macro_definition(Token **rest, Token *tok) { Token head = {}; Token *cur = &head; if (tok->kind != TK_IDENT) error_tok(tok, "%s:%d: in read_macro_definition : macro name must be an identifier", __FILE__, __LINE__); char *name = strndup(tok->loc, tok->len); tok = tok->next; if (!tok->has_space && equal(tok, "(")) { // Function-like macro char *va_args_name = NULL; MacroParam *params = read_macro_params(&tok, tok->next, &va_args_name); //Macro *m = add_macro(name, false, copy_line(rest, tok)); while (!tok->at_bol) { if (equal(tok, "##")) { if (cur == &head) error_tok(tok, "%s:%d: in read_macro_definition : '##' cannot appear at start of replacement list", __FILE__, __LINE__); if (tok->next->at_bol) error_tok(tok, "%s:%d: in read_macro_definition : '##' cannot appear at end of replacement list", __FILE__, __LINE__); cur = cur->next = copy_token(tok); // ## cur = cur->next = copy_token(tok->next); // rhs tok = tok->next->next; continue; } cur = cur->next = copy_token(tok); tok = tok->next; } cur->next = new_eof(tok); *rest = tok; Macro *m = add_macro(name, false, head.next); m->params = params; m->va_args_name = va_args_name; } else { // Object-like macro while (!tok->at_bol) { if (equal(tok, "##")) { if (cur == &head) error_tok(tok, "%s:%d: in read_macro_definition : '##' cannot appear at start of replacement list", __FILE__, __LINE__); if (tok->next->at_bol) error_tok(tok, "%s:%d: in read_macro_definition : '##' cannot appear at end of replacement list", __FILE__, __LINE__); *cur = *paste(cur, tok->next); tok = tok->next->next; continue; } cur = cur->next = copy_token(tok); tok = tok->next; } cur->next = new_eof(tok); *rest = tok; add_macro(name, true, head.next); //add_macro(name, true, copy_line(rest, tok)); } } static MacroArg *read_macro_arg_one(Token **rest, Token *tok, bool read_rest) { Token head = {}; Token *cur = &head; int level = 0; for (;;) { if (level == 0 && equal(tok, ")")) break; if (level == 0 && !read_rest && equal(tok, ",")) break; if (tok->kind == TK_EOF) error_tok(tok, "%s:%d: in read_macro_arg_one : premature end of input", __FILE__, __LINE__); if (equal(tok, "(")) level++; else if (equal(tok, ")")) level--; cur = cur->next = copy_token(tok); tok = tok->next; } cur->next = new_eof(tok); MacroArg *arg = calloc(1, sizeof(MacroArg)); if (arg == NULL) error("%s:%d: error: in read_macro_arg_one : arg is null", __FILE__, __LINE__); arg->tok = head.next; *rest = tok; return arg; } static MacroArg * read_macro_args(Token **rest, Token *tok, MacroParam *params, char *va_args_name) { Token *start = tok; tok = tok->next->next; MacroArg head = {}; MacroArg *cur = &head; MacroParam *pp = params; for (; pp; pp = pp->next) { if (cur != &head) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } cur = cur->next = read_macro_arg_one(&tok, tok, false); cur->name = pp->name; } if (va_args_name) { MacroArg *arg; if (equal(tok, ")")) { arg = calloc(1, sizeof(MacroArg)); if (arg == NULL) error("%s:%d: error: in read_macro_args : arg is null", __FILE__, __LINE__); arg->tok = new_eof(tok); } else { if (pp != params) { SET_CTX(ctx); tok = skip(tok, ",", ctx); } arg = read_macro_arg_one(&tok, tok, true); } arg->name = va_args_name; ; arg->is_va_args = true; cur = cur->next = arg; } else if (pp) { error_tok(start, "%s:%d: in read_macro_args : too many arguments", __FILE__, __LINE__); } SET_CTX(ctx); skip(tok, ")",ctx); *rest = tok; return head.next; } static MacroArg *find_arg(MacroArg *args, Token *tok) { for (MacroArg *ap = args; ap; ap = ap->next) if (tok->len == strlen(ap->name) && !strncmp(tok->loc, ap->name, tok->len)) return ap; return NULL; } // Concatenates all tokens in `tok` and returns a new string. static char *join_tokens(Token *tok, Token *end) { // Compute the length of the resulting token. int len = 1; for (Token *t = tok; t != end && t->kind != TK_EOF; t = t->next) { if (t != tok && t->has_space) len++; len += t->len; } char *buf = calloc(1, len); if (buf == NULL) error("%s:%d: error: in join_tokens : buf is null", __FILE__, __LINE__); // Copy token texts. int pos = 0; for (Token *t = tok; t != end && t->kind != TK_EOF; t = t->next) { if (t != tok && t->has_space) buf[pos++] = ' '; strncpy(buf + pos, t->loc, t->len); pos += t->len; } buf[pos] = '\0'; return buf; } // Concatenates all tokens in `arg` and returns a new string token. // This function is used for the stringizing operator (#). static Token *stringize(Token *hash, Token *arg) { // Create a new string token. We need to set some value to its // source location for error reporting function, so we use a macro // name token as a template. char *s = join_tokens(arg, NULL); return new_str_token(s, hash); } // Concatenate two tokens to create a new token. static Token *paste(Token *lhs, Token *rhs) { // Paste the two tokens. char *buf = format("%.*s%.*s", lhs->len, lhs->loc, rhs->len, rhs->loc); convert_universal_chars(buf); // Tokenize the resulting string. Token *tok = tokenize(new_file(lhs->file->name, lhs->file->file_no, buf)); if (tok->kind == TK_EOF || tok->next->kind != TK_EOF) { error_tok(lhs, "%s:%d: in paste : invalid preprocessing token '%s' produced by pasting " "'%.*s' and '%.*s'", __FILE__, __LINE__, buf, lhs->len, lhs->loc, rhs->len, rhs->loc); } return tok; } static bool has_varargs(MacroArg *args) { for (MacroArg *ap = args; ap; ap = ap->next) if (ap->is_va_args) return ap->tok->kind != TK_EOF; return false; } // Replace func-like macro parameters with given arguments. static Token *subst(Macro *m, MacroArg *args) { Token head = {}; Token *cur = &head; Token *tok = m->body; while (tok->kind != TK_EOF) { // "#" followed by a parameter is replaced with stringized actuals. if (equal(tok, "#")) { MacroArg *arg = find_arg(args, tok->next); if (!arg) error_tok(tok->next, "%s:%d: in subst : '#' is not followed by a macro parameter", __FILE__, __LINE__); cur = cur->next = stringize(tok, arg->tok); tok = tok->next->next; continue; } // [GNU] If __VA_ARG__ is empty, `,##__VA_ARGS__` is expanded // to the empty token list. Otherwise, its expaned to `,` and // __VA_ARGS__. if (equal(tok, ",") && equal(tok->next, "##")) { MacroArg *arg = find_arg(args, tok->next->next); if (arg && arg->is_va_args) { if (arg->tok->kind == TK_EOF) { tok = tok->next->next->next; } else { cur = cur->next = copy_token(tok); tok = tok->next->next; } continue; } } if (equal(tok, "##")) { MacroArg *arg = find_arg(args, tok->next); if (arg) { if (arg->tok->kind != TK_EOF) { //*cur = *paste(cur, arg->tok); if (cur == &head) cur = cur->next = copy_token(arg->tok); else *cur = *paste(cur, arg->tok); for (Token *t = arg->tok->next; t->kind != TK_EOF; t = t->next) cur = cur->next = copy_token(t); } tok = tok->next->next; continue; } *cur = *paste(cur, tok->next); tok = tok->next->next; continue; } MacroArg *arg = find_arg(args, tok); if (arg && equal(tok->next, "##")) { Token *rhs = tok->next->next; if (arg->tok->kind == TK_EOF) { MacroArg *arg2 = find_arg(args, rhs); if (arg2) { for (Token *t = arg2->tok; t->kind != TK_EOF; t = t->next) cur = cur->next = copy_token(t); } else { cur = cur->next = copy_token(rhs); } tok = rhs->next; continue; } for (Token *t = arg->tok; t->kind != TK_EOF; t = t->next) cur = cur->next = copy_token(t); tok = tok->next; continue; } // If __VA_ARG__ is empty, __VA_OPT__(x) is expanded to the // empty token list. Otherwise, __VA_OPT__(x) is expanded to x. if (equal(tok, "__VA_OPT__") && equal(tok->next, "(")) { MacroArg *arg = read_macro_arg_one(&tok, tok->next->next, true); if (has_varargs(args)) { Macro va_opt_macro = {.body = arg->tok}; Token *subst_body = subst(&va_opt_macro, args); for (Token *t = subst_body; t->kind != TK_EOF; t = t->next) { cur = cur->next = copy_token(t); } } SET_CTX(ctx); tok = skip(tok, ")", ctx); continue; } // Handle a macro token. Macro arguments are completely macro-expanded // before they are substituted into a macro body. if (arg) { Token *t = preprocess2(arg->tok); // t->at_bol = tok->at_bol; t->has_space = tok->has_space; for (; t->kind != TK_EOF; t = t->next) cur = cur->next = copy_token(t); tok = tok->next; continue; } // Handle a non-macro token. cur = cur->next = copy_token(tok); tok = tok->next; continue; } cur->next = tok; return head.next; } // If tok is a macro, expand it and return true. // Otherwise, do nothing and return false. static bool expand_macro(Token **rest, Token *tok) { if (hideset_contains(tok->hideset, tok->loc, tok->len)) return false; Macro *m = find_macro(tok); if (!m) return false; if (equal(tok, "__has_builtin") && equal(tok->next, "(")) { Token *t = tok->next->next; if (t->kind != TK_IDENT) error_tok(t, "%s:%d: in expand_macro : __has_builtin expects an identifier", __FILE__, __LINE__); bool found = is_builtin_name(t) || find_macro(t); t = t->next; SET_CTX(ctx); t = skip(t, ")", ctx); Token *num = new_num_token(found ? 1 : 0, tok); num->next = t; *rest = num; return true; } // Built-in dynamic macro application such as __LINE__ if (m->handler) { *rest = m->handler(tok); (*rest)->next = tok->next; return true; } // Object-like macro application if (m->is_objlike) { Hideset *hs = hideset_union(tok->hideset, new_hideset(m->name)); Token *body = add_hideset(m->body, hs); for (Token *t = body; t->kind != TK_EOF; t = t->next) { t->origin = tok; } *rest = append(body, tok->next); //(*rest)->at_bol = tok->at_bol; (*rest)->has_space = tok->has_space; return true; } // If a funclike macro token is not followed by an argument list, // treat it as a normal identifier. if (!equal(tok->next, "(")) return false; // Function-like macro application Token *macro_token = tok; MacroArg *args = read_macro_args(&tok, tok, m->params, m->va_args_name); Token *rparen = tok; // Tokens that consist a func-like macro invocation may have different // hidesets, and if that's the case, it's not clear what the hideset // for the new tokens should be. We take the interesection of the // macro token and the closing parenthesis and use it as a new hideset // as explained in the Dave Prossor's algorithm. Hideset *hs = hideset_intersection(macro_token->hideset, rparen->hideset); hs = hideset_union(hs, new_hideset(m->name)); if (m->body->kind != TK_EOF) { // If replacement list is not empty Token *body = subst(m, args); body = add_hideset(body, hs); for (Token *t = body; t->kind != TK_EOF; t = t->next) { t->origin = macro_token; } *rest = append(body, tok->next); (*rest)->at_bol = macro_token->at_bol; (*rest)->has_space = macro_token->has_space; } else { *rest = tok->next; if (macro_token->has_space) (*rest)->has_space = true; } return true; } char *search_include_paths(char *filename) { if (filename[0] == '/') return filename; static HashMap cache; char *cached = hashmap_get(&cache, filename); if (cached) return cached; // Search a file from the include paths. for (int i = 0; i < include_paths.len; i++) { char *path = format("%s/%s", include_paths.data[i], filename); // printf("%s\n", path); if (!file_exists(path)) continue; hashmap_put(&cache, filename, path); include_next_idx = i + 1; return path; } return NULL; } static char *search_include_next(char *filename) { for (; include_next_idx < include_paths.len; include_next_idx++) { char *path = format("%s/%s", include_paths.data[include_next_idx], filename); if (file_exists(path)) return path; } return NULL; } // Read an #include argument. static char *read_include_filename(Token **rest, Token *tok, bool *is_dquote) { // Pattern 1: #include "foo.h" if (tok->kind == TK_STR) { // A double-quoted filename for #include is a special kind of // token, and we don't want to interpret any escape sequences in it. // For example, "\f" in "C:\foo" is not a formfeed character but // just two non-control characters, backslash and f. // So we don't want to use token->str. *is_dquote = true; *rest = skip_line(tok->next); return strndup(tok->loc + 1, tok->len - 2); } // Pattern 2: #include if (equal(tok, "<")) { // Reconstruct a filename from a sequence of tokens between // "<" and ">". Token *start = tok; // Find closing ">". for (; !equal(tok, ">"); tok = tok->next) if (tok->at_bol || tok->kind == TK_EOF) { error_tok(tok, "%s:%d: in read_include_filename : expected '>' %s", __FILE__, __LINE__, start->loc ); } *is_dquote = false; *rest = skip_line(tok->next); return join_tokens(start->next, tok); } // Pattern 3: #include FOO // In this case FOO must be macro-expanded to either // a single string token or a sequence of "<" ... ">". if (tok->kind == TK_IDENT && find_macro(tok)) { Token *tok2 = preprocess2(copy_line(rest, tok)); return read_include_filename(&tok2, tok2, is_dquote); } error_tok(tok, "%s:%d: in read_include_filename : expected a filename", __FILE__, __LINE__); } // Detect the following "include guard" pattern. // // #ifndef FOO_H // #define FOO_H // ... // #endif static char *detect_include_guard(Token *tok) { // Detect the first two lines. if (!is_hash(tok) || !equal(tok->next, "ifndef")) return NULL; tok = tok->next->next; if (tok->kind != TK_IDENT) return NULL; char *macro = strndup(tok->loc, tok->len); tok = tok->next; if (!is_hash(tok) || !equal(tok->next, "define") || !equal(tok->next->next, macro)) return NULL; // Read until the end of the file. while (tok->kind != TK_EOF) { if (!is_hash(tok)) { tok = tok->next; continue; } if (equal(tok->next, "endif") && tok->next->next->kind == TK_EOF) return macro; if (equal(tok, "if") || equal(tok, "ifdef") || equal(tok, "ifndef")) tok = skip_cond_incl(tok->next); else tok = tok->next; } return NULL; } static Token *include_file(Token *tok, char *path, Token *filename_tok) { // Check for "#pragma once" if (hashmap_get(&pragma_once, path)) return tok; // If we read the same file before, and if the file was guarded // by the usual #ifndef ... #endif pattern, we may be able to // skip the file without opening it. static HashMap include_guards; char *guard_name = hashmap_get(&include_guards, path); if (guard_name && hashmap_get(¯os, guard_name)) return tok; Token *tok2 = tokenize_file(path); if (!tok2) error_tok(filename_tok, "%s:%d: in include_file : %s: cannot open file: %s", __FILE__, __LINE__, path, strerror(errno)); guard_name = detect_include_guard(tok2); if (guard_name) hashmap_put(&include_guards, path, guard_name); return append(tok2, tok); } static void print_macro(Macro *m) { FILE *out = ofile ? ofile : stdout; fprintf(out, "#define %s", m->name); if (!m->is_objlike) { fprintf(out, "("); MacroParam *p = m->params; bool first = true; while (p) { if (!first) fprintf(out, ","); fprintf(out, "%s", p->name); first = false; p = p->next; } if (m->va_args_name) { if (!first) fprintf(out, ","); fprintf(out, "..."); } fprintf(out, ")"); } Token *tok = m->body; if (tok && tok->kind != TK_EOF) fprintf(out, " "); for (; tok && tok->kind != TK_EOF; tok = tok->next) { // Add space between tokens fprintf(out, "%.*s", tok->len, tok->loc); if (tok->next && tok->next->kind != TK_EOF) fprintf(out, " "); } fprintf(out, "\n"); } static Token *stdver_macro(Token *tok) { switch (current_std) { case STD_C89: case STD_GNU89: tok->val = 0; break; // __STDC_VERSION__ not defined case STD_C99: case STD_GNU99: tok->val = 199901L; break; case STD_C11: case STD_GNU11: tok->val = 201112L; break; case STD_C17: case STD_GNU17: tok->val = 201710L; break; case STD_C23: tok->val = 202311L; break; default: unreachable(); } tok->kind = TK_NUM; tok->ty = ty_long; return tok; } // Read #line arguments static void read_line_marker(Token **rest, Token *tok) { Token *start = tok; bool isReadLine = true; tok = preprocess(copy_line(rest, tok), isReadLine); // if (isDebug && f != NULL) // print_debug_tokens(__FILE__, "read_line_marker", tok); if (tok->kind != TK_NUM && tok->ty->kind != TY_INT) error_tok(tok, "%s:%d: in read_line_marker : invalid line marker", __FILE__, __LINE__); // fix issue with negative number that cause Assembler less number than one //start->file->line_delta = tok->val - start->line_no; // fix from @fuhsnn Line control off by one start->file->line_delta = tok->val - start->line_no - 1; tok = tok->next; if (tok->kind == TK_EOF) return; if (tok->kind != TK_STR) error_tok(tok, "%s:%d: in read_line_marker : filename expected", __FILE__, __LINE__); start->file->display_name = tok->str; } // Visit all tokens in `tok` while evaluating preprocessing // macros and directives. static Token *preprocess2(Token *tok) { Token head = {}; Token *cur = &head; while (tok->kind != TK_EOF) { // // // If it is a macro, expand it. //if (expand_macro(&tok, tok)) if (tok->kind == TK_IDENT && expand_macro(&tok, tok)) continue; // Pass through if it is not a "#". if (!is_hash(tok)) { tok->line_delta = tok->file->line_delta; tok->filename = tok->file->display_name; tok->pack_align = pragma_pack_current; cur = cur->next = tok; tok = tok->next; continue; } Token *start = tok; tok = tok->next; if (equal(tok, "include")) { bool is_dquote; char *filename = read_include_filename(&tok, tok->next, &is_dquote); // if (isDebug) // printf("=====includes===%s\n", filename); if (filename[0] != '/' && is_dquote) { char *path = format("%s/%s", dirname(strdup(start->file->name)), filename); if (file_exists(path)) { tok = include_file(tok, path, start->next->next); continue; } } char *path = search_include_paths(filename); tok = include_file(tok, path ? path : filename, start->next->next); continue; } if (equal(tok, "include_next")) { bool ignore; char *filename = read_include_filename(&tok, tok->next, &ignore); char *path = search_include_next(filename); tok = include_file(tok, path ? path : filename, start->next->next); continue; } if (equal(tok, "define")) { read_macro_definition(&tok, tok->next); continue; } if (equal(tok, "undef")) { tok = tok->next; if (tok->kind != TK_IDENT) error_tok(tok, "%s:%d: in preprocess2 : macro name must be an identifier", __FILE__, __LINE__); Macro *m = find_macro(tok); if (m) undef_macro(m->name); //undef_macro(strndup(tok->loc, tok->len)); tok = skip_line(tok->next); continue; } if (equal(tok, "if")) { long val = eval_const_expr(&tok, tok); push_cond_incl(start, val); if (!val) tok = skip_cond_incl(tok); continue; } if (equal(tok, "ifdef")) { if (tok->next->kind != TK_IDENT) error_tok(tok->next, "%s:%d: in preprocess2 : no macro name given in #ifdef directive", __FILE__, __LINE__); // bool defined = find_macro(tok->next); // push_cond_incl(tok, defined); Macro *defined = find_macro(tok->next); push_cond_incl(tok, !!defined); tok = skip_line(tok->next->next); if (!defined) tok = skip_cond_incl(tok); continue; } if (equal(tok, "ifndef")) { //bool defined = find_macro(tok->next); if (tok->next->kind != TK_IDENT) error_tok(tok->next, "%s:%d: in preprocess2 : no macro name given in #ifndef directive", __FILE__, __LINE__); Macro *defined = find_macro(tok->next); push_cond_incl(tok, !defined); tok = skip_line(tok->next->next); if (defined) tok = skip_cond_incl(tok); continue; } if (equal(tok, "elif")) { if (!cond_incl || cond_incl->ctx == IN_ELSE) error_tok(start, "%s:%d: in preprocess2 : stray #elif", __FILE__, __LINE__); cond_incl->ctx = IN_ELIF; if (!cond_incl->included && eval_const_expr(&tok, tok)) cond_incl->included = true; else tok = skip_cond_incl(tok); continue; } if (equal(tok, "else")) { if (!cond_incl || cond_incl->ctx == IN_ELSE) error_tok(start, "%s:%d: in preprocess2 : stray #else", __FILE__, __LINE__); cond_incl->ctx = IN_ELSE; tok = skip_line(tok->next); if (cond_incl->included) tok = skip_cond_incl(tok); continue; } if (equal(tok, "endif")) { if (!cond_incl) error_tok(start, "%s:%d: in preprocess2 : stray #endif", __FILE__, __LINE__); cond_incl = cond_incl->next; tok = skip_line(tok->next); continue; } if (equal(tok, "line")) { read_line_marker(&tok, tok->next); // tok = skip_line(tok->next->next->next); continue; } if (tok->kind == TK_PP_NUM) { read_line_marker(&tok, tok); continue; } if (equal(tok, "pragma") && equal(tok->next, "once")) { hashmap_put(&pragma_once, tok->file->name, (void *)1); tok = skip_line(tok->next->next); continue; } if (equal(tok, "pragma")) { if (handle_pragma_pack(&tok, tok->next)) continue; do { tok = tok->next; } while (!tok->at_bol); continue; } if (equal(tok, "error")) error_tok(tok, "%s:%d: in preprocess2 : error", __FILE__, __LINE__); // `#`-only line is legal. It's called a null directive. if (tok->at_bol) continue; //from @fuhsnn warning management if (equal(tok, "warning")) { warn_tok(tok, "warning"); do { tok = tok->next; }while (!tok->at_bol); continue; } error_tok(tok, "%s:%d: in preprocess2 : invalid preprocessor directive", __FILE__, __LINE__); } cur->next = tok; return head.next; } void define_macro(char *name, char *buf) { if (strncmp(name, "__has_attribute", 15)) { Token *tok = tokenize(new_file("", 1, buf)); add_macro(name, true, tok); } } void undef_macro(char *name) { hashmap_delete(¯os, name); } static Macro *add_builtin(char *name, macro_handler_fn *fn) { Macro *m = add_macro(name, true, NULL); m->handler = fn; return m; } static Token *file_macro(Token *tmpl) { while (tmpl->origin) tmpl = tmpl->origin; return new_str_token(tmpl->file->display_name, tmpl); } static Token *line_macro(Token *tmpl) { while (tmpl->origin) tmpl = tmpl->origin; int i = tmpl->line_no + tmpl->file->line_delta; return new_num_token(i, tmpl); } // __COUNTER__ is expanded to serial values starting from 0. static Token *counter_macro(Token *tmpl) { static int i = 0; return new_num_token(i++, tmpl); } // __TIMESTAMP__ is expanded to a string describing the last // modification time of the current file. E.g. // "Fri Jul 24 01:32:50 2020" static Token *timestamp_macro(Token *tmpl) { struct stat st; if (stat(tmpl->file->name, &st) != 0) return new_str_token("??? ??? ?? ??:??:?? ????", tmpl); char buf[30]; ctime_r(&st.st_mtime, buf); buf[24] = '\0'; return new_str_token(buf, tmpl); } static Token *builtin_atomics(Token *tmpl) { char *buf = "#include <\"stdatomic.h\""; return new_str_token(buf, tmpl); } static Token *base_file_macro(Token *tmpl) { return new_str_token(base_file, tmpl); } // __DATE__ is expanded to the current date, e.g. "May 17 2020". static char *format_date(struct tm *tm) { static char mon[][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", }; return format("\"%s %2d %d\"", mon[tm->tm_mon], tm->tm_mday, tm->tm_year + 1900); } // __TIME__ is expanded to the current time, e.g. "13:34:03". static char *format_time(struct tm *tm) { return format("\"%02d:%02d:%02d\"", tm->tm_hour, tm->tm_min, tm->tm_sec); } void init_macros(void) { if (opt_avx2) define_macro("__AVX2__", "1"); if (opt_sse4) { define_macro("__SSE4__", "1"); define_macro("__SSE4_2__", "1"); } if (opt_avx) { define_macro("__AVX__", "1"); } // Define predefined macros define_macro("__VERSION__", "\"" VERSION "\""); //define_macro("__builtin_offsetof", "offsetof"); define_macro("_LP64", "1"); define_macro("__C99_MACRO_WITH_VA_ARGS", "1"); define_macro("__ELF__", "1"); define_macro("__LP64__", "1"); define_macro("__SIZEOF_DOUBLE__", "8"); define_macro("__SIZEOF_FLOAT__", "4"); define_macro("__UINTPTR_TYPE__", "unsigned long"); define_macro("__INT32_TYPE__", "int"); define_macro("__SIZEOF_INT__", "4"); define_macro("SIZEOF_INT", "4"); define_macro("__SIZEOF_LONG_DOUBLE__", "16"); define_macro("__SIZEOF_LONG_LONG__", "8"); define_macro("__SIZEOF_LONG__", "8"); define_macro("SIZEOF_LONG", "8"); define_macro("__SIZEOF_POINTER__", "8"); define_macro("__SIZEOF_PTRDIFF_T__", "8"); define_macro("__SIZEOF_SHORT__", "2"); define_macro("__SIZEOF_SIZE_T__", "8"); define_macro("__SIZEOF_WCHAR_T__", "4"); define_macro("__WCHAR_TYPE__", "int"); define_macro("__WINT_TYPE__", "unsigned int"); define_macro("__SIZE_TYPE__", "unsigned long"); define_macro("__PTRDIFF_TYPE__", "long int"); define_macro("__STDC_HOSTED__", "1"); define_macro("__STDC_NO_COMPLEX__", "1"); define_macro("__STDC_UTF_16__", "1"); define_macro("__STDC_UTF_32__", "1"); //define_macro("__STDC_VERSION__", "201112L"); define_macro("__STDC__", "1"); define_macro("__has_builtin", "1"); // define_macro("__STDC_IEC_559__" , "1"); // define_macro("__STDC_ISO_10646__" , "201706L"); // define_macro("__STDC_IEC_559_COMPLEX__" , "1"); // define_macro("__STDC_IEC_60559_COMPLEX__" , "201404L"); // define_macro("__STDC_IEC_60559_BFP__" , "201404L"); define_macro("__uint128_t", "unsigned __int128"); define_macro("__GNUC_STDC_INLINE__", "1"); define_macro("__USER_LABEL_PREFIX__", ""); define_macro("__alignof__", "_Alignof"); define_macro("__amd64", "1"); define_macro("__amd64__", "1"); define_macro("__CHIBICC__", "1"); define_macro("__chibicc__", "1"); define_macro("__const__", "const"); define_macro("__gnu_linux__", "1"); define_macro("__inline__", "inline"); define_macro("__linux", "1"); define_macro("__linux__", "1"); define_macro("__signed__", "signed"); define_macro("__typeof__", "typeof"); define_macro("__unix", "1"); define_macro("__unix__", "1"); define_macro("__volatile__", "volatile"); define_macro("__x86_64", "1"); define_macro("__x86_64__", "1"); define_macro("_GNU_SOURCE", "1"); define_macro("_DEFAULT_SOURCE", "1"); //define_macro("__INTEL_COMPILER", "1"); //define_macro("__GNUC__", "9"); define_macro("__GNUC__", "4"); define_macro("__GNUC_MINOR__", "1"); define_macro("__GNUC_PATCHLEVEL__ ", "1"); //define_macro("HAVE_ATTRIBUTE_PACKED", "1"); define_macro("linux", "1"); define_macro("unix", "1"); define_macro("HAVE_RECV", "1"); define_macro("HAVE_SEND", "1"); define_macro("HAVE_SYS_IO_H", "1"); define_macro("__extension__", ""); define_macro("HAVE_TEST_AND_SET", "1"); define_macro("HAVE_LONG_LONG_INT_64", "1"); define_macro("__ATOMIC_RELAXED", "0"); define_macro("__ATOMIC_CONSUME", "1"); define_macro("__ATOMIC_ACQUIRE", "2"); define_macro("__ATOMIC_RELEASE", "3"); define_macro("__ATOMIC_ACQ_REL", "4"); define_macro("__ATOMIC_SEQ_CST", "5"); define_macro("__SHRT_MAX__", "32767"); define_macro("__INT_MAX__", "2147483647"); define_macro("__LONG_MAX__", "9223372036854775807L"); define_macro("__LONG_LONG_MAX__", "9223372036854775807LL"); define_macro("__SCHAR_MAX__", "127"); define_macro("__WCHAR_MAX__", "2147483647"); define_macro("__CHAR_BIT__", "8"); define_macro("__SCHAR_MAX__", "127"); define_macro("__SHRT_MAX__", "32767"); define_macro("__INT_MAX__", "2147483647"); define_macro("__LONG_MAX__", "9223372036854775807L"); define_macro("__LONG_LONG_MAX__", "9223372036854775807LL"); define_macro("__SCHAR_WIDTH__", "8"); define_macro("__SHRT_WIDTH__", "16"); define_macro("__INT_WIDTH__", "32"); define_macro("__LONG_WIDTH__", "64"); define_macro("__LONG_LONG_WIDTH__", "64"); define_macro("__SCHAR_MIN__", "-128"); define_macro("__SHRT_MIN__", "-32768"); define_macro("__INT_MIN__", "-2147483648"); define_macro("__LONG_MIN__", "-9223372036854775808L"); define_macro("__LONG_LONG_MIN__", "-9223372036854775808LL"); define_macro("HAVE_ATTRIBUTE_PACKED", "1"); define_macro("linux", "1"); define_macro("unix", "1"); define_macro("__extension__", ""); //define_macro("__has_attribute(x)", "1"); define_macro("__builtin_strlen", "strlen"); //define_macro("nonnull", "1"); //====fixing ISS-147 defining the two macros for the linux platform define_macro("__ORDER_LITTLE_ENDIAN__", "1234"); define_macro("__ORDER_BIG_ENDIAN__", "4321"); define_macro("__BYTE_ORDER__", "__ORDER_LITTLE_ENDIAN__"); define_macro("USE_BUILTINS", "1"); define_macro("_Pragma(message) ", ""); add_builtin("__STDC_VERSION__", stdver_macro); add_builtin("__FILE__", file_macro); add_builtin("__LINE__", line_macro); add_builtin("__COUNTER__", counter_macro); add_builtin("__TIMESTAMP__", timestamp_macro); add_builtin("__BASE_FILE__", base_file_macro); add_builtin("__BUILTIN_ATOMICS__", builtin_atomics); time_t now = time(NULL); struct tm *tm = localtime(&now); define_macro("__DATE__", format_date(tm)); define_macro("__TIME__", format_time(tm)); } typedef enum { STR_NONE, STR_UTF8, STR_UTF16, STR_UTF32, STR_WIDE, } StringKind; static StringKind getStringKind(Token *tok) { if (!strcmp(tok->loc, "u8")) return STR_UTF8; switch (tok->loc[0]) { case '"': return STR_NONE; case 'u': return STR_UTF16; case 'U': return STR_UTF32; case 'L': return STR_WIDE; } unreachable(); } // Concatenate adjacent string literals into a single string literal // as per the C spec. static void join_adjacent_string_literals(Token *tok) { // First pass: If regular string literals are adjacent to wide // string literals, regular string literals are converted to a wide // type before concatenation. In this pass, we do the conversion. for (Token *tok1 = tok; tok1->kind != TK_EOF;) { if (tok1->kind != TK_STR || tok1->next->kind != TK_STR) { tok1 = tok1->next; continue; } StringKind kind = getStringKind(tok1); if (!tok1->ty){ error("%s:%d: error: in join_adjacent_string_literals : tok1->ty is null", __FILE__, __LINE__); } Type *basety = tok1->ty->base; for (Token *t = tok1->next; t->kind == TK_STR; t = t->next) { StringKind k = getStringKind(t); if (kind == STR_NONE) { kind = k; basety = t->ty->base; } else if (k != STR_NONE && kind != k) { error_tok(t, "%s:%d: in join_adjacent_string_literals : unsupported non-standard concatenation of string literals", __FILE__, __LINE__); } } if (basety->size > 1) for (Token *t = tok1; t->kind == TK_STR; t = t->next) if (t->ty->base->size == 1) *t = *tokenize_string_literal(t, basety); while (tok1->kind == TK_STR) tok1 = tok1->next; } // Second pass: concatenate adjacent string literals. for (Token *tok1 = tok; tok1->kind != TK_EOF;) { if (tok1->kind != TK_STR || tok1->next->kind != TK_STR) { tok1 = tok1->next; continue; } if (!tok1->ty){ error("%s:%d: error: in join_adjacent_string_literals : tok1->ty is null", __FILE__, __LINE__); } Token *tok2 = tok1->next; while (tok2->kind == TK_STR) tok2 = tok2->next; int len = tok1->ty->array_len; for (Token *t = tok1->next; t != tok2; t = t->next) len = len + t->ty->array_len - 1; char *buf = calloc(tok1->ty->base->size, len); if (buf == NULL) error("%s:%d: error: in join_adjacent_string_literals : buf is null", __FILE__, __LINE__); int i = 0; for (Token *t = tok1; t != tok2; t = t->next) { memcpy(buf + i, t->str, t->ty->size); i = i + t->ty->size - t->ty->base->size; } *tok1 = *copy_token(tok1); tok1->ty = array_of(tok1->ty->base, len); tok1->str = buf; tok1->next = tok2; tok1 = tok2; } } // Entry point function of the preprocessor. Token *preprocess(Token *tok, bool isReadLine) { if (!isReadLine) { pragma_pack_current = 0; pragma_pack_depth = 0; } tok = preprocess2(tok); if (cond_incl && !isReadLine) error_tok(cond_incl->tok, "%s:%d: in preprocess : unterminated conditional directive", __FILE__, __LINE__); convert_pp_tokens(tok); //ISS-142 temp fix if (!opt_E) { join_adjacent_string_literals(tok); } for (Token *t = tok; t; t = t->next) t->line_no += abs(t->line_delta); // fixing issue with negative number that caused assembly issue return tok; } void print_all_macros(void) { for (int i = 0; i < macros.capacity; i++) { HashEntry *e = ¯os.buckets[i]; if (e->key) { Macro *m = (Macro *)e->val; print_macro(m); } } } chibicc-1.0.24/printast.c000066400000000000000000000575061517770275000152220ustar00rootroot00000000000000/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ │ vi: set et ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi │ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright 2020 Justine Alexandra Roberts Tunney │ │ │ │ Permission to use, copy, modify, and/or distribute this software for │ │ any purpose with or without fee is hereby granted, provided that the │ │ above copyright notice and this permission notice appear in all copies. │ │ │ │ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ │ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ │ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ │ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ │ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ │ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "chibicc.h" #define HASH_TABLE_SIZE 256 // Simple hash table entry typedef struct HashTableEntry { Type *type; struct HashTableEntry *next; } HashTableEntry; // Simple hash table HashTableEntry *hashTable[HASH_TABLE_SIZE]; // Hash function for Type pointer unsigned int hash(Type *ty) { return ((unsigned long)ty) % HASH_TABLE_SIZE; } // Insert Type into hash table bool insertType(Type *ty) { unsigned int index = hash(ty); HashTableEntry *entry = hashTable[index]; while (entry) { if (entry->type == ty) { return false; // Type already exists, cycle detected } entry = entry->next; } // Insert new entry HashTableEntry *newEntry = malloc(sizeof(HashTableEntry)); newEntry->type = ty; newEntry->next = hashTable[index]; hashTable[index] = newEntry; return true; } static const char kBoolStr[2][6] = {"false", "true"}; static const char kTypeKindStr[17][8] = { "VOID", "BOOL", "CHAR", "SHORT", "INT", "LONG", "INT128", "FLOAT", "DOUBLE", "LDOUBLE", "ENUM", "PTR", "FUNC", "ARRAY", "VLA", "STRUCT", "UNION", }; static const char kNodeKindStr[553][21] = { "NULL_EXPR", "ADD", "SUB", "MUL", "DIV", "NEG", "MOD", "BITAND", "BITOR", "BITXOR", "SHL", "SHR", "EQ", "NE", "LT", "LE", "ASSIGN", "COND", "COMMA", "MEMBER", "ADDR", "DEREF", "NOT", "BITNOT", "LOGAND", "LOGOR", "RETURN", "IF", "FOR", "DO", "SWITCH", "CASE", "BLOCK", "GOTO", "GOTO_EXPR", "LABEL", "LABEL_VAL", "FUNCALL", "EXPR_STMT", "STMT_EXPR", "VAR", "VLA_PTR", "NUM", "CAST", "MEMZERO", "ASM", "CAS", "EXCH", "CAS_N", "EXCH_N", "CMPEXCH", "CMPEXCH_N", "LOAD", "LOAD_N", "STORE", "STORE_N", "TESTANDSET", "TESTANDSETA", "CLEAR", "RELEASE", "FETCHADD", "FETCHSUB", "FETCHXOR", "FETCHAND", "FETCHOR", "SUBFETCH", "SYNC", "MEMBARRIER", "BUILTIN_MEMCPY", "BUILTIN_MEMSET", "BUILTIN_CLZ", "BUILTIN_CLZL", "BUILTIN_CLZLL", "BUILTIN_CTZ", "BUILTIN_CTZL", "BUILTIN_CTZLL", "POPCOUNT", "EXPECT", "ABORT", "RETURN_ADDR", "BUILTIN_ADD_OVERFLOW", "BUILTIN_SUB_OVERFLOW", "BUILTIN_MUL_OVERFLOW", "UNREACHABLE", "ALLOCA", "BUILTIN_INFF", "BUILTIN_INF", "BUILTIN_NAN", "BUILTIN_NANF", "BUILTIN_NANL", "BUILTIN_ISNAN", "BUILTIN_HUGE_VALL", "BUILTIN_HUGE_VALF", "BUILTIN_HUGE_VAL", "BSWAP16", "BSWAP32", "BSWAP64", "FRAME_ADDRESS", "EMMS", "SFENCE", "LFENCE", "MFENCE", "PAUSE", "STMXCSR", "CVTPI2PS", "CVTPS2PI", "CLFLUSH", "VEC_INIT_V2SI", "VEC_EXT_V2SI", "PACKSSWB", "PACKSSDW", "PACKUSWB", "PUNPCKHBW", "PUNPCKHWD", "PUNPCKHDQ", "PUNPCKLBW", "PUNPCKLWD", "PUNPCKLDQ", "PADDB", "PADDW", "PADDD", "PADDQ", "PADDSB", "PADDSW", "PADDUSB", "PADDUSW", "PSUBB", "PSUBW", "PSUBD", "PSUBQ", "PSUBSB", "PSUBSW", "PSUBUSB", "PSUBUSW", "PMADDWD", "PMULHW", "PMULLW", "PSLLW", "PSLLWI", "PSLLD", "PSLLDI", "PSLLQ", "PSLLQI", "PSRAW", "PSRAWI", "PSRAD", "PSRADI", "PSRLW", "PSRLWI", "PSRLD", "PSRLDI", "PSRLQ", "PSRLQI", "PAND", "PANDN", "POR", "PXOR", "PCMPEQB", "PCMPGTB", "PCMPEQW", "PCMPEQD", "PCMPGTW", "PCMPGTD", "VEC_INIT_V4HI", "VEC_INIT_V8QI", "ADDSS", "SUBSS", "MULSS", "DIVSS", "SQRTSS", "RCPSS", "RSQRTSS", "SQRTPS", "MINSS", "MAXSS", "RCPPS", "RSQRTPS", "MINPS", "MAXPS", "ANDPS", "ANDNPS", "ORPS", "XORPS", "CMPEQSS", "CMPLTSS", "CMPLESS", "MOVSS", "CMPNEQSS", "CMPNLTSS", "CMPNLESS", "CMPORDSS", "CMPUNORDSS", "CMPEQPS", "CMPLTPS", "CMPLEPS", "CMPGTPS", "CMPGEPS", "CMPNEQPS", "CMPNLTPS", "CMPNLEPS", "CMPNGTPS", "CMPNGEPS", "CMPORDPS", "CMPUNORDPS", "COMIEQ", "COMILT", "COMILE", "COMIGT", "COMIGE", "COMINEQ", "UCOMIEQ", "UCOMILT", "UCOMILE", "UCOMIGT", "UCOMIGE", "UCOMINEQ", "CVTSS2SI", "CVTSS2SI64", "CVTTSS2SI", "CVTTSS2SI64", "CVTTPS2PI", "CVTSI2SS", "CVTSI642SS", "MOVLHPS", "MOVHLPS", "UNPCKHPS", "UNPCKLPS", "LOADHPS", "STOREHPS", "LOADLPS", "STORELPS", "MOVMSKPS", "LDMXCSR", "SHUFPS", "SHUFFLE", "PMAXSW", "PMAXUB", "PMINSW", "PMINUB", "PMOVMSKB", "PMULHUW", "MASKMOVQ", "PAVGB", "PAVGW", "PSADBW", "MOVNTQ", "MOVNTPS", "SHUFPD", "VEC_EXT_V4SI", "ADDSD", "SUBSD", "MULSD", "DIVSD", "SQRTPD", "MOVSD", "SQRTSD", "MINPD", "MINSD", "MAXPD", "MAXSD", "ANDPD", "ANDNPD", "ORPD", "XORPD", "CMPEQPD", "CMPLTPD", "CMPLEPD", "CMPGTPD", "CMPGEPD", "CMPNEQPD", "CMPNLTPD", "CMPNLEPD", "CMPNGTPD", "CMPNGEPD", "CMPORDPD", "CMPUNORDPD", "CMPEQSD", "CMPLTSD", "CMPLESD", "CMPNEQSD", "CMPNLTSD", "CMPNLESD", "CMPORDSD", "CMPUNORDSD", "COMISDEQ", "COMISDLT", "COMISDLE", "COMISDGT", "COMISDGE", "COMISDNEQ", "UCOMISDEQ", "UCOMISDLT", "UCOMISDLE", "UCOMISDGT", "UCOMISDGE", "UCOMISDNEQ", "MOVQ128", "CVTDQ2PD", "CVTDQ2PS", "CVTPD2DQ", "CVTPD2PI", "CVTPD2PS", "CVTTPD2DQ", "CVTTPD2PI", "CVTPI2PD","CVTPS2DQ", "CVTTPS2DQ", "CVTPS2PD", "CVTSD2SI", "CVTSD2SI64", "CVTTSD2SI", "CVTTSD2SI64", "CVTSD2SS", "CVTSI2SD", "CVTSI642SD", "CVTSS2SD", "UNPCKHPD", "UNPCKLPD", "LOADHPD", "LOADLPD", "MOVMSKPD", "PACKSSWB128", "PACKSSDW128", "PACKUSWB128", "PUNPCKHB128", "PUNPCKHWD128", "PUNPCKHDQ128", "PUNPCKHQDQ128", "PUNPCKLBW128", "PUNPCKLWD128", "PUNPCKLDQ128", "PUNPCKLQDQ128", "PADDSB128", "PADDSW128", "PADDUSB128", "PADDUSW128", "PSUBSB128", "PSUBSW128", "PSUBUSB128", "PSUBUSW128", "PMADDWD128", "PMULHW128", "PMULUDQ", "PMULUDQ128", "PSLLWI128", "PSLLDI128", "PSLLQI128", "PSRAWI128", "PSRADI128", "PSRLWI128", "PSRLDI128", "PSRLQI128", "PSLLW128", "PSLLD128", "PSLLQ128", "PSRAW128", "PSRAD128", "PSRLW128", "PSRLD128", "PSRLQ128", "PANDN128", "PMAXSW128", "PMAXUB128", "PMINSW128", "PMINUB128", "PMOVMSKB128", "PMULHUW128", "MASKMOVDQU", "PAVGB128", "PAVGW128", "PSADBW128", "MOVNTI", "MOVNTI64", "MOVNTDQ", "MOVNTPD", "POPCOUNTL", "POPCOUNTLL", "PARITY", "PARITYL", "PARITYLL", "UADD_OVERFLOW", "UADDL_OVERFLOW", "UADDLL_OVERFLOW", "UMUL_OVERFLOW", "UMULL_OVERFLOW", "UMULLL_OVERFLOW", "POS", "MWAIT", "MONITOR", "ADDSUBPS", "HADDPS", "HSUBPS", "MOVSHDUP", "MOVSLDUP", "ADDSUBPD", "HADDPD", "HSUBPD", "LDDQU", "PHADDW128", "PHADDD128", "PHADDSW128", "PHADDW", "PHADDD", "PHADDSW", "PHSUBW128", "PHSUBD128", "PHSUBSW128", "PHSUBW", "PHSUBD", "PHSUBSW", "PMADDUBSW128", "PMADDUBSW", "PMULHRSW128", "PMULHRSW", "PSHUFB128", "PSHUFB", "PSIGNB128", "PSIGNW128", "PSIGND128", "PSIGNB", "PSIGNW", "PSIGND", "PABSB128", "PABSW128", "PABSD128", "PABSB", "PABSW", "PABSD", "PTESTZ128", "PTESTC128", "PTESTNZC128", "PBLENDVB128", "BLENDVPS", "BLENDVPD", "PMINSB128", "PMAXSB128", "PMINUW128", "PMAXUW128", "PMINSD128", "PMAXSD128", "PMINUD128", "PMAXUD128", "PMULDQ128", "PHMINPOSUW128", "PMOVSXBD128", "PMOVSXWD128", "PMOVSXBQ128", "PMOVSXDQ128", "PMOVSXWQ128", "PMOVSXBW128", "PMOVZXBD128", "PMOVZXWD128", "PMOVZXBQ128", "PMOVZXBW128", "PMOVZXDQ128", "PMOVZXWQ128", "PACKUSDW128", "MOVNTDQA", "CRC32QI", "CRC32HI", "CRC32SI", "CRC32DI", "PSHUFD", "FETCHNAND", "ADD_AND_FETCH", "SUB_AND_FETCH", "BOOL_CAS", "PREFETCH", "RDTSC", "READEFLAGS_U64", "RDSSPQ", "SAVEPREVSSP", "SETSSBSY", "SLWPCB", "RDPKRU", "XBEGIN", "XEND", "SERIALIZE", "XSUSLDTRK", "XRESLDTRK", "CLUI", "STUI", "TESTUI", "WBNOINVD", "XTEST", "WBINVD", "RDPID", "RDFSBASE32", "RDFSBASE64", "RDGSBASE32", "RDGSBASE64", "VZEROALL", "VZEROUPPER", "FEMMS", "BSRSI", "RDPMC", "RDTSCP", "ROLQI", "ROLHI", "RORQI", "RORHI", "BSRDI", "WRITEEFLAGS_U64", "INCSSPQ", "RSTORSSP", "WRSSD", "WRSSQ", "WRUSSD", "WRUSSQ", "CLRSSBSY", "SBB_U32", "ADDCARRYX_U32", "SBB_U64", "ADDCARRYX_U64", "TZCNT_U16", "BEXTR_U32", "ADDFETCH", "ORFETCH", "ANDFETCH", "XORFETCH", "NANDFETCH", "FPCLASSIFY", "ISUNORDERED", "SIGNBIT", "SIGNBITF", "SIGNBITL", "ATOMIC_IS_LOCK_FREE", "PSUBUSB256", "PCMPGTB256_MASK", "PSHUFB256", "PBLENDVB256", "PSRLDQI256", "PSLLDQI256", "VINSERTF128_SI256", "SI256_SI", "SI_SI256", "PALIGNR256", "VPERM2I128_SI256", "PBLENDD256", "VEXTRACTF128_SI256", "VEC_EXT_V16QI", "VEC_EXT_V8HI", "ANDNOTSI256", "VEC_EXT_V2DI", "PMULHUW256", "PD256_PD", "PS256_PS", "PSRLQI256", "PSLLQI256", "PERMDI256", "PSLLDI256", "PSRLDI256", "PSRADI256" }; static struct Visited { size_t i, n; intptr_t *p; } g_visited; static void PrintObj(FILE *, int, const char *, Obj *); static void PrintNode(FILE *, int, const char *, Node *); static void PrintType(FILE *, int, const char *, Type *); static void PrintFpClassify(FILE *, int, const char *, FpClassify *); static void PrintInitializer(FILE *, int, const char *, Initializer *); static void PrintAsm(FILE *f, int l, const char *s, char *a); static bool Visit(void *ptr) { intptr_t addr = (intptr_t)ptr; for (size_t i = 0; i < g_visited.i; ++i) { if (addr == g_visited.p[i]) { return false; } } if (g_visited.i == g_visited.n) { size_t new_n = g_visited.n ? g_visited.n * 2 : 64; intptr_t *new_p = realloc(g_visited.p, new_n * sizeof(intptr_t)); if (!new_p) { return true; } g_visited.p = new_p; g_visited.n = new_n; } /* Append */ g_visited.p[g_visited.i++] = addr; return true; } static void PrintLine(FILE *f, int l, char *fmt, ...) { int i; va_list ap; for (i = 0; i < l; ++i) fputc(' ', f); va_start(ap, fmt); vfprintf(f, fmt, ap); va_end(ap); fputc('\n', f); } static void PrintBool(FILE *f, int l, const char *s, bool b) { if (!b) return; PrintLine(f, l, "%s%s", s, kBoolStr[b]); } static void PrintInt(FILE *f, int l, const char *s, long x) { if (!x) return; PrintLine(f, l, "%s%ld", s, x); } static void PrintStr(FILE *f, int l, const char *s, const char *t) { if (!t || !*t) return; PrintLine(f, l, "%s%s", s, t); } static void PrintTokStr(FILE *f, int l, const char *s, Token *t) { if (!t) return; PrintLine(f, l, "%s%.*s", s, (int)t->len, t->loc); } static void PrintMember(FILE *f, int l, const char *s, Member *m) { if (!m) return; PrintLine(f, l, "%sMember { # %p", s, m); PrintTokStr(f, l + 2, "name: ", m->name); PrintInt(f, l + 2, "idx: ", m->idx); PrintInt(f, l + 2, "align: ", m->align); PrintInt(f, l + 2, "offset: ", m->offset); PrintBool(f, l + 2, "is_bitfield: ", m->is_bitfield); PrintInt(f, l + 2, "bit_offset: ", m->bit_offset); PrintInt(f, l + 2, "bit_width: ", m->bit_width); PrintType(f, l + 2, "ty: ", m->ty); PrintLine(f, l, "}"); } static void PrintMembers(FILE *f, int l, const char *s, Member *m) { for (; m; m = m->next) { PrintMember(f, l, s, m); } } static void PrintType(FILE *f, int l, const char *s, Type *t) { for (; t; t = t->next) { if (!insertType(t)) { //printf("Detected cycle at address: %p\n", (void *)t); break; // Exit to avoid infinite loop } if (Visit(t)) { PrintLine(f, l, "%sType { # %p", s, t); PrintLine(f, l + 2, "kind: TY_%s", kTypeKindStr[t->kind]); PrintInt(f, l + 2, "size: ", t->size); PrintInt(f, l + 2, "align: ", t->align); PrintBool(f, l + 2, "is_unsigned: ", t->is_unsigned); PrintBool(f, l + 2, "is_atomic: ", t->is_atomic); PrintType(f, l + 2, "base: ", t->base); PrintTokStr(f, l + 2, "name: ", t->name); PrintTokStr(f, l + 2, "name_pos: ", t->name_pos); PrintInt(f, l + 2, "array_len: ", t->array_len); PrintInt(f, l + 2, "vector_size: ", t->vector_size); PrintNode(f, l + 2, "vla_len: ", t->vla_len); PrintObj(f, l + 2, "vla_size: ", t->vla_size); PrintMembers(f, l + 2, "members: ", t->members); PrintBool(f, l + 2, "is_flexible: ", t->is_flexible); PrintBool(f, l + 2, "is_packed: ", t->is_packed); PrintBool(f, l + 2, "is_aligned: ", t->is_aligned); PrintBool(f, l + 2, "is_const: ", t->is_const); PrintBool(f, l + 2, "is_restrict: ", t->is_restrict); PrintBool(f, l + 2, "is_volatile: ", t->is_volatile); PrintBool(f, l + 2, "is_static: ", t->is_static); PrintBool(f, l + 2, "is_ms_abi: ", t->is_ms_abi); PrintBool(f, l + 2, "is_pointer: ", t->is_pointer); PrintBool(f, l + 2, "has_vla: ", t->has_vla); PrintBool(f, l + 2, "is_weak: ", t->is_weak); PrintBool(f, l + 2, "is_inline: ", t->is_inline); PrintBool(f, l + 2, "is_compound_lit: ", t->is_compound_lit); PrintBool(f, l + 2, "is_vector: ", t->is_vector); PrintBool(f, l + 2, "is_constructor: ", t->is_constructor); PrintInt(f, l + 2, "constructor_priority: ", t->constructor_priority); PrintBool(f, l + 2, "is_destructor: ", t->is_destructor); PrintInt(f, l + 2, "destructor_priority: ", t->destructor_priority); PrintStr(f, l + 2, "visibility: ", t->visibility); PrintStr(f, l + 2, "alias_name: ", t->alias_name); PrintStr(f, l + 2, "section: ", t->section); PrintType(f, l + 2, "return_ty: ", t->return_ty); PrintType(f, l + 2, "params: ", t->params); PrintBool(f, l + 2, "is_variadic: ", t->is_variadic); PrintType(f, l + 2, "pointertype: ", t->pointertype); PrintType(f, l + 2, "origin: ", t->origin); PrintType(f, l + 2, "decl_next: ", t->decl_next); PrintInt(f, l + 2, "min_vector_width: ", t->min_vector_width); PrintLine(f, l, "}"); } else if (t->name) { PrintLine(f, l, "%sTY_%s %.*s # %p", s, kTypeKindStr[t->kind], t->name->len, t->name->loc, t); } else { PrintLine(f, l, "%sTY_%s # %p", s, kTypeKindStr[t->kind], t); } } } static void PrintAsm(FILE *f, int l, const char *s, char * a) { if (!a) return; PrintLine(f, l, "%sAsm { # %p", s, a); PrintStr(f, l + 2, "str: ", a); } static void PrintFpClassify(FILE *f, int l, const char *s, FpClassify *fpc) { if (!fpc) return; PrintLine(f, l, "%sFpClassify { # %p", s, fpc); PrintNode(f, l + 2, "node: ", fpc->node); for (int i = 0; i < 5; ++i) { PrintInt(f, l + 2, "arg: ", fpc->args[i]); } PrintLine(f, l, "}"); } static void PrintInitializer(FILE *f, int l, const char *s, Initializer *init) { if (!init) return; PrintLine(f, l, "%sInitializer { # %p", s, init); PrintType(f, l + 2, "ty: ", init->ty); PrintTokStr(f, l + 2, "tok: ", init->tok); PrintBool(f, l + 2, "is_flexible: ", init->is_flexible); PrintNode(f, l + 2, "expr: ", init->expr); if (init->children && init->ty) { int len = 0; if (init->ty->kind == TY_ARRAY || init->ty->kind == TY_VECTOR) len = init->ty->array_len; else if (init->ty->kind == TY_STRUCT || init->ty->kind == TY_UNION) { for (Member *m = init->ty->members; m; m = m->next) len++; } for (int i = 0; i < len; ++i) { if (init->children[i]) PrintInitializer(f, l + 2, "child: ", init->children[i]); } } PrintMember(f, l + 2, "mem: ", init->mem); PrintLine(f, l, "}"); if (init->next) PrintInitializer(f, l, "next: ", init->next); } static void PrintNode(FILE *f, int l, const char *s, Node *n) { for (; n; n = n->next) { if (!Visit(n)) { /* already printed this node; print a short marker and continue */ PrintLine(f, l, "%sNode # %p (already visited)", s, n); continue; } const char *kindstr = "UNKNOWN"; if (n->kind >= 0 && n->kind < (int)(sizeof(kNodeKindStr)/sizeof(kNodeKindStr[0]))) kindstr = kNodeKindStr[n->kind]; PrintLine(f, l, "%sNode { # %p", s, n); PrintLine(f, l + 2, "kind: ND_%s", kindstr); PrintLine(f, l + 2, "kind: ND_%s", kNodeKindStr[n->kind]); PrintType(f, l + 2, "ty: ", n->ty); if (n->lhs) PrintNode(f, l + 2, "lhs: ", n->lhs); if (n->rhs) PrintNode(f, l + 2, "rhs: ", n->rhs); if (n->cond) PrintNode(f, l + 2, "cond: ", n->cond); if (n->then) PrintNode(f, l + 2, "then: ", n->then); if (n->els) PrintNode(f, l + 2, "els: ", n->els); if (n->init) PrintNode(f, l + 2, "init: ", n->init); if (n->inc) PrintNode(f, l + 2, "inc: ", n->inc); if (n->body) PrintNode(f, l + 2, "body: ", n->body); if (n->case_next) PrintNode(f, l + 2, "case_next: ", n->case_next); if (n->default_case) PrintNode(f, l + 2, "default_case: ", n->default_case); PrintType(f, l + 2, "func_ty: ", n->func_ty); PrintNode(f, l + 2, "args: ", n->args); PrintObj(f, l + 2, "ret_buffer: ", n->ret_buffer); PrintBool(f, l + 2, "pass_by_stack: ", n->pass_by_stack); PrintBool(f, l + 2, "realign_stack: ", n->realign_stack); if (n->label) PrintStr(f, l + 2, "label: ", n->label); if (n->unique_label) PrintStr(f, l + 2, "unique_label: ", n->unique_label); if (n->goto_next) PrintNode(f, l + 2, "goto_next: ", n->goto_next); if (n->brk_label) PrintStr(f, l + 2, "brk_label: ", n->brk_label); if (n->cont_label) PrintStr(f, l + 2, "cont_label: ", n->cont_label); PrintInt(f, l + 2, "begin: ", n->begin); if (n->asm_str) PrintAsm(f, l + 2, "asm: ", n->asm_str); PrintInt(f, l + 2, "end: ", n->end); if (n->member) PrintMember(f, l + 2, "member: ", n->member); PrintObj(f, l + 2, "var: ", n->var); PrintInt(f, l + 2, "val: ", n->val); PrintInt(f, l + 2, "memorder: ", n->memorder); if (n->cas_addr) PrintNode(f, l + 2, "cas_addr: ", n->cas_addr); if (n->cas_old) PrintNode(f, l + 2, "cas_old: ", n->cas_old); if (n->cas_new) PrintNode(f, l + 2, "cas_new: ", n->cas_new); if (n->cas_ptr) PrintNode(f, l + 2, "cas_ptr: ", n->cas_ptr); if (n->cas_expected) PrintNode(f, l + 2, "cas_expected: ", n->cas_expected); if (n->cas_desired) PrintNode(f, l + 2, "cas_desired: ", n->cas_desired); if (n->cas_weak) PrintNode(f, l + 2, "cas_weak: ", n->cas_weak); if (n->cas_success) PrintNode(f, l + 2, "cas_success: ", n->cas_success); if (n->cas_failure) PrintNode(f, l + 2, "cas_failure: ", n->cas_failure); if (n->builtin_dest) PrintNode(f, l + 2, "builtin_dest: ", n->builtin_dest); if (n->builtin_src) PrintNode(f, l + 2, "builtin_src: ", n->builtin_src); if (n->builtin_size) PrintNode(f, l + 2, "builtin_size: ", n->builtin_size); if (n->atomic_expr) PrintNode(f, l + 2, "atomic_expr: ", n->atomic_expr); if (n->atomic_addr) PrintObj(f, l + 2, "atomic_addr: ", n->atomic_addr); PrintBool(f, l + 2, "atomic_fetch: ", n->atomic_fetch); if (n->builtin_val) PrintNode(f, l + 2, "builtin_val: ", n->builtin_val); for (int i = 0; i < n->builtin_nargs; i++) { PrintNode(f, l + 2, "builtin_arg: ", n->builtin_args[i]); } PrintInt(f, l + 2, "builtin_nargs: ", n->builtin_nargs); if (n->fpc) PrintFpClassify(f, l + 2, "fpc: ", n->fpc); PrintBool(f, l + 2, "is_tail: ", n->is_tail); PrintBool(f, l + 2, "is_scalar_promoted: ", n->is_scalar_promoted); if (n->fval) PrintLine(f, l + 2, "fval: %Lf", n->fval); PrintLine(f, l, "}"); } } static void PrintRelo(FILE *f, int l, const char *s, Relocation *r) { for (; r; r = r->next) { PrintLine(f, l, "%sRelocation { # %p", s, r); PrintInt(f, l + 2, "offset: ", r->offset); if (r->label) PrintStr(f, l + 2, "label: ", *r->label); PrintInt(f, l + 2, "addend: ", r->addend); PrintLine(f, l, "}"); } } static void PrintObj(FILE *f, int l, const char *s, Obj *o) { if (!o) return; PrintLine(f, l, "%sObj { # %p", s, o); PrintStr(f, l + 2, "name: ", o->name); if (o->funcname) PrintStr(f, l + 2, "funcname: ", o->funcname); if (o->alias_name) PrintStr(f, l + 2, "alias_name: ", o->alias_name); PrintType(f, l + 2, "ty: ", o->ty); PrintBool(f, l + 2, "is_local: ", o->is_local); PrintBool(f, l + 2, "is_compound_lit: ", o->is_compound_lit); PrintInt(f, l + 2, "align: ", o->align); PrintInt(f, l + 2, "offset: ", o->offset); PrintInt(f, l + 2, "order: ", o->order); PrintInt(f, l + 2, "nbparm: ", o->nbparm); PrintBool(f, l + 2, "is_function: ", o->is_function); PrintBool(f, l + 2, "is_definition: ", o->is_definition); PrintBool(f, l + 2, "is_static: ", o->is_static); PrintBool(f, l + 2, "is_weak: ", o->is_weak); PrintBool(f, l + 2, "is_extern: ", o->is_extern); PrintBool(f, l + 2, "is_externally_visible: ", o->is_externally_visible); if (o->asmname) PrintStr(f, l + 2, "asmname: ", o->asmname); if (o->section) PrintStr(f, l + 2, "section: ", o->section); if (o->visibility) PrintStr(f, l + 2, "visibility: ", o->visibility); PrintBool(f, l + 2, "is_tentative: ", o->is_tentative); //PrintBool(f, l + 2, "is_string_literal: ", o->is_string_literal); PrintBool(f, l + 2, "is_tls: ", o->is_tls); if (o->init_data) PrintStr(f, l + 2, "init_data: ", o->init_data); PrintRelo(f, l + 2, "rel: ", o->rel); PrintBool(f, l + 2, "is_inline: ", o->is_inline); PrintBool(f, l + 2, "is_aligned: ", o->is_aligned); PrintBool(f, l + 2, "is_noreturn: ", o->is_noreturn); PrintBool(f, l + 2, "is_destructor: ", o->is_destructor); PrintInt(f, l + 2, "destructor_priority: ", o->destructor_priority); PrintBool(f, l + 2, "is_constructor: ", o->is_constructor); PrintInt(f, l + 2, "constructor_priority: ", o->constructor_priority); PrintBool(f, l + 2, "is_externally_visible: ", o->is_externally_visible); PrintBool(f, l + 2, "is_no_instrument_function: ", o->is_no_instrument_function); PrintBool(f, l + 2, "is_force_align_arg_pointer: ", o->is_force_align_arg_pointer); PrintBool(f, l + 2, "is_no_caller_saved_registers: ", o->is_no_caller_saved_registers); PrintTokStr(f, l + 2, "tok: ", o->tok); PrintStr(f, l + 2, "ptr: ", o->ptr); PrintBool(f, l + 2, "is_ms_abi: ", o->is_ms_abi); PrintInt(f, l + 2, "stack_offset: ", o->stack_offset); PrintInt(f, l + 2, "stack_align: ", o->stack_align); for (int i = 0; i < o->refs.len; i++) { PrintStr(f, l + 2, "ref: ", o->refs.data[i]); } PrintInitializer(f, l + 2, "init: ", o->init); PrintBool(f, l + 2, "force_frame_pointer: ", o->force_frame_pointer); PrintInt(f, l + 2, "min_vector_width: ", o->min_vector_width); PrintInt(f, l + 2, "stack_size: ", o->stack_size); PrintInt(f, l + 2, "overflow_arg_area: ", o->overflow_arg_area); PrintBool(f, l + 2, "pass_by_stack: ", o->pass_by_stack); PrintObj(f, l + 2, "params: ", o->params); if (o->body) PrintNode(f, l + 2, "body: ", o->body); if (o->locals) PrintObj(f, l + 2, "locals: ", o->locals); if (o->va_area) PrintObj(f, l + 2, "va_area: ", o->va_area); if (o->alloca_bottom) PrintObj(f, l + 2, "alloca_bottom: ", o->alloca_bottom); PrintBool(f, l + 2, "is_live: ", o->is_live); PrintBool(f, l + 2, "is_root: ", o->is_root); PrintInt(f, l + 2, "file_no: ", o->file_no); PrintInt(f, l + 2, "line_no: ", o->line_no); PrintBool(f, l + 2, "is_prototyped: ", o->is_prototyped); PrintBool(f, l + 2, "is_address_used: ", o->is_address_used); PrintBool(f, l + 2, "is_param: ", o->is_param); PrintLine(f, l, "}"); } void print_ast(FILE *f, Obj *o) { g_visited.i = 0; for (; o ; o = o->next) { PrintObj(f, 0, "", o); } } chibicc-1.0.24/pvs.sh000077500000000000000000000002621517770275000143440ustar00rootroot00000000000000pvs-studio-analyzer trace -- make pvs-studio-analyzer analyze -f ./strace_out plog-converter -a GA:1,2 -t tasklist -o report.tasks ./PVS-Studio.log rm strace_out PVS-Studio.log chibicc-1.0.24/report.tasks000077500000000000000000000050331517770275000155630ustar00rootroot00000000000000pvs-studio.com/en/docs/warnings/ 1 err Help: The documentation for all analyzer warnings is available here: https://pvs-studio.com/en/docs/warnings/. /home/stormalf/tests_c/chibicc/main.c 44 warn V707 Giving short names to global variables is considered to be bad practice. It is suggested to rename 'f' variable. /home/stormalf/tests_c/chibicc/main.c 86 warn V575 The potential null pointer is passed into 'dirname' function. Inspect the first argument. Check lines: 86, 86. /home/stormalf/tests_c/chibicc/parse.c 843 warn V1004 The 'ty->base' pointer was used unsafely after it was verified against nullptr. Check lines: 836, 843. /home/stormalf/tests_c/chibicc/parse.c 1574 warn V773 The return value of function 'write_gvar_data' is required to be utilized. A memory leak is possible. /home/stormalf/tests_c/chibicc/parse.c 2014 warn V1070 Signed value is converted to an unsigned one with subsequent expansion to a larger type in ternary operator. /home/stormalf/tests_c/chibicc/parse.c 2015 warn V1070 Signed value is converted to an unsigned one with subsequent expansion to a larger type in ternary operator. /home/stormalf/tests_c/chibicc/parse.c 2016 warn V1070 Signed value is converted to an unsigned one with subsequent expansion to a larger type in ternary operator. /home/stormalf/tests_c/chibicc/parse.c 2505 err V595 The 'lhs->ty->base' pointer was utilized before it was verified against nullptr. Check lines: 2505, 2513. /home/stormalf/tests_c/chibicc/parse.c 3395 warn V576 Incorrect format. Consider checking the third actual argument of the 'error_tok' function. Under certain conditions the pointer can be null. /home/stormalf/tests_c/chibicc/chibicc.h 159 warn V1071 Consider inspecting the 'skip' function. The return value is not always used. Total calls: 96, discarded results: 1. /home/stormalf/tests_c/chibicc/parse.c 132 warn V1071 Consider inspecting the 'assign' function. The return value is not always used. Total calls: 26, discarded results: 1. /home/stormalf/tests_c/chibicc/preprocess.c 470 warn V547 Expression 'pp' is always false. /home/stormalf/tests_c/chibicc/preprocess.c 894 warn V575 The potential null pointer is passed into 'dirname' function. Inspect the first argument. Check lines: 894, 894. /home/stormalf/tests_c/chibicc/tokenize.c 812 warn V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'input_files' is lost. Consider assigning realloc() to a temporary pointer. /home/stormalf/tests_c/chibicc/type.c 199 warn V1037 Two or more case-branches perform the same actions. Check lines: 199, 238 chibicc-1.0.24/strings.c000077500000000000000000000015331517770275000150370ustar00rootroot00000000000000#include "chibicc.h" void strarray_push(StringArray *arr, char *s) { if (!arr->data) { arr->data = calloc(8, sizeof(char *)); arr->capacity = 8; } if (arr->capacity == arr->len) { char **tmp = realloc(arr->data, sizeof(char *) * arr->capacity * 2); if (tmp == NULL) error("%s:%d: error: in strarray_push reallocation of arr->data failed!", __FILE__, __LINE__); arr->data = tmp; arr->capacity *= 2; } arr->data[arr->len++] = s; } // Takes a printf-style format string and returns a formatted string. char *format(const char *fmt, ...) { char *buf; size_t buflen; FILE *out = open_memstream(&buf, &buflen); if (out == NULL) error("%s:%d: error: in format out is null", __FILE__, __LINE__); va_list ap; va_start(ap, fmt); vfprintf(out, fmt, ap); va_end(ap); fclose(out); return buf; } chibicc-1.0.24/test.sh000077500000000000000000000007611517770275000145170ustar00rootroot00000000000000#!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' TEST_DIR="test" # Ensure directory exists if [[ ! -d "$TEST_DIR" ]]; then echo "Error: directory '$TEST_DIR' not found." >&2 exit 1 fi for exe in "$TEST_DIR"/*.exe; do # Skip when no .exe files exist [[ -e "$exe" ]] || { echo "No .exe files found."; exit 0; } echo "Running: $exe" if ! "$exe"; then echo "Execution failed for $exe" >&2 exit 1 fi done echo "All executables completed successfully." chibicc-1.0.24/test/000077500000000000000000000000001517770275000141545ustar00rootroot00000000000000chibicc-1.0.24/test/agg_eval.c000066400000000000000000000022751517770275000160730ustar00rootroot00000000000000#include "test.h" #include #include struct S2 { int i,j; }; struct S3 { char c; struct S2 arr[2]; }; struct S3 s3 = { .arr = {3, 7, 9, 11} }; struct S2 *s2p = {(struct S2 *)((struct S2 const *)&(((struct S3 const *)&s3))->arr + 1)}; int static_ref_excess_cast(void) { return s2p->j; } int aggregate_eval(void) { { struct S { int arr[2]; }; struct S *src[2] = {&(struct S){5,6}, &(struct S){7,8}}; int *p = *&src[1]->arr; ASSERT(7, *p); } { struct S { int i; int arr[3]; }; struct { struct S *p; } s = {&(struct S){1,2,3,4}}; ASSERT(4, s.p->arr[2]); } { struct S { int arr[2][2]; }; struct S s = {1,2,3,4}; struct { struct S *p; } ps = {&s}; int *p = *&(ps.p->arr)[1]; ASSERT(3, *p); } return 1; } int main(void) { { struct S { struct { char c, c2; } s[13]; }; DASSERT(13 == (intptr_t)&((struct S*)0)->s[6].c2); } { struct S { char a; _Atomic char b; volatile char c; }; SASSERT(1 == offsetof(struct S, b)); SASSERT(2 == offsetof(struct S, c)); } ASSERT(11, static_ref_excess_cast()); ASSERT(1, aggregate_eval()); printf("OK\n"); return 0; } chibicc-1.0.24/test/alias.c000066400000000000000000000001131517770275000154040ustar00rootroot00000000000000void f() {} void g() __attribute__((alias("f"))); int main() { return 0; } chibicc-1.0.24/test/align2.c000066400000000000000000000025131517770275000154750ustar00rootroot00000000000000//#include #include #include "test.h" struct __attribute__((aligned(128))) big128 { char buf[128]; }; struct __attribute__((aligned(1024))) big1024 { char buf[1024]; }; void test_big_align(int named_int, struct big128 s128, struct big1024 s1024, int count, ...) { printf("named int = %d\n", named_int); ASSERT(42, named_int); printf("struct big128 align = %zu size = %zu\n", __alignof__(s128), sizeof(s128)); ASSERT(128, sizeof(s128) ); printf("struct big1024 align = %zu size = %zu\n", __alignof__(s1024), sizeof(s1024)); ASSERT(1024, sizeof(s1024)); va_list ap; va_start(ap, count); for (int i = 0; i < count - 1 ; i++) { double val = va_arg(ap, double); printf("variadic double[%d] = %f\n", i, val); ASSERT(i+1, val); } struct big1024 s1024b = va_arg(ap, struct big1024); printf("struct big1024 align = %zu size = %zu\n", __alignof__(s1024b), sizeof(s1024b)); ASSERT(1024, sizeof(s1024b)); va_end(ap); } int main() { struct big128 s128 = {0}; struct big1024 s1024 = {0}; test_big_align( 42, // named int s128, // struct with align 128 s1024, // struct with align 1024 6, // count // variadic doubles 1.1, 2.2, 3.3, 4.4, 5.5, s1024 ); return 0; } chibicc-1.0.24/test/align7.c000066400000000000000000000010571517770275000155040ustar00rootroot00000000000000#include "test.h" #include _Alignas(32) int x; long double f(long double x) { return x + 1.0L; } long double f2(long double *p) { return p[1]; } typedef __attribute__((aligned(32))) int A; int main() { char __attribute__((aligned(32))) buf[3]; long double x = 3.0L; printf("%Lf\n", f(x)); printf("%p\n", (void *)buf); ASSERT(0, ((uintptr_t)buf % 32) != 0); int __attribute__((aligned(32))) y = 0; ASSERT(1, (int)f(y)); A z; ASSERT(0, (((uintptr_t)&z % 32) != 0)); return 0; } chibicc-1.0.24/test/align7_probe.c000066400000000000000000000010471517770275000166720ustar00rootroot00000000000000#include #include _Alignas(32) int x; long double f(long double x) { return x + 1.0L; } long double f2(long double *p) { return p[1]; } typedef __attribute__((aligned(32))) int A; int main() { char __attribute__((aligned(32))) buf[3]; long double x = 3.0L; int __attribute__((aligned(32))) y = 0; A z; printf("f=%Lf\n", f(x)); printf("alignof(A)=%zu alignof(z)=%zu\n", _Alignof(A), _Alignof(z)); printf("buf%%32=%zu y%%32=%zu z%%32=%zu\n", ((uintptr_t)buf)%32, ((uintptr_t)&y)%32, ((uintptr_t)&z)%32); return 0; } chibicc-1.0.24/test/align_int_probe.c000066400000000000000000000002601517770275000174510ustar00rootroot00000000000000#include "test.h" #include struct P { int a,b; }; int main(){ printf("ai=%zu ap=%zu offb=%zu\n", _Alignof(int), _Alignof(struct P), offsetof(struct P,b)); return 0;} chibicc-1.0.24/test/alignas2.c000066400000000000000000000026501517770275000160230ustar00rootroot00000000000000#include "test.h" struct S { _Alignas(2048) char i[127]; }; static void lvar(int cnt) { if (cnt > 3) return; ASSERT(0, ({ _Alignas(1024) int i; (unsigned long)&i % 1024; })); lvar(cnt + 1); } static void larray(int cnt) { if (cnt > 3) return; ASSERT(0, ({ _Alignas(512) char arr[17]; (unsigned long)&arr[0] % 512; })); larray(cnt + 1); } static void vla(int cnt) { if (cnt > 3) return; ASSERT(0, ({ _Alignas(256) char vla[cnt]; (unsigned long)&vla[0] % 256; })); vla(cnt + 1); } static void lstruct(int cnt) { if (cnt > 3) return; ASSERT(0, ({ struct S s; (unsigned long)&s.i % 2048; })); lstruct(cnt + 1); } static void pass_by_stack_struct(int cnt, struct S s) { if (cnt > 3) return; ASSERT(0, ({ (unsigned long)&s.i % 2048; })); pass_by_stack_struct(cnt + 1, s); } static void mix(int cnt, struct S s) { if (cnt > 3) return; ASSERT(0, ({ (unsigned long)&s.i % 2048; })); _Alignas(1024) int i; ASSERT(0, (unsigned long)&i % 1024 ); _Alignas(256) char arr[17]; ASSERT(0, (unsigned long)&arr[0] % 256 ); _Alignas(512) char vla[cnt]; ASSERT(0, ({ (unsigned long)&vla[0] % 512; })); struct S s2 = s; ASSERT(0, (unsigned long)&s2.i % 2048 ); mix(cnt + 1, s2); } int main(void) { struct S s; ASSERT(0, (unsigned long)&s.i % 2048 ); lvar(1); larray(1); vla(1); lstruct(1); pass_by_stack_struct(1,s); mix(1, s); printf("OK\n"); return 0; }chibicc-1.0.24/test/alignas3.c000066400000000000000000000003751517770275000160260ustar00rootroot00000000000000#include "test.h" int main(int argc, char**argv) { char _Alignas(128) lvar; short _Alignas(32) vla[argc]; printf("%d, %d\n", 127 & (int)&lvar, 31 & (int)&vla); // expect 0,0 ASSERT(0, 127 & (int)&lvar); ASSERT(0, 31 & (int)&vla); return 0; }chibicc-1.0.24/test/alignas4.c000066400000000000000000000004071517770275000160230ustar00rootroot00000000000000#include "test.h" int main(int argc, char**argv) { char _Alignas(1024) lvar; short _Alignas(2048) vla[argc]; printf("%d, %d\n", 1023 & (int)&lvar, 2047 & (int)&vla); // expect 0,0 ASSERT(0, 1023 & (int)&lvar); ASSERT(0, 2047 & (int)&vla); return 0; } chibicc-1.0.24/test/alignas5.c000066400000000000000000000016721517770275000160310ustar00rootroot00000000000000#include #include "test.h" #define A1 __attribute__((aligned(1024))) #define A2 __attribute__((aligned(4096))) int main(void) { A2 int x3, y3 A1; ASSERT(0, ((uintptr_t)&x3 & 4095)); // must be 4096-aligned ASSERT(0, ((uintptr_t)&y3 & 1023)); // must be 1024-aligned int A2 x2, y2 A1; ASSERT(0, ((uintptr_t)&x2 & 4095)); // must be 4096-aligned ASSERT(0, ((uintptr_t)&y2 & 1023)); // must be 1024-aligned //ASSERT(0, ((uintptr_t)&y2 & 4095)); // must NOT require 4096 int A2 x1; int A1 y1; ASSERT(0, ((uintptr_t)&x1 & 4095)); // must be 4096-aligned ASSERT(0, ((uintptr_t)&y1 & 1023)); // must be 1024-aligned //ASSERT(0, ((uintptr_t)&y1 & 4095)); // must NOT require 4096 A2 int x, y A1; ASSERT(0, ((uintptr_t)&x & 4095)); // must be 4096-aligned ASSERT(0, ((uintptr_t)&y & 1023)); // must be 1024-aligned //ASSERT(0, ((uintptr_t)&y2 & 4095)); // must NOT require 4096 return 0; } chibicc-1.0.24/test/alignas6.c000066400000000000000000000022471517770275000160310ustar00rootroot00000000000000#include #include #include "test.h" #define CHECK_ALIGN(ptr, align) \ do { \ uintptr_t addr = (uintptr_t)(ptr); \ if (addr % (align) != 0) { \ printf("Alignment error: %s at %p not aligned to %d\n", #ptr, (void*)addr, align); \ } \ ASSERT(0, addr % (align)); \ } while(0) #define A1 __attribute__((aligned(1024))) #define A2 __attribute__((aligned(4096))) #define A3 __attribute__((aligned(512))) int main(void) { // Attribute before the type _Alignas(64) int a; A1 int b; // Attribute after the type but before the variable int _Alignas(128) c; int A2 d; // Attribute after the variable name int e __attribute__((aligned(256))); int f A3; // Multiple declarators, different alignments A2 int x, y A1, z __attribute__((aligned(512))); // Check alignments CHECK_ALIGN(&a, 64); CHECK_ALIGN(&b, 1024); CHECK_ALIGN(&c, 128); CHECK_ALIGN(&d, 4096); CHECK_ALIGN(&e, 256); CHECK_ALIGN(&f, 512); CHECK_ALIGN(&x, 4096); CHECK_ALIGN(&y, 1024); CHECK_ALIGN(&z, 512); printf("All alignment checks passed!\n"); return 0; } chibicc-1.0.24/test/alignof.c000077500000000000000000000031621517770275000157440ustar00rootroot00000000000000#include "test.h" #include int _Alignas(512) g1; int _Alignas(512) g2; char g3; int g4; long g5; char g6; int main() { ASSERT(1, _Alignof(char)); ASSERT(2, _Alignof(short)); ASSERT(4, _Alignof(int)); ASSERT(8, _Alignof(long)); ASSERT(8, _Alignof(long long)); ASSERT(1, _Alignof(char[3])); ASSERT(4, _Alignof(int[3])); ASSERT(1, _Alignof(struct {char a; char b;}[2])); ASSERT(8, _Alignof(struct {char a; long b;}[2])); ASSERT(0, ({ _Alignas(char) char x, y; (uintptr_t)&x % 1 ; (uintptr_t)&y % 1;})); ASSERT(0, ({ _Alignas(long) char x, y; (uintptr_t)&x % 8 ; (uintptr_t)&y % 8; })); ASSERT(0, ({ _Alignas(32) char x, y; (uintptr_t)&x % 32 ; (uintptr_t)&y % 32; })); ASSERT(0, ({ _Alignas(32) int *x, *y; (uintptr_t)&x % 32 ; (uintptr_t)&y % 32; })); ASSERT(0, ({ struct { _Alignas(16) char x, y; } a; (uintptr_t)&a.x % 16 ; (uintptr_t)&a.y % 16; })); ASSERT(8, ({ struct T { _Alignas(8) char a; }; _Alignof(struct T); })); ASSERT(0, (uintptr_t)&g1 % 512); ASSERT(0, (uintptr_t)&g2 % 512); ASSERT(0, (uintptr_t)&g4 % 4); ASSERT(0, (uintptr_t)&g5 % 8); ASSERT(1, ({ char x; _Alignof(x); })); ASSERT(4, ({ int x; _Alignof(x); })); ASSERT(1, ({ char x; _Alignof x; })); ASSERT(4, ({ int x; _Alignof x; })); ASSERT(1, _Alignof(char) << 31 >> 31); ASSERT(1, _Alignof(char) << 63 >> 63); ASSERT(1, ({ char x; _Alignof(x) << 63 >> 63; })); ASSERT(0, ({ char x[16]; (uintptr_t)&x % 16; })); ASSERT(0, ({ char x[17]; (uintptr_t)&x % 16; })); ASSERT(0, ({ char x[100]; (uintptr_t)&x % 16; })); ASSERT(0, ({ char x[101]; (uintptr_t)&x % 16; })); printf("OK\n"); return 0; } chibicc-1.0.24/test/alignof2.c000066400000000000000000000007501517770275000160230ustar00rootroot00000000000000#include "test.h" int main(int argc, char**argv) { EASSERT(1, _Alignof (char [argc])); char _Alignas(1024) arr1[11]; char _Alignas(1024) arr2[argc]; EASSERT(1024, _Alignof arr1); EASSERT(1, _Alignof arr1[0]); EASSERT(1024, _Alignof arr2); EASSERT(1, _Alignof arr2[0]); struct { char c; _Alignas(1024) int i; } s; EASSERT(1024, _Alignof s); EASSERT(1, _Alignof s.c); EASSERT(1024, _Alignof s.i); EASSERT(1, _Alignof (char){1}); printf("OK\n"); } chibicc-1.0.24/test/alloca.c000077500000000000000000000010671517770275000155620ustar00rootroot00000000000000#include "test.h" void *fn(int x, void *p, int y) { return p; } int main() { int i = 0; char *p1 = alloca(16); char *p2 = alloca(16); char *p3 = 1 + (char *)alloca(3) + 1; p3 -= 2; char *p4 = fn(1, alloca(16), 3); ASSERT(16, p1 - p2); ASSERT(16, p2 - p3); ASSERT(16, p3 - p4); memcpy(p1, "0123456789abcdef", 16); memcpy(p2, "ghijklmnopqrstuv", 16); memcpy(p3, "wxy", 3); ASSERT(0, memcmp(p1, "0123456789abcdef", 16)); ASSERT(0, memcmp(p2, "ghijklmnopqrstuv", 16)); ASSERT(0, memcmp(p3, "wxy", 3)); printf("OK\n"); return 0; } chibicc-1.0.24/test/alloca_builtin.c000066400000000000000000000002101517770275000172720ustar00rootroot00000000000000 void example() { int *p = alloca(10 * sizeof(int)); // Use the allocated memory... } int main() { example(); return 0; }chibicc-1.0.24/test/arith.c000077500000000000000000000075351517770275000154440ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(0, 0); ASSERT(42, 42); ASSERT(21, 5+20-4); ASSERT(41, 12 + 34 - 5 ); ASSERT(47, 5+6*7); ASSERT(15, 5*(9-6)); ASSERT(4, (3+5)/2); ASSERT(10, -10+20); ASSERT(10, - -10); ASSERT(10, - - +10); ASSERT(0, 0==1); ASSERT(1, 42==42); ASSERT(1, 0!=1); ASSERT(0, 42!=42); ASSERT(1, 0<1); ASSERT(0, 1<1); ASSERT(0, 2<1); ASSERT(1, 0<=1); ASSERT(1, 1<=1); ASSERT(0, 2<=1); ASSERT(1, 1>0); ASSERT(0, 1>1); ASSERT(0, 1>2); ASSERT(1, 1>=0); ASSERT(1, 1>=1); ASSERT(0, 1>=2); ASSERT(0, 1073741824 * 100 / 100); ASSERT(7, ({ int i=2; i+=5; i; })); ASSERT(7, ({ int i=2; i+=5; })); ASSERT(3, ({ int i=5; i-=2; i; })); ASSERT(3, ({ int i=5; i-=2; })); ASSERT(6, ({ int i=3; i*=2; i; })); ASSERT(6, ({ int i=3; i*=2; })); ASSERT(3, ({ int i=6; i/=2; i; })); ASSERT(3, ({ int i=6; i/=2; })); ASSERT(3, ({ int i=2; ++i; })); ASSERT(2, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; ++*p; })); ASSERT(0, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; --*p; })); ASSERT(2, ({ int i=2; i++; })); ASSERT(2, ({ int i=2; i--; })); ASSERT(3, ({ int i=2; i++; i; })); ASSERT(1, ({ int i=2; i--; i; })); ASSERT(1, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; *p++; })); ASSERT(1, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; *p--; })); ASSERT(0, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; (*p++)--; a[0]; })); ASSERT(0, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; (*(p--))--; a[1]; })); ASSERT(2, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; (*p)--; a[2]; })); ASSERT(2, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; (*p)--; p++; *p; })); ASSERT(0, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; (*p++)--; a[0]; })); ASSERT(0, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; (*p++)--; a[1]; })); ASSERT(2, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; (*p++)--; a[2]; })); ASSERT(2, ({ int a[3]; a[0]=0; a[1]=1; a[2]=2; int *p=a+1; (*p++)--; *p; })); ASSERT(0, !1); ASSERT(0, !2); ASSERT(1, !0); ASSERT(1, !(char)0); ASSERT(0, !(long)3); ASSERT(4, sizeof(!(char)0)); ASSERT(4, sizeof(!(long)0)); ASSERT(-1, ~0); ASSERT(0, ~-1); ASSERT(5, 17%6); ASSERT(5, ((long)17)%6); ASSERT(2, ({ int i=10; i%=4; i; })); ASSERT(2, ({ long i=10; i%=4; i; })); ASSERT(0, 0&1); ASSERT(1, 3&1); ASSERT(3, 7&3); ASSERT(10, -1&10); ASSERT(1, 0|1); ASSERT(0b10011, 0b10000|0b00011); ASSERT(0, 0^0); ASSERT(0, 0b1111^0b1111); ASSERT(0b110100, 0b111000^0b001100); ASSERT(2, ({ int i=6; i&=3; i; })); ASSERT(7, ({ int i=6; i|=3; i; })); ASSERT(10, ({ int i=15; i^=5; i; })); ASSERT(1, 1<<0); ASSERT(8, 1<<3); ASSERT(10, 5<<1); ASSERT(2, 5>>1); ASSERT(-1, -1>>1); ASSERT(1, ({ int i=1; i<<=0; i; })); ASSERT(8, ({ int i=1; i<<=3; i; })); ASSERT(10, ({ int i=5; i<<=1; i; })); ASSERT(2, ({ int i=5; i>>=1; i; })); ASSERT(-1, -1); ASSERT(-1, ({ int i=-1; i; })); ASSERT(-1, ({ int i=-1; i>>=1; i; })); ASSERT(2, 0?1:2); ASSERT(1, 1?1:2); ASSERT(-1, 0?-2:-1); ASSERT(-2, 1?-2:-1); ASSERT(4, sizeof(0?1:2)); ASSERT(8, sizeof(0?(long)1:(long)2)); ASSERT(-1, 0?(long)-2:-1); ASSERT(-1, 0?-2:(long)-1); ASSERT(-2, 1?(long)-2:-1); ASSERT(-2, 1?-2:(long)-1); 1 ? -2 : (void)-1; ASSERT(20, ({ int x; int *p=&x; p+20-p; })); ASSERT(1, ({ int x; int *p=&x; p+20-p>0; })); ASSERT(-20, ({ int x; int *p=&x; p-20-p; })); ASSERT(1, ({ int x; int *p=&x; p-20-p<0; })); ASSERT(15, (char *)0xffffffffffffffff - (char *)0xfffffffffffffff0); ASSERT(-15, (char *)0xfffffffffffffff0 - (char *)0xffffffffffffffff); ASSERT(1, (void *)0xffffffffffffffff > (void *)0); ASSERT(3, 3?:5); ASSERT(5, 0?:5); ASSERT(4, ({ int i = 3; ++i?:10; })); ASSERT(3, (long double)3); ASSERT(5, (long double)3+2); ASSERT(6, (long double)3*2); ASSERT(5, (long double)3+2.0); printf("OK\n"); return 0; } chibicc-1.0.24/test/array2.c000066400000000000000000000014431517770275000155220ustar00rootroot00000000000000#include void add_arrays(float *a, float *b, float *result, int n) { for (int i = 0; i < n; i++) result[i] = a[i] + b[i]; } #include int *get_array() { static int arr[4] = {1, 2, 3, 4}; // Static allows it to live after function ends return arr; // Returning array decays to pointer to first element } int main() { float a[4] = {1.0, 2.0, 3.0, 4.0}; float b[4] = {10.0, 20.0, 30.0, 40.0}; float result[4]; add_arrays(a, b, result, 4); for (int i = 0; i < 4; i++) printf("result[%d] = %.1f\n", i, result[i]); int *a1 = get_array(); printf("a1[0]=%d\n", a1[0]); printf("a1[1]=%d\n", a1[1]); printf("a1[2]=%d\n", a1[2]); printf("a1[3]=%d\n", a1[3]); return 0; } chibicc-1.0.24/test/array_initializer.c000066400000000000000000000005251517770275000200430ustar00rootroot00000000000000#include "test.h" #define SIZE 10 int main() { int myarr[SIZE] = { 11, 34, 0, 0, 0, 0, 0, 0, 0, 0}; int myarr2[SIZE] = { 11, 34,}; for (int i = 0; i < SIZE; ++i) printf("%d: %d\n", i, myarr[i]); for (int i = 0; i < SIZE; ++i) printf("%d: %d\n", i, myarr2[i]); ASSERT(0, myarr2[9]); return 0; }chibicc-1.0.24/test/array_int.c000066400000000000000000000002571517770275000163140ustar00rootroot00000000000000#include int main() { int data[20] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; for(int i=0;i<16;i++) printf("%d ", data[i]); printf("\n"); } chibicc-1.0.24/test/asm.c000077500000000000000000000006251517770275000151060ustar00rootroot00000000000000#include "test.h" char *asm_fn1(void) { asm("mov $50, %rax\n\t" "mov %rbp, %rsp\n\t" "pop %rbp\n\t" "ret"); } char *asm_fn2(void) { asm inline volatile("mov $55, %rax\n\t" "mov %rbp, %rsp\n\t" "pop %rbp\n\t" "ret"); } int main() { ASSERT(50, asm_fn1()); ASSERT(55, asm_fn2()); printf("OK\n"); return 0; } chibicc-1.0.24/test/asm1.c000066400000000000000000000037151517770275000151670ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #include // #include #include // #include #include "test.h" static jmp_buf segv_handler_env; static void segv_handler(__attribute__((__unused__)) int sig, __attribute__((__unused__)) siginfo_t *info, __attribute__((__unused__)) void *ignored) { siglongjmp(segv_handler_env, 1); } #define HYPERVISOR_INFO_LEAF 0x40000000 #define VMWARE_BDOOR_MAGIC 0x564D5868 #define VMWARE_BDOOR_PORT 0x5658 #define VMWARE_BDOOR_CMD_GETVERSION 10 static inline void cpuid(unsigned int op, unsigned int *teax, unsigned int *tebx, unsigned int *tecx, unsigned int *tedx) { __asm__( "cpuid;" : "=b"(*tebx), "=a"(*teax), "=c"(*tecx), "=d"(*tedx) : "1"(op), "c"(0)); } void vmware_bdoor(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) { __asm__( "inl (%%dx), %%eax;" : "=b"(*ebx), "=a"(*eax), "=c"(*ecx), "=d"(*edx) : "0"(VMWARE_BDOOR_MAGIC), "1"(VMWARE_BDOOR_CMD_GETVERSION), "2"(VMWARE_BDOOR_PORT), "3"(0) : "memory"); } int main(void) { unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0; struct sigaction act, oact; cpuid(HYPERVISOR_INFO_LEAF, &eax, &ebx, &ecx, &edx); printf("%d %d %d %d\n", eax, ebx, ecx, edx); ASSERT(1073741835, eax); ASSERT(1919117645, ebx); ASSERT(1718580079, ecx); ASSERT(1984438388, edx); eax = 0; ebx = 0; ecx = 0; edx = 0; if (getuid() != 0) return 0; if (sigsetjmp(segv_handler_env, 1)) return 0; memset(&act, 0, sizeof(act)); act.sa_sigaction = segv_handler; act.sa_flags = SA_SIGINFO; if (sigaction(SIGSEGV, &act, &oact)) { printf("cannot set signal handler\n"); return -1; } vmware_bdoor(&eax, &ebx, &ecx, &edx); printf("%d %d %d %d\n", eax, ebx, ecx, edx); return 0; }chibicc-1.0.24/test/asm2a.c000066400000000000000000000017551517770275000153330ustar00rootroot00000000000000 #include "test.h" void someasm(void) { /* Add 10 and 20 and store result into register %eax */ int eax=0; int a = 0; __asm__ ( "xor %eax, %eax;" "movl $10, %ebx;" "movl $20, %ebx;" "addl %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( eax )); a = eax; printf("a = %d\n", a); ASSERT(20, a); /* Subtract 20 from 10 and store result into register %eax */ __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "subl %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( eax )); printf("eax = %d\n", eax); ASSERT(-10, eax); /* Multiply 10 and 20 and store result into register %eax */ __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "imull %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( eax )); printf("eax = %d\n", eax); ASSERT(200, eax); } int main() { someasm(); return 0 ; }chibicc-1.0.24/test/asm2b.c000066400000000000000000000017261517770275000153320ustar00rootroot00000000000000#include "test.h" void someasm(void) { /* Add 10 and 20 and store result into register %eax */ int eax=0, ebx = 0; __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "addl %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( eax )); printf("eax = %d\n", eax); ASSERT(30, eax); /* Subtract 20 from 10 and store result into register %eax */ __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "subl %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( eax )); printf("eax = %d\n", eax); ASSERT(-10, eax); /* Multiply 10 and 20 and store result into register %eax */ __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "imull %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( eax )); printf("eax = %d\n", eax); ASSERT(200, eax); } int main() { someasm(); return 0 ; }chibicc-1.0.24/test/asm2c.c000066400000000000000000000016601517770275000153300ustar00rootroot00000000000000#include "test.h" int main() { /* Add 10 and 20 and store result into register %eax */ int teax=0, tebx = 0, tecx = 0; __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "addl %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( teax )); ASSERT(30, teax); printf("eax = %d\n", teax); /* Subtract 20 from 10 and store result into register %eax */ __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "subl %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( teax )); ASSERT(-10, teax); printf("eax = %d\n", teax); /* Multiply 10 and 20 and store result into register %eax */ __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "imull %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( teax )); ASSERT(200, teax); printf("eax = %d\n", teax); return 0 ; }chibicc-1.0.24/test/asm2d.c000066400000000000000000000004361517770275000153310ustar00rootroot00000000000000 #include "test.h" int main() { int src = 1; int dst = 0; __asm__ ("mov %1, %0\n\t" "add $1, %0" : "=r" (dst) : "r" (src)); printf("%d\n", dst); printf("%ld %ld\n", sizeof(src), sizeof(dst)); ASSERT(2, dst); ASSERT(4, sizeof(src)); ASSERT(4, sizeof(dst)); return 0 ; }chibicc-1.0.24/test/asm3.c000066400000000000000000000004041517770275000151610ustar00rootroot00000000000000 #include "test.h" int main() { int src = 1; int dst; asm ("mov %1, %0\n\t" "add $1, %0" : "=r" (dst) : "r" (src)); printf("%d\n", dst); printf("%d\n", src); ASSERT(2, dst); ASSERT(1, src); return 0; }chibicc-1.0.24/test/asm4.c000066400000000000000000000013721517770275000151670ustar00rootroot00000000000000#include #include "test.h" int main() { uint64_t msr; asm volatile ( "rdtsc\n\t" // Returns the time in EDX:EAX. "shl $32, %%rdx\n\t" // Shift the upper bits left. "or %%rdx, %0" // 'Or' in the lower bits. : "=a" (msr) : : "rdx"); printf("msr: %lx\n", msr); ASSERT(1, msr != 0); // Do other work... // Reprint the timestamp asm volatile ( "rdtsc\n\t" // Returns the time in EDX:EAX. "shl $32, %%rdx\n\t" // Shift the upper bits left. "or %%rdx, %0" // 'Or' in the lower bits. : "=a" (msr) : : "rdx"); printf("msr: %lx\n", msr); ASSERT(1, msr != 0); return 0; }chibicc-1.0.24/test/asm5.c000066400000000000000000000013211517770275000151620ustar00rootroot00000000000000#include #include "test.h" void DoCheck(uint32_t dwSomeValue) { uint32_t dwRes; // Assumes dwSomeValue is not zero. asm ("bsfl %1 , %0 ;" : "=r" (dwRes) : "r" (dwSomeValue) : "cc"); printf("%u: %u %u\n", 0, dwSomeValue, dwRes); ASSERT(0, dwRes); ASSERT(5, dwSomeValue); //assert(dwRes > 3); } void do_print(uint32_t dwSomeValue) { uint32_t dwRes; for (uint32_t x=0; x < 5; x++) { // Assumes dwSomeValue is not zero. asm ("bsfl %1 , %0 ;" : "=r" (dwRes) : "r" (dwSomeValue) : "cc"); printf("%u: %u %u\n", x, dwSomeValue, dwRes); } } int main() { uint32_t a = 5; DoCheck(a); do_print(a); return 0; }chibicc-1.0.24/test/asm6.c000066400000000000000000000020651517770275000151710ustar00rootroot00000000000000#include "test.h" void someasm(void) { /* Add 10 and 20 and store result into register %eax */ int eax=0, ebx = 0; __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "addl %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( eax )); ASSERT(30, eax); printf("eax = %d\n", eax); printf("eax = %d\n", eax); /* Subtract 20 from 10 and store result into register %eax */ __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "subl %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( eax )); printf("eax = %d\n", eax); printf("eax = %d\n", eax); ASSERT(-10, eax); /* Multiply 10 and 20 and store result into register %eax */ __asm__ ( "movl $10, %eax;" "movl $20, %ebx;" "imull %ebx, %eax;" ); __asm__ ("movl %%eax, %0;" : "=r" ( eax )); printf("eax = %d\n", eax); printf("eax = %d\n", eax); ASSERT(200, eax); } int main() { someasm(); return 0 ; }chibicc-1.0.24/test/asm7.c000066400000000000000000000004041517770275000151650ustar00rootroot00000000000000#include "test.h" int add(int a, int b) { asm ("add %1, %0\n\t" : "+r" (a) : "r" (b) : "cc" ); return a; } int main(void) { int result = add(10, 21); printf("%d\n", result); ASSERT(31, result); return 0; } chibicc-1.0.24/test/asm8.c000066400000000000000000000011621517770275000151700ustar00rootroot00000000000000 #include "test.h" void add_and_subtract(int a, int b, int *sum, int *diff) { asm ( "add %3, %2\n\t" "mov %2, %0\n\t" "sub %3, %2\n\t" "mov %2, %1\n\t" "" : "=r" (*sum), "=r" (*diff) // Output operands : "r" (a), "r" (b) // Input operands : "cc" // Clobbered registers ); } int main(void) { int a = 10, b = 5; int sum = 0, diff = 0; add_and_subtract(a, b, &sum, &diff); printf("Sum: %d\n", sum); printf("Difference: %d\n", diff); ASSERT(15, sum); ASSERT(10, diff); return 0; } chibicc-1.0.24/test/asm9.c000066400000000000000000000034571517770275000152020ustar00rootroot00000000000000#include #include #include #include "test.h" void ff_put_pixels8_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h) { __asm__ volatile( "movq (%1), %%mm0 \n\t" "movq %%mm0, (%0) \n\t" : // No output operands : "r"(block), "r"(pixels) // Input operands : "memory" // Clobbered registers ); } int atomic_add(int *ptr, int val) { int result; __asm__ volatile("lock; xaddl %0, %1" : "=r"(result), "+m"(*ptr) : "0"(val) : "memory"); return result; } static inline long syscall(long n, long a1, long a2, long a3, long a4, long a5, long a6) { long ret; __asm__ volatile ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2), "d"(a3), "r"(a4), "r"(a5), "r"(a6) : "rcx", "r11", "memory"); return ret; } void *memcpy(void *dest, const void *src, size_t n) { __asm__ volatile( "rep movsb" : "+D"(dest), "+S"(src), "+c"(n) : : "memory"); return dest; } int main(int argc, char **argv) { uint8_t block[8] = {1, 2, 3, 4, 5, 6, 7, 8}; uint8_t pixels[8] = {1 , 2 , 3 , 4 , 5 , 6 , 7 , 8}; ff_put_pixels8_mmx(block, pixels, 8, 1); printf("%d\n", block[0]); printf("%d\n", block[7]); printf("%d\n", pixels[0]); printf("%d\n", pixels[7]); ASSERT(1, block[0]); ASSERT(8, block[7]); ASSERT(1, pixels[0]); ASSERT(8, pixels[7]); int i = 8; int j = 0; int *ptr = &i; j = atomic_add(ptr, 1); printf("i=%d, j=%d\n", i, j); ASSERT(9, i); ASSERT(8, j); // long tid = syscall(SYS_gettid, 0, 0, 0, 0, 0, 0); // printf("Thread ID: %ld\n", tid); return 0; }chibicc-1.0.24/test/asm_mul_test.c000066400000000000000000000013501517770275000170130ustar00rootroot00000000000000// asm_array_min_test.c #include "test.h" #include typedef unsigned long BN_ULONG; static BN_ULONG mul_high(BN_ULONG *ap, BN_ULONG w) { BN_ULONG high, low, carry = 0; asm("mulq %3" : "=a"(low), "=d"(high) : "a"(w), "m"(ap[0]) : "cc"); asm("addq %2,%0; adcq %3,%1" : "+r"(carry), "+d"(high) : "a"(low), "g"(0) : "cc"); asm("addq %2,%0; adcq %3,%1" : "+m"(ap[0]), "+d"(high) : "r"(carry), "g"(0) : "cc"); return high; } int main(void) { BN_ULONG a[1]; a[0] = 0xFFFFFFFFFFFFFFFFUL; BN_ULONG r = mul_high(a, 2); printf("%ld\n", r); ASSERT(2, r); printf("OK\n"); return 0; } chibicc-1.0.24/test/asm_name.c000066400000000000000000000006311517770275000161000ustar00rootroot00000000000000#include "test.h" int neg(int i) { return -i; } typeof(int(int)) g_proto __asm("neg") __attribute__((visibility("default"))); typeof(int(int)) *g_fp = &g_proto; extern typeof(int(int)) *ext_fp __asm("g_fp"); int main(void) { extern typeof(int(int)) l_proto __asm("neg"); ASSERT(-11, g_proto(11)); ASSERT(-22, l_proto(22)); ASSERT(-33, g_fp(33)); ASSERT(-44, ext_fp(44)); printf("OK\n"); }chibicc-1.0.24/test/asm_nop.c000066400000000000000000000014311517770275000157530ustar00rootroot00000000000000#include "test.h" #define ASM_NOP_REPLACE(...) __asm__ volatile(__VA_ARGS__) int main() { int a = 1, b = 2; // Empty template (""), simple volatile ASM_NOP_REPLACE(""); // Volatile with memory clobber ASM_NOP_REPLACE("" ::: "memory"); // Rep; nop template ASM_NOP_REPLACE("rep; nop" ::: "memory"); // Single operand, read/write ASM_NOP_REPLACE("" : "+r"(a)); // Two operands, read/write ASM_NOP_REPLACE("" : "+r"(a), "+r"(b)); // Inputs only ASM_NOP_REPLACE("" : : "r"(a), "r"(b)); // Inputs and outputs ASM_NOP_REPLACE("" : "+r"(a) : "r"(b)); // Full three-part extended asm with clobbers ASM_NOP_REPLACE("" : "+r"(a) : "r"(b) : "memory"); printf("Test completed without parsing errors.\n"); return 0; } chibicc-1.0.24/test/asm_test.c000066400000000000000000000116711517770275000161450ustar00rootroot00000000000000#include "test.h" #include #include typedef unsigned long BN_ULONG; #undef mul #undef mul_add /*- * "m"(a), "+m"(r) is the way to favor DirectPath µ-code; * "g"(0) let the compiler to decide where does it * want to keep the value of zero; */ #define mul_add(r, a, word, carry) \ do { \ register BN_ULONG high, low; \ asm("mulq %3" \ : "=a"(low), "=d"(high) \ : "a"(word), "m"(a) \ : "cc"); \ asm("addq %2,%0; adcq %3,%1" \ : "+r"(carry), "+d"(high) \ : "a"(low), "g"(0) \ : "cc"); \ asm("addq %2,%0; adcq %3,%1" \ : "+m"(r), "+d"(high) \ : "r"(carry), "g"(0) \ : "cc"); \ carry = high; \ } while (0) #define mul(r, a, word, carry) \ do { \ register BN_ULONG high, low; \ asm("mulq %3" \ : "=a"(low), "=d"(high) \ : "a"(word), "g"(a) \ : "cc"); \ asm("addq %2,%0; adcq %3,%1" \ : "+r"(carry), "+d"(high) \ : "a"(low), "g"(0) \ : "cc"); \ (r) = carry, carry = high; \ } while (0) #undef sqr #define sqr(r0, r1, a) \ asm("mulq %2" \ : "=a"(r0), "=d"(r1) \ : "a"(a) \ : "cc"); /* ----------------------------- * Reference multiplication * ----------------------------- */ void ref_mul(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) { memset(r, 0, sizeof(BN_ULONG) * (na + nb)); for (int i = 0; i < na; i++) { BN_ULONG carry = 0; for (int j = 0; j < nb; j++) { unsigned long long prod = (unsigned long long)a[i] * b[j] + r[i + j] + carry; r[i + j] = (BN_ULONG)prod; carry = prod >> 32; } r[i + nb] += carry; } } /* ----------------------------- * Fallback word operations * ----------------------------- */ BN_ULONG bn_mul_words(BN_ULONG *r, BN_ULONG *a, int n, BN_ULONG w) { BN_ULONG carry = 0; for (int i = 0; i < n; i++) { unsigned long long prod = (unsigned long long)a[i] * w + carry; r[i] = (BN_ULONG)prod; carry = prod >> 32; } return carry; } BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w) { BN_ULONG c1 = 0; if (num <= 0) return c1; while (num & ~3) { mul_add(rp[0], ap[0], w, c1); mul_add(rp[1], ap[1], w, c1); mul_add(rp[2], ap[2], w, c1); mul_add(rp[3], ap[3], w, c1); ap += 4; rp += 4; num -= 4; } if (num) { mul_add(rp[0], ap[0], w, c1); if (--num == 0) return c1; mul_add(rp[1], ap[1], w, c1); if (--num == 0) return c1; mul_add(rp[2], ap[2], w, c1); return c1; } return c1; } /* ----------------------------- * YOUR FUNCTION (unchanged) * ----------------------------- */ void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) { BN_ULONG *rr; if (na < nb) { int itmp; BN_ULONG *ltmp; itmp = na; na = nb; nb = itmp; ltmp = a; a = b; b = ltmp; } rr = &(r[na]); if (nb <= 0) { (void)bn_mul_words(r, a, na, 0); return; } else { rr[0] = bn_mul_words(r, a, na, b[0]); } for (;;) { if (--nb <= 0) return; rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]); if (--nb <= 0) return; rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]); if (--nb <= 0) return; rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]); if (--nb <= 0) return; rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]); rr += 4; r += 4; b += 4; } } /* ----------------------------- * Test * ----------------------------- */ #define MAX 32 int main() { BN_ULONG a[MAX], b[MAX], r1[MAX*2], r2[MAX*2]; for (int i = 0; i < MAX; i++) { a[i] = i + 1; b[i] = (i % 7) + 1; } memset(r1, 0, sizeof(r1)); memset(r2, 0, sizeof(r2)); bn_mul_normal(r1, a, 16, b, 16); ref_mul(r2, a, 16, b, 16); // for (int i = 0; i < 32; i++) { // if (r1[i] != r2[i]) { // printf("FAIL at %d: %lu != %lu\n", // i, r1[i], r2[i]); // return 1; // } // } printf("%ld\n", r1[0]); ASSERT(1, r1[0]); printf("%ld\n", r1[1]); ASSERT(4, r1[1]); printf("%ld\n", r2[0]); ASSERT(1, r2[0]); printf("%ld\n", r2[1]); ASSERT(4, r2[1]); printf("OK\n"); return 0; }chibicc-1.0.24/test/assert1.c000066400000000000000000000001071517770275000157000ustar00rootroot00000000000000 #include int main() { static_assert( 3 < 4, "hello"); }chibicc-1.0.24/test/assign_test.c000066400000000000000000000012141517770275000166410ustar00rootroot00000000000000// issues/assign_rhs_first_gain.c #include #include static uintptr_t top_fp; static uintptr_t deep_fp; __attribute__((noinline)) static uintptr_t fp(void) { return (uintptr_t)__builtin_frame_address(0); } __attribute__((noinline)) static int rec(int n) { volatile int x = 0; // forces an addressable LHS if (n == 0) { deep_fp = fp(); return 1; } x = rec(n - 1); // this is the key ND_ASSIGN shape return x + 1; } int main(void) { top_fp = fp(); rec(300); uintptr_t delta = top_fp > deep_fp ? top_fp - deep_fp : deep_fp - top_fp; printf("fp_delta=%lu\n", (unsigned long)delta); return 0; } chibicc-1.0.24/test/assoc.h000066400000000000000000000010641517770275000154360ustar00rootroot00000000000000/* associative array */ void assoc_init(const int hashpower_init); item *assoc_find(const char *key, const size_t nkey, const uint32_t hv); int assoc_insert(item *item, const uint32_t hv); void assoc_delete(const char *key, const size_t nkey, const uint32_t hv); int start_assoc_maintenance_thread(void); void stop_assoc_maintenance_thread(void); void assoc_start_expand(uint64_t curr_items); /* walk functions */ void *assoc_get_iterator(void); bool assoc_iterate(void *iterp, item **it); void assoc_iterate_final(void *iterp); extern unsigned int hashpower; chibicc-1.0.24/test/atomic.c000077500000000000000000000031741517770275000156040ustar00rootroot00000000000000#include "test.h" #include #include static int incr(_Atomic int *p) { int oldval = *p; int newval; do { newval = oldval + 1; } while (!atomic_compare_exchange_weak(p, &oldval, newval)); return newval; } static int add1(void *arg) { _Atomic int *x = arg; for (int i = 0; i < 1000*1000; i++) incr(x); return 0; } static int add2(void *arg) { _Atomic int *x = arg; for (int i = 0; i < 1000*1000; i++) (*x)++; return 0; } static int add3(void *arg) { _Atomic int *x = arg; for (int i = 0; i < 1000*1000; i++) *x += 5; return 0; } static int add_millions(void) { _Atomic int x = 0; pthread_t thr1; pthread_t thr2; pthread_t thr3; pthread_create(&thr1, NULL, add1, &x); pthread_create(&thr2, NULL, add2, &x); pthread_create(&thr3, NULL, add3, &x); for (int i = 0; i < 1000*1000; i++) x--; pthread_join(thr1, NULL); pthread_join(thr2, NULL); pthread_join(thr3, NULL); return x; } static void fetch_ops(void) { _Atomic int x = 0; ASSERT(0, atomic_fetch_add(&x, 17)); ASSERT(17, atomic_fetch_add(&x, 10)); ASSERT(27, atomic_fetch_add(&x, 3)); ASSERT(30, atomic_fetch_sub(&x, 17)); ASSERT(13, atomic_fetch_sub(&x, 13)); ASSERT(0, atomic_fetch_or(&x, 0xf0)); ASSERT(0xf0, atomic_fetch_or(&x, 0x0f)); ASSERT(0xff, atomic_fetch_and(&x, 0x0f)); ASSERT(0x0f, atomic_fetch_xor(&x, 0xff)); ASSERT(0xf0, atomic_fetch_add(&x, 0)); } int main() { ASSERT(6*1000*1000, add_millions()); ASSERT(3, ({ int x=3; atomic_exchange(&x, 5); })); ASSERT(5, ({ int x=3; atomic_exchange(&x, 5); x; })); fetch_ops(); printf("OK\n"); return 0; } chibicc-1.0.24/test/atomic128.c000066400000000000000000000107701517770275000160340ustar00rootroot00000000000000#include "test.h" int main() { unsigned __int128 a = 0; unsigned __int128 b = (((unsigned __int128)1) << 80) | 123; unsigned __int128 c; // Test __atomic_store_n and __atomic_load_n __atomic_store_n(&a, b, 5); c = __atomic_load_n(&a, 5); ASSERT(1, c == b); // Test __atomic_compare_exchange_n (Success) unsigned __int128 expected = b; unsigned __int128 desired = (((unsigned __int128)1) << 90) | 456; // weak=0, success_memorder=5, failure_memorder=5 _Bool ret = __atomic_compare_exchange_n(&a, &expected, desired, 0, 5, 5); ASSERT(1, ret); ASSERT(1, a == desired); // Test __atomic_compare_exchange_n (Failure) expected = 0; // Incorrect expected value ret = __atomic_compare_exchange_n(&a, &expected, b, 0, 5, 5); ASSERT(0, ret); ASSERT(1, expected == desired); // expected should be updated to current value of a ASSERT(1, a == desired); // a should remain unchanged // Test __atomic_exchange_n unsigned __int128 old = __atomic_exchange_n(&a, b, 5); ASSERT(1, old == desired); ASSERT(1, a == b); // Test _Atomic unsigned __int128 (uses atomic_op -> ND_CAS) _Atomic unsigned __int128 u128 = 10; u128 += 20; ASSERT(1, u128 == 30); // Test _Atomic long double (16 bytes, uses atomic_op -> ND_CAS) _Atomic long double ld = 1.0L; ld += 2.0L; ASSERT(1, ld == 3.0L); // Test arithmetic builtins for int128 unsigned __int128 val = 100; unsigned __int128 res; res = __atomic_fetch_add(&val, 50, 0); ASSERT(1, res == 100); ASSERT(1, val == 150); res = __atomic_add_fetch(&val, 50, 0); ASSERT(1, res == 200); ASSERT(1, val == 200); res = __atomic_fetch_sub(&val, 50, 0); ASSERT(1, res == 200); ASSERT(1, val == 150); res = __atomic_sub_fetch(&val, 50, 0); ASSERT(1, res == 100); ASSERT(1, val == 100); res = __atomic_fetch_or(&val, 1, 0); ASSERT(1, res == 100); ASSERT(1, val == 101); res = __atomic_or_fetch(&val, 1, 0); ASSERT(1, res == 101); ASSERT(1, val == 101); res = __atomic_fetch_and(&val, 100, 0); ASSERT(1, res == 101); ASSERT(1, val == 100); res = __atomic_and_fetch(&val, 100, 0); ASSERT(1, res == 100); ASSERT(1, val == 100); res = __atomic_fetch_xor(&val, 100, 0); ASSERT(1, res == 100); ASSERT(1, val == 0); res = __atomic_xor_fetch(&val, 100, 0); ASSERT(1, res == 100); ASSERT(1, val == 100); // Test NAND val = 0xF0F0F0F0F0F0F0F0; val = (val << 64) | 0xF0F0F0F0F0F0F0F0; unsigned __int128 mask = 0xFFFFFFFFFFFFFFFF; mask = (mask << 64) | 0xFFFFFFFFFFFFFFFF; // ~(val & mask) = ~(val) res = __atomic_fetch_nand(&val, mask, 0); // res should be old val // val should be ~old_val ASSERT(1, res == (((unsigned __int128)0xF0F0F0F0F0F0F0F0 << 64) | 0xF0F0F0F0F0F0F0F0)); ASSERT(1, val == ~res); res = __atomic_nand_fetch(&val, mask, 0); // val was ~old_val. new val = ~(val & mask) = ~(~old_val) = old_val ASSERT(1, res == (((unsigned __int128)0xF0F0F0F0F0F0F0F0 << 64) | 0xF0F0F0F0F0F0F0F0)); ASSERT(1, val == res); // Test __sync builtins val = 10; res = __sync_fetch_and_add(&val, 20); ASSERT(1, res == 10); ASSERT(1, val == 30); res = __sync_add_and_fetch(&val, 20); ASSERT(1, res == 50); ASSERT(1, val == 50); res = __sync_fetch_and_sub(&val, 20); ASSERT(1, res == 50); ASSERT(1, val == 30); res = __sync_sub_and_fetch(&val, 20); ASSERT(1, res == 10); ASSERT(1, val == 10); res = __sync_val_compare_and_swap(&val, 10, 100); ASSERT(1, res == 10); ASSERT(1, val == 100); res = __sync_val_compare_and_swap(&val, 10, 200); // Fail ASSERT(1, res == 100); ASSERT(1, val == 100); _Bool bool_res = __sync_bool_compare_and_swap(&val, 100, 200); ASSERT(1, bool_res); ASSERT(1, val == 200); bool_res = __sync_bool_compare_and_swap(&val, 100, 300); // Fail ASSERT(0, bool_res); ASSERT(1, val == 200); // Test __atomic_load and __atomic_store (generic) unsigned __int128 store_val = 555; unsigned __int128 load_val; __atomic_store(&val, &store_val, 5); ASSERT(1, val == 555); __atomic_load(&val, &load_val, 5); ASSERT(1, load_val == 555); // Test __sync_lock_test_and_set and release val = 0; res = __sync_lock_test_and_set(&val, 1); ASSERT(1, res == 0); ASSERT(1, val == 1); __sync_lock_release(&val); ASSERT(1, val == 0); // Test __atomic_test_and_set and __atomic_clear unsigned char flag = 0; ASSERT(0, __atomic_test_and_set(&flag, 5)); ASSERT(1, flag); ASSERT(1, __atomic_test_and_set(&flag, 5)); __atomic_clear(&flag, 5); ASSERT(0, flag); printf("OK\n"); return 0; }chibicc-1.0.24/test/atomic2.c000066400000000000000000000105271517770275000156630ustar00rootroot00000000000000 #include #include "test.h" int main() { int value = 5; int expected = 5; int new_value = 10; if (atomic_compare_exchange_weak(&value, &expected, new_value)) { printf("Value was exchanged.\n"); } else { printf("Value was not exchanged. Expected: %d, Value: %d\n", expected, value); } printf("Final Value: %d\n", value); ASSERT(10, value); if (atomic_compare_exchange_strong(&value, &expected, new_value)) { printf("Value was exchanged.\n"); } else { printf("Value was not exchanged. Expected: %d, Value: %d\n", expected, value); } printf("Final Value: %d\n", value); ASSERT(10, value); value = 5; int old_value = atomic_fetch_add(&value, 3); printf("Old Value: %d, New Value: %d\n", old_value, value); ASSERT(5, old_value); ASSERT(8, value); value = 5; old_value = atomic_fetch_sub(&value, 3); printf("Old Value: %d, New Value: %d\n", old_value, value); ASSERT(5, old_value); ASSERT(2, value); value = 5; // 0101 in binary old_value = atomic_fetch_or(&value, 2); // 0010 in binary printf("Old Value: %d, New Value: %d\n", old_value, value); ASSERT(5, old_value); ASSERT(7, value); value = 5; // 0101 in binary old_value = atomic_fetch_xor(&value, 3); // 0011 in binary printf("Old Value: %d, New Value: %d\n", old_value, value); ASSERT(5, old_value); ASSERT(6, value); value = 5; // 0101 in binary old_value = atomic_fetch_and(&value, 3); // 0011 in binary printf("Old Value: %d, New Value: %d\n", old_value, value); ASSERT(5, old_value); ASSERT(1, value); value = 5; old_value = atomic_exchange(&value, 10); printf("Old Value: %d, New Value: %d\n", old_value, value); ASSERT(5, old_value); ASSERT(10, value); value = 5; old_value = atomic_exchange_explicit(&value, 10, memory_order_seq_cst); printf("Old Value: %d, New Value: %d\n", old_value, value); ASSERT(5, old_value); ASSERT(10, value); value = 5; int loaded_value = atomic_load(&value); printf("Loaded Value: %d\n", loaded_value); ASSERT(5, value); ASSERT(5, loaded_value); value = 5; loaded_value = atomic_load_explicit(&value, memory_order_acquire); printf("Loaded Value: %d\n", loaded_value); ASSERT(5, value); ASSERT(5, loaded_value); atomic_store(&value, 11); printf("Stored Value: %d\n", value); ASSERT(11, value); atomic_store_explicit(&value, 12, memory_order_release); printf("Stored Value: %d\n", value); ASSERT(12, value); atomic_flag flag = ATOMIC_FLAG_INIT; if (!atomic_flag_test_and_set(&flag)) { printf("Flag was clear and is now set.\n"); } else { printf("Flag was already set.\n"); } atomic_flag flag2 = ATOMIC_FLAG_INIT; if (!atomic_flag_test_and_set_explicit(&flag2, memory_order_acquire)) { printf("Flag2 was clear and is now set.\n"); } else { printf("Flag2 was already set.\n"); } atomic_flag flag3 = ATOMIC_FLAG_INIT; atomic_flag_test_and_set(&flag3); atomic_flag_clear(&flag3); printf("Flag3 is now clear.\n"); atomic_flag flag4 = ATOMIC_FLAG_INIT; atomic_flag_test_and_set(&flag4); atomic_flag_clear_explicit(&flag4, memory_order_release); printf("Flag4 is now clear.\n"); value = 5; old_value = __sync_val_compare_and_swap(&value, 5, 10); printf("Old Value: %d, New Value: %d\n", old_value, value); ASSERT(5, old_value); ASSERT(10, value); value = 5; old_value = __sync_fetch_and_add(&value, 3); printf("Old Value: %d, New Value: %d\n", old_value, value); ASSERT(5, old_value); ASSERT(8, value); value = 5; old_value = __sync_fetch_and_sub(&value, 3); printf("Old Value: %d, New Value: %d\n", old_value, value); ASSERT(5, old_value); ASSERT(2, value); value = 5; old_value = __sync_val_compare_and_swap(&value, 5, 10); printf("Old value: %d, New value: %d\n", old_value, value); // Expected: Old value: 5, New value: 10 ASSERT(5, old_value); ASSERT(10, value); value = 5; old_value = __sync_val_compare_and_swap(&value, 5, 20); printf("Old value: %d, New value: %d\n", old_value, value); // Expected: Old value: 5, New value: 20 ASSERT(5, old_value); ASSERT(20, value); return 0; } chibicc-1.0.24/test/atomic3.c000066400000000000000000000016441517770275000156640ustar00rootroot00000000000000#include "test.h" #include #include int main(void) { int x = 0; int y = 42; // Atomic store using __atomic_store_n __atomic_store_n(&x, y, __ATOMIC_SEQ_CST); // Atomic load using __atomic_load_n int z = __atomic_load_n(&x, __ATOMIC_SEQ_CST); printf("x = %d, y = %d, z = %d\n", x, y, z); ASSERT(42, x); ASSERT(42, y); ASSERT(42, z); // Modify x using store_n again __atomic_store_n(&x, 99, __ATOMIC_SEQ_CST); int w = __atomic_load_n(&x, __ATOMIC_SEQ_CST); printf("x = %d, w = %d\n", x, w); ASSERT(99, x); ASSERT(99, w); // Test with uint8_t uint8_t a = 5, b = 200; __atomic_store_n(&a, b, __ATOMIC_SEQ_CST); uint8_t c = __atomic_load_n(&a, __ATOMIC_SEQ_CST); printf("a = %u, b = %u, c = %u\n", a, b, c); ASSERT(200, a); ASSERT(200, b); ASSERT(200, c); return 0; } chibicc-1.0.24/test/atomic4.c000066400000000000000000000033411517770275000156610ustar00rootroot00000000000000#include #include // Test for __atomic_compare_exchange_n void test_compare_exchange_n() { int x = 42; int expected = 42; int desired = 100; // Should succeed, since *x == expected bool success = __atomic_compare_exchange_n(&x, &expected, desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); printf("=== __atomic_compare_exchange_n ===\n"); printf("success=%d, x=%d, expected=%d\n", success, x, expected); // Reset for failure case x = 200; expected = 42; desired = 300; success = __atomic_compare_exchange_n(&x, &expected, desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); printf("failure case: success=%d, x=%d, expected=%d\n", success, x, expected); } // Test for __atomic_compare_exchange void test_compare_exchange() { int x = 42; int expected = 42; int desired = 100; // Same semantics but explicit expected as a pointer bool success = __atomic_compare_exchange(&x, &expected, &desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); printf("=== __atomic_compare_exchange ===\n"); printf("success=%d, x=%d, expected=%d\n", success, x, expected); // Reset for failure case x = 200; expected = 42; desired = 300; success = __atomic_compare_exchange(&x, &expected, &desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); printf("failure case: success=%d, x=%d, expected=%d\n", success, x, expected); } int main() { test_compare_exchange_n(); test_compare_exchange(); return 0; } chibicc-1.0.24/test/atomic5.c000066400000000000000000000011611517770275000156600ustar00rootroot00000000000000#include "test.h" int main() { int x = 0, y; __atomic_load_n(&x, 0); ASSERT(0, x); __atomic_store_n(&x, 0, 0); ASSERT(0, x); __atomic_exchange_n(&x, 1, 0); ASSERT(1, x); __atomic_compare_exchange_n(&x, &y, 1, 0, 0, 0); ASSERT(1, x); __atomic_fetch_add(&x, 1, 0); ASSERT(2, x); __atomic_fetch_sub(&x, 1, 0); ASSERT(1, x); __atomic_fetch_or(&x, 1, 0); ASSERT(1, x); __atomic_fetch_and(&x, 1, 0); ASSERT(1, x); __atomic_fetch_xor(&x, 1, 0); ASSERT(0, x); __sync_add_and_fetch(&x, 1); ASSERT(1, x); printf("atomic5 OK\n"); return 0; } chibicc-1.0.24/test/atomic_builtins.c000066400000000000000000000053551517770275000175150ustar00rootroot00000000000000#include "test.h" int main(void) { int x = 10; int y = 20; int z = 30; printf("=== __atomic_fetch_* tests ===\n"); int a1 = __atomic_fetch_add(&x, 5, __ATOMIC_SEQ_CST); printf("__atomic_fetch_add: old=%d new=%d\n", a1, x); ASSERT(15, x); ASSERT(10, a1); int a2 = __atomic_fetch_sub(&x, 3, __ATOMIC_SEQ_CST); printf("__atomic_fetch_sub: old=%d new=%d\n", a2, x); ASSERT(12, x); ASSERT(15, a2); int a3 = __atomic_fetch_or(&x, 0x10, __ATOMIC_SEQ_CST); printf("__atomic_fetch_or: old=%d new=%d\n", a3, x); ASSERT(28, x); ASSERT(12, a3); int a4 = __atomic_fetch_and(&x, 0x0F, __ATOMIC_SEQ_CST); printf("__atomic_fetch_and: old=%d new=%d\n", a4, x); ASSERT(12, x); ASSERT(28, a4); int a5 = __atomic_fetch_xor(&x, 0xFF, __ATOMIC_SEQ_CST); printf("__atomic_fetch_xor: old=%d new=%d\n", a5, x); ASSERT(243, x); ASSERT(12, a5); int a6 = __atomic_fetch_nand(&x, 0xF0, __ATOMIC_SEQ_CST); printf("__atomic_fetch_nand: old=%d new=%d\n", a6, x); ASSERT(-241, x); ASSERT(243, a6); printf("\n=== __sync_* tests ===\n"); int s1 = __sync_fetch_and_add(&y, 5); printf("__sync_fetch_and_add: old=%d new=%d\n", s1, y); ASSERT(25, y); ASSERT(20, s1); int s2 = __sync_add_and_fetch(&y, 5); printf("__sync_add_and_fetch: new=%d\n", s2); ASSERT(30, y); ASSERT(30, s2); int s3 = __sync_fetch_and_sub(&y, 2); printf("__sync_fetch_and_sub: old=%d new=%d\n", s3, y); ASSERT(28, y); ASSERT(30, s3); int s4 = __sync_sub_and_fetch(&y, 3); printf("__sync_sub_and_fetch: new=%d\n", s4); ASSERT(25, y); ASSERT(25, s4); int s5 = __sync_fetch_and_or(&y, 0x10); printf("__sync_fetch_and_or: old=%d new=%d\n", s5, y); ASSERT(25, y); ASSERT(25, s5); int s6 = __sync_fetch_and_and(&y, 0x0F); printf("__sync_fetch_and_and: old=%d new=%d\n", s6, y); ASSERT(9, y); ASSERT(25, s6); int s7 = __sync_fetch_and_xor(&y, 0xFF); printf("__sync_fetch_and_xor: old=%d new=%d\n", s7, y); ASSERT(246, y); ASSERT(9, s7); int s8 = __sync_fetch_and_nand(&y, 0xF0); printf("__sync_fetch_and_nand: old=%d new=%d\n", s8, y); ASSERT(-241, y); ASSERT(246, s8); int c1 = __sync_bool_compare_and_swap(&z, 30, 99); printf("__sync_bool_compare_and_swap: result=%d new=%d\n", c1, z); ASSERT(99, z); ASSERT(1, c1); int c2 = __sync_val_compare_and_swap(&z, 99, 123); printf("__sync_val_compare_and_swap: old=%d new=%d\n", c2, z); ASSERT(123, z); ASSERT(99, c2); __sync_lock_test_and_set(&z, 777); printf("__sync_lock_test_and_set: new=%d\n", z); ASSERT(777, z); __sync_lock_release(&z); printf("__sync_lock_release: new=%d\n", z); ASSERT(0, z); return 0; } chibicc-1.0.24/test/atomic_clear_flag.c000066400000000000000000000006311517770275000177330ustar00rootroot00000000000000#include "test.h" typedef struct pg_atomic_flag { volatile char value; } pg_atomic_flag; static inline void pg_atomic_clear_flag_impl(volatile pg_atomic_flag *ptr) { __asm__ __volatile__("" ::: "memory"); ptr->value = 0; } int main() { pg_atomic_flag flag = {1}; pg_atomic_clear_flag_impl(&flag); printf("Flag cleared: %d\n", flag.value); ASSERT(0, flag.value); return 0; } chibicc-1.0.24/test/atomic_cmpxchgn.c000066400000000000000000000024051517770275000174640ustar00rootroot00000000000000#include #include #include "test.h" int main() { uint32_t target = 0x12345678; uint32_t expected = 0x12345678; uint32_t desired = 0xDEADBEEF; // This should update target to 0xDEADBEEF. // If chibicc generates a byte operation (due to the bug where it uses the bool return type size), // it might generate `lock cmpxchgb %cl, (%rdi)`. // If target is 32-bit, we expect `lock cmpxchgl %ecx, (%rdi)`. bool ret = __atomic_compare_exchange_n(&target, &expected, desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); if (!ret) printf("FAIL: ret is false\n"); if (target != 0xDEADBEEF) printf("FAIL: target is 0x%x (expected 0xDEADBEEF)\n", target); if (expected != 0x12345678) printf("FAIL: expected is 0x%x\n", expected); // Test failure case: expected value does not match expected = 0xCAFEBABE; ret = __atomic_compare_exchange_n(&target, &expected, 0x0, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); if (ret) printf("FAIL: ret is true (should be false)\n"); // Should update expected to current target value if (expected != target) printf("FAIL: expected is 0x%x (should be 0x%x)\n", expected, target); ASSERT(target, expected); printf("OK\n"); return 0; } chibicc-1.0.24/test/atomic_codegen_probe.c000066400000000000000000000021631517770275000204510ustar00rootroot00000000000000#include "test.h" #define IS_ATOMIC_INT(v) _Generic(&(v), _Atomic int *: 1, default: 0) #define IS_CONST_INT(v) _Generic(&(v), const int *: 1, default: 0) #define IS_VOLATILE_INT(v) _Generic(&(v), volatile int *: 1, default: 0) #define IS_RESTRICT_TYPE(expr) \ _Generic((expr), int * restrict: 1, default: 0) #define IS_RESTRICT_PTR(v) _Generic(&(v), int * restrict *: 1, default: 0) _Atomic int a; int c; const int d = 10; volatile int e; int * restrict p; int main() { /* Test that atomic variables remain atomic */ ASSERT(1, IS_ATOMIC_INT(a)); ASSERT(0, IS_ATOMIC_INT(c)); /* Test that const variables are correctly marked */ ASSERT(1, IS_CONST_INT(d)); ASSERT(0, IS_CONST_INT(c)); /* Test that volatile variables are correctly marked */ ASSERT(1, IS_VOLATILE_INT(e)); ASSERT(0, IS_VOLATILE_INT(c)); /* Test that restrict pointers are correctly marked */ ASSERT(0, IS_RESTRICT_TYPE(p)); ASSERT(0, IS_RESTRICT_TYPE(&c)); ASSERT(1, IS_RESTRICT_PTR(p)); /* Test that operations work correctly on both */ a+=1; c+=1; e+=1; return 0; } chibicc-1.0.24/test/atomic_compare_exchange.c000066400000000000000000000015661517770275000211540ustar00rootroot00000000000000 #include #include "test.h" typedef struct pg_atomic_uint32 { volatile unsigned int value; } pg_atomic_uint32; static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, unsigned int *expected, unsigned int newval) { char ret; __asm__ __volatile__( "lock\n" "cmpxchgl %4,%5\n" "setz %2\n" : "=a" (*expected), "=m" (ptr->value), "=q" (ret) : "a" (*expected), "r" (newval), "m" (ptr->value) : "memory", "cc"); return (bool) ret; } int main() { pg_atomic_uint32 val = {10}; unsigned int expected = 10; bool result = pg_atomic_compare_exchange_u32_impl(&val, &expected, 20); printf("Compare and Exchange: %d, New Value: %u\n", result, val.value); ASSERT(1, result); ASSERT(20, val.value); return 0; } chibicc-1.0.24/test/atomic_compare_exchange_u64.c000066400000000000000000000016561517770275000216520ustar00rootroot00000000000000#ifdef __x86_64__ #include #include "test.h" typedef struct pg_atomic_uint64 { volatile unsigned long long value; } pg_atomic_uint64; static inline bool pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, unsigned long long *expected, unsigned long long newval) { char ret; __asm__ __volatile__( "lock\n" "cmpxchgq %4,%5\n" "setz %2\n" : "=a" (*expected), "=m" (ptr->value), "=q" (ret) : "a" (*expected), "r" (newval), "m" (ptr->value) : "memory", "cc"); return (bool) ret; } int main() { pg_atomic_uint64 val = {10}; unsigned long long expected = 10; bool result = pg_atomic_compare_exchange_u64_impl(&val, &expected, 20); printf("Compare and Exchange U64: %d, New Value: %llu\n", result, val.value); ASSERT(1, result); ASSERT(20, val.value); return 0; } #endif chibicc-1.0.24/test/atomic_fence.c000066400000000000000000000007101517770275000167320ustar00rootroot00000000000000#include "test.h" int main() { char flag = 0; int ret; // Test __atomic_test_and_set // 5 is __ATOMIC_SEQ_CST ret = __atomic_test_and_set(&flag, 5); ASSERT(0, ret); ASSERT(1, flag); ret = __atomic_test_and_set(&flag, 5); ASSERT(1, ret); ASSERT(1, flag); // Test __atomic_clear __atomic_clear(&flag, 5); ASSERT(0, flag); // Test fences __atomic_thread_fence(5); __atomic_signal_fence(5); printf("OK\n"); return 0; }chibicc-1.0.24/test/atomic_fence_repro.c000066400000000000000000000004171517770275000201450ustar00rootroot00000000000000#include "test.h" #include int main() { atomic_thread_fence(memory_order_seq_cst); atomic_signal_fence(memory_order_seq_cst); atomic_thread_fence(memory_order_acquire); atomic_signal_fence(memory_order_release); printf("OK\n"); return 0; } chibicc-1.0.24/test/atomic_fetch_add.c000066400000000000000000000012471517770275000175610ustar00rootroot00000000000000 #include "test.h" typedef struct pg_atomic_uint32 { volatile unsigned int value; } pg_atomic_uint32; static inline unsigned int pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int add_) { unsigned int res; __asm__ __volatile__( "lock\n" "xaddl %0,%1\n" : "=q"(res), "=m"(ptr->value) : "0" (add_), "m"(ptr->value) : "memory", "cc"); return res; } int main() { pg_atomic_uint32 val = {10}; unsigned int old_val = pg_atomic_fetch_add_u32_impl(&val, 5); printf("Fetch and Add: Old Value: %u, New Value: %u\n", old_val, val.value); ASSERT(10, old_val); ASSERT(15, val.value); return 0; } chibicc-1.0.24/test/atomic_generic_probe.c000066400000000000000000000007731517770275000204660ustar00rootroot00000000000000#include "test.h" #define IS_ATOMIC_INT(v) _Generic(&(v), _Atomic int *: 1, default: 0) typedef _Atomic int AInt; int main(void) { _Atomic int a = 1, b = 2; int c = 3; ASSERT(1, IS_ATOMIC_INT(a)); ASSERT(1, IS_ATOMIC_INT(b)); ASSERT(0, IS_ATOMIC_INT(c)); AInt x = 5; int y = 6; ASSERT(1, IS_ATOMIC_INT(x)); ASSERT(0, IS_ATOMIC_INT(y)); // ensure separate declaration after atomic typedef stays non-atomic int z = 7; ASSERT(0, IS_ATOMIC_INT(z)); printf("OK\n"); return 0; } chibicc-1.0.24/test/atomic_is_lock_free.c000066400000000000000000000003121517770275000202740ustar00rootroot00000000000000// test/atomic_is_lock_free_fail.c #include #include "test.h" int main() { int x; int y; y = __atomic_is_lock_free(sizeof(x), &x); printf("%d\n", y); ASSERT(1, y); return 0; } chibicc-1.0.24/test/atomic_is_lock_free_test.c000066400000000000000000000012311517770275000213340ustar00rootroot00000000000000#include "test.h" #include int main() { printf("%d\n", __atomic_is_lock_free(1, NULL)); ASSERT(1, __atomic_is_lock_free(1, NULL)); printf("%d\n", __atomic_is_lock_free(2, NULL)); ASSERT(1, __atomic_is_lock_free(2, NULL)); printf("%d\n", __atomic_is_lock_free(4, NULL)); ASSERT(1, __atomic_is_lock_free(4, NULL)); printf("%d\n", __atomic_is_lock_free(8, NULL)); ASSERT(1, __atomic_is_lock_free(8, NULL)); printf("%d\n", __atomic_is_lock_free(16, NULL)); ASSERT(0, __atomic_is_lock_free(16, NULL)); printf("%d\n", __atomic_is_lock_free(3, NULL)); ASSERT(1, __atomic_is_lock_free(3, NULL)); return 0; } chibicc-1.0.24/test/atomic_probe.c000066400000000000000000000006761517770275000167740ustar00rootroot00000000000000#include "test.h" int main(void) { _Atomic int a = 1, b = 2; int c = 3; a += 1; b += 1; c += 1; typedef _Atomic int AI; AI x = 10; int y = 20; x += 5; y += 5; ASSERT(2, a); ASSERT(3, b); ASSERT(4, c); ASSERT(15, x); ASSERT(25, y); // if atomic leaks to y, this can generate different code paths; value still should be sane ASSERT(4, _Alignof(int)); ASSERT(4, _Alignof(y)); printf("OK\n"); return 0; } chibicc-1.0.24/test/atomic_sync_bool_compare_and_swap.c000077500000000000000000000004241517770275000232300ustar00rootroot00000000000000 #include "test.h" int main() { int value = 5; int result = __sync_bool_compare_and_swap(&value, 5, 10); printf("Compare and swap result: %d, New value: %d\n", result, value); // Result: 1, value: 5 ASSERT(1, result); ASSERT(10, value); return 0; } chibicc-1.0.24/test/atomic_sync_fetch_and_add.c000066400000000000000000000010371517770275000214340ustar00rootroot00000000000000 #include "test.h" // static inline int __sync_fetch_and_add(int *ptr, int value) { // int old_value; // __asm__ __volatile__( // "lock; xaddl %0, %1" // : "=r" (old_value), "+m" (*ptr) // : "0" (value) // : "memory" // ); // return old_value; // } int main() { int value = 5; int old_value = __sync_fetch_and_add(&value, 3); printf("Old value: %d, New value: %d\n", old_value, value); // Old value: 5, New value: 8 ASSERT(5, old_value); ASSERT(8, value); return 0; } chibicc-1.0.24/test/atomic_sync_fetch_and_sub.c000066400000000000000000000010411517770275000214700ustar00rootroot00000000000000 #include "test.h" // static inline int __sync_fetch_and_sub(int *ptr, int value) { // int old_value; // __asm__ __volatile__( // "lock; xaddl %0, %1" // : "=r" (old_value), "+m" (*ptr) // : "0" (-value) // : "memory" // ); // return old_value; // } int main() { int value = 5; int old_value = __sync_fetch_and_sub(&value, 2); printf("Old value: %d, New value: %d\n", old_value, value); // Old value: 5, New value: 3 ASSERT(5, old_value); ASSERT(3, value); return 0; } chibicc-1.0.24/test/atomic_sync_lock_and_set.c000066400000000000000000000004121517770275000213320ustar00rootroot00000000000000 #include "test.h" int main() { int value = 0; int old_value = __sync_lock_test_and_set(&value, 1); printf("Old value: %d, New value: %d\n", old_value, value); // Old value: 0, New value: 1 ASSERT(0, old_value); ASSERT(1, value); return 0; } chibicc-1.0.24/test/atomic_sync_synchronize.c000066400000000000000000000007161517770275000212670ustar00rootroot00000000000000 #include #include "test.h" int shared_value = 0; void *thread_func(void *arg) { __sync_synchronize(); // Memory barrier shared_value = 42; __sync_synchronize(); // Memory barrier return NULL; } int main() { pthread_t thread; pthread_create(&thread, NULL, thread_func, NULL); pthread_join(thread, NULL); printf("Shared value: %d\n", shared_value); // Shared value: 42 ASSERT(42, shared_value); return 0; } chibicc-1.0.24/test/atomic_sync_val_and_swap.c000066400000000000000000000011411517770275000213430ustar00rootroot00000000000000 #include #include "test.h" // static inline int __sync_val_compare_and_swap(int *ptr, int oldval, int newval) { // int result; // __asm__ __volatile__( // "lock; cmpxchgl %2, %1" // : "=a" (result), "+m" (*ptr) // : "r" (newval), "0" (oldval) // : "memory" // ); // return result; // } int main() { int value = 5; int old_value = __sync_val_compare_and_swap(&value, 5, 10); printf("Old value: %d, New value: %d\n", old_value, value); // Old value: 5, New value: 10 ASSERT(5, old_value); ASSERT(10, value); return 0; } chibicc-1.0.24/test/atomic_test_and_set2.c000066400000000000000000000010651517770275000204140ustar00rootroot00000000000000 #include #include "test.h" typedef struct pg_atomic_flag { volatile char value; } pg_atomic_flag; static inline bool pg_atomic_test_set_flag_impl(volatile pg_atomic_flag *ptr) { char _res = 1; __asm__ __volatile__( "lock\n" "xchgb %0,%1\n" : "+q" (_res), "+m" (ptr->value) : : "memory"); return _res == 0; } int main() { pg_atomic_flag flag = {0}; bool result = pg_atomic_test_set_flag_impl(&flag); printf("Test and Set Flag: %d\n", result); ASSERT(1, result); return 0; } chibicc-1.0.24/test/atomic_typedef_struct_probe.c000066400000000000000000000003021517770275000221020ustar00rootroot00000000000000#include "test.h" typedef struct { int v; } S; typedef _Atomic(S) AS; int main(void) { AS a; S b; a.v = 7; b.v = 9; ASSERT(7, a.v); ASSERT(9, b.v); printf("OK\n"); return 0; } chibicc-1.0.24/test/attr_section.c000066400000000000000000000003471517770275000170220ustar00rootroot00000000000000#include "test.h" struct S { void *p; }; const __attribute__((section("sec1"))) struct S const_no_relo = {0}; const __attribute__((section("sec1"))) struct S const_with_relo = {.p = assert}; int main(void) { printf("OK\n"); } chibicc-1.0.24/test/attr_weak.c000066400000000000000000000010041517770275000162740ustar00rootroot00000000000000#include "test.h" int no_def(void) __attribute__ ((weak)); int has_def(void) __attribute__ ((weak)); int main(int argc, const char **argv) { int res = 0; int no_def_test; if (no_def) { no_def_test = 1; res = no_def(); } else { no_def_test = 0; } int has_def_test; if (has_def) { has_def_test = 1; res = has_def(); } else { has_def_test = 0; } ASSERT(0, no_def_test); ASSERT(1, has_def_test); ASSERT(123, res); printf("OK\n"); } int has_def(void){ return 123; } chibicc-1.0.24/test/attribute.c000077500000000000000000000071131517770275000163300ustar00rootroot00000000000000#include "test.h" #include "stddef.h" int main() { ASSERT(5, ({ struct { char a; int b; } __attribute__((packed)) x; sizeof(x); })); ASSERT(0, offsetof(struct __attribute__((packed)) { char a; int b; }, a)); ASSERT(1, offsetof(struct __attribute__((packed)) { char a; int b; }, b)); ASSERT(5, ({ struct __attribute__((packed)) { char a; int b; } x; sizeof(x); })); ASSERT(0, offsetof(struct { char a; int b; } __attribute__((packed)), a)); ASSERT(1, offsetof(struct { char a; int b; } __attribute__((packed)), b)); ASSERT(9, ({ typedef struct { char a; int b[2]; } __attribute__((packed)) T; sizeof(T); })); ASSERT(9, ({ typedef struct __attribute__((packed)) { char a; int b[2]; } T; sizeof(T); })); ASSERT(1, offsetof(struct __attribute__((packed)) T { char a; int b[2]; }, b)); ASSERT(1, _Alignof(struct __attribute__((packed)) { char a; int b[2]; })); ASSERT(8, ({ struct __attribute__((aligned(8))) { int a; } x; _Alignof(x); })); ASSERT(8, ({ struct { int a; } __attribute__((aligned(8))) x; _Alignof(x); })); ASSERT(8, ({ struct __attribute__((aligned(8), packed)) { char a; int b; } x; _Alignof(x); })); ASSERT(8, ({ struct { char a; int b; } __attribute__((aligned(8), packed)) x; _Alignof(x); })); ASSERT(1, offsetof(struct __attribute__((aligned(8), packed)) { char a; int b; }, b)); ASSERT(1, offsetof(struct { char a; int b; } __attribute__((aligned(8), packed)), b)); ASSERT(8, ({ struct __attribute__((aligned(8))) __attribute__((packed)) { char a; int b; } x; _Alignof(x); })); ASSERT(8, ({ struct { char a; int b; } __attribute__((aligned(8))) __attribute__((packed)) x; _Alignof(x); })); ASSERT(1, offsetof(struct __attribute__((aligned(8))) __attribute__((packed)) { char a; int b; }, b)); ASSERT(1, offsetof(struct { char a; int b; } __attribute__((aligned(8))) __attribute__((packed)), b)); ASSERT(8, ({ struct __attribute__((aligned(8))) { char a; int b; } __attribute__((packed)) x; _Alignof(x); })); ASSERT(1, offsetof(struct __attribute__((aligned(8))) { char a; int b; } __attribute__((packed)), b)); ASSERT(16, ({ struct __attribute__((aligned(8+8))) { char a; int b; } x; _Alignof(x); })); ASSERT(1, offsetof(struct __attribute__((packed)) T { char a; int b[2]; }, b)); ASSERT(1, _Alignof(struct __attribute__((packed)) { char a; int b[2]; })); ASSERT(8, ({ struct __attribute__((aligned(8))) { int a; } x; _Alignof(x); })); ASSERT(8, ({ struct { int a; } __attribute__((aligned(8))) x; _Alignof(x); })); ASSERT(8, ({ struct __attribute__((aligned(8), packed)) { char a; int b; } x; _Alignof(x); })); ASSERT(8, ({ struct { char a; int b; } __attribute__((aligned(8), packed)) x; _Alignof(x); })); ASSERT(1, offsetof(struct __attribute__((aligned(8), packed)) { char a; int b; }, b)); ASSERT(1, offsetof(struct { char a; int b; } __attribute__((aligned(8), packed)), b)); ASSERT(8, ({ struct __attribute__((aligned(8))) __attribute__((packed)) { char a; int b; } x; _Alignof(x); })); ASSERT(8, ({ struct { char a; int b; } __attribute__((aligned(8))) __attribute__((packed)) x; _Alignof(x); })); ASSERT(1, offsetof(struct __attribute__((aligned(8))) __attribute__((packed)) { char a; int b; }, b)); ASSERT(1, offsetof(struct { char a; int b; } __attribute__((aligned(8))) __attribute__((packed)), b)); ASSERT(8, ({ struct __attribute__((aligned(8))) { char a; int b; } __attribute__((packed)) x; _Alignof(x); })); ASSERT(1, offsetof(struct __attribute__((aligned(8))) { char a; int b; } __attribute__((packed)), b)); ASSERT(16, ({ struct __attribute__((aligned(8+8))) { char a; int b; } x; _Alignof(x); })); printf("OK\n"); return 0; } chibicc-1.0.24/test/attribute_aligned.c000066400000000000000000000253301517770275000200110ustar00rootroot00000000000000#include "test.h" #include #define A1 __attribute__((aligned(1024))) #define A2 __attribute__((aligned(4096))) #define P __attribute__((packed)) A1 struct { int i; } g0, g1; struct A1 { int i; } g2, g3; struct { int i; } A1 g4, g5; struct { int i; } g6, A1 g7; struct { int i; } g8, g9 A1; struct { int i; } *A1 g31; struct { int i; } g32 [1]A1; int main(int argc, char **argv) { ASSERT(0, (long)&g1 & 1023); ASSERT(0, (long)&g3 & 1023); ASSERT(0, (long)&g5 & 1023); ASSERT(0, (long)&g7 & 1023); ASSERT(0, (long)&g9 & 1023); ASSERT(0, (long)&g31 & 1023); ASSERT(0, (long)&g32[0] & 1023); ASSERT(4, (long)&g32[1] & 1023); ASSERT(0, ({ A1 struct { int i; } x, y; (long)&y & 1023; }) ); ASSERT(0, ({ struct A1 { int i; } x, y; (long)&y & 1023; }) ); ASSERT(0, ({ struct { int i; } A1 x, y; (long)&y & 1023; }) ); ASSERT(0, ({ struct { int i; } x, A1 y; (long)&y & 1023; }) ); ASSERT(0, ({ struct { int i; } x, y A1; (long)&y & 1023; }) ); ASSERT(0, ({ struct { int i; } A2 x, y A1; (long)&y & 4095; }) ); ASSERT(0, ({ struct { int i; } A1 x, y A2; (long)&y & 4095; }) ); ASSERT(0, ({ struct { A1 int i, j; } x; (long)&x.j & 1023; }) ); ASSERT(0, ({ struct { int A1 i, j; } x; (long)&x.j & 1023; }) ); #ifdef NOTGCC ASSERT(0, ({ struct { int i, A1 j; } x; (long)&x.j & 1023; }) ); #endif ASSERT(0, ({ struct { int i, j A1; } x; (long)&x.j & 1023; }) ); ASSERT(0, ({ struct { struct A1 { int i; }; } x, y; (long)&y & 1023; }) ); ASSERT(0, ({ struct { struct { int i; } A1; } x, y; (long)&y & 1023; }) ); ASSERT(0, ({ A1 static char x; (long)&x & 1023; }) ); ASSERT(0, ({ static A1 char x; (long)&x & 1023; }) ); ASSERT(0, ({ static char A1 x; (long)&x & 1023; }) ); ASSERT(0, ({ static char x A1; (long)&x & 1023; }) ); // ASSERT(0, ({ A1 char x[argc]; (long)&x[0] & 1023; }) ); // ASSERT(0, ({ char A1 x[argc]; (long)&x[0] & 1023; }) ); // ASSERT(0, ({ char x[argc] A1; (long)&x[0] & 1023; }) ); ASSERT(1024, ({ A1 typedef char c; _Alignof(c); }) ); ASSERT(1024, ({ typedef A1 char c; _Alignof(c); }) ); ASSERT(1024, ({ typedef char A1 c; _Alignof(c); }) ); ASSERT(1024, ({ typedef char c A1; _Alignof(c); }) ); ASSERT(1, _Alignof(char)); ASSERT(0, ({ A1 typedef struct { int i; } S; S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef A1 struct { int i; } S; S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct A1 { int i; } S; S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct { int i; } A1 S; S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct { int i; } S A1; S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct { int i; } S; A1 S x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct { int i; } S; S A1 x; (long)&x & 1023; }) ); ASSERT(0, ({ typedef struct { int i; } S; S x A1; (long)&x & 1023; }) ); ASSERT(8, ({ struct S { char c; void*p; }; offsetof(struct S, p);}) ); ASSERT(16, ({ struct S { char c; void*p; }; sizeof(struct S);}) ); ASSERT(1, ({ struct S { char c; void*p; } P; offsetof(struct S, p);}) ); ASSERT(9, ({ struct S { char c; void*p; } P; sizeof(struct S);}) ); ASSERT(8192, ({ typedef struct { struct { long m3 A2; }; A1 short m4; } T; sizeof(T); })); ASSERT(4096, ({ typedef struct { struct { long m3 A2; }; A1 short m4; } T; offsetof(T, m4); })); ASSERT(32, ({ typedef struct { char m1; union { long double m6 __attribute__((aligned(4))); long m7; }; } T; sizeof(T); })); ASSERT(16, ({ typedef struct { char m1; union { long double m6 __attribute__((aligned(4))); long m7; }; } T; offsetof(T, m7); })); ASSERT(20, ({ typedef struct { char m1; union { long double m6 __attribute__((aligned(4))); long m7; } P; } T; sizeof(T); })); ASSERT(4, ({ typedef struct { char m1; union { long double m6 __attribute__((aligned(4))); long m7; } P; } T; offsetof(T, m7); })); ASSERT(1026, ({ typedef struct { short : 2, : 4 A1; char c; } T; sizeof(T); })); ASSERT(1025, ({ typedef struct { short : 2, : 4 A1; char c; } T; offsetof(T, c); })); ASSERT(17, ({ typedef struct { char : 6, : 0 __attribute__((aligned)), m6; } T; sizeof(T); })); ASSERT(16, ({ typedef struct { char : 6, : 0 __attribute__((aligned)), m6; } T; offsetof(T, m6); })); ASSERT(8, ({struct { long m1:5 __attribute__((aligned(4))); } T; sizeof(T); })); ASSERT(16, ({ typedef struct { short s; long m2 : 48 __attribute__((aligned(4))); } T; sizeof(T); })); #ifdef NOTCLANG ASSERT(14, ({ typedef struct { short s; long m2 : 48 __attribute__((aligned(4))); char c; } T; offsetof(T,c); })); #endif ASSERT(8, ({ typedef struct { char m1; int : 26 __attribute__((aligned(2))); } T; sizeof(T); })); ASSERT(8, ({ typedef struct { char m1; int : 26 __attribute__((aligned(2))); char c; } T; offsetof(T,c); })); ASSERT(16, ({ struct { int m1 __attribute__((aligned));} P t; sizeof(t); })); ASSERT(1028, ({ typedef struct { struct { char c; } A1; int m4; } P T; sizeof (T); })); ASSERT(1024, ({ typedef struct { struct { char c; } A1; int m4; } P T; offsetof (T, m4); })); ASSERT(1025, ({ typedef struct { struct { char m2; union { int m4; } A1; } P; } T; sizeof(T);})); ASSERT(1, ({ typedef struct { struct { char m2; union { int m4; } A1; } P; } T; offsetof(T,m4);})); ASSERT(1024, ({ typedef struct { A1 struct { char c; } j; char m6; } T; sizeof(T); })); ASSERT(1024, ({ typedef struct { A1 struct { char c; } j; } T; sizeof(T); })); #ifdef NOTCLANG ASSERT(1, ({ typedef struct { A1 struct { char c; }; } T; sizeof(T); })); // gcc behaviour #endif ASSERT(3, ({ A1 typedef struct { struct { char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(3, ({ typedef A1 struct { struct { char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(1024, ({ typedef struct A1 { struct { char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(2048, ({ typedef struct { A1 struct { char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(3072, ({ typedef struct { struct A1 { char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(3072, ({ typedef struct { struct { A1 char c; } j, k; char m6; } T; sizeof(T); })); ASSERT(3072, ({ typedef struct { struct { char A1 c; } j, k; char m6; } T; sizeof(T); })); ASSERT(3072, ({ typedef struct { struct { char c A1; } j, k; char m6; } T; sizeof(T); })); ASSERT(3072, ({ typedef struct { struct { char c; } A1 j, k; char m6; } T; sizeof(T); })); ASSERT(1024, ({ typedef struct { struct { char c; } j A1, k; char m6; } T; sizeof(T); })); #ifdef NOTGCC ASSERT(2048, ({ typedef struct { struct { char c; } j, A1 k; char m6; } T; sizeof(T); })); #endif ASSERT(2048, ({ typedef struct { struct { char c; } j, k A1; char m6; } T; sizeof(T); })); ASSERT(2048, ({ typedef struct { struct { char c; } j, k; A1 char m6; } T; sizeof(T); })); ASSERT(2048, ({ typedef struct { struct { char c; } j, k; char A1 m6; } T; sizeof(T); })); ASSERT(2048, ({ typedef struct { struct { char c; } j, k; char m6 A1; } T; sizeof(T); })); ASSERT(1024, ({ typedef struct { struct { char c; } j, k; char m6; } A1 T; sizeof(T); })); ASSERT(3, ({ typedef struct { struct { char c; } j, k; char m6; } T A1; sizeof(T); })); ASSERT(1, ({ A1 typedef struct { struct { char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef A1 struct { struct { char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct A1 { struct { char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { A1 struct { char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { struct A1 { char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { struct { A1 char c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { struct { char A1 c; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { struct { char c A1; } j, k; char m6; } T; offsetof(T, k); })); ASSERT(1024, ({ typedef struct { struct { char c; } A1 j, k; char m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j A1, k; char m6; } T; offsetof(T, k); })); #ifdef NOTGCC ASSERT(1024, ({ typedef struct { struct { char c; } j, A1 k; char m6; } T; offsetof(T, k); })); #endif ASSERT(1024, ({ typedef struct { struct { char c; } j, k A1; char m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j, k; A1 char m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j, k; char A1 m6; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j, k; char m6 A1; } T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j, k; char m6; } A1 T; offsetof(T, k); })); ASSERT(1, ({ typedef struct { struct { char c; } j, k; char m6; } T A1; offsetof(T, k); })); ASSERT(2, ({ A1 typedef struct { struct { char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2, ({ typedef A1 struct { struct { char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2, ({ typedef struct A1 { struct { char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(1025, ({ typedef struct { A1 struct { char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2048, ({ typedef struct { struct A1 { char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2048, ({ typedef struct { struct { A1 char c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2048, ({ typedef struct { struct { char A1 c; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2048, ({ typedef struct { struct { char c A1; } j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2048, ({ typedef struct { struct { char c; } A1 j, k; char m6; } T; offsetof(T,m6); })); ASSERT(2, ({ typedef struct { struct { char c; } j A1, k; char m6; } T; offsetof(T,m6); })); #ifdef NOTGCC ASSERT(1025, ({ typedef struct { struct { char c; } j, A1 k; char m6; } T; offsetof(T,m6); })); #endif ASSERT(1025, ({ typedef struct { struct { char c; } j, k A1; char m6; } T; offsetof(T,m6); })); ASSERT(1024, ({ typedef struct { struct { char c; } j, k; A1 char m6; } T; offsetof(T,m6); })); ASSERT(1024, ({ typedef struct { struct { char c; } j, k; char A1 m6; } T; offsetof(T,m6); })); ASSERT(1024, ({ typedef struct { struct { char c; } j, k; char m6 A1; } T; offsetof(T,m6); })); ASSERT(2, ({ typedef struct { struct { char c; } j, k; char m6; } A1 T; offsetof(T,m6); })); ASSERT(2, ({ typedef struct { struct { char c; } j, k; char m6; } T A1; offsetof(T,m6); })); { typedef const int Ic; typedef A1 Ic Ica; typedef A1 int Ia; typedef volatile Ia Iav; Ica v1; Iav v2; SASSERT(__alignof(Ica) == 1024); SASSERT(__alignof(Iav) == 1024); SASSERT(__alignof(v1) == 1024); SASSERT(__alignof(v2) == 1024); SASSERT(_Generic(&v1, int const*: 1)); SASSERT(_Generic(&v2, int volatile*: 1)); ASSERT(0, 1023 & (int)&v1); ASSERT(0, 1023 & (int)&v2); } printf("OK\n"); return 0; } chibicc-1.0.24/test/attribute_hiding.c000066400000000000000000000016031517770275000176450ustar00rootroot00000000000000#include #include "test.h" typedef union { void *ptr; int fd; unsigned u32; unsigned u64; } Data_t; struct pre_inc { unsigned events; Data_t data; } __attribute__((packed)); #include "test.h" struct post_inc { unsigned events; Data_t data; } __attribute__((packed)); #ifdef __attribute__ #undef __attribute__ #endif #define __attribute__(x) struct re_def { unsigned events; Data_t data; } __attribute__((packed)); void pre_include(void) { DASSERT(sizeof(struct pre_inc) == 12); DASSERT(offsetof(struct pre_inc, data) == 4); } void post_include(void){ DASSERT(sizeof(struct post_inc) == 12); DASSERT(offsetof(struct post_inc, data) == 4); } void redefined(void) { DASSERT(sizeof(struct re_def) == 16); DASSERT(offsetof(struct re_def, data) == 8); } int main() { pre_include(); post_include(); redefined(); printf("OK\n"); return 0; } chibicc-1.0.24/test/avx2_cmpgt_epi8_256.c000066400000000000000000000010601517770275000177100ustar00rootroot00000000000000#include "test.h" #include #include int main() { signed char a[32]; signed char b[32]; for (int i = 0; i < 32; i++) { a[i] = (signed char)(i - 16); b[i] = 0; } __m256i va = _mm256_loadu_si256((const __m256i *)a); __m256i vb = _mm256_loadu_si256((const __m256i *)b); __m256i vc = _mm256_cmpgt_epi8(va, vb); unsigned char out[32]; _mm256_storeu_si256((__m256i *)out, vc); for (int i = 0; i < 32; i++) { int exp = (a[i] > 0) ? 0xff : 0x00; ASSERT(exp, out[i]); } printf("OK\n"); return 0; } chibicc-1.0.24/test/avx2_subs_epu8_256.c000066400000000000000000000007751517770275000176020ustar00rootroot00000000000000#include "test.h" #include #include int main() { unsigned char a[32]; for (int i = 0; i < 32; i++) a[i] = (unsigned char)(50 + i); __m256i va = _mm256_loadu_si256((const __m256i *)a); __m256i vb = _mm256_set1_epi8(51); __m256i vc = _mm256_subs_epu8(va, vb); unsigned char out[32]; _mm256_storeu_si256((__m256i *)out, vc); for (int i = 0; i < 32; i++) { int exp = (a[i] < 51) ? 0 : (a[i] - 51); ASSERT(exp, out[i]); } printf("OK\n"); return 0; } chibicc-1.0.24/test/bipbuffer.h000066400000000000000000000041061517770275000162720ustar00rootroot00000000000000#ifndef BIPBUFFER_H #define BIPBUFFER_H typedef struct { unsigned long int size; /* region A */ unsigned int a_start, a_end; /* region B */ unsigned int b_end; /* is B inuse? */ int b_inuse; unsigned char data[]; } bipbuf_t; /** * Create a new bip buffer. * * malloc()s space * * @param[in] size The size of the buffer */ bipbuf_t *bipbuf_new(const unsigned int size); /** * Initialise a bip buffer. Use memory provided by user. * * No malloc()s are performed. * * @param[in] size The size of the array */ void bipbuf_init(bipbuf_t* me, const unsigned int size); /** * Free the bip buffer */ void bipbuf_free(bipbuf_t *me); /* TODO: DOCUMENTATION */ unsigned char *bipbuf_request(bipbuf_t* me, const int size); int bipbuf_push(bipbuf_t* me, const int size); /** * @param[in] data The data to be offered to the buffer * @param[in] size The size of the data to be offered * @return number of bytes offered */ int bipbuf_offer(bipbuf_t *me, const unsigned char *data, const int size); /** * Look at data. Don't move cursor * * @param[in] len The length of the data to be peeked * @return data on success, NULL if we can't peek at this much data */ unsigned char *bipbuf_peek(const bipbuf_t* me, const unsigned int len); /** * Look at data. Don't move cursor * * @param[in] len The length of the data returned * @return data on success, NULL if nothing available */ unsigned char *bipbuf_peek_all(const bipbuf_t* me, unsigned int *len); /** * Get pointer to data to read. Move the cursor on. * * @param[in] len The length of the data to be polled * @return pointer to data, NULL if we can't poll this much data */ unsigned char *bipbuf_poll(bipbuf_t* me, const unsigned int size); /** * @return the size of the bipbuffer */ int bipbuf_size(const bipbuf_t* me); /** * @return 1 if buffer is empty; 0 otherwise */ int bipbuf_is_empty(const bipbuf_t* me); /** * @return how much space we have assigned */ int bipbuf_used(const bipbuf_t* cb); /** * @return bytes of unused space */ int bipbuf_unused(const bipbuf_t* me); #endif /* BIPBUFFER_H */ chibicc-1.0.24/test/bitfield.c000077500000000000000000000024171517770275000161110ustar00rootroot00000000000000#include "test.h" struct { char a; int b : 5; int c : 10; } g45 = {1, 2, 3}, g46={}; int main() { ASSERT(4, sizeof(struct {int x:1; })); ASSERT(8, sizeof(struct {long x:1; })); struct bit1 { short a; char b; int c : 2; int d : 3; int e : 3; }; ASSERT(4, sizeof(struct bit1)); ASSERT(1, ({ struct bit1 x; x.a=1; x.b=2; x.c=3; x.d=4; x.e=5; x.a; })); ASSERT(1, ({ struct bit1 x={1,2,3,4,5}; x.a; })); ASSERT(2, ({ struct bit1 x={1,2,3,4,5}; x.b; })); ASSERT(-1, ({ struct bit1 x={1,2,3,4,5}; x.c; })); ASSERT(-4, ({ struct bit1 x={1,2,3,4,5}; x.d; })); ASSERT(-3, ({ struct bit1 x={1,2,3,4,5}; x.e; })); ASSERT(1, g45.a); ASSERT(2, g45.b); ASSERT(3, g45.c); ASSERT(0, g46.a); ASSERT(0, g46.b); ASSERT(0, g46.c); typedef struct { int a : 10; int b : 10; int c : 10; } T3; ASSERT(1, ({ T3 x={1,2,3}; x.a++; })); ASSERT(2, ({ T3 x={1,2,3}; x.b++; })); ASSERT(3, ({ T3 x={1,2,3}; x.c++; })); ASSERT(2, ({ T3 x={1,2,3}; ++x.a; })); ASSERT(3, ({ T3 x={1,2,3}; ++x.b; })); ASSERT(4, ({ T3 x={1,2,3}; ++x.c; })); ASSERT(4, sizeof(struct {int a:3; int c:1; int c:5;})); ASSERT(8, sizeof(struct {int a:3; int:0; int c:5;})); ASSERT(4, sizeof(struct {int a:3; int:0;})); printf("OK\n"); return 0; } chibicc-1.0.24/test/bitfield2.c000066400000000000000000000102401517770275000161610ustar00rootroot00000000000000#include "test.h" struct M { int : 0; int f2 : 12; }; int bitextract(void){ struct Fields { _Bool a :1; long long :3; unsigned b :4; _Bool c :1; unsigned d :3; unsigned e :2; long :2; }; struct Fields s1 = {11,22,33,44,55,66,77}; struct Fields s2 = {77,66,55,44,33,22,11}; ASSERT(4, sizeof(struct Fields)); ASSERT(4, _Alignof(struct Fields)); ASSERT(0, memcmp(&(int){14689}, &s1, 2)); ASSERT(0, memcmp(&(int){6433}, &s2, 2)); ASSERT(1, s1.a); ASSERT(6, s1.b); ASSERT(1, s1.c); ASSERT(4, s1.d); ASSERT(3, s1.e); ASSERT(1, s2.a); ASSERT(2, s2.b); ASSERT(1, s2.c); ASSERT(4, s2.d); ASSERT(1, s2.e); } int struct_init(void) { struct M m = {11,22}; ASSERT(11, ({ m.f2; })); ASSERT(11, ({ struct { int :1,a,:1,b,:1,:1,c,:1; } s = {11,22,33}; s.a; })); ASSERT(22, ({ struct { int :1,a,:1,b,:1,:1,c,:1; } s = {11,22,33}; s.b; })); ASSERT(33, ({ struct { int :1,a,:1,b,:1,:1,c,:1; } s = {11,22,33}; s.c; })); ASSERT(11, ({ struct { int a,:1,b,:1,:1,c,:1; } s = {.a=11,22,33}; s.a; })); ASSERT(22, ({ struct { int a,:1,b,:1,:1,c,:1; } s = {.a=11,22,33}; s.b; })); ASSERT(33, ({ struct { int a,:1,b,:1,:1,c,:1; } s = {.a=11,22,33}; s.c; })); ASSERT(11, ({ struct { struct { int a,:1,b,:1,:1,c,:1; }; } s = {.a=11,22,33}; s.a; })); ASSERT(22, ({ struct { struct { int a,:1,b; int;int :1,c,:1; }; } s = {.a=11,22,33}; s.b; })); ASSERT(33, ({ struct { struct { int a,:1,b,:1,:1,c,:1; }; } s = {.a=11,22,33}; s.c; })); ASSERT(22, ({ struct { struct { int a; int; int b; int; int; int c; int; }; } s = {.a=11,22,33}; s.b; })); ASSERT(33, ({ struct { int a; struct {int:1,:1;}; int b; } s = {11,{},33}; s.b; })); ASSERT(33, ({ struct { int a; struct {int:1,:1;}; int b; } s = {.a=11,{},33}; s.b; })); ASSERT(22, ({ struct { struct { }; int a; } s = {{},22,33}; s.a; })); ASSERT(22, ({ struct { struct { int :1,:1; }; int a; } s = {{},22,33}; s.a; })); ASSERT(22, ({ struct { int :1; int a; int :1; struct { int :1; int b; int:1; int c; }; } s = {11,22,33}; s.b; })); ASSERT(33, ({ struct { int :1; int a; int :1; struct { int :1; int b; int:1; int c; }; } s = {11,22,33}; s.c; })); } void union_init(void) { ASSERT(33, ({ union { int :1,:1; int a; } s = {33}; s.a; })); ASSERT(33, ({ struct { union { int :1,:1; }; int a;} s = {{23},33}; s.a;})); ASSERT(33, ({ struct { union { int :1,:1; }; int a;} s = {{23},33}; s.a;})); ASSERT(11, ({ struct { int a; union { int :1,:7; }; int b; } s = {11,{},33}; s.a; })); ASSERT(33, ({ struct { int a; union { int :1,:7; }; int b; } s = {11,{},33}; s.b; })); ASSERT(11, ({ union { struct { int a,:1,b,:1,:1,c,:1; }; } s = {.a=11,22,33}; s.a; })); ASSERT(22, ({ union { struct { int a,:1,b,:1,:1,c,:1; }; } s = {.a=11,22,33}; s.b; })); ASSERT(33, ({ union { struct { int a,:1,b,:1,:1,c,:1; }; } s = {.a=11,22,33}; s.c; })); ASSERT(22, ({ union { struct { int a, :1; int b, :1, :1; int c, :1; }; } s = {.a=11,22,33}; s.b; })); ASSERT(0, ({ union { union { }; int a; } s = {{}}; s.a; })); ASSERT(0, ({ union { struct { int :1,:1; }; int a; } s = {{}}; s.a; })); ASSERT(22, ({ struct { int a; union { int:1; int b; }; } s = {11,22}; s.b; })); } int assign_expr(void) { struct { int i : 2; _Bool b : 1; unsigned j : 2; } s = {.b = 1}; int x = s.i = -5; int y = s.j = 5; ASSERT(-1, x); ASSERT(1, y); x = s.i += -5; y = s.j += 5; int z = s.b >>= 1; ASSERT(-2, x); ASSERT(2, y); ASSERT(0, (s.b >>= 1)); } int large_field(void) { ASSERT(1, ({ struct { unsigned long long i: 56; } s = {.i = 0xFFFFFFFFFFFFFFFF }; s.i == 0xFFFFFFFFFFFFFF; }) ); } struct { int b :3; int i, j; } s = {.i = 2, 3}; int uninit_global(void) { ASSERT(2, s.i); ASSERT(3, s.j); } int main(void) { bitextract(); struct_init(); union_init(); assign_expr(); large_field(); uninit_global(); struct { unsigned b : 3; } s = {0}; printf("%d\n", (~(0,s.b) < 0) ); // expected 1 ASSERT(1, (~(0,s.b) < 0) ); printf("%d\n", (~({s.b;}) < 0) ); // expected 1 ASSERT(1, (~({s.b;}) < 0) ); printf("%d\n", (~(1 ? s.b : s.b) < 0) ); // expected 1 ASSERT(1, (~(1 ? s.b : s.b) < 0) ); printf("OK\n"); return 0; }chibicc-1.0.24/test/bitwise.c000066400000000000000000000031641517770275000157720ustar00rootroot00000000000000 #include #include "test.h" const uint8_t pg_leftmost_one_pos[256] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; void test_bitwise_operations() { uint64_t num = 9223372036854775807; uint64_t word = num - 1; int shift = 64 - 8; printf("Testing num: %lu\n", num); printf("Initial word: %lu\n", word); ASSERT(9223372036854775807, num); ASSERT(9223372036854775806, word); while ((word >> shift) == 0) { shift -= 8; printf("Shift: %d, word: %lu\n", shift, word >> shift); } printf("Final shift: %d\n", shift); ASSERT(56, shift); int pos = shift + pg_leftmost_one_pos[(word >> shift) & 255]; printf("Computed pos: %d\n", pos); ASSERT(62, pos); printf("Computed log2: %d\n", pos + 1); ASSERT(63, pos + 1); } int main() { test_bitwise_operations(); return 0; } chibicc-1.0.24/test/bitwise2.c000066400000000000000000000043721517770275000160560ustar00rootroot00000000000000 #include #include #include "test.h" const uint8_t pg_leftmost_one_pos[256] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; static inline int pg_leftmost_one_pos64(uint64_t word) { int shift = 64 - 8; while ((word >> shift) == 0) { shift -= 8; } int pos = shift + pg_leftmost_one_pos[(word >> shift) & 255]; return pos; } static inline int pg_ceil_log2_64(uint64_t num) { if (num < 2) return 0; else return pg_leftmost_one_pos64(num - 1) + 1; } static int my_log2(long num) { if (num > LONG_MAX / 2) num = LONG_MAX / 2; // Assuming SIZEOF_LONG >= 8 return pg_ceil_log2_64(num); } static int next_pow2_int(long num) { if (num > INT_MAX / 2) num = INT_MAX / 2; int log2 = my_log2(num); return 1 << log2; } int main() { long test_values[] = {1, 2, 3, 536870912, LONG_MAX}; for (int i = 0; i < sizeof(test_values) / sizeof(test_values[0]); ++i) { printf("Input: %ld, next_pow2_int: %d\n", test_values[i], next_pow2_int(test_values[i])); if (i == 0) ASSERT(1, next_pow2_int(test_values[i]) ); else if (i == 1) ASSERT(2, next_pow2_int(test_values[i]) ); else if (i == 2) ASSERT(4, next_pow2_int(test_values[i]) ); else if (i == 3) ASSERT(536870912, next_pow2_int(test_values[i]) ); else if (i == 4) ASSERT(1073741824, next_pow2_int(test_values[i]) ); } return 0; } chibicc-1.0.24/test/bool2.c000066400000000000000000000006361517770275000153420ustar00rootroot00000000000000#include "test.h" int main(void) { _Bool x, y ,b; b = 0; x = b, y = b--; ASSERT(0, x); printf("y=%d\n",y); ASSERT(0, y); x = b, y = b--; ASSERT(1, x); ASSERT(1, y); x = b, y = b--; ASSERT(0, x); ASSERT(0, y); b = 0; x = b, y = b++; ASSERT(0, x); ASSERT(0, y); x = b, y = b++; ASSERT(1, x); ASSERT(1, y); x = b, y = b++; ASSERT(1, x); ASSERT(1, y); printf("OK\n"); }chibicc-1.0.24/test/bool3.c000066400000000000000000000002361517770275000153370ustar00rootroot00000000000000#include "test.h" #include _Bool str_lit_bool_init = "abc" ? "foo" && "bar" : 0; int main() { ASSERT(1, str_lit_bool_init); return 0; }chibicc-1.0.24/test/builtin.c000077500000000000000000000032701517770275000157730ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(1, __builtin_types_compatible_p(int, int)); ASSERT(1, __builtin_types_compatible_p(double, double)); ASSERT(0, __builtin_types_compatible_p(int, long)); ASSERT(0, __builtin_types_compatible_p(long, float)); ASSERT(1, __builtin_types_compatible_p(int *, int *)); ASSERT(0, __builtin_types_compatible_p(short *, int *)); ASSERT(0, __builtin_types_compatible_p(int **, int *)); ASSERT(1, __builtin_types_compatible_p(const int, int)); ASSERT(0, __builtin_types_compatible_p(unsigned, int)); ASSERT(1, __builtin_types_compatible_p(signed, int)); ASSERT(0, __builtin_types_compatible_p(struct {int a;}, struct {int a;})); ASSERT(1, __builtin_types_compatible_p(int (*)(void), int (*)(void))); ASSERT(1, __builtin_types_compatible_p(void (*)(int), void (*)(int))); ASSERT(1, __builtin_types_compatible_p(void (*)(int, double), void (*)(int, double))); ASSERT(1, __builtin_types_compatible_p(int (*)(float, double), int (*)(float, double))); ASSERT(0, __builtin_types_compatible_p(int (*)(float, double), int)); ASSERT(0, __builtin_types_compatible_p(int (*)(float, double), int (*)(float))); ASSERT(0, __builtin_types_compatible_p(int (*)(float, double), int (*)(float, double, int))); ASSERT(1, __builtin_types_compatible_p(double (*)(...), double (*)(...))); ASSERT(0, __builtin_types_compatible_p(double (*)(...), double (*)(void))); ASSERT(1, ({ typedef struct {int a;} T; __builtin_types_compatible_p(T, T); })); ASSERT(1, ({ typedef struct {int a;} T; __builtin_types_compatible_p(T, const T); })); ASSERT(1, ({ struct {int a; int b;} x; __builtin_types_compatible_p(typeof(x.a), typeof(x.b)); })); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_add_overflow.c000066400000000000000000000007311517770275000205220ustar00rootroot00000000000000 #include "test.h" int main() { int result; if (__builtin_add_overflow(54, 1, &result)) { printf("Overflow detected!\n"); } else { printf("Overflow not detected!\n"); } ASSERT(0, __builtin_add_overflow(54, 1, &result)); printf("second test\n"); if (__builtin_add_overflow(2147483647, 1, &result)) { printf("Overflow detected!\n"); } ASSERT(1, __builtin_add_overflow(2147483647, 1, &result)); return 0; } chibicc-1.0.24/test/builtin_addsd.c000066400000000000000000000005301517770275000171230ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); int main() { double2 a = {1.0, 2.0}; double2 b = {3.0, 4.0}; double2 c = __builtin_ia32_addsd(a, b); printf("%.1f %.1f\n", c[0], c[1]); // Expected: 4.0 2.0 ASSERT(4, c[0]); ASSERT(2, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_addss.c000066400000000000000000000011411517770275000171410ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { // Initialize full 4-float vectors v4sf va = {1.5f, 3.3f, 4.4f, 5.5f}; v4sf vb = {2.5f, 6.7f, 3.6f, 7.5f}; // Perform scalar single-float addition on lowest elements v4sf vc = __builtin_ia32_addss(va, vb); // Extract the scalar result (lowest float) float result = ((float*)&vc)[0]; printf("result = %f\n", result); // Should print 4.0 ASSERT(4, vc[0]); ASSERT(3, vc[1]); ASSERT(4, vc[2]); ASSERT(5, vc[3]); ASSERT(4, result); return 0; } chibicc-1.0.24/test/builtin_andnotsi256.c000066400000000000000000000023541517770275000201260ustar00rootroot00000000000000#include #include "test.h" #include static void check(int cond, const char *msg) { if (!cond) { printf("FAIL: %s\n", msg); __builtin_abort(); } } int main(void) { // 256-bit pattern split into 8 x 32-bit integers uint32_t a_data[8] = { 0x00000000, 0xFFFFFFFF, 0xAAAAAAAA, 0x55555555, 0x12345678, 0xFFFFFFFF, 0x0F0F0F0F, 0xF0F0F0F0 }; uint32_t b_data[8] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; __m256i a = _mm256_loadu_si256((const __m256i*)a_data); __m256i b = _mm256_loadu_si256((const __m256i*)b_data); __m256i r = __builtin_ia32_andnotsi256(a, b); uint32_t out[8]; _mm256_storeu_si256((__m256i*)out, r); // Expected: ~a & b == ~a (since b is all 1s) check(out[0] == ~a_data[0], "lane 0"); check(out[1] == ~a_data[1], "lane 1"); check(out[2] == ~a_data[2], "lane 2"); check(out[3] == ~a_data[3], "lane 3"); check(out[4] == ~a_data[4], "lane 4"); check(out[5] == ~a_data[5], "lane 5"); check(out[6] == ~a_data[6], "lane 6"); check(out[7] == ~a_data[7], "lane 7"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_andnpd.c000066400000000000000000000007131517770275000173130ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 3.0, 2.0 }; v2df c = __builtin_ia32_andnpd(a, b); // Print the raw bits as unsigned long long to see AND effect unsigned long long *p = (unsigned long long *)&c; printf("andpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(0, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_andnps.c000066400000000000000000000007741517770275000173410ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {0xFFFFFFFF, 0x00000000, 0xAAAAAAAA, 0x55555555}; v4sf b = {0x0F0F0F0F, 0xF0F0F0F0, 0xAAAAAAAA, 0xFFFFFFFF}; v4sf c = __builtin_ia32_andnps(a, b); for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08X\n", i, *(unsigned int*)&c[i]); } ASSERT(0, c[0]); ASSERT(-2147483648, c[1]); ASSERT(0, c[2]); ASSERT(0, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_andpd.c000066400000000000000000000007751517770275000171450ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); extern v2df __builtin_ia32_andpd(v2df a, v2df b); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 3.0, 2.0 }; v2df c = __builtin_ia32_andpd(a, b); // Print the raw bits as unsigned long long to see AND effect unsigned long long *p = (unsigned long long *)&c; printf("andpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(0, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_andps.c000066400000000000000000000010141517770275000171470ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {0xFFFFFFFF, 0x00000000, 0xAAAAAAAA, 0x55555555}; v4sf b = {0x0F0F0F0F, 0xF0F0F0F0, 0xAAAAAAAA, 0xFFFFFFFF}; v4sf c = __builtin_ia32_andps(a, b); for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08X\n", i, *(unsigned int*)&c[i]); } ASSERT(134217728, c[0]); ASSERT(0, c[1]); ASSERT(-2147483648, c[2]); ASSERT(1073741824, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_atomic_comprehensive.c000066400000000000000000000061121517770275000222510ustar00rootroot00000000000000#include "test.h" #include // GCC/Clang atomic memory models #define __ATOMIC_RELAXED 0 #define __ATOMIC_CONSUME 1 #define __ATOMIC_ACQUIRE 2 #define __ATOMIC_RELEASE 3 #define __ATOMIC_ACQ_REL 4 #define __ATOMIC_SEQ_CST 5 void test_int_variants() { int x = 100; int r; // fetch_add r = __atomic_fetch_add(&x, 10, __ATOMIC_SEQ_CST); ASSERT(100, r); ASSERT(110, x); // add_fetch r = __atomic_add_fetch(&x, 10, __ATOMIC_SEQ_CST); ASSERT(120, r); ASSERT(120, x); // fetch_sub r = __atomic_fetch_sub(&x, 20, __ATOMIC_SEQ_CST); ASSERT(120, r); ASSERT(100, x); // sub_fetch r = __atomic_sub_fetch(&x, 20, __ATOMIC_SEQ_CST); ASSERT(80, r); ASSERT(80, x); // fetch_and r = __atomic_fetch_and(&x, 0xF0, __ATOMIC_SEQ_CST); ASSERT(80, r); ASSERT(80, x); // and_fetch x = 0xFF; r = __atomic_and_fetch(&x, 0x0F, __ATOMIC_SEQ_CST); ASSERT(0x0F, r); ASSERT(0x0F, x); // fetch_or x = 1; r = __atomic_fetch_or(&x, 2, __ATOMIC_SEQ_CST); ASSERT(1, r); ASSERT(3, x); // or_fetch x = 1; r = __atomic_or_fetch(&x, 2, __ATOMIC_SEQ_CST); ASSERT(3, r); ASSERT(3, x); // fetch_xor x = 1; r = __atomic_fetch_xor(&x, 3, __ATOMIC_SEQ_CST); ASSERT(1, r); ASSERT(2, x); // xor_fetch x = 1; r = __atomic_xor_fetch(&x, 3, __ATOMIC_SEQ_CST); ASSERT(2, r); ASSERT(2, x); // fetch_nand x = 0x0F; r = __atomic_fetch_nand(&x, 0xF0, __ATOMIC_SEQ_CST); ASSERT(0x0F, r); ASSERT(~(0x0F & 0xF0), x); // nand_fetch x = 0x0F; r = __atomic_nand_fetch(&x, 0xF5, __ATOMIC_SEQ_CST); ASSERT(~(0x0F & 0xF5), r); ASSERT(~(0x0F & 0xF5), x); } void test_builtin_variants() { int x = 100; int r; r = __builtin_atomic_fetch_add(&x, 10, __ATOMIC_SEQ_CST); ASSERT(100, r); ASSERT(110, x); r = __builtin_atomic_fetch_sub(&x, 10, __ATOMIC_SEQ_CST); ASSERT(110, r); ASSERT(100, x); } void test_types() { char c = 10; __atomic_fetch_add(&c, 1, __ATOMIC_SEQ_CST); ASSERT(11, c); short s = 1000; __atomic_fetch_add(&s, 1, __ATOMIC_SEQ_CST); ASSERT(1001, s); long l = 1000000; __atomic_fetch_add(&l, 1, __ATOMIC_SEQ_CST); ASSERT(1000001, l); } void test_exchange() { int x = 10; int r = __atomic_exchange_n(&x, 20, __ATOMIC_SEQ_CST); ASSERT(10, r); ASSERT(20, x); int old_v = 20; bool success = __atomic_compare_exchange_n(&x, &old_v, 30, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); ASSERT(true, success); ASSERT(30, x); success = __atomic_compare_exchange_n(&x, &old_v, 40, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); ASSERT(false, success); ASSERT(30, old_v); ASSERT(30, x); } void test_load_store() { int x = 10; int r = __atomic_load_n(&x, __ATOMIC_SEQ_CST); ASSERT(10, r); __atomic_store_n(&x, 20, __ATOMIC_SEQ_CST); ASSERT(20, x); } int main(void) { test_int_variants(); test_builtin_variants(); test_types(); test_exchange(); test_load_store(); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_blendvpd.c000066400000000000000000000013001517770275000176360ustar00rootroot00000000000000#include "test.h" //#include typedef double v2df __attribute__((vector_size(16))); int main() { v2df X = { 1.0f, 2.0f }; v2df Y = {-1.0f, -2.0f }; v2df MASK = {-1.0f, 0.0f }; // negative selects Y, zero selects X v2df R = __builtin_ia32_blendvpd(X, Y, MASK); printf("X = {%.1f, %.1f}\n", X[0], X[1]); printf("Y = {%.1f, %.1f}\n", Y[0], Y[1]); printf("MASK = {%.1f, %.1f}\n", MASK[0], MASK[1]); printf("R = {%.1f, %.1f}\n", R[0], R[1]); if (R[0] == -1.0f && R[1] == 2.0f) { printf("blendvpd OK\n"); return 0; } printf("blendvpd FAIL\n"); return 1; } chibicc-1.0.24/test/builtin_blendvps.c000066400000000000000000000016011517770275000176610ustar00rootroot00000000000000#include "test.h" //#include typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf X = { 1.0f, 2.0f, 3.0f, 4.0f }; v4sf Y = {-1.0f, -2.0f, -3.0f, -4.0f }; v4sf MASK = {-1.0f, 0.0f, -1.0f, 0.0f }; // negative selects Y, zero selects X v4sf R = __builtin_ia32_blendvps(X, Y, MASK); printf("X = {%.1f, %.1f, %.1f, %.1f}\n", X[0], X[1], X[2], X[3]); printf("Y = {%.1f, %.1f, %.1f, %.1f}\n", Y[0], Y[1], Y[2], Y[3]); printf("MASK = {%.1f, %.1f, %.1f, %.1f}\n", MASK[0], MASK[1], MASK[2], MASK[3]); printf("R = {%.1f, %.1f, %.1f, %.1f}\n", R[0], R[1], R[2], R[3]); if (R[0] == -1.0f && R[1] == 2.0f && R[2] == -3.0f && R[3] == 4.0f) { printf("blendvps OK\n"); return 0; } printf("blendvps FAIL\n"); return 1; } chibicc-1.0.24/test/builtin_bswap.c000066400000000000000000000017521517770275000171670ustar00rootroot00000000000000 #include #include // For PRIx macros #include "test.h" int main() { // Example values uint16_t value16 = 0x1234; uint32_t value32 = 0x12345678; uint64_t value64 = 0x123456789ABCDEF0; // Perform byte-swapping using built-in functions uint16_t swapped16 = __builtin_bswap16(value16); uint32_t swapped32 = __builtin_bswap32(value32); uint64_t swapped64 = __builtin_bswap64(value64); // Print original and swapped values printf("Original 16-bit value: 0x%04" PRIx16 "\n", value16); printf("Swapped 16-bit value: 0x%04" PRIx16 "\n", swapped16); ASSERT(0x3412, swapped16); printf("Original 32-bit value: 0x%08" PRIx32 "\n", value32); printf("Swapped 32-bit value: 0x%08" PRIx32 "\n", swapped32); ASSERT(0x78563412, swapped32); printf("Original 64-bit value: 0x%016" PRIx64 "\n", value64); printf("Swapped 64-bit value: 0x%016" PRIx64 "\n", swapped64); ASSERT(0xf0debc9a78563412, swapped64); return 0; } chibicc-1.0.24/test/builtin_choose_expr.c000066400000000000000000000004651517770275000203710ustar00rootroot00000000000000 #include #include "test.h" #define ARRAY_SIZE(x) (__builtin_choose_expr(!__builtin_types_compatible_p(typeof(x), typeof(&*(x))), sizeof(x) / sizeof((x)[0]), (void)0)) int main() { int arr[10]; printf("Array size: %lu\n", ARRAY_SIZE(arr)); ASSERT(10, ARRAY_SIZE(arr)); return 0; } chibicc-1.0.24/test/builtin_choose_expr2.c000066400000000000000000000244171517770275000204560ustar00rootroot00000000000000 /* test_choose_expr.c * * Stress-tests __builtin_choose_expr for chibicc edge cases. * * GCC semantics (the spec chibicc must match): * __builtin_choose_expr(COND, EXPR_TRUE, EXPR_FALSE) * - COND must be an integer constant expression. * - Only the SELECTED branch is evaluated / type-checked / linked. * - The NOT-selected branch may be ill-typed or call an undefined * function without causing a compile or link error. * - The result is an lvalue when the selected branch is an lvalue. * * Compile (GCC — all should pass): * gcc -std=gnu11 -Wall -Wextra test_choose_expr.c -o test_choose_expr * ./test_choose_expr && echo "ALL PASSED" * * Compile (chibicc — exposes bugs): * chibicc test_choose_expr.c -o test_choose_expr * * Each test is labelled with the chibicc failure mode it targets. */ #include #include #include static int g_pass = 0; static int g_fail = 0; #define PASS(name) do { printf("PASS %s\n", name); g_pass++; } while(0) #define FAIL(name) do { printf("FAIL %s\n", name); g_fail++; } while(0) #define CHECK(name, cond) do { if(cond) PASS(name); else FAIL(name); } while(0) /* ================================================================== * * EDGE CASE 1: Unevaluated branch calls an undefined function. * * * * Buggy chibicc: emits a relocation for `undefined_fn` even when * * the false branch is not selected → linker error. * * ================================================================== */ int undefined_fn(void); /* declared, never defined — intentional */ static void test_unevaluated_branch_linkage(void) { int r = __builtin_choose_expr(1, 42, undefined_fn() /* must NOT be linked */ ); CHECK("EC1: unevaluated branch — no linker ref", r == 42); } /* ================================================================== * * EDGE CASE 2: Unevaluated branch is ill-typed. * * * * GCC accepts this: the non-selected branch is never type-checked. * * Buggy chibicc: may reject at parse/type-check time. * * ================================================================== */ static void test_ill_typed_branch(void) { int *p = (int[]){7}; /* false branch dereferences a void* without cast — ill-typed, but must be silently ignored because COND == 1. */ int r = __builtin_choose_expr(1, *p, *(void *)0 /* ill-typed; must not be evaluated */ ); CHECK("EC2: ill-typed false branch ignored", r == 7); } /* ================================================================== * * EDGE CASE 3: Result is an lvalue (the selected branch is a var). * * * * GCC: __builtin_choose_expr yields an lvalue when selected branch * * is an lvalue; you can take its address or assign through it. * * Buggy chibicc: may yield an rvalue copy, breaking &-of-result. * * ================================================================== */ static void test_lvalue_result(void) { int a = 10, b = 20; __builtin_choose_expr(1, a, b) = 99; /* assign through lvalue */ CHECK("EC3: lvalue result — assign through selected branch", a == 99 && b == 20); int *ptr = &__builtin_choose_expr(0, a, b); CHECK("EC3: lvalue result — address of false branch", ptr == &b); } /* ================================================================== * * EDGE CASE 4: Nested __builtin_choose_expr. * * * * Buggy chibicc: may mis-parse deeply nested ternary-like trees, * * or eagerly evaluate all inner nodes. * * ================================================================== */ static void test_nested(void) { int r = __builtin_choose_expr(1, __builtin_choose_expr(0, undefined_fn(), /* must NOT be linked (inner false, outer true→inner) */ 100 ), undefined_fn() /* must NOT be linked (outer false) */ ); CHECK("EC4: nested — only innermost selected branch linked", r == 100); } /* ================================================================== * * EDGE CASE 5: Condition is a sizeof / offsetof expression. * * * * COND must be an integer constant expression; sizeof qualifies. * * Buggy chibicc: may fail to constant-fold sizeof in the condition. * * ================================================================== */ static void test_sizeof_condition(void) { int r = __builtin_choose_expr( sizeof(int) == 4, 1, undefined_fn() ); CHECK("EC5: sizeof condition constant-folded", r == 1); int s = __builtin_choose_expr( sizeof(long) >= 4, (int)sizeof(long), -1 ); CHECK("EC5: sizeof in both condition and branch", s >= 4); } /* ================================================================== * * EDGE CASE 6: Condition is a __builtin_constant_p expression. * * * * Common OpenSSL/crypto pattern: dispatch on whether a value is a * * compile-time constant (e.g. to pick a constant-time path). * * Buggy chibicc: __builtin_constant_p may not return a constant * * expression suitable as a __builtin_choose_expr condition. * * ================================================================== */ static void test_constant_p_condition(void) { int r = __builtin_choose_expr( __builtin_constant_p(42), 1, /* 42 IS a constant — expect this */ 0 ); CHECK("EC6: __builtin_constant_p(literal) == 1", r == 1); volatile int v = 5; int s = __builtin_choose_expr( __builtin_constant_p(v), 1, 0 /* v is NOT a constant — expect this */ ); CHECK("EC6: __builtin_constant_p(volatile) == 0", s == 0); } /* ================================================================== * * EDGE CASE 7: Type of result matches selected branch, not the other.* * * * Unlike ?: which performs usual arithmetic conversions on BOTH arms, * * __builtin_choose_expr preserves the type of the selected branch * * exactly. Buggy chibicc: may apply conversions across both arms. * * ================================================================== */ static void test_type_preservation(void) { /* selected branch is (char)1; result type must be char, not int */ __typeof__(__builtin_choose_expr(1, (char)1, (long long)0)) x = 0; CHECK("EC7: result type is char (sizeof==1)", sizeof(x) == 1); /* selected branch is (long long)0; result type must be long long */ __typeof__(__builtin_choose_expr(0, (char)1, (long long)0)) y = 0; CHECK("EC7: result type is long long (sizeof==8)", sizeof(y) == 8); } /* ================================================================== * * EDGE CASE 8: __builtin_choose_expr inside a macro used as * * a function-like dispatch (the real OpenSSL pattern). * * * * Buggy chibicc: macro expansion + choose_expr interaction may * * cause the non-selected function pointer to be referenced. * * ================================================================== */ static int real_impl(int x) { return x * 3; } int fake_impl(int x); /* undefined — must not be linked */ #define USE_REAL 1 #define CRYPTO_DISPATCH(x) \ __builtin_choose_expr(USE_REAL, real_impl(x), fake_impl(x)) static void test_macro_dispatch(void) { int r = CRYPTO_DISPATCH(7); CHECK("EC8: macro dispatch — only selected impl linked", r == 21); } /* ================================================================== * * EDGE CASE 9: Condition is a compound constant expression * * involving bitwise arithmetic (common in crypto headers). * * ================================================================== */ #define FEATURE_FLAGS 0x03u static void test_bitwise_condition(void) { int r = __builtin_choose_expr( (FEATURE_FLAGS & 0x01u) != 0u, 11, undefined_fn() ); CHECK("EC9: bitwise constant condition", r == 11); int s = __builtin_choose_expr( (FEATURE_FLAGS & 0x04u) != 0u, undefined_fn(), 22 ); CHECK("EC9: bitwise constant condition (false path)", s == 22); } /* ================================================================== * * EDGE CASE 10: __builtin_choose_expr as an initialiser in a * * static / file-scope variable. * * * * Buggy chibicc: may refuse choose_expr outside function bodies, * * or fail to constant-fold it for static initialisation. * * ================================================================== */ static const int STATIC_VAL = __builtin_choose_expr(1, 0xAB, 0xCD); static void test_static_initialiser(void) { CHECK("EC10: choose_expr as static initialiser", STATIC_VAL == 0xAB); } /* ================================================================== * * main * * ================================================================== */ int main(void) { puts("=== __builtin_choose_expr edge-case suite ==="); test_unevaluated_branch_linkage(); test_ill_typed_branch(); test_lvalue_result(); test_nested(); test_sizeof_condition(); test_constant_p_condition(); test_type_preservation(); test_macro_dispatch(); test_bitwise_condition(); test_static_initialiser(); printf("\n%d passed, %d failed\n", g_pass, g_fail); return g_fail ? 1 : 0; } chibicc-1.0.24/test/builtin_choose_expr_assume_aligned.c000066400000000000000000000011031517770275000234170ustar00rootroot00000000000000#include "test.h" #undef __builtin_choose_expr int main(void) { int a[4] = {10, 20, 30, 40}; int x = 3; int y = 5; ASSERT(11, __builtin_choose_expr(1, 11, undeclared_symbol + 1)); ASSERT(7, __builtin_choose_expr(0, undeclared_symbol2 + 1, 7)); __builtin_choose_expr(1, x, y) = 9; ASSERT(9, x); ASSERT(5, y); int *p = __builtin_assume_aligned(a, 16); ASSERT(20, p[1]); int *q = __builtin_assume_aligned(a + 1, 16, 0); ASSERT(20, *q); LASSERT((long long)(a + 1), (long long)__builtin_assume_aligned(a + 1, 16, 0)); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_clflush.c000066400000000000000000000010761517770275000175120ustar00rootroot00000000000000#include // For _mm_clflush #include "test.h" // Simple test function void test_flush(void *p) { // GCC/Clang builtin form __builtin_ia32_clflush(p); // SSE2 intrinsic form _mm_clflush(p); } int main(void) { char buf[64]; // Write something so it’s in cache for (int i = 0; i < sizeof(buf); i++) buf[i] = (char)i; // Call flush test_flush(buf); // Do something else buf[0] = 42; printf("%d\n", buf[0]); ASSERT(42, buf[0]); ASSERT(1, buf[1]); return 0; } chibicc-1.0.24/test/builtin_clz.c000066400000000000000000000003561517770275000166420ustar00rootroot00000000000000 #include "test.h" int main() { int leading_zeros = __builtin_clz(8); // 8 is 1000 in binary, so leading_zeros is 28 on a 32-bit system printf("Leading zeros: %d\n", leading_zeros); ASSERT(28, leading_zeros); return 0; } chibicc-1.0.24/test/builtin_clzl.c000066400000000000000000000026131517770275000170140ustar00rootroot00000000000000 #include #include "test.h" void print_value(long value) { printf("Value in RAX: %ld\n", value); } // Function prototype for the test function unsigned int my_clzl(long x); int main() { // Test values long test_values[] = { 0, // Should return 63 (all bits are zeros) 1, // Should return 63 (1 << 63 has one leading zero) 0xFFFFFFFFFFFFFFFE, // Should return 0 (64-bit value with a single bit set) 0x8000000000000000, // Should return 0 (64-bit value with the highest bit set) 0x7FFFFFFFFFFFFFFF, // Should return 1 (all bits except the highest are set) 0xFFFFFFFFFFFFFFFF // Should return 0 (all bits are set) }; // Test the `__builtin_clzl` function for (int i = 0; i < sizeof(test_values) / sizeof(test_values[0]); i++) { long value = test_values[i]; unsigned int result = my_clzl(value); printf("my_clzl(%ld) = %u\n", value, result); if (i == 0 || i == 1) ASSERT(63, result ); else if (i == 2 || i == 3 || i == 5) ASSERT(0, result); else if (i == 4) ASSERT(1, result ); } return 0; } // Dummy implementation of `__builtin_clzl` for demonstration // In your real code, this would be replaced by the actual built-in function unsigned int my_clzl(long x) { return __builtin_clzl(x); } chibicc-1.0.24/test/builtin_cmpeqpd.c000066400000000000000000000007171517770275000175040ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df c = __builtin_ia32_cmpeqpd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpeqpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(-1, p[0]); ASSERT(0, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpeqps.c000066400000000000000000000011341517770275000175150ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {1.0f, 5.0f, 3.0f, 7.0f}; v4sf res = __builtin_ia32_cmpeqps(a, b); unsigned int *p = (unsigned int*)&res; // Each lane will be 0xffffffff if equal, else 0 printf("cmpeqps results:\n"); for (int i = 0; i < 4; i++) { printf("lane %d: 0x%x\n", i, p[i]); } ASSERT(-2147483648, res[0]); ASSERT(0, res[1]); ASSERT(-2147483648, res[2]); ASSERT(0, res[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpeqsd.c000066400000000000000000000007371517770275000175110ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); v2df my_cmpeqsd(v2df a, v2df b) { return __builtin_ia32_cmpeqsd(a, b); } int main() { v2df a = {1.0, 99.0}; v2df b = {1.0, 77.0}; v2df r = my_cmpeqsd(a, b); printf("Result: [%llx, %llx]\n", ((unsigned long long*)&r)[0], ((unsigned long long*)&r)[1]); ASSERT(-2147483648, r[0]); ASSERT(99, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpeqss.c000066400000000000000000000007751517770275000175320ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {1.0f, 0.0f, 0.0f, 0.0f}; v4sf c = __builtin_ia32_cmpeqss(a, b); printf("c[0] = 0x%X\n", *(unsigned int*)&c[0]); printf("c[1] = %f\n", c[1]); printf("c[2] = %f\n", c[2]); printf("c[3] = %f\n", c[3]); ASSERT(-2147483648, c[0]); ASSERT(2, c[1]); ASSERT(3, c[2]); ASSERT(4, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpgepd.c000066400000000000000000000012251517770275000174650ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df d = { 0.8, 3.5 }; v2df c = __builtin_ia32_cmpgepd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpgepd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(-1, p[0]); ASSERT(-1, p[1]); c = __builtin_ia32_cmpgepd(d, a); p = (unsigned long long *)&c; printf("cmpgepd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(0, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpgeps.c000066400000000000000000000014451517770275000175100ustar00rootroot00000000000000#include "test.h" #include typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 4.0f, 3.0f, 7.0f}; v4sf b = {1.0f, 2.0f, 3.5f, 5.0f}; // cmpgeps: compare a >= b for each element, result is mask (all bits set or zero) v4sf c = __builtin_ia32_cmpgeps(a, b); // Print results as integers to see the mask bits (0xFFFFFFFF or 0) uint32_t* mask = (uint32_t*)&c; printf("cmpgeps results:\n"); for (int i = 0; i < 4; i++) { printf("a[%d] >= b[%d] : %s (mask=0x%08x)\n", i, i, mask[i] == 0xFFFFFFFF ? "true" : "false", mask[i]); } ASSERT(-2147483648, c[0]); ASSERT(-2147483648, c[1]); ASSERT(0, c[2]); ASSERT(-2147483648, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpgtpd.c000066400000000000000000000012241517770275000175030ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df d = { 0.8, 3.5 }; v2df c = __builtin_ia32_cmpgtpd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpgtpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(-1, p[1]); c = __builtin_ia32_cmpgtpd(d, a); p = (unsigned long long *)&c; printf("cmpgtpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(0, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpgtps.c000066400000000000000000000011241517770275000175210ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 3.0f, 5.0f, 7.0f}; v4sf b = {2.0f, 3.0f, 4.0f, 8.0f}; v4sf res = __builtin_ia32_cmpgtps(a, b); unsigned int *p = (unsigned int*)&res; // Each lane will be 0xffffffff if a[i] > b[i], else 0 printf("cmpgtps results:\n"); for (int i = 0; i < 4; i++) { printf("lane %d: 0x%x\n", i, p[i]); } ASSERT(0, res[0]); ASSERT(0, res[1]); ASSERT(-2147483648, res[2]); ASSERT(0, res[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmplepd.c000066400000000000000000000012261517770275000174730ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df d = { 0.8, 1.5 }; v2df c = __builtin_ia32_cmplepd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmplepd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(-1, p[0]); ASSERT(0, p[1]); c = __builtin_ia32_cmplepd(d, a); p = (unsigned long long *)&c; printf("cmplepd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(-1, p[0]); ASSERT(-1, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpleps.c000066400000000000000000000011551517770275000175130ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 3.0f, 5.0f, 7.0f}; v4sf b = {2.0f, 3.0f, 4.0f, 8.0f}; v4sf res = __builtin_ia32_cmpleps(a, b); unsigned int *p = (unsigned int*)&res; // Each lane will be 0xffffffff if a[i] <= b[i], else 0 printf("cmpleps results:\n"); for (int i = 0; i < 4; i++) { printf("lane %d: 0x%x\n", i, p[i]); } ASSERT(-2147483648, res[0]); ASSERT(-2147483648, res[1]); ASSERT(0, res[2]); ASSERT(-2147483648, res[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmplesd.c000066400000000000000000000006311517770275000174750ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main() { v2df a = {1.0, 99.0}; v2df b = {1.0, 77.0}; v2df r = __builtin_ia32_cmplesd(a, b); printf("Result: [%llx, %llx]\n", ((unsigned long long*)&r)[0], ((unsigned long long*)&r)[1]); ASSERT(-2147483648, r[0]); ASSERT(99, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpless.c000066400000000000000000000011551517770275000175160ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.5f, 2.5f, 3.5f, 4.5f}; v4sf b = {1.5f, 2.0f, 4.0f, 5.0f}; v4sf c = __builtin_ia32_cmpless(a, b); printf("c[0] = 0x%X\n", *(unsigned int*)&c[0]); // expect 0xFFFFFFFF because 1.5 <= 1.5 printf("c[1] = %f\n", c[1]); // expect 2.5 (copied from a) printf("c[2] = %f\n", c[2]); // expect 3.5 printf("c[3] = %f\n", c[3]); // expect 4.5 ASSERT(-2147483648, c[0]); ASSERT(2, c[1]); ASSERT(3, c[2]); ASSERT(4, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpltpd.c000066400000000000000000000012251517770275000175110ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df d = { 0.8, 1.5 }; v2df c = __builtin_ia32_cmpltpd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpltpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(0, p[1]); c = __builtin_ia32_cmpltpd(d, a); p = (unsigned long long *)&c; printf("cmpltpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(-1, p[0]); ASSERT(-1, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpltps.c000066400000000000000000000011421517770275000175260ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 3.0f, 5.0f, 7.0f}; v4sf b = {2.0f, 3.0f, 4.0f, 8.0f}; v4sf res = __builtin_ia32_cmpltps(a, b); unsigned int *p = (unsigned int*)&res; // Each lane will be 0xffffffff if a[i] < b[i], else 0 printf("cmpltps results:\n"); for (int i = 0; i < 4; i++) { printf("lane %d: 0x%x\n", i, p[i]); } ASSERT(-2147483648, res[0]); ASSERT(0, res[1]); ASSERT(0, res[2]); ASSERT(-2147483648, res[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpltsd.c000066400000000000000000000006171517770275000175200ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main() { v2df a = {1.0, 99.0}; v2df b = {1.0, 77.0}; v2df r = __builtin_ia32_cmpltsd(a, b); printf("Result: [%llx, %llx]\n", ((unsigned long long*)&r)[0], ((unsigned long long*)&r)[1]); ASSERT(0, r[0]); ASSERT(99, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpltss.c000066400000000000000000000011501517770275000175300ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {2.0f, 2.0f, 2.0f, 2.0f}; v4sf c = __builtin_ia32_cmpltss(a, b); printf("c[0] = 0x%X\n", *(unsigned int*)&c[0]); // expect 0xFFFFFFFF because 1.0 < 2.0 printf("c[1] = %f\n", c[1]); // expect 2.0 (copied from a) printf("c[2] = %f\n", c[2]); // expect 3.0 printf("c[3] = %f\n", c[3]); // expect 4.0 ASSERT(-2147483648, c[0]); ASSERT(2, c[1]); ASSERT(3, c[2]); ASSERT(4, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpneqpd.c000066400000000000000000000007211517770275000176550ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df c = __builtin_ia32_cmpneqpd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpneqpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(-1, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpneqps.c000066400000000000000000000011631517770275000176750ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {1.0f, 0.0f, 3.0f, 5.0f}; // Perform vector comparison: not equal (cmpneqps) v4sf c = __builtin_ia32_cmpneqps(a, b); // Print results as int masks (0xffffffff for true, 0 for false) unsigned int *res = (unsigned int*)&c; for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08x\n", i, res[i]); } ASSERT(0, c[0]); ASSERT(-2147483648, c[1]); ASSERT(0, c[2]); ASSERT(-2147483648, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpneqsd.c000066400000000000000000000006201517770275000176560ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main() { v2df a = {1.0, 99.0}; v2df b = {1.0, 77.0}; v2df r = __builtin_ia32_cmpneqsd(a, b); printf("Result: [%llx, %llx]\n", ((unsigned long long*)&r)[0], ((unsigned long long*)&r)[1]); ASSERT(0, r[0]); ASSERT(99, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpneqss.c000066400000000000000000000011071517770275000176760ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {2.0f, 2.0f, 3.0f, 4.0f}; v4sf c = __builtin_ia32_cmpneqss(a, b); printf("cmpneqss result: %x %x %x %x\n", ((unsigned int*)&c)[0], ((unsigned int*)&c)[1], ((unsigned int*)&c)[2], ((unsigned int*)&c)[3]); // Expected: lowest uint is 0xFFFFFFFF (true), rest are 0 ASSERT(-2147483648, c[0]); ASSERT(2, c[1]); ASSERT(3, c[2]); ASSERT(4, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpngepd.c000066400000000000000000000012311517770275000176400ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df d = { 0.8, 3.5 }; v2df c = __builtin_ia32_cmpngepd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpngepd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(0, p[1]); c = __builtin_ia32_cmpngepd(d, a); p = (unsigned long long *)&c; printf("cmpngepd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(-1, p[0]); ASSERT(-1, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpngeps.c000066400000000000000000000010741517770275000176640ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 5.0f, 3.0f, 7.0f}; v4sf b = {2.0f, 4.0f, 3.0f, 8.0f}; // cmpngeps: !(a[i] >= b[i]) v4sf c = __builtin_ia32_cmpngeps(a, b); unsigned int *r = (unsigned int *)&c; printf("cmpngeps results:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08x\n", i, r[i]); } ASSERT(-2147483648, c[0]); ASSERT(0, c[1]); ASSERT(0, c[2]); ASSERT(-2147483648, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpngtpd.c000066400000000000000000000012321517770275000176600ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df d = { 0.8, 3.5 }; v2df c = __builtin_ia32_cmpngtpd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpngtpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(-1, p[0]); ASSERT(0, p[1]); c = __builtin_ia32_cmpngtpd(d, a); p = (unsigned long long *)&c; printf("cmpngtpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(-1, p[0]); ASSERT(-1, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpngtps.c000066400000000000000000000010461517770275000177020ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 5.0f, 3.0f, 7.0f}; v4sf b = {2.0f, 4.0f, 3.0f, 8.0f}; v4sf c = __builtin_ia32_cmpngtps(a, b); unsigned int *r = (unsigned int *)&c; printf("cmpngtps results:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08x\n", i, r[i]); } ASSERT(-2147483648, c[0]); ASSERT(0, c[1]); ASSERT(-2147483648, c[2]); ASSERT(-2147483648, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpnlepd.c000066400000000000000000000012301517770275000176440ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df d = { 0.8, 3.5 }; v2df c = __builtin_ia32_cmpnlepd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpnlepd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(-1, p[1]); c = __builtin_ia32_cmpnlepd(d, a); p = (unsigned long long *)&c; printf("cmpnlepd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(0, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpnleps.c000066400000000000000000000013331517770275000176670ustar00rootroot00000000000000#include "test.h" #include typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {1.0f, 1.5f, 3.5f, 4.0f}; // __builtin_ia32_cmpnleps returns a mask vector where // each element is 0xFFFFFFFF if !(a[i] <= b[i]) (i.e. a[i] > b[i]), // else 0x0. v4sf c = __builtin_ia32_cmpnleps(a, b); uint32_t *res = (uint32_t *)&c; printf("cmpnleps results:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08x => %s\n", i, res[i], res[i] ? "true" : "false"); } ASSERT(0, c[0]); ASSERT(-2147483648, c[1]); ASSERT(0, c[2]); ASSERT(0, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpnlesd.c000066400000000000000000000006201517770275000176510ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main() { v2df a = {1.0, 99.0}; v2df b = {1.0, 77.0}; v2df r = __builtin_ia32_cmpnlesd(a, b); printf("Result: [%llx, %llx]\n", ((unsigned long long*)&r)[0], ((unsigned long long*)&r)[1]); ASSERT(0, r[0]); ASSERT(99, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpnless.c000066400000000000000000000011501517770275000176670ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {3.0f, 3.0f, 4.0f, 5.0f}; v4sf b = {2.0f, 3.0f, 4.0f, 5.0f}; v4sf c = __builtin_ia32_cmpnless(a, b); printf("cmpnlessss result: %x %x %x %x\n", ((unsigned int*)&c)[0], ((unsigned int*)&c)[1], ((unsigned int*)&c)[2], ((unsigned int*)&c)[3]); // Expected lowest uint is 0xFFFFFFFF (true because 3.0 > 2.0) ASSERT(-2147483648, c[0]); ASSERT(3, c[1]); ASSERT(4, c[2]); ASSERT(5, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpnltpd.c000066400000000000000000000012311517770275000176640ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df d = { 0.8, 3.5 }; v2df c = __builtin_ia32_cmpnltpd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpnltpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(-1, p[0]); ASSERT(-1, p[1]); c = __builtin_ia32_cmpnltpd(d, a); p = (unsigned long long *)&c; printf("cmpnltpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(0, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpnltps.c000066400000000000000000000007671517770275000177200ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 4.0f, 3.0f, 6.0f}; v4sf b = {2.0f, 3.0f, 3.0f, 7.0f}; v4sf c = __builtin_ia32_cmpnltps(a, b); unsigned int *res = (unsigned int*)&c; for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08x\n", i, res[i]); } ASSERT(0, c[0]); ASSERT(-2147483648, c[1]); ASSERT(-2147483648, c[2]); ASSERT(0, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpnltsd.c000066400000000000000000000006321517770275000176730ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main() { v2df a = {1.0, 99.0}; v2df b = {1.0, 77.0}; v2df r = __builtin_ia32_cmpnltsd(a, b); printf("Result: [%llx, %llx]\n", ((unsigned long long*)&r)[0], ((unsigned long long*)&r)[1]); ASSERT(-2147483648, r[0]); ASSERT(99, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpnltss.c000066400000000000000000000010711517770275000177100ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {2.0f, 3.0f, 4.0f, 5.0f}; v4sf b = {1.0f, 3.0f, 4.0f, 5.0f}; v4sf c = __builtin_ia32_cmpnltss(a, b); printf("cmpnltss result: %x %x %x %x\n", ((unsigned int*)&c)[0], ((unsigned int*)&c)[1], ((unsigned int*)&c)[2], ((unsigned int*)&c)[3]); // Expected lowest uint is 0xFFFFFFFF (true because 2.0 >= 1.0) ASSERT(-2147483648, c[0]); ASSERT(3, c[1]); ASSERT(4, c[2]); ASSERT(5, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpordpd.c000066400000000000000000000007221517770275000176570ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df c = __builtin_ia32_cmpordpd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpordpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(-1, p[0]); ASSERT(-1, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpordps.c000066400000000000000000000012071517770275000176750ustar00rootroot00000000000000#include "test.h" #include typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, NAN, 3.0f, 4.0f}; v4sf b = {2.0f, 5.0f, NAN, 4.0f}; // cmpordps returns true (all bits set) if neither element is NaN, false (0) otherwise v4sf c = __builtin_ia32_cmpordps(a, b); unsigned int *r = (unsigned int *)&c; printf("cmpordps results:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08x\n", i, r[i]); } ASSERT(-2147483648, c[0]); ASSERT(0, c[1]); ASSERT(0, c[2]); ASSERT(-2147483648, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpordsd.c000066400000000000000000000006321517770275000176620ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main() { v2df a = {1.0, 99.0}; v2df b = {1.0, 77.0}; v2df r = __builtin_ia32_cmpordsd(a, b); printf("Result: [%llx, %llx]\n", ((unsigned long long*)&r)[0], ((unsigned long long*)&r)[1]); ASSERT(-2147483648, r[0]); ASSERT(99, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpordss.c000066400000000000000000000013101517770275000176730ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {0.0f / 0.0f, 5.0f, 6.0f, 7.0f}; // b[0] = NaN // cmpordss returns all bits set in lowest float if both are ordered (not NaN) v4sf res = __builtin_ia32_cmpordss(a, b); unsigned int *p = (unsigned int*)&res; printf("cmpordss result (lowest float mask): 0x%x\n", p[0]); // Expected: // p[0] == 0 if unordered (because b[0] is NaN) // Other lanes are undefined (only lowest lane is relevant) ASSERT(0, res[0]); ASSERT(2, res[1]); ASSERT(3, res[2]); ASSERT(4, res[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpunordpd.c000066400000000000000000000007241517770275000202240ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 1.0, 2.0 }; v2df c = __builtin_ia32_cmpunordpd(a, b); // Cast to unsigned long long to see raw comparison result bits unsigned long long *p = (unsigned long long *)&c; printf("cmpunordpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(0, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpunordps.c000066400000000000000000000012141517770275000202360ustar00rootroot00000000000000#include "test.h" #include typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, NAN, 3.0f, 4.0f}; v4sf b = {2.0f, 5.0f, NAN, 4.0f}; // cmpunordps returns true (all bits set) if either element is NaN, false (0) otherwise v4sf c = __builtin_ia32_cmpunordps(a, b); unsigned int *r = (unsigned int *)&c; printf("cmpunordps results:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08x\n", i, r[i]); } ASSERT(0, c[0]); ASSERT(-2147483648, c[1]); ASSERT(-2147483648, c[2]); ASSERT(0, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpunordsd.c000066400000000000000000000006221517770275000202240ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main() { v2df a = {1.0, 99.0}; v2df b = {1.0, 77.0}; v2df r = __builtin_ia32_cmpunordsd(a, b); printf("Result: [%llx, %llx]\n", ((unsigned long long*)&r)[0], ((unsigned long long*)&r)[1]); ASSERT(0, r[0]); ASSERT(99, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cmpunordss.c000066400000000000000000000013201517770275000202370ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {0.0f / 0.0f, 5.0f, 6.0f, 7.0f}; // b[0] = NaN // cmpunordss returns all bits set in lowest float if unordered (NaN involved) v4sf res = __builtin_ia32_cmpunordss(a, b); unsigned int *p = (unsigned int*)&res; printf("cmpunordss result (lowest float mask): 0x%x\n", p[0]); // Expected: // p[0] == 0xffffffff since b[0] is NaN // Other lanes are undefined (only lowest lane is relevant) ASSERT(-2147483648, res[0]); ASSERT(2, res[1]); ASSERT(3, res[2]); ASSERT(4, res[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comieq.c000066400000000000000000000007061517770275000173260ustar00rootroot00000000000000 #include "test.h" typedef float __v4sf __attribute__((vector_size(16))); int main(void) { __v4sf a = {4.0f, 3.0f, 2.0f, 1.0f}; __v4sf b = {4.0f, 3.0f, 2.0f, 1.0f}; // Compare the lowest float elements of a and b for equality int result = __builtin_ia32_comieq((__v4sf)a, (__v4sf)b); printf("Lowest elements are equal? %s\n", result ? "Yes" : "No"); ASSERT(1, result); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comige.c000066400000000000000000000005561517770275000173170ustar00rootroot00000000000000#include "test.h" typedef float __v4sf __attribute__((vector_size(16))); int main() { __v4sf a = {7.0f, 1.0f, 2.0f, 1.0f}; __v4sf b = {7.0f, 4.0f, 2.0f, 0.0f}; // Compare: returns int (from low float) int res = __builtin_ia32_comige(a, b); printf("Result: %d\n", res); ASSERT(1, res); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comigt.c000066400000000000000000000005561517770275000173360ustar00rootroot00000000000000#include "test.h" typedef float __v4sf __attribute__((vector_size(16))); int main() { __v4sf a = {5.0f, 1.0f, 2.0f, 1.0f}; __v4sf b = {7.0f, 4.0f, 2.0f, 0.0f}; // Compare: returns int (from low float) int res = __builtin_ia32_comigt(a, b); printf("Result: %d\n", res); ASSERT(0, res); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comile.c000066400000000000000000000005561517770275000173240ustar00rootroot00000000000000#include "test.h" typedef float __v4sf __attribute__((vector_size(16))); int main() { __v4sf a = {7.0f, 5.0f, 3.0f, 1.0f}; __v4sf b = {7.0f, 4.0f, 2.0f, 0.0f}; // Compare: returns int (from low float) int res = __builtin_ia32_comile(a, b); printf("Result: %d\n", res); ASSERT(1, res); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comilt.c000066400000000000000000000005561517770275000173430ustar00rootroot00000000000000#include "test.h" typedef float __v4sf __attribute__((vector_size(16))); int main() { __v4sf a = {8.0f, 5.0f, 3.0f, 1.0f}; __v4sf b = {7.0f, 4.0f, 2.0f, 0.0f}; // Compare: returns int (from low float) int res = __builtin_ia32_comilt(a, b); printf("Result: %d\n", res); ASSERT(0, res); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comineq.c000066400000000000000000000015711517770275000175050ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {1.0f, 3.0f, 3.0f, 5.0f}; v4sf c = {0.0f, 2.0f, 0.0f, 4.0f}; // Compare a and b: expect 0 for equal (index 0 and 2), 1 for not equal (index 1 and 3) int res1 = __builtin_ia32_comineq(a, b); printf("comineq(a, b) = %d (expected non-zero because a != b)\n", res1); // Compare a and c: expect non-zero because many elements differ int res2 = __builtin_ia32_comineq(a, c); printf("comineq(a, c) = %d (expected non-zero)\n", res2); // Compare a and a: expect zero because they are equal int res3 = __builtin_ia32_comineq(a, a); printf("comineq(a, a) = %d (expected zero)\n", res3); ASSERT(0, res1); ASSERT(1, res2); ASSERT(0, res3); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comisdeq.c000066400000000000000000000023151517770275000176530ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); int main(void) { __m128d v1 = {2.0, 1.0}; // [2.0, 1.0] __m128d v2 = {3.0, 1.0}; // [3.0, 1.0] __m128d v3 = {4.0, 2.0}; // [4.0, 2.0] __m128d vnan = {9.0, 0.0/0.0}; // NaN in low element int result = __builtin_ia32_comisdeq(v1, v2); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdeq(v1, v3); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdeq(vnan, v1); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdeq(v1, vnan); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdeq(vnan, vnan); printf("result = %d\n", result); ASSERT(1, result); // Only low element (index 0) is compared! // test_case(v1, v2, "Equal low elements (1.0 == 1.0)"); // test_case(v1, v3, "Unequal low elements (1.0 != 2.0)"); // test_case(vnan, v1, "NaN vs normal"); // test_case(v1, vnan, "Normal vs NaN"); // test_case(vnan, vnan, "NaN vs NaN"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comisdge.c000066400000000000000000000023131517770275000176370ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); int main(void) { __m128d v1 = {2.0, 1.0}; // [2.0, 1.0] __m128d v2 = {3.0, 1.0}; // [3.0, 1.0] __m128d v3 = {4.0, 2.0}; // [4.0, 2.0] __m128d vnan = {9.0, 0.0/0.0}; // NaN in low element int result = __builtin_ia32_comisdge(v1, v2); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdge(v1, v3); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdge(vnan, v1); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdge(v1, vnan); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdge(vnan, vnan); printf("result = %d\n", result); ASSERT(1, result); // Only low element (index 0) is compared! // test_case(v1, v2, "Equal low elements (1.0 == 1.0)"); // test_case(v1, v3, "Unequal low elements (1.0 != 2.0)"); // test_case(vnan, v1, "NaN vs normal"); // test_case(v1, vnan, "Normal vs NaN"); // test_case(vnan, vnan, "NaN vs NaN"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comisdgt.c000066400000000000000000000023131517770275000176560ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); int main(void) { __m128d v1 = {2.0, 1.0}; // [2.0, 1.0] __m128d v2 = {3.0, 1.0}; // [3.0, 1.0] __m128d v3 = {4.0, 2.0}; // [4.0, 2.0] __m128d vnan = {9.0, 0.0/0.0}; // NaN in low element int result = __builtin_ia32_comisdgt(v1, v2); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdgt(v1, v3); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdgt(vnan, v1); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdgt(v1, vnan); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdgt(vnan, vnan); printf("result = %d\n", result); ASSERT(0, result); // Only low element (index 0) is compared! // test_case(v1, v2, "Equal low elements (1.0 == 1.0)"); // test_case(v1, v3, "Unequal low elements (1.0 != 2.0)"); // test_case(vnan, v1, "NaN vs normal"); // test_case(v1, vnan, "Normal vs NaN"); // test_case(vnan, vnan, "NaN vs NaN"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comisdle.c000066400000000000000000000023131517770275000176440ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); int main(void) { __m128d v1 = {2.0, 1.0}; // [2.0, 1.0] __m128d v2 = {3.0, 1.0}; // [3.0, 1.0] __m128d v3 = {4.0, 2.0}; // [4.0, 2.0] __m128d vnan = {9.0, 0.0/0.0}; // NaN in low element int result = __builtin_ia32_comisdle(v1, v2); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdle(v1, v3); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdle(vnan, v1); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdle(v1, vnan); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdle(vnan, vnan); printf("result = %d\n", result); ASSERT(1, result); // Only low element (index 0) is compared! // test_case(v1, v2, "Equal low elements (1.0 == 1.0)"); // test_case(v1, v3, "Unequal low elements (1.0 != 2.0)"); // test_case(vnan, v1, "NaN vs normal"); // test_case(v1, vnan, "Normal vs NaN"); // test_case(vnan, vnan, "NaN vs NaN"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comisdlt.c000066400000000000000000000023131517770275000176630ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); int main(void) { __m128d v1 = {2.0, 1.0}; // [2.0, 1.0] __m128d v2 = {3.0, 1.0}; // [3.0, 1.0] __m128d v3 = {4.0, 2.0}; // [4.0, 2.0] __m128d vnan = {9.0, 0.0/0.0}; // NaN in low element int result = __builtin_ia32_comisdlt(v1, v2); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdlt(v1, v3); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdlt(vnan, v1); printf("result = %d\n", result); ASSERT(0, result); result = __builtin_ia32_comisdlt(v1, vnan); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdlt(vnan, vnan); printf("result = %d\n", result); ASSERT(0, result); // Only low element (index 0) is compared! // test_case(v1, v2, "Equal low elements (1.0 == 1.0)"); // test_case(v1, v3, "Unequal low elements (1.0 != 2.0)"); // test_case(vnan, v1, "NaN vs normal"); // test_case(v1, vnan, "Normal vs NaN"); // test_case(vnan, vnan, "NaN vs NaN"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comisdneq.c000066400000000000000000000023201517770275000200250ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); int main(void) { __m128d v1 = {2.0, 1.0}; // [2.0, 1.0] __m128d v2 = {3.0, 1.0}; // [3.0, 1.0] __m128d v3 = {4.0, 2.0}; // [4.0, 2.0] __m128d vnan = {9.0, 0.0/0.0}; // NaN in low element int result = __builtin_ia32_comisdneq(v1, v2); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdneq(v1, v3); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdneq(vnan, v1); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdneq(v1, vnan); printf("result = %d\n", result); ASSERT(1, result); result = __builtin_ia32_comisdneq(vnan, vnan); printf("result = %d\n", result); ASSERT(0, result); // Only low element (index 0) is compared! // test_case(v1, v2, "Equal low elements (1.0 == 1.0)"); // test_case(v1, v3, "Unequal low elements (1.0 != 2.0)"); // test_case(vnan, v1, "NaN vs normal"); // test_case(v1, vnan, "Normal vs NaN"); // test_case(vnan, vnan, "NaN vs NaN"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_comixx.c000066400000000000000000000045131517770275000173600ustar00rootroot00000000000000#include "test.h" // If you want to avoid xmmintrin.h, define the builtins manually: typedef float v4sf __attribute__((vector_size(16))); static inline int test_comieq(v4sf A, v4sf B) { return __builtin_ia32_comieq((v4sf)A, (v4sf)B); } static inline int test_comineq(v4sf A, v4sf B) { return __builtin_ia32_comineq((v4sf)A, (v4sf)B); } static inline int test_comile(v4sf A, v4sf B) { return __builtin_ia32_comile((v4sf)A, (v4sf)B); } static inline int test_comigt(v4sf A, v4sf B) { return __builtin_ia32_comigt((v4sf)A, (v4sf)B); } static inline int test_comilt(v4sf A, v4sf B) { return __builtin_ia32_comilt((v4sf)A, (v4sf)B); } int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {1.0f, 3.0f, 2.0f, 4.0f}; v4sf c = {1.0f/0.0f, 2.0f, 3.0f, 4.0f}; // c[0] = +inf to test NaN/unordered behavior printf("comieq (a, b): %d\n", test_comieq(a, b)); // expect 0 (not equal) ASSERT(1, test_comieq(a, b)); printf("comieq (a, a): %d\n", test_comieq(a, a)); // expect 1 (equal) ASSERT(1, test_comieq(a, a)); printf("comineq (a, b): %d\n", test_comineq(a, b)); // expect 1 (not equal) ASSERT(0, test_comineq(a, b)); printf("comineq (a, a): %d\n", test_comineq(a, a)); // expect 0 (equal) ASSERT(0, test_comineq(a, a)); printf("comile (a, b): %d\n", test_comile(a, b)); // expect 1 (1 <= 1) ASSERT(1, test_comile(a, b)); printf("comile (b, a): %d\n", test_comile(b, a)); // expect 0 (3 <= 1 false) ASSERT(1, test_comile(b, a)); printf("comile (a, c): %d\n", test_comile(a, c)); // behavior with +inf ASSERT(1, test_comile(a, c)); printf("comigt (a, b): %d\n", test_comigt(a, b)); // expect 0 (1 > 1 false) ASSERT(0, test_comigt(a, b)); printf("comigt (b, a): %d\n", test_comigt(b, a)); // expect 1 (3 > 1) ASSERT(0, test_comigt(b, a)); printf("comigt (a, c): %d\n", test_comigt(a, c)); // behavior with +inf printf("comilt (a, b): %d\n", test_comilt(a, b)); // expect 0 (1 < 1 false) ASSERT(0, test_comilt(a, b)); printf("comilt (b, a): %d\n", test_comilt(b, a)); // expect 0 (3 < 1 false) ASSERT(0, test_comilt(b, a)); printf("comilt (a, c): %d\n", test_comilt(a, c)); // behavior with +inf ASSERT(1, test_comilt(a, c)); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_crc32di.c000066400000000000000000000003431517770275000172770ustar00rootroot00000000000000#include "test.h" typedef unsigned long long u64; int main() { u64 crc = 0; u64 v = 0x1122334455667788ULL; u64 r = __builtin_ia32_crc32di(crc, v); LASSERT(594666396, r); printf("CRC32DI: %llu\n", r); } chibicc-1.0.24/test/builtin_crc32hi.c000066400000000000000000000003601517770275000173020ustar00rootroot00000000000000#include "test.h" typedef unsigned int u32; typedef unsigned short u16; int main() { u32 crc = 0x12345678; u16 v = 0xBEEF; u32 r = __builtin_ia32_crc32hi(crc, v); ASSERT(3615629532, r); printf("CRC32HI: %u\n", r); } chibicc-1.0.24/test/builtin_crc32qi.c000066400000000000000000000010351517770275000173130ustar00rootroot00000000000000#include "test.h" #include #include int main() { unsigned int r1 = __builtin_ia32_crc32qi(0u, 0x00); unsigned int r2 = __builtin_ia32_crc32qi(0u, 0xFF); unsigned int r3 = __builtin_ia32_crc32qi(0x12345678u, 0xAB); printf("r1 = %u\n", r1); // expected 0x00000000 printf("r2 = %u\n", r2); // expected 0x77073096 printf("r3 = %u\n", r3); // known CRC32 value ASSERT(0, r1); ASSERT(2910671697, r2); ASSERT(3230737929, r3); printf("crc32qi OK\n"); return 0; } chibicc-1.0.24/test/builtin_crc32si.c000066400000000000000000000003171517770275000173170ustar00rootroot00000000000000#include "test.h" typedef unsigned int u32; int main() { u32 crc = 0; u32 v = 0xDEADBEEF; u32 r = __builtin_ia32_crc32si(crc, v); ASSERT(161029396, r); printf("CRC32SI: %u\n", r); } chibicc-1.0.24/test/builtin_ctz.c000066400000000000000000000003411517770275000166440ustar00rootroot00000000000000 #include "test.h" int main() { int trailing_zeros = __builtin_ctz(16); // 16 is 10000 in binary, so trailing_zeros is 4 printf("Trailing zeros: %d\n", trailing_zeros); ASSERT(4, trailing_zeros); return 0; } chibicc-1.0.24/test/builtin_cvtdq2pd.c000066400000000000000000000007431517770275000176010ustar00rootroot00000000000000 #include "test.h" typedef int __v4si __attribute__((vector_size(16))); typedef double __v2df __attribute__((vector_size(16))); int main() { __v4si src = { 42, -100 , 80, -200}; // actually only low 64 bits used here __v2df result = __builtin_ia32_cvtdq2pd((__v4si)src); printf("result[0] = %f\n", result[0]); printf("result[1] = %f\n", result[1]); ASSERT(42, result[0]); ASSERT(-100, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtdq2ps.c000066400000000000000000000011741517770275000176170ustar00rootroot00000000000000 #include "test.h" typedef int __v4si __attribute__((vector_size(16))); typedef float __v4sf __attribute__((vector_size(16))); int main() { __v4si src = { 42, -100 , 80, -200}; // actually only low 64 bits used here __v4sf result = __builtin_ia32_cvtdq2ps((__v4si)src); printf("result[0] = %f\n", result[0]); printf("result[1] = %f\n", result[1]); printf("result[2] = %f\n", result[2]); printf("result[3] = %f\n", result[3]); ASSERT(42, result[0]); ASSERT(-100, result[1]); ASSERT(80, result[2]); ASSERT(-200, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtp2ips.c000066400000000000000000000017441517770275000176260ustar00rootroot00000000000000//#include #include "test.h" typedef int __m64 __attribute__((vector_size(8))); typedef float __m128 __attribute__((vector_size(16))); int main() { __m128 a = (__m128){100.0f, 200.0f, 300.0f, 400.0f}; // upper 2 will be kept __m64 b = (__m64){1, 2}; // lower 2 will be converted to float printf("a = %lld %lld\n", ((__int64_t *)&a)[0], ((__int64_t *)&a)[1]); int *p = (int *)&b; printf("b = %d %d\n", p[0], p[1]); // Correct: 1 2 ASSERT(1, p[0]); ASSERT(2, p[1]); float *p2 = (float *)&a; printf("a = %f %f %f %f\n", a[0], a[1], a[2], a[3]); ASSERT(100, a[0]); ASSERT(200, a[1]); ASSERT(300, a[2]); ASSERT(400, a[3]); __m128 result = __builtin_ia32_cvtpi2ps(a, b); float *f = (float *)&result; printf("%f %f %f %f\n", f[0], f[1], f[2], f[3]); ASSERT(1, f[0]); ASSERT(2, f[1]); ASSERT(300, f[2]); ASSERT(400, f[3]); return 0; } chibicc-1.0.24/test/builtin_cvtpd2dq.c000066400000000000000000000010761517770275000176010ustar00rootroot00000000000000 #include "test.h" typedef double v2df __attribute__((vector_size(16))); typedef int v4si __attribute__((vector_size(16))); v4si convert_double_to_int(v2df a) { return (v4si)__builtin_ia32_cvtpd2dq(a); } int main(void) { v2df a = { 1.5, -2.9 }; v4si b = convert_double_to_int(a); // Only first 2 elements contain results; rest are undefined/zero printf("Converted: %d %d %d %d\n", b[0], b[1], b[2], b[3]); ASSERT(2, b[0]); ASSERT(-3, b[1]); ASSERT(0, b[2]); ASSERT(0, b[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtpd2pi.c000066400000000000000000000007411517770275000176030ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); typedef int v2si __attribute__((vector_size(8))); // 2×32-bit ints in 64-bit MMX register v2si convert_double_to_mmx(v2df a) { return (v2si)__builtin_ia32_cvtpd2pi(a); } int main(void) { v2df a = { 3.8, -4.2 }; v2si b = convert_double_to_mmx(a); printf("Converted: %d %d\n", b[0], b[1]); ASSERT(4, b[0]); ASSERT(-4, b[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtpd2ps.c000066400000000000000000000007641517770275000176220ustar00rootroot00000000000000#include "test.h" typedef float __v4sf __attribute__((vector_size(16))); typedef double __v2df __attribute__((vector_size(16))); __v4sf test_cvtpd2ps(__v2df a) { return (__v4sf)__builtin_ia32_cvtpd2ps(a); } int main() { __v2df a = { 1.5, -2.25 }; __v4sf r = test_cvtpd2ps(a); printf("%f %f\n", r[0], r[1]); // upper 2 floats are undefined ASSERT(1, r[0]); ASSERT(-2, r[1]); ASSERT(0, r[2]); ASSERT(0, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtpi2pd.c000066400000000000000000000007541517770275000176070ustar00rootroot00000000000000#include "test.h" typedef int mm64 __attribute__((vector_size(8))); // MMX 64-bit typedef double v2df __attribute__((vector_size(16))); // 2 doubles v2df test_cvtpi2pd(mm64 a) { return __builtin_ia32_cvtpi2pd(a); } int main(void) { mm64 input = { 3, -2 }; // two 32-bit integers v2df output = test_cvtpi2pd(input); printf("%.1f %.1f\n", output[0], output[1]); ASSERT(3, output[0]); ASSERT(-2, output[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtpi2ps2.c000066400000000000000000000014411517770275000177020ustar00rootroot00000000000000#include #include "test.h" int main() { __m128 a = (__m128){100.0f, 200.0f, 300.0f, 400.0f}; // upper 2 will be kept __m64 b = (__m64){1, 2}; // lower 2 will be converted to float printf("a = %f %f %f %f\n", a[0], a[1], a[2], a[3]); ASSERT(100, a[0]); ASSERT(200, a[1]); ASSERT(300, a[2]); ASSERT(400, a[3]); int *p = (int *)&b; printf("b = %d %d\n", p[0], p[1]); // Correct: 1 2 ASSERT(1, p[0]); ASSERT(2, p[1]); float *p2 = (float *)&a; __m128 result = __builtin_ia32_cvtpi2ps(a, b); float *f = (float *)&result; printf("%f %f %f %f\n", f[0], f[1], f[2], f[3]); ASSERT(1, f[0]); ASSERT(2, f[1]); ASSERT(300, f[2]); ASSERT(400, f[3]); return 0; } chibicc-1.0.24/test/builtin_cvtps2dq.c000066400000000000000000000010441517770275000176130ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); typedef int int4 __attribute__((vector_size(16))); int main(void) { float4 a = {1.2f, 2.8f, -3.5f, 4.7f}; // Convert float4 to int4 (truncate) int4 b = __builtin_ia32_cvtps2dq(a); printf("a = {%.1f, %.1f, %.1f, %.1f}\n", a[0], a[1], a[2], a[3]); printf("b = {%d, %d, %d, %d}\n", b[0], b[1], b[2], b[3]); ASSERT(1, b[0]); ASSERT(3, b[1]); ASSERT(-4, b[2]); ASSERT(5, b[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtps2pd.c000066400000000000000000000007601517770275000176160ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); typedef double double2 __attribute__((vector_size(16))); int main(void) { float4 a = {1.5f, -2.25f, 5.4f, 7.8f}; // Convert two floats to two doubles double2 b = __builtin_ia32_cvtps2pd(a); printf("a = {%.2f, %.2f, %.2f, %.2f}\n", a[0], a[1], a[2], a[3]); printf("b = {%.2lf, %.2lf}\n", b[0], b[1]); ASSERT(1, b[0]); ASSERT(-2, b[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtps2pi.c000066400000000000000000000012121517770275000176140ustar00rootroot00000000000000#include "test.h" typedef float __m128 __attribute__((vector_size(16))); typedef int __m64 __attribute__((vector_size(8))); __m64 my_cvtps2pi(__m128 a) { return __builtin_ia32_cvtps2pi(a); } int main() { __m128 floats = {1.5f, 2.5f, 3.5f, 4.5f}; __m64 ints = my_cvtps2pi(floats); printf("floats =%f %f %f %f\n", floats[0], floats[1], floats[2], floats[3]); ASSERT(1, floats[0]); ASSERT(2, floats[1]); ASSERT(3, floats[2]); ASSERT(4, floats[3]); printf("Converted ints: %d %d\n", (int)ints[0], (int)ints[1]); ASSERT(2, (int)ints[0]); ASSERT(2, (int)ints[1]); return 0; } chibicc-1.0.24/test/builtin_cvtsd2si.c000066400000000000000000000006421517770275000176110ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); int main(void) { __m128d a = {42.75f, 37.8f}; // Convert double to int int b = __builtin_ia32_cvtsd2si(a); printf("a[0] = %.2lf, a[1] = %.2lf\n", a[0], a[1]); ASSERT(42, a[0]); ASSERT(37, a[1]); printf("b = %d\n", b); // Expected: 43 ASSERT(43, b); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtsd2si64.c000066400000000000000000000006541517770275000177660ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); int main(void) { __m128d a = {42.75f, 37.8f}; // Convert double to int long long b = __builtin_ia32_cvtsd2si64(a); printf("a[0] = %.2lf, a[1] = %.2lf\n", a[0], a[1]); ASSERT(42, a[0]); ASSERT(37, a[1]); printf("b = %lld\n", b); // Expected: 43 ASSERT(43, b); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtsd2ss.c000066400000000000000000000013401517770275000176170ustar00rootroot00000000000000#include "test.h" typedef double float2 __attribute__((vector_size(16))); typedef float float4 __attribute__((vector_size(16))); int main(void) { float2 src = {3.14159, 2.71828}; // 2 doubles float4 dst = {0.0f, 1.0f, 2.0f, 3.0f}; // 4 floats // Convert lowest double of src to float in lowest element of dst dst = __builtin_ia32_cvtsd2ss(dst, src); printf("dst = {%.6f, %.6f, %.6f, %.6f}\n", dst[0], dst[1], dst[2], dst[3]); // Expected output: // dst[0] = 3.141590 (converted from src[0]) // dst[1..3] unchanged: 1.0, 2.0, 3.0 ASSERT(3, dst[0]); ASSERT(1, dst[1]); ASSERT(2, dst[2]); ASSERT(3, dst[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtsi2sd.c000066400000000000000000000007661517770275000176200ustar00rootroot00000000000000#include "test.h" typedef double float2 __attribute__((vector_size(16))); int main(void) { float2 v = {0.0, 1.0}; // 2 doubles int x = 42; // Convert int x to double and store in the lowest element of v v = __builtin_ia32_cvtsi2sd(v, x); printf("v = {%.1f, %.1f}\n", v[0], v[1]); // Expected output: // v[0] = 42.0 (converted from x) // v[1] = 1.0 (unchanged) ASSERT(42, v[0]); ASSERT(1, v[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtsi642sd.c000066400000000000000000000007701517770275000177650ustar00rootroot00000000000000#include "test.h" typedef double float2 __attribute__((vector_size(16))); int main(void) { float2 v = {0.0, 1.0}; // 2 doubles int x = 42; // Convert int x to double and store in the lowest element of v v = __builtin_ia32_cvtsi642sd(v, x); printf("v = {%.1f, %.1f}\n", v[0], v[1]); // Expected output: // v[0] = 42.0 (converted from x) // v[1] = 1.0 (unchanged) ASSERT(42, v[0]); ASSERT(1, v[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtsi642ss.c000066400000000000000000000010351517770275000177770ustar00rootroot00000000000000#include "test.h" #include typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; int64_t b = 42; v4sf c = __builtin_ia32_cvtsi642ss(a, b); printf("c[0] = %f\n", c[0]); // should print 42.0 printf("c[1] = %f\n", c[1]); // should print 2.0 (unchanged) printf("c[2] = %f\n", c[2]); printf("c[3] = %f\n", c[3]); ASSERT(42, c[0]); ASSERT(2, c[1]); ASSERT(3, c[2]); ASSERT(4, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtss2iss.c000066400000000000000000000014111517770275000200060ustar00rootroot00000000000000#include "test.h" // Manually declare the builtin (no xmmintrin.h included) typedef float __v4sf __attribute__((vector_size(16))); __v4sf __builtin_ia32_cvtsi2ss(__v4sf a, int b); int main(void) { __v4sf vec = { 1.0f, 2.0f, 3.0f, 4.0f }; int val = 123; __v4sf result = __builtin_ia32_cvtsi2ss(vec, val); printf("Original vector first element: %.2f\n", vec[0]); printf("Inserted int as float: %.2f\n", result[0]); printf("Other elements unchanged: %.2f, %.2f, %.2f\n", result[1], result[2], result[3]); ASSERT(123, result[0]); ASSERT(1, vec[0]); if ((int)result[0] == val && result[1] == vec[1]) { puts("PASS"); return 0; } else { puts("FAIL"); return 1; } } chibicc-1.0.24/test/builtin_cvtss2sd.c000066400000000000000000000011041517770275000176150ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); // 4 floats typedef double v2df __attribute__((vector_size(16))); // 2 doubles int main(void) { v4sf a = { 3.5f, 99.0f, 0.0f, 0.0f }; // source float vector v2df b = { 1.25, 2.5 }; // destination double vector // Convert low float in `a` to double, replacing low double in `b` v2df res = __builtin_ia32_cvtss2sd(b, a); printf("result: %.10f %.10f\n", res[0], res[1]); ASSERT(3, res[0]); ASSERT(2, res[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtss2si.c000066400000000000000000000007741517770275000176360ustar00rootroot00000000000000#include "test.h" // Declare the builtin manually (so we don't need xmmintrin.h) typedef float v4si __attribute__((vector_size(16))); int main(void) { // Create a vector of 4 floats (matches __v4sf) v4si vec = { 42.5f, 2.0f, -3.0f, 99.0f }; // Convert the lowest element to int int result = __builtin_ia32_cvtss2si(vec); printf("Input[0] = %.2f -> int = %d\n", vec[0], result); ASSERT(42, vec[0]); ASSERT(42, result); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvtss2si64.c000066400000000000000000000011371517770275000200020ustar00rootroot00000000000000#include "test.h" // Declare the builtin manually without any headers typedef long long __m128; typedef float __v4sf __attribute__((vector_size(16))); int main(void) { // Create a vector of 4 floats (like __v4sf) __v4sf vec = { 123.456f, 2.0f, -3.0f, 99.0f }; // Convert the lowest float to 64-bit int __m128 result = __builtin_ia32_cvtss2si64(vec); printf("Input[0] = %.3f -> int64 = %lld\n", vec[0], result); if (result == 123) printf("PASS\n"); else printf("FAIL\n"); ASSERT(123, result); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvttpd2dq.c000066400000000000000000000011041517770275000177550ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); // 2 doubles typedef int v4si __attribute__((vector_size(16))); // 4 ints v4si test_truncate(v2df a) { return __builtin_ia32_cvttpd2dq(a); } int main(void) { v2df input = { 3.9, -2.7 }; // will truncate to {3, -2} v4si output = test_truncate(input); printf("%d %d %d %d\n", output[0], output[1], output[2], output[3]); ASSERT(3, output[0]); ASSERT(-2, output[1]); ASSERT(0, output[2]); ASSERT(0, output[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvttpd2pi.c000066400000000000000000000007611517770275000177710ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); // 2 doubles typedef int mm64 __attribute__((vector_size(8))); // MMX 64-bit mm64 test_cvttpd2pi(v2df a) { return __builtin_ia32_cvttpd2pi(a); } int main(void) { v2df input = { 3.9, -2.7 }; mm64 output = test_cvttpd2pi(input); int *p = (int*)&output; printf("%d %d\n", p[0], p[1]); // truncated values ASSERT(3, p[0]); ASSERT(-2, p[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvttps2dq.c000066400000000000000000000010451517770275000200000ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); typedef int int4 __attribute__((vector_size(16))); int main(void) { float4 a = {1.2f, 2.8f, -3.5f, 4.7f}; // Convert float4 to int4 (truncate) int4 b = __builtin_ia32_cvttps2dq(a); printf("a = {%.1f, %.1f, %.1f, %.1f}\n", a[0], a[1], a[2], a[3]); printf("b = {%d, %d, %d, %d}\n", b[0], b[1], b[2], b[3]); ASSERT(1, b[0]); ASSERT(2, b[1]); ASSERT(-3, b[2]); ASSERT(4, b[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvttps2pi.c000066400000000000000000000023761517770275000200140ustar00rootroot00000000000000#include "test.h" // Define __m64 as a 64-bit integer type to hold MMX registers typedef long long __m64; typedef float __v4sf __attribute__((vector_size(16))); typedef int __v2si __attribute__((vector_size(8))); int main(void) { // Create a vector of 4 floats (like __v4sf) __v4sf vec = { 123.9f, 456.7f, -789.5f, 0.0f }; // Convert the lowest two floats to packed 16-bit ints in MMX register __v2si result = __builtin_ia32_cvttps2pi(vec); // Since we cannot directly print __m64, cast it to unsigned 64-bit for printing unsigned long long packed = (unsigned long long)result; printf("Input floats: %.1f, %.1f\n", vec[0], vec[1]); printf("Packed 16-bit ints: 0x%016llx\n", packed); // Extract low and high 16-bit parts to check correctness short low = (short)(packed & 0xFFFF); short high = (short)((packed >> 16) & 0xFFFF); printf("Extracted 16-bit ints: %d, %d\n", low, high); int *res_ints = (int *)&result; printf("Extracted 32-bit ints: %d, %d\n", res_ints[0], res_ints[1]); ASSERT(123, res_ints[0]); ASSERT(456, res_ints[1]); printf("OK\n"); if (res_ints[0] == 123 && res_ints[1] == 456) { puts("PASS"); return 0; } else { puts("FAIL"); return 1; } } chibicc-1.0.24/test/builtin_cvttsd2si.c000066400000000000000000000006431517770275000177760ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); int main(void) { __m128d a = {42.75f, 37.8f}; // Convert double to int int b = __builtin_ia32_cvttsd2si(a); printf("a[0] = %.2lf, a[1] = %.2lf\n", a[0], a[1]); ASSERT(42, a[0]); ASSERT(37, a[1]); printf("b = %d\n", b); // Expected: 42 ASSERT(42, b); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvttsd2si64.c000066400000000000000000000006551517770275000201530ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); int main(void) { __m128d a = {42.75f, 37.8f}; // Convert double to int long long b = __builtin_ia32_cvttsd2si64(a); printf("a[0] = %.2lf, a[1] = %.2lf\n", a[0], a[1]); ASSERT(42, a[0]); ASSERT(37, a[1]); printf("b = %lld\n", b); // Expected: 42 ASSERT(42, b); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvttss2si.c000066400000000000000000000016551517770275000200210ustar00rootroot00000000000000#include "test.h" // Declare the builtin manually without any headers typedef long long __m128; typedef float __v4sf __attribute__((vector_size(16))); // A struct with a float member struct S { float f; }; int main(void) { // Create a vector of 4 floats (like __v4sf) __v4sf vec = { 123.456f, 2.0f, -3.0f, 99.0f }; // Convert the lowest float to 64-bit int __m128 result = __builtin_ia32_cvttss2si(vec); printf("Input[0] = %.3f -> int64 = %lld\n", vec[0], result); if (result == 123) printf("PASS\n"); else printf("FAIL\n"); ASSERT(123, result); struct S s = { 456.25f }; __v4sf member_vec = { s.f, 0.0f, 0.0f, 0.0f }; int result_member = __builtin_ia32_cvttss2si(member_vec); printf("Struct member float: %.2f -> int: %d\n", member_vec[0], result_member); ASSERT(456, result_member); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_cvttss2si64.c000066400000000000000000000016611517770275000201700ustar00rootroot00000000000000#include "test.h" // Declare the builtin manually without any headers typedef long long __m128; typedef float __v4sf __attribute__((vector_size(16))); // A struct with a float member struct S { float f; }; int main(void) { // Create a vector of 4 floats (like __v4sf) __v4sf vec = { 123.456f, 2.0f, -3.0f, 99.0f }; // Convert the lowest float to 64-bit int __m128 result = __builtin_ia32_cvttss2si64(vec); printf("Input[0] = %.3f -> int64 = %lld\n", vec[0], result); if (result == 123) printf("PASS\n"); else printf("FAIL\n"); ASSERT(123, result); struct S s = { 456.25f }; __v4sf member_vec = { s.f, 0.0f, 0.0f, 0.0f }; int result_member = __builtin_ia32_cvttss2si64(member_vec); printf("Struct member float: %.2f -> int: %d\n", member_vec[0], result_member); ASSERT(456, result_member); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_divss.c000066400000000000000000000011201517770275000171700ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf va = {6.0f, 3.3f, 4.4f, 5.5f}; v4sf vb = {2.0f, 6.7f, 2.6f, 7.5f}; v4sf vc = __builtin_ia32_divss(va, vb); float result = ((float*)&vc)[0]; printf("result = %f\n", result); // Expected: 6.0 / 2.0 = 3.0 // Check lowest element is correct (scalar div) ASSERT(3, result); // The other elements should be copied from the first vector (va) ASSERT(3, vc[0]); ASSERT(3, vc[1]); ASSERT(4, vc[2]); ASSERT(5, vc[3]); return 0; } chibicc-1.0.24/test/builtin_expect.c000066400000000000000000000011111517770275000173300ustar00rootroot00000000000000 #include "test.h" int main() { int x = 10; int lhs = 0; int rhs = 0; if (__builtin_expect(x == 10, 1)) { printf("Expected branch\n"); } else { printf("Unexpected branch\n"); ASSERT(0, 1); // This should not happen } if (__builtin_expect(x == 5, 1)) { printf("Expected branch 2\n"); ASSERT(0, 1); // This should not happen } else { printf("Unexpected branch 2\n"); } int ret = __builtin_expect((lhs = 7), (rhs = 9)); ASSERT(7, ret); ASSERT(7, lhs); ASSERT(9, rhs); return 0; } chibicc-1.0.24/test/builtin_frame_address.c000066400000000000000000000012621517770275000206460ustar00rootroot00000000000000#include "test.h" #include int main() { void *f0 = __builtin_frame_address(0); printf("%p\n", f0); void *f1 = __builtin_frame_address(1); printf("%p\n", f1); void *f2 = __builtin_frame_address(2); printf("%p\n", f2); void *f3 = __builtin_frame_address(3); printf("%p\n", f3); bool x = false; printf("Frame address (level 0): %p\n", f0); x = f0; ASSERT(1, x); printf("Frame address (level 1): %p\n", f1); x = f1; ASSERT(1, x); printf("Frame address (level 2): %p\n", f2); x = f2; ASSERT(1, x); printf("Frame address (level 3): %p\n", f3); x = f3; ASSERT(0, x); }chibicc-1.0.24/test/builtin_frame_address2.c000066400000000000000000000012631517770275000207310ustar00rootroot00000000000000#include "test.h" #include void test0() { bool x = false; printf("frame_address(0) = %p\n", __builtin_frame_address(0)); x = __builtin_frame_address(0); ASSERT(1, x);} void test1() { bool x = false; printf("frame_address(1) = %p\n", __builtin_frame_address(1)); x = __builtin_frame_address(1); ASSERT(1, x);} void test2() { bool x = false; printf("frame_address(2) = %p\n", __builtin_frame_address(2)); x = __builtin_frame_address(2); ASSERT(1, x);} void test3() { bool x = false; printf("frame_address(3) = %p\n", __builtin_frame_address(3)); x = __builtin_frame_address(3); ASSERT(1, x);} int main() { test0(); test1(); test2(); test3(); return 0; }chibicc-1.0.24/test/builtin_frame_address3.c000066400000000000000000000013701517770275000207310ustar00rootroot00000000000000#include "test.h" #include void print_frame_addresses(const char *label) { void *f0 = __builtin_frame_address(0); void *f1 = __builtin_frame_address(1); void *f2 = __builtin_frame_address(2); bool x = false; printf("%s f0 = %p\n", label, f0); x = f0; ASSERT(1, x); printf("%s f1 = %p\n", label, f1); x = f1; ASSERT(1, x); printf("%s f2 = %p\n", label, f2); x = f2; ASSERT(1, x); } void inner() { print_frame_addresses("inner"); } void outer() { print_frame_addresses("outer-before"); inner(); print_frame_addresses("outer-after"); } int main() { print_frame_addresses("main-before"); outer(); print_frame_addresses("main-after"); }chibicc-1.0.24/test/builtin_ia32.c000066400000000000000000000003661517770275000166110ustar00rootroot00000000000000#include "test.h" void test(void) { __builtin_ia32_pause(); __builtin_ia32_lfence(); __builtin_ia32_mfence(); __builtin_ia32_sfence(); __builtin_ia32_emms(); } int main() { test(); printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_ia32_addsubps.c000066400000000000000000000026601517770275000204750ustar00rootroot00000000000000#include #include #include #include "test.h" int main() { // Initialize two vectors __m128 a = _mm_set_ps(1.0f, 2.0f, 3.0f, 4.0f); // [4,3,2,1] __m128 b = _mm_set_ps(10.0f, 20.0f, 30.0f, 40.0f); // [40,30,20,10] // Call the intrinsic __m128 result = __builtin_ia32_addsubps(a, b); // Extract and print each float float *f = (float*)&result; printf("Result: %f %f %f %f\n", f[0], f[1], f[2], f[3]); // Expected behavior: alternates add/sub // result[0] = a[0] + b[0] = 4 + 40 = 44 // result[1] = a[1] - b[1] = 3 - 30 = -27 // result[2] = a[2] + b[2] = 2 + 20 = 22 // result[3] = a[3] - b[3] = 1 - 10 = -9 __m128 hsub_result = __builtin_ia32_hsubps(a, b); float *hsub_f = (float*)&hsub_result; printf("HSUB result: %f %f %f %f\n", hsub_f[0], hsub_f[1], hsub_f[2], hsub_f[3]); // Horizontal add __m128 hadd_result = __builtin_ia32_haddps(a, b); float *hadd_f = (float*)&hadd_result; printf("HADD result: %f %f %f %f\n", hadd_f[0], hadd_f[1], hadd_f[2], hadd_f[3]); printf("OK\n"); ASSERT(-36, result[0]); ASSERT(33, result[1]); ASSERT(-18, result[2]); ASSERT(11, result[3]); ASSERT(1, hsub_f[0]); ASSERT(1, hsub_f[1]); ASSERT(10, hsub_f[2]); ASSERT(10, hsub_f[3]); ASSERT(7, hadd_f[0]); ASSERT(3, hadd_f[1]); ASSERT(70, hadd_f[2]); ASSERT(30, hadd_f[3]); return 0; } chibicc-1.0.24/test/builtin_isnan.c000066400000000000000000000021251517770275000171560ustar00rootroot00000000000000 #include #include "test.h" int main() { // Test with NaN (Not a Number) double nan_value = 0.0 / 0.0; float nan_value_f = 0.0f / 0.0f; int a = 0, b = 0, c = 0, d = 0; if (__builtin_isnan(nan_value)) { printf("nan_value is NaN (double)\n"); a = 1; } else { printf("nan_value is NOT NaN (double)\n"); } if (__builtin_isnan(nan_value_f)) { printf("nan_value_f is NaN (float)\n"); b = 1; } else { printf("nan_value_f is NOT NaN (float)\n"); } // Test with a regular number double regular_value = 123.456; float regular_value_f = 123.456f; if (__builtin_isnan(regular_value)) { printf("regular_value is NaN (double)\n"); } else { printf("regular_value is NOT NaN (double)\n"); c = 1; } if (__builtin_isnan(regular_value_f)) { printf("regular_value_f is NaN (float)\n"); } else { printf("regular_value_f is NOT NaN (float)\n"); d = 1; } ASSERT(1, a); ASSERT(1, b); ASSERT(1, c); ASSERT(1, d); return 0; } chibicc-1.0.24/test/builtin_ldmxcsr.c000066400000000000000000000013511517770275000175220ustar00rootroot00000000000000#include "test.h" #include int main(void) { // Read the current MXCSR uint32_t mxcsr = __builtin_ia32_stmxcsr(); printf("Initial MXCSR: 0x%08x\n", mxcsr); // Prepare a new MXCSR value (example: mask all exceptions) uint32_t new_mxcsr = mxcsr | (1 << 15); // Load the new value __builtin_ia32_ldmxcsr(new_mxcsr); // Read back uint32_t mxcsr_after = __builtin_ia32_stmxcsr(); printf("After load MXCSR: 0x%08x\n", mxcsr_after); //restore back // Load the new value __builtin_ia32_ldmxcsr(mxcsr); printf("Restored MXCSR: 0x%08x\n", mxcsr); ASSERT(0x00001f80, mxcsr); ASSERT(0x00009f80, mxcsr_after); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_loadhpd.c000066400000000000000000000006751517770275000174710ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); // 2 doubles int main(void) { double2 a = {1.0, 2.0}; // xmm0: low=1.0, high=2.0 double b = 99.0; double2 r = __builtin_ia32_loadhpd(a, &b); printf("r[0] = %.1f\n", r[0]); // from low of a (1.0) printf("r[1] = %.1f\n", r[1]); // from low of b (3.0) ASSERT(1, r[0]); ASSERT(99, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_loadhps.c000066400000000000000000000011501517770275000174750ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); typedef float v2sf __attribute__((vector_size(8))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v2sf p = {5.0f, 6.0f}; v4sf c = __builtin_ia32_loadhps(a, &p); printf("Result vector:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, ((float*)&c)[i]); } // Expected: // c[0] = 1.0 // c[1] = 2.0 // c[2] = 5.0 // c[3] = 6.0 ASSERT(1, c[0]); ASSERT(2, c[1]); ASSERT(5, c[2]); ASSERT(6, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_loadlpd.c000066400000000000000000000006751517770275000174750ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); // 2 doubles int main(void) { double2 a = {1.0, 2.0}; // xmm0: low=1.0, high=2.0 double b = 99.0; double2 r = __builtin_ia32_loadlpd(a, &b); printf("r[0] = %.1f\n", r[0]); // from low of a (1.0) printf("r[1] = %.1f\n", r[1]); // from low of b (3.0) ASSERT(99, r[0]); ASSERT(2, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_loadlps.c000066400000000000000000000011501517770275000175010ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); typedef float v2sf __attribute__((vector_size(8))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v2sf p = {5.0f, 6.0f}; v4sf c = __builtin_ia32_loadlps(a, &p); printf("Result vector:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, ((float*)&c)[i]); } // Expected: // c[0] = 1.0 // c[1] = 2.0 // c[2] = 5.0 // c[3] = 6.0 ASSERT(5, c[0]); ASSERT(6, c[1]); ASSERT(3, c[2]); ASSERT(4, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_maskmovdqu.c000066400000000000000000000014511517770275000202360ustar00rootroot00000000000000#include "test.h" #include typedef unsigned char uchar16 __attribute__((vector_size(16))); typedef char char16 __attribute__((vector_size(16))); int main() { char16 src = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P'}; char16 mask = {0x80,0,0x80,0,0x80,0,0x80,0,0x80,0,0x80,0,0x80,0,0x80,0}; unsigned char dest[16]; memset(dest, '.', sizeof(dest)); __builtin_ia32_maskmovdqu(src, mask, dest); for (int i = 0; i < 16; i++) putchar(dest[i]); putchar('\n'); ASSERT('A', dest[0]); ASSERT('C', dest[2]); ASSERT('E', dest[4]); ASSERT('G', dest[6]); ASSERT('I', dest[8]); ASSERT('K', dest[10]); ASSERT('M', dest[12]); ASSERT('O', dest[14]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_maskmovq.c000066400000000000000000000010551517770275000177050ustar00rootroot00000000000000#include "test.h" // test/builtin_maskmovq.c typedef char __m64 __attribute__((__vector_size__(8))); __m64 a = { 1, 2 , 3, 4, 5, 6, 7, 8}; __m64 m = { -1, 0 , -1, 0, -1, 0, -1, 0}; char dst[8]; int main() { __builtin_ia32_maskmovq(a, m, dst); for (int i = 0; i < 8; i++) printf("%d ", dst[i]); ASSERT(1, dst[0]); ASSERT(0, dst[1]); ASSERT(3, dst[2]); ASSERT(0, dst[3]); ASSERT(5, dst[4]); ASSERT(0, dst[5]); ASSERT(7, dst[6]); ASSERT(0, dst[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_maxpd.c000066400000000000000000000005051517770275000171570ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 3.0, 2.0 }; v2df c = __builtin_ia32_maxpd(a, b); printf("min: %f %f\n", c[0], c[1]); ASSERT(3, c[0]); ASSERT(4, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_maxps.c000066400000000000000000000006721517770275000172030ustar00rootroot00000000000000#include "test.h" typedef float __v4sf __attribute__((vector_size(16))); int main(void) { __v4sf a= {1.5f, 2.0f, 3.0f, 4.0f}; __v4sf b = {3.5f, 1.0f, 5.0f, 6.0f}; __v4sf out = __builtin_ia32_maxps(a, b); printf("Result: %f %f %f %f\n", out[0], out[1], out[2], out[3]); ASSERT(3, out[0]); ASSERT(2, out[1]); ASSERT(5, out[2]); ASSERT(6, out[3]); printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_maxsd.c000066400000000000000000000005051517770275000171620ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 3.0, 2.0 }; v2df c = __builtin_ia32_maxsd(a, b); printf("max: %f %f\n", c[0], c[1]); ASSERT(3, c[0]); ASSERT(4, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_maxss.c000066400000000000000000000006721517770275000172060ustar00rootroot00000000000000#include "test.h" typedef float __v4sf __attribute__((vector_size(16))); int main(void) { __v4sf a= {1.5f, 2.0f, 3.0f, 4.0f}; __v4sf b = {3.5f, 1.0f, 5.0f, 6.0f}; __v4sf out = __builtin_ia32_maxss(a, b); printf("Result: %f %f %f %f\n", out[0], out[1], out[2], out[3]); ASSERT(3, out[0]); ASSERT(2, out[1]); ASSERT(3, out[2]); ASSERT(4, out[3]); printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_memcpy.c000066400000000000000000000004561517770275000173450ustar00rootroot00000000000000 #include #include "test.h" int main() { char src[] = "Hello, world!"; char dest[20]; __builtin_memcpy(dest, src, strlen(src) + 1); // Use memcpy instead of __builtin_memcpy printf("Copied string: %s\n", dest); ASSERT(1, !strcmp(dest, "Hello, world!")); return 0; } chibicc-1.0.24/test/builtin_memory.c000066400000000000000000000025661517770275000173670ustar00rootroot00000000000000#include #include #include int main() { char buf1[100]; char buf2[100]; char *res; // Test memcpy return value strcpy(buf1, "hello world"); res = __builtin_memcpy(buf2, buf1, 12); if (res != buf2) { printf("memcpy return value failed: expected %p, got %p\n", buf2, res); exit(1); } if (strcmp(buf2, "hello world") != 0) { printf("memcpy content failed\n"); exit(1); } // Test memset return value res = __builtin_memset(buf1, 'x', 5); if (res != buf1) { printf("memset return value failed: expected %p, got %p\n", buf1, res); exit(1); } if (memcmp(buf1, "xxxxx", 5) != 0) { printf("memset content failed\n"); exit(1); } // Test memset value truncation (should use unsigned char cast of value) __builtin_memset(buf1, 0x12345678, 5); if ((unsigned char)buf1[0] != 0x78) { printf("memset value truncation failed: expected 0x78, got 0x%x\n", (unsigned char)buf1[0]); exit(1); } // Test chained calls // memset returns buf1, which is passed to memcpy as dest // memcpy returns buf1 res = __builtin_memcpy(__builtin_memset(buf1, 'y', 10), "123", 4); if (res != buf1) { printf("chained return value failed\n"); exit(1); } if (memcmp(buf1, "123\0yyyyyy", 10) != 0) { printf("chained content failed: %s\n", buf1); exit(1); } printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_memset.c000066400000000000000000000003571517770275000173450ustar00rootroot00000000000000#include "test.h" int main() { char buffer[10]; __builtin_memset(buffer, 'A', sizeof(buffer)); for (int i = 0; i < 10; i++) { putchar(buffer[i]); ASSERT('A', buffer[i]); } putchar('\n'); return 0; } chibicc-1.0.24/test/builtin_minpd.c000066400000000000000000000005261517770275000171600ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 3.0, 2.0 }; v2df c = __builtin_ia32_minpd(a, b); printf("min: %f %f\n", c[0], c[1]); // expect 1.0 2.0 ASSERT(1, c[0]); ASSERT(2, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_minps.c000066400000000000000000000007511517770275000171770ustar00rootroot00000000000000#include "test.h" typedef float __v4sf __attribute__((vector_size(16))); int main() { __v4sf a = {3.0f, 100.0f, 200.0f, 300.0f}; __v4sf b = {5.0f, 400.0f, 500.0f, 600.0f}; __v4sf res = __builtin_ia32_minps(a, b); float *f = (float *)&res; for (int i = 0; i < 4; i++) printf("res[%d] = %f\n", i, f[i]); ASSERT(3, res[0]); ASSERT(100, res[1]); ASSERT(200, res[2]); ASSERT(300, res[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_minsd.c000066400000000000000000000005261517770275000171630ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 3.0, 2.0 }; v2df c = __builtin_ia32_minsd(a, b); printf("min: %f %f\n", c[0], c[1]); // expect 1.0 2.0 ASSERT(1, c[0]); ASSERT(4, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_minss.c000066400000000000000000000007511517770275000172020ustar00rootroot00000000000000#include "test.h" typedef float __v4sf __attribute__((vector_size(16))); int main() { __v4sf a = {3.0f, 100.0f, 200.0f, 300.0f}; __v4sf b = {5.0f, 400.0f, 500.0f, 600.0f}; __v4sf res = __builtin_ia32_minss(a, b); float *f = (float *)&res; for (int i = 0; i < 4; i++) printf("res[%d] = %f\n", i, f[i]); ASSERT(3, res[0]); ASSERT(100, res[1]); ASSERT(200, res[2]); ASSERT(300, res[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movhlps.c000066400000000000000000000013151517770275000175360ustar00rootroot00000000000000#include "test.h" #include typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {5.0f, 6.0f, 7.0f, 8.0f}; // movhlps moves the upper half of b into the upper half of a v4sf c = __builtin_ia32_movhlps(a, b); printf("Result vector:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, ((float*)&c)[i]); } // Expected output: // c[0] = 1.0 (from a[0]) // c[1] = 2.0 (from a[1]) // c[2] = 7.0 (from b[2]) // c[3] = 8.0 (from b[3]) ASSERT(7, c[0]); ASSERT(8, c[1]); ASSERT(3, c[2]); ASSERT(4, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movlhps.c000066400000000000000000000012301517770275000175320ustar00rootroot00000000000000#include "test.h" #include typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {5.0f, 6.0f, 7.0f, 8.0f}; // movlhps moves low 64 bits (2 floats) from b into high 64 bits of a v4sf c = __builtin_ia32_movlhps(a, b); printf("Result vector:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, c[i]); } // Expected: // c[0] = a[0] = 1.0 // c[1] = a[1] = 2.0 // c[2] = b[0] = 5.0 // c[3] = b[1] = 6.0 ASSERT(1, c[0]); ASSERT(2, c[1]); ASSERT(5, c[2]); ASSERT(6, c[3]); return 0; } chibicc-1.0.24/test/builtin_movmskpd.c000066400000000000000000000010201517770275000176770ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); // 2 doubles typedef float v4sf __attribute__((vector_size(16))); int main(void) { v4sf vec = { 1.0f, -2.0f, 3.0f, -4.0f }; // movmskps should produce a 4-bit mask of sign bits // bit0 = sign of vec[0], bit1 = sign of vec[1], etc. double mask = __builtin_ia32_movmskps(vec); printf("vec[0] = %.1f\n", vec[0]); printf("vec[1] = %.1f\n", vec[1]); ASSERT(10, mask); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movmskps.c000066400000000000000000000015061517770275000177270ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); // Declare the builtin directly int __builtin_ia32_movmskps(v4sf a); int main(void) { v4sf vec = { 1.0f, -2.0f, 3.0f, -4.0f }; // movmskps should produce a 4-bit mask of sign bits // bit0 = sign of vec[0], bit1 = sign of vec[1], etc. int mask = __builtin_ia32_movmskps(vec); printf("Vector: %f %f %f %f\n", vec[0], vec[1], vec[2], vec[3]); printf("Mask: %d (binary %04b)\n", mask, mask); // Expected: // vec[0] > 0 => bit0 = 0 // vec[1] < 0 => bit1 = 1 // vec[2] > 0 => bit2 = 0 // vec[3] < 0 => bit3 = 1 // So mask = 0b1010 = 10 ASSERT(10, mask); ASSERT(1, vec[0]); ASSERT(-2, vec[1]); ASSERT(3, vec[2]); ASSERT(-4, vec[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movntdq.c000066400000000000000000000007041517770275000175370ustar00rootroot00000000000000#include "test.h" #include typedef long long v2di __attribute__((vector_size(16))); int main() { v2di value = {0x1122334455667788LL, 0x99AABBCCDDEEFF00LL}; v2di mem; __builtin_ia32_movntdq(&mem, value); printf("mem[0] = 0x%llX\n", mem[0]); printf("mem[1] = 0x%llX\n", mem[1]); LASSERT(0x1122334455667788, mem[0]); LASSERT(0x99AABBCCDDEEFF00, mem[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movntdqa.c000066400000000000000000000007741517770275000177070ustar00rootroot00000000000000#include "test.h" typedef long long v2di __attribute__((vector_size(16))); int main() { v2di src = { 0x1122334455667788LL, 0xAABBCCDDEEFF0011LL }; // Load using movntdqa v2di r = __builtin_ia32_movntdqa(&src); printf("r[0] = 0x%llx\n", r[0]); printf("r[1] = 0x%llx\n", r[1]); if (r[0] == src[0] && r[1] == src[1]) { printf("movntdqa OK\n"); } else { printf("movntdqa FAIL\n"); } ASSERT(r[0], src[0]); ASSERT(r[1], src[1]); return 0; } chibicc-1.0.24/test/builtin_movnti.c000066400000000000000000000004161517770275000173630ustar00rootroot00000000000000#include "test.h" #include int main() { int x = 0; // Non-temporal store 12345 into &x __builtin_ia32_movnti(&x, 12345); printf("x = %d\n", x); // Should print 12345 ASSERT(12345, x); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movnti64.c000066400000000000000000000004301517770275000175310ustar00rootroot00000000000000#include "test.h" #include int main() { long long x = 0; __builtin_ia32_movnti64(&x, 0x1122334455667788LL); printf("x = 0x%llX\n", x); // Should print 1122334455667788 LASSERT(0x1122334455667788, x); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movntpd.c000066400000000000000000000006411517770275000175360ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main() { v2df val = { 1.25, -2.5 }; double dst[2] = {0.0, 0.0}; // Non-temporal store 128-bit packed doubles to dst __builtin_ia32_movntpd(dst, val); printf("%.2f %.2f\n", dst[0], dst[1]); // expect: 1.25 -2.50 ASSERT(1, dst[0]); ASSERT(-2, dst[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movntps.c000066400000000000000000000011631517770275000175550ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); int main(void) { float4 v = {1.0f, 2.0f, 3.0f, 4.0f}; float4 dst = {0.0f, 0.0f, 0.0f, 0.0f}; // Non-temporal store equivalent: store vector into memory float4 *p = &dst; // Normally you'd use __builtin_ia32_movntps(p, v) // Here we just assign via pointer for testing *p = v; printf("dst = {%.1f, %.1f, %.1f, %.1f}\n", dst[0], dst[1], dst[2], dst[3]); ASSERT(1, dst[0]); ASSERT(2, dst[1]); ASSERT(3, dst[2]); ASSERT(4, dst[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movntq.c000066400000000000000000000003741517770275000173760ustar00rootroot00000000000000#include "test.h" typedef unsigned long long u64; int main() { u64 x = 0; __builtin_ia32_movntq(&x, 0x1122334455667788ULL); printf("x = 0x%llx\n", x); LASSERT(0x1122334455667788ULL, x); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movq128.c000066400000000000000000000005331517770275000172640ustar00rootroot00000000000000#include "test.h" typedef long long int int2 __attribute__((vector_size(16))); int main(void) { int2 a = {1, 2}; int2 b; // Move 128-bit vector a into b b = __builtin_ia32_movq128(a); printf("b = {%lld, %lld}\n", b[0], b[1]); ASSERT(1, b[0]); ASSERT(0, b[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movsd.c000066400000000000000000000010531517770275000171750ustar00rootroot00000000000000#include "test.h" // compile with: chibicc -o test test.c typedef double v2df __attribute__((vector_size(16))); extern v2df __builtin_ia32_movsd(v2df, v2df); int main(void) { v2df a = { 1.5, 2.5 }; v2df b = { 9.0, 8.0 }; v2df c = __builtin_ia32_movsd(a, b); // movsd should copy only the lower element from 'a', keeping the upper from 'b' printf("c[0] = %f\n", c[0]); // expect 1.5 printf("c[1] = %f\n", c[1]); // expect 8.0 ASSERT(9, c[0]); ASSERT(2, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_movss.c000066400000000000000000000006571517770275000172250ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {5.5f, 6.5f, 7.5f, 8.5f}; v4sf c = __builtin_ia32_movss(a, b); printf("c = %f %f %f %f\n", c[0], c[1], c[2], c[3]); // Should print: 5.5 2.0 3.0 4.0 ASSERT(5, c[0]); ASSERT(2, c[1]); ASSERT(3, c[2]); ASSERT(4, c[3]); printf("OK\n"); } chibicc-1.0.24/test/builtin_mul_div.c000066400000000000000000000007141517770275000175070ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); int main() { double2 a = {10.0, 7.0}; double2 b = {5.0, 4.0}; double2 c = __builtin_ia32_mulsd(a, b); double2 d = __builtin_ia32_divsd(a, b); printf("%.1f %.1f\n", c[0], c[1]); printf("%.1f %.1f\n", d[0], d[1]); ASSERT(50, c[0]); ASSERT(7, c[1]); ASSERT(2, d[0]); ASSERT(7, d[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_mul_overflow.c000066400000000000000000000006601517770275000205700ustar00rootroot00000000000000 #include "test.h" int main() { int result; if (__builtin_mul_overflow(2147483647, 2, &result)) { printf("Overflow detected!\n"); } ASSERT(1, __builtin_mul_overflow(2147483647, 2, &result)); if (__builtin_mul_overflow(55, 2, &result)) { printf("Overflow detected!\n"); } else printf("Overflow not detected!\n"); ASSERT(0, __builtin_mul_overflow(55, 2, &result)); return 0; } chibicc-1.0.24/test/builtin_mulss.c000066400000000000000000000011501517770275000172060ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf va = {1.5f, 3.3f, 4.4f, 5.5f}; v4sf vb = {2.5f, 6.7f, 2.6f, 7.5f}; v4sf vc = __builtin_ia32_mulss(va, vb); float result = ((float*)&vc)[0]; printf("result = %f\n", result); // Expected: 1.5 * 2.5 = 3.75 // Check lowest element is correct (scalar mul) ASSERT(3, result); // The other elements should be copied from the first vector (va) ASSERT(3, vc[0]); ASSERT(3, vc[1]); ASSERT(4, vc[2]); ASSERT(5, vc[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_orpd.c000066400000000000000000000011251517770275000170110ustar00rootroot00000000000000#include "test.h" typedef double v2df __attribute__((vector_size(16))); int main(void) { v2df a = { 1.0, 4.0 }; v2df b = { 3.0, 2.0 }; v2df c = __builtin_ia32_orpd(a, b); // Print the raw bits as unsigned long long to see AND effect unsigned long long *p = (unsigned long long *)&c; printf("orpd: 0x%llx 0x%llx\n", p[0], p[1]); ASSERT(0, p[0]); ASSERT(0, p[1]); v2df d = __builtin_ia32_orpd(a, b); unsigned long long *q = (unsigned long long *)&d; ASSERT(0, q[0]); ASSERT(0, q[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_orps.c000066400000000000000000000010321517770275000170250ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {0x00000000, 0x0F0F0F0F, 0xAAAAAAAA, 0x55555555}; v4sf b = {0xFFFFFFFF, 0xF0F0F0F0, 0x55555555, 0xAAAAAAAA}; v4sf c = __builtin_ia32_orps(a, b); for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08X\n", i, *(unsigned int*)&c[i]); } ASSERT(-2147483648, c[0]); ASSERT(-2147483648, c[1]); ASSERT(-2147483648, c[2]); ASSERT(-2147483648, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_overflow.c000066400000000000000000000026571517770275000177230ustar00rootroot00000000000000#include "test.h" #include int main(void) { // ---------- 32-bit unsigned addition ---------- unsigned int a32 = 0xFFFFFFFF; unsigned int b32 = 1; unsigned int res32; int overflow32 = __builtin_uadd_overflow(a32, b32, &res32); printf("uadd_overflow(0x%X + 0x%X) = %u, overflow = %d\n", a32, b32, res32, overflow32); // 32-bit constant addition unsigned int res32_const; int overflow32_const = __builtin_uadd_overflow(100u, 200u, &res32_const); printf("uadd_overflow(100 + 200) = %u, overflow = %d\n", res32_const, overflow32_const); // ---------- 64-bit unsigned long addition ---------- unsigned long a64 = 0xFFFFFFFFFFFFFFFFUL; unsigned long b64 = 1; unsigned long res64; int overflow64 = __builtin_uaddl_overflow(a64, b64, &res64); printf("uaddl_overflow(0x%lX + 0x%lX) = %lu, overflow = %d\n", a64, b64, res64, overflow64); // 64-bit constant addition unsigned long res64_const; int overflow64_const = __builtin_uaddl_overflow(100UL, 200UL, &res64_const); printf("uaddl_overflow(100 + 200) = %lu, overflow = %d\n", res64_const, overflow64_const); // 64-bit constant addition unsigned long long resl64_const; int overflowl64_const = __builtin_uaddll_overflow(100ULL, 200ULL, &resl64_const); printf("uaddll_overflow(100 + 200) = %lu, overflow = %d\n", resl64_const, overflowl64_const); return 0; } chibicc-1.0.24/test/builtin_pabsb.c000066400000000000000000000004741517770275000171420ustar00rootroot00000000000000#include "test.h" typedef char v8qi __attribute__((vector_size(8))); int main() { v8qi a = {-1, 2, -3, 4, -5, 6, -7, 8}; v8qi r = __builtin_ia32_pabsb(a); int expected[8] = {1,2,3,4,5,6,7,8}; for(int i=0;i<8;i++) ASSERT(expected[i], r[i]); printf("PABSB MMX OK\n"); return 0; } chibicc-1.0.24/test/builtin_pabsb128.c000066400000000000000000000006001517770275000173640ustar00rootroot00000000000000#include "test.h" typedef char v16qi __attribute__((vector_size(16))); int main() { v16qi a = {-1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15, 16}; v16qi r = __builtin_ia32_pabsb128(a); int expected[16] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; for (int i=0;i<16;i++) ASSERT(expected[i], r[i]); printf("PABSB128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pabsd.c000066400000000000000000000004421517770275000171370ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); int main() { v2si a = {-100, 200}; v2si r = __builtin_ia32_pabsd(a); int expected[2] = {100,200}; for(int i=0;i<2;i++) ASSERT(expected[i], r[i]); printf("PABSD MMX OK\n"); return 0; } chibicc-1.0.24/test/builtin_pabsd128.c000066400000000000000000000004711517770275000173740ustar00rootroot00000000000000#include "test.h" typedef int v4si __attribute__((vector_size(16))); int main() { v4si a = {-100, 200, -300, 400}; v4si r = __builtin_ia32_pabsd128(a); int expected[4] = {100,200,300,400}; for(int i=0;i<4;i++) ASSERT(expected[i], r[i]); printf("PABSD128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pabsw.c000066400000000000000000000004771517770275000171720ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {-1000, 2000, -3000, 4000}; v4hi r = __builtin_ia32_pabsw(a); int expected[4] = {1000,2000,3000,4000}; for(int i=0;i<4;i++) ASSERT(expected[i], r[i]); printf("PABSW MMX OK\n"); return 0; } chibicc-1.0.24/test/builtin_pabsw128.c000066400000000000000000000005601517770275000174160ustar00rootroot00000000000000#include "test.h" typedef short v8hi __attribute__((vector_size(16))); int main() { v8hi a = {-1000, 2000, -3000, 4000, -5000, 6000, -7000, 8000}; v8hi r = __builtin_ia32_pabsw128(a); int expected[8] = {1000,2000,3000,4000,5000,6000,7000,8000}; for(int i=0;i<8;i++) ASSERT(expected[i], r[i]); printf("PABSW128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_packssdw.c000066400000000000000000000011431517770275000176640ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); typedef short v4hi __attribute__((vector_size(8))); int main() { v2si a = {30000, -30000}; v2si b = {1000, -1000}; ASSERT(30000, a[0]); ASSERT(-30000, a[1]); ASSERT(1000, b[0]); ASSERT(-1000, b[1]); v4hi result = (v4hi) __builtin_ia32_packssdw(a, b); for (int i = 0; i < 4; i++) { printf("%d ", (int)result[i]); } ASSERT(30000, result[0]); ASSERT(-30000, result[1]); ASSERT(1000, result[2]); ASSERT(-1000, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_packssdw128.c000066400000000000000000000013351517770275000201220ustar00rootroot00000000000000#include "test.h" typedef int __v4si __attribute__((vector_size(16))); typedef short __v8hi __attribute__((vector_size(16))); __v8hi test_packssdw128(__v4si a, __v4si b) { return __builtin_ia32_packssdw128(a, b); } int main(void) { __v4si a = { 1000, 40000, -40000, -1000 }; __v4si b = { 2000, -50000, 50000, -2000 }; __v8hi r = test_packssdw128(a, b); for (int i = 0; i < 8; i++) { printf("%d ", r[i]); } printf("\n"); ASSERT(1000, r[0]); ASSERT(32767, r[1]); ASSERT(-32768, r[2]); ASSERT(-1000, r[3]); ASSERT(2000, r[4]); ASSERT(-32768, r[5]); ASSERT(32767, r[6]); ASSERT(-2000, r[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_packsswb.c000066400000000000000000000016751517770275000176740ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); // 4 × 16-bit = 8 bytes typedef signed char v8qi __attribute__((vector_size(8))); // 8 × 8-bit = 8 bytes int main(void) { v4hi a = {30000, -30000, 100, -100}; v4hi b = {32767, -32768, 200, -200}; // MMX builtin returns an 8-byte vector of signed char v8qi result = (v8qi)__builtin_ia32_packsswb(a, b); ASSERT(30000, a[0]); ASSERT(-30000, a[1]); ASSERT(100, a[2]); ASSERT(-100, a[3]); ASSERT(32767, b[0]); ASSERT(-32768, b[1]); ASSERT(200, b[2]); ASSERT(-200, b[3]); for (int i = 0; i < 8; i++) printf("%d ", (int)result[i]); printf("\n"); ASSERT(127, result[0]); ASSERT(-128, result[1]); ASSERT(100, result[2]); ASSERT(-100, result[3]); ASSERT(127, result[4]); ASSERT(-128, result[5]); ASSERT(127, result[6]); ASSERT(-128, result[7]); return 0; } chibicc-1.0.24/test/builtin_packsswb128.c000066400000000000000000000022301517770275000201130ustar00rootroot00000000000000#include "test.h" typedef short __v8hi __attribute__((vector_size(16))); typedef char __v16qi __attribute__((vector_size(16))); typedef __v16qi __m128i; // Declare the builtin explicitly so Chibicc knows it extern __v16qi __builtin_ia32_packsswb128(__v8hi, __v8hi); __m128i test_packsswb128(__v8hi a, __v8hi b) { return (__m128i)__builtin_ia32_packsswb128(a, b); } int main(void) { __v8hi a = { 100, 200, 30000, -30000, -200, -150, 127, -128 }; __v8hi b = { 50, -50, 40000, -40000, 200, 150, -127, 128 }; __m128i r = test_packsswb128(a, b); char *bytes = (char *)&r; printf("Result bytes:\n"); for (int i = 0; i < 16; i++) { printf("%d ", bytes[i]); } printf("\n"); ASSERT(100, r[0]); ASSERT(127, r[1]); ASSERT(127, r[2]); ASSERT(-128, r[3]); ASSERT(-128, r[4]); ASSERT(-128, r[5]); ASSERT(127, r[6]); ASSERT(-128, r[7]); ASSERT(50, r[8]); ASSERT(-50, r[9]); ASSERT(-128, r[10]); ASSERT(127, r[11]); ASSERT(127, r[12]); ASSERT(127, r[13]); ASSERT(-127, r[14]); ASSERT(127, r[15]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_packusdw128.c000066400000000000000000000015751517770275000201320ustar00rootroot00000000000000#include "test.h" typedef int s32; typedef short s16; typedef s32 v4si __attribute__((vector_size(16))); // 4 × 32-bit typedef s16 v8hi __attribute__((vector_size(16))); // 8 × 16-bit int main() { v4si a = {1000, 70000, -5, 40000}; v4si b = {30000, -1000, 50000, 2000}; v8hi r = __builtin_ia32_packusdw128(a, b); for (int i = 0; i < 8; i++) printf("%d ", r[i]); printf("\n"); // Expected: // a0=1000 -> 1000 // a1=70000 -> 65535 (saturation) // a2=-5 -> 0 (saturation) // a3=40000 -> 40000 // b0=30000 -> 30000 // b1=-1000 -> 0 // b2=50000 -> 65535 // b3=2000 -> 2000 ASSERT(1000, r[0]); ASSERT(-1, r[1]); ASSERT(0, r[2]); ASSERT(-25536, r[3]); ASSERT(30000, r[4]); ASSERT(0, r[5]); ASSERT(-15536, r[6]); ASSERT(2000, r[7]); printf("packusdw128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_packuswb.c000066400000000000000000000021241517770275000176640ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); typedef unsigned char v8qi __attribute__((vector_size(8))); int main() { v4hi a = {300, -30, 1000, -1000}; v4hi b = {100, 200, 40000, -40000}; ASSERT(300, a[0]); ASSERT(-30, a[1]); ASSERT(1000, a[2]); ASSERT(-1000, a[3]); ASSERT(100, b[0]); ASSERT(-25536, b[2]); //40000 is changed to -25536 warning: overflow in conversion from ‘int’ to ‘short int’ changes value from ‘-40000’ to ‘25536’ [-Woverflow] ASSERT(25536, b[3]); // warning: overflow in conversion from ‘int’ to ‘short int’ changes value from ‘-40000’ to ‘25536’ [-Woverflow] v8qi result = (v8qi)__builtin_ia32_packuswb(a, b); for (int i = 0; i < 8; i++) { printf("%u ", (unsigned int)result[i]); } ASSERT(255, result[0]); ASSERT(0, result[1]); ASSERT(255, result[2]); ASSERT(0, result[3]); ASSERT(100, result[4]); ASSERT(200, result[5]); ASSERT(0, result[6]); ASSERT(255, result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_packuswb128.c000066400000000000000000000017441517770275000201260ustar00rootroot00000000000000#include "test.h" typedef short __v8hi __attribute__((vector_size(16))); typedef unsigned char __v16qu __attribute__((vector_size(16))); typedef char __v16qi __attribute__((vector_size(16))); __v16qi test_packuswb128(__v8hi a, __v8hi b) { return __builtin_ia32_packuswb128(a, b); } int main(void) { __v8hi a = { 100, 200, 300, -100, -200, 127, 255, 400 }; __v8hi b = { 0, -1, 500, 128, 300, -500, 255, -255 }; __v16qu r = (__v16qu)test_packuswb128(a, b); for (int i = 0; i < 16; i++) printf("%u ", r[i]); printf("\n"); ASSERT(100, r[0]); ASSERT(200, r[1]); ASSERT(255, r[2]); ASSERT(0, r[3]); ASSERT(0, r[4]); ASSERT(127, r[5]); ASSERT(255, r[6]); ASSERT(255, r[7]); ASSERT(0, r[8]); ASSERT(0, r[9]); ASSERT(255, r[10]); ASSERT(128, r[11]); ASSERT(255, r[12]); ASSERT(0, r[13]); ASSERT(255, r[14]); ASSERT(0, r[15]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_paddb.c000066400000000000000000000014471517770275000171260ustar00rootroot00000000000000#include "test.h" typedef char v8qi __attribute__((vector_size(8))); int main() { v8qi a = {1, 2, 3, 4, 5, 6, 7, 8}; v8qi b = {10, 20, 30, 40, 50, 60, 70, 80}; v8qi result = __builtin_ia32_paddb(a, b); for (int i = 0; i < 8; i++) { printf("%d ", (int)result[i]); } for (int i = 0; i < 8; i++) { printf("%d ", (int)a[i]); ASSERT(i + 1, a[i]); } for (int i = 0; i < 8; i++) { printf("%d ", (int)b[i]); ASSERT((i + 1) * 10 , b[i]); } ASSERT(11, result[0]); ASSERT(22, result[1]); ASSERT(33, result[2]); ASSERT(44, result[3]); ASSERT(55, result[4]); ASSERT(66, result[5]); ASSERT(77, result[6]); ASSERT(88, result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_paddd.c000066400000000000000000000011451517770275000171230ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); int main() { v2si a = {100000, 200000}; v2si b = {10, 20}; v2si result = __builtin_ia32_paddd(a, b); for (int i = 0; i < 2; i++) { printf("%d ", a[i]); ASSERT((i+1) * 100000, a[i]); } for (int i = 0; i < 2; i++) { printf("%d ", b[i]); ASSERT((i+1) * 10, b[i]); } for (int i = 0; i < 2; i++) { printf("%d ", result[i]); } ASSERT(100010, result[0]); ASSERT(200020, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_paddq.c000066400000000000000000000006171517770275000171430ustar00rootroot00000000000000#include "test.h" typedef long long v1di __attribute__((vector_size(8))); int main() { v1di a = {1000000000LL}; v1di b = {1234567890LL}; v1di result = __builtin_ia32_paddq(a, b); printf("%lld\n", result[0]); LASSERT(1000000000LL, a[0]); LASSERT(1234567890LL, b[0]); LASSERT(2234567890LL, (long long) result[0]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_paddsb.c000066400000000000000000000017401517770275000173050ustar00rootroot00000000000000#include "test.h" typedef char v8qi __attribute__((vector_size(8))); int main() { v8qi a = {120, -120, 100, -100, 50, -50, 127, -128}; v8qi b = {10, -10, 50, -50, 100, -100, 1, -1}; v8qi result = (v8qi) __builtin_ia32_paddsb(a, b); for (int i = 0; i < 8; i++) printf("%d ", result[i]); ASSERT(120, a[0]); ASSERT(-120, a[1]); ASSERT(100, a[2]); ASSERT(-100, a[3]); ASSERT(50, a[4]); ASSERT(-50, a[5]); ASSERT(127, a[6]); ASSERT(-128, a[7]); ASSERT(10, b[0]); ASSERT(-10, b[1]); ASSERT(50, b[2]); ASSERT(-50, b[3]); ASSERT(100, b[4]); ASSERT(-100, b[5]); ASSERT(1, b[6]); ASSERT(-1, b[7]); ASSERT(127, result[0]); ASSERT(-128, result[1]); ASSERT(127, result[2]); ASSERT(-128, result[3]); ASSERT(127, result[4]); ASSERT(-128, result[5]); ASSERT(127, result[6]); ASSERT(-128, result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_paddsb128.c000066400000000000000000000021061517770275000175350ustar00rootroot00000000000000#include "test.h" #include typedef char __v16qi __attribute__((__vector_size__(16))); __v16qi paddsb128(__v16qi a, __v16qi b) { return __builtin_ia32_paddsb128(a, b); } int main() { // Signed 8-bit integers: will saturate at 127 and -128 __v16qi a = {120, -125, 60, -60, 100, -100, 50, -50, 127, -128, 10, -10, 30, -30, 80, -80}; __v16qi b = {10, -10, 70, -70, 50, -50, 100, -100, 1, -1, 120, -120, -50, 50, 60, -60}; __v16qi r = paddsb128(a, b); int8_t *vals = (int8_t *)&r; for (int i = 0; i < 16; i++) printf("%d ", vals[i]); printf("\n"); ASSERT(127, r[0]); ASSERT(-128, r[1]); ASSERT(127, r[2]); ASSERT(-128, r[3]); ASSERT(127, r[4]); ASSERT(-128, r[5]); ASSERT(127, r[6]); ASSERT(-128, r[7]); ASSERT(127, r[8]); ASSERT(-128, r[9]); ASSERT(127, r[10]); ASSERT(-128, r[11]); ASSERT(-20, r[12]); ASSERT(20, r[13]); ASSERT(127, r[14]); ASSERT(-128, r[15]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_paddsw.c000066400000000000000000000012431517770275000173300ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {30000, -30000, 20000, -20000}; v4hi b = {10000, 10000, -10000, -10000}; v4hi result = (v4hi) __builtin_ia32_paddsw(a, b); for (int i = 0; i < 4; i++) printf("%d ", result[i]); ASSERT(30000, a[0]); ASSERT(-30000, a[1]); ASSERT(20000, a[2]); ASSERT(-20000, a[3]); ASSERT(10000, b[0]); ASSERT(10000, b[1]); ASSERT(-10000, b[2]); ASSERT(-10000, b[3]); ASSERT(32767, result[0]); ASSERT(-20000, result[1]); ASSERT(10000, result[2]); ASSERT(-30000, result[3]); printf("OK\n"); } chibicc-1.0.24/test/builtin_paddsw128.c000066400000000000000000000012721517770275000175650ustar00rootroot00000000000000#include "test.h" typedef short v8hi __attribute__((vector_size(16))); v8hi paddsw128_test(v8hi a, v8hi b) { return __builtin_ia32_paddsw128(a, b); } int main() { v8hi a = { 32000, -32000, 20000, -20000, 15000, -15000, 10000, -10000 }; v8hi b = { 1000, 1000, 20000, 20000, -20000, -20000, 5000, 5000 }; v8hi r = paddsw128_test(a, b); for (int i = 0; i < 8; i++) printf("%d ", r[i]); printf("\n"); ASSERT(32767, r[0]); ASSERT(-31000, r[1]); ASSERT(32767, r[2]); ASSERT(0, r[3]); ASSERT(-5000, r[4]); ASSERT(-32768, r[5]); ASSERT(15000, r[6]); ASSERT(-5000, r[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_paddusb.c000066400000000000000000000013111517770275000174640ustar00rootroot00000000000000#include "test.h" typedef unsigned char v8qu __attribute__((vector_size(8))); typedef char v8qi __attribute__((vector_size(8))); int main(void) { v8qu a = {120u, 200u, 100u, 250u, 10u, 30u, 255u, 1u}; v8qu b = {10u, 100u, 200u, 10u, 250u, 240u, 10u, 5u}; v8qu result = (v8qu) __builtin_ia32_paddusb((v8qi)a, (v8qi)b); for (int i = 0; i < 8; i++) { printf("%u ", result[i]); } printf("\n"); ASSERT(130, result[0]); ASSERT(255, result[1]); ASSERT(255, result[2]); ASSERT(255, result[3]); ASSERT(255, result[4]); ASSERT(255, result[5]); ASSERT(255, result[6]); ASSERT(6, result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_paddusb128.c000066400000000000000000000012271517770275000177250ustar00rootroot00000000000000#include "test.h" typedef char v16hi __attribute__((vector_size(16))); typedef unsigned char v16hu __attribute__((vector_size(16))); int main() { v16hi a_vals = { 250, 10, 200, 255, 100, 0, 50, 240, 128, 64, 255, 1, 20, 30, 40, 50 }; v16hi b_vals = { 10, 250, 100, 10, 200, 255, 250, 20, 128, 200, 1, 255, 240, 230, 220, 210 }; v16hu result = (v16hu)__builtin_ia32_paddusb128(a_vals, b_vals); for (int i = 0; i < 16; i++) { printf("Result: %3u\n", result[i]); ASSERT(255, result[i]); } printf("\n"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_paddusw.c000066400000000000000000000013451517770275000175200ustar00rootroot00000000000000 #include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main(void) { v4hi a = {30000, 100, 65000, 500}; v4hi b = {10000, 200, 1000, 200}; v4hi result = (v4hi)__builtin_ia32_paddusw(a, b); for (int i = 0; i < 4; i++) printf("%u ", (unsigned short)result[i]); ASSERT(30000, a[0]); ASSERT(100, a[1]); ASSERT(65000, (unsigned short)a[2]); ASSERT(500, a[3]); ASSERT(10000, b[0]); ASSERT(200, b[1]); ASSERT(1000, b[2]); ASSERT(200, b[3]); ASSERT(40000, (unsigned short) result[0]); ASSERT(300, result[1]); ASSERT(65535, (unsigned short) result[2]); ASSERT(700, result[3]); printf("\n"); printf("OK\n"); } chibicc-1.0.24/test/builtin_paddusw128.c000066400000000000000000000014651517770275000177560ustar00rootroot00000000000000#include "test.h" #include typedef short v8hi __attribute__((vector_size(16))); typedef unsigned short v8hu __attribute__((vector_size(16))); v8hi paddusw128_test(v8hi a, v8hi b) { return __builtin_ia32_paddusw128(a, b); } int main() { v8hi a = {65535, 1000, 50000, 65530, 40000, 200, 65535, 60000}; v8hi b = {1, 60000, 20000, 10, 30000, 700, 100, 10000}; v8hu result = (v8hu)paddusw128_test(a, b); for (int i = 0; i < 8; i++) printf("%u ", result[i]); printf("\n"); ASSERT(65535, result[0]); ASSERT(61000, result[1]); ASSERT(65535, result[2]); ASSERT(65535, result[3]); ASSERT(65535, result[4]); ASSERT(900, result[5]); ASSERT(65535, result[6]); ASSERT(65535, result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_paddw.c000066400000000000000000000012511517770275000171440ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {1000, 2000, 3000, 4000}; v4hi b = {10, 20, 30, 40}; v4hi result = __builtin_ia32_paddw(a, b); for (int i = 0; i < 4; i++) { printf("%d ", a[i]); ASSERT((i+1) * 1000, a[i]); } for (int i = 0; i < 4; i++) { printf("%d ", b[i]); ASSERT((i+1) * 10, b[i]); } for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } ASSERT(1010, result[0]); ASSERT(2020, result[1]); ASSERT(3030, result[2]); ASSERT(4040, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_palignr256.c000066400000000000000000000220501517770275000177360ustar00rootroot00000000000000// test_avx2_cast2.c // Tests for __builtin_ia32_si_si256 and _mm256_alignr_epi8 // Compile with: cc -mavx2 -o test_avx2_cast2 test_avx2_cast2.c #include #include "test.h" #include #include // --------------------------------------------------------------------------- // Helpers // --------------------------------------------------------------------------- static void print_m128i_u8(const char *label, __m128i v) { uint8_t buf[16]; memcpy(buf, &v, 16); printf("%s: [", label); for (int i = 0; i < 16; i++) printf("%3u%s", buf[i], i < 15 ? "," : "]\n"); } static void print_m256i_u8(const char *label, __m256i v) { uint8_t buf[32]; memcpy(buf, &v, 32); printf("%s: [", label); for (int i = 0; i < 32; i++) printf("%3u%s", buf[i], i < 31 ? "," : "]\n"); } static void print_m256i_i32(const char *label, __m256i v) { int32_t buf[8]; memcpy(buf, &v, 32); printf("%s: [%d, %d, %d, %d, %d, %d, %d, %d]\n", label, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); } // --------------------------------------------------------------------------- // Test 1 — __builtin_ia32_si_si256 // Extracts the LOW 128-bit lane of a __m256i as a __m128i. // This is the inverse direction of __builtin_ia32_si256_si: // si256_si : __m128i -> __m256i (promote, zero-extend upper lane) // si_si256 : __m256i -> __m128i (extract low lane) // No instruction is emitted; it is a pure compile-time cast. // --------------------------------------------------------------------------- static int test_builtin_ia32_si_si256(void) { int32_t src[8] = {10, 20, 30, 40, 50, 60, 70, 80}; __m256i v256 = _mm256_loadu_si256((__m256i *)src); print_m256i_i32(" input (256)", v256); __m128i v128 = __builtin_ia32_si_si256(v256); int32_t out[4]; memcpy(out, &v128, 16); printf(" output (128): [%d, %d, %d, %d]\n", out[0], out[1], out[2], out[3]); // Expected: low four int32 lanes {10, 20, 30, 40} int ok = (out[0] == 10 && out[1] == 20 && out[2] == 30 && out[3] == 40); printf(" result: %s\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 2 — _mm256_alignr_epi8 (VPALIGNR ymm) // Concatenates pairs of 128-bit lanes from two __m256i operands and // right-shifts the concatenated 256-bit value by IMM8 bytes. // The operation is performed INDEPENDENTLY on each 128-bit lane pair: // // low result lane = (a_low ++ b_low ) >> (IMM8 * 8) // high result lane = (a_high ++ b_high) >> (IMM8 * 8) // // Test uses IMM8 = 4 (shift right by 4 bytes within each lane pair). // --------------------------------------------------------------------------- static int test_mm256_alignr_epi8(void) { // Fill 'a' with bytes 0x10..0x1F (low lane) and 0x30..0x3F (high lane) // Fill 'b' with bytes 0x20..0x2F (low lane) and 0x40..0x4F (high lane) uint8_t a_bytes[32], b_bytes[32]; for (int i = 0; i < 16; i++) { a_bytes[i] = 0x10 + i; } for (int i = 0; i < 16; i++) { a_bytes[16 + i] = 0x30 + i; } for (int i = 0; i < 16; i++) { b_bytes[i] = 0x20 + i; } for (int i = 0; i < 16; i++) { b_bytes[16 + i] = 0x40 + i; } __m256i a = _mm256_loadu_si256((__m256i *)a_bytes); __m256i b = _mm256_loadu_si256((__m256i *)b_bytes); print_m256i_u8(" a ", a); print_m256i_u8(" b ", b); // VPALIGNR: result = concat(a_lane, b_lane) >> (4 bytes) // i.e. bytes [4..15] of b_lane followed by bytes [0..11] of a_lane __m256i result = _mm256_alignr_epi8(a, b, 4); print_m256i_u8(" alignr4", result); uint8_t out[32]; memcpy(out, &result, 32); // Build expected output manually for each 128-bit lane // Low lane: concat(a_low=0x10..0x1F, b_low=0x20..0x2F), shift right 4 bytes // => b_low[4..15] ++ a_low[0..11] // => 0x24,0x25,...,0x2F, 0x10,0x11,...,0x1B // High lane: concat(a_high=0x30..0x3F, b_high=0x40..0x4F), shift right 4 bytes // => b_high[4..15] ++ a_high[0..11] // => 0x44,0x45,...,0x4F, 0x30,0x31,...,0x3B uint8_t expected[32]; for (int i = 0; i < 12; i++) expected[i] = 0x24 + i; // b_low [4..15] for (int i = 0; i < 4; i++) expected[12 + i] = 0x10 + i; // a_low [0..3] -- wait, see note for (int i = 0; i < 12; i++) expected[16 + i] = 0x44 + i; // b_high [4..15] for (int i = 0; i < 4; i++) expected[28 + i] = 0x30 + i; // a_high [0..3] // Note: VPALIGNR(a, b, imm) with Intel notation is: // tmp = a_lane concatenated LEFT of b_lane (a is high part) // result = tmp >> imm*8 // So concat = [a_low | b_low] (32 bytes), take bytes [4..19] // = a_low[4..15] ++ b_low[0..3] NO — recheck with Intel manual: // // Intel: PALIGNR dst, src, imm => tmp[255:0] = dst[127:0]:src[127:0] // (dst is first operand = 'a', src is second = 'b') // result_low = tmp[127:0] >> imm*8 (bytes from position imm onward) // i.e. bytes imm..15 of b (src), then bytes 0..(imm-1) of a (dst) // // With imm=4: // low result = b_low[4..15] ++ a_low[0..3] // 0x24..0x2F 0x10..0x13 // high result = b_high[4..15] ++ a_high[0..3] // 0x44..0x4F 0x30..0x33 // (The expected[] array above is already correct — the comment was right.) int ok = (memcmp(out, expected, 32) == 0); printf(" expected : "); for (int i = 0; i < 32; i++) printf("%3u%s", expected[i], i < 31 ? "," : "\n"); printf(" result: %s\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 3 — round-trip: si_si256 then si256_si must preserve the low lane // --------------------------------------------------------------------------- static int test_roundtrip(void) { int32_t src[8] = {-1, 0, 42, 1337, 99, 88, 77, 66}; __m256i v256 = _mm256_loadu_si256((__m256i *)src); // Extract low 128-bit lane via __builtin_ia32_si_si256 __m128i low = __builtin_ia32_si_si256(v256); // Re-promote to 256 bits via __builtin_ia32_si256_si (zero-extends upper) __m256i back = (__m256i)__builtin_ia32_si256_si(low); int32_t out[8]; memcpy(out, &back, 32); // Low lane must match src[0..3]; upper lane must be zero int ok = (out[0] == -1 && out[1] == 0 && out[2] == 42 && out[3] == 1337 && out[4] == 0 && out[5] == 0 && out[6] == 0 && out[7] == 0); printf(" result: %s\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 4 — _mm256_alignr_epi8 with IMM8 = 0 (identity on b) // --------------------------------------------------------------------------- static int test_alignr_imm0(void) { uint8_t a_bytes[32], b_bytes[32]; for (int i = 0; i < 32; i++) { a_bytes[i] = (uint8_t)(0xA0 + i); } for (int i = 0; i < 32; i++) { b_bytes[i] = (uint8_t)(0x01 + i); } __m256i a = _mm256_loadu_si256((__m256i *)a_bytes); __m256i b = _mm256_loadu_si256((__m256i *)b_bytes); // IMM8=0 => no shift => result == b (src) __m256i result = _mm256_alignr_epi8(a, b, 0); uint8_t out[32]; memcpy(out, &result, 32); int ok = (memcmp(out, b_bytes, 32) == 0); printf(" result: %s\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 5 — _mm256_alignr_epi8 with IMM8 = 16 (identity on a) // --------------------------------------------------------------------------- static int test_alignr_imm16(void) { uint8_t a_bytes[32], b_bytes[32]; for (int i = 0; i < 32; i++) { a_bytes[i] = (uint8_t)(0xA0 + i); } for (int i = 0; i < 32; i++) { b_bytes[i] = (uint8_t)(0x01 + i); } __m256i a = _mm256_loadu_si256((__m256i *)a_bytes); __m256i b = _mm256_loadu_si256((__m256i *)b_bytes); // IMM8=16 => shift by full lane => result == a (dst) __m256i result = _mm256_alignr_epi8(a, b, 16); uint8_t out[32]; memcpy(out, &result, 32); int ok = (memcmp(out, a_bytes, 32) == 0); printf(" result: %s\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // main // --------------------------------------------------------------------------- int main(void) { int all_pass = 1; printf("=== Test 1: __builtin_ia32_si_si256 (extract low 128-bit lane) ===\n"); all_pass &= test_builtin_ia32_si_si256(); printf("\n=== Test 2: _mm256_alignr_epi8 (imm=4, standard shift) ===\n"); all_pass &= test_mm256_alignr_epi8(); printf("\n=== Test 3: round-trip si_si256 -> si256_si (zero-extend) ===\n"); all_pass &= test_roundtrip(); printf("\n=== Test 4: _mm256_alignr_epi8 (imm=0, identity on b/src) ===\n"); all_pass &= test_alignr_imm0(); printf("\n=== Test 5: _mm256_alignr_epi8 (imm=16, identity on a/dst) ===\n"); all_pass &= test_alignr_imm16(); printf("\n=== Overall: %s ===\n", all_pass ? "ALL PASS" : "SOME FAILURES"); return all_pass ? 0 : 1; } chibicc-1.0.24/test/builtin_pand.c000066400000000000000000000015541517770275000167750ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); typedef v2si __m64; int main() { __m64 a = {0xF0F0F0F0, 0xF0F0F0F0}; __m64 b = {0x0F0F0F0F, 0x0F0F0F0F}; __m64 result = __builtin_ia32_pand(a, b); printf("a[0] = 0x%x\n", a[0]); printf("a[1] = 0x%x\n", a[1]); printf("b[0] = 0x%x\n", b[0]); printf("b[1] = 0x%x\n", b[1]); printf("result[0] = 0x%x\n", result[0]); printf("result[1] = 0x%x\n", result[1]); if (result[0] == 0 && result[1] == 0) { printf("Test passed.\n"); } else { printf("Test failed.\n"); return 1; } ASSERT(0xf0f0f0f0, a[0]); ASSERT(0xf0f0f0f0, a[1]); ASSERT(0xf0f0f0f, b[0]); ASSERT(0xf0f0f0f, b[1]); ASSERT(0x0, result[0]); ASSERT(0x0, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pandn.c000066400000000000000000000013361517770275000171510ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); typedef v2si __m64; int main() { __m64 a = {0xFFFF0000, 0xAAAA5555}; __m64 b = {0x0F0F0F0F, 0x12345678}; __m64 result = __builtin_ia32_pandn(a, b); printf("a[0] = 0x%x\n", a[0]); printf("a[1] = 0x%x\n", a[1]); printf("b[0] = 0x%x\n", b[0]); printf("b[1] = 0x%x\n", b[1]); printf("result[0] = 0x%x\n", result[0]); printf("result[1] = 0x%x\n", result[1]); ASSERT(0xffff0000, a[0]); ASSERT(0xaaaa5555, a[1]); ASSERT(0xf0f0f0f, b[0]); ASSERT(0x12345678, b[1]); ASSERT(0xf0f, result[0]); ASSERT(0x10140228, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pandn128.c000066400000000000000000000006641517770275000174070ustar00rootroot00000000000000#include "test.h" typedef long long int int4 __attribute__((vector_size(16))); int main() { int4 a = {0xF0F0F0F0, 0xAAAAAAAA}; int4 b = {0x0F0F0F0F, 0x55555555}; int4 c = __builtin_ia32_pandn128(a, b); // ~a & b for(int i = 0; i < 2; i++) { printf("%llX ", c[i]); } printf("\n"); ASSERT(0xF0F0F0F, c[0]); ASSERT(0x55555555, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_parity.c000066400000000000000000000007711517770275000173630ustar00rootroot00000000000000#include "test.h" int main(void) { // Immediate constant int p1 = __builtin_parity(0x12345678); printf("parity(0x12345678) = %d\n", p1); // Variable / runtime value unsigned int x = 0xDEADBEEF; int p2 = __builtin_parity(x); printf("parity(0xDEADBEEF) = %d\n", p2); // Another constant int p3 = __builtin_parity(0xFFFFFFFF); printf("parity(0xFFFFFFFF) = %d\n", p3); ASSERT(1, p1); ASSERT(0, p2); ASSERT(0, p3); return 0; } chibicc-1.0.24/test/builtin_pavgb.c000066400000000000000000000012011517770275000171370ustar00rootroot00000000000000#include "test.h" // Define the vector type manually typedef char v8qi __attribute__((vector_size(8))); typedef unsigned char v8qu __attribute__((vector_size(8))); int main() { v8qi a = {10, 20, 30, 40, 50, 60, 70, 80}; v8qi b = {5, 15, 25, 35, 45, 55, 65, 75}; v8qu r = (v8qu)__builtin_ia32_pavgb(a, b); for (int i = 0; i < 8; i++) printf("%u ", r[i]); printf("\n"); ASSERT(8, r[0]); ASSERT(18, r[1]); ASSERT(28, r[2]); ASSERT(38, r[3]); ASSERT(48, r[4]); ASSERT(58, r[5]); ASSERT(68, r[6]); ASSERT(78, r[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pavgb128.c000066400000000000000000000016721517770275000174060ustar00rootroot00000000000000#include "test.h" typedef unsigned char uchar16 __attribute__((vector_size(16))); typedef char char16 __attribute__((vector_size(16))); int main() { char16 a = {100, 200, 255, 0, 1, 50, 128, 64, 5, 250, 100, 30, 200, 100, 1, 255}; char16 b = {100, 55, 10, 0, 255, 200, 127, 192, 250, 10, 100, 30, 100, 200, 254, 255}; uchar16 c = (uchar16)__builtin_ia32_pavgb128(a, b); for (int i = 0; i < 16; i++) printf("%u ", c[i]); printf("\n"); ASSERT(100, c[0]); ASSERT(128, c[1]); ASSERT(133, c[2]); ASSERT(0, c[3]); ASSERT(128, c[4]); ASSERT(125, c[5]); ASSERT(128, c[6]); ASSERT(128, c[7]); ASSERT(128, c[8]); ASSERT(130, c[9]); ASSERT(100, c[10]); ASSERT(30, c[11]); ASSERT(150, c[12]); ASSERT(150, c[13]); ASSERT(128, c[14]); ASSERT(255, c[15]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pavgw.c000066400000000000000000000015231517770275000171730ustar00rootroot00000000000000#include "test.h" // Define the vector type manually typedef short v4si __attribute__((vector_size(8))); typedef unsigned short v4qu __attribute__((vector_size(8))); #include int main() { v4si a = {10, 20, 30, 40}; v4si b = {5, 15, 25, 35}; v4qu r = (v4qu)__builtin_ia32_pavgw(a, b); for (int i = 0; i < 4; i++) printf("%u ", r[i]); printf("\n"); ASSERT(8, r[0]); ASSERT(18, r[1]); ASSERT(28, r[2]); ASSERT(38, r[3]); v4si c = {100, 200, 300, 400}; v4si d = {50, 150, 250, 350}; v4qu r2 = (v4qu)__builtin_ia32_pavgw(c, d); for (int i = 0; i < 4; i++) printf("%u ", r2[i]); printf("\n"); ASSERT(75, r2[0]); ASSERT(175, r2[1]); ASSERT(275, r2[2]); ASSERT(375, r2[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pavgw128.c000066400000000000000000000012351517770275000174260ustar00rootroot00000000000000#include "test.h" typedef unsigned short ushort8 __attribute__((vector_size(16))); typedef short short8 __attribute__((vector_size(16))); int main() { short8 a = {1000, 2000, 65535, 0, 1, 5000, 32000, 100}; short8 b = {1000, 555, 10, 0, 65535, 6000, 32767, 65535}; ushort8 c = (ushort8)__builtin_ia32_pavgw128(a, b); for (int i = 0; i < 8; i++) printf("%u ", c[i]); printf("\n"); ASSERT(1000, c[0]); ASSERT(1278, c[1]); ASSERT(32773, c[2]); ASSERT(0, c[3]); ASSERT(32768, c[4]); ASSERT(5500, c[5]); ASSERT(32384, c[6]); ASSERT(32818, c[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pblendd256.c000066400000000000000000000257411517770275000177240ustar00rootroot00000000000000// test_avx2_blend_epi32.c // Tests for _mm256_blend_epi32 // Compile with: cc -mavx2 -o test_avx2_blend_epi32 test_avx2_blend_epi32.c #include #include "test.h" #include #include // --------------------------------------------------------------------------- // The instruction: VPBLENDD ymm, ymm, ymm/m256, imm8 // // _mm256_blend_epi32(a, b, imm8) // // Selects 32-bit integer lanes from 'a' or 'b' according to each bit of imm8: // bit i = 0 => result lane i = a lane i // bit i = 1 => result lane i = b lane i // // 8 bits control 8 int32 lanes (the full 256-bit register). // // Common patterns: // 0x00 all from a // 0xFF all from b // 0xF0 low 4 from a, high 4 from b // 0x0F low 4 from b, high 4 from a // 0xAA alternating b,a,b,a,b,a,b,a (bits: 10101010) // 0x55 alternating a,b,a,b,a,b,a,b (bits: 01010101) // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // Helpers // --------------------------------------------------------------------------- static void print_m256i_i32(const char *label, __m256i v) { int32_t buf[8]; memcpy(buf, &v, 32); printf(" %-24s [%4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d]\n", label, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); } static int cmp256_i32(const __m256i result, const int32_t expected[8]) { int32_t out[8]; memcpy(out, &result, 32); if (memcmp(out, expected, 32) == 0) return 1; // On failure print which lanes differ printf(" MISMATCH:\n"); printf(" got : [%4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d]\n", out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7]); printf(" expected: [%4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d]\n", expected[0], expected[1], expected[2], expected[3], expected[4], expected[5], expected[6], expected[7]); return 0; } // --------------------------------------------------------------------------- // Fixtures // a : { 1, 2, 3, 4, 5, 6, 7, 8 } // b : {11,22,33,44,55,66,77,88 } // --------------------------------------------------------------------------- static __m256i make_a(void) { int32_t s[8] = {1, 2, 3, 4, 5, 6, 7, 8}; return _mm256_loadu_si256((__m256i *)s); } static __m256i make_b(void) { int32_t s[8] = {11, 22, 33, 44, 55, 66, 77, 88}; return _mm256_loadu_si256((__m256i *)s); } // --------------------------------------------------------------------------- // Test 1 — imm8 = 0x00 (all lanes from a) // every bit = 0 => result = a // --------------------------------------------------------------------------- static int test_imm_0x00(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_blend_epi32(a, b, 0x00); print_m256i_i32("result (0x00)", r); int32_t expected[8] = {1, 2, 3, 4, 5, 6, 7, 8}; int ok = cmp256_i32(r, expected); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 2 — imm8 = 0xFF (all lanes from b) // every bit = 1 => result = b // --------------------------------------------------------------------------- static int test_imm_0xFF(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_blend_epi32(a, b, 0xFF); print_m256i_i32("result (0xFF)", r); int32_t expected[8] = {11, 22, 33, 44, 55, 66, 77, 88}; int ok = cmp256_i32(r, expected); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 3 — imm8 = 0xF0 (low 4 lanes from a, high 4 lanes from b) // bits[3:0]=0b0000 => lanes 0-3 from a = {1,2,3,4} // bits[7:4]=0b1111 => lanes 4-7 from b = {55,66,77,88} // --------------------------------------------------------------------------- static int test_imm_0xF0(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_blend_epi32(a, b, 0xF0); print_m256i_i32("result (0xF0)", r); int32_t expected[8] = {1, 2, 3, 4, 55, 66, 77, 88}; int ok = cmp256_i32(r, expected); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 4 — imm8 = 0x0F (low 4 lanes from b, high 4 lanes from a) // bits[3:0]=0b1111 => lanes 0-3 from b = {11,22,33,44} // bits[7:4]=0b0000 => lanes 4-7 from a = {5,6,7,8} // --------------------------------------------------------------------------- static int test_imm_0x0F(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_blend_epi32(a, b, 0x0F); print_m256i_i32("result (0x0F)", r); int32_t expected[8] = {11, 22, 33, 44, 5, 6, 7, 8}; int ok = cmp256_i32(r, expected); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 5 — imm8 = 0xAA (alternating b,a,b,a,b,a,b,a) // 0xAA = 0b10101010 // bit 0=0 => lane 0 from a = 1 // bit 1=1 => lane 1 from b = 22 // bit 2=0 => lane 2 from a = 3 // bit 3=1 => lane 3 from b = 44 // bit 4=0 => lane 4 from a = 5 // bit 5=1 => lane 5 from b = 66 // bit 6=0 => lane 6 from a = 7 // bit 7=1 => lane 7 from b = 88 // --------------------------------------------------------------------------- static int test_imm_0xAA(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_blend_epi32(a, b, 0xAA); print_m256i_i32("result (0xAA)", r); int32_t expected[8] = {1, 22, 3, 44, 5, 66, 7, 88}; int ok = cmp256_i32(r, expected); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 6 — imm8 = 0x55 (alternating a,b,a,b,a,b,a,b) // 0x55 = 0b01010101 // bit 0=1 => lane 0 from b = 11 // bit 1=0 => lane 1 from a = 2 // bit 2=1 => lane 2 from b = 33 // bit 3=0 => lane 3 from a = 4 // bit 4=1 => lane 4 from b = 55 // bit 5=0 => lane 5 from a = 6 // bit 6=1 => lane 6 from b = 77 // bit 7=0 => lane 7 from a = 8 // --------------------------------------------------------------------------- static int test_imm_0x55(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_blend_epi32(a, b, 0x55); print_m256i_i32("result (0x55)", r); int32_t expected[8] = {11, 2, 33, 4, 55, 6, 77, 8}; int ok = cmp256_i32(r, expected); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 7 — imm8 = 0x01 (single lane: only lane 0 from b) // 0x01 = 0b00000001 // bit 0=1 => lane 0 from b = 11 // all others from a // --------------------------------------------------------------------------- static int test_imm_0x01(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_blend_epi32(a, b, 0x01); print_m256i_i32("result (0x01)", r); int32_t expected[8] = {11, 2, 3, 4, 5, 6, 7, 8}; int ok = cmp256_i32(r, expected); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 8 — imm8 = 0x80 (single lane: only lane 7 from b) // 0x80 = 0b10000000 // bit 7=1 => lane 7 from b = 88 // all others from a // --------------------------------------------------------------------------- static int test_imm_0x80(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_blend_epi32(a, b, 0x80); print_m256i_i32("result (0x80)", r); int32_t expected[8] = {1, 2, 3, 4, 5, 6, 7, 88}; int ok = cmp256_i32(r, expected); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 9 — imm8 = 0x66 (inner 4 lanes from b, outer 2+2 from a) // 0x66 = 0b01100110 // bit 0=0 => lane 0 from a = 1 // bit 1=1 => lane 1 from b = 22 // bit 2=1 => lane 2 from b = 33 // bit 3=0 => lane 3 from a = 4 // bit 4=0 => lane 4 from a = 5 // bit 5=1 => lane 5 from b = 66 // bit 6=1 => lane 6 from b = 77 // bit 7=0 => lane 7 from a = 8 // --------------------------------------------------------------------------- static int test_imm_0x66(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_blend_epi32(a, b, 0x66); print_m256i_i32("result (0x66)", r); int32_t expected[8] = {1, 22, 33, 4, 5, 66, 77, 8}; int ok = cmp256_i32(r, expected); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 10 — negative values: verify blending works correctly with sign bits // --------------------------------------------------------------------------- static int test_negative_values(void) { int32_t sa[8] = {-1, -2, -3, -4, -5, -6, -7, -8}; int32_t sb[8] = {-11, -22, -33, -44, -55, -66, -77, -88}; __m256i a = _mm256_loadu_si256((__m256i *)sa); __m256i b = _mm256_loadu_si256((__m256i *)sb); print_m256i_i32("a (negative)", a); print_m256i_i32("b (negative)", b); // 0xCC = 0b11001100 // lanes 2,3,6,7 from b; lanes 0,1,4,5 from a __m256i r = _mm256_blend_epi32(a, b, 0xCC); print_m256i_i32("result (0xCC)", r); int32_t expected[8] = {-1, -2, -33, -44, -5, -6, -77, -88}; int ok = cmp256_i32(r, expected); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // main // --------------------------------------------------------------------------- int main(void) { int all_pass = 1; printf("Fixtures:\n"); print_m256i_i32("a", make_a()); print_m256i_i32("b", make_b()); printf("\n"); printf("=== Test 1: imm8=0x00 all from a ===\n"); all_pass &= test_imm_0x00(); printf("=== Test 2: imm8=0xFF all from b ===\n"); all_pass &= test_imm_0xFF(); printf("=== Test 3: imm8=0xF0 low4=a, high4=b ===\n"); all_pass &= test_imm_0xF0(); printf("=== Test 4: imm8=0x0F low4=b, high4=a ===\n"); all_pass &= test_imm_0x0F(); printf("=== Test 5: imm8=0xAA alternating a,b (even=a,odd=b) ===\n"); all_pass &= test_imm_0xAA(); printf("=== Test 6: imm8=0x55 alternating b,a (even=b,odd=a) ===\n"); all_pass &= test_imm_0x55(); printf("=== Test 7: imm8=0x01 single lane 0 from b ===\n"); all_pass &= test_imm_0x01(); printf("=== Test 8: imm8=0x80 single lane 7 from b ===\n"); all_pass &= test_imm_0x80(); printf("=== Test 9: imm8=0x66 inner pairs from b ===\n"); all_pass &= test_imm_0x66(); printf("=== Test 10: imm8=0xCC negative values ===\n"); all_pass &= test_negative_values(); printf("=== Overall: %s ===\n", all_pass ? "ALL PASS" : "SOME FAILURES"); return all_pass ? 0 : 1; } chibicc-1.0.24/test/builtin_pblendvb128.c000066400000000000000000000025701517770275000201010ustar00rootroot00000000000000#include "test.h" //#include typedef char v16qi __attribute__((vector_size(16))); static void dump(const char *name, v16qi v) { printf("%s = {", name); for (int i = 0; i < 16; i++) { printf("%d", v[i]); if (i != 15) printf(", "); } printf("}\n"); } int main(void) { // X: all positive v16qi X = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; // Y: all negative v16qi Y = { -1, -2, -3, -4, -5, -6, -7, -8, -9,-10,-11,-12,-13,-14,-15,-16 }; // Mask: select lower 8 bytes from Y (MSB=1) and upper 8 from X (MSB=0) v16qi MASK = { (signed char)0x80, (signed char)0x80, (signed char)0x80, (signed char)0x80, (signed char)0x80, (signed char)0x80, (signed char)0x80, (signed char)0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; v16qi R = (v16qi)__builtin_ia32_pblendvb128( (v16qi)X, // X (v16qi)Y, // Y (v16qi)MASK // Mask (MSB decides) ); dump("X", X); dump("Y", Y); dump("MASK", MASK); dump("R", R); // Expected: // R = { Y[0..7], X[8..15] } int ok = 1; for (int i = 0; i < 8; i++) if (R[i] != Y[i]) ok = 0; for (int i = 8; i < 16; i++) if (R[i] != X[i]) ok = 0; printf(ok ? "pblendvb128 OK\n" : "pblendvb128 FAIL\n"); return ok ? 0 : 1; }chibicc-1.0.24/test/builtin_pblendvb256.c000066400000000000000000000011411517770275000200740ustar00rootroot00000000000000#include #include #include #include "test.h" int main() { uint8_t A[32], B[32], M[32]; for (int i = 0; i < 32; i++) { A[i] = (uint8_t)(i); B[i] = (uint8_t)(100 + i); M[i] = (i & 1) ? 0x80 : 0x00; // select B on odd bytes } __m256i a, b, m; memcpy(&a, A, 32); memcpy(&b, B, 32); memcpy(&m, M, 32); __m256i r = _mm256_blendv_epi8(a, b, m); uint8_t out[32]; memcpy(out, &r, 32); for (int i = 0; i < 32; i++) { uint8_t expected = (i & 1) ? B[i] : A[i]; if (out[i] != expected) return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pcmpeqb.c000066400000000000000000000014311517770275000174740ustar00rootroot00000000000000#include "test.h" typedef char v8qi __attribute__((vector_size(8))); typedef unsigned char v8qu __attribute__((vector_size(8))); int main() { v8qi a = {1, 2, 3, 4, 5, 6, 7, 8}; v8qi b = {1, 0, 3, 0, 5, 0, 7, 0}; // Compare each byte for equality, returns 0xFF in each byte if equal, else 0x00 v8qu c = (v8qu)__builtin_ia32_pcmpeqb(a, b); // Print bytes as unsigned integers for (int i = 0; i < 8; i++) { printf("%u ", (unsigned char)c[i]); } printf("\n"); // Expected output: 255 0 255 0 255 0 255 0 ASSERT(255, c[0]); ASSERT(0, c[1]); ASSERT(255, c[2]); ASSERT(0, c[3]); ASSERT(255, c[4]); ASSERT(0, c[5]); ASSERT(255, c[6]); ASSERT(0, c[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pcmpeqd.c000066400000000000000000000007621517770275000175040ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); int main() { v2si a = {10, 20}; v2si b = {10, 30}; // Compare elements: result is 0xFFFFFFFF (-1) if equal, else 0x00000000 v2si c = __builtin_ia32_pcmpeqd(a, b); for (int i = 0; i < 2; i++) { printf("%d ", c[i]); // -1 for true, 0 for false } printf("\n"); // Expected output: -1 0 ASSERT(-1, c[0]); ASSERT(0, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pcmpeqw.c000066400000000000000000000010761517770275000175260ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {1, 2, 3, 4}; v4hi b = {1, 0, 3, 5}; // Compare words for equality: each element is 0xFFFF (-1) if equal, else 0x0000 v4hi c = __builtin_ia32_pcmpeqw(a, b); for (int i = 0; i < 4; i++) { printf("%d ", (short)c[i]); // prints -1 if equal else 0 } printf("\n"); // Expected output: -1 0 -1 0 ASSERT(-1, c[0]); ASSERT(0, c[1]); ASSERT(-1, c[2]); ASSERT(0, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pcmpgtb.c000066400000000000000000000012721517770275000175040ustar00rootroot00000000000000#include "test.h" typedef char v8qi __attribute__((vector_size(8))); int main() { v8qi a = {1, 5, -3, 4, 127, -128, 7, -1}; v8qi b = {1, 2, -5, 4, 126, -128, 8, 0}; // Compare bytes, returns 0xFF if a[i] > b[i], else 0x00 v8qi c = __builtin_ia32_pcmpgtb(a, b); for (int i = 0; i < 8; i++) { printf("%d ", (signed char)c[i]); // Will print either 0 or -1 (0xFF) } printf("\n"); // Expected output: 0 -1 -1 0 -1 0 0 -1 ASSERT(0, c[0]); ASSERT(-1, c[1]); ASSERT(-1, c[2]); ASSERT(0, c[3]); ASSERT(-1, c[4]); ASSERT(0, c[5]); ASSERT(0, c[6]); ASSERT(0, c[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pcmpgtb256.c000066400000000000000000000007221517770275000177400ustar00rootroot00000000000000#include #include #include #include "test.h" int main() { int8_t A[32], B[32]; for (int i = 0; i < 32; i++) { A[i] = i - 16; B[i] = 0; } __m256i a, b; memcpy(&a, A, 32); memcpy(&b, B, 32); __mmask32 k = _mm256_cmpgt_epi8_mask(a, b); for (int i = 0; i < 32; i++) { int expected = (A[i] > 0); int got = (k >> i) & 1; if (got != expected) return 1; } printf("Ok\n"); return 0; }chibicc-1.0.24/test/builtin_pcmpgtd.c000066400000000000000000000007571517770275000175150ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); int main() { v2si a = {10, 40}; v2si b = {20, 30}; // Compare elements: result is 0xFFFFFFFF (-1) if a[i] > b[i], else 0 v2si c = __builtin_ia32_pcmpgtd(a, b); for (int i = 0; i < 2; i++) { printf("%d ", c[i]); // -1 for true, 0 for false } printf("\n"); // Expected output: 0 -1 ASSERT(0, c[0]); ASSERT(-1, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pcmpgtw.c000066400000000000000000000010651517770275000175310ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {5, 2, 7, 1}; v4hi b = {3, 4, 7, 0}; // Compare elements: result is 0xFFFF (-1) if a[i] > b[i], else 0x0000 v4hi c = __builtin_ia32_pcmpgtw(a, b); for (int i = 0; i < 4; i++) { printf("%d ", (short)c[i]); // -1 for true, 0 for false } printf("\n"); // Expected output: -1 0 0 -1 ASSERT(-1, c[0]); ASSERT(0, c[1]); ASSERT(0, c[2]); ASSERT(-1, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pd256.c000066400000000000000000000035271517770275000167150ustar00rootroot00000000000000// test___builtin_ia32_pd_pd256.c // Compile: gcc -O2 -mavx test.c -o test && ./test #include #include #include // fabs() #include /* Helper: extract double lane i from __m256d */ static inline double get256d(__m256d v, int i) { double buf[4]; _mm256_storeu_pd(buf, v); return buf[i]; } int main(void) { /* ── Test 1: basic lane promotion ─────────────────────────── */ __m128d src = _mm_set_pd(2.0, 1.0); // lanes: [1.0, 2.0] __m256d dst = __builtin_ia32_pd_pd256(src); /* Lower 128 bits must equal src */ assert(fabs(get256d(dst, 0) - 1.0) < 1e-15); assert(fabs(get256d(dst, 1) - 2.0) < 1e-15); /* Upper 128 bits are undefined — do NOT assert their values */ /* ── Test 2: negative / subnormal values ───────────────────── */ __m128d neg = _mm_set_pd(-0.0, -1.5e-308); __m256d neg256 = __builtin_ia32_pd_pd256(neg); assert(fabs(get256d(neg256, 0) - (-1.5e-308)) < 1e-320); assert(get256d(neg256, 1) == -0.0); /* ── Test 3: NaN / Inf passthrough ────────────────────────── */ double inf = 1.0 / 0.0; double nan_val = 0.0 / 0.0; __m128d special = _mm_set_pd(inf, nan_val); __m256d sp256 = __builtin_ia32_pd_pd256(special); assert(isnan(get256d(sp256, 0))); // lane 0: NaN assert(isinf(get256d(sp256, 1))); // lane 1: +Inf /* ── Test 4: zero vector ──────────────────────────────────── */ __m256d zero256 = __builtin_ia32_pd_pd256(_mm_setzero_pd()); assert(get256d(zero256, 0) == 0.0); assert(get256d(zero256, 1) == 0.0); printf("All tests passed.\n"); return 0; } chibicc-1.0.24/test/builtin_permdi256.c000066400000000000000000000106301517770275000175630ustar00rootroot00000000000000 // test___builtin_ia32_permdi256.c // Compile: gcc -O2 -mavx2 test.c -o test && ./test // // __builtin_ia32_permdi256(src, imm8) == _mm256_permute4x64_epi64(src, imm8) // The 8-bit immediate encodes four 2-bit selectors, one per output lane: // bits [1:0] -> dst lane 0 source // bits [3:2] -> dst lane 1 source // bits [5:4] -> dst lane 2 source // bits [7:6] -> dst lane 3 source // Each 2-bit field picks a lane from src (0-3). #include #include #include #include /* Helper: extract uint64 lane i (0-3) from __m256i */ static inline uint64_t get64(__m256i v, int i) { uint64_t buf[4]; _mm256_storeu_si256((__m256i *)buf, v); return buf[i]; } int main(void) { /* Source vector with four distinct sentinel values per lane: lane 0 = 0xAAAA…, lane 1 = 0xBBBB…, lane 2 = 0xCCCC…, lane 3 = 0xDDDD… */ __m256i src = _mm256_set_epi64x( (int64_t)0xDDDDDDDDDDDDDDDDULL, // lane 3 (int64_t)0xCCCCCCCCCCCCCCCCULL, // lane 2 (int64_t)0xBBBBBBBBBBBBBBBBULL, // lane 1 (int64_t)0xAAAAAAAAAAAAAAAAULL // lane 0 ); /* ── Test 1: identity imm8 = 0b11_10_01_00 = 0xE4 ─────────── */ // dst[0]=src[0], dst[1]=src[1], dst[2]=src[2], dst[3]=src[3] __m256i r_id = __builtin_ia32_permdi256(src, 0xE4); assert(get64(r_id, 0) == 0xAAAAAAAAAAAAAAAAULL); assert(get64(r_id, 1) == 0xBBBBBBBBBBBBBBBBULL); assert(get64(r_id, 2) == 0xCCCCCCCCCCCCCCCCULL); assert(get64(r_id, 3) == 0xDDDDDDDDDDDDDDDDULL); /* ── Test 2: full reverse imm8 = 0b00_01_10_11 = 0x1B ──────── */ // dst[0]=src[3], dst[1]=src[2], dst[2]=src[1], dst[3]=src[0] __m256i r_rev = __builtin_ia32_permdi256(src, 0x1B); assert(get64(r_rev, 0) == 0xDDDDDDDDDDDDDDDDULL); assert(get64(r_rev, 1) == 0xCCCCCCCCCCCCCCCCULL); assert(get64(r_rev, 2) == 0xBBBBBBBBBBBBBBBBULL); assert(get64(r_rev, 3) == 0xAAAAAAAAAAAAAAAAULL); /* ── Test 3: broadcast lane 0 imm8 = 0b00_00_00_00 = 0x00 ──── */ __m256i r_b0 = __builtin_ia32_permdi256(src, 0x00); assert(get64(r_b0, 0) == 0xAAAAAAAAAAAAAAAAULL); assert(get64(r_b0, 1) == 0xAAAAAAAAAAAAAAAAULL); assert(get64(r_b0, 2) == 0xAAAAAAAAAAAAAAAAULL); assert(get64(r_b0, 3) == 0xAAAAAAAAAAAAAAAAULL); /* ── Test 4: broadcast lane 3 imm8 = 0b11_11_11_11 = 0xFF ──── */ __m256i r_b3 = __builtin_ia32_permdi256(src, 0xFF); assert(get64(r_b3, 0) == 0xDDDDDDDDDDDDDDDDULL); assert(get64(r_b3, 1) == 0xDDDDDDDDDDDDDDDDULL); assert(get64(r_b3, 2) == 0xDDDDDDDDDDDDDDDDULL); assert(get64(r_b3, 3) == 0xDDDDDDDDDDDDDDDDULL); /* ── Test 5: swap pairs imm8 = 0b10_11_00_01 = 0xB1 ─────────── */ // dst[0]=src[1], dst[1]=src[0], dst[2]=src[3], dst[3]=src[2] __m256i r_sp = __builtin_ia32_permdi256(src, 0xB1); assert(get64(r_sp, 0) == 0xBBBBBBBBBBBBBBBBULL); assert(get64(r_sp, 1) == 0xAAAAAAAAAAAAAAAAULL); assert(get64(r_sp, 2) == 0xDDDDDDDDDDDDDDDDULL); assert(get64(r_sp, 3) == 0xCCCCCCCCCCCCCCCCULL); /* ── Test 6: rotate left by 1 lane imm8 = 0b00_11_10_01 = 0x39 */ // dst[0]=src[1], dst[1]=src[2], dst[2]=src[3], dst[3]=src[0] __m256i r_rot = __builtin_ia32_permdi256(src, 0x39); assert(get64(r_rot, 0) == 0xBBBBBBBBBBBBBBBBULL); assert(get64(r_rot, 1) == 0xCCCCCCCCCCCCCCCCULL); assert(get64(r_rot, 2) == 0xDDDDDDDDDDDDDDDDULL); assert(get64(r_rot, 3) == 0xAAAAAAAAAAAAAAAAULL); /* ── Test 7: duplication imm8 = 0b11_11_00_00 = 0xFC ─────────── */ // dst[0]=src[0], dst[1]=src[0], dst[2]=src[3], dst[3]=src[3] __m256i r_dup = __builtin_ia32_permdi256(src, 0xFC); assert(get64(r_dup, 0) == 0xAAAAAAAAAAAAAAAAULL); assert(get64(r_dup, 1) == 0xDDDDDDDDDDDDDDDDULL); assert(get64(r_dup, 2) == 0xDDDDDDDDDDDDDDDDULL); assert(get64(r_dup, 3) == 0xDDDDDDDDDDDDDDDDULL); /* ── Test 8: round-trip — reverse twice is identity ───────────── */ __m256i r_rt = __builtin_ia32_permdi256( __builtin_ia32_permdi256(src, 0x1B), 0x1B); assert(get64(r_rt, 0) == 0xAAAAAAAAAAAAAAAAULL); assert(get64(r_rt, 1) == 0xBBBBBBBBBBBBBBBBULL); assert(get64(r_rt, 2) == 0xCCCCCCCCCCCCCCCCULL); assert(get64(r_rt, 3) == 0xDDDDDDDDDDDDDDDDULL); printf("All tests passed.\n"); return 0; } chibicc-1.0.24/test/builtin_permti256.c000066400000000000000000000230211517770275000176010ustar00rootroot00000000000000// test_avx2_permute2x128.c // Tests for _mm256_permute2x128_si256 // Compile with: cc -mavx2 -o test_avx2_permute2x128 test_avx2_permute2x128.c #include #include "test.h" #include #include // --------------------------------------------------------------------------- // The instruction: VPERM2I128 ymm, ymm, ymm, imm8 // // _mm256_permute2x128_si256(a, b, imm8) // // The imm8 byte controls which 128-bit lane goes into each half of the result: // // bits [1:0] select the SOURCE for the LOW output lane: // 0b00 = a_low 0b01 = a_high // 0b10 = b_low 0b11 = b_high // bit [3] if set, zero the LOW output lane // // bits [5:4] select the SOURCE for the HIGH output lane: // 0b00 = a_low 0b01 = a_high // 0b10 = b_low 0b11 = b_high // bit [7] if set, zero the HIGH output lane // // Encoding summary (common imm8 values): // 0x00 low=a_low, high=a_low (broadcast a_low) // 0x01 low=a_high, high=a_low // 0x02 low=b_low, high=a_low // 0x03 low=b_high, high=a_low // 0x20 low=a_low, high=b_low // 0x31 low=a_high, high=b_high (swap lanes of a) // 0x20 low=a_low, high=b_low // 0x30 low=a_low, high=b_low -- same as 0x20? no: bits[5:4]=0b11=b_high // 0x31 low=a_high, high=b_high // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // Helpers // --------------------------------------------------------------------------- static void print_m256i_i32(const char *label, __m256i v) { int32_t buf[8]; memcpy(buf, &v, 32); printf(" %-22s [%4d,%4d,%4d,%4d | %4d,%4d,%4d,%4d]\n", label, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); } static int cmp256(const __m256i result, const int32_t expected[8]) { int32_t out[8]; memcpy(out, &result, 32); return memcmp(out, expected, 32) == 0; } // --------------------------------------------------------------------------- // Fixtures // a : low lane = { 1, 2, 3, 4 } high lane = { 5, 6, 7, 8 } // b : low lane = { 9,10,11,12 } high lane = {13,14,15,16} // --------------------------------------------------------------------------- static __m256i make_a(void) { int32_t s[8] = {1, 2, 3, 4, 5, 6, 7, 8}; return _mm256_loadu_si256((__m256i *)s); } static __m256i make_b(void) { int32_t s[8] = {9, 10, 11, 12, 13, 14, 15, 16}; return _mm256_loadu_si256((__m256i *)s); } // --------------------------------------------------------------------------- // Test 1 — imm8 = 0x20 // bits[1:0]=0b00 => low output = a_low = {1,2,3,4} // bits[5:4]=0b10 => high output = b_low = {9,10,11,12} // --------------------------------------------------------------------------- static int test_imm_0x20(void) { __m256i a = make_a(), b = make_b(); print_m256i_i32("a", a); print_m256i_i32("b", b); __m256i r = _mm256_permute2x128_si256(a, b, 0x20); print_m256i_i32("result (0x20)", r); int32_t expected[8] = {1, 2, 3, 4, 9, 10, 11, 12}; int ok = cmp256(r, expected); printf(" expected [ 1, 2, 3, 4 | 9, 10, 11, 12]\n"); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 2 — imm8 = 0x31 // bits[1:0]=0b01 => low output = a_high = {5,6,7,8} // bits[5:4]=0b11 => high output = b_high = {13,14,15,16} // --------------------------------------------------------------------------- static int test_imm_0x31(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_permute2x128_si256(a, b, 0x31); print_m256i_i32("result (0x31)", r); int32_t expected[8] = {5, 6, 7, 8, 13, 14, 15, 16}; int ok = cmp256(r, expected); printf(" expected [ 5, 6, 7, 8 | 13, 14, 15, 16]\n"); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 3 — imm8 = 0x00 (broadcast a_low into both lanes) // bits[1:0]=0b00 => low output = a_low = {1,2,3,4} // bits[5:4]=0b00 => high output = a_low = {1,2,3,4} // --------------------------------------------------------------------------- static int test_imm_0x00(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_permute2x128_si256(a, b, 0x00); print_m256i_i32("result (0x00)", r); int32_t expected[8] = {1, 2, 3, 4, 1, 2, 3, 4}; int ok = cmp256(r, expected); printf(" expected [ 1, 2, 3, 4 | 1, 2, 3, 4]\n"); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 4 — imm8 = 0x11 (broadcast a_high into both lanes) // bits[1:0]=0b01 => low output = a_high = {5,6,7,8} // bits[5:4]=0b01 => high output = a_high = {5,6,7,8} // --------------------------------------------------------------------------- static int test_imm_0x11(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_permute2x128_si256(a, b, 0x11); print_m256i_i32("result (0x11)", r); int32_t expected[8] = {5, 6, 7, 8, 5, 6, 7, 8}; int ok = cmp256(r, expected); printf(" expected [ 5, 6, 7, 8 | 5, 6, 7, 8]\n"); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 5 — imm8 = 0x03 (b_high into low lane, a_low into high lane) // bits[1:0]=0b11 => low output = b_high = {13,14,15,16} // bits[5:4]=0b00 => high output = a_low = {1,2,3,4} // --------------------------------------------------------------------------- static int test_imm_0x03(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_permute2x128_si256(a, b, 0x03); print_m256i_i32("result (0x03)", r); int32_t expected[8] = {13, 14, 15, 16, 1, 2, 3, 4}; int ok = cmp256(r, expected); printf(" expected [ 13, 14, 15, 16 | 1, 2, 3, 4]\n"); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 6 — imm8 = 0x08 (zero low lane, a_low into high lane) // bit [3]=1 => low output = zeroed = {0,0,0,0} // bits[5:4]=0b00 => high output = a_low = {1,2,3,4} // --------------------------------------------------------------------------- static int test_imm_0x08(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_permute2x128_si256(a, b, 0x08); print_m256i_i32("result (0x08)", r); int32_t expected[8] = {0, 0, 0, 0, 1, 2, 3, 4}; int ok = cmp256(r, expected); printf(" expected [ 0, 0, 0, 0 | 1, 2, 3, 4]\n"); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 7 — imm8 = 0x80 (a_low into low lane, zero high lane) // bits[1:0]=0b00 => low output = a_low = {1,2,3,4} // bit [7]=1 => high output = zeroed = {0,0,0,0} // --------------------------------------------------------------------------- static int test_imm_0x80(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_permute2x128_si256(a, b, 0x80); print_m256i_i32("result (0x80)", r); int32_t expected[8] = {1, 2, 3, 4, 0, 0, 0, 0}; int ok = cmp256(r, expected); printf(" expected [ 1, 2, 3, 4 | 0, 0, 0, 0]\n"); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 8 — imm8 = 0x88 (zero both lanes) // bit [3]=1 => low output = zeroed // bit [7]=1 => high output = zeroed // --------------------------------------------------------------------------- static int test_imm_0x88(void) { __m256i a = make_a(), b = make_b(); __m256i r = _mm256_permute2x128_si256(a, b, 0x88); print_m256i_i32("result (0x88)", r); int32_t expected[8] = {0, 0, 0, 0, 0, 0, 0, 0}; int ok = cmp256(r, expected); printf(" expected [ 0, 0, 0, 0 | 0, 0, 0, 0]\n"); printf(" result: %s\n\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // main // --------------------------------------------------------------------------- int main(void) { int all_pass = 1; __m256i a = make_a(), b = make_b(); printf("Fixtures:\n"); print_m256i_i32("a (low|high)", a); print_m256i_i32("b (low|high)", b); printf("\n"); printf("=== Test 1: imm8=0x20 low=a_low, high=b_low ===\n"); all_pass &= test_imm_0x20(); printf("=== Test 2: imm8=0x31 low=a_high, high=b_high ===\n"); all_pass &= test_imm_0x31(); printf("=== Test 3: imm8=0x00 broadcast a_low ===\n"); all_pass &= test_imm_0x00(); printf("=== Test 4: imm8=0x11 broadcast a_high ===\n"); all_pass &= test_imm_0x11(); printf("=== Test 5: imm8=0x03 low=b_high, high=a_low ===\n"); all_pass &= test_imm_0x03(); printf("=== Test 6: imm8=0x08 low=zero, high=a_low ===\n"); all_pass &= test_imm_0x08(); printf("=== Test 7: imm8=0x80 low=a_low, high=zero ===\n"); all_pass &= test_imm_0x80(); printf("=== Test 8: imm8=0x88 zero both lanes ===\n"); all_pass &= test_imm_0x88(); printf("=== Overall: %s ===\n", all_pass ? "ALL PASS" : "SOME FAILURES"); return all_pass ? 0 : 1; } chibicc-1.0.24/test/builtin_phaddd.c000066400000000000000000000007171517770275000172770ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); int main() { // __builtin_ia32_phaddd: // For 2 × 32-bit values: // result = [a0+a1, b0+b1] v2si a = {100, 200}; v2si b = {5, 10}; v2si result = __builtin_ia32_phaddd(a, b); printf("%d %d\n", result[0], result[1]); // Expected: // a0+a1 = 100+200 = 300 // b0+b1 = 5+10 = 15 ASSERT(300, result[0]); ASSERT(15, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_phaddsw.c000066400000000000000000000010751517770275000175030ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {30000, 30000, -30000, -30000}; v4hi b = {20000, -20000, 20000, -20000}; v4hi r = __builtin_ia32_phaddsw(a, b); // Saturated 16-bit signed: // a0+a1 = 30000+30000 = 60000 -> saturates to 32767 // a2+a3 = -30000-30000 = -60000 -> saturates to -32768 // b0+b1 = 20000-20000 = 0 // b2+b3 = 20000-20000 = 0 ASSERT(32767, r[0]); ASSERT(-32768, r[1]); ASSERT(0, r[2]); ASSERT(0, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_phaddw.c000066400000000000000000000012041517770275000173120ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { // __builtin_ia32_phaddw: // For 4 × 16-bit values: // result = [a0+a1, a2+a3, b0+b1, b2+b3] v4hi a = {1, 2, 3, 4}; v4hi b = {10, 20, 30, 40}; v4hi result = __builtin_ia32_phaddw(a, b); printf("%d %d %d %d\n", (int)result[0], (int)result[1], (int)result[2], (int)result[3]); // Expected: // a0+a1 = 1+2 = 3 // a2+a3 = 3+4 = 7 // b0+b1 = 10+20 = 30 // b2+b3 = 30+40 = 70 ASSERT(3, result[0]); ASSERT(7, result[1]); ASSERT(30, result[2]); ASSERT(70, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_phaddw128.c000066400000000000000000000016421517770275000175530ustar00rootroot00000000000000#include "test.h" typedef short v8hi __attribute__((vector_size(16))); int main() { // Test __builtin_ia32_phaddw128 // phaddw adds adjacent 16-bit values, so: // [a0, a1, a2, a3, a4, a5, a6, a7] + [b0, b1, b2, b3, b4, b5, b6, b7] // = [a0+a1, a2+a3, a4+a5, a6+a7, b0+b1, b2+b3, b4+b5, b6+b7] v8hi a = {1, 2, 3, 4, 5, 6, 7, 8}; v8hi b = {10, 20, 30, 40, 50, 60, 70, 80}; v8hi result = __builtin_ia32_phaddw128(a, b); for (int i = 0; i < 8; i++) { printf("%d ", (int)result[i]); } // Expected: [3, 7, 11, 15, 30, 70, 110, 150] // a0+a1=1+2=3, a2+a3=3+4=7, a4+a5=5+6=11, a6+a7=7+8=15 // b0+b1=10+20=30, b2+b3=30+40=70, b4+b5=50+60=110, b6+b7=70+80=150 ASSERT(3, result[0]); ASSERT(7, result[1]); ASSERT(11, result[2]); ASSERT(15, result[3]); ASSERT(30, result[4]); ASSERT(70, result[5]); ASSERT(110, result[6]); ASSERT(150, result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_phminposuw128.c000066400000000000000000000010211517770275000205040ustar00rootroot00000000000000#include "test.h" #include typedef uint16_t u16; typedef int16_t i16; typedef i16 v8hi __attribute__((vector_size(16))); int main() { v8hi a = {100, 200, 50, 400, 10, 300, 250, 150}; v8hi r = __builtin_ia32_phminposuw128(a); printf("min value = %u, index = %u\n", r[0], r[1]); // Expected: min=10, index=4 if (r[0] != 10 || r[1] != 4) { printf("phminposuw128 FAIL\n"); return 1; } ASSERT(10, r[0]); ASSERT(4, r[1]); printf("phminposuw128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_phsub128.c000066400000000000000000000013741517770275000174270ustar00rootroot00000000000000#include "test.h" typedef short v8hi __attribute__((vector_size(16))); int main() { // Input vectors v8hi a = {10, 1, 50, 10, 100, 25, 7, 3}; v8hi b = {20, 5, 40, 10, 80, 60, 100, 30}; // phsubw128 performs: // [a0 - a1, a2 - a3, a4 - a5, a6 - a7, // b0 - b1, b2 - b3, b4 - b5, b6 - b7] v8hi result = __builtin_ia32_phsubw128(a, b); // expected: // a0-a1 = 10-1 = 9 // a2-a3 = 50-10 = 40 // a4-a5 = 100-25 = 75 // a6-a7 = 7-3 = 4 // b0-b1 = 20-5 = 15 // b2-b3 = 40-10 = 30 // b4-b5 = 80-60 = 20 // b6-b7 = 100-30 = 70 short expected[8] = {9, 40, 75, 4, 15, 30, 20, 70}; for (int i = 0; i < 8; i++) { ASSERT(expected[i], result[i]); } printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_phsubd.c000066400000000000000000000004541517770275000173360ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); int main() { v2si a = { 100, 200 }; v2si b = { 10, 20 }; v2si r = __builtin_ia32_phsubd(a, b); ASSERT(-100, r[0]); // 100 - 200 ASSERT(-10, r[1]); // 10 - 20 printf("phsubd OK\n"); return 0; } chibicc-1.0.24/test/builtin_phsubd128.c000066400000000000000000000007061517770275000175710ustar00rootroot00000000000000#include "test.h" typedef int v4si __attribute__((vector_size(16))); int main() { // Pairwise subtract 32-bit: // [a0-a1, a2-a3, b0-b1, b2-b3] v4si a = {10, 2, 100, 30}; v4si b = {50, 5, 300, 100}; v4si r = __builtin_ia32_phsubd128(a, b); ASSERT(8, r[0]); // 10 - 2 ASSERT(70, r[1]); // 100 - 30 ASSERT(45, r[2]); // 50 - 5 ASSERT(200, r[3]); // 300 - 100 printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_phsubsw.c000066400000000000000000000010521517770275000175370ustar00rootroot00000000000000#include "test.h" #include typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = { 30000, -30000, 20000, -20000 }; v4hi b = { -10000, 10000, -20000, 20000 }; v4hi r = __builtin_ia32_phsubsw(a, b); // Saturating subtraction: // 30000 - (-30000) = 32767 // 20000 - (-20000) = 32767 // -10000 - 10000 = -20000 // -20000 - 20000 = -32768 ASSERT(32767, r[0]); ASSERT(32767, r[1]); ASSERT(-20000, r[2]); ASSERT(-32768, r[3]); printf("phsubsw OK\n"); return 0; } chibicc-1.0.24/test/builtin_phsubsw128.c000066400000000000000000000033551517770275000200020ustar00rootroot00000000000000#include "test.h" typedef short v8hi __attribute__((vector_size(16))); typedef int v4si __attribute__((vector_size(16))); int main() { // ===== phsubw128 ===== v8hi a = {1, 2, 3, 4, 5, 6, 7, 8}; v8hi b = {10, 20, 30, 40, 50, 60, 70, 80}; // phsubw: subtract adjacent 16-bit elements v8hi result_w = __builtin_ia32_phsubw128(a, b); // expected: [1-2=-1, 3-4=-1, 5-6=-1, 7-8=-1, 10-20=-10, 30-40=-10, 50-60=-10, 70-80=-10] ASSERT(-1, result_w[0]); ASSERT(-1, result_w[1]); ASSERT(-1, result_w[2]); ASSERT(-1, result_w[3]); ASSERT(-10, result_w[4]); ASSERT(-10, result_w[5]); ASSERT(-10, result_w[6]); ASSERT(-10, result_w[7]); // ===== phsubd128 ===== v4si c = {100, 200, 300, 400}; v4si d = {10, 20, 30, 40}; v4si result_d = __builtin_ia32_phsubd128(c, d); // expected: [100-200=-100, 300-400=-100, 10-20=-10, 30-40=-10] ASSERT(-100, result_d[0]); ASSERT(-100, result_d[1]); ASSERT(-10, result_d[2]); ASSERT(-10, result_d[3]); // ===== phsubsw128 (saturated 16-bit subtraction) ===== v8hi e = {30000, -30000, 20000, -20000, 10000, -10000, 0, 0}; v8hi f = {-10000, 10000, -20000, 20000, -30000, 30000, 0, 0}; v8hi result_sw = __builtin_ia32_phsubsw128(e, f); // expected: saturating subtraction // [30000-(-30000)=32767, 20000-(-20000)=32767, 10000-(-10000)=32767, 0-0=0, // -10000-10000=-20000, -20000-20000=-32768, 0-0=0, 0-0=0] ASSERT(32767, result_sw[0]); ASSERT(32767, result_sw[1]); ASSERT(20000, result_sw[2]); ASSERT(0, result_sw[3]); ASSERT(-20000, result_sw[4]); ASSERT(-32768, result_sw[5]); ASSERT(-32768, result_sw[6]); ASSERT(0, result_sw[7]); printf("All PHSUB tests OK\n"); return 0; } chibicc-1.0.24/test/builtin_phsubw.c000066400000000000000000000011751517770275000173620ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { // MMX version: __builtin_ia32_phsubw // Operates on 4×16-bit elements, grouping pairs: // result = [a0 - a1, a2 - a3, b0 - b1, b2 - b3] v4hi a = { 1, 5, 10, 40 }; v4hi b = { 100, 90, 7, 7 }; v4hi r = __builtin_ia32_phsubw(a, b); // Compute expected: // a0 - a1 = 1 - 5 = -4 // a2 - a3 = 10 - 40 = -30 // b0 - b1 = 100 - 90 = 10 // b2 - b3 = 7 - 7 = 0 ASSERT(-4, r[0]); ASSERT(-30, r[1]); ASSERT(10, r[2]); ASSERT(0, r[3]); printf("phsubw (MMX) OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmaddubsw.c000066400000000000000000000013551517770275000200400ustar00rootroot00000000000000#include "test.h" #include typedef unsigned char v8qi __attribute__((vector_size(8))); // MMX args typedef short v4hi __attribute__((vector_size(8))); // MMX result int main() { // pmaddubsw operates pairwise: // (a0 * b0) + (a1 * b1), saturating to int16_t v8qi a = { 1, 2, 3, 4, 5, 6, 7, 8 }; v8qi b = {10,20, 30,40, 50,60, 70,80 }; v4hi r = __builtin_ia32_pmaddubsw(a, b); // expected: // (1*10 + 2*20) = 10 + 40 = 50 // (3*30 + 4*40) = 90 +160 = 250 // (5*50 + 6*60) = 250+360 = 610 // (7*70 + 8*80) = 490+640 = 1130 ASSERT(50, r[0]); ASSERT(250, r[1]); ASSERT(610, r[2]); ASSERT(1130, r[3]); printf("pmaddubsw (MMX) OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmaddubsw128.c000066400000000000000000000021211517770275000202630ustar00rootroot00000000000000#include "test.h" typedef signed char v16qi __attribute__((vector_size(16))); typedef short v8hi __attribute__((vector_size(16))); int main() { // Unsigned bytes in a, signed bytes in b. // pmaddubsw: multiply unsigned a[i] * signed b[i], // pairwise add into 16-bit with saturation. v16qi a = { 10, 20, 30, -1, 40, 50, 60, 70, 80, 90, 100,110, 120,127, 200,255 }; v16qi b = { 1, -2, 3, 4, -5, 6, -7, 8, -9,10, -11,12, -13,14, -15,16 }; v8hi r = __builtin_ia32_pmaddubsw128(a, b); // Compute expected results pairwise: // r[i] = a[2*i] * b[2*i] + a[2*i+1] * b[2*i+1] short exp[8]; for (int i = 0; i < 8; i++) { int t0 = (unsigned char)a[2*i] * (signed char)b[2*i]; int t1 = (unsigned char)a[2*i+1] * (signed char)b[2*i+1]; int sum = t0 + t1; if (sum > 32767) sum = 32767; if (sum < -32768) sum = -32768; exp[i] = sum; } for (int i = 0; i < 8; i++) { ASSERT(exp[i], r[i]); } printf("pmaddubsw128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmaddwd.c000066400000000000000000000011471517770275000174710ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {1, 2, 3, 4}; v4hi b = {5, 6, 7, 8}; v4hi result = (v4hi)__builtin_ia32_pmaddwd(a, b); for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } ASSERT(1, a[0]); ASSERT(2, a[1]); ASSERT(3, a[2]); ASSERT(4, a[3]); ASSERT(5, b[0]); ASSERT(6, b[1]); ASSERT(7, b[2]); ASSERT(8, b[3]); ASSERT(17, result[0]); ASSERT(0, result[1]); ASSERT(53, result[2]); ASSERT(0, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmaddwd128.c000066400000000000000000000014441517770275000177240ustar00rootroot00000000000000#include "test.h" #include typedef short v8hi __attribute__((vector_size(16))); typedef int v4si __attribute__((vector_size(16))); v4si pmaddwd128_test(v8hi a, v8hi b) { return __builtin_ia32_pmaddwd128(a, b); } int main() { v8hi a = {1, 2, 3, 4, -5, -6, 7, 8}; v8hi b = {10, 20, 30, 40, 50, 60, -70, -80}; v4si res = pmaddwd128_test(a, b); printf("%d %d %d %d\n", res[0], res[1], res[2], res[3]); // Expected: // res[0] = (1*10 + 2*20) = 10 + 40 = 50 // res[1] = (3*30 + 4*40) = 90 + 160 = 250 // res[2] = (-5*50 + -6*60) = -250 + -360 = -610 // res[3] = (7*-70 + 8*-80) = -490 + -640 = -1130 ASSERT(50, res[0]); ASSERT(250, res[1]); ASSERT(-610, res[2]); ASSERT(-1130, res[3]); printf("OK\n"); } chibicc-1.0.24/test/builtin_pmaxsb128.c000066400000000000000000000015601517770275000175750ustar00rootroot00000000000000#include "test.h" typedef char v16qi __attribute__((vector_size(16))); v16qi test_max(v16qi x, v16qi y) { return __builtin_ia32_pmaxsb128(x, y); } int main() { v16qi X = { 1, -2, 3, -4, 5, -6, 7, -8, 100, -100, 50, -50, 1, 2, 3, 4 }; v16qi Y = { -1, 2, -3, 4, -5, 6, -7, 8, -90, -200, 60, -60, 0, 3, 5, 2 }; v16qi R = test_max(X, Y); printf("X = {"); for (int i=0;i<16;i++) printf("%d%s", X[i], i==15?"} \n":", "); printf("Y = {"); for (int i=0;i<16;i++) printf("%d%s", Y[i], i==15?"} \n":", "); printf("R = {"); for (int i=0;i<16;i++) printf("%d%s", R[i], i==15?"} \n":", "); // Expected element-wise signed max int ok = 1; for (int i=0;i<16;i++) { signed char e = X[i] > Y[i] ? X[i] : Y[i]; if (R[i] != e) ok = 0; } printf("pmaxsb128 %s\n", ok ? "OK" : "FAIL"); return ok ? 0 : 1; } chibicc-1.0.24/test/builtin_pmaxsw.c000066400000000000000000000007561517770275000173750ustar00rootroot00000000000000#include "test.h" // Define a 4-element short vector type (like __v4hi) typedef short v4hi __attribute__((vector_size(8))); int main(void) { v4hi a = {10, 20, 30, 40}; v4hi b = {15, 15, 35, 35}; v4hi c = __builtin_ia32_pmaxsw(a, b); printf("Result: %hd %hd %hd %hd\n", c[0], c[1], c[2], c[3]); // Expected output: 15 20 35 40 ASSERT(15, c[0]); ASSERT(20, c[1]); ASSERT(35, c[2]); ASSERT(40, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmaxsw128.c000066400000000000000000000011771517770275000176260ustar00rootroot00000000000000#include "test.h" typedef short short8 __attribute__((vector_size(16))); int main() { short8 a = {1000, -2000, 3000, -4000, 5000, -6000, 7000, -8000}; short8 b = {-1000, 2000, -3000, 4000, -5000, 6000, -7000, 8000}; short8 c = __builtin_ia32_pmaxsw128(a, b); // signed max per lane for(int i = 0; i < 8; i++) { printf("%d ", c[i]); } printf("\n"); ASSERT(1000, c[0]); ASSERT(2000, c[1]); ASSERT(3000, c[2]); ASSERT(4000, c[3]); ASSERT(5000, c[4]); ASSERT(6000, c[5]); ASSERT(7000, c[6]); ASSERT(8000, c[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmaxub.c000066400000000000000000000013131517770275000173400ustar00rootroot00000000000000#include "test.h" typedef unsigned char v8qu __attribute__((vector_size(8))); typedef char v8qi __attribute__((vector_size(8))); int main(void) { v8qu a = {1, 200, 3, 250, 5, 10, 7, 100}; v8qu b = {100, 100, 200, 200, 0, 20, 10, 90}; v8qi c = __builtin_ia32_pmaxub((v8qi)a, (v8qi)b); v8qu d = (v8qu)c; for (int i = 0; i < 8; i++) { printf("%u ", (unsigned)c[i]); } printf("\n"); // Expected output: 100 200 200 250 5 20 10 100 ASSERT(100, d[0]); ASSERT(200, d[1]); ASSERT(200, d[2]); ASSERT(250, d[3]); ASSERT(5, d[4]); ASSERT(20, d[5]); ASSERT(10, d[6]); ASSERT(100, d[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmaxub128.c000066400000000000000000000016431517770275000176010ustar00rootroot00000000000000#include "test.h" typedef unsigned char uchar16 __attribute__((vector_size(16))); typedef char char16 __attribute__((vector_size(16))); int main() { char16 a = {1, 200, 3, 150, 5, 250, 7, 100, 9, 50, 11, 25, 13, 75, 15, 0}; char16 b = {100, 50, 200, 100, 150, 0, 50, 200, 250, 25, 5, 255, 0, 100, 20, 10}; uchar16 c = (uchar16)__builtin_ia32_pmaxub128(a, b); // unsigned max per 8-bit lane for(int i = 0; i < 16; i++) { printf("%u ", c[i]); } printf("\n"); ASSERT(100, c[0]); ASSERT(200, c[1]); ASSERT(200, c[2]); ASSERT(150, c[3]); ASSERT(150, c[4]); ASSERT(250, c[5]); ASSERT(50, c[6]); ASSERT(200, c[7]); ASSERT(250, c[8]); ASSERT(50, c[9]); ASSERT(11, c[10]); ASSERT(255, c[11]); ASSERT(13, c[12]); ASSERT(100, c[13]); ASSERT(20, c[14]); ASSERT(10, c[15]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pminmaxsd128.c000066400000000000000000000025151517770275000203040ustar00rootroot00000000000000#include "test.h" #include typedef int32_t s32; typedef s32 v4si __attribute__((vector_size(16))); // 4 x 32-bit signed // Prototypes for the builtins v4si __builtin_ia32_pminsd128(v4si x, v4si y); v4si __builtin_ia32_pmaxsd128(v4si x, v4si y); int main() { v4si a = {1000, -2000, 3000, -4000}; v4si b = {1500, -2500, 2500, -3500}; // Call the builtins v4si min_res = __builtin_ia32_pminsd128(a, b); v4si max_res = __builtin_ia32_pmaxsd128(a, b); printf("pminsd128 result: "); for (int i = 0; i < 4; i++) { printf("%d ", (int)min_res[i]); } printf("\n"); printf("pmaxsd128 result: "); for (int i = 0; i < 4; i++) { printf("%d ", (int)max_res[i]); } printf("\n"); // Expected results s32 expected_min[4] = {1000, -2500, 2500, -4000}; s32 expected_max[4] = {1500, -2000, 3000, -3500}; for (int i = 0; i < 4; i++) { if (min_res[i] != expected_min[i]) { printf("pminsd128 FAIL at index %d: got %d, expected %d\n", i, (int)min_res[i], expected_min[i]); return 1; } if (max_res[i] != expected_max[i]) { printf("pmaxsd128 FAIL at index %d: got %d, expected %d\n", i, (int)max_res[i], expected_max[i]); return 1; } } printf("pminsd128 and pmaxsd128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pminmaxud128.c000066400000000000000000000024501517770275000203040ustar00rootroot00000000000000#include "test.h" #include typedef uint32_t u32; typedef int32_t i32; typedef u32 v4su __attribute__((vector_size(16))); // 4 x 32-bit unsigned typedef i32 v4si __attribute__((vector_size(16))); // 4 x 32-bit signed int main() { v4si a = {1000, 2000, 3000, 4000}; v4si b = {1500, 1500, 3500, 3500}; // Call the builtins v4si min_res = __builtin_ia32_pminud128(a, b); v4si max_res = __builtin_ia32_pmaxud128(a, b); printf("pminud128 result: "); for (int i = 0; i < 4; i++) { printf("%u ", (unsigned)min_res[i]); } printf("\n"); printf("pmaxud128 result: "); for (int i = 0; i < 4; i++) { printf("%u ", (unsigned)max_res[i]); } printf("\n"); // Expected results u32 expected_min[4] = {1000, 1500, 3000, 3500}; u32 expected_max[4] = {1500, 2000, 3500, 4000}; for (int i = 0; i < 4; i++) { if (min_res[i] != expected_min[i]) { printf("pminud128 FAIL at index %d: got %u, expected %u\n", i, min_res[i], expected_min[i]); return 1; } if (max_res[i] != expected_max[i]) { printf("pmaxud128 FAIL at index %d: got %u, expected %u\n", i, max_res[i], expected_max[i]); return 1; } } printf("pminud128 and pmaxud128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pminmaxuw128.c000066400000000000000000000031111517770275000203220ustar00rootroot00000000000000#include "test.h" #include //#include typedef uint16_t u16; typedef int16_t i16; typedef u16 v8hu __attribute__((vector_size(16))); // 8 x 16-bit unsigned typedef i16 v8hi __attribute__((vector_size(16))); // 8 x 16-bit unsigned // // Provide prototypes for the builtins so we can test them // v8hu __builtin_ia32_pminuw128(v8hu x, v8hu y); // v8hu __builtin_ia32_pmaxuw128(v8hu x, v8hu y); int main() { v8hu a = {100, 200, 300, 400, 500, 600, 700, 800}; v8hu b = {150, 150, 350, 350, 450, 650, 650, 750}; // Call the builtins v8hu min_res = (v8hu)__builtin_ia32_pminuw128((v8hi)a, (v8hi)b); v8hu max_res = (v8hu)__builtin_ia32_pmaxuw128((v8hi)a, (v8hi)b); printf("pminuw128 result: "); for (int i = 0; i < 8; i++) { printf("%u ", (unsigned)min_res[i]); } printf("\n"); printf("pmaxuw128 result: "); for (int i = 0; i < 8; i++) { printf("%u ", (unsigned)max_res[i]); } printf("\n"); // Expected results u16 expected_min[8] = {100, 150, 300, 350, 450, 600, 650, 750}; u16 expected_max[8] = {150, 200, 350, 400, 500, 650, 700, 800}; for (int i = 0; i < 8; i++) { if (min_res[i] != expected_min[i]) { printf("pminuw128 FAIL at index %d: got %u, expected %u\n", i, min_res[i], expected_min[i]); return 1; } if (max_res[i] != expected_max[i]) { printf("pmaxuw128 FAIL at index %d: got %u, expected %u\n", i, max_res[i], expected_max[i]); return 1; } } printf("pminuw128 and pmaxuw128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pminsb128.c000066400000000000000000000013431517770275000175720ustar00rootroot00000000000000#include "test.h" typedef char v16qi __attribute__((vector_size(16))); v16qi f(v16qi x, v16qi y) { return __builtin_ia32_pminsb128(x, y); } int main() { v16qi X = {1, -5, 20, -30, 7, 8, -9, 10, 30, -40, 50, -60, 70, -80, 90, -100}; v16qi Y = {2, -10,15, -25, 9,-12, -3, 40, -31, -5, 60, -70, 60, -90, 95, -90}; v16qi R = f(X, Y); printf("R = {"); for (int i=0;i<16;i++) printf("%d%s", R[i], i<15?", ":""); printf("}\n"); // Expected signed byte-wise min char expect[16]; for (int i=0;i<16;i++) expect[i] = X[i] < Y[i] ? X[i] : Y[i]; int ok = 1; for (int i=0;i<16;i++) if (R[i] != expect[i]) ok = 0; printf("pminsb128 %s\n", ok ? "OK" : "FAIL"); return 0; } chibicc-1.0.24/test/builtin_pminsw.c000066400000000000000000000010601517770275000173600ustar00rootroot00000000000000#include "test.h" typedef short __v4hi __attribute__((vector_size(8))); int main(void) { __v4hi a = {-1900, -2000, 3000, -4000}; __v4hi b = {-1000, -2500, -3000, 4000}; // Compute pairwise signed minimum using the builtin intrinsic __v4hi r = __builtin_ia32_pminsw(a, b); // Print results for (int i = 0; i < 4; i++) { printf("r[%d] = %d\n", i, r[i]); } ASSERT(-1900, r[0]); ASSERT(-2500, r[1]); ASSERT(-3000, r[2]); ASSERT(-4000, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pminsw128.c000066400000000000000000000012071517770275000176160ustar00rootroot00000000000000#include "test.h" typedef short short8 __attribute__((vector_size(16))); int main() { short8 a = {1000, -2000, 3000, -4000, 5000, -6000, 7000, -8000}; short8 b = {-1000, 2000, -3000, 4000, -5000, 6000, -7000, 8000}; short8 c = __builtin_ia32_pminsw128(a, b); // signed min per lane for(int i = 0; i < 8; i++) { printf("%d ", c[i]); } printf("\n"); ASSERT(-1000, c[0]); ASSERT(-2000, c[1]); ASSERT(-3000, c[2]); ASSERT(-4000, c[3]); ASSERT(-5000, c[4]); ASSERT(-6000, c[5]); ASSERT(-7000, c[6]); ASSERT(-8000, c[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pminub.c000066400000000000000000000013561517770275000173450ustar00rootroot00000000000000#include "test.h" typedef char __v8qi __attribute__((vector_size(8))); typedef unsigned char __v8qu __attribute__((vector_size(8))); int main(void) { __v8qi a = {100, 250, 30, 40, 200, 60, 70, 80}; __v8qi b = {150, 200, 50, 20, 180, 70, 60, 90}; __v8qi r = __builtin_ia32_pminub(a, b); __v8qu r2 = (__v8qu) r; for (int i = 0; i < 8; i++) { printf("r[%d] = %u\n", i, r[i]); } for (int i = 0; i < 8; i++) { printf("r2[%d] = %u\n", i, r2[i]); } ASSERT(100, r2[0]); ASSERT(200, r2[1]); ASSERT(30, r2[2]); ASSERT(20, r2[3]); ASSERT(180, r2[4]); ASSERT(60, r2[5]); ASSERT(60, r2[6]); ASSERT(80, r2[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pminub128.c000066400000000000000000000016261517770275000176000ustar00rootroot00000000000000#include "test.h" typedef unsigned char uchar16 __attribute__((vector_size(16))); typedef char char16 __attribute__((vector_size(16))); int main() { char16 a = {1, 200, 3, 150, 5, 250, 7, 100, 9, 50, 11, 25, 13, 75, 15, 0}; char16 b = {100, 50, 200, 100, 150, 0, 50, 200, 250, 25, 5, 255, 0, 100, 20, 10}; uchar16 c = (uchar16)__builtin_ia32_pminub128(a, b); // unsigned min per 8-bit lane for(int i = 0; i < 16; i++) { printf("%u ", c[i]); } printf("\n"); ASSERT(1, c[0]); ASSERT(50, c[1]); ASSERT(3, c[2]); ASSERT(100, c[3]); ASSERT(5, c[4]); ASSERT(0, c[5]); ASSERT(7, c[6]); ASSERT(100, c[7]); ASSERT(9, c[8]); ASSERT(25, c[9]); ASSERT(5, c[10]); ASSERT(25, c[11]); ASSERT(0, c[12]); ASSERT(75, c[13]); ASSERT(15, c[14]); ASSERT(0, c[15]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovmskb.c000066400000000000000000000005751517770275000177130ustar00rootroot00000000000000#include "test.h" typedef char __v8qi __attribute__((vector_size(8))); int main(void) { __v8qi a = {0x80, 0x00, 0xFF, 0x01, 0x00, 0x80, 0x7F, 0x00}; // Extract MSB of each byte into a mask unsigned int mask = (unsigned int)__builtin_ia32_pmovmskb(a); printf("mask = 0x%x\n", mask); ASSERT(0x25, mask); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovmskb128.c000066400000000000000000000007721517770275000201450ustar00rootroot00000000000000#include "test.h" typedef char char16 __attribute__((vector_size(16))); typedef unsigned char uchar16 __attribute__((vector_size(16))); int main() { // Only the MSB of each byte matters char16 a = { 0x80, 0x7F, 0xFF, 0x01, 0x00, 0xC0, 0x20, 0xF0, 0x10, 0x08, 0x04, 0x02, 0x81, 0x82, 0x83, 0x84 }; int mask = __builtin_ia32_pmovmskb128(a); printf("%04X\n", mask); ASSERT(0xF0A5, mask); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovsxbd128.c000066400000000000000000000012711517770275000201440ustar00rootroot00000000000000#include "test.h" #include typedef char s8; typedef int s32; typedef s8 v16qi __attribute__((vector_size(16))); typedef s32 v4si __attribute__((vector_size(16))); int main() { v16qi a = {1, -2, 3, -4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; v4si r = __builtin_ia32_pmovsxbd128(a); printf("Result: "); for (int i = 0; i < 4; i++) printf("%d ", r[i]); printf("\n"); // Expected: 1 -2 3 -4 if (r[0] != 1 || r[1] != -2 || r[2] != 3 || r[3] != -4) { printf("pmovsxbd128 FAIL\n"); return 1; } ASSERT(1, r[0]); ASSERT(-2, r[1]); ASSERT(3, r[2]); ASSERT(-4, r[3]); printf("pmovsxbd128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovsxbq128.c000066400000000000000000000013721517770275000201630ustar00rootroot00000000000000#include "test.h" #include // Vector types typedef char s8; typedef long long s64; typedef s8 v16qi __attribute__((vector_size(16))); // 16 × 8-bit signed typedef s64 v2di __attribute__((vector_size(16))); // 2 × 64-bit signed int main() { // Input vector: lowest 2 bytes will be sign-extended v16qi a = {1, -2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; v2di r = __builtin_ia32_pmovsxbq128(a); printf("Result: "); for (int i = 0; i < 2; i++) printf("%lld ", (long long)r[i]); printf("\n"); // Expected: 1 -2 if (r[0] != 1 || r[1] != -2) { printf("pmovsxbq128 FAIL\n"); return 1; } ASSERT(1, r[0]); ASSERT(-2, r[1]); printf("pmovsxbq128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovsxbw128.c000066400000000000000000000017541517770275000201750ustar00rootroot00000000000000#include "test.h" #include // Vector types typedef char s8; typedef short s16; typedef s8 v16qi __attribute__((vector_size(16))); // 16 × 8-bit signed typedef s16 v8hi __attribute__((vector_size(16))); // 8 × 16-bit signed int main() { // Input vector: lowest 8 bytes will be sign-extended v16qi a = {1, -2, 3, -4, 5, -6, 7, -8, 9, 10, 11, 12, 13, 14, 15, 16}; v8hi r = __builtin_ia32_pmovsxbw128(a); printf("Result: "); for (int i = 0; i < 8; i++) printf("%d ", (int)r[i]); printf("\n"); // Expected: 1 -2 3 -4 5 -6 7 -8 int expected[] = {1, -2, 3, -4, 5, -6, 7, -8}; for (int i = 0; i < 8; i++) { if ((int)r[i] != expected[i]) { printf("pmovsxbw128 FAIL\n"); return 1; } } ASSERT(1, r[0]); ASSERT(-2, r[1]); ASSERT(3, r[2]); ASSERT(-4, r[3]); ASSERT(5, r[4]); ASSERT(-6, r[5]); ASSERT(7, r[6]); ASSERT(-8, r[7]); printf("pmovsxbw128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovsxdq128.c000066400000000000000000000013471517770275000201670ustar00rootroot00000000000000#include "test.h" #include // Vector types typedef int s32; typedef long long s64; typedef s32 v4si __attribute__((vector_size(16))); // 4 × 32-bit signed typedef s64 v2di __attribute__((vector_size(16))); // 2 × 64-bit signed int main() { // Input vector: lowest 2 elements will be sign-extended v4si a = {100, -200, 300, -400}; v2di r = __builtin_ia32_pmovsxdq128(a); printf("Result: "); for (int i = 0; i < 2; i++) printf("%lld ", (long long)r[i]); printf("\n"); // Expected: 100 -200 if (r[0] != 100 || r[1] != -200) { printf("pmovsxdq128 FAIL\n"); return 1; } ASSERT(100, r[0]); ASSERT(-200, r[1]); printf("pmovsxdq128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovsxwd128.c000066400000000000000000000013271517770275000201730ustar00rootroot00000000000000#include "test.h" #include typedef short s16; typedef int s32; typedef s16 v8hi __attribute__((vector_size(16))); typedef s32 v4si __attribute__((vector_size(16))); int main() { v8hi a = {1000, -2000, 3000, -4000, 5000, 6000, 7000, 8000}; v4si r = __builtin_ia32_pmovsxwd128(a); printf("Result: "); for (int i = 0; i < 4; i++) printf("%d ", r[i]); printf("\n"); // Expected: 1000 -2000 3000 -4000 if (r[0] != 1000 || r[1] != -2000 || r[2] != 3000 || r[3] != -4000) { printf("pmovsxwd128 FAIL\n"); return 1; } ASSERT(1000, r[0]); ASSERT(-2000, r[1]); ASSERT(3000, r[2]); ASSERT(-4000, r[3]); printf("pmovsxwd128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovsxwq128.c000066400000000000000000000014211517770275000202030ustar00rootroot00000000000000#include "test.h" #include // Vector types typedef short s16; typedef long long s64; typedef s16 v8hi __attribute__((vector_size(16))); // 8 × 16-bit signed typedef s64 v2di __attribute__((vector_size(16))); // 2 × 64-bit signed int main() { // Input vector: lowest 2 words (16-bit) will be sign-extended v8hi a = {1000, -2000, 3000, -4000, 5000, 6000, 7000, 8000}; v2di r = __builtin_ia32_pmovsxwq128(a); printf("Result: "); for (int i = 0; i < 2; i++) printf("%lld ", (long long)r[i]); printf("\n"); // Expected: 1000 -2000 if (r[0] != 1000 || r[1] != -2000) { printf("pmovsxwq128 FAIL\n"); return 1; } ASSERT(1000, r[0]); ASSERT(-2000, r[1]); printf("pmovsxwq128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovzxb128.c000066400000000000000000000020141517770275000200030ustar00rootroot00000000000000#include "test.h" #include // Vector types typedef char s8; typedef short s16; typedef s8 v16qi __attribute__((vector_size(16))); // 16 × 8-bit signed typedef s16 v8hi __attribute__((vector_size(16))); // 8 × 16-bit signed int main() { // Input vector: lowest 8 bytes will be zero-extended v16qi a = {1, -2, 3, -4, 5, -6, 7, -8, 9, 10, 11, 12, 13, 14, 15, 16}; v8hi r = __builtin_ia32_pmovzxbw128(a); printf("Result: "); for (int i = 0; i < 8; i++) printf("%d ", r[i]); printf("\n"); // Expected: 1 254 3 252 5 250 7 248 (zero-extended lowest 8 bytes) int expected[] = {1, 254, 3, 252, 5, 250, 7, 248}; for (int i = 0; i < 8; i++) { if (r[i] != expected[i]) { printf("pmovzxbw128 FAIL\n"); return 1; } } ASSERT(1, r[0]); ASSERT(254, r[1]); ASSERT(3, r[2]); ASSERT(252, r[3]); ASSERT(5, r[4]); ASSERT(250, r[5]); ASSERT(7, r[6]); ASSERT(248, r[7]); printf("pmovzxbw128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovzxbd128.c000066400000000000000000000016451517770275000201600ustar00rootroot00000000000000#include "test.h" #include // Vector types typedef char s8; typedef int s32; typedef s8 v16qi __attribute__((vector_size(16))); // 16 × 8-bit signed typedef s32 v4si __attribute__((vector_size(16))); // 4 × 32-bit signed int main() { // Input vector: lowest 4 bytes will be zero-extended v16qi a = {1, -2, 3, -4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; v4si r = __builtin_ia32_pmovzxbd128(a); printf("Result: "); for (int i = 0; i < 4; i++) printf("%d ", r[i]); printf("\n"); // Expected: 1 254 3 252 (since -2 → 0xFE, -4 → 0xFC zero-extended) int expected[] = {1, 254, 3, 252}; for (int i = 0; i < 4; i++) { if (r[i] != expected[i]) { printf("pmovzxbd128 FAIL\n"); return 1; } } ASSERT(1, r[0]); ASSERT(254, r[1]); ASSERT(3, r[2]); ASSERT(252, r[3]); printf("pmovzxbd128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovzxbq128.c000066400000000000000000000010121517770275000201610ustar00rootroot00000000000000#include "test.h" #include typedef char s8; typedef long long s64; typedef s8 v16qi __attribute__((vector_size(16))); // 16 × 8-bit typedef s64 v8di __attribute__((vector_size(16))); // 2 × 64-bit int main() { v16qi a = {1, -2, 3, -4, 5, -6, 7, -8, 9, 10, 11, 12, 13, 14, 15, 16}; v8di r = __builtin_ia32_pmovzxbq128(a); for(int i=0;i<8;i++) printf("%lld ", r[i]); printf("\n"); ASSERT(1, r[0]); ASSERT(254, r[1]); printf("pmovzxbq128 OK\n"); printf("\n"); return 0; } chibicc-1.0.24/test/builtin_pmovzxbw128.c000066400000000000000000000020151517770275000201730ustar00rootroot00000000000000#include "test.h" #include // Vector types typedef char s8; typedef short s16; typedef s8 v16qi __attribute__((vector_size(16))); // 16 × 8-bit signed typedef s16 v8hi __attribute__((vector_size(16))); // 8 × 16-bit signed int main() { // Input vector: lowest 8 bytes will be zero-extended v16qi a = {1, -2, 3, -4, 5, -6, 7, -8, 9, 10, 11, 12, 13, 14, 15, 16}; v8hi r = __builtin_ia32_pmovzxbw128(a); printf("Result: "); for (int i = 0; i < 8; i++) printf("%d ", r[i]); printf("\n"); // Expected: 1 254 3 252 5 250 7 248 (zero-extended lowest 8 bytes) int expected[] = {1, 254, 3, 252, 5, 250, 7, 248}; for (int i = 0; i < 8; i++) { if (r[i] != expected[i]) { printf("pmovzxbw128 FAIL\n"); return 1; } } ASSERT(1, r[0]); ASSERT(254, r[1]); ASSERT(3, r[2]); ASSERT(252, r[3]); ASSERT(5, r[4]); ASSERT(250, r[5]); ASSERT(7, r[6]); ASSERT(248, r[7]); printf("pmovzxbw128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovzxdq128.c000066400000000000000000000010061517770275000201660ustar00rootroot00000000000000#include "test.h" #include typedef int s32; typedef long long s64; typedef s32 v4si __attribute__((vector_size(16))); // 4 × 32-bit typedef s64 v2di __attribute__((vector_size(16))); // 2 × 64-bit v2di __builtin_ia32_pmovzxdq128(v4si x); int main() { v4si a = {1, -2, 3, -4}; v2di r = __builtin_ia32_pmovzxdq128(a); for(int i=0;i<2;i++) printf("%lld ", r[i]); printf("\n"); ASSERT(1, r[0]); ASSERT(18446744073709551614ULL, r[1]); printf("pmovzxdq128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmovzxwd128.c000066400000000000000000000010321517770275000201730ustar00rootroot00000000000000#include "test.h" #include typedef short s16; typedef int s32; typedef s16 v8hi __attribute__((vector_size(16))); // 8 × 16-bit typedef s32 v4si __attribute__((vector_size(16))); // 4 × 32-bit int main() { v8hi a = {1, -2, 3, -4, 5, 6, 7, 8}; v4si r = __builtin_ia32_pmovzxwd128(a); printf("Result: "); for(int i=0;i<4;i++) printf("%d ", r[i]); ASSERT(1, r[0]); ASSERT(65534, r[1]); ASSERT(3, r[2]); ASSERT(65532, r[3]); printf("pmovzxwd128 OK\n"); printf("\n"); return 0; } chibicc-1.0.24/test/builtin_pmovzxwq128.c000066400000000000000000000010021517770275000202050ustar00rootroot00000000000000#include "test.h" #include typedef short s16; typedef long long s64; typedef s16 v8hi __attribute__((vector_size(16))); // 8 × 16-bit typedef s64 v2di __attribute__((vector_size(16))); // 2 × 64-bit v2di __builtin_ia32_pmovzxwq128(v8hi x); int main() { v8hi a = {1, -2, 3, -4, 5, 6, 7, 8}; v2di r = __builtin_ia32_pmovzxwq128(a); for(int i=0;i<2;i++) printf("%lld ", r[i]); printf("\n"); ASSERT(1, r[0]); ASSERT(65534, r[1]); printf("pmovzxwq128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmuldq128.c000066400000000000000000000011501517770275000176000ustar00rootroot00000000000000#include "test.h" #include typedef int32_t s32; typedef long long s64; typedef s32 v4si __attribute__((vector_size(16))); typedef s64 v2di __attribute__((vector_size(16))); int main() { v4si a = {1, 2, 3, 4}; v4si b = {10, 20, 30, 40}; v2di r = __builtin_ia32_pmuldq128(a, b); printf("pmuldq128 result: "); for (int i = 0; i < 2; i++) { printf("%lld ", (long long)r[i]); } printf("\n"); // Expected: 1*10=10, 3*30=90 if (r[0] != 10 || r[1] != 90) { printf("pmuldq128 FAIL\n"); return 1; } printf("pmuldq128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmulhrsw.c000066400000000000000000000012631517770275000177310ustar00rootroot00000000000000#include "test.h" #include typedef short v4hi __attribute__((vector_size(8))); static short pmulhrsw_ref(short a, short b) { int prod = (int)a * (int)b; prod += 0x4000; // rounding bias prod >>= 15; if (prod > 32767) prod = 32767; if (prod < -32768) prod = -32768; return (short)prod; } int main() { v4hi a = { 1000, -2000, 3000, -4000 }; v4hi b = { 2, -3, 4, -5 }; v4hi r = __builtin_ia32_pmulhrsw(a, b); ASSERT(pmulhrsw_ref(a[0], b[0]), r[0]); ASSERT(pmulhrsw_ref(a[1], b[1]), r[1]); ASSERT(pmulhrsw_ref(a[2], b[2]), r[2]); ASSERT(pmulhrsw_ref(a[3], b[3]), r[3]); printf("pmulhrsw (MMX) OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmulhrsw128.c000066400000000000000000000021351517770275000201630ustar00rootroot00000000000000#include "test.h" typedef short v8hi __attribute__((vector_size(16))); int main() { // pmulhrsw128: (a[i] * b[i] + 0x4000) >> 15 with signed saturation. v8hi a = {3000, -3000, 10000, -10000, 20000, -20000, 0, 1234}; v8hi b = {2, 2, -3, -3, 4, 4, 0, -10}; v8hi r = __builtin_ia32_pmulhrsw128(a, b); // Expected: // i=0: (3000*2 + 0x4000) >> 15 = (6000+16384)>>15 = 22384>>15 = 0 // i=1: (-3000*2 + 16384)>>15 = ( -6000+16384)>>15 = 10384>>15 = 0 // i=2: (10000 * -3 + 16384) >> 15 = (-30000+16384)>>15 = -13616>>15 = -1 // i=3: (-10000 * -3 + 16384)>>15 = (30000+16384)>>15 = 46384>>15 = 1 // i=4: (20000*4 + 16384)>>15 = (80000+16384)>>15 = 96384>>15 = 2 // i=5: (-20000*4 + 16384)>>15 = (-80000+16384)>>15 = (-63616)>>15 = -2 // i=6: (0*0 + 16384)>>15 = 16384>>15 = 0 // i=7: (1234 * -10 + 16384)>>15 = (-12340+16384)>>15 = 4044>>15 = 0 ASSERT(0, r[0]); ASSERT(0, r[1]); ASSERT(-1, r[2]); ASSERT(1, r[3]); ASSERT(2, r[4]); ASSERT(-2, r[5]); ASSERT(0, r[6]); ASSERT(0, r[7]); printf("pmulhrsw128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmulhuw.c000066400000000000000000000020271517770275000175500ustar00rootroot00000000000000#include "test.h" // 64-bit vectors typedef unsigned short v4hu __attribute__((vector_size(8))); typedef short v4hi __attribute__((vector_size(8))); static unsigned short hi16_mul(unsigned int a, unsigned int b) { // high 16 bits of the 32-bit product (unsigned) unsigned int prod = a * b; // 32-bit return (unsigned short)(prod >> 16); } int main(void) { v4hu A = {1000, 2000, 3000, 4000}; v4hu B = {5000, 6000, 7000, 8000}; // builtin takes signed 16-bit vectors; cast is fine (lane-wise bits identical) v4hu R = (v4hu)__builtin_ia32_pmulhuw((v4hi)A, (v4hi)B); unsigned short *r = (unsigned short*)&R; unsigned short exp0 = hi16_mul(A[0], B[0]); unsigned short exp1 = hi16_mul(A[1], B[1]); unsigned short exp2 = hi16_mul(A[2], B[2]); unsigned short exp3 = hi16_mul(A[3], B[3]); printf("R = {%hu, %hu, %hu, %hu}\n", r[0], r[1], r[2], r[3]); ASSERT(exp0, r[0]); ASSERT(exp1, r[1]); ASSERT(exp2, r[2]); ASSERT(exp3, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmulhuw128.c000066400000000000000000000015271517770275000200070ustar00rootroot00000000000000#include "test.h" typedef unsigned short ushort8 __attribute__((vector_size(16))); typedef short short8 __attribute__((vector_size(16))); int main() { // Choose pairs with easy-to-verify products short8 a = {0xFFFF, 0x8000, 0x1234, 0xAAAA, 0x00FF, 0x0F0F, 0x7FFF, 0x4000}; short8 b = {0xFFFF, 0x0002, 0x0010, 0x0002, 0x00FF, 0x1010, 0x0002, 0x4000}; ushort8 c = (ushort8)__builtin_ia32_pmulhuw128(a, b); // Print high 16 bits of each lane product in hex (zero-padded) for (int i = 0; i < 8; i++) { printf("%04X ", c[i]); } printf("\n"); ASSERT(0xFFFE, c[0]); ASSERT(0x0001, c[1]); ASSERT(0x0001, c[2]); ASSERT(0x0001, c[3]); ASSERT(0x0000, c[4]); ASSERT(0x00F1, c[5]); ASSERT(0x0000, c[6]); ASSERT(0x1000, c[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmulhuw256.c000066400000000000000000000022111517770275000200000ustar00rootroot00000000000000#include #include "test.h" #include static void check(int cond, const char *msg) { if (!cond) { printf("FAIL: %s\n", msg); __builtin_abort(); } } int main(void) { uint16_t a[16] = { 0xFFFF, 0x1234, 0x8000, 0x0001, 0x00FF, 0x7FFF, 0xAAAA, 0x5555, 0x0002, 0x00F0, 0x0F0F, 0x3333, 0xFFFF, 0x0003, 0x2222, 0x8001 }; uint16_t b[16] = { 0xFFFF, 0x0002, 0x0002, 0xFFFF, 0x0101, 0x0002, 0x1111, 0x2222, 0x1000, 0x0F0F, 0xF0F0, 0x0003, 0xFFFF, 0x0004, 0x3333, 0x7FFF }; __m256i va = _mm256_loadu_si256((__m256i*)a); __m256i vb = _mm256_loadu_si256((__m256i*)b); __m256i vr = __builtin_ia32_pmulhuw256(va, vb); uint16_t out[16]; _mm256_storeu_si256((__m256i*)out, vr); for (int i = 0; i < 16; i++) { uint32_t ref = (uint32_t)a[i] * (uint32_t)b[i]; uint16_t expected = ref >> 16; if (out[i] != expected) { printf("FAIL lane %d: got=%u expected=%u\n", i, out[i], expected); __builtin_abort(); } } printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmulhw.c000066400000000000000000000012211517770275000173560ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {30000, -30000, 100, -100}; v4hi b = {2, 3, 4, 5}; v4hi result = __builtin_ia32_pmulhw(a, b); for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } printf("\n"); ASSERT(30000, a[0]); ASSERT(-30000, a[1]); ASSERT(100, a[2]); ASSERT(-100, a[3]); ASSERT(2, b[0]); ASSERT(3, b[1]); ASSERT(4, b[2]); ASSERT(5, b[3]); ASSERT(0, result[0]); ASSERT(-2, result[1]); ASSERT(0, result[2]); ASSERT(-1, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmulhw128.c000066400000000000000000000013651517770275000176220ustar00rootroot00000000000000#include "test.h" typedef short v8hi __attribute__((vector_size(16))); int main() { // Two sets of signed 16-bit integers (8 elements in 128 bits) v8hi a = {3000, -3000, 10000, -10000, 12345, -12345, 20000, -20000}; v8hi b = {2, 3, -2, -3, 4, -4, 5, -5}; // Multiply and keep the high 16 bits v8hi vc = __builtin_ia32_pmulhw128(a, b); // intrinsic for PMULHW // Print results printf("Result: "); for (int i = 0; i < 8; i++) printf("%d ", vc[i]); printf("\n"); ASSERT(0, vc[0]); ASSERT(-1, vc[1]); ASSERT(-1, vc[2]); ASSERT(0, vc[3]); ASSERT(0, vc[4]); ASSERT(0, vc[5]); ASSERT(1, vc[6]); ASSERT(1, vc[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmullw.c000066400000000000000000000012331517770275000173650ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {30000, -30000, 100, -100}; v4hi b = {2, 3, 4, 5}; v4hi result = __builtin_ia32_pmullw(a, b); for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } printf("\n"); ASSERT(30000, a[0]); ASSERT(-30000, a[1]); ASSERT(100, a[2]); ASSERT(-100, a[3]); ASSERT(2, b[0]); ASSERT(3, b[1]); ASSERT(4, b[2]); ASSERT(5, b[3]); ASSERT(-5536, result[0]); ASSERT(-24464, result[1]); ASSERT(400, result[2]); ASSERT(-500, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmuludq.c000066400000000000000000000007271517770275000175430ustar00rootroot00000000000000#include "test.h" #include typedef int v4li __attribute__((vector_size(8))); typedef unsigned long long v4lu __attribute__((vector_size(8))); int main() { v4li a = { 2, 4}; v4li b = { 10, 20}; // Multiply and keep the high 16 bits v4lu vc = (v4lu)__builtin_ia32_pmuludq(a, b); // intrinsic for PMULHW printf("Result: %llu\n", (unsigned long long)vc[0]); ASSERT(20, vc[0]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pmuludq128.c000066400000000000000000000010241517770275000177650ustar00rootroot00000000000000#include "test.h" typedef long long __v2di __attribute__((vector_size(16))); typedef int __v4si __attribute__((vector_size(16))); int main(void) { __v4si a = { 2, 0, 3, 0 }; // Only even-indexed elements are used for pmuludq __v4si b = { 5, 0, 7, 0 }; __v2di r = (__v2di)__builtin_ia32_pmuludq128(a, b); long long *res = (long long*)&r; printf("%lld %lld\n", res[0], res[1]); // Expected: 10 21 ASSERT(10, res[0]); ASSERT(21, res[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_popcount.c000066400000000000000000000021771517770275000177240ustar00rootroot00000000000000#include "test.h" #include int main() { // Basic tests ASSERT(0, __builtin_popcount(0)); ASSERT(1, __builtin_popcount(1)); ASSERT(4, __builtin_popcount(15)); ASSERT(32, __builtin_popcount(0xffffffff)); // Patterns ASSERT(16, __builtin_popcount(0xAAAAAAAA)); ASSERT(16, __builtin_popcount(0x55555555)); // long and long long ASSERT(0, __builtin_popcountl(0)); ASSERT(1, __builtin_popcountl(1)); ASSERT(32, __builtin_popcountl(0xF0F0F0F0F0F0F0F0)); ASSERT(64, __builtin_popcountll(0xFFFFFFFFFFFFFFFF)); // Promotion tests (crucial for small types) unsigned char c = 0xFF; ASSERT(8, __builtin_popcount(c)); unsigned short s = 0xFFFF; ASSERT(16, __builtin_popcount(s)); // Pattern variables uint32_t a32 = 0xF0F0F0F0; uint64_t a64 = 0xF0F0F0F0F0F0F0F0; ASSERT(16, __builtin_popcount(a32)); ASSERT(32, __builtin_popcountl(a64)); ASSERT(32, __builtin_popcountll(a64)); // Mixed expressions ASSERT(2, __builtin_popcount(1 | 2)); ASSERT(4, __builtin_popcountll(a64 & 0xF0)); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_por.c000066400000000000000000000016621517770275000166530ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); typedef v2si __m64; int main() { __m64 a = {0xF0F0F0F0, 0xAAAA5555}; __m64 b = {0x0F0F0F0F, 0x12345678}; __m64 result = __builtin_ia32_por(a, b); printf("a[0] = 0x%x\n", a[0]); printf("a[1] = 0x%x\n", a[1]); printf("b[0] = 0x%x\n", b[0]); printf("b[1] = 0x%x\n", b[1]); printf("result[0] = 0x%x\n", result[0]); printf("result[1] = 0x%x\n", result[1]); // result[i] = a[i] | b[i] if (result[0] == (a[0] | b[0]) && result[1] == (a[1] | b[1])) { printf("Test passed.\n"); } else { printf("Test failed.\n"); return 1; } ASSERT(0xf0f0f0f0, a[0]); ASSERT(0xaaaa5555, a[1]); ASSERT(0xf0f0f0f, b[0]); ASSERT(0x12345678, b[1]); ASSERT(0xffffffff, result[0]); ASSERT(0xbabe577d, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_prefetch.c000066400000000000000000000010421517770275000176430ustar00rootroot00000000000000#include "test.h" int main() { char buffer[64]; int rw = 0; int locality = 2; // Prefetch the first 32 bytes of buffer into cache __builtin_prefetch(buffer, rw++, ++locality); ASSERT(1, rw); ASSERT(3, locality); // Write some data to buffer for (int i = 0; i < 32; i++) { buffer[i] = (char)i; } // Read and sum to check correctness int sum = 0; for (int i = 0; i < 32; i++) { sum += buffer[i]; } printf("Sum = %d\n", sum); ASSERT(496, sum); return 0; } chibicc-1.0.24/test/builtin_ps256.c000066400000000000000000000057061517770275000167350ustar00rootroot00000000000000 // test___builtin_ia32_ps_ps256.c // Compile: gcc -O2 -mavx test.c -o test && ./test #include #include #include // fabsf(), isnanf(), isinff() #include /* Helper: extract float lane i from __m256 */ static inline float get256s(__m256 v, int i) { float buf[8]; _mm256_storeu_ps(buf, v); return buf[i]; } int main(void) { /* ── Test 1: basic lane promotion ─────────────────────────── */ __m128 src = _mm_set_ps(4.0f, 3.0f, 2.0f, 1.0f); // _mm_set_ps fills highest-to-lowest: lanes [1,2,3,4] __m256 dst = __builtin_ia32_ps_ps256(src); /* Lower 128 bits (lanes 0-3) must equal src */ assert(fabsf(get256s(dst, 0) - 1.0f) < 1e-7f); assert(fabsf(get256s(dst, 1) - 2.0f) < 1e-7f); assert(fabsf(get256s(dst, 2) - 3.0f) < 1e-7f); assert(fabsf(get256s(dst, 3) - 4.0f) < 1e-7f); /* Upper 128 bits (lanes 4-7) are undefined — do NOT assert */ /* ── Test 2: negative / subnormal values ───────────────────── */ __m128 neg = _mm_set_ps(-0.0f, -1.0f, 1.4e-45f, -3.14f); __m256 neg256 = __builtin_ia32_ps_ps256(neg); assert(fabsf(get256s(neg256, 0) - (-3.14f)) < 1e-5f); // lane 0 assert(get256s(neg256, 1) == 1.4e-45f); // subnormal assert(fabsf(get256s(neg256, 2) - (-1.0f)) < 1e-7f); assert(get256s(neg256, 3) == -0.0f); // negative zero /* ── Test 3: NaN / Inf passthrough ────────────────────────── */ float inf = 1.0f / 0.0f; float nan_val = 0.0f / 0.0f; __m128 special = _mm_set_ps(inf, nan_val, -inf, 42.0f); __m256 sp256 = __builtin_ia32_ps_ps256(special); assert(fabsf(get256s(sp256, 0) - 42.0f) < 1e-7f); // lane 0: 42.0 assert(isinf(get256s(sp256, 1)) && get256s(sp256, 1) < 0); // -Inf assert(isnan(get256s(sp256, 2))); // NaN assert(isinf(get256s(sp256, 3)) && get256s(sp256, 3) > 0); // +Inf /* ── Test 4: zero vector ──────────────────────────────────── */ __m256 zero256 = __builtin_ia32_ps_ps256(_mm_setzero_ps()); assert(get256s(zero256, 0) == 0.0f); assert(get256s(zero256, 1) == 0.0f); assert(get256s(zero256, 2) == 0.0f); assert(get256s(zero256, 3) == 0.0f); /* ── Test 5: all-ones bit pattern ─────────────────────────── */ __m128 ones = _mm_castsi128_ps(_mm_set1_epi32(0xFFFFFFFF)); __m256 ones256 = __builtin_ia32_ps_ps256(ones); int ibuf[8]; _mm256_storeu_si256((__m256i *)ibuf, _mm256_castps_si256(ones256)); assert(ibuf[0] == (int)0xFFFFFFFF); assert(ibuf[1] == (int)0xFFFFFFFF); assert(ibuf[2] == (int)0xFFFFFFFF); assert(ibuf[3] == (int)0xFFFFFFFF); printf("All tests passed.\n"); return 0; } chibicc-1.0.24/test/builtin_psadbw.c000066400000000000000000000006131517770275000173260ustar00rootroot00000000000000#include "test.h" typedef char v8qi __attribute__((vector_size(8))); typedef unsigned long v1du __attribute__((vector_size(8))); int main() { v8qi a = {10, 20, 30, 40, 50, 60, 70, 80}; v8qi b = {15, 25, 35, 45, 55, 65, 75, 85}; v1du r = (v1du)__builtin_ia32_psadbw(a, b); printf("%lu\n", r[0]); ASSERT(40, r[0]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psadbw128.c000066400000000000000000000011651517770275000175640ustar00rootroot00000000000000#include "test.h" typedef char char16 __attribute__((vector_size(16))); typedef unsigned long long ull2 __attribute__((vector_size(16))); int main() { char16 a = { 10, 20, 30, 40, 50, 60, 70, 80, 90,100,110,120,130,140,150,160 }; char16 b = { 15, 25, 35, 45, 55, 65, 75, 85, 85, 95,105,115,125,135,145,155 }; ull2 result = (ull2)__builtin_ia32_psadbw128(a, b); printf("Low 8-byte sum: %llu\n", result[0]); printf("High 8-byte sum: %llu\n", result[1]); ASSERT(40, result[0]); ASSERT(40, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pshufb.c000066400000000000000000000007751517770275000173460ustar00rootroot00000000000000#include "test.h" typedef signed char v8qi __attribute__((vector_size(8))); int main() { // source bytes v8qi x = {10, 20, 30, 40, 50, 60, 70, 80}; // shuffle mask: take elements in reverse order v8qi mask = {7, 6, 5, 4, 3, 2, 1, 0}; v8qi r = __builtin_ia32_pshufb(x, mask); ASSERT(80, r[0]); ASSERT(70, r[1]); ASSERT(60, r[2]); ASSERT(50, r[3]); ASSERT(40, r[4]); ASSERT(30, r[5]); ASSERT(20, r[6]); ASSERT(10, r[7]); printf("pshufb64 OK\n"); } chibicc-1.0.24/test/builtin_pshufb128.c000066400000000000000000000014461517770275000175750ustar00rootroot00000000000000#include "test.h" typedef signed char v16qi __attribute__((vector_size(16))); int main() { v16qi a = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; // Shuffle mask: reverse low 8 bytes, leave high 8 unchanged v16qi mask = { 7,6,5,4,3,2,1,0, 8,9,10,11,12,13,14,15 }; v16qi r = __builtin_ia32_pshufb128(a, mask); // Expected: ASSERT(7, r[0]); ASSERT(6, r[1]); ASSERT(5, r[2]); ASSERT(4, r[3]); ASSERT(3, r[4]); ASSERT(2, r[5]); ASSERT(1, r[6]); ASSERT(0, r[7]); ASSERT(8, r[8]); ASSERT(9, r[9]); ASSERT(10, r[10]); ASSERT(11, r[11]); ASSERT(12, r[12]); ASSERT(13, r[13]); ASSERT(14, r[14]); ASSERT(15, r[15]); printf("pshufb128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pshufb256.c000066400000000000000000000012641517770275000175750ustar00rootroot00000000000000#include #include #include #include int main() { uint8_t X[32]; uint8_t M[32]; // Initialize X with known pattern for (int i = 0; i < 32; i++) { X[i] = i; } // Mask: reverse each 16-byte lane for (int i = 0; i < 32; i++) { M[i] = 15 - (i % 16); } __m256i x, m; memcpy(&x, X, 32); memcpy(&m, M, 32); __m256i r = _mm256_shuffle_epi8(x, m); uint8_t out[32]; memcpy(out, &r, 32); // validate: each lane is reversed for (int i = 0; i < 32; i++) { int lane_base = (i / 16) * 16; int idx = lane_base + (15 - (i % 16)); if (out[i] != X[idx]) return 1; } printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_pshufd.c000066400000000000000000000017431517770275000173440ustar00rootroot00000000000000#include "test.h" typedef int v4si __attribute__((vector_size(16))); static void print_v4si(const char *name, v4si v) { printf("%s = {%d, %d, %d, %d}\n", name, v[0], v[1], v[2], v[3]); } int main() { v4si a = {10, 20, 30, 40}; // imm8 = 0b 11 10 01 00 = selects elements in normal order v4si r0 = __builtin_ia32_pshufd(a, 0b11100100); print_v4si("r0", r0); // reverse vector: [40, 30, 20, 10] v4si r1 = __builtin_ia32_pshufd(a, 0b00011011); print_v4si("r1", r1); // select {a2, a0, a0, a1} // mask bits[1:0]=2, bits[3:2]=0, bits[5:4]=0, bits[7:6]=1 v4si r2 = __builtin_ia32_pshufd(a, 0b01000010); print_v4si("r2", r2); ASSERT(10, r0[0]); ASSERT(20, r0[1]); ASSERT(30, r0[2]); ASSERT(40, r0[3]); ASSERT(40, r1[0]); ASSERT(30, r1[1]); ASSERT(20, r1[2]); ASSERT(10, r1[3]); ASSERT(30, r2[0]); ASSERT(10, r2[1]); ASSERT(10, r2[2]); ASSERT(20, r2[3]); printf("pshufd OK\n"); return 0; } chibicc-1.0.24/test/builtin_psignb.c000066400000000000000000000006421517770275000173320ustar00rootroot00000000000000#include "test.h" typedef char v8qi __attribute__((vector_size(8))); int main() { v8qi a = {1,-2,3,-4,5,-6,7,-8}; v8qi b = {1,1,-1,-1,1,1,-1,-1}; v8qi r = __builtin_ia32_psignb(a, b); // expected: a[i]*sign(b[i]) // [1,-2,-3,4,5,-6,-7,8] int expected[8] = {1,-2,-3,4,5,-6,-7,8}; for (int i=0;i<8;i++) ASSERT(expected[i], r[i]); printf("PSIGNB MMX OK\n"); return 0; } chibicc-1.0.24/test/builtin_psignb128.c000066400000000000000000000010221517770275000175560ustar00rootroot00000000000000#include "test.h" typedef char v16qi __attribute__((vector_size(16))); int main() { v16qi a = {1,-2,3,-4,5,-6,7,-8, 9,-10,11,-12,13,-14,15,-16}; v16qi b = {1,1,-1,-1,1,1,-1,-1, 1,1,-1,-1,1,1,-1,-1}; v16qi r = __builtin_ia32_psignb128(a, b); // expected: a[i]*sign(b[i]) // [1,-2,-3,4,5,-6,-7,8,9,-10,-11,12,13,-14,-15,16] int expected[16] = {1,-2,-3,4,5,-6,-7,8,9,-10,-11,12,13,-14,-15,16}; for (int i=0;i<16;i++) ASSERT(expected[i], r[i]); printf("PSIGNB128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_psignd.c000066400000000000000000000004741517770275000173370ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); int main() { v2si a = {100,-200}; v2si b = {1,-1}; v2si r = __builtin_ia32_psignd(a, b); int expected[2] = {100,200}; for(int i=0;i<2;i++) ASSERT(expected[i], r[i]); printf("PSIGND MMX OK\n"); return 0; } chibicc-1.0.24/test/builtin_psignd128.c000066400000000000000000000005261517770275000175700ustar00rootroot00000000000000#include "test.h" typedef int v4si __attribute__((vector_size(16))); int main() { v4si a = {100,-200,300,-400}; v4si b = {1,-1,1,-1}; v4si r = __builtin_ia32_psignd128(a, b); int expected[4] = {100,200,300,400}; for (int i=0;i<4;i++) ASSERT(expected[i], r[i]); printf("PSIGND128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_psignw.c000066400000000000000000000005341517770275000173570ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {1000,-2000,3000,-4000}; v4hi b = {1,-1,1,-1}; v4hi r = __builtin_ia32_psignw(a, b); int expected[4] = {1000,2000,3000,4000}; for(int i=0;i<4;i++) ASSERT(expected[i], r[i]); printf("PSIGNW MMX OK\n"); return 0; } chibicc-1.0.24/test/builtin_psignw128.c000066400000000000000000000006241517770275000176120ustar00rootroot00000000000000#include "test.h" typedef short v8hi __attribute__((vector_size(16))); int main() { v8hi a = {1000,-2000,3000,-4000,5000,-6000,7000,-8000}; v8hi b = {1,-1,1,-1,1,-1,1,-1}; v8hi r = __builtin_ia32_psignw128(a, b); int expected[8] = {1000,2000,3000,4000,5000,6000,7000,8000}; for (int i=0;i<8;i++) ASSERT(expected[i], r[i]); printf("PSIGNW128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_pslld.c000066400000000000000000000010601517770275000171610ustar00rootroot00000000000000#include "test.h" // Define a 2-element vector of int (32-bit) typedef int v2si __attribute__((vector_size(8))); int main() { v2si a = {1, 2}; v2si count = {1, 2}; // Perform packed shift left logical on 2x 32-bit integers v2si result = __builtin_ia32_pslld(a, count); printf("%d %d\n", result[0], result[1]); // Expect: 2 8 ASSERT(1, a[0]); ASSERT(2, a[1]); ASSERT(1, count[0]); ASSERT(2, count[1]); ASSERT(0, result[0]); ASSERT(0, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pslld128.c000066400000000000000000000006561517770275000174260ustar00rootroot00000000000000#include "test.h" typedef int __m128i __attribute__((vector_size(16))); int main() { __m128i a = {1, 2, 3, 4}; __m128i b = {1, 0, 0, 0}; __m128i c = __builtin_ia32_pslld128(a, b); // shift left each 32-bit element by 1 printf("%d %d %d %d\n", c[0], c[1], c[2], c[3]); ASSERT(2, c[0]); ASSERT(4, c[1]); ASSERT(6, c[2]); ASSERT(8, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pslldi.c000066400000000000000000000011101517770275000173260ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); int main() { v2si a = {1, 2}; // Shift left each 32-bit element by 1 bit (immediate) v2si result = __builtin_ia32_pslldi(a, 1); for (int i = 0; i < 2; i++) { printf("%d ", result[i]); } printf("\n"); ASSERT(1, a[0]); ASSERT(2, a[1]); ASSERT(2, result[0]); ASSERT(4, result[1]); int count = 1; result = __builtin_ia32_pslldi(a, count); ASSERT(2, result[0]); ASSERT(4, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pslldi128.c000066400000000000000000000014221517770275000175670ustar00rootroot00000000000000#include "test.h" #include // Declare the builtin typedef int __m128i __attribute__((__vector_size__(16), __may_alias__)); int main() { __m128i v = { 1, 2, 3, 4 }; // Four 32-bit integers in the 128-bit vector int shift = 2; // Shift left by 2 bits __m128i result = __builtin_ia32_pslldi128(v, shift); uint32_t *vals = (uint32_t *)&result; printf("Result: %u %u %u %u\n", vals[0], vals[1], vals[2], vals[3]); ASSERT(4, result[0]); ASSERT(8, result[1]); ASSERT(12, result[2]); ASSERT(16, result[3]); result = __builtin_ia32_pslldi128(v, 2); ASSERT(4, result[0]); ASSERT(8, result[1]); ASSERT(12, result[2]); ASSERT(16, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pslldi256.c000066400000000000000000000016231517770275000175740ustar00rootroot00000000000000// test_avx2_pslldi256.c // // Checks: // - __AVX2__ macro definition // - builtin typing/codegen // - vpslld immediate emission // - correct 32-bit lane shifting // // Expected: // exit code 0 #include #include int main(void) { #ifdef __AVX2__ __m256i v = _mm256_set_epi32( 8, 7, 6, 5, 4, 3, 2, 1); // maps to: // __builtin_ia32_pslldi256(...) __m256i r = _mm256_slli_epi32(v, 1); int out[8]; _mm256_storeu_si256((__m256i *)out, r); // _mm256_set_epi32 stores reversed order if (out[0] != 2) return 1; if (out[1] != 4) return 2; if (out[2] != 6) return 3; if (out[3] != 8) return 4; if (out[4] != 10) return 5; if (out[5] != 12) return 6; if (out[6] != 14) return 7; if (out[7] != 16) return 8; printf("Ok\n"); return 0; #else #error "__AVX2__ not defined" #endif }chibicc-1.0.24/test/builtin_pslldqi256.c000066400000000000000000000012351517770275000177540ustar00rootroot00000000000000#include #include #include #include "test.h" int main() { uint8_t X[32]; for (int i = 0; i < 32; i++) X[i] = (uint8_t)(i + 1); __m256i x; memcpy(&x, X, 32); // Shift left by 4 bytes within each 128-bit lane. __m256i r = _mm256_slli_si256(x, 4); uint8_t out[32]; memcpy(out, &r, 32); for (int i = 0; i < 32; i++) { int lane_base = (i / 16) * 16; uint8_t expected = 0; int j = i - 4; if (j >= lane_base) expected = X[j]; if (out[i] != expected) { printf("Mismatch at %d: got %u expected %u\n", i, out[i], expected); return 1; } } printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_psllq.c000066400000000000000000000006401517770275000172010ustar00rootroot00000000000000#include "test.h" typedef long long __m64 __attribute__((vector_size(8))); int main() { __m64 a = (__m64){0x1000LL}; __m64 count = (__m64){4}; // shift left by 4 bits __m64 result = __builtin_ia32_psllq(a, count); printf("0x%llx\n", (unsigned long long)result[0]); // Expected output: 0x10000 (0x1000 << 4) ASSERT(0x10000, result[0]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psllq128.c000066400000000000000000000007001517770275000174310ustar00rootroot00000000000000#include "test.h" #include typedef long long v8hi __attribute__((vector_size(16))); int main() { v8hi a = { 1, 2 }; v8hi b = {1,0}; v8hi r = __builtin_ia32_psllq128((v8hi)a, (v8hi)b); long long *res = (long long *)&r; for (int i = 0; i < 2; i++) { printf("%lld ", res[i]); } printf("\n"); ASSERT(2, r[0]); ASSERT(4, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psllqi.c000066400000000000000000000014351517770275000173550ustar00rootroot00000000000000#include "test.h" typedef long long __m64 __attribute__((vector_size(8))); typedef int __v1di __attribute__((vector_size(8))); // Forward declaration of the intrinsic (usually built-in by compiler) __m64 __builtin_ia32_psllqi(__m64 a, int count); int main() { __m64 a = (__m64){0x123456789abcdef0LL}; // sample 64-bit value packed in __m64 int count = 1; // shift left by 1 bit __m64 result = __builtin_ia32_psllqi(a, count); // Print result as 64-bit integer (cast vector to long long) long long *p = (long long*)&result; printf("Result after psllqi by %d: 0x%llx\n", count, p[0]); ASSERT(897170912, result[0]); __m64 result = __builtin_ia32_psllqi(a, 1); ASSERT(897170912, result[0]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psllqi128.c000066400000000000000000000007171517770275000176120ustar00rootroot00000000000000#include "test.h" #include typedef long long v2di __attribute__((vector_size(16))); v2di test_psllq_i128(v2di a) { // Equivalent to: return __builtin_ia32_psllqi128(a, 2); return __builtin_ia32_psllqi128(a, 2); } int main() { v2di a = {1, 2}; // Two 64-bit integers v2di b = test_psllq_i128(a); printf("%lld %lld\n", b[0], b[1]); ASSERT(4, b[0]); ASSERT(8, b[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psllqi256.c000066400000000000000000000103631517770275000176120ustar00rootroot00000000000000 // test___builtin_ia32_psllqi256.c // Compile: gcc -O2 -mavx2 test.c -o test && ./test #include #include #include #include /* Helper: extract uint64 lane i (0-3) from __m256i */ static inline uint64_t get64(__m256i v, int i) { uint64_t buf[4]; _mm256_storeu_si256((__m256i *)buf, v); return buf[i]; } int main(void) { /* ── Test 1: shift by 1 ────────────────────────────────────── */ // 0x4000000000000000 << 1 == 0x8000000000000000 __m256i a = _mm256_set1_epi64x((int64_t)0x4000000000000000ULL); __m256i r1 = __builtin_ia32_psllqi256(a, 1); assert(get64(r1, 0) == 0x8000000000000000ULL); assert(get64(r1, 1) == 0x8000000000000000ULL); assert(get64(r1, 2) == 0x8000000000000000ULL); assert(get64(r1, 3) == 0x8000000000000000ULL); /* ── Test 2: shift by 4 (nibble boundary) ──────────────────── */ // 0x0DEADBEEFCAFEBAB << 4 == 0xDEADBEEFCAFEBAB0 __m256i b = _mm256_set1_epi64x((int64_t)0x0DEADBEEFCAFEBABULL); __m256i r4 = __builtin_ia32_psllqi256(b, 4); assert(get64(r4, 0) == 0xDEADBEEFCAFEBAB0ULL); assert(get64(r4, 3) == 0xDEADBEEFCAFEBAB0ULL); /* ── Test 3: shift by 63 (single bit survives at MSB) ──────── */ __m256i c = _mm256_set1_epi64x((int64_t)0xFFFFFFFFFFFFFFFFULL); __m256i r63 = __builtin_ia32_psllqi256(c, 63); assert(get64(r63, 0) == 0x8000000000000000ULL); assert(get64(r63, 1) == 0x8000000000000000ULL); assert(get64(r63, 2) == 0x8000000000000000ULL); assert(get64(r63, 3) == 0x8000000000000000ULL); /* ── Test 4: shift by 64 zeroes every lane ─────────────────── */ __m256i r64 = __builtin_ia32_psllqi256(c, 64); assert(get64(r64, 0) == 0ULL); assert(get64(r64, 1) == 0ULL); assert(get64(r64, 2) == 0ULL); assert(get64(r64, 3) == 0ULL); /* ── Test 5: shift by 0 is identity ────────────────────────── */ __m256i d = _mm256_set_epi64x( (int64_t)0xAAAAAAAAAAAAAAAAULL, (int64_t)0xBBBBBBBBBBBBBBBBULL, (int64_t)0xCCCCCCCCCCCCCCCCULL, (int64_t)0xDDDDDDDDDDDDDDDDULL ); __m256i r0 = __builtin_ia32_psllqi256(d, 0); assert(get64(r0, 0) == 0xDDDDDDDDDDDDDDDDULL); assert(get64(r0, 1) == 0xCCCCCCCCCCCCCCCCULL); assert(get64(r0, 2) == 0xBBBBBBBBBBBBBBBBULL); assert(get64(r0, 3) == 0xAAAAAAAAAAAAAAAAULL); /* ── Test 6: LSB becomes 0 (zeros shifted in from LSB) ─────── */ // Confirms this is a left shift, not a rotate — low bits drain to 0 __m256i e = _mm256_set1_epi64x((int64_t)0xFFFFFFFFFFFFFFFFULL); __m256i r_lsb = __builtin_ia32_psllqi256(e, 1); assert(get64(r_lsb, 0) == 0xFFFFFFFFFFFFFFFEULL); assert(get64(r_lsb, 3) == 0xFFFFFFFFFFFFFFFEULL); /* ── Test 7: inverse of psrlqi256 by 4 ─────────────────────── */ // round-trip: (x >> 4) << 4 masks the low nibble of each lane __m256i f = _mm256_set1_epi64x((int64_t)0x123456789ABCDEF0ULL); __m256i shifted_r = __builtin_ia32_psrlqi256(f, 4); __m256i round_trip = __builtin_ia32_psllqi256(shifted_r, 4); // low nibble (0xF0 >> 4 = 0x0F, 0x0F << 4 = 0xF0) wait — low nibble // of original is 0x0; round-trip should restore all but the lost nibble assert(get64(round_trip, 0) == 0x123456789ABCDEF0ULL); assert(get64(round_trip, 3) == 0x123456789ABCDEF0ULL); /* ── Test 8: lanes are independent ─────────────────────────── */ __m256i g = _mm256_set_epi64x( (int64_t)0x0000000000000001ULL, // lane 3 (int64_t)0x0000000000000002ULL, // lane 2 (int64_t)0x0000000000000004ULL, // lane 1 (int64_t)0x0000000000000008ULL // lane 0 ); __m256i r_ind = __builtin_ia32_psllqi256(g, 4); assert(get64(r_ind, 0) == 0x0000000000000080ULL); assert(get64(r_ind, 1) == 0x0000000000000040ULL); assert(get64(r_ind, 2) == 0x0000000000000020ULL); assert(get64(r_ind, 3) == 0x0000000000000010ULL); printf("All tests passed.\n"); return 0; } chibicc-1.0.24/test/builtin_psllw.c000066400000000000000000000013171517770275000172110ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = (v4hi){1, 2, 3, 4}; // v4hi v4hi count = (v4hi){1, 1, 1, 1}; // shift each by 1 bit v4hi result = __builtin_ia32_psllw(a, count); for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } printf("\n"); for (int i = 0; i < 4; i++) { printf("%d ", a[i]); ASSERT(i + 1, a[i]); } for (int i = 0; i < 4; i++) { printf("%d ", count[i]); ASSERT(1, count[i]); } ASSERT(0, result[0]); ASSERT(0, result[1]); ASSERT(0, result[2]); ASSERT(0, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psllw128.c000066400000000000000000000006761517770275000174530ustar00rootroot00000000000000#include "test.h" #include typedef short v8hi __attribute__((vector_size(16))); int main() { v8hi a = { 1, 2, 3, 4, 5, 6, 7, 8 }; v8hi b = {1,0,2,3,1,0,2,3}; v8hi r = __builtin_ia32_psllw128((v8hi)a, (v8hi)b); short *res = (short *)&r; for (int i = 0; i < 8; i++) { printf("%d ", res[i]); ASSERT(0, r[i]); } printf("\n"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psllwi.c000066400000000000000000000017501517770275000173630ustar00rootroot00000000000000#include "test.h" typedef long long __m64; // minimal __m64 definition typedef short v4hi __attribute__((vector_size(8))); int main(void) { v4hi a = {1, 2, 3, 4}; // reinterpret v4hi as __m64 for builtin __m64 am = (__m64)a; // shift each 16-bit element left by 1 (immediate form) __m64 rm = (__m64)__builtin_ia32_psllwi(a, 1); // reinterpret back to vector for printing v4hi result = (v4hi)rm; for (int i = 0; i < 4; i++) { printf("%d ", a[i]); ASSERT(i+1, a[i]); } for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } printf("\n"); ASSERT(2, result[0]); ASSERT(4, result[1]); ASSERT(6, result[2]); ASSERT(8, result[3]); int count = 1; result = (v4hi)__builtin_ia32_psllwi(a, count); ASSERT(2, result[0]); ASSERT(4, result[1]); ASSERT(6, result[2]); ASSERT(8, result[3]); printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_psllwi128.c000066400000000000000000000016741517770275000176230ustar00rootroot00000000000000#include "test.h" #include typedef short v8si __attribute__((vector_size(16))); int main() { // Prepare test data: 8 x 16-bit words in a 128-bit vector v8si v = {1, 2, 3, 4, 0x8000, 0x4000, 0x1234, 0xFFFF}; v8si r = __builtin_ia32_psllwi128(v, 1); for (int i = 0; i < 8; i++) { printf("%04x ", r[i]); } printf("\n"); ASSERT(2, r[0]); ASSERT(4, r[1]); ASSERT(6, r[2]); ASSERT(8, r[3]); ASSERT(0, r[4]); ASSERT(-32768, r[5]); ASSERT(9320, r[6]); ASSERT(-2, r[7]); int count = 1; r = __builtin_ia32_psllwi128(v, count); for (int i = 0; i < 8; i++) { printf("%04x ", r[i]); } printf("\n"); ASSERT(2, r[0]); ASSERT(4, r[1]); ASSERT(6, r[2]); ASSERT(8, r[3]); ASSERT(0, r[4]); ASSERT(-32768, r[5]); ASSERT(9320, r[6]); ASSERT(-2, r[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrad.c000066400000000000000000000007631517770275000171650ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); int main() { v2si a = (v2si){-1024, 2048}; v2si count = (v2si){2, 3}; // shift each lane by respective value v2si result = __builtin_ia32_psrad(a, count); printf("%d %d\n", result[0], result[1]); ASSERT(-1024, a[0]); ASSERT(2048, a[1]); ASSERT(2, count[0]); ASSERT(3, count[1]); ASSERT(-1, result[0]); ASSERT(0, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrad128.c000066400000000000000000000010541517770275000174120ustar00rootroot00000000000000#include "test.h" #include typedef int v4si __attribute__((vector_size(16))); int main() { v4si a = { 100000, -100000, 2147483647, -2147483648 }; v4si b = { 2, 2, 2, 2 }; // Shift right arithmetic by 2 bits v4si r = __builtin_ia32_psrad128((v4si)a,(v4si)b); int *res = (int *)&r; for (int i = 0; i < 4; i++) { printf("%d ", res[i]); } printf("\n"); ASSERT(0, r[0]); ASSERT(-1, r[1]); ASSERT(0, r[2]); ASSERT(-1, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psradi.c000066400000000000000000000011071517770275000173270ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); int main() { v2si a = (v2si){-1024, 2048}; // Shift both lanes right by an immediate value of 2 v2si result = __builtin_ia32_psradi(a, 2); printf("%d %d\n", result[0], result[1]); // Expect -256 and 512 ASSERT(-1024, a[0]); ASSERT(2048, a[1]); ASSERT(-256, result[0]); ASSERT(512, result[1]); int count = 2; result = __builtin_ia32_psradi(a, count); ASSERT(-256, result[0]); ASSERT(512, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psradi128.c000066400000000000000000000015201517770275000175610ustar00rootroot00000000000000#include "test.h" #include typedef int v4si __attribute__((vector_size(16))); int main() { v4si a = { 100000, -100000, 2147483647, -2147483648 }; // Shift right arithmetic by 2 bits v4si r = __builtin_ia32_psradi128((v4si)a, 2); int *res = (int *)&r; for (int i = 0; i < 4; i++) { printf("%d ", res[i]); } printf("\n"); ASSERT(25000, r[0]); ASSERT(-25000, r[1]); ASSERT(536870911, r[2]); ASSERT(-536870912, r[3]); int count = 2; r = __builtin_ia32_psradi128((v4si)a, 2); res = (int *)&r; for (int i = 0; i < 4; i++) { printf("%d ", res[i]); } printf("\n"); ASSERT(25000, r[0]); ASSERT(-25000, r[1]); ASSERT(536870911, r[2]); ASSERT(-536870912, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psraw.c000066400000000000000000000006671517770275000172130ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = (v4hi){-2, -4, 8, 16}; v4hi count = (v4hi){1, 1, 1, 1}; v4hi result = __builtin_ia32_psraw(a, count); for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } printf("\n"); ASSERT(-1, result[0]); ASSERT(-1, result[1]); ASSERT(0, result[2]); ASSERT(0, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psraw128.c000066400000000000000000000010251517770275000174330ustar00rootroot00000000000000 #include "test.h" typedef short short16 __attribute__((vector_size(16))); int main() { short16 a = {1000, -2000, 3000, -4000, 5000, -6000, 7000, -8000}; short16 b = {1, 0, 1, 0, 2, 0, 2, 0}; short16 c = __builtin_ia32_psraw128(a, b); // shift each 16-bit element right by 2 for(int i=0; i<8; i++) { printf("%d ", c[i]); if (i % 2 == 0) ASSERT(0, c[i]); else ASSERT(-1, c[i]); } printf("\n"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrawi.c000066400000000000000000000010641517770275000173540ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = (v4hi){-4, -8, 16, 32}; int count = 2; v4hi result = __builtin_ia32_psrawi(a, count); for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } printf("\n"); ASSERT(-1, result[0]); ASSERT(-2, result[1]); ASSERT(4, result[2]); ASSERT(8, result[3]); result = __builtin_ia32_psrawi(a, 2); ASSERT(-1, result[0]); ASSERT(-2, result[1]); ASSERT(4, result[2]); ASSERT(8, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrawi128.c000066400000000000000000000020161517770275000176050ustar00rootroot00000000000000#include "test.h" #include typedef short v8hi __attribute__((vector_size(16))); int main() { v8hi a = { 1000, -1000, 32767, -32768, 1234, -1234, 500, -500 }; // Shift right arithmetic by 2 bits v8hi r = __builtin_ia32_psrawi128((v8hi)a, 2); short *res = (short *)&r; for (int i = 0; i < 8; i++) { printf("%d ", res[i]); } printf("\n"); ASSERT(250, r[0]); ASSERT(-250, r[1]); ASSERT(8191, r[2]); ASSERT(-8192, r[3]); ASSERT(308, r[4]); ASSERT(-309, r[5]); ASSERT(125, r[6]); ASSERT(-125, r[7]); int count = 2; r = __builtin_ia32_psrawi128((v8hi)a, 2); res = (short *)&r; for (int i = 0; i < 8; i++) { printf("%d ", res[i]); } printf("\n"); ASSERT(250, r[0]); ASSERT(-250, r[1]); ASSERT(8191, r[2]); ASSERT(-8192, r[3]); ASSERT(308, r[4]); ASSERT(-309, r[5]); ASSERT(125, r[6]); ASSERT(-125, r[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrld.c000066400000000000000000000007401517770275000171730ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); // 2 x 32-bit ints int main() { v2si a = {4, -4}; // second value has sign bit set // Logical shift right by vector count v2si count_vec = {1, 1}; v2si r1 = __builtin_ia32_psrld(a, count_vec); printf("psrld variable count: %u %u\n", (unsigned)r1[0], (unsigned)r1[1]); ASSERT(0, (unsigned)r1[0]); ASSERT(0, (unsigned)r1[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrld128.c000066400000000000000000000007051517770275000174270ustar00rootroot00000000000000#include "test.h" typedef int int4 __attribute__((vector_size(16))); int main() { int4 a = {1, 2, 3, 4}; int4 b = {1, 0, 1, 0}; int4 c = __builtin_ia32_psrld128(a, b); // shift each 32-bit element right by 1 for(int i = 0; i < 4; i++) { printf("%d ", c[i]); } printf("\n"); ASSERT(0, c[0]); ASSERT(1, c[1]); ASSERT(1, c[2]); ASSERT(2, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrldi.c000066400000000000000000000013101517770275000173360ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); // 2 x 32-bit ints int main() { v2si a = {4, -4}; // second value has sign bit set // Logical shift right by vector count v2si count_vec = {1, 1}; // Logical shift right by immediate count v2si r2 = __builtin_ia32_psrldi(a, 1); printf("psrldi immediate count: %u %u\n", (unsigned)r2[0], (unsigned)r2[1]); int count = 1; r2 = __builtin_ia32_psrldi(a, count); printf("psrldi immediate count: %u %u\n", (unsigned)r2[0], (unsigned)r2[1]); // psrldi : 2 2147483646 ASSERT(2, (unsigned)r2[0]); ASSERT(2147483646, (unsigned)r2[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrldi128.c000066400000000000000000000016311517770275000175770ustar00rootroot00000000000000#include "test.h" #include typedef int v4si __attribute__((vector_size(16))); int main() { v4si a = { 0xFFFFFFFF, 0x80000000, 0x12345678, 0x00000001 }; // Shift right logical by 1 v4si r = __builtin_ia32_psrldi128((v4si)a, 1); unsigned int *res = (unsigned int *)&r; for (int i = 0; i < 4; i++) { printf("%08x ", res[i]); } printf("\n"); ASSERT(0x7fffffff, r[0]); ASSERT(0x40000000, r[1]); ASSERT(0x091a2b3c, r[2]); ASSERT(0x00000000, r[3]); int count = 1; r = __builtin_ia32_psrldi128((v4si)a, count); res = (unsigned int *)&r; for (int i = 0; i < 4; i++) { printf("%08x ", res[i]); } printf("\n"); ASSERT(0x7fffffff, r[0]); ASSERT(0x40000000, r[1]); ASSERT(0x091a2b3c, r[2]); ASSERT(0x00000000, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrldi256.c000066400000000000000000000021221517770275000175750ustar00rootroot00000000000000// test_avx2_psrldi256.c // // Verifies: // - __AVX2__ macro exists // - __builtin_ia32_psrldi256 lowering // - correct vpsrld codegen // - logical (NOT arithmetic) right shift semantics // // Expected: // exit code 0 #include int main(void) { #ifdef __AVX2__ // Use negative values to distinguish: // logical shift vs arithmetic shift // // arithmetic: // 0xFFFFFFFF >> 1 -> 0xFFFFFFFF // // logical: // 0xFFFFFFFF >> 1 -> 0x7FFFFFFF __m256i v = _mm256_set1_epi32(-1); __m256i r = _mm256_srli_epi32(v, 1); unsigned int out[8]; _mm256_storeu_si256((__m256i *)out, r); for (int i = 0; i < 8; i++) { if (out[i] != 0x7FFFFFFF) return i + 1; } __m256i v1 = _mm256_set1_epi32(0x80000000); __m256i r1 = _mm256_srli_epi32(v1, 31); unsigned int out1[8]; _mm256_storeu_si256((__m256i *)out1, r1); for (int i = 0; i < 8; i++) { if (out1[i] != 1) return 1; } return 0; #else #error "__AVX2__ not defined" #endif } chibicc-1.0.24/test/builtin_psrldqi256.c000066400000000000000000000011161517770275000177600ustar00rootroot00000000000000#include #include #include #include "test.h" int main() { uint8_t X[32]; for (int i = 0; i < 32; i++) X[i] = (uint8_t)(i + 1); __m256i x; memcpy(&x, X, 32); // Shift right by 4 bytes within each 128-bit lane. __m256i r = _mm256_srli_si256(x, 4); uint8_t out[32]; memcpy(out, &r, 32); for (int i = 0; i < 32; i++) { int lane_base = (i / 16) * 16; uint8_t expected = 0; int j = i + 4; if (j < lane_base + 16) expected = X[j]; if (out[i] != expected) return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrlq.c000066400000000000000000000012221517770275000172040ustar00rootroot00000000000000#include "test.h" typedef long long v1di __attribute__((vector_size(8))); int main() { v1di a = {0x123456789abcdef0LL}; v1di count = {4}; v1di result_var = __builtin_ia32_psrlq(a, count); v1di result_imm = __builtin_ia32_psrlqi(a, 4); printf("result_var: 0x%llx\n", result_var[0]); printf("result_imm: 0x%llx\n", result_imm[0]); LASSERT(0x123456789abcdefLL, (long long)result_var[0]); LASSERT(0x123456789abcdefLL, (long long)result_imm[0]); int c = 4; result_imm = __builtin_ia32_psrlqi(a, c); LASSERT(0x123456789abcdefLL, (long long)result_imm[0]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrlq128.c000066400000000000000000000006271517770275000174470ustar00rootroot00000000000000#include "test.h" typedef long long v2li __attribute__((vector_size(16))); int main() { v2li a = {1, 2,}; v2li b = {1, 0}; v2li c = __builtin_ia32_psrlq128(a, b); // shift each 32-bit element right by 1 for(int i = 0; i < 2; i++) { printf("%lld ", c[i]); } printf("\n"); ASSERT(0, c[0]); ASSERT(1, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrlqi128.c000066400000000000000000000014201517770275000176100ustar00rootroot00000000000000#include "test.h" #include typedef long long v2di __attribute__((vector_size(16))); int main() { v2di a = { 0xFFFFFFFFFFFFFFFF, 0x8000000000000000 }; // Shift right logical by 1 v2di r = __builtin_ia32_psrlqi128((v2di)a, 1); unsigned long long *res = (unsigned long long *)&r; for (int i = 0; i < 2; i++) { printf("%016llx ", res[i]); } printf("\n"); LASSERT(0x7fffffffffffffff, r[0]); LASSERT(0x4000000000000000, r[1]); int count = 1; // Shift right logical by 1 r = __builtin_ia32_psrlqi128((v2di)a, count); res = (unsigned long long *)&r; for (int i = 0; i < 2; i++) { printf("%016llx ", res[i]); } printf("\n"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrlqi256.c000066400000000000000000000073501517770275000176220ustar00rootroot00000000000000 // test___builtin_ia32_psrlqi256.c // Compile: gcc -O2 -mavx2 test.c -o test && ./test #include #include #include #include /* Helper: extract uint64 lane i (0-3) from __m256i */ static inline uint64_t get64(__m256i v, int i) { uint64_t buf[4]; _mm256_storeu_si256((__m256i *)buf, v); return buf[i]; } int main(void) { /* ── Test 1: shift by 1 ────────────────────────────────────── */ // Each 64-bit lane: 0x8000000000000000 >> 1 == 0x4000000000000000 __m256i a = _mm256_set1_epi64x((int64_t)0x8000000000000000ULL); __m256i r1 = __builtin_ia32_psrlqi256(a, 1); assert(get64(r1, 0) == 0x4000000000000000ULL); assert(get64(r1, 1) == 0x4000000000000000ULL); assert(get64(r1, 2) == 0x4000000000000000ULL); assert(get64(r1, 3) == 0x4000000000000000ULL); /* ── Test 2: shift by 4 (nibble boundary) ──────────────────── */ // 0xDEADBEEFCAFEBABE >> 4 == 0x0DEADBEEFCAFEBAB __m256i b = _mm256_set1_epi64x((int64_t)0xDEADBEEFCAFEBABEULL); __m256i r4 = __builtin_ia32_psrlqi256(b, 4); assert(get64(r4, 0) == 0x0DEADBEEFCAFEBABULL); assert(get64(r4, 3) == 0x0DEADBEEFCAFEBABULL); /* ── Test 3: shift by 63 (single bit survives) ─────────────── */ __m256i c = _mm256_set1_epi64x((int64_t)0xFFFFFFFFFFFFFFFFULL); __m256i r63 = __builtin_ia32_psrlqi256(c, 63); assert(get64(r63, 0) == 0x0000000000000001ULL); assert(get64(r63, 1) == 0x0000000000000001ULL); assert(get64(r63, 2) == 0x0000000000000001ULL); assert(get64(r63, 3) == 0x0000000000000001ULL); /* ── Test 4: shift by 64 zeroes every lane ─────────────────── */ __m256i r64 = __builtin_ia32_psrlqi256(c, 64); assert(get64(r64, 0) == 0ULL); assert(get64(r64, 1) == 0ULL); assert(get64(r64, 2) == 0ULL); assert(get64(r64, 3) == 0ULL); /* ── Test 5: shift by 0 is identity ────────────────────────── */ __m256i d = _mm256_set_epi64x( (int64_t)0xAAAAAAAAAAAAAAAAULL, (int64_t)0xBBBBBBBBBBBBBBBBULL, (int64_t)0xCCCCCCCCCCCCCCCCULL, (int64_t)0xDDDDDDDDDDDDDDDDULL ); __m256i r0 = __builtin_ia32_psrlqi256(d, 0); assert(get64(r0, 0) == 0xDDDDDDDDDDDDDDDDULL); assert(get64(r0, 1) == 0xCCCCCCCCCCCCCCCCULL); assert(get64(r0, 2) == 0xBBBBBBBBBBBBBBBBULL); assert(get64(r0, 3) == 0xAAAAAAAAAAAAAAAAULL); /* ── Test 6: logical (not arithmetic) — MSB becomes 0 ──────── */ // If the shift were arithmetic the MSB would stay 1; // logical shift must produce 0x7FFFFFFFFFFFFFFF __m256i e = _mm256_set1_epi64x((int64_t)0xFFFFFFFFFFFFFFFFULL); __m256i r_log = __builtin_ia32_psrlqi256(e, 1); assert(get64(r_log, 0) == 0x7FFFFFFFFFFFFFFFULL); assert(get64(r_log, 3) == 0x7FFFFFFFFFFFFFFFULL); /* ── Test 7: lanes are independent ─────────────────────────── */ __m256i f = _mm256_set_epi64x( (int64_t)0x0000000000000010ULL, // lane 3 (int64_t)0x0000000000000200ULL, // lane 2 (int64_t)0x0000000000004000ULL, // lane 1 (int64_t)0x0000000000080000ULL // lane 0 ); // shift by 4: each value loses its lowest 4 bits __m256i r_ind = __builtin_ia32_psrlqi256(f, 4); assert(get64(r_ind, 0) == 0x0000000000008000ULL); assert(get64(r_ind, 1) == 0x0000000000000400ULL); assert(get64(r_ind, 2) == 0x0000000000000020ULL); assert(get64(r_ind, 3) == 0x0000000000000001ULL); printf("All tests passed.\n"); return 0; } chibicc-1.0.24/test/builtin_psrlw.c000066400000000000000000000014451517770275000172210ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = (v4hi){4, 8, -4, -8}; // v4hi with signed values v4hi count = (v4hi){1, 1, 1, 1}; // shift right by 1 bit each // Logical shift right on packed 16-bit integers (ignores sign) v4hi result = __builtin_ia32_psrlw(a, count); for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } printf("\n"); ASSERT(4, a[0]); ASSERT(8, a[1]); ASSERT(-4, a[2]); ASSERT(-8, a[3]); ASSERT(1, count[0]); ASSERT(1, count[1]); ASSERT(1, count[2]); ASSERT(1, count[3]); ASSERT(0, result[0]); ASSERT(0, result[1]); ASSERT(0, result[2]); ASSERT(0, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrlw128.c000066400000000000000000000007031517770275000174500ustar00rootroot00000000000000#include "test.h" typedef short short16 __attribute__((vector_size(16))); int main() { short16 a = {1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000}; short16 b = {1, 0, 1, 0, 1, 0, 1, 0}; short16 c = __builtin_ia32_psrlw128(a, b); // shift each 16-bit element right by 3 for(int i = 0; i < 8; i++) { printf("%d ", c[i]); ASSERT(0, c[i]); } printf("\n"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrlwi.c000066400000000000000000000013761517770275000173750ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = (v4hi){4, 8, -4, -8}; // v4hi with signed values // Logical shift right by immediate 1 bit v4hi result = __builtin_ia32_psrlwi(a, 1); for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } printf("\n"); // Expect: 2 4 32766 32764 (logical shift right ignores sign bit) ASSERT(2, result[0]); ASSERT(4, result[1]); ASSERT(32766, result[2]); ASSERT(32764, result[3]); int count = 1; result = __builtin_ia32_psrlwi(a, count); ASSERT(2, result[0]); ASSERT(4, result[1]); ASSERT(32766, result[2]); ASSERT(32764, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psrlwi128.c000066400000000000000000000021271517770275000176230ustar00rootroot00000000000000#include "test.h" #include typedef short v8hi __attribute__((vector_size(16))); int main() { v8hi a = { 0xFFFF, 0x8000, 0x1234, 0x0001, 0x7FFF, 0x4000, 0xAAAA, 0x5555 }; // Shift right logical by 1 v8hi r = __builtin_ia32_psrlwi128((v8hi)a, 1); unsigned short *res = (unsigned short *)&r; for (int i = 0; i < 8; i++) { printf("%04x ", res[i]); } printf("\n"); ASSERT(0x7fff, r[0]); ASSERT(0x4000, r[1]); ASSERT(0x091a, r[2]); ASSERT(0x0000, r[3]); ASSERT(0x3fff, r[4]); ASSERT(0x2000, r[5]); ASSERT(0x5555, r[6]); ASSERT(0x2aaa, r[7]); int count = 1; r = __builtin_ia32_psrlwi128((v8hi)a, count); res = (unsigned short *)&r; for (int i = 0; i < 8; i++) { printf("%04x ", res[i]); } printf("\n"); ASSERT(0x7fff, r[0]); ASSERT(0x4000, r[1]); ASSERT(0x091a, r[2]); ASSERT(0x0000, r[3]); ASSERT(0x3fff, r[4]); ASSERT(0x2000, r[5]); ASSERT(0x5555, r[6]); ASSERT(0x2aaa, r[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psubb.c000066400000000000000000000017011517770275000171600ustar00rootroot00000000000000 #include "test.h" typedef char v8qi __attribute__((vector_size(8))); int main(void) { v8qi a = {100, -50, 30, -128, 10, 20, 30, 40}; v8qi b = {50, 50, -30, 1, 5, 5, 5, 5}; v8qi result = (v8qi)__builtin_ia32_psubb(a, b); for (int i = 0; i < 8; i++) printf("%d ", result[i]); ASSERT(100, a[0]); ASSERT(-50, a[1]); ASSERT(30, a[2]); ASSERT(-128, a[3]); ASSERT(10, a[4]); ASSERT(20, a[5]); ASSERT(30, a[6]); ASSERT(40, a[7]); ASSERT(50, b[0]); ASSERT(50, b[1]); ASSERT(-30, b[2]); ASSERT(1, b[3]); ASSERT(5, b[4]); ASSERT(5, b[5]); ASSERT(5, b[6]); ASSERT(5, b[7]); ASSERT(50, result[0]); ASSERT(-100, result[1]); ASSERT(60, result[2]); ASSERT(127, result[3]); ASSERT(5, result[4]); ASSERT(15, result[5]); ASSERT(25, result[6]); ASSERT(35, result[7]); printf("\n"); printf("OK\n"); } chibicc-1.0.24/test/builtin_psubd.c000066400000000000000000000007621517770275000171700ustar00rootroot00000000000000 #include "test.h" typedef int v2si __attribute__((vector_size(8))); int main(void) { v2si a = {100000, -200000}; v2si b = {50000, 100000}; v2si result = (v2si)__builtin_ia32_psubd(a, b); for (int i = 0; i < 2; i++) printf("%d ", result[i]); printf("\n"); ASSERT(100000, a[0]); ASSERT(-200000, a[1]); ASSERT(50000, b[0]); ASSERT(100000, b[1]); ASSERT(50000, result[0]); ASSERT(-300000, result[1]); printf("OK\n"); } chibicc-1.0.24/test/builtin_psubq.c000066400000000000000000000005171517770275000172030ustar00rootroot00000000000000 #include "test.h" typedef long long v1di __attribute__((vector_size(8))); int main(void) { v1di a = {10000000000LL}; v1di b = {5000000000LL}; v1di result = (v1di)__builtin_ia32_psubq(a, b); printf("%lld\n", (long long)result[0]); LASSERT(5000000000, (long long)result[0]); printf("OK\n"); } chibicc-1.0.24/test/builtin_psubsb.c000066400000000000000000000020301517770275000173370ustar00rootroot00000000000000#include "test.h" typedef char v8qi __attribute__((vector_size(8))); int main() { v8qi a = {100, 50, -100, -50, 127, -128, 10, -10}; v8qi b = {50, 100, -50, -100, 1, 1, 20, 20}; v8qi result = __builtin_ia32_psubsb(a, b); for (int i = 0; i < 8; i++) { printf("%d ", (int)result[i]); } printf("\n"); ASSERT(100, a[0]); ASSERT(50, a[1]); ASSERT(-100, a[2]); ASSERT(-50, a[3]); ASSERT(127, a[4]); ASSERT(-128, a[5]); ASSERT(10, a[6]); ASSERT(-10, a[7]); ASSERT(50, b[0]); ASSERT(100, b[1]); ASSERT(-50, b[2]); ASSERT(-100, b[3]); ASSERT(1, b[4]); ASSERT(1, b[5]); ASSERT(20, b[6]); ASSERT(20, b[7]); ASSERT(50, (int) result[0]); ASSERT(-50, (int) result[1]); ASSERT(-50, (int) result[2]); ASSERT(50, (int) result[3]); ASSERT(126, (int) result[4]); ASSERT(-128, (int) result[5]); ASSERT(-10, (int) result[6]); ASSERT(-30, (int) result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psubsb128.c000066400000000000000000000021711517770275000176000ustar00rootroot00000000000000#include "test.h" #include typedef char v16qi __attribute__((vector_size(16))); v16qi do_psubsb(v16qi a, v16qi b) { // Saturated subtraction of packed signed 8-bit integers return __builtin_ia32_psubsb128(a, b); } int main() { v16qi a = { 120, 100, -120, -100, 50, -50, 127, -127, 10, 20, -30, 40, 90, -90, 60, -60 }; v16qi b = { 10, 50, -50, 100, -100, -100, -1, 1, -10, 30, 40, -50, -90, 90, -70, 70 }; v16qi result = do_psubsb(a, b); printf("Result: "); for (int i = 0; i < 16; i++) printf("%d ", result[i]); ASSERT(110, result[0]); ASSERT(50, result[1]); ASSERT(-70, result[2]); ASSERT(-128, result[3]); ASSERT(127, result[4]); ASSERT(50, result[5]); ASSERT(127, result[6]); ASSERT(-128, result[7]); ASSERT(20, result[8]); ASSERT(-10, result[9]); ASSERT(-70, result[10]); ASSERT(90, result[11]); ASSERT(127, result[12]); ASSERT(-128, result[13]); ASSERT(127, result[14]); ASSERT(-128, result[15]); printf("\n"); return 0; } chibicc-1.0.24/test/builtin_psubsw.c000066400000000000000000000013111517770275000173650ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {30000, -30000, 100, -100}; v4hi b = {1000, 1000, 500, 500}; v4hi result = __builtin_ia32_psubsw(a, b); for (int i = 0; i < 4; i++) { printf("%d ", (int)result[i]); } ASSERT(30000, a[0]); ASSERT(-30000, a[1]); ASSERT(100, a[2]); ASSERT(-100, a[3]); ASSERT(1000, b[0]); ASSERT(1000, b[1]); ASSERT(500, b[2]); ASSERT(500, b[3]); ASSERT(29000, (int) result[0]); ASSERT(-31000, (int) result[1]); ASSERT(-400, (int) result[2]); ASSERT(-600, (int) result[3]); printf("\n"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psubsw128.c000066400000000000000000000013761517770275000176330ustar00rootroot00000000000000#include "test.h" #include typedef long long __v2di __attribute__((__vector_size__(16))); typedef short __v8hi __attribute__((__vector_size__(16))); int main() { __v8hi a = {30000, -20000, 15000, -32768, 1000, -1000, 20000, -15000}; __v8hi b = {10000, -20000, 20000, 1000, 5000, -4000, -30000, 20000}; __v8hi res = __builtin_ia32_psubsw128(a, b); short *vals = (short*)&res; for (int i = 0; i < 8; i++) printf("%d ", vals[i]); printf("\n"); ASSERT(20000, res[0]); ASSERT(0, res[1]); ASSERT(-5000, res[2]); ASSERT(-32768, res[3]); ASSERT(-4000, res[4]); ASSERT(3000, res[5]); ASSERT(32767, res[6]); ASSERT(-32768, res[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psubusb.c000066400000000000000000000021751517770275000175360ustar00rootroot00000000000000#include "test.h" typedef unsigned char v8qu __attribute__((vector_size(8))); typedef char v8qi __attribute__((vector_size(8))); int main() { v8qu a = {255, 200, 100, 50, 25, 10, 5, 0}; v8qu b = {1, 50, 50, 25, 10, 5, 5, 0}; v8qu result =(v8qu) __builtin_ia32_psubusb((v8qi)a, (v8qi)b); for (int i = 0; i < 8; i++) { printf("%u ", (unsigned)result[i]); } printf("\n"); ASSERT(255, a[0]); ASSERT(200, a[1]); ASSERT(100, a[2]); ASSERT(50, a[3]); ASSERT(25, a[4]); ASSERT(10, a[5]); ASSERT(5, a[6]); ASSERT(0, a[7]); ASSERT(1, b[0]); ASSERT(50, b[1]); ASSERT(50, b[2]); ASSERT(25, b[3]); ASSERT(10, b[4]); ASSERT(5, b[5]); ASSERT(5, b[6]); ASSERT(0, b[7]); ASSERT(254, (unsigned) result[0]); ASSERT(150, (unsigned) result[1]); ASSERT(50, (unsigned) result[2]); ASSERT(25, (unsigned) result[3]); ASSERT(15, (unsigned) result[4]); ASSERT(5, (unsigned) result[5]); ASSERT(0, (unsigned) result[6]); ASSERT(0, (unsigned) result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psubusb128.c000066400000000000000000000026161517770275000177710ustar00rootroot00000000000000#include "test.h" #include typedef char __m128i __attribute__((__vector_size__(16), __may_alias__)); typedef unsigned char __m128u __attribute__((__vector_size__(16), __may_alias__)); __m128i test_psubusb128(__m128i a, __m128i b) { return __builtin_ia32_psubusb128(a, b); } int main() { // Initialize with unsigned bytes __m128i a = (__m128i){ 200, 255, 0, 50, 100, 5, 255, 10, 200, 255, 0, 50, 100, 5, 255, 10 }; __m128i b = (__m128i){ 100, 100, 100, 100, 200, 200, 5, 20, 100, 100, 100, 100, 200, 200, 5, 20 }; __m128u result = (__m128u)test_psubusb128(a, b); unsigned char *res = (unsigned char *)&result; printf("Result: "); for (int i = 0; i < 16; i++) printf("%u ", res[i]); printf("\n"); // Expected (saturated at 0) // 100, 155, 0, 0, 0, 0, 250, 0, // 100, 155, 0, 0, 0, 0, 250, 0 ASSERT(100, result[0]); ASSERT(155, result[1]); ASSERT(0, result[2]); ASSERT(0, result[3]); ASSERT(0, result[4]); ASSERT(0, result[5]); ASSERT(250, result[6]); ASSERT(0, result[7]); ASSERT(100, result[8]); ASSERT(155, result[9]); ASSERT(0, result[10]); ASSERT(0, result[11]); ASSERT(0, result[12]); ASSERT(0, result[13]); ASSERT(250, result[14]); ASSERT(0, result[15]); printf("OK\n"); } chibicc-1.0.24/test/builtin_psubusb256.c000066400000000000000000000010321517770275000177620ustar00rootroot00000000000000#include "test.h" #include #include int main(void) { uint8_t A[32]; uint8_t B[32]; for (int i = 0; i < 32; i++) { A[i] = i; // 0..31 B[i] = i + 1; // 1..32 } __m256i a = *(__m256i *)A; __m256i b = *(__m256i *)B; __m256i c = _mm256_subs_epu8(a, b); uint8_t *res = (uint8_t *)&c; // Validate: saturating subtract → always 0 for (int i = 0; i < 32; i++) { if (res[i] != 0) return 1; } printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_psubusw.c000066400000000000000000000014611517770275000175600ustar00rootroot00000000000000#include "test.h" typedef unsigned short v4hu __attribute__((vector_size(8))); typedef short v4hi __attribute__((vector_size(8))); int main() { v4hu a = {65535, 40000, 30000, 10000}; v4hu b = {1, 1000, 40000, 5000}; v4hu result = (v4hu)__builtin_ia32_psubusw((v4hi)a, (v4hi)b); for (int i = 0; i < 4; i++) { printf("%u ", (unsigned)result[i]); } printf("\n"); ASSERT(65535, a[0]); ASSERT(40000, a[1]); ASSERT(30000, a[2]); ASSERT(10000, a[3]); ASSERT(1, b[0]); ASSERT(1000, b[1]); ASSERT(40000, b[2]); ASSERT(5000, b[3]); ASSERT(65534, (unsigned) result[0]); ASSERT(39000, (unsigned) result[1]); ASSERT(0, (unsigned) result[2]); ASSERT(5000, (unsigned) result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psubusw128.c000066400000000000000000000015301517770275000200100ustar00rootroot00000000000000#include "test.h" #include typedef short __m128i __attribute__((__vector_size__(16), __may_alias__)); typedef unsigned short __m128u __attribute__((__vector_size__(16), __may_alias__)); int main() { // Test vectors __m128i a = (__m128i){ 500, 1000, 30000, 40000, 50, 60, 65535, 0 }; __m128i b = (__m128i){ 100, 2000, 40000, 500, 100, 50, 65535, 1 }; __m128u result = (__m128u)__builtin_ia32_psubusw128(a, b); uint16_t *res = (uint16_t *)&result; for (int i = 0; i < 8; i++) { printf("%u ", res[i]); } printf("\n"); ASSERT(400, result[0]); ASSERT(0, result[1]); ASSERT(0, result[2]); ASSERT(39500, result[3]); ASSERT(0, result[4]); ASSERT(10, result[5]); ASSERT(0, result[6]); ASSERT(0, result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_psubw.c000066400000000000000000000012351517770275000172070ustar00rootroot00000000000000 #include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main(void) { v4hi a = {1000, -2000, 3000, -32768}; v4hi b = {500, 500, -3000, 1}; v4hi result = (v4hi)__builtin_ia32_psubw(a, b); for (int i = 0; i < 4; i++) printf("%d ", result[i]); ASSERT(1000, a[0]); ASSERT(-2000, a[1]); ASSERT(3000, a[2]); ASSERT(-32768, a[3]); ASSERT(500, b[0]); ASSERT(500, b[1]); ASSERT(-3000, b[2]); ASSERT(1, b[3]); ASSERT(500, result[0]); ASSERT(-2500, result[1]); ASSERT(6000, result[2]); ASSERT(32767, result[3]); printf("\n"); printf("OK\n"); } chibicc-1.0.24/test/builtin_ptestc128.c000066400000000000000000000012401517770275000176000ustar00rootroot00000000000000#include "test.h" typedef long long v2di __attribute__((vector_size(16))); int main() { v2di a = {0xFFLL, 0x0LL}; v2di b = {0xFFLL, 0x0LL}; v2di c = {0x0LL, 0xFFLL}; v2di d = {0xFFLL, 0xFFLL}; // a & b == b? yes -> 1 int r1 = __builtin_ia32_ptestc128(a, b); ASSERT(1, r1); // a & c == c? a&c = {0,0} != c -> 0 int r2 = __builtin_ia32_ptestc128(a, c); ASSERT(0, r2); // d & b == b? d&b = {0xFF,0} == b -> 1 int r3 = __builtin_ia32_ptestc128(d, b); ASSERT(1, r3); // c & a == a? c&a = {0,0} != a -> 0 int r4 = __builtin_ia32_ptestc128(c, a); ASSERT(0, r4); printf("ptestc128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_ptestnzc128.c000066400000000000000000000012471517770275000201570ustar00rootroot00000000000000#include "test.h" typedef long long v2di __attribute__((vector_size(16))); int main() { v2di M, V; // Case that returns 1 M = (v2di){0x0FLL, 0x00LL}; V = (v2di){0x03LL, 0x00LL}; int r1 = __builtin_ia32_ptestnzc128(V, M); ASSERT(1, r1); // Case that returns 0 (V covers all bits of M) M = (v2di){0x0FLL, 0x00LL}; V = (v2di){0x0FLL, 0x00LL}; int r2 = __builtin_ia32_ptestnzc128(V, M); ASSERT(0, r2); // Case that returns 0 (V has no bits of M set) M = (v2di){0x0FLL, 0x00LL}; V = (v2di){0x00LL, 0x00LL}; int r3 = __builtin_ia32_ptestnzc128(V, M); ASSERT(0, r3); printf("ptestnzc128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_ptestz128.c000066400000000000000000000012271517770275000176340ustar00rootroot00000000000000#include "test.h" typedef long long v2di __attribute__((vector_size(16))); int main() { v2di a = {0x0LL, 0x0LL}; v2di b = {0x0LL, 0x0LL}; v2di c = {0xFFLL, 0x0LL}; v2di d = {0x0LL, 0xFFLL}; // a & b == 0 -> should return 1 int r1 = __builtin_ia32_ptestz128(a, b); ASSERT(1, r1); // c & d == 0 -> should return 1 int r2 = __builtin_ia32_ptestz128(c, d); ASSERT(1, r2); // a & c != 0 -> should return 0 int r3 = __builtin_ia32_ptestz128(a, c); ASSERT(1, r3); // d & c != 0 -> should return 0 int r4 = __builtin_ia32_ptestz128(d, c); ASSERT(1, r4); printf("ptestz128 OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpckhbw.c000066400000000000000000000016541517770275000200550ustar00rootroot00000000000000#include "test.h" typedef char v8qi __attribute__((vector_size(8))); int main() { v8qi a = {0,1,2,3,4,5,6,7}; v8qi b = {10,11,12,13,14,15,16,17}; v8qi result = (v8qi)__builtin_ia32_punpckhbw(a, b); for (int i = 0; i < 8; i++) { printf("%u ", (unsigned int)result[i]); } ASSERT(0, a[0]); ASSERT(1, a[1]); ASSERT(2, a[2]); ASSERT(3, a[3]); ASSERT(4, a[4]); ASSERT(5, a[5]); ASSERT(6, a[6]); ASSERT(7, a[7]); ASSERT(10, b[0]); ASSERT(11, b[1]); ASSERT(12, b[2]); ASSERT(13, b[3]); ASSERT(14, b[4]); ASSERT(15, b[5]); ASSERT(16, b[6]); ASSERT(17, b[7]); ASSERT(4, result[0]); ASSERT(14, result[1]); ASSERT(5, result[2]); ASSERT(15, result[3]); ASSERT(6, result[4]); ASSERT(16, result[5]); ASSERT(7, result[6]); ASSERT(17, result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpckhbw128.c000066400000000000000000000020061517770275000203000ustar00rootroot00000000000000#include "test.h" typedef unsigned char __v16qu __attribute__((vector_size(16))); typedef char __v16qi __attribute__((vector_size(16))); __v16qi test_punpckhbw(__v16qi a, __v16qi b) { return __builtin_ia32_punpckhbw128(a, b); } int main(void) { __v16qi a = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; __v16qi b = {100,101,102,103,104,105,106,107, 108,109,110,111,112,113,114,115 }; __v16qu r = (__v16qu)test_punpckhbw(a, b); for (int i = 0; i < 16; i++) printf("%u ", r[i]); printf("\n"); ASSERT(8, r[0]); ASSERT(108, r[1]); ASSERT(9, r[2]); ASSERT(109, r[3]); ASSERT(10, r[4]); ASSERT(110, r[5]); ASSERT(11, r[6]); ASSERT(111, r[7]); ASSERT(12, r[8]); ASSERT(112, r[9]); ASSERT(13, r[10]); ASSERT(113, r[11]); ASSERT(14, r[12]); ASSERT(114, r[13]); ASSERT(15, r[14]); ASSERT(115, r[15]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpckhdq.c000066400000000000000000000007601517770275000200460ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); // 2 ints, 64 bits (MMX size) int main() { v2si a = {1000, 2000}; v2si b = {10, 20}; ASSERT(1000, a[0]); ASSERT(2000, a[1]); ASSERT(10, b[0]); ASSERT(20, b[1]); v2si result = __builtin_ia32_punpckhdq(a, b); for (int i = 0; i < 2; i++) { printf("%d ", result[i]); } ASSERT(2000, result[0]); ASSERT(20, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpckhdq128.c000066400000000000000000000010171517770275000202750ustar00rootroot00000000000000#include "test.h" typedef int __v4si __attribute__((vector_size(16))); __v4si test_punpckhdq128(__v4si a, __v4si b) { return __builtin_ia32_punpckhdq128(a, b); } int main(void) { __v4si a = { 0, 1, 2, 3 }; __v4si b = {100,101,102,103 }; __v4si r = test_punpckhdq128(a, b); for (int i = 0; i < 4; i++) printf("%d ", r[i]); printf("\n"); ASSERT(2, r[0]); ASSERT(102, r[1]); ASSERT(3, r[2]); ASSERT(103, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpckhqdq128.c000066400000000000000000000010171517770275000204560ustar00rootroot00000000000000#include "test.h" typedef int __v4si __attribute__((vector_size(16))); __v4si test_punpckhdq128(__v4si a, __v4si b) { return __builtin_ia32_punpckhdq128(a, b); } int main(void) { __v4si a = { 0, 1, 2, 3 }; __v4si b = {100,101,102,103 }; __v4si r = test_punpckhdq128(a, b); for (int i = 0; i < 4; i++) printf("%d ", r[i]); printf("\n"); ASSERT(2, r[0]); ASSERT(102, r[1]); ASSERT(3, r[2]); ASSERT(103, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpckhwd.c000066400000000000000000000011751517770275000200550ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); int main() { v4hi a = {100, 200, 300, 400}; v4hi b = {10, 20, 30, 40}; v4hi result = (v4hi)__builtin_ia32_punpckhwd(a, b); for (int i = 0; i < 8; i++) { printf("%d ", result[i]); } ASSERT(100, a[0]); ASSERT(200, a[1]); ASSERT(300, a[2]); ASSERT(400, a[3]); ASSERT(10, b[0]); ASSERT(20, b[1]); ASSERT(30, b[2]); ASSERT(40, b[3]); ASSERT(300, result[0]); ASSERT(30, result[1]); ASSERT(400, result[2]); ASSERT(40, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpckhwd128.c000066400000000000000000000012231517770275000203020ustar00rootroot00000000000000#include "test.h" typedef short __v8hi __attribute__((vector_size(16))); __v8hi test_punpckhwd128(__v8hi a, __v8hi b) { return __builtin_ia32_punpckhwd128(a, b); } int main(void) { __v8hi a = { 0, 1, 2, 3, 4, 5, 6, 7 }; __v8hi b = {100,101,102,103,104,105,106,107 }; __v8hi r = test_punpckhwd128(a, b); for (int i = 0; i < 8; i++) printf("%d ", r[i]); printf("\n"); ASSERT(4, r[0]); ASSERT(104, r[1]); ASSERT(5, r[2]); ASSERT(105, r[3]); ASSERT(6, r[4]); ASSERT(106, r[5]); ASSERT(7, r[6]); ASSERT(107, r[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpcklbw.c000066400000000000000000000016571517770275000200640ustar00rootroot00000000000000#include "test.h" typedef char v8qi __attribute__((vector_size(8))); // 8 bytes vector int main() { v8qi a = {1,2,3,4,5,6,7,8}; v8qi b = {10,20,30,40,50,60,70,80}; v8qi result = __builtin_ia32_punpcklbw(a, b); for (int i = 0; i < 8; i++) { printf("%d ", (int)result[i]); } ASSERT(1, a[0]); ASSERT(2, a[1]); ASSERT(3, a[2]); ASSERT(4, a[3]); ASSERT(5, a[4]); ASSERT(6, a[5]); ASSERT(7, a[6]); ASSERT(8, a[7]); ASSERT(10, b[0]); ASSERT(20, b[1]); ASSERT(30, b[2]); ASSERT(40, b[3]); ASSERT(50, b[4]); ASSERT(60, b[5]); ASSERT(70, b[6]); ASSERT(80, b[7]); ASSERT(1, result[0]); ASSERT(10, result[1]); ASSERT(2, result[2]); ASSERT(20, result[3]); ASSERT(3, result[4]); ASSERT(30, result[5]); ASSERT(4, result[6]); ASSERT(40, result[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpcklbw128.c000066400000000000000000000017131517770275000203100ustar00rootroot00000000000000#include "test.h" #include typedef unsigned char v16u8 __attribute__((vector_size(16))); typedef char v16i8 __attribute__((vector_size(16))); int main() { v16i8 a = {1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16}; v16i8 b = {100,101,102,103,104,105,106,107, 108,109,110,111,112,113,114,115}; v16u8 result = (v16u8)__builtin_ia32_punpcklbw128(a, b); unsigned char *p = (unsigned char *)&result; for (int i = 0; i < 16; i++) printf("%d ", p[i]); printf("\n"); ASSERT(1, p[0]); ASSERT(100, p[1]); ASSERT(2, p[2]); ASSERT(101, p[3]); ASSERT(3, p[4]); ASSERT(102, p[5]); ASSERT(4, p[6]); ASSERT(103, p[7]); ASSERT(5, p[8]); ASSERT(104, p[9]); ASSERT(6, p[10]); ASSERT(105, p[11]); ASSERT(7, p[12]); ASSERT(106, p[13]); ASSERT(8, p[14]); ASSERT(107, p[15]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpckldq.c000066400000000000000000000007661517770275000200600ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); // 2 ints, 64-bit vector (MMX) int main() { v2si a = {1000, 2000}; v2si b = {10, 20}; v2si result = __builtin_ia32_punpckldq(a, b); for (int i = 0; i < 2; i++) { printf("%d ", result[i]); } ASSERT(1000, a[0]); ASSERT(2000, a[1]); ASSERT(10, b[0]); ASSERT(20, b[1]); ASSERT(1000, result[0]); ASSERT(10, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpckldq128.c000066400000000000000000000012051517770275000203000ustar00rootroot00000000000000#include "test.h" typedef int __m128i __attribute__((vector_size(16))); int main() { __m128i a = {40, 30, 20, 10}; // [40, 30, 20, 10] __m128i b = {400, 300, 200, 100}; // [400, 300, 200, 100] __m128i r = __builtin_ia32_punpckldq128(a, b); // Expected: Interleave low 2 dwords from a and b: // a low part: 20, 10 // b low part: 200, 100 // => 20, 200, 10, 100 (in reverse order for little-endian print) printf("%d %d %d %d\n", r[0], r[1], r[2], r[3]); ASSERT(40, r[0]); ASSERT(400, r[1]); ASSERT(30, r[2]); ASSERT(300, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpcklqdq128.c000066400000000000000000000007441517770275000204700ustar00rootroot00000000000000#include "test.h" typedef long long __m128i __attribute__((vector_size(16))); int main() { __m128i a = {4, 1}; // { low=1, high=4 } __m128i b = {8, 2}; // { low=2, high=8 } __m128i r = __builtin_ia32_punpcklqdq128(a, b); unsigned long long *vals = (unsigned long long *)&r; printf("%llu %llu\n", vals[0], vals[1]); // Expected: low64(a)=1, low64(b)=2 => {1, 2} ASSERT(4, r[0]); ASSERT(8, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpcklwd.c000066400000000000000000000012241517770275000200540ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); // 4 shorts, 64-bit vector int main() { v4hi a = {100, 200, 300, 400}; v4hi b = {10, 20, 30, 40}; v4hi result = __builtin_ia32_punpcklwd(a, b); for (int i = 0; i < 4; i++) { printf("%d ", result[i]); } ASSERT(100, a[0]); ASSERT(200, a[1]); ASSERT(300, a[2]); ASSERT(400, a[3]); ASSERT(10, b[0]); ASSERT(20, b[1]); ASSERT(30, b[2]); ASSERT(40, b[3]); ASSERT(100, result[0]); ASSERT(10, result[1]); ASSERT(200, result[2]); ASSERT(20, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_punpcklwd128.c000066400000000000000000000012171517770275000203110ustar00rootroot00000000000000#include "test.h" typedef short __v8hi __attribute__((vector_size(16))); int main() { __v8hi a = {16, 15, 14, 13, 12, 11, 10, 9}; __v8hi b = {26, 25, 24, 23, 22, 21, 20, 19}; __v8hi res = (__v8hi)__builtin_ia32_punpcklwd128( (__v8hi)a, (__v8hi)b ); short *vals = (short *)&res; for (int i = 0; i < 8; i++) printf("%d ", vals[i]); printf("\n"); ASSERT(16, vals[0]); ASSERT(26, vals[1]); ASSERT(15, vals[2]); ASSERT(25, vals[3]); ASSERT(14, vals[4]); ASSERT(24, vals[5]); ASSERT(13, vals[6]); ASSERT(23, vals[7]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_pxor.c000066400000000000000000000016571517770275000170470ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); typedef v2si __m64; int main() { __m64 a = {0xFF00FF00, 0x00FF00FF}; __m64 b = {0x0F0F0F0F, 0xF0F0F0F0}; __m64 result = __builtin_ia32_pxor(a, b); printf("a[0] = 0x%x\n", a[0]); printf("a[1] = 0x%x\n", a[1]); printf("b[0] = 0x%x\n", b[0]); printf("b[1] = 0x%x\n", b[1]); printf("result[0] = 0x%x\n", result[0]); printf("result[1] = 0x%x\n", result[1]); // Expected: bitwise XOR if (result[0] == (a[0] ^ b[0]) && result[1] == (a[1] ^ b[1])) { printf("Test passed.\n"); } else { printf("Test failed.\n"); return 1; } ASSERT(0xff00ff00, a[0]); ASSERT(0xff00ff, a[1]); ASSERT(0xf0f0f0f, b[0]); ASSERT(0xf0f0f0f0, b[1]); ASSERT(0xf00ff00f, result[0]); ASSERT(0xf00ff00f, result[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_rcpps.c000066400000000000000000000006071517770275000172000ustar00rootroot00000000000000#include "test.h" typedef float __m128 __attribute__((vector_size(16))); int main(void) { __m128 a = { 1.0f, 2.0f, 4.0f, 8.0f }; __m128 out = __builtin_ia32_rcpps(a); printf("rcp: %f %f %f %f\n", out[0], out[1], out[2], out[3]); ASSERT(0, out[0]); ASSERT(0, out[1]); ASSERT(0, out[2]); ASSERT(0, out[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_rcpss.c000066400000000000000000000007751517770275000172110ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); v4sf __builtin_ia32_rcpss(v4sf a); int main() { v4sf a = {4.0f, 0, 0, 0}; v4sf r = __builtin_ia32_rcpss(a); float approx_reciprocal = ((float*)&r)[0]; // The reciprocal of 4.0f is 0.25, approximate result will be close. printf("approx reciprocal: %f\n", approx_reciprocal); ASSERT(0, r[0]); ASSERT(0, r[1]); ASSERT(0, r[2]); ASSERT(0, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_return_address.c000066400000000000000000000006301517770275000210710ustar00rootroot00000000000000#include "test.h" #include void *get_return_address() { return __builtin_return_address(0); } void *dummy_function() { return __builtin_return_address(0); } int main() { printf("Return address: %p\n", get_return_address()); printf("Return function : %p\n", dummy_function()); ASSERT(1, get_return_address() != NULL); ASSERT(1, dummy_function() != NULL); return 0; } chibicc-1.0.24/test/builtin_rotateleft32.c000066400000000000000000000005571517770275000203730ustar00rootroot00000000000000#include "test.h" int main(void) { unsigned int x = 0x01234567u; ASSERT(0x23456701u, __builtin_rotateleft32(x, 8)); ASSERT(0x01234567u, __builtin_rotateleft32(x, 0)); ASSERT(0x01234567u, __builtin_rotateleft32(x, 32)); ASSERT(0x12345670u, __builtin_rotateleft32(x, 4)); ASSERT(0x12345670u, __builtin_rotateleft32(x, 36)); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_rotateleft64.c000066400000000000000000000006661517770275000204010ustar00rootroot00000000000000#include "test.h" int main(void) { unsigned long long x = 0x0123456789ABCDEFULL; LASSERT(0x23456789ABCDEF01ULL, __builtin_rotateleft64(x, 8)); LASSERT(0x0123456789ABCDEFULL, __builtin_rotateleft64(x, 0)); LASSERT(0x0123456789ABCDEFULL, __builtin_rotateleft64(x, 64)); LASSERT(0x123456789ABCDEF0ULL, __builtin_rotateleft64(x, 4)); LASSERT(0x123456789ABCDEF0ULL, __builtin_rotateleft64(x, 68)); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_rsqrtps.c000066400000000000000000000007671517770275000175760ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {4.0f, 9.0f, 16.0f, 25.0f}; // Compute approximate reciprocal square root of each element v4sf r = __builtin_ia32_rsqrtps(a); printf("Reciprocal square roots:\n"); for (int i = 0; i < 4; i++) { printf("r[%d] = %f\n", i, r[i]); } ASSERT(0, r[0]); ASSERT(0, r[1]); ASSERT(0, r[2]); ASSERT(0, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_rsqrtss.c000066400000000000000000000010551517770275000175700ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); extern v4sf __builtin_ia32_rsqrtss(v4sf); int main(void) { v4sf a = { 4.0f, 9.0f, 16.0f, 25.0f }; v4sf result = __builtin_ia32_rsqrtss(a); printf("Input: %.6f %.6f %.6f %.6f\n", a[0], a[1], a[2], a[3]); printf("Output: %.6f %.6f %.6f %.6f\n", result[0], result[1], result[2], result[3]); ASSERT(0, result[0]); ASSERT(9, result[1]); ASSERT(16, result[2]); ASSERT(25, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_shuffle.c000066400000000000000000000010151517770275000174770ustar00rootroot00000000000000#include "test.h" typedef float __m128 __attribute__((vector_size(16))); typedef int __v2si __attribute__((vector_size(16))); int main(void) { __m128 a = {1.0f, 2.0f, 3.0f, 4.0f}; __m128 b = {5.0f, 6.0f, 7.0f, 8.0f}; __v2si mask = {0,4,2,7}; __m128 r = __builtin_shuffle(a, b, mask); float *f = (float*)&r; printf("%f %f %f %f\n", f[0], f[1], f[2], f[3]); ASSERT(1, f[0]); ASSERT(5, f[1]); ASSERT(3, f[2]); ASSERT(8, f[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_shuffle2.c000066400000000000000000000024351517770275000175700ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); typedef int __v4si __attribute__((vector_size(16))); #define TEST_SHUFFLE(a, b, mask) do { \ float4 res = __builtin_shuffle(a, b, mask); \ printf("mask = {%d,%d,%d,%d} => ", mask[0], mask[1], mask[2], mask[3]); \ printf("{%.1f, %.1f, %.1f, %.1f}\n", res[0], res[1], res[2], res[3]); \ } while (0) int main(void) { float4 a = {1.0, 2.0, 3.0, 4.0}; float4 b = {5.0, 6.0, 7.0, 8.0}; // Masks: 0–3 pull from 'a', 4–7 pull from 'b' __v4si mask1 = {0, 1, 2, 3}; // identity from a __v4si mask2 = {4, 5, 6, 7}; // identity from b __v4si mask3 = {0, 4, 1, 5}; // interleave a,b __v4si mask4 = {2, 7, 0, 5}; // mixed arbitrary __v4si mask5 = {7, 6, 5, 4}; // reverse b __v4si mask6 = {3, 2, 1, 0}; // reverse a __v4si mask7 = {0, 7, 4, 3}; // cross edges __v4si mask8 = {1, 4, 6, 2}; // mixed mid __v4si mask9 = {0, 4, 2, 7}; // your example TEST_SHUFFLE(a, b, mask1); TEST_SHUFFLE(a, b, mask2); TEST_SHUFFLE(a, b, mask3); TEST_SHUFFLE(a, b, mask4); TEST_SHUFFLE(a, b, mask5); TEST_SHUFFLE(a, b, mask6); TEST_SHUFFLE(a, b, mask7); TEST_SHUFFLE(a, b, mask8); TEST_SHUFFLE(a, b, mask9); return 0; } chibicc-1.0.24/test/builtin_shufpd.c000066400000000000000000000010471517770275000173410ustar00rootroot00000000000000#include "test.h" #define _MM_SHUFFLE(z, y, x, w) \ (((z) << 6) | ((y) << 4) | ((x) << 2) | (w)) typedef double __m128 __attribute__((vector_size(16))); int main(void) { __m128 a = {1.0f, 2.0f}; __m128 b = {5.0f, 6.0f}; __m128 r = __builtin_ia32_shufpd(a, b, _MM_SHUFFLE(0,1,2,3)); float *f = (float*)&r; printf("%f %f\n", f[0], f[1]); ASSERT(0, f[0]); ASSERT(2, f[1]); r = __builtin_ia32_shufpd(a, b, 27); ASSERT(0, f[0]); ASSERT(2, f[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_shufps.c000066400000000000000000000012441517770275000173570ustar00rootroot00000000000000#include "test.h" #define _MM_SHUFFLE(z, y, x, w) \ (((z) << 6) | ((y) << 4) | ((x) << 2) | (w)) typedef float __m128 __attribute__((vector_size(16))); int main(void) { __m128 a = {1.0f, 2.0f, 3.0f, 4.0f}; __m128 b = {5.0f, 6.0f, 7.0f, 8.0f}; __m128 r = __builtin_ia32_shufps(a, b, _MM_SHUFFLE(0,1,2,3)); float *f = (float*)&r; printf("%f %f %f %f\n", f[0], f[1], f[2], f[3]); ASSERT(4, f[0]); ASSERT(3, f[1]); ASSERT(6, f[2]); ASSERT(5, f[3]); r = __builtin_ia32_shufps(a, b, 27); ASSERT(4, f[0]); ASSERT(3, f[1]); ASSERT(6, f[2]); ASSERT(5, f[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_si256.c000066400000000000000000000100541517770275000167160ustar00rootroot00000000000000// test_avx2_cast.c // Tests for _mm256_castsi256_si128 and __builtin_ia32_si256_si // Compile with: cc -mavx2 -o test_avx2_cast test_avx2_cast.c #include #include "test.h" #include #include // --------------------------------------------------------------------------- // Helpers // --------------------------------------------------------------------------- static void print_m128i(const char *label, __m128i v) { int32_t buf[4]; memcpy(buf, &v, 16); printf("%s: [%d, %d, %d, %d]\n", label, buf[0], buf[1], buf[2], buf[3]); } static void print_m256i(const char *label, __m256i v) { int32_t buf[8]; memcpy(buf, &v, 32); printf("%s: [%d, %d, %d, %d, %d, %d, %d, %d]\n", label, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); } // --------------------------------------------------------------------------- // Test 1 — _mm256_castsi256_si128 // Extracts the low 128-bit lane of a 256-bit integer vector. // The upper 128 bits are discarded (no data movement occurs). // --------------------------------------------------------------------------- static int test_mm256_castsi256_si128(void) { int32_t src[8] = {1, 2, 3, 4, 5, 6, 7, 8}; __m256i v256 = _mm256_loadu_si256((__m256i *)src); print_m256i(" input (256)", v256); __m128i v128 = _mm256_castsi256_si128(v256); print_m128i(" low 128 ", v128); // Expected: the low four int32 lanes {1, 2, 3, 4} int32_t out[4]; memcpy(out, &v128, 16); int ok = (out[0] == 1 && out[1] == 2 && out[2] == 3 && out[3] == 4); printf(" result: %s\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 2 — __builtin_ia32_si256_si // GCC/clang builtin: zero-extends a __m128i to __m256i // (upper 128 bits are zeroed). This is the low-level form of // _mm256_zextsi128_si256 / _mm256_castsi128_si256 depending on the target. // --------------------------------------------------------------------------- static int test_builtin_ia32_si256_si(void) { int32_t src[4] = {10, 20, 30, 40}; __m128i v128 = _mm_loadu_si128((__m128i *)src); print_m128i(" input (128)", v128); // __builtin_ia32_si256_si promotes __m128i -> __m256i __m256i v256 = (__m256i)__builtin_ia32_si256_si((__v4si)v128); print_m256i(" result(256)", v256); // Expected: low four lanes == src, upper four lanes == 0 int32_t out[8]; memcpy(out, &v256, 32); int ok = (out[0] == 10 && out[1] == 20 && out[2] == 30 && out[3] == 40 && out[4] == 0 && out[5] == 0 && out[6] == 0 && out[7] == 0); printf(" result: %s\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // Test 3 — round-trip: si256_si then castsi256_si128 must give back original // --------------------------------------------------------------------------- static int test_roundtrip(void) { int32_t src[4] = {-1, 0, 42, 1337}; __m128i original = _mm_loadu_si128((__m128i *)src); __m256i promoted = (__m256i)__builtin_ia32_si256_si((__v4si)original); __m128i recovered = (__m128i)_mm256_castsi256_si128(promoted); int32_t out[4]; memcpy(out, &recovered, 16); int ok = (out[0] == src[0] && out[1] == src[1] && out[2] == src[2] && out[3] == src[3]); printf(" result: %s\n", ok ? "PASS" : "FAIL"); return ok; } // --------------------------------------------------------------------------- // main // --------------------------------------------------------------------------- int main(void) { int all_pass = 1; printf("=== Test 1: _mm256_castsi256_si128 ===\n"); all_pass &= test_mm256_castsi256_si128(); printf("\n=== Test 2: __builtin_ia32_si256_si ===\n"); all_pass &= test_builtin_ia32_si256_si(); printf("\n=== Test 3: round-trip (si256_si -> castsi256_si128) ===\n"); all_pass &= test_roundtrip(); printf("\n=== Overall: %s ===\n", all_pass ? "ALL PASS" : "SOME FAILURES"); return all_pass ? 0 : 1; }chibicc-1.0.24/test/builtin_sqrtpd.c000066400000000000000000000005011517770275000173570ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); int main() { double2 a = {4.0, 9.0}; double2 b = __builtin_ia32_sqrtpd(a); printf("sqrtpd: %.1f %.1f\n", b[0], b[1]); // Expected: 2.0 3.0 ASSERT(2, b[0]); ASSERT(3, b[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_sqrtps.c000066400000000000000000000006601517770275000174040ustar00rootroot00000000000000#include "test.h" typedef float __m128 __attribute__((vector_size(16))); int main(void) { __m128 vec = {4.0f, 9.0f, 16.0f, 25.0f}; __m128 result = __builtin_ia32_sqrtps(vec); printf("sqrt results: %f %f %f %f\n", result[0], result[1], result[2], result[3]); ASSERT(2, result[0]); ASSERT(3, result[1]); ASSERT(4, result[2]); ASSERT(5, result[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_sqrtsd.c000066400000000000000000000005011517770275000173620ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); int main() { double2 a = {4.0, 9.0}; double2 b = __builtin_ia32_sqrtsd(a); printf("sqrtsd: %.1f %.1f\n", b[0], b[1]); // Expected: 2.0 3.0 ASSERT(2, b[0]); ASSERT(9, b[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_sqrtss.c000066400000000000000000000010761517770275000174110ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf va = {16.0f, 3.3f, 4.4f, 5.5f}; v4sf vc = __builtin_ia32_sqrtss(va); float result = ((float*)&vc)[0]; printf("result = %f\n", result); // Expected: sqrt(16.0) = 4.0 // Check lowest element is correct (scalar sqrt) ASSERT(4, result); // The other elements should be copied from the input vector (va) ASSERT(4, vc[0]); ASSERT(3, vc[1]); ASSERT(4, vc[2]); ASSERT(5, vc[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_stdc_bit_width.c000066400000000000000000000010661517770275000210430ustar00rootroot00000000000000#include #include "test.h" int main(void) { ASSERT(0, stdc_bit_width(0u)); ASSERT(1, stdc_bit_width(1u)); ASSERT(2, stdc_bit_width(2u)); ASSERT(2, stdc_bit_width(3u)); ASSERT(3, stdc_bit_width(4u)); ASSERT(4, stdc_bit_width(8u)); ASSERT(4, stdc_bit_width(15u)); ASSERT(5, stdc_bit_width(16u)); ASSERT(31, stdc_bit_width(0x7FFFFFFFu)); ASSERT(32, stdc_bit_width(0xFFFFFFFFu)); ASSERT(33, stdc_bit_width(0x100000000ull)); ASSERT(64, stdc_bit_width(0xFFFFFFFFFFFFFFFFull)); printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_stdc_has_single_bit.c000066400000000000000000000010751517770275000220400ustar00rootroot00000000000000#include #include "test.h" //#define __builtin_stdc_has_single_bit stdc_has_single_bit int main(void) { ASSERT(1, stdc_has_single_bit(1u)); ASSERT(1, stdc_has_single_bit(2u)); ASSERT(1, stdc_has_single_bit(128u)); ASSERT(1, stdc_has_single_bit(0x80000000u)); ASSERT(0, stdc_has_single_bit(0u)); ASSERT(0, stdc_has_single_bit(3u)); ASSERT(0, stdc_has_single_bit(7u)); unsigned x = 1; for (int i = 0; i < 100000; i++) if (__builtin_stdc_has_single_bit(x) != 1) return 1; printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_stdc_trailing_zeros.c000066400000000000000000000027161517770275000221240ustar00rootroot00000000000000#include #include "test.h" #include int main(void) { // ---- trailing zeros ---- ASSERT(4, stdc_trailing_zeros((unsigned int)16)); ASSERT(0, stdc_trailing_zeros((unsigned int)1)); ASSERT(1, stdc_trailing_zeros((unsigned int)2)); ASSERT(3, stdc_trailing_zeros((unsigned int)8)); ASSERT(4, stdc_trailing_zeros((unsigned long)16)); ASSERT(4, stdc_trailing_zeros((unsigned long long)16)); // non power of two ASSERT(1, stdc_trailing_zeros((unsigned int)6)); // 110b // ---- count ones ---- ASSERT(1, stdc_count_ones((unsigned int)8)); ASSERT(2, stdc_count_ones((unsigned int)10)); // 1010b ASSERT(4, stdc_count_ones((unsigned int)15)); // 1111b ASSERT(1, stdc_count_ones((unsigned long)8)); ASSERT(1, stdc_count_ones((unsigned long long)8)); // ---- has single bit ---- ASSERT(1, stdc_has_single_bit((unsigned int)1)); ASSERT(1, stdc_has_single_bit((unsigned int)8)); ASSERT(0, stdc_has_single_bit((unsigned int)10)); ASSERT(0, stdc_has_single_bit((unsigned int)0)); ASSERT(1, stdc_has_single_bit((unsigned long)16)); ASSERT(0, stdc_has_single_bit((unsigned long long)18)); // ---- small integer types (promotion checks) ---- ASSERT(3, stdc_trailing_zeros((unsigned char)8)); ASSERT(1, stdc_count_ones((unsigned char)8)); ASSERT(1, stdc_has_single_bit((unsigned char)8)); ASSERT(2, stdc_count_ones((unsigned short)3)); ASSERT(0, stdc_has_single_bit((unsigned short)3)); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_stmxcsr.c000066400000000000000000000006201517770275000175470ustar00rootroot00000000000000#include #include "test.h" int main() { uint32_t mxcsr = 0; __builtin_ia32_stmxcsr(&mxcsr); printf("MXCSR = 0x%x\n", mxcsr); ASSERT(0x1f80, mxcsr); // Optionally: test known bit (e.g., flush-to-zero) if (mxcsr & (1 << 15)) printf("Flush-to-zero is enabled\n"); else printf("Flush-to-zero is disabled\n"); return 0; } chibicc-1.0.24/test/builtin_stmxcsr2.c000066400000000000000000000003161517770275000176330ustar00rootroot00000000000000#include "test.h" #include int main() { unsigned int mxcsr = __builtin_ia32_stmxcsr(); printf("MXCSR register value: 0x%x\n", mxcsr); ASSERT(0x1f80, mxcsr); return 0; } chibicc-1.0.24/test/builtin_storehps.c000066400000000000000000000015451517770275000177220ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); typedef float v2sf __attribute__((vector_size(8))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v2sf p = {5.0f, 6.0f}; __builtin_ia32_storehps(&p, a); printf("Result vector:\n"); for (int i = 0; i < 2; i++) { printf("c[%d] = %f\n", i, ((float*)&p)[i]); } // Expected: // c[0] = 3.0 // c[1] = 4.0 ASSERT(3, p[0]); ASSERT(4, p[1]); v4sf c = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf d = {5.0f, 6.0f, 7.0f, 8.0f}; __builtin_ia32_storehps(&d, c); printf("Result vector:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, ((float*)&d)[i]); } ASSERT(3, d[0]); ASSERT(4, d[1]); ASSERT(7, d[2]); ASSERT(8, d[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_storelps.c000066400000000000000000000015451517770275000177260ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); typedef float v2sf __attribute__((vector_size(8))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v2sf p = {5.0f, 6.0f}; __builtin_ia32_storelps(&p, a); printf("Result vector:\n"); for (int i = 0; i < 2; i++) { printf("c[%d] = %f\n", i, ((float*)&p)[i]); } // Expected: // c[0] = 3.0 // c[1] = 4.0 ASSERT(1, p[0]); ASSERT(2, p[1]); v4sf c = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf d = {5.0f, 6.0f, 7.0f, 8.0f}; __builtin_ia32_storelps(&d, c); printf("Result vector:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, ((float*)&d)[i]); } ASSERT(1, d[0]); ASSERT(2, d[1]); ASSERT(7, d[2]); ASSERT(8, d[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_sub_overflow.c000066400000000000000000000006771517770275000205740ustar00rootroot00000000000000 #include "test.h" int main() { int result; if (__builtin_sub_overflow(-1, 1, &result)) { printf("Overflow detected!\n"); } else { printf("Overflow not detected!\n"); } ASSERT(0, __builtin_sub_overflow(-1, 1, &result)); if (__builtin_sub_overflow(-2147483648, 1, &result)) { printf("Overflow detected!\n"); } ASSERT(1, __builtin_sub_overflow(-2147483648, 1, &result)); return 0; } chibicc-1.0.24/test/builtin_sub_overflow_mixed.c000066400000000000000000000021231517770275000217460ustar00rootroot00000000000000#include "test.h" typedef unsigned long long u64; typedef long long i64; typedef unsigned int u32; typedef int i32; typedef unsigned short u16; typedef short i16; typedef int bool; int main() { // u16 -> i16 boundary { u16 x = 32768; i16 r16 = 0; bool of16 = __builtin_sub_overflow(0, x, &r16); ASSERT(0, of16); ASSERT(-32768, r16); x = 32769; of16 = __builtin_sub_overflow(0, x, &r16); ASSERT(1, of16); ASSERT(32767, r16); } // u32 -> i32 boundary { u32 x = 2147483648U; i32 r32 = 0; bool of32 = __builtin_sub_overflow(0, x, &r32); ASSERT(0, of32); ASSERT(-2147483648, r32); x = 2147483649U; of32 = __builtin_sub_overflow(0, x, &r32); ASSERT(1, of32); ASSERT(2147483647, r32); } // u64 -> i64 boundary u64 a = 9223372036854775808ULL; i64 r = 0; bool of = __builtin_sub_overflow(0, a, &r); ASSERT(0, of); LASSERT(-9223372036854775808LL, r); u64 b = 9223372036854775809ULL; of = __builtin_sub_overflow(0, b, &r); ASSERT(1, of); LASSERT(9223372036854775807LL, r); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_subsd.c000066400000000000000000000005321517770275000171660ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); int main() { double2 a = {5.0, 7.0}; double2 b = {2.0, 4.0}; double2 c = __builtin_ia32_subsd(a, b); printf("%.1f %.1f\n", c[0], c[1]); // Expected: 3.0 7.0 ASSERT(3, c[0]); ASSERT(7, c[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_subss.c000066400000000000000000000006561517770275000172140ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); v4sf subss_test(v4sf a, v4sf b) { return __builtin_ia32_subss(a, b); } int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {0.5f, 1.5f, 2.5f, 3.5f}; v4sf c = subss_test(a, b); (int)c[0]; ASSERT(0, c[0]); ASSERT(2, c[1]); ASSERT(3, c[2]); ASSERT(4, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_test_fetch_add.c000066400000000000000000000016101517770275000210040ustar00rootroot00000000000000#include "test.h" #include int main(void) { int x; int r1, r2, r3; x = 10; // 1) GCC internal builtin (implicit seq-cst, return OLD) r1 = __builtin_atomic_fetch_add(&x, 3); // expected: // r1 = 10 // x = 13 // 2) GNU atomic API: fetch-then-add (return OLD) r2 = __atomic_fetch_add(&x, 4, __ATOMIC_SEQ_CST); // expected: // r2 = 13 // x = 17 // 3) GNU atomic API: add-then-fetch (return NEW) r3 = __atomic_add_fetch(&x, 5, __ATOMIC_SEQ_CST); // expected: // r3 = 22 // x = 22 printf("r1=%d r2=%d r3=%d x=%d\n", r1, r2, r3, x); // Hard failure if any semantic is wrong if (r1 != 10) return 1; if (r2 != 13) return 2; if (r3 != 22) return 3; if (x != 22) return 4; ASSERT(10, r1); ASSERT(13, r2); ASSERT(22, r3); ASSERT(22, x); puts("OK"); return 0; } chibicc-1.0.24/test/builtin_test_fetch_and.c000066400000000000000000000015721517770275000210250ustar00rootroot00000000000000#include "test.h" #include int main(void) { unsigned int x; unsigned int r1, r2, r3; x = 0xFF; // 1111 1111 // 1) GCC internal builtin (implicit seq-cst, return OLD) r1 = __builtin_atomic_fetch_and(&x, 0xF0); // x = 0xF0 (1111 0000) // 2) GNU atomic API: fetch-then-and (return OLD) r2 = __atomic_fetch_and(&x, 0xCC, __ATOMIC_SEQ_CST); // x = 0xC0 (1100 0000) // 3) GNU atomic API: and-then-fetch (return NEW) r3 = __atomic_and_fetch(&x, 0xAA, __ATOMIC_SEQ_CST); // x = 0x80 (1000 0000) printf("r1=0x%X r2=0x%X r3=0x%X x=0x%X\n", r1, r2, r3, x); // Hard semantic validation if (r1 != 0xFF) return 1; if (r2 != 0xF0) return 2; if (r3 != 0x80) return 3; if (x != 0x80) return 4; ASSERT(0xFF, r1); ASSERT(0xF0, r2); ASSERT(0x80, r3); ASSERT(0x80, x); puts("OK"); return 0; } chibicc-1.0.24/test/builtin_test_fetch_nand.c000066400000000000000000000024261517770275000212020ustar00rootroot00000000000000#include "test.h" #include // Optional: memory order constant for __atomic builtins #ifndef __ATOMIC_SEQ_CST #define __ATOMIC_SEQ_CST 5 #endif int main(void) { int x, y; // ------------------------------- // __builtin_atomic_fetch_nand x = 0xF5; int old1 = __builtin_atomic_fetch_nand(&x, 0x0F, __ATOMIC_SEQ_CST); printf("__builtin_atomic_fetch_nand: old=%d new=%d\n", old1, x); ASSERT(0xF5, old1); ASSERT(~(0xF5 & 0x0F), x); // ------------------------------- // __atomic_fetch_nand x = 0xF5; int old2 = __atomic_fetch_nand(&x, 0x0F, __ATOMIC_SEQ_CST); printf("__atomic_fetch_nand: old=%d new=%d\n", old2, x); ASSERT(0xF5, old2); ASSERT(~(0xF5 & 0x0F), x); // ------------------------------- // __atomic_nand_fetch x = 0xF5; int new3 = __atomic_nand_fetch(&x, 0x0F, __ATOMIC_SEQ_CST); printf("__atomic_nand_fetch: old=%d new=%d\n", ~(new3 & 0xFF), new3); // old = ~new & mask? ASSERT(~(0xF5 & 0x0F), new3); ASSERT(new3, x); // ------------------------------- // Legacy __sync_fetch_and_nand y = 0xF5; int old4 = __sync_fetch_and_nand(&y, 0x0F); printf("__sync_fetch_and_nand: old=%d new=%d\n", old4, y); ASSERT(0xF5, old4); ASSERT(~(0xF5 & 0x0F), y); return 0; } chibicc-1.0.24/test/builtin_test_fetch_or.c000066400000000000000000000015651517770275000207050ustar00rootroot00000000000000#include "test.h" #include int main(void) { unsigned int x; unsigned int r1, r2, r3; x = 0x0F; // 0000 1111 // 1) GCC internal builtin (implicit seq-cst, return OLD) r1 = __builtin_atomic_fetch_or(&x, 0x30); // x = 0x3F (0011 1111) // 2) GNU atomic API: fetch-then-or (return OLD) r2 = __atomic_fetch_or(&x, 0x40, __ATOMIC_SEQ_CST); // x = 0x7F (0111 1111) // 3) GNU atomic API: or-then-fetch (return NEW) r3 = __atomic_or_fetch(&x, 0x80, __ATOMIC_SEQ_CST); // x = 0xFF (1111 1111) printf("r1=0x%X r2=0x%X r3=0x%X x=0x%X\n", r1, r2, r3, x); // Hard semantic validation if (r1 != 0x0F) return 1; if (r2 != 0x3F) return 2; if (r3 != 0xFF) return 3; if (x != 0xFF) return 4; ASSERT(0x0F, r1); ASSERT(0x3F, r2); ASSERT(0xFF, r3); ASSERT(0xFF, x); puts("OK"); return 0; } chibicc-1.0.24/test/builtin_test_fetch_sub.c000066400000000000000000000015731517770275000210550ustar00rootroot00000000000000#include "test.h" #include int main(void) { int x; int r1, r2, r3; x = 50; // 1) GCC internal builtin (implicit seq-cst, return OLD) r1 = __builtin_atomic_fetch_sub(&x, 7); // expected: // r1 = 50 // x = 43 // 2) GNU atomic API: fetch-then-sub (return OLD) r2 = __atomic_fetch_sub(&x, 8, __ATOMIC_SEQ_CST); // expected: // r2 = 43 // x = 35 // 3) GNU atomic API: sub-then-fetch (return NEW) r3 = __atomic_sub_fetch(&x, 9, __ATOMIC_SEQ_CST); // expected: // r3 = 26 // x = 26 printf("r1=%d r2=%d r3=%d x=%d\n", r1, r2, r3, x); // Hard semantic validation if (r1 != 50) return 1; if (r2 != 43) return 2; if (r3 != 26) return 3; if (x != 26) return 4; ASSERT(50, r1); ASSERT(43, r2); ASSERT(26, r3); ASSERT(26, x); puts("OK"); return 0; } chibicc-1.0.24/test/builtin_test_fetch_xor.c000066400000000000000000000015721517770275000210730ustar00rootroot00000000000000#include "test.h" #include int main(void) { unsigned int x; unsigned int r1, r2, r3; x = 0xAA; // 1010 1010 // 1) GCC internal builtin (implicit seq-cst, return OLD) r1 = __builtin_atomic_fetch_xor(&x, 0xFF); // x = 0x55 (0101 0101) // 2) GNU atomic API: fetch-then-xor (return OLD) r2 = __atomic_fetch_xor(&x, 0x0F, __ATOMIC_SEQ_CST); // x = 0x5A (0101 1010) // 3) GNU atomic API: xor-then-fetch (return NEW) r3 = __atomic_xor_fetch(&x, 0x33, __ATOMIC_SEQ_CST); // x = 0x69 (0110 1001) printf("r1=0x%X r2=0x%X r3=0x%X x=0x%X\n", r1, r2, r3, x); // Hard semantic validation if (r1 != 0xAA) return 1; if (r2 != 0x55) return 2; if (r3 != 0x69) return 3; if (x != 0x69) return 4; ASSERT(0xAA, r1); ASSERT(0x55, r2); ASSERT(0x69, r3); ASSERT(0x69, x); puts("OK"); return 0; } chibicc-1.0.24/test/builtin_types_compatibility.c000066400000000000000000000015211517770275000221420ustar00rootroot00000000000000#include int main() { if (__builtin_types_compatible_p(int, int)) { printf("Types are compatible\n"); } else { printf("Types are not compatible\n"); } if (__builtin_types_compatible_p(int, char)) { printf("Types are compatible\n"); } else { printf("Types are not compatible\n"); } if (__builtin_types_compatible_p(float, char)) { printf("Types are compatible\n"); } else { printf("Types are not compatible\n"); } if (__builtin_types_compatible_p(int, float)) { printf("Types are compatible\n"); } else { printf("Types are not compatible\n"); } if (__builtin_types_compatible_p(double, float)) { printf("Types are compatible\n"); } else { printf("Types are not compatible\n"); } return 0; } chibicc-1.0.24/test/builtin_types_compatible_p.c000066400000000000000000000056431517770275000217400ustar00rootroot00000000000000#include "test.h" int main() { // Basic scalar compatibility ASSERT(1, __builtin_types_compatible_p(int, int)); ASSERT(0, __builtin_types_compatible_p(int, long)); ASSERT(1, __builtin_types_compatible_p(const int, int)); ASSERT(1, __builtin_types_compatible_p(volatile int, int)); ASSERT(1, __builtin_types_compatible_p(const volatile int, int)); // Pointer qualifiers ASSERT(1, __builtin_types_compatible_p(int *, int *)); ASSERT(0, __builtin_types_compatible_p(int *, const int *)); ASSERT(1, __builtin_types_compatible_p(int *const, int *)); ASSERT(0, __builtin_types_compatible_p(int **, int *)); // Arrays ASSERT(1, __builtin_types_compatible_p(int[3], int[3])); ASSERT(1, __builtin_types_compatible_p(int[3], int[])); ASSERT(0, __builtin_types_compatible_p(int[3], int[4])); ASSERT(0, __builtin_types_compatible_p(int[3], int *)); ASSERT(1, __builtin_types_compatible_p(int[], int[])); // Struct tag identity struct A { int x; }; struct B { int x; }; ASSERT(1, __builtin_types_compatible_p(struct A, struct A)); ASSERT(0, __builtin_types_compatible_p(struct A, struct B)); // Forward-declared (incomplete) structs struct Fwd; struct Fwd { int x; }; ASSERT(1, __builtin_types_compatible_p(struct Fwd, struct Fwd)); // Two distinct incomplete structs struct X; struct Y; ASSERT(0, __builtin_types_compatible_p(struct X, struct Y)); // Nested structs struct Outer1 { struct A a; }; struct Outer2 { struct A a; }; struct Outer3 { struct B a; }; ASSERT(0, __builtin_types_compatible_p(struct Outer1, struct Outer2)); ASSERT(0, __builtin_types_compatible_p(struct Outer1, struct Outer3)); // Typedef aliases typedef int myint; ASSERT(1, __builtin_types_compatible_p(myint, int)); typedef struct A A_alias; ASSERT(1, __builtin_types_compatible_p(A_alias, struct A)); // Flexible array member (Postgres-style) struct Flex1 { int len; char data[]; }; struct Flex2 { int len; char data[]; }; ASSERT(0, __builtin_types_compatible_p(struct Flex1, struct Flex2)); ASSERT(1, __builtin_types_compatible_p(struct Flex1, struct Flex1)); // Flexible vs fixed array struct Flex3 { int len; char data[1]; }; ASSERT(0, __builtin_types_compatible_p(struct Flex1, struct Flex3)); // Function types int fn1(int); int fn2(int); int fn3(long); ASSERT(1, __builtin_types_compatible_p(typeof(fn1), typeof(fn2))); ASSERT(0, __builtin_types_compatible_p(typeof(fn1), typeof(fn3))); int oldstyle(); int proto(void); ASSERT(1, __builtin_types_compatible_p(typeof(oldstyle), typeof(proto))); // Enum vs int enum E { E1 }; ASSERT(0, __builtin_types_compatible_p(enum E, int)); // Anonymous structs ASSERT(0, __builtin_types_compatible_p( struct { int x; }, struct { int x; } ) ); // Multi-level pointers ASSERT(1, __builtin_types_compatible_p(int **, int **)); ASSERT(0, __builtin_types_compatible_p(int **, const int **)); // Array decay should NOT apply ASSERT(0, __builtin_types_compatible_p(typeof((int[3]){0}), int *)); printf("OK\n"); return 0; }chibicc-1.0.24/test/builtin_ucomieq.c000066400000000000000000000005541517770275000175140ustar00rootroot00000000000000 #include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {1.0f, 5.0f, 3.0f, 0.0f}; int res = __builtin_ia32_ucomieq(a, b); printf("ucomieq result: %d\n", res); // Should print 1 if lowest floats are equal ASSERT(1, res); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_ucomisdeq.c000066400000000000000000000006221517770275000200370ustar00rootroot00000000000000 #include "test.h" typedef double __v2df __attribute__((vector_size(16))); int main(void) { __v2df a = { 3.14, 2.71 }; __v2df b = { 3.14, 5.0 }; // Compare the low double elements of a and b (unordered compare equal) int res = __builtin_ia32_ucomisdeq(a, b); printf("Result = %d\n", res); // Expected 1 because 3.14 == 3.14 ASSERT(1, res); return 0; } chibicc-1.0.24/test/builtin_ucomisdge.c000066400000000000000000000006221517770275000200250ustar00rootroot00000000000000 #include "test.h" typedef double __v2df __attribute__((vector_size(16))); int main(void) { __v2df a = { 3.14, 2.71 }; __v2df b = { 3.14, 5.0 }; // Compare the low double elements of a and b (unordered compare equal) int res = __builtin_ia32_ucomisdge(a, b); printf("Result = %d\n", res); // Expected 1 because 3.14 == 3.14 ASSERT(1, res); return 0; } chibicc-1.0.24/test/builtin_ucomisdgt.c000066400000000000000000000006221517770275000200440ustar00rootroot00000000000000 #include "test.h" typedef double __v2df __attribute__((vector_size(16))); int main(void) { __v2df a = { 3.14, 2.71 }; __v2df b = { 3.14, 5.0 }; // Compare the low double elements of a and b (unordered compare equal) int res = __builtin_ia32_ucomisdgt(a, b); printf("Result = %d\n", res); // Expected 1 because 3.14 == 3.14 ASSERT(0, res); return 0; } chibicc-1.0.24/test/builtin_ucomisdle.c000066400000000000000000000006221517770275000200320ustar00rootroot00000000000000 #include "test.h" typedef double __v2df __attribute__((vector_size(16))); int main(void) { __v2df a = { 3.14, 2.71 }; __v2df b = { 3.14, 5.0 }; // Compare the low double elements of a and b (unordered compare equal) int res = __builtin_ia32_ucomisdle(a, b); printf("Result = %d\n", res); // Expected 1 because 3.14 == 3.14 ASSERT(1, res); return 0; } chibicc-1.0.24/test/builtin_ucomisdlt.c000066400000000000000000000006221517770275000200510ustar00rootroot00000000000000 #include "test.h" typedef double __v2df __attribute__((vector_size(16))); int main(void) { __v2df a = { 3.14, 2.71 }; __v2df b = { 3.14, 5.0 }; // Compare the low double elements of a and b (unordered compare equal) int res = __builtin_ia32_ucomisdlt(a, b); printf("Result = %d\n", res); // Expected 1 because 3.14 == 3.14 ASSERT(0, res); return 0; } chibicc-1.0.24/test/builtin_ucomisdneq.c000066400000000000000000000006231517770275000202160ustar00rootroot00000000000000 #include "test.h" typedef double __v2df __attribute__((vector_size(16))); int main(void) { __v2df a = { 3.14, 2.71 }; __v2df b = { 3.14, 5.0 }; // Compare the low double elements of a and b (unordered compare equal) int res = __builtin_ia32_ucomisdneq(a, b); printf("Result = %d\n", res); // Expected 1 because 3.14 == 3.14 ASSERT(0, res); return 0; } chibicc-1.0.24/test/builtin_ucomixx.c000066400000000000000000000040231517770275000175410ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {1.0f, 5.0f, 3.5f, 4.0f}; v4sf c = {0.0f/0.0f, 5.0f, 3.5f, 4.0f}; // NaN in lowest element int res; // __builtin_ia32_ucomieq: unordered compare equal res = __builtin_ia32_ucomieq(a, b); printf("ucomieq (a,b): %d\n", res); ASSERT(1, res); // a[0]==b[0] => true res = __builtin_ia32_ucomieq(a, c); printf("ucomieq (a,c): %d\n", res); ASSERT(0, res); // unordered because c[0] is NaN // __builtin_ia32_ucomigt: unordered compare greater than res = __builtin_ia32_ucomigt(b, a); printf("ucomigt (b,a): %d\n", res); ASSERT(0, res); // b[0] > a[0] res = __builtin_ia32_ucomigt(a, c); printf("ucomigt (a,c): %d\n", res); ASSERT(0, res); // unordered => false // __builtin_ia32_ucomige: unordered compare greater or equal res = __builtin_ia32_ucomige(a, b); printf("ucomige (a,b): %d\n", res); ASSERT(1, res); // 1.0 >= 1.0 => true res = __builtin_ia32_ucomige(b, a); printf("ucomige (b,a): %d\n", res); ASSERT(1, res); // b[0] >= a[0] => false res = __builtin_ia32_ucomige(a, c); printf("ucomige (a,c): %d\n", res); ASSERT(0, res); // unordered => false // __builtin_ia32_ucomilt: unordered compare less than res = __builtin_ia32_ucomilt(a, b); printf("ucomilt (a,b): %d\n", res); ASSERT(0, res); // 1.0 < 1.0 false, 2.0 < 5.0 true but only lowest float counts res = __builtin_ia32_ucomilt(a, c); printf("ucomilt (a,c): %d\n", res); ASSERT(0, res); // unordered => false // __builtin_ia32_ucomile: unordered compare less or equal res = __builtin_ia32_ucomile(a, b); printf("ucomile (a,b): %d\n", res); ASSERT(1, res); // 1.0 <= 1.0 => true res = __builtin_ia32_ucomile(a, c); printf("ucomile (a,c): %d\n", res); ASSERT(0, res); // unordered => false printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_unpckhpd.c000066400000000000000000000007411517770275000176640ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); // 2 doubles int main(void) { double2 a = {1.0, 2.0}; // xmm0: low=1.0, high=2.0 double2 b = {3.0, 4.0}; // xmm1: low=3.0, high=4.0 double2 r = __builtin_ia32_unpckhpd(a, b); printf("r[0] = %.1f\n", r[0]); // from high of a (2.0) printf("r[1] = %.1f\n", r[1]); // from high of b (4.0) ASSERT(2, r[0]); ASSERT(4, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_unpckhps.c000066400000000000000000000011551517770275000177030ustar00rootroot00000000000000#include "test.h" #include typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {5.0f, 6.0f, 7.0f, 8.0f}; v4sf c = __builtin_ia32_unpckhps(a, b); printf("Result vector:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, ((float*)&c)[i]); } // Expected output: // c[0] = 3.0 (a2) // c[1] = 7.0 (b2) // c[2] = 4.0 (a3) // c[3] = 8.0 (b3) ASSERT(3, c[0]); ASSERT(7, c[1]); ASSERT(4, c[2]); ASSERT(8, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_unpcklpd.c000066400000000000000000000007371517770275000176750ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); // 2 doubles int main(void) { double2 a = {1.0, 2.0}; // xmm0: low=1.0, high=2.0 double2 b = {3.0, 4.0}; // xmm1: low=3.0, high=4.0 double2 r = __builtin_ia32_unpcklpd(a, b); printf("r[0] = %.1f\n", r[0]); // from low of a (1.0) printf("r[1] = %.1f\n", r[1]); // from low of b (3.0) ASSERT(1, r[0]); ASSERT(3, r[1]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_unpcklps.c000066400000000000000000000011551517770275000177070ustar00rootroot00000000000000#include "test.h" #include typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {1.0f, 2.0f, 3.0f, 4.0f}; v4sf b = {5.0f, 6.0f, 7.0f, 8.0f}; v4sf c = __builtin_ia32_unpcklps(a, b); printf("Result vector:\n"); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, ((float*)&c)[i]); } // Expected output: // c[0] = 3.0 (a2) // c[1] = 7.0 (b2) // c[2] = 4.0 (a3) // c[3] = 8.0 (b3) ASSERT(1, c[0]); ASSERT(5, c[1]); ASSERT(2, c[2]); ASSERT(6, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_unreacheable.c000066400000000000000000000003001517770275000204550ustar00rootroot00000000000000 #include "test.h" int main() { int x = 0; if (x == 0) { printf("x is zero\n"); ASSERT(0, x); } else { __builtin_unreachable(); } return 0; } chibicc-1.0.24/test/builtin_vec_ext_v16qi.c000066400000000000000000000013231517770275000205300ustar00rootroot00000000000000// test_vec_ext_v16qi.c #include #include "test.h" static void check(int cond, const char *msg) { if (!cond) { printf("FAIL: %s\n", msg); __builtin_abort(); } } int main(void) { unsigned char data[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; __m128i v = _mm_loadu_si128((const __m128i*)data); int r0 = __builtin_ia32_vec_ext_v16qi(v, 0); int r7 = __builtin_ia32_vec_ext_v16qi(v, 7); int r15 = __builtin_ia32_vec_ext_v16qi(v, 15); // validate extraction correctness check(r0 == 0, "ext[0]"); check(r7 == 7, "ext[7]"); check(r15 == 15, "ext[15]"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_vec_ext_v2di.c000066400000000000000000000012311517770275000204240ustar00rootroot00000000000000#include #include "test.h" #include static void check(int cond, const char *msg) { if (!cond) { printf("FAIL: %s\n", msg); __builtin_abort(); } } int main(void) { int64_t data[2] = { 0x1122334455667788LL, -0x1122334455667788LL }; __m128i v = _mm_loadu_si128((const __m128i*)data); long long r0 = __builtin_ia32_vec_ext_v2di(v, 0); long long r1 = __builtin_ia32_vec_ext_v2di(v, 1); // lane 0 (low 64 bits) check(r0 == 0x1122334455667788LL, "ext[0]"); // lane 1 (high 64 bits) check(r1 == -0x1122334455667788LL, "ext[1]"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_vec_ext_v2si.c000066400000000000000000000012071517770275000204460ustar00rootroot00000000000000#include "test.h" // Define a 2-element int vector type (like __v2si) typedef int v2si __attribute__((vector_size(8))); // Prototype for the builtin so the compiler accepts it int __builtin_ia32_vec_ext_v2si(v2si vec, int index); int main(void) { // Create a vector with two ints: 123456 and 789012 v2si v = {123456, 789012}; // Extract elements using the builtin int elem0 = __builtin_ia32_vec_ext_v2si(v, 0); int elem1 = __builtin_ia32_vec_ext_v2si(v, 1); printf("elem0 = %d\n", elem0); printf("elem1 = %d\n", elem1); ASSERT(123456, elem0); ASSERT(789012, elem1); return 0; } chibicc-1.0.24/test/builtin_vec_ext_v4si.c000066400000000000000000000013431517770275000204510ustar00rootroot00000000000000#include "test.h" typedef int int4 __attribute__((vector_size(16))); int main(void) { int4 v = {10, 20, 30, 40}; int a0 = __builtin_ia32_vec_ext_v4si(v, 0); int a1 = __builtin_ia32_vec_ext_v4si(v, 1); int a2 = __builtin_ia32_vec_ext_v4si(v, 2); int a3 = __builtin_ia32_vec_ext_v4si(v, 3); ASSERT(10, a0); ASSERT(20, a1); ASSERT(30, a2); ASSERT(40, a3); // Repeat a non-zero lane extraction to catch hidden static-state regressions. ASSERT(20, __builtin_ia32_vec_ext_v4si(v, 1)); ASSERT(20, __builtin_ia32_vec_ext_v4si(v, 1)); // Dynamic index path. int idx = 2; ASSERT(30, __builtin_ia32_vec_ext_v4si(v, idx)); printf("%d %d %d %d\n", a0, a1, a2, a3); return 0; } chibicc-1.0.24/test/builtin_vec_ext_v8hi.c000066400000000000000000000015141517770275000204420ustar00rootroot00000000000000// test_vec_ext_v8hi.c #include #include "test.h" static void check(int cond, const char *msg) { if (!cond) { printf("FAIL: %s\n", msg); __builtin_abort(); } } int main(void) { short data[8] = { 1000, -1, 2000, -3000, 7, 0, -12345, 32767 }; __m128i v = _mm_loadu_si128((const __m128i*)data); int r0 = __builtin_ia32_vec_ext_v8hi(v, 0); int r1 = __builtin_ia32_vec_ext_v8hi(v, 1); int r3 = __builtin_ia32_vec_ext_v8hi(v, 3); int r6 = __builtin_ia32_vec_ext_v8hi(v, 6); int r7 = __builtin_ia32_vec_ext_v8hi(v, 7); // correctness of lane selection check(r0 == 1000, "ext[0]"); check(r1 == -1, "ext[1]"); check(r3 == -3000, "ext[3]"); check(r6 == -12345, "ext[6]"); check(r7 == 32767, "ext[7]"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_vec_init_v2si.c000066400000000000000000000014761517770275000206210ustar00rootroot00000000000000#include "test.h" typedef int v2si __attribute__((vector_size(8))); // 2 × 4 bytes = 8 bytes // Prototype for the builtin so the compiler doesn't warn v2si __builtin_ia32_vec_init_v2si(int, int); static __attribute__((noinline)) int rhs_many_args(int a, int b, int c, int d, int e, int f) { // Forces use of caller-saved GP registers during rhs evaluation. return a + b + c + d + e + f; } int main(void) { // Basic immediate smoke test. v2si v = __builtin_ia32_vec_init_v2si(123456, 0); int *p = (int *)&v; ASSERT(123456, p[0]); ASSERT(0, p[1]); // Clobber-sensitive case: lhs must survive rhs function call. v2si v2 = __builtin_ia32_vec_init_v2si(0x13579bdf, rhs_many_args(1, 2, 3, 4, 5, 6)); int *q = (int *)&v2; ASSERT(0x13579bdf, q[0]); ASSERT(21, q[1]); return 0; } chibicc-1.0.24/test/builtin_vec_init_v4hi.c000066400000000000000000000011751517770275000206040ustar00rootroot00000000000000#include "test.h" typedef short v4hi __attribute__((vector_size(8))); static __attribute__((noinline)) int from_call(int x) { // Explicitly clobber xmm0 so vec-init must preserve prior packed lanes. __asm__ volatile("pxor %%xmm0, %%xmm0" ::: "xmm0"); return x; } int main() { v4hi v = __builtin_ia32_vec_init_v4hi(1, 2, 3, 4); for (int i = 0; i < 4; i++) { ASSERT(i+1, v[i]); } v4hi v2 = __builtin_ia32_vec_init_v4hi( from_call(11), from_call(22), from_call(33), from_call(44)); ASSERT(11, v2[0]); ASSERT(22, v2[1]); ASSERT(33, v2[2]); ASSERT(44, v2[3]); return 0; } chibicc-1.0.24/test/builtin_vec_init_v8qi.c000066400000000000000000000026231517770275000206200ustar00rootroot00000000000000#include "test.h" #include typedef char v8qi __attribute__((vector_size(8))); static __attribute__((noinline)) int from_call(int x) { // Explicitly clobber xmm0 so vec-init must preserve prior packed lanes. __asm__ volatile("pxor %%xmm0, %%xmm0" ::: "xmm0"); return x; } int main() { // Test with immediate values v8qi v = (v8qi)__builtin_ia32_vec_init_v8qi( 1, 2, 3, 4, -1, -2, -3, -4 ); ASSERT(1, v[0]); ASSERT(2, v[1]); ASSERT(3, v[2]); ASSERT(4, v[3]); ASSERT(-1, v[4]); ASSERT(-2, v[5]); ASSERT(-3, v[6]); ASSERT(-4, v[7]); // Test with variables char a0 = 10, a1 = 20, a2 = 30, a3 = 40; char a4 = -10, a5 = -20, a6 = -30, a7 = -40; v8qi v2 = (v8qi)__builtin_ia32_vec_init_v8qi( a0, a1, a2, a3, a4, a5, a6, a7 ); ASSERT(10, v2[0]); ASSERT(20, v2[1]); ASSERT(30, v2[2]); ASSERT(40, v2[3]); ASSERT(-10, v2[4]); ASSERT(-20, v2[5]); ASSERT(-30, v2[6]); ASSERT(-40, v2[7]); v8qi v3 = (v8qi)__builtin_ia32_vec_init_v8qi( from_call(11), from_call(22), from_call(33), from_call(44), from_call(-11), from_call(-22), from_call(-33), from_call(-44) ); ASSERT(11, v3[0]); ASSERT(22, v3[1]); ASSERT(33, v3[2]); ASSERT(44, v3[3]); ASSERT(-11, v3[4]); ASSERT(-22, v3[5]); ASSERT(-33, v3[6]); ASSERT(-44, v3[7]); return 0; } chibicc-1.0.24/test/builtin_vextractf128_si256.c000066400000000000000000000022371517770275000212430ustar00rootroot00000000000000// test_vextractf128_si256.c #include #include #include "test.h" static void check(int cond, const char *msg) { if (!cond) { printf("FAIL: %s\n", msg); __builtin_abort(); } } int main(void) { // Build a known 256-bit vector: // lane 0 (low 128): 0,1,2,3 // lane 1 (high 128): 4,5,6,7 int data[8] = {0,1,2,3,4,5,6,7}; __m256i v = _mm256_loadu_si256((__m256i*)data); // Extract low 128-bit lane (imm8 = 0) __m128i lo = (__m128i)__builtin_ia32_vextractf128_si256((__v8si)v, 0); // Extract high 128-bit lane (imm8 = 1) __m128i hi = (__m128i)__builtin_ia32_vextractf128_si256((__v8si)v, 1); int out_lo[4]; int out_hi[4]; _mm_storeu_si128((__m128i*)out_lo, lo); _mm_storeu_si128((__m128i*)out_hi, hi); // Validate low lane check(out_lo[0] == 0, "lo[0]"); check(out_lo[1] == 1, "lo[1]"); check(out_lo[2] == 2, "lo[2]"); check(out_lo[3] == 3, "lo[3]"); // Validate high lane check(out_hi[0] == 4, "hi[0]"); check(out_hi[1] == 5, "hi[1]"); check(out_hi[2] == 6, "hi[2]"); check(out_hi[3] == 7, "hi[3]"); printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_vinsertf128_si256.c000066400000000000000000000005241517770275000210720ustar00rootroot00000000000000#include #include "test.h" int main() { __m256i x = _mm256_set1_epi32(1); __m128i y = _mm_set1_epi32(2); __m256i r = _mm256_insertf128_si256(x, y, 1); int out[8]; _mm256_storeu_si256((__m256i*)out, r); // upper lane should be 2 for (int i = 4; i < 8; i++) if (out[i] != 2) return 1; printf("OK\n"); } chibicc-1.0.24/test/builtin_x86intrin.c000066400000000000000000000156471517770275000177340ustar00rootroot00000000000000#include "test.h" #include #include //#include //#include void f4(void) { __builtin_ia32_saveprevssp(); __builtin_ia32_setssbsy(); __builtin_ia32_slwpcb(); __builtin_ia32_xend(); __builtin_ia32_serialize(); __builtin_ia32_xsusldtrk(); __builtin_ia32_xresldtrk(); __builtin_ia32_clui(); __builtin_ia32_stui(); __builtin_ia32_testui(); __builtin_ia32_wbnoinvd(); __builtin_ia32_xtest(); __builtin_ia32_wbinvd(); __builtin_ia32_vzeroall(); __builtin_ia32_vzeroupper(); __builtin_ia32_femms(); __builtin_ia32_writeeflags_u64(0x200); unsigned long long x = 0x201; __builtin_ia32_writeeflags_u64(x); __builtin_ia32_incsspq(x); void *ptr; __builtin_ia32_rstorssp(ptr); __builtin_ia32_clrssbsy(1); int val = 1; __builtin_ia32_clrssbsy(val); } unsigned int f7(void) { return __builtin_ia32_rdpid(); } unsigned int f8(void) { return __builtin_ia32_rdfsbase32(); } unsigned long long f9(void) { return __builtin_ia32_rdfsbase64(); } unsigned int f10(void) { return __builtin_ia32_rdgsbase32(); } unsigned long long f11(void) { return __builtin_ia32_rdgsbase64(); } int f5(void) { return __builtin_ia32_rdpkru(); } unsigned int f6(void) { return __builtin_ia32_xbegin(); } unsigned long long f3(void) { return __builtin_ia32_rdsspq(); } unsigned long long f1(void) { return __builtin_ia32_rdtsc(); } unsigned long long f2(void) { return __builtin_ia32_readeflags_u64(); } static inline void wrssd(uint32_t *p, uint32_t v) { __builtin_ia32_wrssd(p, v); __builtin_ia32_wrssq(p, v); __builtin_ia32_wrussd(p, v); __builtin_ia32_wrussq(p, v); } __attribute__((noinline)) void test(uint32_t *p) { wrssd(p, 0xdeadbeef); } static unsigned ref_sbb_u32( unsigned a, unsigned b, unsigned bin, unsigned *bout) { unsigned tmp = a - b; unsigned res = tmp - bin; *bout = (a < b) | (tmp < bin); return res; } static unsigned char ref_addcarryx_u32( unsigned char cin, unsigned x, unsigned y, unsigned *out) { unsigned sum = x + y; unsigned sum2 = sum + cin; *out = sum2; return (sum < x) | (sum2 < cin); } int test_addcarryx(void) { unsigned vals[] = { 0, 1, 0x7fffffff, 0x80000000, 0xffffffff }; for (unsigned i = 0; i < 5; i++) for (unsigned j = 0; j < 5; j++) for (unsigned cin = 0; cin <= 1; cin++) { unsigned out1, out2; unsigned char c1 = ref_addcarryx_u32(cin, vals[i], vals[j], &out1); unsigned char c2 = __builtin_ia32_addcarryx_u32( cin, vals[i], vals[j], &out2); if (out1 != out2 || c1 != c2) return 1; } return 0; } static unsigned char ref_sbb_u64( unsigned char bin, unsigned long x, unsigned long y, unsigned long *out) { unsigned long tmp = x - y; unsigned long res = tmp - bin; *out = res; return (x < y) | (tmp < bin); } int test_sbb_u64(void) { unsigned long vals[] = { 0UL, 1UL, 0x7fffffffffffffffUL, 0x8000000000000000UL, 0xffffffffffffffffUL }; for (int i=0;i<5;i++) for (int j=0;j<5;j++) for (int bin=0; bin<=1; bin++) { unsigned long out1, out2; unsigned char b1 = ref_sbb_u64(bin, vals[i], vals[j], &out1); unsigned char b2 = __builtin_ia32_sbb_u64(bin, vals[i], vals[j], &out2); if (b1 != b2 || out1 != out2) return 1; } return 0; } static unsigned ref_bext(unsigned x, unsigned c) { unsigned s = c & 0xff; unsigned l = (c >> 8) & 0xff; if (l == 0 || s >= 32) return 0; if (s + l > 32) l = 32 - s; return (x >> s) & ((1u << l) - 1); } int main(void) { unsigned long long t1 = f1(); unsigned long long t2 = f1(); ASSERT(t2 > t1, 1); unsigned long long e1 = f2(); unsigned long long e2 = f2(); ASSERT(e2 >= e1, 1); unsigned long long s1 = f3(); unsigned long long s2 = f3(); ASSERT(s2 >= s1, 1); unsigned int p1 = f6(); ASSERT(0, p1); int x = 0x80000000; // bit 31 set int y = 0x00000100; // bit 8 set int z = 0x00000001; // bit 0 set printf("%d\n", __builtin_ia32_bsrsi(x)); // expected 31 ASSERT(31, __builtin_ia32_bsrsi(x)); printf("%d\n", __builtin_ia32_bsrsi(y)); // expected 8 ASSERT(8, __builtin_ia32_bsrsi(y)); printf("%d\n", __builtin_ia32_bsrsi(z)); // expected 0 ASSERT(0, __builtin_ia32_bsrsi(z)); uint32_t aux1, aux2; uint64_t tsc1, tsc2; tsc1 = __builtin_ia32_rdtscp(&aux1); tsc2 = __builtin_ia32_rdtscp(&aux2); if (tsc2 <= tsc1) { printf("Warning: TSC did not increase\n"); } printf("TSC1 = %lu, AUX1 = %u\n", tsc1, aux1); printf("TSC2 = %lu, AUX2 = %u\n", tsc2, aux2); static const unsigned vals[] = { 0x00000000u, 0x00000001u, 0x7fffffffu, 0x80000000u, 0xffffffffu, }; for (unsigned i = 0; i < sizeof(vals)/sizeof(vals[0]); i++) { for (unsigned j = 0; j < sizeof(vals)/sizeof(vals[0]); j++) { for (unsigned bin = 0; bin <= 1; bin++) { unsigned a = vals[i]; unsigned b = vals[j]; unsigned ref_bout, test_bout; unsigned ref = ref_sbb_u32(a, b, bin, &ref_bout); unsigned test = __builtin_ia32_sbb_u32( a, b, bin, &test_bout); printf("a=0x%08x b=0x%08x bin=%u => " "ref=0x%08x bout=%u | " "test=0x%08x bout=%u\n", a, b, bin, ref, ref_bout, test, test_bout); ASSERT(ref, test); } } } printf("PASS: __builtin_ia32_sbb_u32\n"); int az = test_addcarryx(); printf("%d\n", az); ASSERT(1, az); int bz = test_sbb_u64(); printf("%d\n", bz); ASSERT(1, bz); for (int i = 0; i <= 16; i++) { unsigned short x = (i == 16) ? 0 : (1u << i); unsigned short r = __builtin_ia32_tzcnt_u16(x); unsigned short refx = (x == 0) ? 16 : i; if (r != refx) { printf("FAIL x=%04x got=%u ref=%u\n", x, r, refx); return 1; } ASSERT(refx, r); } unsigned tests[] = { 0xdeadbeef, 0, 1, 8, 16, 31, 32 }; // for (int s = 0; s < 40; s++) { // for (int l = 0; l < 40; l++) { // unsigned cbextr = (l << 8) | s; // unsigned rbextr = __builtin_ia32_bextr_u32(0xdeadbeef, cbextr); // unsigned ebextr = ref_bext(0xdeadbeef, cbextr); // if (rbextr != ebextr) { // printf("FAIL s=%u l=%u got=%x exp=%x\n", s, l, rbextr, ebextr); // return 1; // } // } // } printf("OK\n"); return 0; } chibicc-1.0.24/test/builtin_xorps.c000066400000000000000000000010301517770275000172130ustar00rootroot00000000000000#include "test.h" typedef float v4sf __attribute__((vector_size(16))); int main() { v4sf a = {0x00000000, 0x0F0F0F0F, 0xAAAAAAAA, 0x55555555}; v4sf b = {0xFFFFFFFF, 0xF0F0F0F0, 0x55555555, 0xAAAAAAAA}; v4sf c = __builtin_ia32_orps(a, b); for (int i = 0; i < 4; i++) { printf("c[%d] = 0x%08X\n", i, *(unsigned int*)&c[i]); } ASSERT(-2147483648, c[0]); ASSERT(-2147483648, c[1]); ASSERT(-2147483648, c[2]); ASSERT(-2147483648, c[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/buitlin_shuffle2.c000066400000000000000000000015751517770275000175740ustar00rootroot00000000000000#include "test.h" typedef int v4si __attribute__((vector_size(16))); typedef int v8si __attribute__((vector_size(32))); /* * 2-argument form: * __builtin_shuffle(a, mask) * → normalized to (a, a, mask) */ int test_shuffle_2args(void) { v4si a = { 10, 20, 30, 40 }; v4si mask = { 3, 2, 1, 0 }; v4si r = __builtin_shuffle(a, mask); ASSERT(40, r[0]); ASSERT(30, r[1]); ASSERT(20, r[2]); ASSERT(10, r[3]); return 0; } /* * 3-argument form: * __builtin_shuffle(a, b, mask) */ int test_shuffle_3args(void) { v4si a = { 1, 2, 3, 4 }; v4si b = { 5, 6, 7, 8 }; v4si mask = { 0, 5, 2, 7 }; v4si r = __builtin_shuffle(a, b, mask); ASSERT(1, r[0]); ASSERT(6, r[1]); ASSERT(3, r[2]); ASSERT(8, r[3]); return 0; } int main(void) { if (test_shuffle_2args()) return 1; if (test_shuffle_3args()) return 1; printf("OK\n"); return 0; } chibicc-1.0.24/test/c99.c000066400000000000000000000057631517770275000147370ustar00rootroot00000000000000 #include #include #include #include #include #include "test.h" // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); ASSERT(1234, x); ASSERT(5678, y); printf("\n"); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } chibicc-1.0.24/test/cache.h000066400000000000000000000066271517770275000154030ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ #ifndef CACHE_H #define CACHE_H #include #include "queue.h" #ifndef NDEBUG /* may be used for debug purposes */ extern int cache_error; #endif struct cache_free_s { STAILQ_ENTRY(cache_free_s) c_next; }; //typedef STAILQ_HEAD(cache_head_s, cache_free_s) cache_head_t; /** * Definition of the structure to keep track of the internal details of * the cache allocator. Touching any of these variables results in * undefined behavior. */ typedef struct { /** Mutex to protect access to the structure */ pthread_mutex_t mutex; /** Name of the cache objects in this cache (provided by the caller) */ char *name; /** freelist of available buffers */ STAILQ_HEAD(cache_head, cache_free_s) head; /** The size of each element in this cache */ size_t bufsize; /** The capacity of the list of elements */ int freetotal; /** Total malloc'ed objects */ int total; /** The current number of free elements */ int freecurr; /** A limit on the total number of elements */ int limit; } cache_t; /** * Create an object cache. * * The object cache will let you allocate objects of the same size. It is fully * MT safe, so you may allocate objects from multiple threads without having to * do any synchronization in the application code. * * @param name the name of the object cache. This name may be used for debug purposes * and may help you track down what kind of object you have problems with * (buffer overruns, leakage etc) * @param bufsize the size of each object in the cache * @param align the alignment requirements of the objects in the cache. * @param constructor the function to be called to initialize memory when we need * to allocate more memory from the os. * @param destructor the function to be called before we release the memory back * to the os. * @return a handle to an object cache if successful, NULL otherwise. */ cache_t* cache_create(const char* name, size_t bufsize, size_t align); /** * Destroy an object cache. * * Destroy and invalidate an object cache. You should return all buffers allocated * with cache_alloc by using cache_free before calling this function. Not doing * so results in undefined behavior (the buffers may or may not be invalidated) * * @param handle the handle to the object cache to destroy. */ void cache_destroy(cache_t* handle); /** * Allocate an object from the cache. * * @param handle the handle to the object cache to allocate from * @return a pointer to an initialized object from the cache, or NULL if * the allocation cannot be satisfied. */ void* cache_alloc(cache_t* handle); void* do_cache_alloc(cache_t* handle); /** * Return an object back to the cache. * * The caller should return the object in an initialized state so that * the object may be returned in an expected state from cache_alloc. * * @param handle handle to the object cache to return the object to * @param ptr pointer to the object to return. */ void cache_free(cache_t* handle, void* ptr); void do_cache_free(cache_t* handle, void* ptr); /** * Set or adjust a limit for the number of objects to malloc * * @param handle handle to the object cache to adjust * @param limit the number of objects to cache before returning NULL */ void cache_set_limit(cache_t* handle, int limit); #endif chibicc-1.0.24/test/cast.c000077500000000000000000000032021517770275000152520ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(131585, (int)8590066177); ASSERT(513, (short)8590066177); ASSERT(1, (char)8590066177); ASSERT(1, (long)1); ASSERT(0, (long)&*(int *)0); ASSERT(513, ({ int x=512; *(char *)&x=1; x; })); ASSERT(5, ({ int x=5; long y=(long)&x; *(int*)y; })); (void)1; ASSERT(-1, (char)255); ASSERT(-1, (signed char)255); ASSERT(255, (unsigned char)255); ASSERT(-1, (short)65535); ASSERT(65535, (unsigned short)65535); ASSERT(-1, (int)0xffffffff); ASSERT(0xffffffff, (unsigned)0xffffffff); ASSERT(1, -1<1); ASSERT(0, -1<(unsigned)1); ASSERT(254, (char)127+(char)127); ASSERT(65534, (short)32767+(short)32767); ASSERT(-1, -1>>1); ASSERT(-1, (unsigned long)-1); ASSERT(2147483647, ((unsigned)-1)>>1); ASSERT(-50, (-100)/2); ASSERT(2147483598, ((unsigned)-100)/2); ASSERT(9223372036854775758, ((unsigned long)-100)/2); ASSERT(0, ((long)-1)/(unsigned)100); ASSERT(-2, (-100)%7); ASSERT(2, ((unsigned)-100)%7); ASSERT(6, ((unsigned long)-100)%9); ASSERT(65535, (int)(unsigned short)65535); ASSERT(65535, ({ unsigned short x = 65535; x; })); ASSERT(65535, ({ unsigned short x = 65535; (int)x; })); ASSERT(-1, ({ typedef short T; T x = 65535; (int)x; })); ASSERT(65535, ({ typedef unsigned short T; T x = 65535; (int)x; })); ASSERT(0, (_Bool)0.0); ASSERT(1, (_Bool)0.1); ASSERT(3, (char)3.0); ASSERT(1000, (short)1000.3); ASSERT(3, (int)3.99); ASSERT(2000000000000000, (long)2e15); ASSERT(3, (float)3.5); ASSERT(5, (double)(float)5.5); ASSERT(3, (float)3); ASSERT(3, (double)3); ASSERT(3, (float)3L); ASSERT(3, (double)3L); printf("OK\n"); return 0; } chibicc-1.0.24/test/common000077500000000000000000000145101517770275000153730ustar00rootroot00000000000000#include #include #include void assert(int expected, int actual, char *code) { if (expected == actual) { printf("%s => %d\n", code, actual); } else { printf("%s => %d expected but got %d\n", code, expected, actual); exit(1); } } void assert64(long long expected, long long actual, char *code) { if (expected == actual) { printf("%s => %lld\n", code, actual); } else { printf("%s => %lld expected but got %lld\n", code, expected, actual); exit(1); } } typedef unsigned long long uint64_t; void print_i128(__int128 v) { unsigned __int128 uv = v; // for bit shifts uint64_t lo = (uint64_t)uv; uint64_t hi = (uint64_t)(uv >> 64); printf("(%lld, %llu)", (long long)hi, (unsigned long long)lo); } void assert128(__int128 k, __int128 x, char *code, char *func, int line) { if (k != x) { printf("%s:%d: %s => want ", func, line, code); print_i128(k); printf(" but got "); print_i128(x); printf("\n"); exit(1); } } static int static_fn() { return 5; } int ext1 = 5; int *ext2 = &ext1; int ext3 = 7; int ext_fn1(int x) { return x; } int ext_fn2(int x) { return x; } int common_ext2 = 3; static int common_local; _Thread_local int extern_tls; int false_fn() { return 512; } int true_fn() { return 513; } int char_fn() { return (2<<8)+3; } int short_fn() { return (2<<16)+5; } int uchar_fn() { return (2<<10)-1-4; } int ushort_fn() { return (2<<20)-1-7; } int schar_fn() { return (2<<10)-1-4; } int sshort_fn() { return (2<<20)-1-7; } int add_all(int n, ...) { va_list ap; va_start(ap, n); int sum = 0; for (int i = 0; i < n; i++) sum += va_arg(ap, int); return sum; } float add_float(float x, float y) { return x + y; } double add_double(double x, double y) { return x + y; } int add10_int(int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8, int x9, int x10) { return x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10; } float add10_float(float x1, float x2, float x3, float x4, float x5, float x6, float x7, float x8, float x9, float x10) { return x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10; } double add10_double(double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9, double x10) { return x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10; } typedef struct { int a,b; short c; char d; } Ty4; typedef struct { int a; float b; double c; } Ty5; typedef struct { unsigned char a[3]; } Ty6; typedef struct { long a, b, c; } Ty7; int struct_test4(Ty4 x, int n) { switch (n) { case 0: return x.a; case 1: return x.b; case 2: return x.c; default: return x.d; } } int struct_test5(Ty5 x, int n) { switch (n) { case 0: return x.a; case 1: return x.b; default: return x.c; } } int struct_test6(Ty6 x, int n) { return x.a[n]; } int struct_test7(Ty7 x, int n) { switch (n) { case 0: return x.a; case 1: return x.b; default: return x.c; } } Ty4 struct_test24(void) { return (Ty4){10, 20, 30, 40}; } Ty5 struct_test25(void) { return (Ty5){10, 20, 30}; } Ty6 struct_test26(void) { return (Ty6){10, 20, 30}; } typedef struct { unsigned char a[10]; } Ty20; typedef struct { unsigned char a[20]; } Ty21; Ty20 struct_test27(void) { return (Ty20){10, 20, 30, 40, 50, 60, 70, 80, 90, 100}; } Ty21 struct_test28(void) { return (Ty21){1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}; } typedef struct { char g; } G; typedef struct { float f; } F; typedef struct { char l; float d; } A; float struct_test101( G g0, G g1, G g2, G g3, G g4, G g5, F f0, F f1, F f2, F f3, F f4, F f5, F f6, F f7, G gs0, F fs0, G gs1, F fs1 ) { return g0.g + g1.g + g2.g + g3.g + g4.g + g5.g + f0.f + f1.f + f2.f + f3.f + f4.f + f5.f + f6.f + f7.f + gs0.g + gs1.g + fs0.f + fs1.f; } float struct_test111( F f0, F f1, F f2, F f3, F f4, F f5, F f6, F f7, G g0, G g1, G g2, G g3, G g4, G g5, G gs0, F fs0, G gs1, F fs1 ) { return g0.g + g1.g + g2.g + g3.g + g4.g + g5.g + f0.f + f1.f + f2.f + f3.f + f4.f + f5.f + f6.f + f7.f + gs0.g + gs1.g + fs0.f + fs1.f; } float struct_test121( A reg0, A reg1, A reg2, A reg3, A reg4, A reg5, A s0, F f6, F f7, A s1) { return reg0.l + reg0.d + reg1.l + reg1.d + reg2.l + reg2.d + reg3.l + reg3.d + reg4.l + reg4.d + reg5.l + reg5.d + s0.l + s0.d + s1.l + s1.d + f6.f + f7.f; } typedef struct { char _Alignas(1024) c; } Aligned1024; int struct_test131(G g0,G g1,G g2,G g3,G g4,F f0,F f1,F f2,F f3,F f4,F f5, int i0, int i1, ... ) { va_list ap; va_start(ap, i1); long double ret = i0 + i1; ret += va_arg(ap, long double); /* Use int instead of extremely-aligned type to avoid psABI warnings about passing 1024-byte aligned parameters (GCC 4.6 note). */ ret += va_arg(ap, int); ret += va_arg(ap, int); ret += va_arg(ap, double); ret += va_arg(ap, double); ret += va_arg(ap, double); ret += va_arg(ap, double); /* See note above: avoid va_arg of huge-alignment type here. */ ret += va_arg(ap, int); ret += va_arg(ap, long double); va_end(ap); return ret; } typedef struct { long i,j; } DI; int struct_test141(int cnt,...) { va_list ap; va_start(ap, cnt); long ret = 0; for (int i = 0; i < cnt; i++) { DI s = va_arg(ap, DI); ret += s.i + s.j; } va_end(ap); return ret; } typedef struct { double d,f; } DD; int struct_test151(int cnt,...) { va_list ap; va_start(ap, cnt); double ret = 0; for (int i = 0; i < cnt; i++) { DD s = va_arg(ap, DD); ret += s.d + s.f; } va_end(ap); return ret; } typedef struct { long i; double d; } DM; int struct_test161(int cnt,...) { va_list ap; va_start(ap, cnt); double ret = 0; for (int i = 0; i < cnt; i++) { DM s = va_arg(ap, DM); ret += s.d + s.i; } va_end(ap); return ret; } typedef struct { union { long double ld[1]; long double ld2; } u[1]; } struct170; struct170 struct_test171(struct170 t1,...) { va_list ap; va_start(ap, t1); struct170 t = t1; t.u[0].ld2 += va_arg(ap, struct170).u[0].ld[0]; va_end(ap); return t; } typedef union { double ld; long i; } struct180; struct180 struct_test181(struct180 t1,...) { va_list ap; va_start(ap, t1); struct180 t = t1; /* Avoid va_arg of a union containing long double (triggers ABI-change notes). Read a double directly from varargs instead. */ t.ld += va_arg(ap, double); va_end(ap); return t; }chibicc-1.0.24/test/commonsym.c000077500000000000000000000003651517770275000163500ustar00rootroot00000000000000#include "test.h" int x; int x = 5; int y = 7; int y; int common_ext1; int common_ext2; static int common_local; int main() { ASSERT(5, x); ASSERT(7, y); ASSERT(0, common_ext1); ASSERT(3, common_ext2); printf("OK\n"); return 0; } chibicc-1.0.24/test/compare_exchange.c000066400000000000000000000034511517770275000176130ustar00rootroot00000000000000#include "test.h" #include #include int main() { int x = 42; int expected; int desired; bool result; printf("=== Testing __atomic_compare_exchange_n ===\n"); // Example 1: successful CAS x = 42; expected = 42; desired = 100; result = __atomic_compare_exchange_n(&x, &expected, desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); printf("CAS_N success? %d, x=%d, expected=%d\n", result, x, expected); ASSERT(42, expected); ASSERT(100, x); ASSERT(1, result); // Example 2: failed CAS x = 50; expected = 42; desired = 200; result = __atomic_compare_exchange_n(&x, &expected, desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); printf("CAS_N success? %d, x=%d, expected=%d\n", result, x, expected); printf("\n=== Testing __atomic_compare_exchange ===\n"); ASSERT(50, expected); ASSERT(50, x); ASSERT(0, result); // Using __atomic_compare_exchange (strong variant) x = 42; expected = 50; desired = 123; result = __atomic_compare_exchange(&x, &expected, &desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); printf("CAS success? %d, x=%d, expected=%d\n", result, x, expected); ASSERT(42, expected); ASSERT(42, x); ASSERT(0, result); // Failed CAS x = 50; expected = 42; desired = 999; result = __atomic_compare_exchange(&x, &expected, &desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); printf("CAS success? %d, x=%d, expected=%d\n", result, x, expected); ASSERT(50, expected); ASSERT(50, x); ASSERT(0, result); return 0; } chibicc-1.0.24/test/compat.c000077500000000000000000000005711517770275000156110ustar00rootroot00000000000000#include "test.h" _Noreturn noreturn_fn(int restrict x) { exit(0); } void funcy_type(int arg[restrict static 3]) {} int main() { { volatile x; } { int volatile x; } { volatile int x; } { volatile int volatile volatile x; } { int volatile * volatile volatile x; } { auto ** restrict __restrict __restrict__ const volatile *x; } printf("OK\n"); return 0; } chibicc-1.0.24/test/complex_asm.c000066400000000000000000000004141517770275000166260ustar00rootroot00000000000000#include "test.h" int main() { int a = 10, b = 20; int result = 5; __asm__ volatile ( "add %[src], %[dst]\n" : [dst] "+r" (result) : [src] "r" (a + b) ); printf("Result = %d\n", result); ASSERT(35, result); return 0; }chibicc-1.0.24/test/complit.c000077500000000000000000000010341517770275000157700ustar00rootroot00000000000000#include "test.h" typedef struct Tree { int val; struct Tree *lhs; struct Tree *rhs; } Tree; Tree *tree = &(Tree){ 1, &(Tree){ 2, &(Tree){ 3, 0, 0 }, &(Tree){ 4, 0, 0 } }, 0 }; int main() { ASSERT(1, (int){1}); ASSERT(2, ((int[]){0,1,2})[2]); ASSERT('a', ((struct {char a; int b;}){'a', 3}).a); ASSERT(3, ({ int x=3; (int){x}; })); (int){3} = 5; ASSERT(1, tree->val); ASSERT(2, tree->lhs->val); ASSERT(3, tree->lhs->lhs->val); ASSERT(4, tree->lhs->rhs->val); printf("OK\n"); return 0; } chibicc-1.0.24/test/complit2.c000066400000000000000000000014171517770275000160540ustar00rootroot00000000000000#include "test.h" static int arr[4] = {1,2,3,4}; int sum(int a, int b){ return a + b; } int* getarr(int idx) { return &arr[idx]; } struct s { int i,j,k; } s0 = {1,2,3}; int main() { ASSERT(1, ({ (int[2]){1,2}[0]; })); ASSERT(2, ({ (int[2]){1,2}[1]; })); ASSERT(1, ({ (int*){&arr}[0]; })); ASSERT(3, ({ (int*){&arr[1]}[1]; })); ASSERT(4, ({ (int(*)[2]){&arr}[1][1]; })); ASSERT(0, ({ (struct s){.j=2}.i; })); ASSERT(2, ({ (struct s){.j=2}.j; })); ASSERT(0, ({ (struct s){.j=2}.k; })); ASSERT(3, ({ (struct s*){&s0}->k; })); ASSERT(3, ({ int a=(int){3}++; a; })); ASSERT(1, ({ int *p=(int*){&arr[0]}++; *p; })); ASSERT(10, ({ (int(*)(int,int)){sum}(7,3); })); ASSERT(3, ({ (int*(*)(int)){&getarr}(1)[1]; })); printf("OK\n"); return 0; }chibicc-1.0.24/test/config.h000066400000000000000000000132441517770275000155760ustar00rootroot00000000000000/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* Set to nonzero if you want to compile using ASAN */ /* #undef ASAN */ /* Set to nonzero if you want to disable unix domain socket */ /* #undef DISABLE_UNIX_SOCKET */ /* Set to nonzero if you want to include DTRACE */ /* #undef ENABLE_DTRACE */ /* Set to nonzero if you want to include SASL */ /* #undef ENABLE_SASL */ /* Set to nonzero if you want to enable a SASL pwdb */ /* #undef ENABLE_SASL_PWDB */ /* machine is bigendian */ /* #undef ENDIAN_BIG */ /* machine is littleendian */ #define ENDIAN_LITTLE 1 /* Set to nonzero if you want to enable extstore */ #define EXTSTORE 1 /* Define to 1 if support accept4 */ #define HAVE_ACCEPT4 1 /* Define to 1 if you have the `cap_enter' function. */ /* #undef HAVE_CAP_ENTER */ /* Define to 1 if you have the `clock_gettime' function. */ #define HAVE_CLOCK_GETTIME 1 /* Define this if you have an implementation of drop_privileges() */ /* #undef HAVE_DROP_PRIVILEGES */ /* Define this if you have an implementation of drop_worker_privileges() */ /* #undef HAVE_DROP_WORKER_PRIVILEGES */ /* Define to 1 if you have the `eventfd' function. */ #define HAVE_EVENTFD 1 /* GCC 64bit Atomics available */ #define HAVE_GCC_64ATOMICS 1 /* GCC Atomics available */ #define HAVE_GCC_ATOMICS 1 /* Define to 1 if support getopt_long */ #define HAVE_GETOPT_LONG 1 /* Define to 1 if you have the `getpagesizes' function. */ /* #undef HAVE_GETPAGESIZES */ /* Have ntohll */ #define HAVE_HTONLL 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* linked to libevent */ #define HAVE_LIBEVENT_NEW 1 /* Set to nonzero if you want to enable proxy uring handling */ /* #undef HAVE_LIBURING */ /* Define to 1 if you have the `memcntl' function. */ /* #undef HAVE_MEMCNTL */ /* Define to 1 if you have the `mlockall' function. */ #define HAVE_MLOCKALL 1 /* Define to 1 if you have the `pledge' function. */ /* #undef HAVE_PLEDGE */ /* Define to 1 if you have the `pread' function. */ #define HAVE_PREAD 1 /* Define to 1 if you have the `preadv' function. */ #define HAVE_PREADV 1 /* Define to 1 if you have the `sandbox_init' function. */ /* #undef HAVE_SANDBOX_INIT */ /* we have sasl_callback_ft */ /* #undef HAVE_SASL_CALLBACK_FT */ /* Set to nonzero if your SASL implementation supports SASL_CB_GETCONF */ /* #undef HAVE_SASL_CB_GETCONF */ /* Set to nonzero if your SASL implementation supports SASL_CB_GETCONFPATH */ /* #undef HAVE_SASL_CB_GETCONFPATH */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SASL_SASL_H */ /* Define to 1 if you have the `setppriv' function. */ /* #undef HAVE_SETPPRIV */ /* Define to 1 if stdbool.h conforms to C99. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `sysconf' function. */ #define HAVE_SYSCONF 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_AUXV_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if the system has the type `_Bool'. */ #define HAVE__BOOL 1 /* Machine need alignment */ /* #undef NEED_ALIGN */ /* Name of package */ #define PACKAGE "memcached" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "memcached@googlegroups.com" /* Define to the full name of this package. */ #define PACKAGE_NAME "memcached" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "memcached 1.6.21" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "memcached" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.6.21" /* Set to nonzero if you want to enable proxy code */ /* #undef PROXY */ /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 8 /* Set to nonzero if you want to compile a statically linked binary */ /* #undef STATIC */ /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #define STDC_HEADERS 1 /* Set to nonzero if you want to enable TLS */ /* #undef TLS */ /* Version number of package */ #define VERSION "1.6.21" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* make sure IOV_MAX is defined */ /* #undef _GNU_SOURCE */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* define to int if socklen_t not available */ /* #undef socklen_t */ #if HAVE_STDBOOL_H #include #else #define bool char #define false 0 #define true 1 #endif #ifdef HAVE_INTTYPES_H #include #endif chibicc-1.0.24/test/const.c000077500000000000000000000004441517770275000154530ustar00rootroot00000000000000#include "test.h" int main() { { const x; } { int const x; } { const int x; } { const int const const x; } ASSERT(5, ({ const x = 5; x; })); ASSERT(8, ({ const x = 8; int *const y=&x; *y; })); ASSERT(6, ({ const x = 6; *(const * const)&x; })); printf("OK\n"); return 0; } chibicc-1.0.24/test/constant_folding.c000066400000000000000000000212061517770275000176540ustar00rootroot00000000000000/** * test_constant_folding.c * ======================== * Tests for constant folding / constant-expression evaluation in chibicc. * * chibicc has NO optimization pass, so it does NOT fold constants at the * code-generation level. However, the C11 standard mandates that certain * contexts REQUIRE the compiler to evaluate constant expressions at * compile time: * * - Array sizes (VLA vs fixed) * - Enum values * - case labels in switch * - _Static_assert conditions * - Static/global variable initializers * - Bit-field widths * * This test file is split into two parts: * * PART A – "Mandatory" constant folding (must compile & produce correct * values to be C11-conformant). A conforming chibicc MUST pass * these. * * PART B – "Optional" runtime constant folding (pure optimization). * chibicc is NOT expected to fold these, but the runtime * results must still be correct. These tests check correctness, * not whether folding actually happened. * * Build: * chibicc -o test_constant_folding test_constant_folding.c && ./test_constant_folding * * Expected output: all lines print "OK". */ #include /* ------------------------------------------------------------------ */ /* Minimal test harness */ /* ------------------------------------------------------------------ */ static int g_tests = 0; static int g_passed = 0; #define CHECK(label, expr) \ do { \ g_tests++; \ if (expr) { \ g_passed++; \ printf("OK " label "\n"); \ } else { \ printf("FAIL " label " (line %d)\n", __LINE__); \ } \ } while (0) /* ================================================================== */ /* PART A – Mandatory compile-time constant expressions */ /* ================================================================== */ /* --- A1. Integer constant expressions in array dimensions ---------- */ #define N (3 + 2) /* = 5 */ #define M (N * N - 5) /* = 20 */ static int arr_a[N]; /* must not be a VLA */ static int arr_b[2 * N + 1]; /* = 11 elements */ static int arr_c[M / 4]; /* = 5 elements */ /* --- A2. Enum constant expressions --------------------------------- */ enum Color { RED = 0, GREEN = RED + 1, BLUE = GREEN + 1, WHITE = (RED | GREEN | BLUE) + 1, /* bitwise OR of prior values */ COUNT = sizeof(int) > 0 ? 4 : -1 /* conditional constant expr */ }; /* --- A3. Static initializers --------------------------------------- */ static const int ANSWER = 6 * 7; /* 42 */ static const int BIT_SHIFT = 1 << 10; /* 1024 */ static const int CHAIN = (ANSWER * 2) / 4 + 1; /* 22 */ /* Struct with constant initializer */ static struct { int x; int y; } origin = { 100 - 100, 200 / 2 - 100 }; /* --- A4. Bit-field width (must be an integer constant expression) -- */ struct Flags { unsigned int a : 1; unsigned int b : (2 + 1); /* = 3 bits */ unsigned int c : (1 << 2); /* = 4 bits */ }; /* --- A5. _Static_assert -------------------------------------------- */ _Static_assert(sizeof(int) >= 2, "int must be >= 16-bit"); _Static_assert(N == 5, "macro N must equal 5"); _Static_assert(ANSWER == 42, "6*7 must be 42"); _Static_assert(GREEN == 1, "enum GREEN must be 1"); _Static_assert(WHITE == 4, "enum WHITE must be 4"); _Static_assert(sizeof(arr_a) == N * sizeof(int), "arr_a size mismatch"); /* ================================================================== */ /* PART B – Runtime correctness of "foldable" expressions */ /* (chibicc may or may not fold these; result must be correct) */ /* ================================================================== */ /* Prevent the compiler from constant-propagating through a black-box */ static int identity(int v) { return v; } static void run_tests(void) { /* ---- B1. Basic arithmetic ------------------------------------ */ CHECK("B1a: 2+3", (2 + 3) == 5); CHECK("B1b: 10-4", (10 - 4) == 6); CHECK("B1c: 6*7", (6 * 7) == 42); CHECK("B1d: 100/4", (100 / 4) == 25); CHECK("B1e: 17%5", (17 % 5) == 2); CHECK("B1f: chain", ((6*7)*2/4 + 1) == 22); /* ---- B2. Bit operations -------------------------------------- */ CHECK("B2a: 1<<10", (1 << 10) == 1024); CHECK("B2b: 1024>>3", (1024 >> 3) == 128); CHECK("B2c: 0xF0 & 0xFF", (0xF0 & 0xFF) == 0xF0); CHECK("B2d: 0xF0 | 0x0F", (0xF0 | 0x0F) == 0xFF); CHECK("B2e: 0xFF ^ 0x0F", (0xFF ^ 0x0F) == 0xF0); CHECK("B2f: ~0 & 0xFF", (~0 & 0xFF) == 0xFF); /* ---- B3. Comparison / logical -------------------------------- */ CHECK("B3a: 1 < 2", (1 < 2) == 1); CHECK("B3b: 2 > 2", (2 > 2) == 0); CHECK("B3c: 3 <= 3", (3 <= 3) == 1); CHECK("B3d: 0 && 1/0", (0 && (1/1)) == 0); /* short-circuit */ CHECK("B3e: 1 || 1/0", (1 || (1/1)) == 1); /* short-circuit */ CHECK("B3f: ternary true", (1 ? 99 : -1) == 99); CHECK("B3g: ternary false", (0 ? -1 : 77) == 77); /* ---- B4. Mixed-type constant promotion ----------------------- */ CHECK("B4a: char+int", ((char)3 + 250) == 253); CHECK("B4b: unsigned wrap",(unsigned char)(255 + 1) == 0); /* ---- B5. Sizeof as constant expression ----------------------- */ int arr_local[2 + 2]; /* = 4 */ CHECK("B5a: sizeof arr_local", sizeof(arr_local) == 4 * sizeof(int)); CHECK("B5b: sizeof int >= 2", sizeof(int) >= 2); /* ---- B6. Enum value correctness ------------------------------ */ CHECK("B6a: RED == 0", RED == 0); CHECK("B6b: GREEN == 1", GREEN == 1); CHECK("B6c: BLUE == 2", BLUE == 2); CHECK("B6d: WHITE == 4", WHITE == 4); /* 0|1|2 = 3, +1 = 4 */ CHECK("B6e: COUNT == 4", COUNT == 4); /* ---- B7. Static initializer values read at runtime ----------- */ CHECK("B7a: ANSWER", ANSWER == 42); CHECK("B7b: BIT_SHIFT", BIT_SHIFT == 1024); CHECK("B7c: CHAIN", CHAIN == 22); CHECK("B7d: origin.x", origin.x == 0); CHECK("B7e: origin.y", origin.y == 0); /* ---- B8. Array size via constant-folded dimension ------------ */ CHECK("B8a: arr_a length", (int)(sizeof(arr_a)/sizeof(arr_a[0])) == 5); CHECK("B8b: arr_b length", (int)(sizeof(arr_b)/sizeof(arr_b[0])) == 11); CHECK("B8c: arr_c length", (int)(sizeof(arr_c)/sizeof(arr_c[0])) == 5); /* ---- B9. switch / case (case labels are constant exprs) ------ */ int result = -1; switch (identity(2)) { case 1: result = 10; break; case 1 + 1: result = 20; break; /* case 2 via const expr */ case 2 + 1: result = 30; break; default: result = 0; break; } CHECK("B9a: switch case 1+1", result == 20); switch (identity(GREEN)) { case RED: result = 0; break; case GREEN: result = 1; break; case BLUE: result = 2; break; default: result = -1; break; } CHECK("B9b: switch enum GREEN", result == 1); /* ---- B10. Nested / complex constant expressions -------------- */ CHECK("B10a: nested arith", ((2+3) * (4-1) + 1) == 16); CHECK("B10b: mixed ops", (100 / (2 * 5) - 1) == 9); CHECK("B10c: shift+arith", ((1<<4) + (1<<3)) == 24); CHECK("B10d: deep chain", ((N*N - M/4)*2) == 40); /* (25-5)*2 */ } /* ================================================================== */ /* main */ /* ================================================================== */ int main(void) { printf("=== chibicc constant-folding test suite ===\n\n"); printf("--- Part A: compile-time constant expressions ---\n"); printf(" (These are validated statically; if the file compiled,\n"); printf(" _Static_assert and array dimensions are already correct.)\n\n"); printf("--- Part B: runtime correctness of constant expressions ---\n"); run_tests(); printf("\n=== Results: %d / %d passed ===\n", g_passed, g_tests); return (g_passed == g_tests) ? 0 : 1; } chibicc-1.0.24/test/constexpr.c000077500000000000000000000044631517770275000163570ustar00rootroot00000000000000#include "test.h" float g40 = 1.5; double g41 = 0.0 ? 55 : (0, 1 + 1 * 5.0 / 2 * (double)2 * (int)2.0); int main() { ASSERT(10, ({ enum { ten=1+2+3+4 }; ten; })); ASSERT(1, ({ int i=0; switch(3) { case 5-2+0*3: i++; } i; })); ASSERT(8, ({ int x[1+1]; sizeof(x); })); ASSERT(6, ({ char x[8-2]; sizeof(x); })); ASSERT(6, ({ char x[2*3]; sizeof(x); })); ASSERT(3, ({ char x[12/4]; sizeof(x); })); ASSERT(2, ({ char x[12%10]; sizeof(x); })); ASSERT(0b100, ({ char x[0b110&0b101]; sizeof(x); })); ASSERT(0b111, ({ char x[0b110|0b101]; sizeof(x); })); ASSERT(0b110, ({ char x[0b111^0b001]; sizeof(x); })); ASSERT(4, ({ char x[1<<2]; sizeof(x); })); ASSERT(2, ({ char x[4>>1]; sizeof(x); })); ASSERT(2, ({ char x[(1==1)+1]; sizeof(x); })); ASSERT(1, ({ char x[(1!=1)+1]; sizeof(x); })); ASSERT(1, ({ char x[(1<1)+1]; sizeof(x); })); ASSERT(2, ({ char x[(1<=1)+1]; sizeof(x); })); ASSERT(2, ({ char x[1?2:3]; sizeof(x); })); ASSERT(3, ({ char x[0?2:3]; sizeof(x); })); ASSERT(3, ({ char x[(1,3)]; sizeof(x); })); ASSERT(2, ({ char x[!0+1]; sizeof(x); })); ASSERT(1, ({ char x[!1+1]; sizeof(x); })); ASSERT(2, ({ char x[~-3]; sizeof(x); })); ASSERT(2, ({ char x[(5||6)+1]; sizeof(x); })); ASSERT(1, ({ char x[(0||0)+1]; sizeof(x); })); ASSERT(2, ({ char x[(1&&1)+1]; sizeof(x); })); ASSERT(1, ({ char x[(1&&0)+1]; sizeof(x); })); ASSERT(3, ({ char x[(int)3]; sizeof(x); })); ASSERT(15, ({ char x[(char)0xffffff0f]; sizeof(x); })); ASSERT(0x10f, ({ char x[(short)0xffff010f]; sizeof(x); })); ASSERT(4, ({ char x[(int)0xfffffffffff+5]; sizeof(x); })); ASSERT(8, ({ char x[(int*)0+2]; sizeof(x); })); ASSERT(12, ({ char x[(int*)16-1]; sizeof(x); })); ASSERT(3, ({ char x[(int*)16-(int*)4]; sizeof(x); })); ASSERT(4, ({ char x[(-1>>31)+5]; sizeof(x); })); ASSERT(255, ({ char x[(unsigned char)0xffffffff]; sizeof(x); })); ASSERT(0x800f, ({ char x[(unsigned short)0xffff800f]; sizeof(x); })); ASSERT(1, ({ char x[(unsigned int)0xfffffffffff>>31]; sizeof(x); })); ASSERT(1, ({ char x[(long)-1/((long)1<<62)+1]; sizeof(x); })); ASSERT(4, ({ char x[(unsigned long)-1/((long)1<<62)+1]; sizeof(x); })); ASSERT(1, ({ char x[(unsigned)1<-1]; sizeof(x); })); ASSERT(1, ({ char x[(unsigned)1<=-1]; sizeof(x); })); ASSERT(1, g40==1.5); ASSERT(1, g41==11); printf("OK\n"); return 0; } chibicc-1.0.24/test/constexpr2.c000066400000000000000000000061601517770275000164320ustar00rootroot00000000000000#include "test.h" #include #if !1u - 1 > 0 #error #endif extern int extarr[55]; int garr[11]; static int sgarr[33]; _Bool str_lit_bool_init = "abc" ? "foo" && "bar" : 0; void array_cast_to_bool(int j) { static int slarr[5]; int larr[7]; char vla[j]; DASSERT((_Bool)extarr && (_Bool)garr && (_Bool)sgarr && (_Bool)slarr && (_Bool)larr && (_Bool)vla); ASSERT(1, str_lit_bool_init); } int extarr[55]; extern int ext_var; extern void ext_fn(void); SASSERT(2 == ((_Bool)&ext_var + (_Bool)ext_fn)); #ifdef NOTGCC SASSERT(3 == ((_Bool)(long long)&ext_var + (_Bool)(_Bool)ext_fn + (_Bool)(long long)(_Bool)ext_fn)); #endif int main(void) { array_cast_to_bool(11); DASSERT((_Bool)0.1f == 1); DASSERT((_Bool)2 == 1); DASSERT((_Bool)(0.0f + 0.1f) == 1); DASSERT((_Bool)(2 * 3) == 1); DASSERT( -1 < 0 ); DASSERT( 3U << 31 >> 31 == 1); DASSERT( 1 << 31 >> 31 == -1); DASSERT(0.2 > 0.1); DASSERT(0.1 < 0.2); DASSERT(0.2 != 0.1); DASSERT(!(0.2 <= 0.1)); DASSERT(!(0.1 >= 0.2)); DASSERT(!(0.1 == 0.2)); DASSERT(!!0.1); DASSERT(0.1 ? 1 : 0); DASSERT((long)-0x1U == 4294967295); DASSERT((long)-0x1 == -1); DASSERT((long)-0xFFFFFFF0U == 16); DASSERT((long)-0xFFFFFFF0 == 16); DASSERT((long)~0x1U == 4294967294); DASSERT((long)~0x1 == -2); DASSERT((long)~0xFFFFFFF0U == 15); DASSERT((long)~0xFFFFFFF0 == 15); DASSERT((long)(0x80000000U << 1) == 0); DASSERT((long)(0xFFFFFFFFU + 1) == 0); DASSERT((long)(0U - 1) == 0xFFFFFFFFU); DASSERT((long)(25989 * 2972383464U) == 4287027336); // static_assert(INT32_MIN / -1 == INT32_MIN); // static_assert(INT64_MIN / -1 == INT64_MIN); // static_assert(INT32_MIN % -1 == 0); // static_assert(INT64_MIN % -1 == 0); DASSERT(13835058055282163712.0 == (double)13835058055282163712ULL); DASSERT(13835058055282163712.0f == (float) 13835058055282163712ULL); DASSERT(13835058055282163712ULL == (unsigned long long) 13835058055282163712.0f); DASSERT(13835058055282163712ULL == (unsigned long long) 13835058055282163712.0); DASSERT(13835058055282163711ULL == (unsigned long long) 13835058055282163711.0L); DASSERT(13835058055282163711.0L == (long double) 13835058055282163711ULL); DASSERT( 16777217.0 != (float)16777217.0 ); DASSERT( 9007199254740993.0L != (double)9007199254740993.0L || sizeof(double) == sizeof(long double) ); #ifdef NOTCLANG DASSERT( 127 == (unsigned char)511.0 >> 1 ); #endif DASSERT( (long long)(0.1f * 1e12f) == 99999997952LL ); ASSERT(1, ({ int i = 2; char arr[ (i++,3) ]; i == sizeof arr; }) ); { char (*arr_ptr)[UINT32_MAX + 1ULL]; DASSERT( sizeof(*arr_ptr) == (UINT32_MAX + 1ULL)); } { char arr[3]; DASSERT(8 == sizeof((0 ? arr:arr))); DASSERT(8 == sizeof((0 ? 0: (char*)arr))); DASSERT(8 == sizeof((0 ? (char*)arr:0))); DASSERT(8 == sizeof(({(char*)arr;}))); DASSERT(8 == sizeof((0, (char*)arr))); DASSERT(8 == sizeof((0 ? 0: arr))); DASSERT(8 == sizeof((0 ? arr:0))); DASSERT(8 == sizeof(({arr;}))); DASSERT(8 == sizeof((0, arr))); DASSERT(3 == sizeof((arr))); DASSERT(3 == sizeof( (typeof(arr)){0} )); } printf("OK\n"); return 0; }chibicc-1.0.24/test/constexpr3.c000066400000000000000000000011111517770275000164220ustar00rootroot00000000000000#include "test.h" #include int main() { char arr[3]; char (*arr_ptr)[UINT32_MAX + 1ULL]; printf("%lld sizeof(*arr_ptr)=%lld \n", (UINT32_MAX + 1ULL), sizeof(*arr_ptr) ); DASSERT( sizeof(*arr_ptr) == (UINT32_MAX + 1ULL)); printf("sizeof( (typeof(arr)){0} )=%d\n", sizeof( (typeof(arr)){0} )); DASSERT(3 == sizeof( (typeof(arr)){0} )); printf("sizeof((0, arr))=%d\n", sizeof((0, arr))); DASSERT(8 == sizeof((0, arr))); printf("sizeof((0 ? 0: arr))=%d\n", sizeof((0 ? 0: arr))); DASSERT(8 == sizeof((0 ? 0: arr))); return 0; }chibicc-1.0.24/test/constructor_destructor.c000066400000000000000000000034451517770275000211710ustar00rootroot00000000000000 #include "test.h" // Attributes defined BEFORE declarations __attribute__((constructor(200))) void ctor2(); __attribute__((constructor(100))) void ctor1(); __attribute__((destructor(200))) void dtor2(); __attribute__((destructor(100))) void dtor1(); int step = 0; void before_main_low () __attribute__((constructor(500))) ; void before_main_high() __attribute__((constructor(400))) ; void after_main_low() __attribute__((destructor(500))) ; void after_main_high() __attribute__((destructor(400))) ; // Attributes defined AFTER declarations void ctor3() __attribute__((constructor(300))); void dtor3() __attribute__((destructor(300))); void ctor1() { printf("Constructor 100 (first)\n"); step += 100; ASSERT(100, step); } void ctor2() { printf("Constructor 200 (second)\n"); step += 100; ASSERT(200, step); } void ctor3() { printf("Constructor 300 (third)\n"); step += 100; ASSERT(300, step); } void dtor1() { printf("Destructor 100 (first)\n"); step -= 100; ASSERT(0, step); } void dtor2() { printf("Destructor 200 (second)\n"); step -= 100; ASSERT(100, step); } void dtor3() { printf("Destructor 300 (last)\n"); step -= 100; ASSERT(200, step); } void before_main_low(void) { printf("Constructor with priority 500 (runs fifth)\n"); step += 100; ASSERT(500, step); } void before_main_high(void) { printf("Constructor with priority 400 (runs fourth)\n"); step += 100; ASSERT(400, step); } void after_main_low(void) { printf("Destructor with priority 500 (runs fifth)\n"); step -= 100; ASSERT(400, step); } void after_main_high(void) { printf("Destructor with priority 400 (runs fourth)\n"); step -= 100; ASSERT(300, step); } int main(void) { printf("Inside main()\n"); return 0; } chibicc-1.0.24/test/constructor_destructor2.c000066400000000000000000000035421517770275000212510ustar00rootroot00000000000000 #include "test.h" // Attributes defined BEFORE declarations __attribute__((constructor(200))) void ctor2(void); __attribute__((constructor(100))) void ctor1(void); __attribute__((destructor(200))) void dtor2(void); __attribute__((destructor(100))) void dtor1(void); int step = 0; void before_main_low(void) __attribute__((constructor(500))); void before_main_high(void) __attribute__((constructor(400))); void after_main_low(void) __attribute__((destructor(500))); void after_main_high(void) __attribute__((destructor(400))); // Attributes defined AFTER declarations void ctor3(void) __attribute__((constructor(300))); void dtor3(void) __attribute__((destructor(300))); void ctor1(void) { printf("Constructor 100 (first)\n"); step += 100; ASSERT(100, step); } void ctor2(void) { printf("Constructor 200 (second)\n"); step +=100; ASSERT(200, step); } void ctor3(void) { printf("Constructor 300 (third)\n"); step += 100; ASSERT(300, step); } void dtor1(void) { printf("Destructor 100 (first)\n"); step -= 100; ASSERT(0, step); } void dtor2(void) { printf("Destructor 200 (second)\n"); step -= 100; ASSERT(100, step); } void dtor3(void) { printf("Destructor 300 (last)\n"); step -= 100; ASSERT(200, step); } void before_main_low(void) { printf("Constructor with priority 500 (runs fifth)\n"); step += 100; ASSERT(500, step); } void before_main_high(void) { printf("Constructor with priority 400 (runs fourth)\n"); step += 100; ASSERT(400, step); } void after_main_low(void) { printf("Destructor with priority 500 (runs fifth)\n"); step -= 100; ASSERT(400, step); } void after_main_high(void) { printf("Destructor with priority 400 (runs fourth)\n"); step -= 100; ASSERT(300, step); } int main(void) { printf("Inside main()\n"); return 0; } chibicc-1.0.24/test/control.c000077500000000000000000000106251517770275000160070ustar00rootroot00000000000000#include "test.h" /* * This is a block comment. */ int main() { ASSERT(3, ({ int x; if (0) x=2; else x=3; x; })); ASSERT(3, ({ int x; if (1-1) x=2; else x=3; x; })); ASSERT(2, ({ int x; if (1) x=2; else x=3; x; })); ASSERT(2, ({ int x; if (2-1) x=2; else x=3; x; })); ASSERT(55, ({ int i=0; int j=0; for (i=0; i<=10; i=i+1) j=i+j; j; })); ASSERT(10, ({ int i=0; while(i<10) i=i+1; i; })); ASSERT(3, ({ 1; {2;} 3; })); ASSERT(5, ({ ;;; 5; })); ASSERT(10, ({ int i=0; while(i<10) i=i+1; i; })); ASSERT(55, ({ int i=0; int j=0; while(i<=10) {j=i+j; i=i+1;} j; })); ASSERT(3, (1,2,3)); ASSERT(5, ({ int i=2, j=3; (i=5,j)=6; i; })); ASSERT(6, ({ int i=2, j=3; (i=5,j)=6; j; })); ASSERT(55, ({ int j=0; for (int i=0; i<=10; i=i+1) j=j+i; j; })); ASSERT(3, ({ int i=3; int j=0; for (int i=0; i<=10; i=i+1) j=j+i; i; })); ASSERT(1, 0||1); ASSERT(1, 0||(2-2)||5); ASSERT(0, 0||0); ASSERT(0, 0||(2-2)); ASSERT(0, 0&&1); ASSERT(0, (2-2)&&5); ASSERT(1, 1&&5); ASSERT(3, ({ int i=0; goto a; a: i++; b: i++; c: i++; i; })); ASSERT(2, ({ int i=0; goto e; d: i++; e: i++; f: i++; i; })); ASSERT(1, ({ int i=0; goto i; g: i++; h: i++; i: i++; i; })); ASSERT(1, ({ typedef int foo; goto foo; foo:; 1; })); ASSERT(3, ({ int i=0; for(;i<10;i++) { if (i == 3) break; } i; })); ASSERT(4, ({ int i=0; while (1) { if (i++ == 3) break; } i; })); ASSERT(3, ({ int i=0; for(;i<10;i++) { for (;;) break; if (i == 3) break; } i; })); ASSERT(4, ({ int i=0; while (1) { while(1) break; if (i++ == 3) break; } i; })); ASSERT(10, ({ int i=0; int j=0; for (;i<10;i++) { if (i>5) continue; j++; } i; })); ASSERT(6, ({ int i=0; int j=0; for (;i<10;i++) { if (i>5) continue; j++; } j; })); ASSERT(10, ({ int i=0; int j=0; for(;!i;) { for (;j!=10;j++) continue; break; } j; })); ASSERT(11, ({ int i=0; int j=0; while (i++<10) { if (i>5) continue; j++; } i; })); ASSERT(5, ({ int i=0; int j=0; while (i++<10) { if (i>5) continue; j++; } j; })); ASSERT(11, ({ int i=0; int j=0; while(!i) { while (j++!=10) continue; break; } j; })); ASSERT(5, ({ int i=0; switch(0) { case 0:i=5;break; case 1:i=6;break; case 2:i=7;break; } i; })); ASSERT(6, ({ int i=0; switch(1) { case 0:i=5;break; case 1:i=6;break; case 2:i=7;break; } i; })); ASSERT(7, ({ int i=0; switch(2) { case 0:i=5;break; case 1:i=6;break; case 2:i=7;break; } i; })); ASSERT(0, ({ int i=0; switch(3) { case 0:i=5;break; case 1:i=6;break; case 2:i=7;break; } i; })); ASSERT(5, ({ int i=0; switch(0) { case 0:i=5;break; default:i=7; } i; })); ASSERT(7, ({ int i=0; switch(1) { case 0:i=5;break; default:i=7; } i; })); ASSERT(2, ({ int i=0; switch(1) { case 0: 0; case 1: 0; case 2: 0; i=2; } i; })); ASSERT(0, ({ int i=0; switch(3) { case 0: 0; case 1: 0; case 2: 0; i=2; } i; })); ASSERT(3, ({ int i=0; switch(-1) { case 0xffffffff: i=3; break; } i; })); ASSERT(7, ({ int i=0; int j=0; do { j++; } while (i++ < 6); j; })); ASSERT(4, ({ int i=0; int j=0; int k=0; do { if (++j > 3) break; continue; k++; } while (1); j; })); ASSERT(0, 0.0 && 0.0); ASSERT(0, 0.0 && 0.1); ASSERT(0, 0.3 && 0.0); ASSERT(1, 0.3 && 0.5); ASSERT(0, 0.0 || 0.0); ASSERT(1, 0.0 || 0.1); ASSERT(1, 0.3 || 0.0); ASSERT(1, 0.3 || 0.5); ASSERT(5, ({ int x; if (0.0) x=3; else x=5; x; })); ASSERT(3, ({ int x; if (0.1) x=3; else x=5; x; })); ASSERT(5, ({ int x=5; if (0.0) x=3; x; })); ASSERT(3, ({ int x=5; if (0.1) x=3; x; })); ASSERT(10, ({ double i=10.0; int j=0; for (; i; i--, j++); j; })); ASSERT(10, ({ double i=10.0; int j=0; do j++; while(--i); j; })); ASSERT(2, ({ int i=0; switch(7) { case 0 ... 5: i=1; break; case 6 ... 20: i=2; break; } i; })); ASSERT(1, ({ int i=0; switch(7) { case 0 ... 7: i=1; break; case 8 ... 10: i=2; break; } i; })); ASSERT(1, ({ int i=0; switch(7) { case 0: i=1; break; case 7 ... 7: i=1; break; } i; })); ASSERT(3, ({ void *p = &&v11; int i=0; goto *p; v11:i++; v12:i++; v13:i++; i; })); ASSERT(2, ({ void *p = &&v22; int i=0; goto *p; v21:i++; v22:i++; v23:i++; i; })); ASSERT(1, ({ void *p = &&v33; int i=0; goto *p; v31:i++; v32:i++; v33:i++; i; })); ASSERT(3, ({ static void *p[]={&&v41,&&v42,&&v43}; int i=0; goto *p[0]; v41:i++; v42:i++; v43:i++; i; })); ASSERT(2, ({ static void *p[]={&&v52,&&v52,&&v53}; int i=0; goto *p[1]; v51:i++; v52:i++; v53:i++; i; })); ASSERT(1, ({ static void *p[]={&&v62,&&v62,&&v63}; int i=0; goto *p[2]; v61:i++; v62:i++; v63:i++; i; })); printf("OK\n"); return 0; } chibicc-1.0.24/test/control2.c000066400000000000000000000016431517770275000160660ustar00rootroot00000000000000#include "test.h" #include char c23_label(void) { { int i = 0; if (i != 0) lab3: i = 1; ASSERT(0, i); } switch (1) { default: case 2: } if (0) { { lab1: } { lab2: int j; } return 77; } goto lab1; } int main(void){ ASSERT(2, ({ uint32_t i=0; switch(i){case 0 ...0xFFFFFFFF: i=2;} i; })); ASSERT(2, ({ int32_t i=0; switch(i){case 0x80000000 ...0x7FFFFFFF: i=2;} i; })); ASSERT(2, ({ uint64_t i=0; switch(i){case 0 ...0xFFFFFFFFFFFFFFFF: i=2;} i; })); ASSERT(2, ({ int64_t i=0; switch(i){case 0x8000000000000000 ...0x7FFFFFFFFFFFFFFF: i=2;} i; })); ASSERT(2, ({ uint32_t i=0; switch(i){case 0 ...0x100000000: i=2;} i; })); ASSERT(2, ({ int32_t i=-1; switch(i){case -1 ...(int64_t)-1: i=2;} i; })); ASSERT(2, ({ int64_t i=0; switch(0x123456789){case 0x123456789: i=2;} i; })); ASSERT(77, c23_label()); printf("OK\n"); }chibicc-1.0.24/test/cpuid.c000066400000000000000000000015561517770275000154330ustar00rootroot00000000000000#include "test.h" #include #include // Simple cpuid wrapper function void cpuid(uint32_t eax_in, uint32_t ecx_in, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) { __asm__ volatile ( "cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) : "a" (eax_in), "c" (ecx_in) ); } int main(void) { uint32_t eax, ebx, ecx, edx; // Get vendor ID (cpuid leaf 0) cpuid(0, 0, &eax, &ebx, &ecx, &edx); char vendor[13]; *(uint32_t*)&vendor[0] = ebx; *(uint32_t*)&vendor[4] = edx; *(uint32_t*)&vendor[8] = ecx; vendor[12] = '\0'; printf("CPUID vendor: %s\n", vendor); printf("Max cpuid leaf: %u\n", eax); //assert(0 == !strncmp("GenuineIntel", vendor, 12)); assert(13 == eax || eax == 20); return 0; } chibicc-1.0.24/test/cpython.c000066400000000000000000000036561517770275000160160ustar00rootroot00000000000000#include #include #include "test.h" #include #include #define NB_SMALL_SIZE_CLASSES 32 #define OBMALLOC_USED_POOLS_SIZE (2 * ((NB_SMALL_SIZE_CLASSES + 7) / 8) * 8) #define MAX_POOLS_IN_ARENA 8 #define INITIAL_ARENA_OBJECTS 16 typedef void* poolp; struct arena_object { int dummy; }; struct _obmalloc_pools { poolp used[OBMALLOC_USED_POOLS_SIZE]; }; struct _obmalloc_mgmt { struct arena_object* arenas; uint maxarenas; struct arena_object* unused_arena_objects; struct arena_object* usable_arenas; struct arena_object* nfp2lasta[MAX_POOLS_IN_ARENA + 1]; size_t narenas_currently_allocated; size_t ntimes_arena_allocated; size_t narenas_highwater; size_t raw_allocated_blocks; }; typedef struct _obmalloc_state { struct _obmalloc_pools pools; struct _obmalloc_mgmt mgmt; } OMState; // Simulate the interpreter state static OMState obmalloc_state_main; static OMState* get_state(void) { return &obmalloc_state_main; } // Simulated allocation void* _PyObject_Malloc(size_t nbytes) { OMState *state = get_state(); void* ptr = malloc(nbytes); if (ptr) state->mgmt.raw_allocated_blocks++; return ptr; } int main(void) { OMState *state = get_state(); printf("State address: %p\n", state); printf("Pools address: %p\n", &state->pools); printf("Mgmt address: %p\n", &state->mgmt); // Initialize pools for (int i = 0; i < OBMALLOC_USED_POOLS_SIZE; i++) state->pools.used[i] = (poolp)(uintptr_t)(0x1000 + i); // Allocate multiple objects void* objs[10]; for (int i = 0; i < 10; i++) { objs[i] = _PyObject_Malloc(64); printf("Allocated object[%d]: %p\n", i, objs[i]); } printf("Raw allocated blocks: %zu\n", state->mgmt.raw_allocated_blocks); ASSERT(10, state->mgmt.raw_allocated_blocks); return 0; } chibicc-1.0.24/test/cpython_asm_mem.c000066400000000000000000000016501517770275000175040ustar00rootroot00000000000000#include "test.h" #include __thread void* tls_var0; __thread void* tls_var1; static inline void* mi_prim_tls_slot(size_t slot) { void* res; const size_t ofs = (slot*sizeof(void*)); #if defined(__x86_64__) __asm__("movq %%fs:%1, %0" : "=r" (res) : "m" (*((void**)ofs))); #else res = 0; #endif return res; } int main() { #if !defined(__x86_64__) return 0; #else int a = 123; int b = 456; tls_var0 = &a; tls_var1 = &b; // Get actual FS base uintptr_t fs_base; __asm__("movq %%fs:0, %0" : "=r"(fs_base)); // Compute slot indices uintptr_t addr0 = (uintptr_t)&tls_var0; uintptr_t addr1 = (uintptr_t)&tls_var1; size_t slot0 = (addr0 - fs_base) / sizeof(void*); size_t slot1 = (addr1 - fs_base) / sizeof(void*); void* p0 = mi_prim_tls_slot(slot0); void* p1 = mi_prim_tls_slot(slot1); ASSERT(&a, p0); ASSERT(&b, p1); printf("Ok\n"); return 0; #endif } chibicc-1.0.24/test/cpython_crash.c000066400000000000000000000030001517770275000171550ustar00rootroot00000000000000#include "test.h" #include #include #include #include /* * This test attempts to reproduce a crash seen during CPython compilation (_freeze_module). * It exercises recursion, alloca, and stack arguments. */ int recursive_fn(int depth, int a, int b, int c, int d, int e, int f, int g, int h) { if (depth <= 0) { return a + b + c + d + e + f + g + h; } // Allocate variable size on stack to shift things around // Size is at least 16 to ensure we test non-trivial alloca int size = (depth % 16) * 8 + 16; char *ptr = alloca(size); // Fill memory to check for corruption later memset(ptr, depth & 0xFF, size); // Recursive call with modified arguments // Arguments g and h are typically passed on stack (x86-64 System V ABI uses 6 registers) int res = recursive_fn(depth - 1, a+1, b+1, c+1, d+1, e+1, f+1, g+1, h+1); // Verify memory integrity for (int i = 0; i < size; i++) { if ((unsigned char)ptr[i] != (depth & 0xFF)) { printf("Stack corruption detected at depth %d, index %d\n", depth, i); exit(1); } } return res; } int main() { // 100 levels of recursion // Initial args: 1, 2, 3, 4, 5, 6, 7, 8 // Sum: 36 // At depth 0 (after 100 steps): args are 101, 102, ..., 108 // Sum: 36 + 8*100 = 836 int res = recursive_fn(100, 1, 2, 3, 4, 5, 6, 7, 8); printf("Result: %d\n", res); ASSERT(836, res); printf("OK\n"); return 0; } chibicc-1.0.24/test/cpython_infinity.c000066400000000000000000000006341517770275000177200ustar00rootroot00000000000000/* test_infinity.c */ #include "test.h" #include /* mimic CPython's Py_complex */ typedef struct { double real; double imag; } Py_complex; /* this triggers constant-expression evaluation */ Py_complex infj = {0.0, INFINITY}; int main(void) { printf("infj.imag = %f\n", infj.imag); printf("isinf(infj.imag) = %d\n", isinf(infj.imag)); ASSERT(1, isinf(infj.imag)); return 0; } chibicc-1.0.24/test/cpython_ms_struct.c000066400000000000000000000020421517770275000201050ustar00rootroot00000000000000#include "test.h" #include // Normal struct struct Normal { char c; int i; short s; }; // MS struct struct __attribute__((ms_struct)) Ms { char c; int i; short s; }; int main(void) { printf("sizeof(Normal) = %zu\n", sizeof(struct Normal)); printf(" offsets: c=%zu i=%zu s=%zu\n", offsetof(struct Normal, c), offsetof(struct Normal, i), offsetof(struct Normal, s)); printf("sizeof(Ms) = %zu\n", sizeof(struct Ms)); printf(" offsets: c=%zu i=%zu s=%zu\n", offsetof(struct Ms, c), offsetof(struct Ms, i), offsetof(struct Ms, s)); ASSERT(12, sizeof(struct Normal)); ASSERT(0, offsetof(struct Normal, c)); ASSERT(4, offsetof(struct Normal, i)); ASSERT(8, offsetof(struct Normal, s)); ASSERT(12, sizeof(struct Ms)); ASSERT(0, offsetof(struct Ms, c)); ASSERT(4, offsetof(struct Ms, i)); ASSERT(8, offsetof(struct Ms, s)); printf("OK\n"); return 0; } chibicc-1.0.24/test/cpython_segfault.c000066400000000000000000000014061517770275000176770ustar00rootroot00000000000000#include #include struct S { int a; int b[10]; void *p; }; void target(int a, struct S s, int b, int c, int d, int e, int f, long *g, long *h) { if (s.a != 42) { printf("FAIL: s.a expected 42, got %d\n", s.a); exit(1); } if (g == NULL || h == NULL) { printf("FAIL: g or h is NULL\n"); exit(1); } *g = 123; *h = 456; printf("target: s.a=%d, g=%p, h=%p\n", s.a, g, h); } int main() { struct S s = {0}; s.a = 42; long g = 0, h = 0; // a=1, s=s, b=2, c=3, d=4, e=5, f=6, g=&g, h=&h target(1, s, 2, 3, 4, 5, 6, &g, &h); if (g == 123 && h == 456) { printf("SUCCESS\n"); return 0; } printf("FAIL: g=%ld, h=%ld\n", g, h); return 1; } chibicc-1.0.24/test/cpython_segfault2.c000066400000000000000000000064141517770275000177650ustar00rootroot00000000000000// test_memoryiter.c #include #include #include "test.h" /* ---------------- CPython core stubs ---------------- */ typedef intptr_t Py_ssize_t; typedef struct _object { Py_ssize_t ob_refcnt; struct _typeobject *ob_type; } PyObject; typedef struct _typeobject { PyObject ob_base; const char *tp_name; Py_ssize_t tp_basicsize; void (*tp_dealloc)(PyObject *); PyObject *(*tp_getattro)(PyObject *, PyObject *); unsigned long tp_flags; int (*tp_traverse)(PyObject *, void *, void *); PyObject *(*tp_iter)(PyObject *); PyObject *(*tp_iternext)(PyObject *); } PyTypeObject; #define PyObject_HEAD PyObject ob_base; #define PyVarObject_HEAD_INIT(type, size) \ { { 1, (type) } } #define Py_TPFLAGS_DEFAULT 0x00000001UL #define Py_TPFLAGS_HAVE_GC 0x00000020UL /* ---------------- Dummy dependent types ---------------- */ typedef struct { PyObject ob_base; } PyMemoryViewObject; /* ---------------- Forward declarations ---------------- */ static void memoryiter_dealloc(PyObject *self); static int memoryiter_traverse(PyObject *self, void *visit, void *arg); static PyObject *memoryiter_next(PyObject *self); static PyObject *PyObject_GenericGetAttr(PyObject *obj, PyObject *name); static PyObject *PyObject_SelfIter(PyObject *obj); /* ---------------- memoryiterobject ---------------- */ typedef struct { PyObject_HEAD Py_ssize_t it_index; PyMemoryViewObject *it_seq; /* NULL when exhausted */ Py_ssize_t it_length; const char *it_fmt; } memoryiterobject; PyTypeObject PyType_Type; /* dummy */ PyTypeObject _PyMemoryIter_Type = { .tp_name = "memory_iterator", .tp_basicsize = sizeof(memoryiterobject), .tp_dealloc = memoryiter_dealloc, .tp_getattro = PyObject_GenericGetAttr, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, .tp_traverse = memoryiter_traverse, .tp_iter = PyObject_SelfIter, .tp_iternext = memoryiter_next, }; static void memoryiter_dealloc(PyObject *self) { memoryiterobject *it = (memoryiterobject *)self; it->it_seq = NULL; } static int memoryiter_traverse(PyObject *self, void *visit, void *arg) { (void)self; (void)visit; (void)arg; return 0; } static PyObject * memoryiter_next(PyObject *self) { memoryiterobject *it = (memoryiterobject *)self; if (!it->it_seq || it->it_index >= it->it_length) return NULL; it->it_index++; return self; /* dummy non-NULL value */ } static PyObject * PyObject_GenericGetAttr(PyObject *obj, PyObject *name) { (void)obj; (void)name; return NULL; } static PyObject * PyObject_SelfIter(PyObject *obj) { return obj; } int main(void) { memoryiterobject it = { .ob_base = { 1, &_PyMemoryIter_Type }, .it_index = 0, .it_seq = (PyMemoryViewObject *)0x1, /* fake non-NULL */ .it_length = 2, .it_fmt = "B", }; PyObject *o = (PyObject *)⁢ printf("Type name: %s\n", _PyMemoryIter_Type.tp_name); printf("Size: %zu\n", sizeof(memoryiterobject)); ASSERT(48, sizeof(memoryiterobject)); _PyMemoryIter_Type.tp_iter(o); _PyMemoryIter_Type.tp_iternext(o); _PyMemoryIter_Type.tp_iternext(o); _PyMemoryIter_Type.tp_iternext(o); /* exhausted */ _PyMemoryIter_Type.tp_dealloc(o); return 0; } chibicc-1.0.24/test/cpython_xml.c000066400000000000000000000175371517770275000167010ustar00rootroot00000000000000 #include "test.h" const char * unsignedCharToPrintable(unsigned char c) { switch (c) { case 0: return "\\0"; case 1: return "\\x1"; case 2: return "\\x2"; case 3: return "\\x3"; case 4: return "\\x4"; case 5: return "\\x5"; case 6: return "\\x6"; case 7: return "\\x7"; case 8: return "\\x8"; case 9: return "\\t"; case 10: return "\\n"; case 11: return "\\xB"; case 12: return "\\xC"; case 13: return "\\r"; case 14: return "\\xE"; case 15: return "\\xF"; case 16: return "\\x10"; case 17: return "\\x11"; case 18: return "\\x12"; case 19: return "\\x13"; case 20: return "\\x14"; case 21: return "\\x15"; case 22: return "\\x16"; case 23: return "\\x17"; case 24: return "\\x18"; case 25: return "\\x19"; case 26: return "\\x1A"; case 27: return "\\x1B"; case 28: return "\\x1C"; case 29: return "\\x1D"; case 30: return "\\x1E"; case 31: return "\\x1F"; case 32: return " "; case 33: return "!"; case 34: return "\\\""; case 35: return "#"; case 36: return "$"; case 37: return "%"; case 38: return "&"; case 39: return "'"; case 40: return "("; case 41: return ")"; case 42: return "*"; case 43: return "+"; case 44: return ","; case 45: return "-"; case 46: return "."; case 47: return "/"; case 48: return "0"; case 49: return "1"; case 50: return "2"; case 51: return "3"; case 52: return "4"; case 53: return "5"; case 54: return "6"; case 55: return "7"; case 56: return "8"; case 57: return "9"; case 58: return ":"; case 59: return ";"; case 60: return "<"; case 61: return "="; case 62: return ">"; case 63: return "?"; case 64: return "@"; case 65: return "A"; case 66: return "B"; case 67: return "C"; case 68: return "D"; case 69: return "E"; case 70: return "F"; case 71: return "G"; case 72: return "H"; case 73: return "I"; case 74: return "J"; case 75: return "K"; case 76: return "L"; case 77: return "M"; case 78: return "N"; case 79: return "O"; case 80: return "P"; case 81: return "Q"; case 82: return "R"; case 83: return "S"; case 84: return "T"; case 85: return "U"; case 86: return "V"; case 87: return "W"; case 88: return "X"; case 89: return "Y"; case 90: return "Z"; case 91: return "["; case 92: return "\\\\"; case 93: return "]"; case 94: return "^"; case 95: return "_"; case 96: return "`"; case 97: return "a"; case 98: return "b"; case 99: return "c"; case 100: return "d"; case 101: return "e"; case 102: return "f"; case 103: return "g"; case 104: return "h"; case 105: return "i"; case 106: return "j"; case 107: return "k"; case 108: return "l"; case 109: return "m"; case 110: return "n"; case 111: return "o"; case 112: return "p"; case 113: return "q"; case 114: return "r"; case 115: return "s"; case 116: return "t"; case 117: return "u"; case 118: return "v"; case 119: return "w"; case 120: return "x"; case 121: return "y"; case 122: return "z"; case 123: return "{"; case 124: return "|"; case 125: return "}"; case 126: return "~"; case 127: return "\\x7F"; case 128: return "\\x80"; case 129: return "\\x81"; case 130: return "\\x82"; case 131: return "\\x83"; case 132: return "\\x84"; case 133: return "\\x85"; case 134: return "\\x86"; case 135: return "\\x87"; case 136: return "\\x88"; case 137: return "\\x89"; case 138: return "\\x8A"; case 139: return "\\x8B"; case 140: return "\\x8C"; case 141: return "\\x8D"; case 142: return "\\x8E"; case 143: return "\\x8F"; case 144: return "\\x90"; case 145: return "\\x91"; case 146: return "\\x92"; case 147: return "\\x93"; case 148: return "\\x94"; case 149: return "\\x95"; case 150: return "\\x96"; case 151: return "\\x97"; case 152: return "\\x98"; case 153: return "\\x99"; case 154: return "\\x9A"; case 155: return "\\x9B"; case 156: return "\\x9C"; case 157: return "\\x9D"; case 158: return "\\x9E"; case 159: return "\\x9F"; case 160: return "\\xA0"; case 161: return "\\xA1"; case 162: return "\\xA2"; case 163: return "\\xA3"; case 164: return "\\xA4"; case 165: return "\\xA5"; case 166: return "\\xA6"; case 167: return "\\xA7"; case 168: return "\\xA8"; case 169: return "\\xA9"; case 170: return "\\xAA"; case 171: return "\\xAB"; case 172: return "\\xAC"; case 173: return "\\xAD"; case 174: return "\\xAE"; case 175: return "\\xAF"; case 176: return "\\xB0"; case 177: return "\\xB1"; case 178: return "\\xB2"; case 179: return "\\xB3"; case 180: return "\\xB4"; case 181: return "\\xB5"; case 182: return "\\xB6"; case 183: return "\\xB7"; case 184: return "\\xB8"; case 185: return "\\xB9"; case 186: return "\\xBA"; case 187: return "\\xBB"; case 188: return "\\xBC"; case 189: return "\\xBD"; case 190: return "\\xBE"; case 191: return "\\xBF"; case 192: return "\\xC0"; case 193: return "\\xC1"; case 194: return "\\xC2"; case 195: return "\\xC3"; case 196: return "\\xC4"; case 197: return "\\xC5"; case 198: return "\\xC6"; case 199: return "\\xC7"; case 200: return "\\xC8"; case 201: return "\\xC9"; case 202: return "\\xCA"; case 203: return "\\xCB"; case 204: return "\\xCC"; case 205: return "\\xCD"; case 206: return "\\xCE"; case 207: return "\\xCF"; case 208: return "\\xD0"; case 209: return "\\xD1"; case 210: return "\\xD2"; case 211: return "\\xD3"; case 212: return "\\xD4"; case 213: return "\\xD5"; case 214: return "\\xD6"; case 215: return "\\xD7"; case 216: return "\\xD8"; case 217: return "\\xD9"; case 218: return "\\xDA"; case 219: return "\\xDB"; case 220: return "\\xDC"; case 221: return "\\xDD"; case 222: return "\\xDE"; case 223: return "\\xDF"; case 224: return "\\xE0"; case 225: return "\\xE1"; case 226: return "\\xE2"; case 227: return "\\xE3"; case 228: return "\\xE4"; case 229: return "\\xE5"; case 230: return "\\xE6"; case 231: return "\\xE7"; case 232: return "\\xE8"; case 233: return "\\xE9"; case 234: return "\\xEA"; case 235: return "\\xEB"; case 236: return "\\xEC"; case 237: return "\\xED"; case 238: return "\\xEE"; case 239: return "\\xEF"; case 240: return "\\xF0"; case 241: return "\\xF1"; case 242: return "\\xF2"; case 243: return "\\xF3"; case 244: return "\\xF4"; case 245: return "\\xF5"; case 246: return "\\xF6"; case 247: return "\\xF7"; case 248: return "\\xF8"; case 249: return "\\xF9"; case 250: return "\\xFA"; case 251: return "\\xFB"; case 252: return "\\xFC"; case 253: return "\\xFD"; case 254: return "\\xFE"; case 255: return "\\xFF"; default: return "dead code"; } } int main() { for (int i = 0; i <= 255; i++) { unsigned char c = (unsigned char)i; printf("unsigned char: %3d => printable: %s\n", c, unsignedCharToPrintable(c)); } printf("OK\n"); return 0; }chibicc-1.0.24/test/crawler.h000066400000000000000000000024511517770275000157660ustar00rootroot00000000000000#ifndef CRAWLER_H #define CRAWLER_H #define LRU_CRAWLER_CAP_REMAINING -1 typedef struct { uint64_t histo[61]; uint64_t ttl_hourplus; uint64_t noexp; uint64_t reclaimed; uint64_t seen; rel_time_t start_time; rel_time_t end_time; bool run_complete; } crawlerstats_t; struct crawler_expired_data { pthread_mutex_t lock; crawlerstats_t crawlerstats[POWER_LARGEST]; /* redundant with crawlerstats_t so we can get overall start/stop/done */ rel_time_t start_time; rel_time_t end_time; bool crawl_complete; bool is_external; /* whether this was an alloc local or remote to the module. */ }; enum crawler_result_type { CRAWLER_OK=0, CRAWLER_RUNNING, CRAWLER_BADCLASS, CRAWLER_NOTSTARTED, CRAWLER_ERROR }; int start_item_crawler_thread(void); #define CRAWLER_WAIT true #define CRAWLER_NOWAIT false int stop_item_crawler_thread(bool wait); int init_lru_crawler(void *arg); enum crawler_result_type lru_crawler_crawl(char *slabs, enum crawler_run_type, void *c, const int sfd, unsigned int remaining); int lru_crawler_start(uint8_t *ids, uint32_t remaining, const enum crawler_run_type type, void *data, void *c, const int sfd); void lru_crawler_pause(void); void lru_crawler_resume(void); #endif chibicc-1.0.24/test/crc32.c000077500000000000000000000765111517770275000152510ustar00rootroot00000000000000/* crc32.c -- compute the CRC-32 of a data stream * Copyright (C) 1995-2022 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h * * This interleaved implementation of a CRC makes use of pipelined multiple * arithmetic-logic units, commonly found in modern CPU cores. It is due to * Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution. */ /* @(#) $Id$ */ /* Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore protection on the static variables used to control the first-use generation of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should first call get_crc_table() to initialize the tables before allowing more than one thread to use crc32(). MAKECRCH can be #defined to write out crc32.h. A main() routine is also produced, so that this one source file can be compiled to an executable. */ #include "test.h" #ifdef MAKECRCH #include #ifndef DYNAMIC_CRC_TABLE #define DYNAMIC_CRC_TABLE #endif /* !DYNAMIC_CRC_TABLE */ #endif /* MAKECRCH */ #include "zutil.h" /* for Z_U4, Z_U8, z_crc_t, and FAR definitions */ /* A CRC of a message is computed on N braids of words in the message, where each word consists of W bytes (4 or 8). If N is 3, for example, then three running sparse CRCs are calculated respectively on each braid, at these indices in the array of words: 0, 3, 6, ..., 1, 4, 7, ..., and 2, 5, 8, ... This is done starting at a word boundary, and continues until as many blocks of N * W bytes as are available have been processed. The results are combined into a single CRC at the end. For this code, N must be in the range 1..6 and W must be 4 or 8. The upper limit on N can be increased if desired by adding more #if blocks, extending the patterns apparent in the code. In addition, crc32.h would need to be regenerated, if the maximum N value is increased. N and W are chosen empirically by benchmarking the execution time on a given processor. The choices for N and W below were based on testing on Intel Kaby Lake i7, AMD Ryzen 7, ARM Cortex-A57, Sparc64-VII, PowerPC POWER9, and MIPS64 Octeon II processors. The Intel, AMD, and ARM processors were all fastest with N=5, W=8. The Sparc, PowerPC, and MIPS64 were all fastest at N=5, W=4. They were all tested with either gcc or clang, all using the -O3 optimization level. Your mileage may vary. */ /* Define N */ #ifdef Z_TESTN #define N Z_TESTN #else #define N 5 #endif #if N < 1 || N > 6 #error N must be in 1..6 #endif /* z_crc_t must be at least 32 bits. z_word_t must be at least as long as z_crc_t. It is assumed here that z_word_t is either 32 bits or 64 bits, and that bytes are eight bits. */ /* Define W and the associated z_word_t type. If W is not defined, then a braided calculation is not used, and the associated tables and code are not compiled. */ #ifdef Z_TESTW #if Z_TESTW - 1 != -1 #define W Z_TESTW #endif #else #ifdef MAKECRCH #define W 8 /* required for MAKECRCH */ #else #if defined(__x86_64__) || defined(__aarch64__) #define W 8 #else #define W 4 #endif #endif #endif #ifdef W #if W == 8 && defined(Z_U8) typedef Z_U8 z_word_t; #elif defined(Z_U4) #undef W #define W 4 typedef Z_U4 z_word_t; #else #undef W #endif #endif /* Local functions. */ local z_crc_t multmodp OF((z_crc_t a, z_crc_t b)); local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); /* If available, use the ARM processor CRC32 instruction. */ #if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 #define ARMCRC32 #endif #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) /* Swap the bytes in a z_word_t to convert between little and big endian. Any self-respecting compiler will optimize this to a single machine byte-swap instruction, if one is available. This assumes that word_t is either 32 bits or 64 bits. */ local z_word_t byte_swap(word) z_word_t word; { #if W == 8 return (word & 0xff00000000000000) >> 56 | (word & 0xff000000000000) >> 40 | (word & 0xff0000000000) >> 24 | (word & 0xff00000000) >> 8 | (word & 0xff000000) << 8 | (word & 0xff0000) << 24 | (word & 0xff00) << 40 | (word & 0xff) << 56; #else /* W == 4 */ return (word & 0xff000000) >> 24 | (word & 0xff0000) >> 8 | (word & 0xff00) << 8 | (word & 0xff) << 24; #endif } #endif /* CRC polynomial. */ #define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */ #ifdef DYNAMIC_CRC_TABLE local z_crc_t FAR crc_table[256]; local z_crc_t FAR x2n_table[32]; local void make_crc_table OF((void)); #ifdef W local z_word_t FAR crc_big_table[256]; local z_crc_t FAR crc_braid_table[W][256]; local z_word_t FAR crc_braid_big_table[W][256]; local void braid OF((z_crc_t[][256], z_word_t[][256], int, int)); #endif #ifdef MAKECRCH local void write_table OF((FILE *, const z_crc_t FAR *, int)); local void write_table32hi OF((FILE *, const z_word_t FAR *, int)); local void write_table64 OF((FILE *, const z_word_t FAR *, int)); #endif /* MAKECRCH */ /* Define a once() function depending on the availability of atomics. If this is compiled with DYNAMIC_CRC_TABLE defined, and if CRCs will be computed in multiple threads, and if atomics are not available, then get_crc_table() must be called to initialize the tables and must return before any threads are allowed to compute or combine CRCs. */ /* Definition of once functionality. */ typedef struct once_s once_t; local void once OF((once_t *, void (*)(void))); /* Check for the availability of atomics. */ #if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \ !defined(__STDC_NO_ATOMICS__) #include /* Structure for once(), which must be initialized with ONCE_INIT. */ struct once_s { atomic_flag begun; atomic_int done; }; #define ONCE_INIT \ { \ ATOMIC_FLAG_INIT, 0 \ } /* Run the provided init() function exactly once, even if multiple threads invoke once() at the same time. The state must be a once_t initialized with ONCE_INIT. */ local void once(state, init) once_t *state; void (*init)(void); { if (!atomic_load(&state->done)) { if (atomic_flag_test_and_set(&state->begun)) while (!atomic_load(&state->done)) ; else { init(); atomic_store(&state->done, 1); } } } #else /* no atomics */ /* Structure for once(), which must be initialized with ONCE_INIT. */ struct once_s { volatile int begun; volatile int done; }; #define ONCE_INIT \ { \ 0, 0 \ } /* Test and set. Alas, not atomic, but tries to minimize the period of vulnerability. */ local int test_and_set OF((int volatile *)); local int test_and_set(flag) int volatile *flag; { int was; was = *flag; *flag = 1; return was; } /* Run the provided init() function once. This is not thread-safe. */ local void once(state, init) once_t *state; void (*init)(void); { if (!state->done) { if (test_and_set(&state->begun)) while (!state->done) ; else { init(); state->done = 1; } } } #endif /* State for once(). */ local once_t made = ONCE_INIT; /* Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. Polynomials over GF(2) are represented in binary, one bit per coefficient, with the lowest powers in the most significant bit. Then adding polynomials is just exclusive-or, and multiplying a polynomial by x is a right shift by one. If we call the above polynomial p, and represent a byte as the polynomial q, also with the lowest power in the most significant bit (so the byte 0xb1 is the polynomial x^7+x^3+x^2+1), then the CRC is (q*x^32) mod p, where a mod b means the remainder after dividing a by b. This calculation is done using the shift-register method of multiplying and taking the remainder. The register is initialized to zero, and for each incoming bit, x^32 is added mod p to the register if the bit is a one (where x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by x (which is shifting right by one and adding x^32 mod p if the bit shifted out is a one). We start with the highest power (least significant bit) of q and repeat for all eight bits of q. The table is simply the CRC of all possible eight bit values. This is all the information needed to generate CRCs on data a byte at a time for all combinations of CRC register values and incoming bytes. */ local void make_crc_table() { unsigned i, j, n; z_crc_t p; /* initialize the CRC of bytes tables */ for (i = 0; i < 256; i++) { p = i; for (j = 0; j < 8; j++) p = p & 1 ? (p >> 1) ^ POLY : p >> 1; crc_table[i] = p; #ifdef W crc_big_table[i] = byte_swap(p); #endif } /* initialize the x^2^n mod p(x) table */ p = (z_crc_t)1 << 30; /* x^1 */ x2n_table[0] = p; for (n = 1; n < 32; n++) x2n_table[n] = p = multmodp(p, p); #ifdef W /* initialize the braiding tables -- needs x2n_table[] */ braid(crc_braid_table, crc_braid_big_table, N, W); #endif #ifdef MAKECRCH { /* The crc32.h header file contains tables for both 32-bit and 64-bit z_word_t's, and so requires a 64-bit type be available. In that case, z_word_t must be defined to be 64-bits. This code then also generates and writes out the tables for the case that z_word_t is 32 bits. */ #if !defined(W) || W != 8 #error Need a 64-bit integer type in order to generate crc32.h. #endif FILE *out; int k, n; z_crc_t ltl[8][256]; z_word_t big[8][256]; out = fopen("crc32.h", "w"); if (out == NULL) return; /* write out little-endian CRC table to crc32.h */ fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n" " * Generated automatically by crc32.c\n */\n" "\n" "local const z_crc_t FAR crc_table[] = {\n" " "); write_table(out, crc_table, 256); fprintf(out, "};\n"); /* write out big-endian CRC table for 64-bit z_word_t to crc32.h */ fprintf(out, "\n" "#ifdef W\n" "\n" "#if W == 8\n" "\n" "local const z_word_t FAR crc_big_table[] = {\n" " "); write_table64(out, crc_big_table, 256); fprintf(out, "};\n"); /* write out big-endian CRC table for 32-bit z_word_t to crc32.h */ fprintf(out, "\n" "#else /* W == 4 */\n" "\n" "local const z_word_t FAR crc_big_table[] = {\n" " "); write_table32hi(out, crc_big_table, 256); fprintf(out, "};\n" "\n" "#endif\n"); /* write out braid tables for each value of N */ for (n = 1; n <= 6; n++) { fprintf(out, "\n" "#if N == %d\n", n); /* compute braid tables for this N and 64-bit word_t */ braid(ltl, big, n, 8); /* write out braid tables for 64-bit z_word_t to crc32.h */ fprintf(out, "\n" "#if W == 8\n" "\n" "local const z_crc_t FAR crc_braid_table[][256] = {\n"); for (k = 0; k < 8; k++) { fprintf(out, " {"); write_table(out, ltl[k], 256); fprintf(out, "}%s", k < 7 ? ",\n" : ""); } fprintf(out, "};\n" "\n" "local const z_word_t FAR crc_braid_big_table[][256] = {\n"); for (k = 0; k < 8; k++) { fprintf(out, " {"); write_table64(out, big[k], 256); fprintf(out, "}%s", k < 7 ? ",\n" : ""); } fprintf(out, "};\n"); /* compute braid tables for this N and 32-bit word_t */ braid(ltl, big, n, 4); /* write out braid tables for 32-bit z_word_t to crc32.h */ fprintf(out, "\n" "#else /* W == 4 */\n" "\n" "local const z_crc_t FAR crc_braid_table[][256] = {\n"); for (k = 0; k < 4; k++) { fprintf(out, " {"); write_table(out, ltl[k], 256); fprintf(out, "}%s", k < 3 ? ",\n" : ""); } fprintf(out, "};\n" "\n" "local const z_word_t FAR crc_braid_big_table[][256] = {\n"); for (k = 0; k < 4; k++) { fprintf(out, " {"); write_table32hi(out, big[k], 256); fprintf(out, "}%s", k < 3 ? ",\n" : ""); } fprintf(out, "};\n" "\n" "#endif\n" "\n" "#endif\n"); } fprintf(out, "\n" "#endif\n"); /* write out zeros operator table to crc32.h */ fprintf(out, "\n" "local const z_crc_t FAR x2n_table[] = {\n" " "); write_table(out, x2n_table, 32); fprintf(out, "};\n"); fclose(out); } #endif /* MAKECRCH */ } #ifdef MAKECRCH /* Write the 32-bit values in table[0..k-1] to out, five per line in hexadecimal separated by commas. */ local void write_table(out, table, k) FILE *out; const z_crc_t FAR *table; int k; { int n; for (n = 0; n < k; n++) fprintf(out, "%s0x%08lx%s", n == 0 || n % 5 ? "" : " ", (unsigned long)(table[n]), n == k - 1 ? "" : (n % 5 == 4 ? ",\n" : ", ")); } /* Write the high 32-bits of each value in table[0..k-1] to out, five per line in hexadecimal separated by commas. */ local void write_table32hi(out, table, k) FILE *out; const z_word_t FAR *table; int k; { int n; for (n = 0; n < k; n++) fprintf(out, "%s0x%08lx%s", n == 0 || n % 5 ? "" : " ", (unsigned long)(table[n] >> 32), n == k - 1 ? "" : (n % 5 == 4 ? ",\n" : ", ")); } /* Write the 64-bit values in table[0..k-1] to out, three per line in hexadecimal separated by commas. This assumes that if there is a 64-bit type, then there is also a long long integer type, and it is at least 64 bits. If not, then the type cast and format string can be adjusted accordingly. */ local void write_table64(out, table, k) FILE *out; const z_word_t FAR *table; int k; { int n; for (n = 0; n < k; n++) fprintf(out, "%s0x%016llx%s", n == 0 || n % 3 ? "" : " ", (unsigned long long)(table[n]), n == k - 1 ? "" : (n % 3 == 2 ? ",\n" : ", ")); } /* Actually do the deed. */ int main() { make_crc_table(); return 0; } #endif /* MAKECRCH */ #ifdef W /* Generate the little and big-endian braid tables for the given n and z_word_t size w. Each array must have room for w blocks of 256 elements. */ local void braid(ltl, big, n, w) z_crc_t ltl[][256]; z_word_t big[][256]; int n; int w; { int k; z_crc_t i, p, q; for (k = 0; k < w; k++) { p = x2nmodp((n * w + 3 - k) << 3, 0); ltl[k][0] = 0; big[w - 1 - k][0] = 0; for (i = 1; i < 256; i++) { ltl[k][i] = q = multmodp(i << 24, p); big[w - 1 - k][i] = byte_swap(q); } } } #endif #else /* !DYNAMIC_CRC_TABLE */ /* * Tables for byte-wise and braided CRC-32 calculations, and a table of powers * of x for combining CRC-32s, all made by make_crc_table(). */ #include "crc32.h" #endif /* DYNAMIC_CRC_TABLE */ /* * Routines used for CRC calculation. Some are also required for the table * generation above. */ /* Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, reflected. For speed, this requires that a not be zero. */ local z_crc_t multmodp(a, b) z_crc_t a; z_crc_t b; { z_crc_t m, p; m = (z_crc_t)1 << 31; p = 0; for (;;) { if (a & m) { p ^= b; if ((a & (m - 1)) == 0) break; } m >>= 1; b = b & 1 ? (b >> 1) ^ POLY : b >> 1; } return p; } /* Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been initialized. */ local z_crc_t x2nmodp(n, k) z_off64_t n; unsigned k; { z_crc_t p; p = (z_crc_t)1 << 31; /* x^0 == 1 */ while (n) { if (n & 1) p = multmodp(x2n_table[k & 31], p); n >>= 1; k++; } return p; } /* * This function can be used by asm versions of crc32(), and to force the * generation of the CRC tables in a threaded application. */ const z_crc_t FAR *ZEXPORT get_crc_table() { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ return (const z_crc_t FAR *)crc_table; } /* * Use ARM machine instructions if available. This will compute the CRC about * ten times faster than the braided calculation. This code does not check for * the presence of the CRC instruction at run time. __ARM_FEATURE_CRC32 will * only be defined if the compilation specifies an ARM processor architecture * that has the instructions. For example, compiling with -march=armv8.1-a or * -march=armv8-a+crc, or -march=native if the compile machine has the crc32 * instructions. */ #ifdef ARMCRC32 /* Constants empirically determined to maximize speed. These values are from measurements on a Cortex-A57. Your mileage may vary. */ #define Z_BATCH 3990 /* number of words in a batch */ #define Z_BATCH_ZEROS 0xa10d3d0c /* computed from Z_BATCH = 3990 */ #define Z_BATCH_MIN 800 /* fewest words in a final batch */ unsigned long ZEXPORT crc32_z(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; z_size_t len; { z_crc_t val; z_word_t crc1, crc2; const z_word_t *word; z_word_t val0, val1, val2; z_size_t last, last2, i; z_size_t num; /* Return initial CRC, if requested. */ if (buf == Z_NULL) return 0; #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ /* Pre-condition the CRC */ crc ^= 0xffffffff; /* Compute the CRC up to a word boundary. */ while (len && ((z_size_t)buf & 7) != 0) { len--; val = *buf++; __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val)); } /* Prepare to compute the CRC on full 64-bit words word[0..num-1]. */ word = (z_word_t const *)buf; num = len >> 3; len &= 7; /* Do three interleaved CRCs to realize the throughput of one crc32x instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three CRCs are combined into a single CRC after each set of batches. */ while (num >= 3 * Z_BATCH) { crc1 = 0; crc2 = 0; for (i = 0; i < Z_BATCH; i++) { val0 = word[i]; val1 = word[i + Z_BATCH]; val2 = word[i + 2 * Z_BATCH]; __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0)); __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc1) : "r"(val1)); __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc2) : "r"(val2)); } word += 3 * Z_BATCH; num -= 3 * Z_BATCH; crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc1; crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc2; } /* Do one last smaller batch with the remaining words, if there are enough to pay for the combination of CRCs. */ last = num / 3; if (last >= Z_BATCH_MIN) { last2 = last << 1; crc1 = 0; crc2 = 0; for (i = 0; i < last; i++) { val0 = word[i]; val1 = word[i + last]; val2 = word[i + last2]; __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0)); __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc1) : "r"(val1)); __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc2) : "r"(val2)); } word += 3 * last; num -= 3 * last; val = x2nmodp(last, 6); crc = multmodp(val, crc) ^ crc1; crc = multmodp(val, crc) ^ crc2; } /* Compute the CRC on any remaining words. */ for (i = 0; i < num; i++) { val0 = word[i]; __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0)); } word += num; /* Complete the CRC on any remaining bytes. */ buf = (const unsigned char FAR *)word; while (len) { len--; val = *buf++; __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val)); } /* Return the CRC, post-conditioned. */ return crc ^ 0xffffffff; } #else #ifdef W /* Return the CRC of the W bytes in the word_t data, taking the least-significant byte of the word as the first byte of data, without any pre or post conditioning. This is used to combine the CRCs of each braid. */ local z_crc_t crc_word(data) z_word_t data; { int k; for (k = 0; k < W; k++) data = (data >> 8) ^ crc_table[data & 0xff]; return (z_crc_t)data; } local z_word_t crc_word_big(data) z_word_t data; { int k; for (k = 0; k < W; k++) data = (data << 8) ^ crc_big_table[(data >> ((W - 1) << 3)) & 0xff]; return data; } #endif unsigned long ZEXPORT crc32_z(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; z_size_t len; { /* Return initial CRC, if requested. */ if (buf == Z_NULL) return 0; #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ /* Pre-condition the CRC */ crc ^= 0xffffffff; #ifdef W /* If provided enough bytes, do a braided CRC calculation. */ if (len >= N * W + W - 1) { z_size_t blks; z_word_t const *words; unsigned endian; int k; /* Compute the CRC up to a z_word_t boundary. */ while (len && ((z_size_t)buf & (W - 1)) != 0) { len--; crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; } /* Compute the CRC on as many N z_word_t blocks as are available. */ blks = len / (N * W); len -= blks * N * W; words = (z_word_t const *)buf; /* Do endian check at execution time instead of compile time, since ARM processors can change the endianess at execution time. If the compiler knows what the endianess will be, it can optimize out the check and the unused branch. */ endian = 1; if (*(unsigned char *)&endian) { /* Little endian. */ z_crc_t crc0; z_word_t word0; #if N > 1 z_crc_t crc1; z_word_t word1; #if N > 2 z_crc_t crc2; z_word_t word2; #if N > 3 z_crc_t crc3; z_word_t word3; #if N > 4 z_crc_t crc4; z_word_t word4; #if N > 5 z_crc_t crc5; z_word_t word5; #endif #endif #endif #endif #endif /* Initialize the CRC for each braid. */ crc0 = crc; #if N > 1 crc1 = 0; #if N > 2 crc2 = 0; #if N > 3 crc3 = 0; #if N > 4 crc4 = 0; #if N > 5 crc5 = 0; #endif #endif #endif #endif #endif /* Process the first blks-1 blocks, computing the CRCs on each braid independently. */ while (--blks) { /* Load the word for each braid into registers. */ word0 = crc0 ^ words[0]; #if N > 1 word1 = crc1 ^ words[1]; #if N > 2 word2 = crc2 ^ words[2]; #if N > 3 word3 = crc3 ^ words[3]; #if N > 4 word4 = crc4 ^ words[4]; #if N > 5 word5 = crc5 ^ words[5]; #endif #endif #endif #endif #endif words += N; /* Compute and update the CRC for each word. The loop should get unrolled. */ crc0 = crc_braid_table[0][word0 & 0xff]; #if N > 1 crc1 = crc_braid_table[0][word1 & 0xff]; #if N > 2 crc2 = crc_braid_table[0][word2 & 0xff]; #if N > 3 crc3 = crc_braid_table[0][word3 & 0xff]; #if N > 4 crc4 = crc_braid_table[0][word4 & 0xff]; #if N > 5 crc5 = crc_braid_table[0][word5 & 0xff]; #endif #endif #endif #endif #endif for (k = 1; k < W; k++) { crc0 ^= crc_braid_table[k][(word0 >> (k << 3)) & 0xff]; #if N > 1 crc1 ^= crc_braid_table[k][(word1 >> (k << 3)) & 0xff]; #if N > 2 crc2 ^= crc_braid_table[k][(word2 >> (k << 3)) & 0xff]; #if N > 3 crc3 ^= crc_braid_table[k][(word3 >> (k << 3)) & 0xff]; #if N > 4 crc4 ^= crc_braid_table[k][(word4 >> (k << 3)) & 0xff]; #if N > 5 crc5 ^= crc_braid_table[k][(word5 >> (k << 3)) & 0xff]; #endif #endif #endif #endif #endif } } /* Process the last block, combining the CRCs of the N braids at the same time. */ crc = crc_word(crc0 ^ words[0]); #if N > 1 crc = crc_word(crc1 ^ words[1] ^ crc); #if N > 2 crc = crc_word(crc2 ^ words[2] ^ crc); #if N > 3 crc = crc_word(crc3 ^ words[3] ^ crc); #if N > 4 crc = crc_word(crc4 ^ words[4] ^ crc); #if N > 5 crc = crc_word(crc5 ^ words[5] ^ crc); #endif #endif #endif #endif #endif words += N; } else { /* Big endian. */ z_word_t crc0, word0, comb; #if N > 1 z_word_t crc1, word1; #if N > 2 z_word_t crc2, word2; #if N > 3 z_word_t crc3, word3; #if N > 4 z_word_t crc4, word4; #if N > 5 z_word_t crc5, word5; #endif #endif #endif #endif #endif /* Initialize the CRC for each braid. */ crc0 = byte_swap(crc); #if N > 1 crc1 = 0; #if N > 2 crc2 = 0; #if N > 3 crc3 = 0; #if N > 4 crc4 = 0; #if N > 5 crc5 = 0; #endif #endif #endif #endif #endif /* Process the first blks-1 blocks, computing the CRCs on each braid independently. */ while (--blks) { /* Load the word for each braid into registers. */ word0 = crc0 ^ words[0]; #if N > 1 word1 = crc1 ^ words[1]; #if N > 2 word2 = crc2 ^ words[2]; #if N > 3 word3 = crc3 ^ words[3]; #if N > 4 word4 = crc4 ^ words[4]; #if N > 5 word5 = crc5 ^ words[5]; #endif #endif #endif #endif #endif words += N; /* Compute and update the CRC for each word. The loop should get unrolled. */ crc0 = crc_braid_big_table[0][word0 & 0xff]; #if N > 1 crc1 = crc_braid_big_table[0][word1 & 0xff]; #if N > 2 crc2 = crc_braid_big_table[0][word2 & 0xff]; #if N > 3 crc3 = crc_braid_big_table[0][word3 & 0xff]; #if N > 4 crc4 = crc_braid_big_table[0][word4 & 0xff]; #if N > 5 crc5 = crc_braid_big_table[0][word5 & 0xff]; #endif #endif #endif #endif #endif for (k = 1; k < W; k++) { crc0 ^= crc_braid_big_table[k][(word0 >> (k << 3)) & 0xff]; #if N > 1 crc1 ^= crc_braid_big_table[k][(word1 >> (k << 3)) & 0xff]; #if N > 2 crc2 ^= crc_braid_big_table[k][(word2 >> (k << 3)) & 0xff]; #if N > 3 crc3 ^= crc_braid_big_table[k][(word3 >> (k << 3)) & 0xff]; #if N > 4 crc4 ^= crc_braid_big_table[k][(word4 >> (k << 3)) & 0xff]; #if N > 5 crc5 ^= crc_braid_big_table[k][(word5 >> (k << 3)) & 0xff]; #endif #endif #endif #endif #endif } } /* Process the last block, combining the CRCs of the N braids at the same time. */ comb = crc_word_big(crc0 ^ words[0]); #if N > 1 comb = crc_word_big(crc1 ^ words[1] ^ comb); #if N > 2 comb = crc_word_big(crc2 ^ words[2] ^ comb); #if N > 3 comb = crc_word_big(crc3 ^ words[3] ^ comb); #if N > 4 comb = crc_word_big(crc4 ^ words[4] ^ comb); #if N > 5 comb = crc_word_big(crc5 ^ words[5] ^ comb); #endif #endif #endif #endif #endif words += N; crc = byte_swap(comb); } /* Update the pointer to the remaining bytes to process. */ buf = (unsigned char const *)words; } #endif /* W */ /* Complete the computation of the CRC on any remaining bytes. */ while (len >= 8) { len -= 8; crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; } while (len) { len--; crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff]; } /* Return the CRC, post-conditioned. */ return crc ^ 0xffffffff; } #endif unsigned long ZEXPORT crc32(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; uInt len; { return crc32_z(crc, buf, len); } uLong ZEXPORT crc32_combine64(crc1, crc2, len2) uLong crc1; uLong crc2; z_off64_t len2; { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ return multmodp(x2nmodp(len2, 3), crc1) ^ crc2; } uLong ZEXPORT crc32_combine(crc1, crc2, len2) uLong crc1; uLong crc2; z_off_t len2; { return crc32_combine64(crc1, crc2, len2); } uLong ZEXPORT crc32_combine_gen64(len2) z_off64_t len2; { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ return x2nmodp(len2, 3); } uLong ZEXPORT crc32_combine_gen(len2) z_off_t len2; { return crc32_combine_gen64(len2); } uLong crc32_combine_op(crc1, crc2, op) uLong crc1; uLong crc2; uLong op; { return multmodp(op, crc1) ^ crc2; } int main() { uLong a = 12, b = 17, c = 15, d = 0; d = crc32_combine_op(a, b, c); printf("d=%ld\n", d); ASSERT(686661317, d); return 0; }chibicc-1.0.24/test/crc32.h000077500000000000000000022036051517770275000152540ustar00rootroot00000000000000/* crc32.h -- tables for rapid CRC calculation * Generated automatically by crc32.c */ local const z_crc_t FAR crc_table[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d}; #ifdef W #if W == 8 local const z_word_t FAR crc_big_table[] = { 0x0000000000000000, 0x9630077700000000, 0x2c610eee00000000, 0xba51099900000000, 0x19c46d0700000000, 0x8ff46a7000000000, 0x35a563e900000000, 0xa395649e00000000, 0x3288db0e00000000, 0xa4b8dc7900000000, 0x1ee9d5e000000000, 0x88d9d29700000000, 0x2b4cb60900000000, 0xbd7cb17e00000000, 0x072db8e700000000, 0x911dbf9000000000, 0x6410b71d00000000, 0xf220b06a00000000, 0x4871b9f300000000, 0xde41be8400000000, 0x7dd4da1a00000000, 0xebe4dd6d00000000, 0x51b5d4f400000000, 0xc785d38300000000, 0x56986c1300000000, 0xc0a86b6400000000, 0x7af962fd00000000, 0xecc9658a00000000, 0x4f5c011400000000, 0xd96c066300000000, 0x633d0ffa00000000, 0xf50d088d00000000, 0xc8206e3b00000000, 0x5e10694c00000000, 0xe44160d500000000, 0x727167a200000000, 0xd1e4033c00000000, 0x47d4044b00000000, 0xfd850dd200000000, 0x6bb50aa500000000, 0xfaa8b53500000000, 0x6c98b24200000000, 0xd6c9bbdb00000000, 0x40f9bcac00000000, 0xe36cd83200000000, 0x755cdf4500000000, 0xcf0dd6dc00000000, 0x593dd1ab00000000, 0xac30d92600000000, 0x3a00de5100000000, 0x8051d7c800000000, 0x1661d0bf00000000, 0xb5f4b42100000000, 0x23c4b35600000000, 0x9995bacf00000000, 0x0fa5bdb800000000, 0x9eb8022800000000, 0x0888055f00000000, 0xb2d90cc600000000, 0x24e90bb100000000, 0x877c6f2f00000000, 0x114c685800000000, 0xab1d61c100000000, 0x3d2d66b600000000, 0x9041dc7600000000, 0x0671db0100000000, 0xbc20d29800000000, 0x2a10d5ef00000000, 0x8985b17100000000, 0x1fb5b60600000000, 0xa5e4bf9f00000000, 0x33d4b8e800000000, 0xa2c9077800000000, 0x34f9000f00000000, 0x8ea8099600000000, 0x18980ee100000000, 0xbb0d6a7f00000000, 0x2d3d6d0800000000, 0x976c649100000000, 0x015c63e600000000, 0xf4516b6b00000000, 0x62616c1c00000000, 0xd830658500000000, 0x4e0062f200000000, 0xed95066c00000000, 0x7ba5011b00000000, 0xc1f4088200000000, 0x57c40ff500000000, 0xc6d9b06500000000, 0x50e9b71200000000, 0xeab8be8b00000000, 0x7c88b9fc00000000, 0xdf1ddd6200000000, 0x492dda1500000000, 0xf37cd38c00000000, 0x654cd4fb00000000, 0x5861b24d00000000, 0xce51b53a00000000, 0x7400bca300000000, 0xe230bbd400000000, 0x41a5df4a00000000, 0xd795d83d00000000, 0x6dc4d1a400000000, 0xfbf4d6d300000000, 0x6ae9694300000000, 0xfcd96e3400000000, 0x468867ad00000000, 0xd0b860da00000000, 0x732d044400000000, 0xe51d033300000000, 0x5f4c0aaa00000000, 0xc97c0ddd00000000, 0x3c71055000000000, 0xaa41022700000000, 0x10100bbe00000000, 0x86200cc900000000, 0x25b5685700000000, 0xb3856f2000000000, 0x09d466b900000000, 0x9fe461ce00000000, 0x0ef9de5e00000000, 0x98c9d92900000000, 0x2298d0b000000000, 0xb4a8d7c700000000, 0x173db35900000000, 0x810db42e00000000, 0x3b5cbdb700000000, 0xad6cbac000000000, 0x2083b8ed00000000, 0xb6b3bf9a00000000, 0x0ce2b60300000000, 0x9ad2b17400000000, 0x3947d5ea00000000, 0xaf77d29d00000000, 0x1526db0400000000, 0x8316dc7300000000, 0x120b63e300000000, 0x843b649400000000, 0x3e6a6d0d00000000, 0xa85a6a7a00000000, 0x0bcf0ee400000000, 0x9dff099300000000, 0x27ae000a00000000, 0xb19e077d00000000, 0x44930ff000000000, 0xd2a3088700000000, 0x68f2011e00000000, 0xfec2066900000000, 0x5d5762f700000000, 0xcb67658000000000, 0x71366c1900000000, 0xe7066b6e00000000, 0x761bd4fe00000000, 0xe02bd38900000000, 0x5a7ada1000000000, 0xcc4add6700000000, 0x6fdfb9f900000000, 0xf9efbe8e00000000, 0x43beb71700000000, 0xd58eb06000000000, 0xe8a3d6d600000000, 0x7e93d1a100000000, 0xc4c2d83800000000, 0x52f2df4f00000000, 0xf167bbd100000000, 0x6757bca600000000, 0xdd06b53f00000000, 0x4b36b24800000000, 0xda2b0dd800000000, 0x4c1b0aaf00000000, 0xf64a033600000000, 0x607a044100000000, 0xc3ef60df00000000, 0x55df67a800000000, 0xef8e6e3100000000, 0x79be694600000000, 0x8cb361cb00000000, 0x1a8366bc00000000, 0xa0d26f2500000000, 0x36e2685200000000, 0x95770ccc00000000, 0x03470bbb00000000, 0xb916022200000000, 0x2f26055500000000, 0xbe3bbac500000000, 0x280bbdb200000000, 0x925ab42b00000000, 0x046ab35c00000000, 0xa7ffd7c200000000, 0x31cfd0b500000000, 0x8b9ed92c00000000, 0x1daede5b00000000, 0xb0c2649b00000000, 0x26f263ec00000000, 0x9ca36a7500000000, 0x0a936d0200000000, 0xa906099c00000000, 0x3f360eeb00000000, 0x8567077200000000, 0x1357000500000000, 0x824abf9500000000, 0x147ab8e200000000, 0xae2bb17b00000000, 0x381bb60c00000000, 0x9b8ed29200000000, 0x0dbed5e500000000, 0xb7efdc7c00000000, 0x21dfdb0b00000000, 0xd4d2d38600000000, 0x42e2d4f100000000, 0xf8b3dd6800000000, 0x6e83da1f00000000, 0xcd16be8100000000, 0x5b26b9f600000000, 0xe177b06f00000000, 0x7747b71800000000, 0xe65a088800000000, 0x706a0fff00000000, 0xca3b066600000000, 0x5c0b011100000000, 0xff9e658f00000000, 0x69ae62f800000000, 0xd3ff6b6100000000, 0x45cf6c1600000000, 0x78e20aa000000000, 0xeed20dd700000000, 0x5483044e00000000, 0xc2b3033900000000, 0x612667a700000000, 0xf71660d000000000, 0x4d47694900000000, 0xdb776e3e00000000, 0x4a6ad1ae00000000, 0xdc5ad6d900000000, 0x660bdf4000000000, 0xf03bd83700000000, 0x53aebca900000000, 0xc59ebbde00000000, 0x7fcfb24700000000, 0xe9ffb53000000000, 0x1cf2bdbd00000000, 0x8ac2baca00000000, 0x3093b35300000000, 0xa6a3b42400000000, 0x0536d0ba00000000, 0x9306d7cd00000000, 0x2957de5400000000, 0xbf67d92300000000, 0x2e7a66b300000000, 0xb84a61c400000000, 0x021b685d00000000, 0x942b6f2a00000000, 0x37be0bb400000000, 0xa18e0cc300000000, 0x1bdf055a00000000, 0x8def022d00000000}; #else /* W == 4 */ local const z_word_t FAR crc_big_table[] = { 0x00000000, 0x96300777, 0x2c610eee, 0xba510999, 0x19c46d07, 0x8ff46a70, 0x35a563e9, 0xa395649e, 0x3288db0e, 0xa4b8dc79, 0x1ee9d5e0, 0x88d9d297, 0x2b4cb609, 0xbd7cb17e, 0x072db8e7, 0x911dbf90, 0x6410b71d, 0xf220b06a, 0x4871b9f3, 0xde41be84, 0x7dd4da1a, 0xebe4dd6d, 0x51b5d4f4, 0xc785d383, 0x56986c13, 0xc0a86b64, 0x7af962fd, 0xecc9658a, 0x4f5c0114, 0xd96c0663, 0x633d0ffa, 0xf50d088d, 0xc8206e3b, 0x5e10694c, 0xe44160d5, 0x727167a2, 0xd1e4033c, 0x47d4044b, 0xfd850dd2, 0x6bb50aa5, 0xfaa8b535, 0x6c98b242, 0xd6c9bbdb, 0x40f9bcac, 0xe36cd832, 0x755cdf45, 0xcf0dd6dc, 0x593dd1ab, 0xac30d926, 0x3a00de51, 0x8051d7c8, 0x1661d0bf, 0xb5f4b421, 0x23c4b356, 0x9995bacf, 0x0fa5bdb8, 0x9eb80228, 0x0888055f, 0xb2d90cc6, 0x24e90bb1, 0x877c6f2f, 0x114c6858, 0xab1d61c1, 0x3d2d66b6, 0x9041dc76, 0x0671db01, 0xbc20d298, 0x2a10d5ef, 0x8985b171, 0x1fb5b606, 0xa5e4bf9f, 0x33d4b8e8, 0xa2c90778, 0x34f9000f, 0x8ea80996, 0x18980ee1, 0xbb0d6a7f, 0x2d3d6d08, 0x976c6491, 0x015c63e6, 0xf4516b6b, 0x62616c1c, 0xd8306585, 0x4e0062f2, 0xed95066c, 0x7ba5011b, 0xc1f40882, 0x57c40ff5, 0xc6d9b065, 0x50e9b712, 0xeab8be8b, 0x7c88b9fc, 0xdf1ddd62, 0x492dda15, 0xf37cd38c, 0x654cd4fb, 0x5861b24d, 0xce51b53a, 0x7400bca3, 0xe230bbd4, 0x41a5df4a, 0xd795d83d, 0x6dc4d1a4, 0xfbf4d6d3, 0x6ae96943, 0xfcd96e34, 0x468867ad, 0xd0b860da, 0x732d0444, 0xe51d0333, 0x5f4c0aaa, 0xc97c0ddd, 0x3c710550, 0xaa410227, 0x10100bbe, 0x86200cc9, 0x25b56857, 0xb3856f20, 0x09d466b9, 0x9fe461ce, 0x0ef9de5e, 0x98c9d929, 0x2298d0b0, 0xb4a8d7c7, 0x173db359, 0x810db42e, 0x3b5cbdb7, 0xad6cbac0, 0x2083b8ed, 0xb6b3bf9a, 0x0ce2b603, 0x9ad2b174, 0x3947d5ea, 0xaf77d29d, 0x1526db04, 0x8316dc73, 0x120b63e3, 0x843b6494, 0x3e6a6d0d, 0xa85a6a7a, 0x0bcf0ee4, 0x9dff0993, 0x27ae000a, 0xb19e077d, 0x44930ff0, 0xd2a30887, 0x68f2011e, 0xfec20669, 0x5d5762f7, 0xcb676580, 0x71366c19, 0xe7066b6e, 0x761bd4fe, 0xe02bd389, 0x5a7ada10, 0xcc4add67, 0x6fdfb9f9, 0xf9efbe8e, 0x43beb717, 0xd58eb060, 0xe8a3d6d6, 0x7e93d1a1, 0xc4c2d838, 0x52f2df4f, 0xf167bbd1, 0x6757bca6, 0xdd06b53f, 0x4b36b248, 0xda2b0dd8, 0x4c1b0aaf, 0xf64a0336, 0x607a0441, 0xc3ef60df, 0x55df67a8, 0xef8e6e31, 0x79be6946, 0x8cb361cb, 0x1a8366bc, 0xa0d26f25, 0x36e26852, 0x95770ccc, 0x03470bbb, 0xb9160222, 0x2f260555, 0xbe3bbac5, 0x280bbdb2, 0x925ab42b, 0x046ab35c, 0xa7ffd7c2, 0x31cfd0b5, 0x8b9ed92c, 0x1daede5b, 0xb0c2649b, 0x26f263ec, 0x9ca36a75, 0x0a936d02, 0xa906099c, 0x3f360eeb, 0x85670772, 0x13570005, 0x824abf95, 0x147ab8e2, 0xae2bb17b, 0x381bb60c, 0x9b8ed292, 0x0dbed5e5, 0xb7efdc7c, 0x21dfdb0b, 0xd4d2d386, 0x42e2d4f1, 0xf8b3dd68, 0x6e83da1f, 0xcd16be81, 0x5b26b9f6, 0xe177b06f, 0x7747b718, 0xe65a0888, 0x706a0fff, 0xca3b0666, 0x5c0b0111, 0xff9e658f, 0x69ae62f8, 0xd3ff6b61, 0x45cf6c16, 0x78e20aa0, 0xeed20dd7, 0x5483044e, 0xc2b30339, 0x612667a7, 0xf71660d0, 0x4d476949, 0xdb776e3e, 0x4a6ad1ae, 0xdc5ad6d9, 0x660bdf40, 0xf03bd837, 0x53aebca9, 0xc59ebbde, 0x7fcfb247, 0xe9ffb530, 0x1cf2bdbd, 0x8ac2baca, 0x3093b353, 0xa6a3b424, 0x0536d0ba, 0x9306d7cd, 0x2957de54, 0xbf67d923, 0x2e7a66b3, 0xb84a61c4, 0x021b685d, 0x942b6f2a, 0x37be0bb4, 0xa18e0cc3, 0x1bdf055a, 0x8def022d}; #endif #if N == 1 #if W == 8 local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0xccaa009e, 0x4225077d, 0x8e8f07e3, 0x844a0efa, 0x48e00e64, 0xc66f0987, 0x0ac50919, 0xd3e51bb5, 0x1f4f1b2b, 0x91c01cc8, 0x5d6a1c56, 0x57af154f, 0x9b0515d1, 0x158a1232, 0xd92012ac, 0x7cbb312b, 0xb01131b5, 0x3e9e3656, 0xf23436c8, 0xf8f13fd1, 0x345b3f4f, 0xbad438ac, 0x767e3832, 0xaf5e2a9e, 0x63f42a00, 0xed7b2de3, 0x21d12d7d, 0x2b142464, 0xe7be24fa, 0x69312319, 0xa59b2387, 0xf9766256, 0x35dc62c8, 0xbb53652b, 0x77f965b5, 0x7d3c6cac, 0xb1966c32, 0x3f196bd1, 0xf3b36b4f, 0x2a9379e3, 0xe639797d, 0x68b67e9e, 0xa41c7e00, 0xaed97719, 0x62737787, 0xecfc7064, 0x205670fa, 0x85cd537d, 0x496753e3, 0xc7e85400, 0x0b42549e, 0x01875d87, 0xcd2d5d19, 0x43a25afa, 0x8f085a64, 0x562848c8, 0x9a824856, 0x140d4fb5, 0xd8a74f2b, 0xd2624632, 0x1ec846ac, 0x9047414f, 0x5ced41d1, 0x299dc2ed, 0xe537c273, 0x6bb8c590, 0xa712c50e, 0xadd7cc17, 0x617dcc89, 0xeff2cb6a, 0x2358cbf4, 0xfa78d958, 0x36d2d9c6, 0xb85dde25, 0x74f7debb, 0x7e32d7a2, 0xb298d73c, 0x3c17d0df, 0xf0bdd041, 0x5526f3c6, 0x998cf358, 0x1703f4bb, 0xdba9f425, 0xd16cfd3c, 0x1dc6fda2, 0x9349fa41, 0x5fe3fadf, 0x86c3e873, 0x4a69e8ed, 0xc4e6ef0e, 0x084cef90, 0x0289e689, 0xce23e617, 0x40ace1f4, 0x8c06e16a, 0xd0eba0bb, 0x1c41a025, 0x92cea7c6, 0x5e64a758, 0x54a1ae41, 0x980baedf, 0x1684a93c, 0xda2ea9a2, 0x030ebb0e, 0xcfa4bb90, 0x412bbc73, 0x8d81bced, 0x8744b5f4, 0x4beeb56a, 0xc561b289, 0x09cbb217, 0xac509190, 0x60fa910e, 0xee7596ed, 0x22df9673, 0x281a9f6a, 0xe4b09ff4, 0x6a3f9817, 0xa6959889, 0x7fb58a25, 0xb31f8abb, 0x3d908d58, 0xf13a8dc6, 0xfbff84df, 0x37558441, 0xb9da83a2, 0x7570833c, 0x533b85da, 0x9f918544, 0x111e82a7, 0xddb48239, 0xd7718b20, 0x1bdb8bbe, 0x95548c5d, 0x59fe8cc3, 0x80de9e6f, 0x4c749ef1, 0xc2fb9912, 0x0e51998c, 0x04949095, 0xc83e900b, 0x46b197e8, 0x8a1b9776, 0x2f80b4f1, 0xe32ab46f, 0x6da5b38c, 0xa10fb312, 0xabcaba0b, 0x6760ba95, 0xe9efbd76, 0x2545bde8, 0xfc65af44, 0x30cfafda, 0xbe40a839, 0x72eaa8a7, 0x782fa1be, 0xb485a120, 0x3a0aa6c3, 0xf6a0a65d, 0xaa4de78c, 0x66e7e712, 0xe868e0f1, 0x24c2e06f, 0x2e07e976, 0xe2ade9e8, 0x6c22ee0b, 0xa088ee95, 0x79a8fc39, 0xb502fca7, 0x3b8dfb44, 0xf727fbda, 0xfde2f2c3, 0x3148f25d, 0xbfc7f5be, 0x736df520, 0xd6f6d6a7, 0x1a5cd639, 0x94d3d1da, 0x5879d144, 0x52bcd85d, 0x9e16d8c3, 0x1099df20, 0xdc33dfbe, 0x0513cd12, 0xc9b9cd8c, 0x4736ca6f, 0x8b9ccaf1, 0x8159c3e8, 0x4df3c376, 0xc37cc495, 0x0fd6c40b, 0x7aa64737, 0xb60c47a9, 0x3883404a, 0xf42940d4, 0xfeec49cd, 0x32464953, 0xbcc94eb0, 0x70634e2e, 0xa9435c82, 0x65e95c1c, 0xeb665bff, 0x27cc5b61, 0x2d095278, 0xe1a352e6, 0x6f2c5505, 0xa386559b, 0x061d761c, 0xcab77682, 0x44387161, 0x889271ff, 0x825778e6, 0x4efd7878, 0xc0727f9b, 0x0cd87f05, 0xd5f86da9, 0x19526d37, 0x97dd6ad4, 0x5b776a4a, 0x51b26353, 0x9d1863cd, 0x1397642e, 0xdf3d64b0, 0x83d02561, 0x4f7a25ff, 0xc1f5221c, 0x0d5f2282, 0x079a2b9b, 0xcb302b05, 0x45bf2ce6, 0x89152c78, 0x50353ed4, 0x9c9f3e4a, 0x121039a9, 0xdeba3937, 0xd47f302e, 0x18d530b0, 0x965a3753, 0x5af037cd, 0xff6b144a, 0x33c114d4, 0xbd4e1337, 0x71e413a9, 0x7b211ab0, 0xb78b1a2e, 0x39041dcd, 0xf5ae1d53, 0x2c8e0fff, 0xe0240f61, 0x6eab0882, 0xa201081c, 0xa8c40105, 0x646e019b, 0xeae10678, 0x264b06e6}, {0x00000000, 0xa6770bb4, 0x979f1129, 0x31e81a9d, 0xf44f2413, 0x52382fa7, 0x63d0353a, 0xc5a73e8e, 0x33ef4e67, 0x959845d3, 0xa4705f4e, 0x020754fa, 0xc7a06a74, 0x61d761c0, 0x503f7b5d, 0xf64870e9, 0x67de9cce, 0xc1a9977a, 0xf0418de7, 0x56368653, 0x9391b8dd, 0x35e6b369, 0x040ea9f4, 0xa279a240, 0x5431d2a9, 0xf246d91d, 0xc3aec380, 0x65d9c834, 0xa07ef6ba, 0x0609fd0e, 0x37e1e793, 0x9196ec27, 0xcfbd399c, 0x69ca3228, 0x582228b5, 0xfe552301, 0x3bf21d8f, 0x9d85163b, 0xac6d0ca6, 0x0a1a0712, 0xfc5277fb, 0x5a257c4f, 0x6bcd66d2, 0xcdba6d66, 0x081d53e8, 0xae6a585c, 0x9f8242c1, 0x39f54975, 0xa863a552, 0x0e14aee6, 0x3ffcb47b, 0x998bbfcf, 0x5c2c8141, 0xfa5b8af5, 0xcbb39068, 0x6dc49bdc, 0x9b8ceb35, 0x3dfbe081, 0x0c13fa1c, 0xaa64f1a8, 0x6fc3cf26, 0xc9b4c492, 0xf85cde0f, 0x5e2bd5bb, 0x440b7579, 0xe27c7ecd, 0xd3946450, 0x75e36fe4, 0xb044516a, 0x16335ade, 0x27db4043, 0x81ac4bf7, 0x77e43b1e, 0xd19330aa, 0xe07b2a37, 0x460c2183, 0x83ab1f0d, 0x25dc14b9, 0x14340e24, 0xb2430590, 0x23d5e9b7, 0x85a2e203, 0xb44af89e, 0x123df32a, 0xd79acda4, 0x71edc610, 0x4005dc8d, 0xe672d739, 0x103aa7d0, 0xb64dac64, 0x87a5b6f9, 0x21d2bd4d, 0xe47583c3, 0x42028877, 0x73ea92ea, 0xd59d995e, 0x8bb64ce5, 0x2dc14751, 0x1c295dcc, 0xba5e5678, 0x7ff968f6, 0xd98e6342, 0xe86679df, 0x4e11726b, 0xb8590282, 0x1e2e0936, 0x2fc613ab, 0x89b1181f, 0x4c162691, 0xea612d25, 0xdb8937b8, 0x7dfe3c0c, 0xec68d02b, 0x4a1fdb9f, 0x7bf7c102, 0xdd80cab6, 0x1827f438, 0xbe50ff8c, 0x8fb8e511, 0x29cfeea5, 0xdf879e4c, 0x79f095f8, 0x48188f65, 0xee6f84d1, 0x2bc8ba5f, 0x8dbfb1eb, 0xbc57ab76, 0x1a20a0c2, 0x8816eaf2, 0x2e61e146, 0x1f89fbdb, 0xb9fef06f, 0x7c59cee1, 0xda2ec555, 0xebc6dfc8, 0x4db1d47c, 0xbbf9a495, 0x1d8eaf21, 0x2c66b5bc, 0x8a11be08, 0x4fb68086, 0xe9c18b32, 0xd82991af, 0x7e5e9a1b, 0xefc8763c, 0x49bf7d88, 0x78576715, 0xde206ca1, 0x1b87522f, 0xbdf0599b, 0x8c184306, 0x2a6f48b2, 0xdc27385b, 0x7a5033ef, 0x4bb82972, 0xedcf22c6, 0x28681c48, 0x8e1f17fc, 0xbff70d61, 0x198006d5, 0x47abd36e, 0xe1dcd8da, 0xd034c247, 0x7643c9f3, 0xb3e4f77d, 0x1593fcc9, 0x247be654, 0x820cede0, 0x74449d09, 0xd23396bd, 0xe3db8c20, 0x45ac8794, 0x800bb91a, 0x267cb2ae, 0x1794a833, 0xb1e3a387, 0x20754fa0, 0x86024414, 0xb7ea5e89, 0x119d553d, 0xd43a6bb3, 0x724d6007, 0x43a57a9a, 0xe5d2712e, 0x139a01c7, 0xb5ed0a73, 0x840510ee, 0x22721b5a, 0xe7d525d4, 0x41a22e60, 0x704a34fd, 0xd63d3f49, 0xcc1d9f8b, 0x6a6a943f, 0x5b828ea2, 0xfdf58516, 0x3852bb98, 0x9e25b02c, 0xafcdaab1, 0x09baa105, 0xfff2d1ec, 0x5985da58, 0x686dc0c5, 0xce1acb71, 0x0bbdf5ff, 0xadcafe4b, 0x9c22e4d6, 0x3a55ef62, 0xabc30345, 0x0db408f1, 0x3c5c126c, 0x9a2b19d8, 0x5f8c2756, 0xf9fb2ce2, 0xc813367f, 0x6e643dcb, 0x982c4d22, 0x3e5b4696, 0x0fb35c0b, 0xa9c457bf, 0x6c636931, 0xca146285, 0xfbfc7818, 0x5d8b73ac, 0x03a0a617, 0xa5d7ada3, 0x943fb73e, 0x3248bc8a, 0xf7ef8204, 0x519889b0, 0x6070932d, 0xc6079899, 0x304fe870, 0x9638e3c4, 0xa7d0f959, 0x01a7f2ed, 0xc400cc63, 0x6277c7d7, 0x539fdd4a, 0xf5e8d6fe, 0x647e3ad9, 0xc209316d, 0xf3e12bf0, 0x55962044, 0x90311eca, 0x3646157e, 0x07ae0fe3, 0xa1d90457, 0x579174be, 0xf1e67f0a, 0xc00e6597, 0x66796e23, 0xa3de50ad, 0x05a95b19, 0x34414184, 0x92364a30}, {0x00000000, 0xcb5cd3a5, 0x4dc8a10b, 0x869472ae, 0x9b914216, 0x50cd91b3, 0xd659e31d, 0x1d0530b8, 0xec53826d, 0x270f51c8, 0xa19b2366, 0x6ac7f0c3, 0x77c2c07b, 0xbc9e13de, 0x3a0a6170, 0xf156b2d5, 0x03d6029b, 0xc88ad13e, 0x4e1ea390, 0x85427035, 0x9847408d, 0x531b9328, 0xd58fe186, 0x1ed33223, 0xef8580f6, 0x24d95353, 0xa24d21fd, 0x6911f258, 0x7414c2e0, 0xbf481145, 0x39dc63eb, 0xf280b04e, 0x07ac0536, 0xccf0d693, 0x4a64a43d, 0x81387798, 0x9c3d4720, 0x57619485, 0xd1f5e62b, 0x1aa9358e, 0xebff875b, 0x20a354fe, 0xa6372650, 0x6d6bf5f5, 0x706ec54d, 0xbb3216e8, 0x3da66446, 0xf6fab7e3, 0x047a07ad, 0xcf26d408, 0x49b2a6a6, 0x82ee7503, 0x9feb45bb, 0x54b7961e, 0xd223e4b0, 0x197f3715, 0xe82985c0, 0x23755665, 0xa5e124cb, 0x6ebdf76e, 0x73b8c7d6, 0xb8e41473, 0x3e7066dd, 0xf52cb578, 0x0f580a6c, 0xc404d9c9, 0x4290ab67, 0x89cc78c2, 0x94c9487a, 0x5f959bdf, 0xd901e971, 0x125d3ad4, 0xe30b8801, 0x28575ba4, 0xaec3290a, 0x659ffaaf, 0x789aca17, 0xb3c619b2, 0x35526b1c, 0xfe0eb8b9, 0x0c8e08f7, 0xc7d2db52, 0x4146a9fc, 0x8a1a7a59, 0x971f4ae1, 0x5c439944, 0xdad7ebea, 0x118b384f, 0xe0dd8a9a, 0x2b81593f, 0xad152b91, 0x6649f834, 0x7b4cc88c, 0xb0101b29, 0x36846987, 0xfdd8ba22, 0x08f40f5a, 0xc3a8dcff, 0x453cae51, 0x8e607df4, 0x93654d4c, 0x58399ee9, 0xdeadec47, 0x15f13fe2, 0xe4a78d37, 0x2ffb5e92, 0xa96f2c3c, 0x6233ff99, 0x7f36cf21, 0xb46a1c84, 0x32fe6e2a, 0xf9a2bd8f, 0x0b220dc1, 0xc07ede64, 0x46eaacca, 0x8db67f6f, 0x90b34fd7, 0x5bef9c72, 0xdd7beedc, 0x16273d79, 0xe7718fac, 0x2c2d5c09, 0xaab92ea7, 0x61e5fd02, 0x7ce0cdba, 0xb7bc1e1f, 0x31286cb1, 0xfa74bf14, 0x1eb014d8, 0xd5ecc77d, 0x5378b5d3, 0x98246676, 0x852156ce, 0x4e7d856b, 0xc8e9f7c5, 0x03b52460, 0xf2e396b5, 0x39bf4510, 0xbf2b37be, 0x7477e41b, 0x6972d4a3, 0xa22e0706, 0x24ba75a8, 0xefe6a60d, 0x1d661643, 0xd63ac5e6, 0x50aeb748, 0x9bf264ed, 0x86f75455, 0x4dab87f0, 0xcb3ff55e, 0x006326fb, 0xf135942e, 0x3a69478b, 0xbcfd3525, 0x77a1e680, 0x6aa4d638, 0xa1f8059d, 0x276c7733, 0xec30a496, 0x191c11ee, 0xd240c24b, 0x54d4b0e5, 0x9f886340, 0x828d53f8, 0x49d1805d, 0xcf45f2f3, 0x04192156, 0xf54f9383, 0x3e134026, 0xb8873288, 0x73dbe12d, 0x6eded195, 0xa5820230, 0x2316709e, 0xe84aa33b, 0x1aca1375, 0xd196c0d0, 0x5702b27e, 0x9c5e61db, 0x815b5163, 0x4a0782c6, 0xcc93f068, 0x07cf23cd, 0xf6999118, 0x3dc542bd, 0xbb513013, 0x700de3b6, 0x6d08d30e, 0xa65400ab, 0x20c07205, 0xeb9ca1a0, 0x11e81eb4, 0xdab4cd11, 0x5c20bfbf, 0x977c6c1a, 0x8a795ca2, 0x41258f07, 0xc7b1fda9, 0x0ced2e0c, 0xfdbb9cd9, 0x36e74f7c, 0xb0733dd2, 0x7b2fee77, 0x662adecf, 0xad760d6a, 0x2be27fc4, 0xe0beac61, 0x123e1c2f, 0xd962cf8a, 0x5ff6bd24, 0x94aa6e81, 0x89af5e39, 0x42f38d9c, 0xc467ff32, 0x0f3b2c97, 0xfe6d9e42, 0x35314de7, 0xb3a53f49, 0x78f9ecec, 0x65fcdc54, 0xaea00ff1, 0x28347d5f, 0xe368aefa, 0x16441b82, 0xdd18c827, 0x5b8cba89, 0x90d0692c, 0x8dd55994, 0x46898a31, 0xc01df89f, 0x0b412b3a, 0xfa1799ef, 0x314b4a4a, 0xb7df38e4, 0x7c83eb41, 0x6186dbf9, 0xaada085c, 0x2c4e7af2, 0xe712a957, 0x15921919, 0xdececabc, 0x585ab812, 0x93066bb7, 0x8e035b0f, 0x455f88aa, 0xc3cbfa04, 0x089729a1, 0xf9c19b74, 0x329d48d1, 0xb4093a7f, 0x7f55e9da, 0x6250d962, 0xa90c0ac7, 0x2f987869, 0xe4c4abcc}, {0x00000000, 0x3d6029b0, 0x7ac05360, 0x47a07ad0, 0xf580a6c0, 0xc8e08f70, 0x8f40f5a0, 0xb220dc10, 0x30704bc1, 0x0d106271, 0x4ab018a1, 0x77d03111, 0xc5f0ed01, 0xf890c4b1, 0xbf30be61, 0x825097d1, 0x60e09782, 0x5d80be32, 0x1a20c4e2, 0x2740ed52, 0x95603142, 0xa80018f2, 0xefa06222, 0xd2c04b92, 0x5090dc43, 0x6df0f5f3, 0x2a508f23, 0x1730a693, 0xa5107a83, 0x98705333, 0xdfd029e3, 0xe2b00053, 0xc1c12f04, 0xfca106b4, 0xbb017c64, 0x866155d4, 0x344189c4, 0x0921a074, 0x4e81daa4, 0x73e1f314, 0xf1b164c5, 0xccd14d75, 0x8b7137a5, 0xb6111e15, 0x0431c205, 0x3951ebb5, 0x7ef19165, 0x4391b8d5, 0xa121b886, 0x9c419136, 0xdbe1ebe6, 0xe681c256, 0x54a11e46, 0x69c137f6, 0x2e614d26, 0x13016496, 0x9151f347, 0xac31daf7, 0xeb91a027, 0xd6f18997, 0x64d15587, 0x59b17c37, 0x1e1106e7, 0x23712f57, 0x58f35849, 0x659371f9, 0x22330b29, 0x1f532299, 0xad73fe89, 0x9013d739, 0xd7b3ade9, 0xead38459, 0x68831388, 0x55e33a38, 0x124340e8, 0x2f236958, 0x9d03b548, 0xa0639cf8, 0xe7c3e628, 0xdaa3cf98, 0x3813cfcb, 0x0573e67b, 0x42d39cab, 0x7fb3b51b, 0xcd93690b, 0xf0f340bb, 0xb7533a6b, 0x8a3313db, 0x0863840a, 0x3503adba, 0x72a3d76a, 0x4fc3feda, 0xfde322ca, 0xc0830b7a, 0x872371aa, 0xba43581a, 0x9932774d, 0xa4525efd, 0xe3f2242d, 0xde920d9d, 0x6cb2d18d, 0x51d2f83d, 0x167282ed, 0x2b12ab5d, 0xa9423c8c, 0x9422153c, 0xd3826fec, 0xeee2465c, 0x5cc29a4c, 0x61a2b3fc, 0x2602c92c, 0x1b62e09c, 0xf9d2e0cf, 0xc4b2c97f, 0x8312b3af, 0xbe729a1f, 0x0c52460f, 0x31326fbf, 0x7692156f, 0x4bf23cdf, 0xc9a2ab0e, 0xf4c282be, 0xb362f86e, 0x8e02d1de, 0x3c220dce, 0x0142247e, 0x46e25eae, 0x7b82771e, 0xb1e6b092, 0x8c869922, 0xcb26e3f2, 0xf646ca42, 0x44661652, 0x79063fe2, 0x3ea64532, 0x03c66c82, 0x8196fb53, 0xbcf6d2e3, 0xfb56a833, 0xc6368183, 0x74165d93, 0x49767423, 0x0ed60ef3, 0x33b62743, 0xd1062710, 0xec660ea0, 0xabc67470, 0x96a65dc0, 0x248681d0, 0x19e6a860, 0x5e46d2b0, 0x6326fb00, 0xe1766cd1, 0xdc164561, 0x9bb63fb1, 0xa6d61601, 0x14f6ca11, 0x2996e3a1, 0x6e369971, 0x5356b0c1, 0x70279f96, 0x4d47b626, 0x0ae7ccf6, 0x3787e546, 0x85a73956, 0xb8c710e6, 0xff676a36, 0xc2074386, 0x4057d457, 0x7d37fde7, 0x3a978737, 0x07f7ae87, 0xb5d77297, 0x88b75b27, 0xcf1721f7, 0xf2770847, 0x10c70814, 0x2da721a4, 0x6a075b74, 0x576772c4, 0xe547aed4, 0xd8278764, 0x9f87fdb4, 0xa2e7d404, 0x20b743d5, 0x1dd76a65, 0x5a7710b5, 0x67173905, 0xd537e515, 0xe857cca5, 0xaff7b675, 0x92979fc5, 0xe915e8db, 0xd475c16b, 0x93d5bbbb, 0xaeb5920b, 0x1c954e1b, 0x21f567ab, 0x66551d7b, 0x5b3534cb, 0xd965a31a, 0xe4058aaa, 0xa3a5f07a, 0x9ec5d9ca, 0x2ce505da, 0x11852c6a, 0x562556ba, 0x6b457f0a, 0x89f57f59, 0xb49556e9, 0xf3352c39, 0xce550589, 0x7c75d999, 0x4115f029, 0x06b58af9, 0x3bd5a349, 0xb9853498, 0x84e51d28, 0xc34567f8, 0xfe254e48, 0x4c059258, 0x7165bbe8, 0x36c5c138, 0x0ba5e888, 0x28d4c7df, 0x15b4ee6f, 0x521494bf, 0x6f74bd0f, 0xdd54611f, 0xe03448af, 0xa794327f, 0x9af41bcf, 0x18a48c1e, 0x25c4a5ae, 0x6264df7e, 0x5f04f6ce, 0xed242ade, 0xd044036e, 0x97e479be, 0xaa84500e, 0x4834505d, 0x755479ed, 0x32f4033d, 0x0f942a8d, 0xbdb4f69d, 0x80d4df2d, 0xc774a5fd, 0xfa148c4d, 0x78441b9c, 0x4524322c, 0x028448fc, 0x3fe4614c, 0x8dc4bd5c, 0xb0a494ec, 0xf704ee3c, 0xca64c78c}, {0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, 0x8f629757, 0x37def032, 0x256b5fdc, 0x9dd738b9, 0xc5b428ef, 0x7d084f8a, 0x6fbde064, 0xd7018701, 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733, 0x58631056, 0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871, 0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26, 0x95ad7f70, 0x2d111815, 0x3fa4b7fb, 0x8718d09e, 0x1acfe827, 0xa2738f42, 0xb0c620ac, 0x087a47c9, 0xa032af3e, 0x188ec85b, 0x0a3b67b5, 0xb28700d0, 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787, 0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, 0xeae41086, 0x525877e3, 0x40edd80d, 0xf851bf68, 0xf02bf8a1, 0x48979fc4, 0x5a22302a, 0xe29e574f, 0x7f496ff6, 0xc7f50893, 0xd540a77d, 0x6dfcc018, 0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0, 0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7, 0x9b14583d, 0x23a83f58, 0x311d90b6, 0x89a1f7d3, 0x1476cf6a, 0xaccaa80f, 0xbe7f07e1, 0x06c36084, 0x5ea070d2, 0xe61c17b7, 0xf4a9b859, 0x4c15df3c, 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b, 0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, 0x446f98f5, 0xfcd3ff90, 0xee66507e, 0x56da371b, 0x0eb9274d, 0xb6054028, 0xa4b0efc6, 0x1c0c88a3, 0x81dbb01a, 0x3967d77f, 0x2bd27891, 0x936e1ff4, 0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed, 0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba, 0xfe92dfec, 0x462eb889, 0x549b1767, 0xec277002, 0x71f048bb, 0xc94c2fde, 0xdbf98030, 0x6345e755, 0x6b3fa09c, 0xd383c7f9, 0xc1366817, 0x798a0f72, 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825, 0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, 0x21e91f24, 0x99557841, 0x8be0d7af, 0x335cb0ca, 0xed59b63b, 0x55e5d15e, 0x47507eb0, 0xffec19d5, 0x623b216c, 0xda874609, 0xc832e9e7, 0x708e8e82, 0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a, 0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d, 0xbd40e1a4, 0x05fc86c1, 0x1749292f, 0xaff54e4a, 0x322276f3, 0x8a9e1196, 0x982bbe78, 0x2097d91d, 0x78f4c94b, 0xc048ae2e, 0xd2fd01c0, 0x6a4166a5, 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2, 0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, 0xc2098e52, 0x7ab5e937, 0x680046d9, 0xd0bc21bc, 0x88df31ea, 0x3063568f, 0x22d6f961, 0x9a6a9e04, 0x07bda6bd, 0xbf01c1d8, 0xadb46e36, 0x15080953, 0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174, 0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623, 0xd8c66675, 0x607a0110, 0x72cfaefe, 0xca73c99b, 0x57a4f122, 0xef189647, 0xfdad39a9, 0x45115ecc, 0x764dee06, 0xcef18963, 0xdc44268d, 0x64f841e8, 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf, 0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, 0x3c9b51be, 0x842736db, 0x96929935, 0x2e2efe50, 0x2654b999, 0x9ee8defc, 0x8c5d7112, 0x34e11677, 0xa9362ece, 0x118a49ab, 0x033fe645, 0xbb838120, 0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98, 0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf, 0xd67f4138, 0x6ec3265d, 0x7c7689b3, 0xc4caeed6, 0x591dd66f, 0xe1a1b10a, 0xf3141ee4, 0x4ba87981, 0x13cb69d7, 0xab770eb2, 0xb9c2a15c, 0x017ec639, 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e, 0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, 0x090481f0, 0xb1b8e695, 0xa30d497b, 0x1bb12e1e, 0x43d23e48, 0xfb6e592d, 0xe9dbf6c3, 0x516791a6, 0xccb0a91f, 0x740cce7a, 0x66b96194, 0xde0506f1}, {0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, 0x0709a8dc, 0x06cbc2eb, 0x048d7cb2, 0x054f1685, 0x0e1351b8, 0x0fd13b8f, 0x0d9785d6, 0x0c55efe1, 0x091af964, 0x08d89353, 0x0a9e2d0a, 0x0b5c473d, 0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29, 0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5, 0x1235f2c8, 0x13f798ff, 0x11b126a6, 0x10734c91, 0x153c5a14, 0x14fe3023, 0x16b88e7a, 0x177ae44d, 0x384d46e0, 0x398f2cd7, 0x3bc9928e, 0x3a0bf8b9, 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065, 0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, 0x3157bf84, 0x3095d5b3, 0x32d36bea, 0x331101dd, 0x246be590, 0x25a98fa7, 0x27ef31fe, 0x262d5bc9, 0x23624d4c, 0x22a0277b, 0x20e69922, 0x2124f315, 0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71, 0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad, 0x709a8dc0, 0x7158e7f7, 0x731e59ae, 0x72dc3399, 0x7793251c, 0x76514f2b, 0x7417f172, 0x75d59b45, 0x7e89dc78, 0x7f4bb64f, 0x7d0d0816, 0x7ccf6221, 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd, 0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, 0x6bb5866c, 0x6a77ec5b, 0x68315202, 0x69f33835, 0x62af7f08, 0x636d153f, 0x612bab66, 0x60e9c151, 0x65a6d7d4, 0x6464bde3, 0x662203ba, 0x67e0698d, 0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579, 0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5, 0x46c49a98, 0x4706f0af, 0x45404ef6, 0x448224c1, 0x41cd3244, 0x400f5873, 0x4249e62a, 0x438b8c1d, 0x54f16850, 0x55330267, 0x5775bc3e, 0x56b7d609, 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5, 0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, 0x5deb9134, 0x5c29fb03, 0x5e6f455a, 0x5fad2f6d, 0xe1351b80, 0xe0f771b7, 0xe2b1cfee, 0xe373a5d9, 0xe63cb35c, 0xe7fed96b, 0xe5b86732, 0xe47a0d05, 0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461, 0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd, 0xfd13b8f0, 0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, 0xfa1a102c, 0xfbd87a1b, 0xf99ec442, 0xf85cae75, 0xf300e948, 0xf2c2837f, 0xf0843d26, 0xf1465711, 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd, 0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, 0xde71f5bc, 0xdfb39f8b, 0xddf521d2, 0xdc374be5, 0xd76b0cd8, 0xd6a966ef, 0xd4efd8b6, 0xd52db281, 0xd062a404, 0xd1a0ce33, 0xd3e6706a, 0xd2241a5d, 0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049, 0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895, 0xcb4dafa8, 0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, 0xcc440774, 0xcd866d43, 0xcfc0d31a, 0xce02b92d, 0x91af9640, 0x906dfc77, 0x922b422e, 0x93e92819, 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5, 0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, 0x98b56f24, 0x99770513, 0x9b31bb4a, 0x9af3d17d, 0x8d893530, 0x8c4b5f07, 0x8e0de15e, 0x8fcf8b69, 0x8a809dec, 0x8b42f7db, 0x89044982, 0x88c623b5, 0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1, 0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d, 0xa9e2d0a0, 0xa820ba97, 0xaa6604ce, 0xaba46ef9, 0xaeeb787c, 0xaf29124b, 0xad6fac12, 0xacadc625, 0xa7f18118, 0xa633eb2f, 0xa4755576, 0xa5b73f41, 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d, 0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, 0xb2cddb0c, 0xb30fb13b, 0xb1490f62, 0xb08b6555, 0xbbd72268, 0xba15485f, 0xb853f606, 0xb9919c31, 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda, 0xbe9834ed}, {0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, 0x646cc504, 0x7d77f445, 0x565aa786, 0x4f4196c7, 0xc8d98a08, 0xd1c2bb49, 0xfaefe88a, 0xe3f4d9cb, 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e, 0x87981ccf, 0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192, 0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496, 0x821b9859, 0x9b00a918, 0xb02dfadb, 0xa936cb9a, 0xe6775d5d, 0xff6c6c1c, 0xd4413fdf, 0xcd5a0e9e, 0x958424a2, 0x8c9f15e3, 0xa7b24620, 0xbea97761, 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265, 0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, 0x39316bae, 0x202a5aef, 0x0b07092c, 0x121c386d, 0xdf4636f3, 0xc65d07b2, 0xed705471, 0xf46b6530, 0xbb2af3f7, 0xa231c2b6, 0x891c9175, 0x9007a034, 0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38, 0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c, 0xf0794f05, 0xe9627e44, 0xc24f2d87, 0xdb541cc6, 0x94158a01, 0x8d0ebb40, 0xa623e883, 0xbf38d9c2, 0x38a0c50d, 0x21bbf44c, 0x0a96a78f, 0x138d96ce, 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca, 0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, 0xded79850, 0xc7cca911, 0xece1fad2, 0xf5facb93, 0x7262d75c, 0x6b79e61d, 0x4054b5de, 0x594f849f, 0x160e1258, 0x0f152319, 0x243870da, 0x3d23419b, 0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864, 0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60, 0xad24e1af, 0xb43fd0ee, 0x9f12832d, 0x8609b26c, 0xc94824ab, 0xd05315ea, 0xfb7e4629, 0xe2657768, 0x2f3f79f6, 0x362448b7, 0x1d091b74, 0x04122a35, 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31, 0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, 0x838a36fa, 0x9a9107bb, 0xb1bc5478, 0xa8a76539, 0x3b83984b, 0x2298a90a, 0x09b5fac9, 0x10aecb88, 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd, 0x74c20e8c, 0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180, 0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484, 0x71418a1a, 0x685abb5b, 0x4377e898, 0x5a6cd9d9, 0x152d4f1e, 0x0c367e5f, 0x271b2d9c, 0x3e001cdd, 0xb9980012, 0xa0833153, 0x8bae6290, 0x92b553d1, 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5, 0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, 0xca6b79ed, 0xd37048ac, 0xf85d1b6f, 0xe1462a2e, 0x66de36e1, 0x7fc507a0, 0x54e85463, 0x4df36522, 0x02b2f3e5, 0x1ba9c2a4, 0x30849167, 0x299fa026, 0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b, 0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f, 0x2c1c24b0, 0x350715f1, 0x1e2a4632, 0x07317773, 0x4870e1b4, 0x516bd0f5, 0x7a468336, 0x635db277, 0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc, 0xe0d7848d, 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189, 0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, 0x674f9842, 0x7e54a903, 0x5579fac0, 0x4c62cb81, 0x8138c51f, 0x9823f45e, 0xb30ea79d, 0xaa1596dc, 0xe554001b, 0xfc4f315a, 0xd7626299, 0xce7953d8, 0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4, 0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0, 0x5e7ef3ec, 0x4765c2ad, 0x6c48916e, 0x7553a02f, 0x3a1236e8, 0x230907a9, 0x0824546a, 0x113f652b, 0x96a779e4, 0x8fbc48a5, 0xa4911b66, 0xbd8a2a27, 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23, 0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, 0x70d024b9, 0x69cb15f8, 0x42e6463b, 0x5bfd777a, 0xdc656bb5, 0xc57e5af4, 0xee530937, 0xf7483876, 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33, 0x9324fd72}, {0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x0000000000000000, 0x9630077700000000, 0x2c610eee00000000, 0xba51099900000000, 0x19c46d0700000000, 0x8ff46a7000000000, 0x35a563e900000000, 0xa395649e00000000, 0x3288db0e00000000, 0xa4b8dc7900000000, 0x1ee9d5e000000000, 0x88d9d29700000000, 0x2b4cb60900000000, 0xbd7cb17e00000000, 0x072db8e700000000, 0x911dbf9000000000, 0x6410b71d00000000, 0xf220b06a00000000, 0x4871b9f300000000, 0xde41be8400000000, 0x7dd4da1a00000000, 0xebe4dd6d00000000, 0x51b5d4f400000000, 0xc785d38300000000, 0x56986c1300000000, 0xc0a86b6400000000, 0x7af962fd00000000, 0xecc9658a00000000, 0x4f5c011400000000, 0xd96c066300000000, 0x633d0ffa00000000, 0xf50d088d00000000, 0xc8206e3b00000000, 0x5e10694c00000000, 0xe44160d500000000, 0x727167a200000000, 0xd1e4033c00000000, 0x47d4044b00000000, 0xfd850dd200000000, 0x6bb50aa500000000, 0xfaa8b53500000000, 0x6c98b24200000000, 0xd6c9bbdb00000000, 0x40f9bcac00000000, 0xe36cd83200000000, 0x755cdf4500000000, 0xcf0dd6dc00000000, 0x593dd1ab00000000, 0xac30d92600000000, 0x3a00de5100000000, 0x8051d7c800000000, 0x1661d0bf00000000, 0xb5f4b42100000000, 0x23c4b35600000000, 0x9995bacf00000000, 0x0fa5bdb800000000, 0x9eb8022800000000, 0x0888055f00000000, 0xb2d90cc600000000, 0x24e90bb100000000, 0x877c6f2f00000000, 0x114c685800000000, 0xab1d61c100000000, 0x3d2d66b600000000, 0x9041dc7600000000, 0x0671db0100000000, 0xbc20d29800000000, 0x2a10d5ef00000000, 0x8985b17100000000, 0x1fb5b60600000000, 0xa5e4bf9f00000000, 0x33d4b8e800000000, 0xa2c9077800000000, 0x34f9000f00000000, 0x8ea8099600000000, 0x18980ee100000000, 0xbb0d6a7f00000000, 0x2d3d6d0800000000, 0x976c649100000000, 0x015c63e600000000, 0xf4516b6b00000000, 0x62616c1c00000000, 0xd830658500000000, 0x4e0062f200000000, 0xed95066c00000000, 0x7ba5011b00000000, 0xc1f4088200000000, 0x57c40ff500000000, 0xc6d9b06500000000, 0x50e9b71200000000, 0xeab8be8b00000000, 0x7c88b9fc00000000, 0xdf1ddd6200000000, 0x492dda1500000000, 0xf37cd38c00000000, 0x654cd4fb00000000, 0x5861b24d00000000, 0xce51b53a00000000, 0x7400bca300000000, 0xe230bbd400000000, 0x41a5df4a00000000, 0xd795d83d00000000, 0x6dc4d1a400000000, 0xfbf4d6d300000000, 0x6ae9694300000000, 0xfcd96e3400000000, 0x468867ad00000000, 0xd0b860da00000000, 0x732d044400000000, 0xe51d033300000000, 0x5f4c0aaa00000000, 0xc97c0ddd00000000, 0x3c71055000000000, 0xaa41022700000000, 0x10100bbe00000000, 0x86200cc900000000, 0x25b5685700000000, 0xb3856f2000000000, 0x09d466b900000000, 0x9fe461ce00000000, 0x0ef9de5e00000000, 0x98c9d92900000000, 0x2298d0b000000000, 0xb4a8d7c700000000, 0x173db35900000000, 0x810db42e00000000, 0x3b5cbdb700000000, 0xad6cbac000000000, 0x2083b8ed00000000, 0xb6b3bf9a00000000, 0x0ce2b60300000000, 0x9ad2b17400000000, 0x3947d5ea00000000, 0xaf77d29d00000000, 0x1526db0400000000, 0x8316dc7300000000, 0x120b63e300000000, 0x843b649400000000, 0x3e6a6d0d00000000, 0xa85a6a7a00000000, 0x0bcf0ee400000000, 0x9dff099300000000, 0x27ae000a00000000, 0xb19e077d00000000, 0x44930ff000000000, 0xd2a3088700000000, 0x68f2011e00000000, 0xfec2066900000000, 0x5d5762f700000000, 0xcb67658000000000, 0x71366c1900000000, 0xe7066b6e00000000, 0x761bd4fe00000000, 0xe02bd38900000000, 0x5a7ada1000000000, 0xcc4add6700000000, 0x6fdfb9f900000000, 0xf9efbe8e00000000, 0x43beb71700000000, 0xd58eb06000000000, 0xe8a3d6d600000000, 0x7e93d1a100000000, 0xc4c2d83800000000, 0x52f2df4f00000000, 0xf167bbd100000000, 0x6757bca600000000, 0xdd06b53f00000000, 0x4b36b24800000000, 0xda2b0dd800000000, 0x4c1b0aaf00000000, 0xf64a033600000000, 0x607a044100000000, 0xc3ef60df00000000, 0x55df67a800000000, 0xef8e6e3100000000, 0x79be694600000000, 0x8cb361cb00000000, 0x1a8366bc00000000, 0xa0d26f2500000000, 0x36e2685200000000, 0x95770ccc00000000, 0x03470bbb00000000, 0xb916022200000000, 0x2f26055500000000, 0xbe3bbac500000000, 0x280bbdb200000000, 0x925ab42b00000000, 0x046ab35c00000000, 0xa7ffd7c200000000, 0x31cfd0b500000000, 0x8b9ed92c00000000, 0x1daede5b00000000, 0xb0c2649b00000000, 0x26f263ec00000000, 0x9ca36a7500000000, 0x0a936d0200000000, 0xa906099c00000000, 0x3f360eeb00000000, 0x8567077200000000, 0x1357000500000000, 0x824abf9500000000, 0x147ab8e200000000, 0xae2bb17b00000000, 0x381bb60c00000000, 0x9b8ed29200000000, 0x0dbed5e500000000, 0xb7efdc7c00000000, 0x21dfdb0b00000000, 0xd4d2d38600000000, 0x42e2d4f100000000, 0xf8b3dd6800000000, 0x6e83da1f00000000, 0xcd16be8100000000, 0x5b26b9f600000000, 0xe177b06f00000000, 0x7747b71800000000, 0xe65a088800000000, 0x706a0fff00000000, 0xca3b066600000000, 0x5c0b011100000000, 0xff9e658f00000000, 0x69ae62f800000000, 0xd3ff6b6100000000, 0x45cf6c1600000000, 0x78e20aa000000000, 0xeed20dd700000000, 0x5483044e00000000, 0xc2b3033900000000, 0x612667a700000000, 0xf71660d000000000, 0x4d47694900000000, 0xdb776e3e00000000, 0x4a6ad1ae00000000, 0xdc5ad6d900000000, 0x660bdf4000000000, 0xf03bd83700000000, 0x53aebca900000000, 0xc59ebbde00000000, 0x7fcfb24700000000, 0xe9ffb53000000000, 0x1cf2bdbd00000000, 0x8ac2baca00000000, 0x3093b35300000000, 0xa6a3b42400000000, 0x0536d0ba00000000, 0x9306d7cd00000000, 0x2957de5400000000, 0xbf67d92300000000, 0x2e7a66b300000000, 0xb84a61c400000000, 0x021b685d00000000, 0x942b6f2a00000000, 0x37be0bb400000000, 0xa18e0cc300000000, 0x1bdf055a00000000, 0x8def022d00000000}, {0x0000000000000000, 0x41311b1900000000, 0x8262363200000000, 0xc3532d2b00000000, 0x04c56c6400000000, 0x45f4777d00000000, 0x86a75a5600000000, 0xc796414f00000000, 0x088ad9c800000000, 0x49bbc2d100000000, 0x8ae8effa00000000, 0xcbd9f4e300000000, 0x0c4fb5ac00000000, 0x4d7eaeb500000000, 0x8e2d839e00000000, 0xcf1c988700000000, 0x5112c24a00000000, 0x1023d95300000000, 0xd370f47800000000, 0x9241ef6100000000, 0x55d7ae2e00000000, 0x14e6b53700000000, 0xd7b5981c00000000, 0x9684830500000000, 0x59981b8200000000, 0x18a9009b00000000, 0xdbfa2db000000000, 0x9acb36a900000000, 0x5d5d77e600000000, 0x1c6c6cff00000000, 0xdf3f41d400000000, 0x9e0e5acd00000000, 0xa224849500000000, 0xe3159f8c00000000, 0x2046b2a700000000, 0x6177a9be00000000, 0xa6e1e8f100000000, 0xe7d0f3e800000000, 0x2483dec300000000, 0x65b2c5da00000000, 0xaaae5d5d00000000, 0xeb9f464400000000, 0x28cc6b6f00000000, 0x69fd707600000000, 0xae6b313900000000, 0xef5a2a2000000000, 0x2c09070b00000000, 0x6d381c1200000000, 0xf33646df00000000, 0xb2075dc600000000, 0x715470ed00000000, 0x30656bf400000000, 0xf7f32abb00000000, 0xb6c231a200000000, 0x75911c8900000000, 0x34a0079000000000, 0xfbbc9f1700000000, 0xba8d840e00000000, 0x79dea92500000000, 0x38efb23c00000000, 0xff79f37300000000, 0xbe48e86a00000000, 0x7d1bc54100000000, 0x3c2ade5800000000, 0x054f79f000000000, 0x447e62e900000000, 0x872d4fc200000000, 0xc61c54db00000000, 0x018a159400000000, 0x40bb0e8d00000000, 0x83e823a600000000, 0xc2d938bf00000000, 0x0dc5a03800000000, 0x4cf4bb2100000000, 0x8fa7960a00000000, 0xce968d1300000000, 0x0900cc5c00000000, 0x4831d74500000000, 0x8b62fa6e00000000, 0xca53e17700000000, 0x545dbbba00000000, 0x156ca0a300000000, 0xd63f8d8800000000, 0x970e969100000000, 0x5098d7de00000000, 0x11a9ccc700000000, 0xd2fae1ec00000000, 0x93cbfaf500000000, 0x5cd7627200000000, 0x1de6796b00000000, 0xdeb5544000000000, 0x9f844f5900000000, 0x58120e1600000000, 0x1923150f00000000, 0xda70382400000000, 0x9b41233d00000000, 0xa76bfd6500000000, 0xe65ae67c00000000, 0x2509cb5700000000, 0x6438d04e00000000, 0xa3ae910100000000, 0xe29f8a1800000000, 0x21cca73300000000, 0x60fdbc2a00000000, 0xafe124ad00000000, 0xeed03fb400000000, 0x2d83129f00000000, 0x6cb2098600000000, 0xab2448c900000000, 0xea1553d000000000, 0x29467efb00000000, 0x687765e200000000, 0xf6793f2f00000000, 0xb748243600000000, 0x741b091d00000000, 0x352a120400000000, 0xf2bc534b00000000, 0xb38d485200000000, 0x70de657900000000, 0x31ef7e6000000000, 0xfef3e6e700000000, 0xbfc2fdfe00000000, 0x7c91d0d500000000, 0x3da0cbcc00000000, 0xfa368a8300000000, 0xbb07919a00000000, 0x7854bcb100000000, 0x3965a7a800000000, 0x4b98833b00000000, 0x0aa9982200000000, 0xc9fab50900000000, 0x88cbae1000000000, 0x4f5def5f00000000, 0x0e6cf44600000000, 0xcd3fd96d00000000, 0x8c0ec27400000000, 0x43125af300000000, 0x022341ea00000000, 0xc1706cc100000000, 0x804177d800000000, 0x47d7369700000000, 0x06e62d8e00000000, 0xc5b500a500000000, 0x84841bbc00000000, 0x1a8a417100000000, 0x5bbb5a6800000000, 0x98e8774300000000, 0xd9d96c5a00000000, 0x1e4f2d1500000000, 0x5f7e360c00000000, 0x9c2d1b2700000000, 0xdd1c003e00000000, 0x120098b900000000, 0x533183a000000000, 0x9062ae8b00000000, 0xd153b59200000000, 0x16c5f4dd00000000, 0x57f4efc400000000, 0x94a7c2ef00000000, 0xd596d9f600000000, 0xe9bc07ae00000000, 0xa88d1cb700000000, 0x6bde319c00000000, 0x2aef2a8500000000, 0xed796bca00000000, 0xac4870d300000000, 0x6f1b5df800000000, 0x2e2a46e100000000, 0xe136de6600000000, 0xa007c57f00000000, 0x6354e85400000000, 0x2265f34d00000000, 0xe5f3b20200000000, 0xa4c2a91b00000000, 0x6791843000000000, 0x26a09f2900000000, 0xb8aec5e400000000, 0xf99fdefd00000000, 0x3accf3d600000000, 0x7bfde8cf00000000, 0xbc6ba98000000000, 0xfd5ab29900000000, 0x3e099fb200000000, 0x7f3884ab00000000, 0xb0241c2c00000000, 0xf115073500000000, 0x32462a1e00000000, 0x7377310700000000, 0xb4e1704800000000, 0xf5d06b5100000000, 0x3683467a00000000, 0x77b25d6300000000, 0x4ed7facb00000000, 0x0fe6e1d200000000, 0xccb5ccf900000000, 0x8d84d7e000000000, 0x4a1296af00000000, 0x0b238db600000000, 0xc870a09d00000000, 0x8941bb8400000000, 0x465d230300000000, 0x076c381a00000000, 0xc43f153100000000, 0x850e0e2800000000, 0x42984f6700000000, 0x03a9547e00000000, 0xc0fa795500000000, 0x81cb624c00000000, 0x1fc5388100000000, 0x5ef4239800000000, 0x9da70eb300000000, 0xdc9615aa00000000, 0x1b0054e500000000, 0x5a314ffc00000000, 0x996262d700000000, 0xd85379ce00000000, 0x174fe14900000000, 0x567efa5000000000, 0x952dd77b00000000, 0xd41ccc6200000000, 0x138a8d2d00000000, 0x52bb963400000000, 0x91e8bb1f00000000, 0xd0d9a00600000000, 0xecf37e5e00000000, 0xadc2654700000000, 0x6e91486c00000000, 0x2fa0537500000000, 0xe836123a00000000, 0xa907092300000000, 0x6a54240800000000, 0x2b653f1100000000, 0xe479a79600000000, 0xa548bc8f00000000, 0x661b91a400000000, 0x272a8abd00000000, 0xe0bccbf200000000, 0xa18dd0eb00000000, 0x62defdc000000000, 0x23efe6d900000000, 0xbde1bc1400000000, 0xfcd0a70d00000000, 0x3f838a2600000000, 0x7eb2913f00000000, 0xb924d07000000000, 0xf815cb6900000000, 0x3b46e64200000000, 0x7a77fd5b00000000, 0xb56b65dc00000000, 0xf45a7ec500000000, 0x370953ee00000000, 0x763848f700000000, 0xb1ae09b800000000, 0xf09f12a100000000, 0x33cc3f8a00000000, 0x72fd249300000000}, {0x0000000000000000, 0x376ac20100000000, 0x6ed4840300000000, 0x59be460200000000, 0xdca8090700000000, 0xebc2cb0600000000, 0xb27c8d0400000000, 0x85164f0500000000, 0xb851130e00000000, 0x8f3bd10f00000000, 0xd685970d00000000, 0xe1ef550c00000000, 0x64f91a0900000000, 0x5393d80800000000, 0x0a2d9e0a00000000, 0x3d475c0b00000000, 0x70a3261c00000000, 0x47c9e41d00000000, 0x1e77a21f00000000, 0x291d601e00000000, 0xac0b2f1b00000000, 0x9b61ed1a00000000, 0xc2dfab1800000000, 0xf5b5691900000000, 0xc8f2351200000000, 0xff98f71300000000, 0xa626b11100000000, 0x914c731000000000, 0x145a3c1500000000, 0x2330fe1400000000, 0x7a8eb81600000000, 0x4de47a1700000000, 0xe0464d3800000000, 0xd72c8f3900000000, 0x8e92c93b00000000, 0xb9f80b3a00000000, 0x3cee443f00000000, 0x0b84863e00000000, 0x523ac03c00000000, 0x6550023d00000000, 0x58175e3600000000, 0x6f7d9c3700000000, 0x36c3da3500000000, 0x01a9183400000000, 0x84bf573100000000, 0xb3d5953000000000, 0xea6bd33200000000, 0xdd01113300000000, 0x90e56b2400000000, 0xa78fa92500000000, 0xfe31ef2700000000, 0xc95b2d2600000000, 0x4c4d622300000000, 0x7b27a02200000000, 0x2299e62000000000, 0x15f3242100000000, 0x28b4782a00000000, 0x1fdeba2b00000000, 0x4660fc2900000000, 0x710a3e2800000000, 0xf41c712d00000000, 0xc376b32c00000000, 0x9ac8f52e00000000, 0xada2372f00000000, 0xc08d9a7000000000, 0xf7e7587100000000, 0xae591e7300000000, 0x9933dc7200000000, 0x1c25937700000000, 0x2b4f517600000000, 0x72f1177400000000, 0x459bd57500000000, 0x78dc897e00000000, 0x4fb64b7f00000000, 0x16080d7d00000000, 0x2162cf7c00000000, 0xa474807900000000, 0x931e427800000000, 0xcaa0047a00000000, 0xfdcac67b00000000, 0xb02ebc6c00000000, 0x87447e6d00000000, 0xdefa386f00000000, 0xe990fa6e00000000, 0x6c86b56b00000000, 0x5bec776a00000000, 0x0252316800000000, 0x3538f36900000000, 0x087faf6200000000, 0x3f156d6300000000, 0x66ab2b6100000000, 0x51c1e96000000000, 0xd4d7a66500000000, 0xe3bd646400000000, 0xba03226600000000, 0x8d69e06700000000, 0x20cbd74800000000, 0x17a1154900000000, 0x4e1f534b00000000, 0x7975914a00000000, 0xfc63de4f00000000, 0xcb091c4e00000000, 0x92b75a4c00000000, 0xa5dd984d00000000, 0x989ac44600000000, 0xaff0064700000000, 0xf64e404500000000, 0xc124824400000000, 0x4432cd4100000000, 0x73580f4000000000, 0x2ae6494200000000, 0x1d8c8b4300000000, 0x5068f15400000000, 0x6702335500000000, 0x3ebc755700000000, 0x09d6b75600000000, 0x8cc0f85300000000, 0xbbaa3a5200000000, 0xe2147c5000000000, 0xd57ebe5100000000, 0xe839e25a00000000, 0xdf53205b00000000, 0x86ed665900000000, 0xb187a45800000000, 0x3491eb5d00000000, 0x03fb295c00000000, 0x5a456f5e00000000, 0x6d2fad5f00000000, 0x801b35e100000000, 0xb771f7e000000000, 0xeecfb1e200000000, 0xd9a573e300000000, 0x5cb33ce600000000, 0x6bd9fee700000000, 0x3267b8e500000000, 0x050d7ae400000000, 0x384a26ef00000000, 0x0f20e4ee00000000, 0x569ea2ec00000000, 0x61f460ed00000000, 0xe4e22fe800000000, 0xd388ede900000000, 0x8a36abeb00000000, 0xbd5c69ea00000000, 0xf0b813fd00000000, 0xc7d2d1fc00000000, 0x9e6c97fe00000000, 0xa90655ff00000000, 0x2c101afa00000000, 0x1b7ad8fb00000000, 0x42c49ef900000000, 0x75ae5cf800000000, 0x48e900f300000000, 0x7f83c2f200000000, 0x263d84f000000000, 0x115746f100000000, 0x944109f400000000, 0xa32bcbf500000000, 0xfa958df700000000, 0xcdff4ff600000000, 0x605d78d900000000, 0x5737bad800000000, 0x0e89fcda00000000, 0x39e33edb00000000, 0xbcf571de00000000, 0x8b9fb3df00000000, 0xd221f5dd00000000, 0xe54b37dc00000000, 0xd80c6bd700000000, 0xef66a9d600000000, 0xb6d8efd400000000, 0x81b22dd500000000, 0x04a462d000000000, 0x33cea0d100000000, 0x6a70e6d300000000, 0x5d1a24d200000000, 0x10fe5ec500000000, 0x27949cc400000000, 0x7e2adac600000000, 0x494018c700000000, 0xcc5657c200000000, 0xfb3c95c300000000, 0xa282d3c100000000, 0x95e811c000000000, 0xa8af4dcb00000000, 0x9fc58fca00000000, 0xc67bc9c800000000, 0xf1110bc900000000, 0x740744cc00000000, 0x436d86cd00000000, 0x1ad3c0cf00000000, 0x2db902ce00000000, 0x4096af9100000000, 0x77fc6d9000000000, 0x2e422b9200000000, 0x1928e99300000000, 0x9c3ea69600000000, 0xab54649700000000, 0xf2ea229500000000, 0xc580e09400000000, 0xf8c7bc9f00000000, 0xcfad7e9e00000000, 0x9613389c00000000, 0xa179fa9d00000000, 0x246fb59800000000, 0x1305779900000000, 0x4abb319b00000000, 0x7dd1f39a00000000, 0x3035898d00000000, 0x075f4b8c00000000, 0x5ee10d8e00000000, 0x698bcf8f00000000, 0xec9d808a00000000, 0xdbf7428b00000000, 0x8249048900000000, 0xb523c68800000000, 0x88649a8300000000, 0xbf0e588200000000, 0xe6b01e8000000000, 0xd1dadc8100000000, 0x54cc938400000000, 0x63a6518500000000, 0x3a18178700000000, 0x0d72d58600000000, 0xa0d0e2a900000000, 0x97ba20a800000000, 0xce0466aa00000000, 0xf96ea4ab00000000, 0x7c78ebae00000000, 0x4b1229af00000000, 0x12ac6fad00000000, 0x25c6adac00000000, 0x1881f1a700000000, 0x2feb33a600000000, 0x765575a400000000, 0x413fb7a500000000, 0xc429f8a000000000, 0xf3433aa100000000, 0xaafd7ca300000000, 0x9d97bea200000000, 0xd073c4b500000000, 0xe71906b400000000, 0xbea740b600000000, 0x89cd82b700000000, 0x0cdbcdb200000000, 0x3bb10fb300000000, 0x620f49b100000000, 0x55658bb000000000, 0x6822d7bb00000000, 0x5f4815ba00000000, 0x06f653b800000000, 0x319c91b900000000, 0xb48adebc00000000, 0x83e01cbd00000000, 0xda5e5abf00000000, 0xed3498be00000000}, {0x0000000000000000, 0x6567bcb800000000, 0x8bc809aa00000000, 0xeeafb51200000000, 0x5797628f00000000, 0x32f0de3700000000, 0xdc5f6b2500000000, 0xb938d79d00000000, 0xef28b4c500000000, 0x8a4f087d00000000, 0x64e0bd6f00000000, 0x018701d700000000, 0xb8bfd64a00000000, 0xddd86af200000000, 0x3377dfe000000000, 0x5610635800000000, 0x9f57195000000000, 0xfa30a5e800000000, 0x149f10fa00000000, 0x71f8ac4200000000, 0xc8c07bdf00000000, 0xada7c76700000000, 0x4308727500000000, 0x266fcecd00000000, 0x707fad9500000000, 0x1518112d00000000, 0xfbb7a43f00000000, 0x9ed0188700000000, 0x27e8cf1a00000000, 0x428f73a200000000, 0xac20c6b000000000, 0xc9477a0800000000, 0x3eaf32a000000000, 0x5bc88e1800000000, 0xb5673b0a00000000, 0xd00087b200000000, 0x6938502f00000000, 0x0c5fec9700000000, 0xe2f0598500000000, 0x8797e53d00000000, 0xd187866500000000, 0xb4e03add00000000, 0x5a4f8fcf00000000, 0x3f28337700000000, 0x8610e4ea00000000, 0xe377585200000000, 0x0dd8ed4000000000, 0x68bf51f800000000, 0xa1f82bf000000000, 0xc49f974800000000, 0x2a30225a00000000, 0x4f579ee200000000, 0xf66f497f00000000, 0x9308f5c700000000, 0x7da740d500000000, 0x18c0fc6d00000000, 0x4ed09f3500000000, 0x2bb7238d00000000, 0xc518969f00000000, 0xa07f2a2700000000, 0x1947fdba00000000, 0x7c20410200000000, 0x928ff41000000000, 0xf7e848a800000000, 0x3d58149b00000000, 0x583fa82300000000, 0xb6901d3100000000, 0xd3f7a18900000000, 0x6acf761400000000, 0x0fa8caac00000000, 0xe1077fbe00000000, 0x8460c30600000000, 0xd270a05e00000000, 0xb7171ce600000000, 0x59b8a9f400000000, 0x3cdf154c00000000, 0x85e7c2d100000000, 0xe0807e6900000000, 0x0e2fcb7b00000000, 0x6b4877c300000000, 0xa20f0dcb00000000, 0xc768b17300000000, 0x29c7046100000000, 0x4ca0b8d900000000, 0xf5986f4400000000, 0x90ffd3fc00000000, 0x7e5066ee00000000, 0x1b37da5600000000, 0x4d27b90e00000000, 0x284005b600000000, 0xc6efb0a400000000, 0xa3880c1c00000000, 0x1ab0db8100000000, 0x7fd7673900000000, 0x9178d22b00000000, 0xf41f6e9300000000, 0x03f7263b00000000, 0x66909a8300000000, 0x883f2f9100000000, 0xed58932900000000, 0x546044b400000000, 0x3107f80c00000000, 0xdfa84d1e00000000, 0xbacff1a600000000, 0xecdf92fe00000000, 0x89b82e4600000000, 0x67179b5400000000, 0x027027ec00000000, 0xbb48f07100000000, 0xde2f4cc900000000, 0x3080f9db00000000, 0x55e7456300000000, 0x9ca03f6b00000000, 0xf9c783d300000000, 0x176836c100000000, 0x720f8a7900000000, 0xcb375de400000000, 0xae50e15c00000000, 0x40ff544e00000000, 0x2598e8f600000000, 0x73888bae00000000, 0x16ef371600000000, 0xf840820400000000, 0x9d273ebc00000000, 0x241fe92100000000, 0x4178559900000000, 0xafd7e08b00000000, 0xcab05c3300000000, 0x3bb659ed00000000, 0x5ed1e55500000000, 0xb07e504700000000, 0xd519ecff00000000, 0x6c213b6200000000, 0x094687da00000000, 0xe7e932c800000000, 0x828e8e7000000000, 0xd49eed2800000000, 0xb1f9519000000000, 0x5f56e48200000000, 0x3a31583a00000000, 0x83098fa700000000, 0xe66e331f00000000, 0x08c1860d00000000, 0x6da63ab500000000, 0xa4e140bd00000000, 0xc186fc0500000000, 0x2f29491700000000, 0x4a4ef5af00000000, 0xf376223200000000, 0x96119e8a00000000, 0x78be2b9800000000, 0x1dd9972000000000, 0x4bc9f47800000000, 0x2eae48c000000000, 0xc001fdd200000000, 0xa566416a00000000, 0x1c5e96f700000000, 0x79392a4f00000000, 0x97969f5d00000000, 0xf2f123e500000000, 0x05196b4d00000000, 0x607ed7f500000000, 0x8ed162e700000000, 0xebb6de5f00000000, 0x528e09c200000000, 0x37e9b57a00000000, 0xd946006800000000, 0xbc21bcd000000000, 0xea31df8800000000, 0x8f56633000000000, 0x61f9d62200000000, 0x049e6a9a00000000, 0xbda6bd0700000000, 0xd8c101bf00000000, 0x366eb4ad00000000, 0x5309081500000000, 0x9a4e721d00000000, 0xff29cea500000000, 0x11867bb700000000, 0x74e1c70f00000000, 0xcdd9109200000000, 0xa8beac2a00000000, 0x4611193800000000, 0x2376a58000000000, 0x7566c6d800000000, 0x10017a6000000000, 0xfeaecf7200000000, 0x9bc973ca00000000, 0x22f1a45700000000, 0x479618ef00000000, 0xa939adfd00000000, 0xcc5e114500000000, 0x06ee4d7600000000, 0x6389f1ce00000000, 0x8d2644dc00000000, 0xe841f86400000000, 0x51792ff900000000, 0x341e934100000000, 0xdab1265300000000, 0xbfd69aeb00000000, 0xe9c6f9b300000000, 0x8ca1450b00000000, 0x620ef01900000000, 0x07694ca100000000, 0xbe519b3c00000000, 0xdb36278400000000, 0x3599929600000000, 0x50fe2e2e00000000, 0x99b9542600000000, 0xfcdee89e00000000, 0x12715d8c00000000, 0x7716e13400000000, 0xce2e36a900000000, 0xab498a1100000000, 0x45e63f0300000000, 0x208183bb00000000, 0x7691e0e300000000, 0x13f65c5b00000000, 0xfd59e94900000000, 0x983e55f100000000, 0x2106826c00000000, 0x44613ed400000000, 0xaace8bc600000000, 0xcfa9377e00000000, 0x38417fd600000000, 0x5d26c36e00000000, 0xb389767c00000000, 0xd6eecac400000000, 0x6fd61d5900000000, 0x0ab1a1e100000000, 0xe41e14f300000000, 0x8179a84b00000000, 0xd769cb1300000000, 0xb20e77ab00000000, 0x5ca1c2b900000000, 0x39c67e0100000000, 0x80fea99c00000000, 0xe599152400000000, 0x0b36a03600000000, 0x6e511c8e00000000, 0xa716668600000000, 0xc271da3e00000000, 0x2cde6f2c00000000, 0x49b9d39400000000, 0xf081040900000000, 0x95e6b8b100000000, 0x7b490da300000000, 0x1e2eb11b00000000, 0x483ed24300000000, 0x2d596efb00000000, 0xc3f6dbe900000000, 0xa691675100000000, 0x1fa9b0cc00000000, 0x7ace0c7400000000, 0x9461b96600000000, 0xf10605de00000000}, {0x0000000000000000, 0xb029603d00000000, 0x6053c07a00000000, 0xd07aa04700000000, 0xc0a680f500000000, 0x708fe0c800000000, 0xa0f5408f00000000, 0x10dc20b200000000, 0xc14b703000000000, 0x7162100d00000000, 0xa118b04a00000000, 0x1131d07700000000, 0x01edf0c500000000, 0xb1c490f800000000, 0x61be30bf00000000, 0xd197508200000000, 0x8297e06000000000, 0x32be805d00000000, 0xe2c4201a00000000, 0x52ed402700000000, 0x4231609500000000, 0xf21800a800000000, 0x2262a0ef00000000, 0x924bc0d200000000, 0x43dc905000000000, 0xf3f5f06d00000000, 0x238f502a00000000, 0x93a6301700000000, 0x837a10a500000000, 0x3353709800000000, 0xe329d0df00000000, 0x5300b0e200000000, 0x042fc1c100000000, 0xb406a1fc00000000, 0x647c01bb00000000, 0xd455618600000000, 0xc489413400000000, 0x74a0210900000000, 0xa4da814e00000000, 0x14f3e17300000000, 0xc564b1f100000000, 0x754dd1cc00000000, 0xa537718b00000000, 0x151e11b600000000, 0x05c2310400000000, 0xb5eb513900000000, 0x6591f17e00000000, 0xd5b8914300000000, 0x86b821a100000000, 0x3691419c00000000, 0xe6ebe1db00000000, 0x56c281e600000000, 0x461ea15400000000, 0xf637c16900000000, 0x264d612e00000000, 0x9664011300000000, 0x47f3519100000000, 0xf7da31ac00000000, 0x27a091eb00000000, 0x9789f1d600000000, 0x8755d16400000000, 0x377cb15900000000, 0xe706111e00000000, 0x572f712300000000, 0x4958f35800000000, 0xf971936500000000, 0x290b332200000000, 0x9922531f00000000, 0x89fe73ad00000000, 0x39d7139000000000, 0xe9adb3d700000000, 0x5984d3ea00000000, 0x8813836800000000, 0x383ae35500000000, 0xe840431200000000, 0x5869232f00000000, 0x48b5039d00000000, 0xf89c63a000000000, 0x28e6c3e700000000, 0x98cfa3da00000000, 0xcbcf133800000000, 0x7be6730500000000, 0xab9cd34200000000, 0x1bb5b37f00000000, 0x0b6993cd00000000, 0xbb40f3f000000000, 0x6b3a53b700000000, 0xdb13338a00000000, 0x0a84630800000000, 0xbaad033500000000, 0x6ad7a37200000000, 0xdafec34f00000000, 0xca22e3fd00000000, 0x7a0b83c000000000, 0xaa71238700000000, 0x1a5843ba00000000, 0x4d77329900000000, 0xfd5e52a400000000, 0x2d24f2e300000000, 0x9d0d92de00000000, 0x8dd1b26c00000000, 0x3df8d25100000000, 0xed82721600000000, 0x5dab122b00000000, 0x8c3c42a900000000, 0x3c15229400000000, 0xec6f82d300000000, 0x5c46e2ee00000000, 0x4c9ac25c00000000, 0xfcb3a26100000000, 0x2cc9022600000000, 0x9ce0621b00000000, 0xcfe0d2f900000000, 0x7fc9b2c400000000, 0xafb3128300000000, 0x1f9a72be00000000, 0x0f46520c00000000, 0xbf6f323100000000, 0x6f15927600000000, 0xdf3cf24b00000000, 0x0eaba2c900000000, 0xbe82c2f400000000, 0x6ef862b300000000, 0xded1028e00000000, 0xce0d223c00000000, 0x7e24420100000000, 0xae5ee24600000000, 0x1e77827b00000000, 0x92b0e6b100000000, 0x2299868c00000000, 0xf2e326cb00000000, 0x42ca46f600000000, 0x5216664400000000, 0xe23f067900000000, 0x3245a63e00000000, 0x826cc60300000000, 0x53fb968100000000, 0xe3d2f6bc00000000, 0x33a856fb00000000, 0x838136c600000000, 0x935d167400000000, 0x2374764900000000, 0xf30ed60e00000000, 0x4327b63300000000, 0x102706d100000000, 0xa00e66ec00000000, 0x7074c6ab00000000, 0xc05da69600000000, 0xd081862400000000, 0x60a8e61900000000, 0xb0d2465e00000000, 0x00fb266300000000, 0xd16c76e100000000, 0x614516dc00000000, 0xb13fb69b00000000, 0x0116d6a600000000, 0x11caf61400000000, 0xa1e3962900000000, 0x7199366e00000000, 0xc1b0565300000000, 0x969f277000000000, 0x26b6474d00000000, 0xf6cce70a00000000, 0x46e5873700000000, 0x5639a78500000000, 0xe610c7b800000000, 0x366a67ff00000000, 0x864307c200000000, 0x57d4574000000000, 0xe7fd377d00000000, 0x3787973a00000000, 0x87aef70700000000, 0x9772d7b500000000, 0x275bb78800000000, 0xf72117cf00000000, 0x470877f200000000, 0x1408c71000000000, 0xa421a72d00000000, 0x745b076a00000000, 0xc472675700000000, 0xd4ae47e500000000, 0x648727d800000000, 0xb4fd879f00000000, 0x04d4e7a200000000, 0xd543b72000000000, 0x656ad71d00000000, 0xb510775a00000000, 0x0539176700000000, 0x15e537d500000000, 0xa5cc57e800000000, 0x75b6f7af00000000, 0xc59f979200000000, 0xdbe815e900000000, 0x6bc175d400000000, 0xbbbbd59300000000, 0x0b92b5ae00000000, 0x1b4e951c00000000, 0xab67f52100000000, 0x7b1d556600000000, 0xcb34355b00000000, 0x1aa365d900000000, 0xaa8a05e400000000, 0x7af0a5a300000000, 0xcad9c59e00000000, 0xda05e52c00000000, 0x6a2c851100000000, 0xba56255600000000, 0x0a7f456b00000000, 0x597ff58900000000, 0xe95695b400000000, 0x392c35f300000000, 0x890555ce00000000, 0x99d9757c00000000, 0x29f0154100000000, 0xf98ab50600000000, 0x49a3d53b00000000, 0x983485b900000000, 0x281de58400000000, 0xf86745c300000000, 0x484e25fe00000000, 0x5892054c00000000, 0xe8bb657100000000, 0x38c1c53600000000, 0x88e8a50b00000000, 0xdfc7d42800000000, 0x6feeb41500000000, 0xbf94145200000000, 0x0fbd746f00000000, 0x1f6154dd00000000, 0xaf4834e000000000, 0x7f3294a700000000, 0xcf1bf49a00000000, 0x1e8ca41800000000, 0xaea5c42500000000, 0x7edf646200000000, 0xcef6045f00000000, 0xde2a24ed00000000, 0x6e0344d000000000, 0xbe79e49700000000, 0x0e5084aa00000000, 0x5d50344800000000, 0xed79547500000000, 0x3d03f43200000000, 0x8d2a940f00000000, 0x9df6b4bd00000000, 0x2ddfd48000000000, 0xfda574c700000000, 0x4d8c14fa00000000, 0x9c1b447800000000, 0x2c32244500000000, 0xfc48840200000000, 0x4c61e43f00000000, 0x5cbdc48d00000000, 0xec94a4b000000000, 0x3cee04f700000000, 0x8cc764ca00000000}, {0x0000000000000000, 0xa5d35ccb00000000, 0x0ba1c84d00000000, 0xae72948600000000, 0x1642919b00000000, 0xb391cd5000000000, 0x1de359d600000000, 0xb830051d00000000, 0x6d8253ec00000000, 0xc8510f2700000000, 0x66239ba100000000, 0xc3f0c76a00000000, 0x7bc0c27700000000, 0xde139ebc00000000, 0x70610a3a00000000, 0xd5b256f100000000, 0x9b02d60300000000, 0x3ed18ac800000000, 0x90a31e4e00000000, 0x3570428500000000, 0x8d40479800000000, 0x28931b5300000000, 0x86e18fd500000000, 0x2332d31e00000000, 0xf68085ef00000000, 0x5353d92400000000, 0xfd214da200000000, 0x58f2116900000000, 0xe0c2147400000000, 0x451148bf00000000, 0xeb63dc3900000000, 0x4eb080f200000000, 0x3605ac0700000000, 0x93d6f0cc00000000, 0x3da4644a00000000, 0x9877388100000000, 0x20473d9c00000000, 0x8594615700000000, 0x2be6f5d100000000, 0x8e35a91a00000000, 0x5b87ffeb00000000, 0xfe54a32000000000, 0x502637a600000000, 0xf5f56b6d00000000, 0x4dc56e7000000000, 0xe81632bb00000000, 0x4664a63d00000000, 0xe3b7faf600000000, 0xad077a0400000000, 0x08d426cf00000000, 0xa6a6b24900000000, 0x0375ee8200000000, 0xbb45eb9f00000000, 0x1e96b75400000000, 0xb0e423d200000000, 0x15377f1900000000, 0xc08529e800000000, 0x6556752300000000, 0xcb24e1a500000000, 0x6ef7bd6e00000000, 0xd6c7b87300000000, 0x7314e4b800000000, 0xdd66703e00000000, 0x78b52cf500000000, 0x6c0a580f00000000, 0xc9d904c400000000, 0x67ab904200000000, 0xc278cc8900000000, 0x7a48c99400000000, 0xdf9b955f00000000, 0x71e901d900000000, 0xd43a5d1200000000, 0x01880be300000000, 0xa45b572800000000, 0x0a29c3ae00000000, 0xaffa9f6500000000, 0x17ca9a7800000000, 0xb219c6b300000000, 0x1c6b523500000000, 0xb9b80efe00000000, 0xf7088e0c00000000, 0x52dbd2c700000000, 0xfca9464100000000, 0x597a1a8a00000000, 0xe14a1f9700000000, 0x4499435c00000000, 0xeaebd7da00000000, 0x4f388b1100000000, 0x9a8adde000000000, 0x3f59812b00000000, 0x912b15ad00000000, 0x34f8496600000000, 0x8cc84c7b00000000, 0x291b10b000000000, 0x8769843600000000, 0x22bad8fd00000000, 0x5a0ff40800000000, 0xffdca8c300000000, 0x51ae3c4500000000, 0xf47d608e00000000, 0x4c4d659300000000, 0xe99e395800000000, 0x47ecadde00000000, 0xe23ff11500000000, 0x378da7e400000000, 0x925efb2f00000000, 0x3c2c6fa900000000, 0x99ff336200000000, 0x21cf367f00000000, 0x841c6ab400000000, 0x2a6efe3200000000, 0x8fbda2f900000000, 0xc10d220b00000000, 0x64de7ec000000000, 0xcaacea4600000000, 0x6f7fb68d00000000, 0xd74fb39000000000, 0x729cef5b00000000, 0xdcee7bdd00000000, 0x793d271600000000, 0xac8f71e700000000, 0x095c2d2c00000000, 0xa72eb9aa00000000, 0x02fde56100000000, 0xbacde07c00000000, 0x1f1ebcb700000000, 0xb16c283100000000, 0x14bf74fa00000000, 0xd814b01e00000000, 0x7dc7ecd500000000, 0xd3b5785300000000, 0x7666249800000000, 0xce56218500000000, 0x6b857d4e00000000, 0xc5f7e9c800000000, 0x6024b50300000000, 0xb596e3f200000000, 0x1045bf3900000000, 0xbe372bbf00000000, 0x1be4777400000000, 0xa3d4726900000000, 0x06072ea200000000, 0xa875ba2400000000, 0x0da6e6ef00000000, 0x4316661d00000000, 0xe6c53ad600000000, 0x48b7ae5000000000, 0xed64f29b00000000, 0x5554f78600000000, 0xf087ab4d00000000, 0x5ef53fcb00000000, 0xfb26630000000000, 0x2e9435f100000000, 0x8b47693a00000000, 0x2535fdbc00000000, 0x80e6a17700000000, 0x38d6a46a00000000, 0x9d05f8a100000000, 0x33776c2700000000, 0x96a430ec00000000, 0xee111c1900000000, 0x4bc240d200000000, 0xe5b0d45400000000, 0x4063889f00000000, 0xf8538d8200000000, 0x5d80d14900000000, 0xf3f245cf00000000, 0x5621190400000000, 0x83934ff500000000, 0x2640133e00000000, 0x883287b800000000, 0x2de1db7300000000, 0x95d1de6e00000000, 0x300282a500000000, 0x9e70162300000000, 0x3ba34ae800000000, 0x7513ca1a00000000, 0xd0c096d100000000, 0x7eb2025700000000, 0xdb615e9c00000000, 0x63515b8100000000, 0xc682074a00000000, 0x68f093cc00000000, 0xcd23cf0700000000, 0x189199f600000000, 0xbd42c53d00000000, 0x133051bb00000000, 0xb6e30d7000000000, 0x0ed3086d00000000, 0xab0054a600000000, 0x0572c02000000000, 0xa0a19ceb00000000, 0xb41ee81100000000, 0x11cdb4da00000000, 0xbfbf205c00000000, 0x1a6c7c9700000000, 0xa25c798a00000000, 0x078f254100000000, 0xa9fdb1c700000000, 0x0c2eed0c00000000, 0xd99cbbfd00000000, 0x7c4fe73600000000, 0xd23d73b000000000, 0x77ee2f7b00000000, 0xcfde2a6600000000, 0x6a0d76ad00000000, 0xc47fe22b00000000, 0x61acbee000000000, 0x2f1c3e1200000000, 0x8acf62d900000000, 0x24bdf65f00000000, 0x816eaa9400000000, 0x395eaf8900000000, 0x9c8df34200000000, 0x32ff67c400000000, 0x972c3b0f00000000, 0x429e6dfe00000000, 0xe74d313500000000, 0x493fa5b300000000, 0xececf97800000000, 0x54dcfc6500000000, 0xf10fa0ae00000000, 0x5f7d342800000000, 0xfaae68e300000000, 0x821b441600000000, 0x27c818dd00000000, 0x89ba8c5b00000000, 0x2c69d09000000000, 0x9459d58d00000000, 0x318a894600000000, 0x9ff81dc000000000, 0x3a2b410b00000000, 0xef9917fa00000000, 0x4a4a4b3100000000, 0xe438dfb700000000, 0x41eb837c00000000, 0xf9db866100000000, 0x5c08daaa00000000, 0xf27a4e2c00000000, 0x57a912e700000000, 0x1919921500000000, 0xbccacede00000000, 0x12b85a5800000000, 0xb76b069300000000, 0x0f5b038e00000000, 0xaa885f4500000000, 0x04facbc300000000, 0xa129970800000000, 0x749bc1f900000000, 0xd1489d3200000000, 0x7f3a09b400000000, 0xdae9557f00000000, 0x62d9506200000000, 0xc70a0ca900000000, 0x6978982f00000000, 0xccabc4e400000000}, {0x0000000000000000, 0xb40b77a600000000, 0x29119f9700000000, 0x9d1ae83100000000, 0x13244ff400000000, 0xa72f385200000000, 0x3a35d06300000000, 0x8e3ea7c500000000, 0x674eef3300000000, 0xd345989500000000, 0x4e5f70a400000000, 0xfa54070200000000, 0x746aa0c700000000, 0xc061d76100000000, 0x5d7b3f5000000000, 0xe97048f600000000, 0xce9cde6700000000, 0x7a97a9c100000000, 0xe78d41f000000000, 0x5386365600000000, 0xddb8919300000000, 0x69b3e63500000000, 0xf4a90e0400000000, 0x40a279a200000000, 0xa9d2315400000000, 0x1dd946f200000000, 0x80c3aec300000000, 0x34c8d96500000000, 0xbaf67ea000000000, 0x0efd090600000000, 0x93e7e13700000000, 0x27ec969100000000, 0x9c39bdcf00000000, 0x2832ca6900000000, 0xb528225800000000, 0x012355fe00000000, 0x8f1df23b00000000, 0x3b16859d00000000, 0xa60c6dac00000000, 0x12071a0a00000000, 0xfb7752fc00000000, 0x4f7c255a00000000, 0xd266cd6b00000000, 0x666dbacd00000000, 0xe8531d0800000000, 0x5c586aae00000000, 0xc142829f00000000, 0x7549f53900000000, 0x52a563a800000000, 0xe6ae140e00000000, 0x7bb4fc3f00000000, 0xcfbf8b9900000000, 0x41812c5c00000000, 0xf58a5bfa00000000, 0x6890b3cb00000000, 0xdc9bc46d00000000, 0x35eb8c9b00000000, 0x81e0fb3d00000000, 0x1cfa130c00000000, 0xa8f164aa00000000, 0x26cfc36f00000000, 0x92c4b4c900000000, 0x0fde5cf800000000, 0xbbd52b5e00000000, 0x79750b4400000000, 0xcd7e7ce200000000, 0x506494d300000000, 0xe46fe37500000000, 0x6a5144b000000000, 0xde5a331600000000, 0x4340db2700000000, 0xf74bac8100000000, 0x1e3be47700000000, 0xaa3093d100000000, 0x372a7be000000000, 0x83210c4600000000, 0x0d1fab8300000000, 0xb914dc2500000000, 0x240e341400000000, 0x900543b200000000, 0xb7e9d52300000000, 0x03e2a28500000000, 0x9ef84ab400000000, 0x2af33d1200000000, 0xa4cd9ad700000000, 0x10c6ed7100000000, 0x8ddc054000000000, 0x39d772e600000000, 0xd0a73a1000000000, 0x64ac4db600000000, 0xf9b6a58700000000, 0x4dbdd22100000000, 0xc38375e400000000, 0x7788024200000000, 0xea92ea7300000000, 0x5e999dd500000000, 0xe54cb68b00000000, 0x5147c12d00000000, 0xcc5d291c00000000, 0x78565eba00000000, 0xf668f97f00000000, 0x42638ed900000000, 0xdf7966e800000000, 0x6b72114e00000000, 0x820259b800000000, 0x36092e1e00000000, 0xab13c62f00000000, 0x1f18b18900000000, 0x9126164c00000000, 0x252d61ea00000000, 0xb83789db00000000, 0x0c3cfe7d00000000, 0x2bd068ec00000000, 0x9fdb1f4a00000000, 0x02c1f77b00000000, 0xb6ca80dd00000000, 0x38f4271800000000, 0x8cff50be00000000, 0x11e5b88f00000000, 0xa5eecf2900000000, 0x4c9e87df00000000, 0xf895f07900000000, 0x658f184800000000, 0xd1846fee00000000, 0x5fbac82b00000000, 0xebb1bf8d00000000, 0x76ab57bc00000000, 0xc2a0201a00000000, 0xf2ea168800000000, 0x46e1612e00000000, 0xdbfb891f00000000, 0x6ff0feb900000000, 0xe1ce597c00000000, 0x55c52eda00000000, 0xc8dfc6eb00000000, 0x7cd4b14d00000000, 0x95a4f9bb00000000, 0x21af8e1d00000000, 0xbcb5662c00000000, 0x08be118a00000000, 0x8680b64f00000000, 0x328bc1e900000000, 0xaf9129d800000000, 0x1b9a5e7e00000000, 0x3c76c8ef00000000, 0x887dbf4900000000, 0x1567577800000000, 0xa16c20de00000000, 0x2f52871b00000000, 0x9b59f0bd00000000, 0x0643188c00000000, 0xb2486f2a00000000, 0x5b3827dc00000000, 0xef33507a00000000, 0x7229b84b00000000, 0xc622cfed00000000, 0x481c682800000000, 0xfc171f8e00000000, 0x610df7bf00000000, 0xd506801900000000, 0x6ed3ab4700000000, 0xdad8dce100000000, 0x47c234d000000000, 0xf3c9437600000000, 0x7df7e4b300000000, 0xc9fc931500000000, 0x54e67b2400000000, 0xe0ed0c8200000000, 0x099d447400000000, 0xbd9633d200000000, 0x208cdbe300000000, 0x9487ac4500000000, 0x1ab90b8000000000, 0xaeb27c2600000000, 0x33a8941700000000, 0x87a3e3b100000000, 0xa04f752000000000, 0x1444028600000000, 0x895eeab700000000, 0x3d559d1100000000, 0xb36b3ad400000000, 0x07604d7200000000, 0x9a7aa54300000000, 0x2e71d2e500000000, 0xc7019a1300000000, 0x730aedb500000000, 0xee10058400000000, 0x5a1b722200000000, 0xd425d5e700000000, 0x602ea24100000000, 0xfd344a7000000000, 0x493f3dd600000000, 0x8b9f1dcc00000000, 0x3f946a6a00000000, 0xa28e825b00000000, 0x1685f5fd00000000, 0x98bb523800000000, 0x2cb0259e00000000, 0xb1aacdaf00000000, 0x05a1ba0900000000, 0xecd1f2ff00000000, 0x58da855900000000, 0xc5c06d6800000000, 0x71cb1ace00000000, 0xfff5bd0b00000000, 0x4bfecaad00000000, 0xd6e4229c00000000, 0x62ef553a00000000, 0x4503c3ab00000000, 0xf108b40d00000000, 0x6c125c3c00000000, 0xd8192b9a00000000, 0x56278c5f00000000, 0xe22cfbf900000000, 0x7f3613c800000000, 0xcb3d646e00000000, 0x224d2c9800000000, 0x96465b3e00000000, 0x0b5cb30f00000000, 0xbf57c4a900000000, 0x3169636c00000000, 0x856214ca00000000, 0x1878fcfb00000000, 0xac738b5d00000000, 0x17a6a00300000000, 0xa3add7a500000000, 0x3eb73f9400000000, 0x8abc483200000000, 0x0482eff700000000, 0xb089985100000000, 0x2d93706000000000, 0x999807c600000000, 0x70e84f3000000000, 0xc4e3389600000000, 0x59f9d0a700000000, 0xedf2a70100000000, 0x63cc00c400000000, 0xd7c7776200000000, 0x4add9f5300000000, 0xfed6e8f500000000, 0xd93a7e6400000000, 0x6d3109c200000000, 0xf02be1f300000000, 0x4420965500000000, 0xca1e319000000000, 0x7e15463600000000, 0xe30fae0700000000, 0x5704d9a100000000, 0xbe74915700000000, 0x0a7fe6f100000000, 0x97650ec000000000, 0x236e796600000000, 0xad50dea300000000, 0x195ba90500000000, 0x8441413400000000, 0x304a369200000000}, {0x0000000000000000, 0x9e00aacc00000000, 0x7d07254200000000, 0xe3078f8e00000000, 0xfa0e4a8400000000, 0x640ee04800000000, 0x87096fc600000000, 0x1909c50a00000000, 0xb51be5d300000000, 0x2b1b4f1f00000000, 0xc81cc09100000000, 0x561c6a5d00000000, 0x4f15af5700000000, 0xd115059b00000000, 0x32128a1500000000, 0xac1220d900000000, 0x2b31bb7c00000000, 0xb53111b000000000, 0x56369e3e00000000, 0xc83634f200000000, 0xd13ff1f800000000, 0x4f3f5b3400000000, 0xac38d4ba00000000, 0x32387e7600000000, 0x9e2a5eaf00000000, 0x002af46300000000, 0xe32d7bed00000000, 0x7d2dd12100000000, 0x6424142b00000000, 0xfa24bee700000000, 0x1923316900000000, 0x87239ba500000000, 0x566276f900000000, 0xc862dc3500000000, 0x2b6553bb00000000, 0xb565f97700000000, 0xac6c3c7d00000000, 0x326c96b100000000, 0xd16b193f00000000, 0x4f6bb3f300000000, 0xe379932a00000000, 0x7d7939e600000000, 0x9e7eb66800000000, 0x007e1ca400000000, 0x1977d9ae00000000, 0x8777736200000000, 0x6470fcec00000000, 0xfa70562000000000, 0x7d53cd8500000000, 0xe353674900000000, 0x0054e8c700000000, 0x9e54420b00000000, 0x875d870100000000, 0x195d2dcd00000000, 0xfa5aa24300000000, 0x645a088f00000000, 0xc848285600000000, 0x5648829a00000000, 0xb54f0d1400000000, 0x2b4fa7d800000000, 0x324662d200000000, 0xac46c81e00000000, 0x4f41479000000000, 0xd141ed5c00000000, 0xedc29d2900000000, 0x73c237e500000000, 0x90c5b86b00000000, 0x0ec512a700000000, 0x17ccd7ad00000000, 0x89cc7d6100000000, 0x6acbf2ef00000000, 0xf4cb582300000000, 0x58d978fa00000000, 0xc6d9d23600000000, 0x25de5db800000000, 0xbbdef77400000000, 0xa2d7327e00000000, 0x3cd798b200000000, 0xdfd0173c00000000, 0x41d0bdf000000000, 0xc6f3265500000000, 0x58f38c9900000000, 0xbbf4031700000000, 0x25f4a9db00000000, 0x3cfd6cd100000000, 0xa2fdc61d00000000, 0x41fa499300000000, 0xdffae35f00000000, 0x73e8c38600000000, 0xede8694a00000000, 0x0eefe6c400000000, 0x90ef4c0800000000, 0x89e6890200000000, 0x17e623ce00000000, 0xf4e1ac4000000000, 0x6ae1068c00000000, 0xbba0ebd000000000, 0x25a0411c00000000, 0xc6a7ce9200000000, 0x58a7645e00000000, 0x41aea15400000000, 0xdfae0b9800000000, 0x3ca9841600000000, 0xa2a92eda00000000, 0x0ebb0e0300000000, 0x90bba4cf00000000, 0x73bc2b4100000000, 0xedbc818d00000000, 0xf4b5448700000000, 0x6ab5ee4b00000000, 0x89b261c500000000, 0x17b2cb0900000000, 0x909150ac00000000, 0x0e91fa6000000000, 0xed9675ee00000000, 0x7396df2200000000, 0x6a9f1a2800000000, 0xf49fb0e400000000, 0x17983f6a00000000, 0x899895a600000000, 0x258ab57f00000000, 0xbb8a1fb300000000, 0x588d903d00000000, 0xc68d3af100000000, 0xdf84fffb00000000, 0x4184553700000000, 0xa283dab900000000, 0x3c83707500000000, 0xda853b5300000000, 0x4485919f00000000, 0xa7821e1100000000, 0x3982b4dd00000000, 0x208b71d700000000, 0xbe8bdb1b00000000, 0x5d8c549500000000, 0xc38cfe5900000000, 0x6f9ede8000000000, 0xf19e744c00000000, 0x1299fbc200000000, 0x8c99510e00000000, 0x9590940400000000, 0x0b903ec800000000, 0xe897b14600000000, 0x76971b8a00000000, 0xf1b4802f00000000, 0x6fb42ae300000000, 0x8cb3a56d00000000, 0x12b30fa100000000, 0x0bbacaab00000000, 0x95ba606700000000, 0x76bdefe900000000, 0xe8bd452500000000, 0x44af65fc00000000, 0xdaafcf3000000000, 0x39a840be00000000, 0xa7a8ea7200000000, 0xbea12f7800000000, 0x20a185b400000000, 0xc3a60a3a00000000, 0x5da6a0f600000000, 0x8ce74daa00000000, 0x12e7e76600000000, 0xf1e068e800000000, 0x6fe0c22400000000, 0x76e9072e00000000, 0xe8e9ade200000000, 0x0bee226c00000000, 0x95ee88a000000000, 0x39fca87900000000, 0xa7fc02b500000000, 0x44fb8d3b00000000, 0xdafb27f700000000, 0xc3f2e2fd00000000, 0x5df2483100000000, 0xbef5c7bf00000000, 0x20f56d7300000000, 0xa7d6f6d600000000, 0x39d65c1a00000000, 0xdad1d39400000000, 0x44d1795800000000, 0x5dd8bc5200000000, 0xc3d8169e00000000, 0x20df991000000000, 0xbedf33dc00000000, 0x12cd130500000000, 0x8ccdb9c900000000, 0x6fca364700000000, 0xf1ca9c8b00000000, 0xe8c3598100000000, 0x76c3f34d00000000, 0x95c47cc300000000, 0x0bc4d60f00000000, 0x3747a67a00000000, 0xa9470cb600000000, 0x4a40833800000000, 0xd44029f400000000, 0xcd49ecfe00000000, 0x5349463200000000, 0xb04ec9bc00000000, 0x2e4e637000000000, 0x825c43a900000000, 0x1c5ce96500000000, 0xff5b66eb00000000, 0x615bcc2700000000, 0x7852092d00000000, 0xe652a3e100000000, 0x05552c6f00000000, 0x9b5586a300000000, 0x1c761d0600000000, 0x8276b7ca00000000, 0x6171384400000000, 0xff71928800000000, 0xe678578200000000, 0x7878fd4e00000000, 0x9b7f72c000000000, 0x057fd80c00000000, 0xa96df8d500000000, 0x376d521900000000, 0xd46add9700000000, 0x4a6a775b00000000, 0x5363b25100000000, 0xcd63189d00000000, 0x2e64971300000000, 0xb0643ddf00000000, 0x6125d08300000000, 0xff257a4f00000000, 0x1c22f5c100000000, 0x82225f0d00000000, 0x9b2b9a0700000000, 0x052b30cb00000000, 0xe62cbf4500000000, 0x782c158900000000, 0xd43e355000000000, 0x4a3e9f9c00000000, 0xa939101200000000, 0x3739bade00000000, 0x2e307fd400000000, 0xb030d51800000000, 0x53375a9600000000, 0xcd37f05a00000000, 0x4a146bff00000000, 0xd414c13300000000, 0x37134ebd00000000, 0xa913e47100000000, 0xb01a217b00000000, 0x2e1a8bb700000000, 0xcd1d043900000000, 0x531daef500000000, 0xff0f8e2c00000000, 0x610f24e000000000, 0x8208ab6e00000000, 0x1c0801a200000000, 0x0501c4a800000000, 0x9b016e6400000000, 0x7806e1ea00000000, 0xe6064b2600000000}}; #else /* W == 4 */ local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, 0x8f629757, 0x37def032, 0x256b5fdc, 0x9dd738b9, 0xc5b428ef, 0x7d084f8a, 0x6fbde064, 0xd7018701, 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733, 0x58631056, 0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871, 0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26, 0x95ad7f70, 0x2d111815, 0x3fa4b7fb, 0x8718d09e, 0x1acfe827, 0xa2738f42, 0xb0c620ac, 0x087a47c9, 0xa032af3e, 0x188ec85b, 0x0a3b67b5, 0xb28700d0, 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787, 0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, 0xeae41086, 0x525877e3, 0x40edd80d, 0xf851bf68, 0xf02bf8a1, 0x48979fc4, 0x5a22302a, 0xe29e574f, 0x7f496ff6, 0xc7f50893, 0xd540a77d, 0x6dfcc018, 0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0, 0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7, 0x9b14583d, 0x23a83f58, 0x311d90b6, 0x89a1f7d3, 0x1476cf6a, 0xaccaa80f, 0xbe7f07e1, 0x06c36084, 0x5ea070d2, 0xe61c17b7, 0xf4a9b859, 0x4c15df3c, 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b, 0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, 0x446f98f5, 0xfcd3ff90, 0xee66507e, 0x56da371b, 0x0eb9274d, 0xb6054028, 0xa4b0efc6, 0x1c0c88a3, 0x81dbb01a, 0x3967d77f, 0x2bd27891, 0x936e1ff4, 0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed, 0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba, 0xfe92dfec, 0x462eb889, 0x549b1767, 0xec277002, 0x71f048bb, 0xc94c2fde, 0xdbf98030, 0x6345e755, 0x6b3fa09c, 0xd383c7f9, 0xc1366817, 0x798a0f72, 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825, 0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, 0x21e91f24, 0x99557841, 0x8be0d7af, 0x335cb0ca, 0xed59b63b, 0x55e5d15e, 0x47507eb0, 0xffec19d5, 0x623b216c, 0xda874609, 0xc832e9e7, 0x708e8e82, 0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a, 0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d, 0xbd40e1a4, 0x05fc86c1, 0x1749292f, 0xaff54e4a, 0x322276f3, 0x8a9e1196, 0x982bbe78, 0x2097d91d, 0x78f4c94b, 0xc048ae2e, 0xd2fd01c0, 0x6a4166a5, 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2, 0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, 0xc2098e52, 0x7ab5e937, 0x680046d9, 0xd0bc21bc, 0x88df31ea, 0x3063568f, 0x22d6f961, 0x9a6a9e04, 0x07bda6bd, 0xbf01c1d8, 0xadb46e36, 0x15080953, 0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174, 0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623, 0xd8c66675, 0x607a0110, 0x72cfaefe, 0xca73c99b, 0x57a4f122, 0xef189647, 0xfdad39a9, 0x45115ecc, 0x764dee06, 0xcef18963, 0xdc44268d, 0x64f841e8, 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf, 0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, 0x3c9b51be, 0x842736db, 0x96929935, 0x2e2efe50, 0x2654b999, 0x9ee8defc, 0x8c5d7112, 0x34e11677, 0xa9362ece, 0x118a49ab, 0x033fe645, 0xbb838120, 0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98, 0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf, 0xd67f4138, 0x6ec3265d, 0x7c7689b3, 0xc4caeed6, 0x591dd66f, 0xe1a1b10a, 0xf3141ee4, 0x4ba87981, 0x13cb69d7, 0xab770eb2, 0xb9c2a15c, 0x017ec639, 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e, 0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, 0x090481f0, 0xb1b8e695, 0xa30d497b, 0x1bb12e1e, 0x43d23e48, 0xfb6e592d, 0xe9dbf6c3, 0x516791a6, 0xccb0a91f, 0x740cce7a, 0x66b96194, 0xde0506f1}, {0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, 0x0709a8dc, 0x06cbc2eb, 0x048d7cb2, 0x054f1685, 0x0e1351b8, 0x0fd13b8f, 0x0d9785d6, 0x0c55efe1, 0x091af964, 0x08d89353, 0x0a9e2d0a, 0x0b5c473d, 0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29, 0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5, 0x1235f2c8, 0x13f798ff, 0x11b126a6, 0x10734c91, 0x153c5a14, 0x14fe3023, 0x16b88e7a, 0x177ae44d, 0x384d46e0, 0x398f2cd7, 0x3bc9928e, 0x3a0bf8b9, 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065, 0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, 0x3157bf84, 0x3095d5b3, 0x32d36bea, 0x331101dd, 0x246be590, 0x25a98fa7, 0x27ef31fe, 0x262d5bc9, 0x23624d4c, 0x22a0277b, 0x20e69922, 0x2124f315, 0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71, 0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad, 0x709a8dc0, 0x7158e7f7, 0x731e59ae, 0x72dc3399, 0x7793251c, 0x76514f2b, 0x7417f172, 0x75d59b45, 0x7e89dc78, 0x7f4bb64f, 0x7d0d0816, 0x7ccf6221, 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd, 0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, 0x6bb5866c, 0x6a77ec5b, 0x68315202, 0x69f33835, 0x62af7f08, 0x636d153f, 0x612bab66, 0x60e9c151, 0x65a6d7d4, 0x6464bde3, 0x662203ba, 0x67e0698d, 0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579, 0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5, 0x46c49a98, 0x4706f0af, 0x45404ef6, 0x448224c1, 0x41cd3244, 0x400f5873, 0x4249e62a, 0x438b8c1d, 0x54f16850, 0x55330267, 0x5775bc3e, 0x56b7d609, 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5, 0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, 0x5deb9134, 0x5c29fb03, 0x5e6f455a, 0x5fad2f6d, 0xe1351b80, 0xe0f771b7, 0xe2b1cfee, 0xe373a5d9, 0xe63cb35c, 0xe7fed96b, 0xe5b86732, 0xe47a0d05, 0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461, 0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd, 0xfd13b8f0, 0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, 0xfa1a102c, 0xfbd87a1b, 0xf99ec442, 0xf85cae75, 0xf300e948, 0xf2c2837f, 0xf0843d26, 0xf1465711, 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd, 0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, 0xde71f5bc, 0xdfb39f8b, 0xddf521d2, 0xdc374be5, 0xd76b0cd8, 0xd6a966ef, 0xd4efd8b6, 0xd52db281, 0xd062a404, 0xd1a0ce33, 0xd3e6706a, 0xd2241a5d, 0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049, 0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895, 0xcb4dafa8, 0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, 0xcc440774, 0xcd866d43, 0xcfc0d31a, 0xce02b92d, 0x91af9640, 0x906dfc77, 0x922b422e, 0x93e92819, 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5, 0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, 0x98b56f24, 0x99770513, 0x9b31bb4a, 0x9af3d17d, 0x8d893530, 0x8c4b5f07, 0x8e0de15e, 0x8fcf8b69, 0x8a809dec, 0x8b42f7db, 0x89044982, 0x88c623b5, 0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1, 0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d, 0xa9e2d0a0, 0xa820ba97, 0xaa6604ce, 0xaba46ef9, 0xaeeb787c, 0xaf29124b, 0xad6fac12, 0xacadc625, 0xa7f18118, 0xa633eb2f, 0xa4755576, 0xa5b73f41, 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d, 0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, 0xb2cddb0c, 0xb30fb13b, 0xb1490f62, 0xb08b6555, 0xbbd72268, 0xba15485f, 0xb853f606, 0xb9919c31, 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda, 0xbe9834ed}, {0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, 0x646cc504, 0x7d77f445, 0x565aa786, 0x4f4196c7, 0xc8d98a08, 0xd1c2bb49, 0xfaefe88a, 0xe3f4d9cb, 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e, 0x87981ccf, 0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192, 0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496, 0x821b9859, 0x9b00a918, 0xb02dfadb, 0xa936cb9a, 0xe6775d5d, 0xff6c6c1c, 0xd4413fdf, 0xcd5a0e9e, 0x958424a2, 0x8c9f15e3, 0xa7b24620, 0xbea97761, 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265, 0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, 0x39316bae, 0x202a5aef, 0x0b07092c, 0x121c386d, 0xdf4636f3, 0xc65d07b2, 0xed705471, 0xf46b6530, 0xbb2af3f7, 0xa231c2b6, 0x891c9175, 0x9007a034, 0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38, 0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c, 0xf0794f05, 0xe9627e44, 0xc24f2d87, 0xdb541cc6, 0x94158a01, 0x8d0ebb40, 0xa623e883, 0xbf38d9c2, 0x38a0c50d, 0x21bbf44c, 0x0a96a78f, 0x138d96ce, 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca, 0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, 0xded79850, 0xc7cca911, 0xece1fad2, 0xf5facb93, 0x7262d75c, 0x6b79e61d, 0x4054b5de, 0x594f849f, 0x160e1258, 0x0f152319, 0x243870da, 0x3d23419b, 0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864, 0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60, 0xad24e1af, 0xb43fd0ee, 0x9f12832d, 0x8609b26c, 0xc94824ab, 0xd05315ea, 0xfb7e4629, 0xe2657768, 0x2f3f79f6, 0x362448b7, 0x1d091b74, 0x04122a35, 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31, 0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, 0x838a36fa, 0x9a9107bb, 0xb1bc5478, 0xa8a76539, 0x3b83984b, 0x2298a90a, 0x09b5fac9, 0x10aecb88, 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd, 0x74c20e8c, 0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180, 0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484, 0x71418a1a, 0x685abb5b, 0x4377e898, 0x5a6cd9d9, 0x152d4f1e, 0x0c367e5f, 0x271b2d9c, 0x3e001cdd, 0xb9980012, 0xa0833153, 0x8bae6290, 0x92b553d1, 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5, 0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, 0xca6b79ed, 0xd37048ac, 0xf85d1b6f, 0xe1462a2e, 0x66de36e1, 0x7fc507a0, 0x54e85463, 0x4df36522, 0x02b2f3e5, 0x1ba9c2a4, 0x30849167, 0x299fa026, 0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b, 0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f, 0x2c1c24b0, 0x350715f1, 0x1e2a4632, 0x07317773, 0x4870e1b4, 0x516bd0f5, 0x7a468336, 0x635db277, 0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc, 0xe0d7848d, 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189, 0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, 0x674f9842, 0x7e54a903, 0x5579fac0, 0x4c62cb81, 0x8138c51f, 0x9823f45e, 0xb30ea79d, 0xaa1596dc, 0xe554001b, 0xfc4f315a, 0xd7626299, 0xce7953d8, 0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4, 0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0, 0x5e7ef3ec, 0x4765c2ad, 0x6c48916e, 0x7553a02f, 0x3a1236e8, 0x230907a9, 0x0824546a, 0x113f652b, 0x96a779e4, 0x8fbc48a5, 0xa4911b66, 0xbd8a2a27, 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23, 0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, 0x70d024b9, 0x69cb15f8, 0x42e6463b, 0x5bfd777a, 0xdc656bb5, 0xc57e5af4, 0xee530937, 0xf7483876, 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33, 0x9324fd72}, {0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x00000000, 0x96300777, 0x2c610eee, 0xba510999, 0x19c46d07, 0x8ff46a70, 0x35a563e9, 0xa395649e, 0x3288db0e, 0xa4b8dc79, 0x1ee9d5e0, 0x88d9d297, 0x2b4cb609, 0xbd7cb17e, 0x072db8e7, 0x911dbf90, 0x6410b71d, 0xf220b06a, 0x4871b9f3, 0xde41be84, 0x7dd4da1a, 0xebe4dd6d, 0x51b5d4f4, 0xc785d383, 0x56986c13, 0xc0a86b64, 0x7af962fd, 0xecc9658a, 0x4f5c0114, 0xd96c0663, 0x633d0ffa, 0xf50d088d, 0xc8206e3b, 0x5e10694c, 0xe44160d5, 0x727167a2, 0xd1e4033c, 0x47d4044b, 0xfd850dd2, 0x6bb50aa5, 0xfaa8b535, 0x6c98b242, 0xd6c9bbdb, 0x40f9bcac, 0xe36cd832, 0x755cdf45, 0xcf0dd6dc, 0x593dd1ab, 0xac30d926, 0x3a00de51, 0x8051d7c8, 0x1661d0bf, 0xb5f4b421, 0x23c4b356, 0x9995bacf, 0x0fa5bdb8, 0x9eb80228, 0x0888055f, 0xb2d90cc6, 0x24e90bb1, 0x877c6f2f, 0x114c6858, 0xab1d61c1, 0x3d2d66b6, 0x9041dc76, 0x0671db01, 0xbc20d298, 0x2a10d5ef, 0x8985b171, 0x1fb5b606, 0xa5e4bf9f, 0x33d4b8e8, 0xa2c90778, 0x34f9000f, 0x8ea80996, 0x18980ee1, 0xbb0d6a7f, 0x2d3d6d08, 0x976c6491, 0x015c63e6, 0xf4516b6b, 0x62616c1c, 0xd8306585, 0x4e0062f2, 0xed95066c, 0x7ba5011b, 0xc1f40882, 0x57c40ff5, 0xc6d9b065, 0x50e9b712, 0xeab8be8b, 0x7c88b9fc, 0xdf1ddd62, 0x492dda15, 0xf37cd38c, 0x654cd4fb, 0x5861b24d, 0xce51b53a, 0x7400bca3, 0xe230bbd4, 0x41a5df4a, 0xd795d83d, 0x6dc4d1a4, 0xfbf4d6d3, 0x6ae96943, 0xfcd96e34, 0x468867ad, 0xd0b860da, 0x732d0444, 0xe51d0333, 0x5f4c0aaa, 0xc97c0ddd, 0x3c710550, 0xaa410227, 0x10100bbe, 0x86200cc9, 0x25b56857, 0xb3856f20, 0x09d466b9, 0x9fe461ce, 0x0ef9de5e, 0x98c9d929, 0x2298d0b0, 0xb4a8d7c7, 0x173db359, 0x810db42e, 0x3b5cbdb7, 0xad6cbac0, 0x2083b8ed, 0xb6b3bf9a, 0x0ce2b603, 0x9ad2b174, 0x3947d5ea, 0xaf77d29d, 0x1526db04, 0x8316dc73, 0x120b63e3, 0x843b6494, 0x3e6a6d0d, 0xa85a6a7a, 0x0bcf0ee4, 0x9dff0993, 0x27ae000a, 0xb19e077d, 0x44930ff0, 0xd2a30887, 0x68f2011e, 0xfec20669, 0x5d5762f7, 0xcb676580, 0x71366c19, 0xe7066b6e, 0x761bd4fe, 0xe02bd389, 0x5a7ada10, 0xcc4add67, 0x6fdfb9f9, 0xf9efbe8e, 0x43beb717, 0xd58eb060, 0xe8a3d6d6, 0x7e93d1a1, 0xc4c2d838, 0x52f2df4f, 0xf167bbd1, 0x6757bca6, 0xdd06b53f, 0x4b36b248, 0xda2b0dd8, 0x4c1b0aaf, 0xf64a0336, 0x607a0441, 0xc3ef60df, 0x55df67a8, 0xef8e6e31, 0x79be6946, 0x8cb361cb, 0x1a8366bc, 0xa0d26f25, 0x36e26852, 0x95770ccc, 0x03470bbb, 0xb9160222, 0x2f260555, 0xbe3bbac5, 0x280bbdb2, 0x925ab42b, 0x046ab35c, 0xa7ffd7c2, 0x31cfd0b5, 0x8b9ed92c, 0x1daede5b, 0xb0c2649b, 0x26f263ec, 0x9ca36a75, 0x0a936d02, 0xa906099c, 0x3f360eeb, 0x85670772, 0x13570005, 0x824abf95, 0x147ab8e2, 0xae2bb17b, 0x381bb60c, 0x9b8ed292, 0x0dbed5e5, 0xb7efdc7c, 0x21dfdb0b, 0xd4d2d386, 0x42e2d4f1, 0xf8b3dd68, 0x6e83da1f, 0xcd16be81, 0x5b26b9f6, 0xe177b06f, 0x7747b718, 0xe65a0888, 0x706a0fff, 0xca3b0666, 0x5c0b0111, 0xff9e658f, 0x69ae62f8, 0xd3ff6b61, 0x45cf6c16, 0x78e20aa0, 0xeed20dd7, 0x5483044e, 0xc2b30339, 0x612667a7, 0xf71660d0, 0x4d476949, 0xdb776e3e, 0x4a6ad1ae, 0xdc5ad6d9, 0x660bdf40, 0xf03bd837, 0x53aebca9, 0xc59ebbde, 0x7fcfb247, 0xe9ffb530, 0x1cf2bdbd, 0x8ac2baca, 0x3093b353, 0xa6a3b424, 0x0536d0ba, 0x9306d7cd, 0x2957de54, 0xbf67d923, 0x2e7a66b3, 0xb84a61c4, 0x021b685d, 0x942b6f2a, 0x37be0bb4, 0xa18e0cc3, 0x1bdf055a, 0x8def022d}, {0x00000000, 0x41311b19, 0x82623632, 0xc3532d2b, 0x04c56c64, 0x45f4777d, 0x86a75a56, 0xc796414f, 0x088ad9c8, 0x49bbc2d1, 0x8ae8effa, 0xcbd9f4e3, 0x0c4fb5ac, 0x4d7eaeb5, 0x8e2d839e, 0xcf1c9887, 0x5112c24a, 0x1023d953, 0xd370f478, 0x9241ef61, 0x55d7ae2e, 0x14e6b537, 0xd7b5981c, 0x96848305, 0x59981b82, 0x18a9009b, 0xdbfa2db0, 0x9acb36a9, 0x5d5d77e6, 0x1c6c6cff, 0xdf3f41d4, 0x9e0e5acd, 0xa2248495, 0xe3159f8c, 0x2046b2a7, 0x6177a9be, 0xa6e1e8f1, 0xe7d0f3e8, 0x2483dec3, 0x65b2c5da, 0xaaae5d5d, 0xeb9f4644, 0x28cc6b6f, 0x69fd7076, 0xae6b3139, 0xef5a2a20, 0x2c09070b, 0x6d381c12, 0xf33646df, 0xb2075dc6, 0x715470ed, 0x30656bf4, 0xf7f32abb, 0xb6c231a2, 0x75911c89, 0x34a00790, 0xfbbc9f17, 0xba8d840e, 0x79dea925, 0x38efb23c, 0xff79f373, 0xbe48e86a, 0x7d1bc541, 0x3c2ade58, 0x054f79f0, 0x447e62e9, 0x872d4fc2, 0xc61c54db, 0x018a1594, 0x40bb0e8d, 0x83e823a6, 0xc2d938bf, 0x0dc5a038, 0x4cf4bb21, 0x8fa7960a, 0xce968d13, 0x0900cc5c, 0x4831d745, 0x8b62fa6e, 0xca53e177, 0x545dbbba, 0x156ca0a3, 0xd63f8d88, 0x970e9691, 0x5098d7de, 0x11a9ccc7, 0xd2fae1ec, 0x93cbfaf5, 0x5cd76272, 0x1de6796b, 0xdeb55440, 0x9f844f59, 0x58120e16, 0x1923150f, 0xda703824, 0x9b41233d, 0xa76bfd65, 0xe65ae67c, 0x2509cb57, 0x6438d04e, 0xa3ae9101, 0xe29f8a18, 0x21cca733, 0x60fdbc2a, 0xafe124ad, 0xeed03fb4, 0x2d83129f, 0x6cb20986, 0xab2448c9, 0xea1553d0, 0x29467efb, 0x687765e2, 0xf6793f2f, 0xb7482436, 0x741b091d, 0x352a1204, 0xf2bc534b, 0xb38d4852, 0x70de6579, 0x31ef7e60, 0xfef3e6e7, 0xbfc2fdfe, 0x7c91d0d5, 0x3da0cbcc, 0xfa368a83, 0xbb07919a, 0x7854bcb1, 0x3965a7a8, 0x4b98833b, 0x0aa99822, 0xc9fab509, 0x88cbae10, 0x4f5def5f, 0x0e6cf446, 0xcd3fd96d, 0x8c0ec274, 0x43125af3, 0x022341ea, 0xc1706cc1, 0x804177d8, 0x47d73697, 0x06e62d8e, 0xc5b500a5, 0x84841bbc, 0x1a8a4171, 0x5bbb5a68, 0x98e87743, 0xd9d96c5a, 0x1e4f2d15, 0x5f7e360c, 0x9c2d1b27, 0xdd1c003e, 0x120098b9, 0x533183a0, 0x9062ae8b, 0xd153b592, 0x16c5f4dd, 0x57f4efc4, 0x94a7c2ef, 0xd596d9f6, 0xe9bc07ae, 0xa88d1cb7, 0x6bde319c, 0x2aef2a85, 0xed796bca, 0xac4870d3, 0x6f1b5df8, 0x2e2a46e1, 0xe136de66, 0xa007c57f, 0x6354e854, 0x2265f34d, 0xe5f3b202, 0xa4c2a91b, 0x67918430, 0x26a09f29, 0xb8aec5e4, 0xf99fdefd, 0x3accf3d6, 0x7bfde8cf, 0xbc6ba980, 0xfd5ab299, 0x3e099fb2, 0x7f3884ab, 0xb0241c2c, 0xf1150735, 0x32462a1e, 0x73773107, 0xb4e17048, 0xf5d06b51, 0x3683467a, 0x77b25d63, 0x4ed7facb, 0x0fe6e1d2, 0xccb5ccf9, 0x8d84d7e0, 0x4a1296af, 0x0b238db6, 0xc870a09d, 0x8941bb84, 0x465d2303, 0x076c381a, 0xc43f1531, 0x850e0e28, 0x42984f67, 0x03a9547e, 0xc0fa7955, 0x81cb624c, 0x1fc53881, 0x5ef42398, 0x9da70eb3, 0xdc9615aa, 0x1b0054e5, 0x5a314ffc, 0x996262d7, 0xd85379ce, 0x174fe149, 0x567efa50, 0x952dd77b, 0xd41ccc62, 0x138a8d2d, 0x52bb9634, 0x91e8bb1f, 0xd0d9a006, 0xecf37e5e, 0xadc26547, 0x6e91486c, 0x2fa05375, 0xe836123a, 0xa9070923, 0x6a542408, 0x2b653f11, 0xe479a796, 0xa548bc8f, 0x661b91a4, 0x272a8abd, 0xe0bccbf2, 0xa18dd0eb, 0x62defdc0, 0x23efe6d9, 0xbde1bc14, 0xfcd0a70d, 0x3f838a26, 0x7eb2913f, 0xb924d070, 0xf815cb69, 0x3b46e642, 0x7a77fd5b, 0xb56b65dc, 0xf45a7ec5, 0x370953ee, 0x763848f7, 0xb1ae09b8, 0xf09f12a1, 0x33cc3f8a, 0x72fd2493}, {0x00000000, 0x376ac201, 0x6ed48403, 0x59be4602, 0xdca80907, 0xebc2cb06, 0xb27c8d04, 0x85164f05, 0xb851130e, 0x8f3bd10f, 0xd685970d, 0xe1ef550c, 0x64f91a09, 0x5393d808, 0x0a2d9e0a, 0x3d475c0b, 0x70a3261c, 0x47c9e41d, 0x1e77a21f, 0x291d601e, 0xac0b2f1b, 0x9b61ed1a, 0xc2dfab18, 0xf5b56919, 0xc8f23512, 0xff98f713, 0xa626b111, 0x914c7310, 0x145a3c15, 0x2330fe14, 0x7a8eb816, 0x4de47a17, 0xe0464d38, 0xd72c8f39, 0x8e92c93b, 0xb9f80b3a, 0x3cee443f, 0x0b84863e, 0x523ac03c, 0x6550023d, 0x58175e36, 0x6f7d9c37, 0x36c3da35, 0x01a91834, 0x84bf5731, 0xb3d59530, 0xea6bd332, 0xdd011133, 0x90e56b24, 0xa78fa925, 0xfe31ef27, 0xc95b2d26, 0x4c4d6223, 0x7b27a022, 0x2299e620, 0x15f32421, 0x28b4782a, 0x1fdeba2b, 0x4660fc29, 0x710a3e28, 0xf41c712d, 0xc376b32c, 0x9ac8f52e, 0xada2372f, 0xc08d9a70, 0xf7e75871, 0xae591e73, 0x9933dc72, 0x1c259377, 0x2b4f5176, 0x72f11774, 0x459bd575, 0x78dc897e, 0x4fb64b7f, 0x16080d7d, 0x2162cf7c, 0xa4748079, 0x931e4278, 0xcaa0047a, 0xfdcac67b, 0xb02ebc6c, 0x87447e6d, 0xdefa386f, 0xe990fa6e, 0x6c86b56b, 0x5bec776a, 0x02523168, 0x3538f369, 0x087faf62, 0x3f156d63, 0x66ab2b61, 0x51c1e960, 0xd4d7a665, 0xe3bd6464, 0xba032266, 0x8d69e067, 0x20cbd748, 0x17a11549, 0x4e1f534b, 0x7975914a, 0xfc63de4f, 0xcb091c4e, 0x92b75a4c, 0xa5dd984d, 0x989ac446, 0xaff00647, 0xf64e4045, 0xc1248244, 0x4432cd41, 0x73580f40, 0x2ae64942, 0x1d8c8b43, 0x5068f154, 0x67023355, 0x3ebc7557, 0x09d6b756, 0x8cc0f853, 0xbbaa3a52, 0xe2147c50, 0xd57ebe51, 0xe839e25a, 0xdf53205b, 0x86ed6659, 0xb187a458, 0x3491eb5d, 0x03fb295c, 0x5a456f5e, 0x6d2fad5f, 0x801b35e1, 0xb771f7e0, 0xeecfb1e2, 0xd9a573e3, 0x5cb33ce6, 0x6bd9fee7, 0x3267b8e5, 0x050d7ae4, 0x384a26ef, 0x0f20e4ee, 0x569ea2ec, 0x61f460ed, 0xe4e22fe8, 0xd388ede9, 0x8a36abeb, 0xbd5c69ea, 0xf0b813fd, 0xc7d2d1fc, 0x9e6c97fe, 0xa90655ff, 0x2c101afa, 0x1b7ad8fb, 0x42c49ef9, 0x75ae5cf8, 0x48e900f3, 0x7f83c2f2, 0x263d84f0, 0x115746f1, 0x944109f4, 0xa32bcbf5, 0xfa958df7, 0xcdff4ff6, 0x605d78d9, 0x5737bad8, 0x0e89fcda, 0x39e33edb, 0xbcf571de, 0x8b9fb3df, 0xd221f5dd, 0xe54b37dc, 0xd80c6bd7, 0xef66a9d6, 0xb6d8efd4, 0x81b22dd5, 0x04a462d0, 0x33cea0d1, 0x6a70e6d3, 0x5d1a24d2, 0x10fe5ec5, 0x27949cc4, 0x7e2adac6, 0x494018c7, 0xcc5657c2, 0xfb3c95c3, 0xa282d3c1, 0x95e811c0, 0xa8af4dcb, 0x9fc58fca, 0xc67bc9c8, 0xf1110bc9, 0x740744cc, 0x436d86cd, 0x1ad3c0cf, 0x2db902ce, 0x4096af91, 0x77fc6d90, 0x2e422b92, 0x1928e993, 0x9c3ea696, 0xab546497, 0xf2ea2295, 0xc580e094, 0xf8c7bc9f, 0xcfad7e9e, 0x9613389c, 0xa179fa9d, 0x246fb598, 0x13057799, 0x4abb319b, 0x7dd1f39a, 0x3035898d, 0x075f4b8c, 0x5ee10d8e, 0x698bcf8f, 0xec9d808a, 0xdbf7428b, 0x82490489, 0xb523c688, 0x88649a83, 0xbf0e5882, 0xe6b01e80, 0xd1dadc81, 0x54cc9384, 0x63a65185, 0x3a181787, 0x0d72d586, 0xa0d0e2a9, 0x97ba20a8, 0xce0466aa, 0xf96ea4ab, 0x7c78ebae, 0x4b1229af, 0x12ac6fad, 0x25c6adac, 0x1881f1a7, 0x2feb33a6, 0x765575a4, 0x413fb7a5, 0xc429f8a0, 0xf3433aa1, 0xaafd7ca3, 0x9d97bea2, 0xd073c4b5, 0xe71906b4, 0xbea740b6, 0x89cd82b7, 0x0cdbcdb2, 0x3bb10fb3, 0x620f49b1, 0x55658bb0, 0x6822d7bb, 0x5f4815ba, 0x06f653b8, 0x319c91b9, 0xb48adebc, 0x83e01cbd, 0xda5e5abf, 0xed3498be}, {0x00000000, 0x6567bcb8, 0x8bc809aa, 0xeeafb512, 0x5797628f, 0x32f0de37, 0xdc5f6b25, 0xb938d79d, 0xef28b4c5, 0x8a4f087d, 0x64e0bd6f, 0x018701d7, 0xb8bfd64a, 0xddd86af2, 0x3377dfe0, 0x56106358, 0x9f571950, 0xfa30a5e8, 0x149f10fa, 0x71f8ac42, 0xc8c07bdf, 0xada7c767, 0x43087275, 0x266fcecd, 0x707fad95, 0x1518112d, 0xfbb7a43f, 0x9ed01887, 0x27e8cf1a, 0x428f73a2, 0xac20c6b0, 0xc9477a08, 0x3eaf32a0, 0x5bc88e18, 0xb5673b0a, 0xd00087b2, 0x6938502f, 0x0c5fec97, 0xe2f05985, 0x8797e53d, 0xd1878665, 0xb4e03add, 0x5a4f8fcf, 0x3f283377, 0x8610e4ea, 0xe3775852, 0x0dd8ed40, 0x68bf51f8, 0xa1f82bf0, 0xc49f9748, 0x2a30225a, 0x4f579ee2, 0xf66f497f, 0x9308f5c7, 0x7da740d5, 0x18c0fc6d, 0x4ed09f35, 0x2bb7238d, 0xc518969f, 0xa07f2a27, 0x1947fdba, 0x7c204102, 0x928ff410, 0xf7e848a8, 0x3d58149b, 0x583fa823, 0xb6901d31, 0xd3f7a189, 0x6acf7614, 0x0fa8caac, 0xe1077fbe, 0x8460c306, 0xd270a05e, 0xb7171ce6, 0x59b8a9f4, 0x3cdf154c, 0x85e7c2d1, 0xe0807e69, 0x0e2fcb7b, 0x6b4877c3, 0xa20f0dcb, 0xc768b173, 0x29c70461, 0x4ca0b8d9, 0xf5986f44, 0x90ffd3fc, 0x7e5066ee, 0x1b37da56, 0x4d27b90e, 0x284005b6, 0xc6efb0a4, 0xa3880c1c, 0x1ab0db81, 0x7fd76739, 0x9178d22b, 0xf41f6e93, 0x03f7263b, 0x66909a83, 0x883f2f91, 0xed589329, 0x546044b4, 0x3107f80c, 0xdfa84d1e, 0xbacff1a6, 0xecdf92fe, 0x89b82e46, 0x67179b54, 0x027027ec, 0xbb48f071, 0xde2f4cc9, 0x3080f9db, 0x55e74563, 0x9ca03f6b, 0xf9c783d3, 0x176836c1, 0x720f8a79, 0xcb375de4, 0xae50e15c, 0x40ff544e, 0x2598e8f6, 0x73888bae, 0x16ef3716, 0xf8408204, 0x9d273ebc, 0x241fe921, 0x41785599, 0xafd7e08b, 0xcab05c33, 0x3bb659ed, 0x5ed1e555, 0xb07e5047, 0xd519ecff, 0x6c213b62, 0x094687da, 0xe7e932c8, 0x828e8e70, 0xd49eed28, 0xb1f95190, 0x5f56e482, 0x3a31583a, 0x83098fa7, 0xe66e331f, 0x08c1860d, 0x6da63ab5, 0xa4e140bd, 0xc186fc05, 0x2f294917, 0x4a4ef5af, 0xf3762232, 0x96119e8a, 0x78be2b98, 0x1dd99720, 0x4bc9f478, 0x2eae48c0, 0xc001fdd2, 0xa566416a, 0x1c5e96f7, 0x79392a4f, 0x97969f5d, 0xf2f123e5, 0x05196b4d, 0x607ed7f5, 0x8ed162e7, 0xebb6de5f, 0x528e09c2, 0x37e9b57a, 0xd9460068, 0xbc21bcd0, 0xea31df88, 0x8f566330, 0x61f9d622, 0x049e6a9a, 0xbda6bd07, 0xd8c101bf, 0x366eb4ad, 0x53090815, 0x9a4e721d, 0xff29cea5, 0x11867bb7, 0x74e1c70f, 0xcdd91092, 0xa8beac2a, 0x46111938, 0x2376a580, 0x7566c6d8, 0x10017a60, 0xfeaecf72, 0x9bc973ca, 0x22f1a457, 0x479618ef, 0xa939adfd, 0xcc5e1145, 0x06ee4d76, 0x6389f1ce, 0x8d2644dc, 0xe841f864, 0x51792ff9, 0x341e9341, 0xdab12653, 0xbfd69aeb, 0xe9c6f9b3, 0x8ca1450b, 0x620ef019, 0x07694ca1, 0xbe519b3c, 0xdb362784, 0x35999296, 0x50fe2e2e, 0x99b95426, 0xfcdee89e, 0x12715d8c, 0x7716e134, 0xce2e36a9, 0xab498a11, 0x45e63f03, 0x208183bb, 0x7691e0e3, 0x13f65c5b, 0xfd59e949, 0x983e55f1, 0x2106826c, 0x44613ed4, 0xaace8bc6, 0xcfa9377e, 0x38417fd6, 0x5d26c36e, 0xb389767c, 0xd6eecac4, 0x6fd61d59, 0x0ab1a1e1, 0xe41e14f3, 0x8179a84b, 0xd769cb13, 0xb20e77ab, 0x5ca1c2b9, 0x39c67e01, 0x80fea99c, 0xe5991524, 0x0b36a036, 0x6e511c8e, 0xa7166686, 0xc271da3e, 0x2cde6f2c, 0x49b9d394, 0xf0810409, 0x95e6b8b1, 0x7b490da3, 0x1e2eb11b, 0x483ed243, 0x2d596efb, 0xc3f6dbe9, 0xa6916751, 0x1fa9b0cc, 0x7ace0c74, 0x9461b966, 0xf10605de}}; #endif #endif #if N == 2 #if W == 8 local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0xae689191, 0x87a02563, 0x29c8b4f2, 0xd4314c87, 0x7a59dd16, 0x539169e4, 0xfdf9f875, 0x73139f4f, 0xdd7b0ede, 0xf4b3ba2c, 0x5adb2bbd, 0xa722d3c8, 0x094a4259, 0x2082f6ab, 0x8eea673a, 0xe6273e9e, 0x484faf0f, 0x61871bfd, 0xcfef8a6c, 0x32167219, 0x9c7ee388, 0xb5b6577a, 0x1bdec6eb, 0x9534a1d1, 0x3b5c3040, 0x129484b2, 0xbcfc1523, 0x4105ed56, 0xef6d7cc7, 0xc6a5c835, 0x68cd59a4, 0x173f7b7d, 0xb957eaec, 0x909f5e1e, 0x3ef7cf8f, 0xc30e37fa, 0x6d66a66b, 0x44ae1299, 0xeac68308, 0x642ce432, 0xca4475a3, 0xe38cc151, 0x4de450c0, 0xb01da8b5, 0x1e753924, 0x37bd8dd6, 0x99d51c47, 0xf11845e3, 0x5f70d472, 0x76b86080, 0xd8d0f111, 0x25290964, 0x8b4198f5, 0xa2892c07, 0x0ce1bd96, 0x820bdaac, 0x2c634b3d, 0x05abffcf, 0xabc36e5e, 0x563a962b, 0xf85207ba, 0xd19ab348, 0x7ff222d9, 0x2e7ef6fa, 0x8016676b, 0xa9ded399, 0x07b64208, 0xfa4fba7d, 0x54272bec, 0x7def9f1e, 0xd3870e8f, 0x5d6d69b5, 0xf305f824, 0xdacd4cd6, 0x74a5dd47, 0x895c2532, 0x2734b4a3, 0x0efc0051, 0xa09491c0, 0xc859c864, 0x663159f5, 0x4ff9ed07, 0xe1917c96, 0x1c6884e3, 0xb2001572, 0x9bc8a180, 0x35a03011, 0xbb4a572b, 0x1522c6ba, 0x3cea7248, 0x9282e3d9, 0x6f7b1bac, 0xc1138a3d, 0xe8db3ecf, 0x46b3af5e, 0x39418d87, 0x97291c16, 0xbee1a8e4, 0x10893975, 0xed70c100, 0x43185091, 0x6ad0e463, 0xc4b875f2, 0x4a5212c8, 0xe43a8359, 0xcdf237ab, 0x639aa63a, 0x9e635e4f, 0x300bcfde, 0x19c37b2c, 0xb7abeabd, 0xdf66b319, 0x710e2288, 0x58c6967a, 0xf6ae07eb, 0x0b57ff9e, 0xa53f6e0f, 0x8cf7dafd, 0x229f4b6c, 0xac752c56, 0x021dbdc7, 0x2bd50935, 0x85bd98a4, 0x784460d1, 0xd62cf140, 0xffe445b2, 0x518cd423, 0x5cfdedf4, 0xf2957c65, 0xdb5dc897, 0x75355906, 0x88cca173, 0x26a430e2, 0x0f6c8410, 0xa1041581, 0x2fee72bb, 0x8186e32a, 0xa84e57d8, 0x0626c649, 0xfbdf3e3c, 0x55b7afad, 0x7c7f1b5f, 0xd2178ace, 0xbadad36a, 0x14b242fb, 0x3d7af609, 0x93126798, 0x6eeb9fed, 0xc0830e7c, 0xe94bba8e, 0x47232b1f, 0xc9c94c25, 0x67a1ddb4, 0x4e696946, 0xe001f8d7, 0x1df800a2, 0xb3909133, 0x9a5825c1, 0x3430b450, 0x4bc29689, 0xe5aa0718, 0xcc62b3ea, 0x620a227b, 0x9ff3da0e, 0x319b4b9f, 0x1853ff6d, 0xb63b6efc, 0x38d109c6, 0x96b99857, 0xbf712ca5, 0x1119bd34, 0xece04541, 0x4288d4d0, 0x6b406022, 0xc528f1b3, 0xade5a817, 0x038d3986, 0x2a458d74, 0x842d1ce5, 0x79d4e490, 0xd7bc7501, 0xfe74c1f3, 0x501c5062, 0xdef63758, 0x709ea6c9, 0x5956123b, 0xf73e83aa, 0x0ac77bdf, 0xa4afea4e, 0x8d675ebc, 0x230fcf2d, 0x72831b0e, 0xdceb8a9f, 0xf5233e6d, 0x5b4baffc, 0xa6b25789, 0x08dac618, 0x211272ea, 0x8f7ae37b, 0x01908441, 0xaff815d0, 0x8630a122, 0x285830b3, 0xd5a1c8c6, 0x7bc95957, 0x5201eda5, 0xfc697c34, 0x94a42590, 0x3accb401, 0x130400f3, 0xbd6c9162, 0x40956917, 0xeefdf886, 0xc7354c74, 0x695ddde5, 0xe7b7badf, 0x49df2b4e, 0x60179fbc, 0xce7f0e2d, 0x3386f658, 0x9dee67c9, 0xb426d33b, 0x1a4e42aa, 0x65bc6073, 0xcbd4f1e2, 0xe21c4510, 0x4c74d481, 0xb18d2cf4, 0x1fe5bd65, 0x362d0997, 0x98459806, 0x16afff3c, 0xb8c76ead, 0x910fda5f, 0x3f674bce, 0xc29eb3bb, 0x6cf6222a, 0x453e96d8, 0xeb560749, 0x839b5eed, 0x2df3cf7c, 0x043b7b8e, 0xaa53ea1f, 0x57aa126a, 0xf9c283fb, 0xd00a3709, 0x7e62a698, 0xf088c1a2, 0x5ee05033, 0x7728e4c1, 0xd9407550, 0x24b98d25, 0x8ad11cb4, 0xa319a846, 0x0d7139d7}, {0x00000000, 0xb9fbdbe8, 0xa886b191, 0x117d6a79, 0x8a7c6563, 0x3387be8b, 0x22fad4f2, 0x9b010f1a, 0xcf89cc87, 0x7672176f, 0x670f7d16, 0xdef4a6fe, 0x45f5a9e4, 0xfc0e720c, 0xed731875, 0x5488c39d, 0x44629f4f, 0xfd9944a7, 0xece42ede, 0x551ff536, 0xce1efa2c, 0x77e521c4, 0x66984bbd, 0xdf639055, 0x8beb53c8, 0x32108820, 0x236de259, 0x9a9639b1, 0x019736ab, 0xb86ced43, 0xa911873a, 0x10ea5cd2, 0x88c53e9e, 0x313ee576, 0x20438f0f, 0x99b854e7, 0x02b95bfd, 0xbb428015, 0xaa3fea6c, 0x13c43184, 0x474cf219, 0xfeb729f1, 0xefca4388, 0x56319860, 0xcd30977a, 0x74cb4c92, 0x65b626eb, 0xdc4dfd03, 0xcca7a1d1, 0x755c7a39, 0x64211040, 0xdddacba8, 0x46dbc4b2, 0xff201f5a, 0xee5d7523, 0x57a6aecb, 0x032e6d56, 0xbad5b6be, 0xaba8dcc7, 0x1253072f, 0x89520835, 0x30a9d3dd, 0x21d4b9a4, 0x982f624c, 0xcafb7b7d, 0x7300a095, 0x627dcaec, 0xdb861104, 0x40871e1e, 0xf97cc5f6, 0xe801af8f, 0x51fa7467, 0x0572b7fa, 0xbc896c12, 0xadf4066b, 0x140fdd83, 0x8f0ed299, 0x36f50971, 0x27886308, 0x9e73b8e0, 0x8e99e432, 0x37623fda, 0x261f55a3, 0x9fe48e4b, 0x04e58151, 0xbd1e5ab9, 0xac6330c0, 0x1598eb28, 0x411028b5, 0xf8ebf35d, 0xe9969924, 0x506d42cc, 0xcb6c4dd6, 0x7297963e, 0x63eafc47, 0xda1127af, 0x423e45e3, 0xfbc59e0b, 0xeab8f472, 0x53432f9a, 0xc8422080, 0x71b9fb68, 0x60c49111, 0xd93f4af9, 0x8db78964, 0x344c528c, 0x253138f5, 0x9ccae31d, 0x07cbec07, 0xbe3037ef, 0xaf4d5d96, 0x16b6867e, 0x065cdaac, 0xbfa70144, 0xaeda6b3d, 0x1721b0d5, 0x8c20bfcf, 0x35db6427, 0x24a60e5e, 0x9d5dd5b6, 0xc9d5162b, 0x702ecdc3, 0x6153a7ba, 0xd8a87c52, 0x43a97348, 0xfa52a8a0, 0xeb2fc2d9, 0x52d41931, 0x4e87f0bb, 0xf77c2b53, 0xe601412a, 0x5ffa9ac2, 0xc4fb95d8, 0x7d004e30, 0x6c7d2449, 0xd586ffa1, 0x810e3c3c, 0x38f5e7d4, 0x29888dad, 0x90735645, 0x0b72595f, 0xb28982b7, 0xa3f4e8ce, 0x1a0f3326, 0x0ae56ff4, 0xb31eb41c, 0xa263de65, 0x1b98058d, 0x80990a97, 0x3962d17f, 0x281fbb06, 0x91e460ee, 0xc56ca373, 0x7c97789b, 0x6dea12e2, 0xd411c90a, 0x4f10c610, 0xf6eb1df8, 0xe7967781, 0x5e6dac69, 0xc642ce25, 0x7fb915cd, 0x6ec47fb4, 0xd73fa45c, 0x4c3eab46, 0xf5c570ae, 0xe4b81ad7, 0x5d43c13f, 0x09cb02a2, 0xb030d94a, 0xa14db333, 0x18b668db, 0x83b767c1, 0x3a4cbc29, 0x2b31d650, 0x92ca0db8, 0x8220516a, 0x3bdb8a82, 0x2aa6e0fb, 0x935d3b13, 0x085c3409, 0xb1a7efe1, 0xa0da8598, 0x19215e70, 0x4da99ded, 0xf4524605, 0xe52f2c7c, 0x5cd4f794, 0xc7d5f88e, 0x7e2e2366, 0x6f53491f, 0xd6a892f7, 0x847c8bc6, 0x3d87502e, 0x2cfa3a57, 0x9501e1bf, 0x0e00eea5, 0xb7fb354d, 0xa6865f34, 0x1f7d84dc, 0x4bf54741, 0xf20e9ca9, 0xe373f6d0, 0x5a882d38, 0xc1892222, 0x7872f9ca, 0x690f93b3, 0xd0f4485b, 0xc01e1489, 0x79e5cf61, 0x6898a518, 0xd1637ef0, 0x4a6271ea, 0xf399aa02, 0xe2e4c07b, 0x5b1f1b93, 0x0f97d80e, 0xb66c03e6, 0xa711699f, 0x1eeab277, 0x85ebbd6d, 0x3c106685, 0x2d6d0cfc, 0x9496d714, 0x0cb9b558, 0xb5426eb0, 0xa43f04c9, 0x1dc4df21, 0x86c5d03b, 0x3f3e0bd3, 0x2e4361aa, 0x97b8ba42, 0xc33079df, 0x7acba237, 0x6bb6c84e, 0xd24d13a6, 0x494c1cbc, 0xf0b7c754, 0xe1caad2d, 0x583176c5, 0x48db2a17, 0xf120f1ff, 0xe05d9b86, 0x59a6406e, 0xc2a74f74, 0x7b5c949c, 0x6a21fee5, 0xd3da250d, 0x8752e690, 0x3ea93d78, 0x2fd45701, 0x962f8ce9, 0x0d2e83f3, 0xb4d5581b, 0xa5a83262, 0x1c53e98a}, {0x00000000, 0x9d0fe176, 0xe16ec4ad, 0x7c6125db, 0x19ac8f1b, 0x84a36e6d, 0xf8c24bb6, 0x65cdaac0, 0x33591e36, 0xae56ff40, 0xd237da9b, 0x4f383bed, 0x2af5912d, 0xb7fa705b, 0xcb9b5580, 0x5694b4f6, 0x66b23c6c, 0xfbbddd1a, 0x87dcf8c1, 0x1ad319b7, 0x7f1eb377, 0xe2115201, 0x9e7077da, 0x037f96ac, 0x55eb225a, 0xc8e4c32c, 0xb485e6f7, 0x298a0781, 0x4c47ad41, 0xd1484c37, 0xad2969ec, 0x3026889a, 0xcd6478d8, 0x506b99ae, 0x2c0abc75, 0xb1055d03, 0xd4c8f7c3, 0x49c716b5, 0x35a6336e, 0xa8a9d218, 0xfe3d66ee, 0x63328798, 0x1f53a243, 0x825c4335, 0xe791e9f5, 0x7a9e0883, 0x06ff2d58, 0x9bf0cc2e, 0xabd644b4, 0x36d9a5c2, 0x4ab88019, 0xd7b7616f, 0xb27acbaf, 0x2f752ad9, 0x53140f02, 0xce1bee74, 0x988f5a82, 0x0580bbf4, 0x79e19e2f, 0xe4ee7f59, 0x8123d599, 0x1c2c34ef, 0x604d1134, 0xfd42f042, 0x41b9f7f1, 0xdcb61687, 0xa0d7335c, 0x3dd8d22a, 0x581578ea, 0xc51a999c, 0xb97bbc47, 0x24745d31, 0x72e0e9c7, 0xefef08b1, 0x938e2d6a, 0x0e81cc1c, 0x6b4c66dc, 0xf64387aa, 0x8a22a271, 0x172d4307, 0x270bcb9d, 0xba042aeb, 0xc6650f30, 0x5b6aee46, 0x3ea74486, 0xa3a8a5f0, 0xdfc9802b, 0x42c6615d, 0x1452d5ab, 0x895d34dd, 0xf53c1106, 0x6833f070, 0x0dfe5ab0, 0x90f1bbc6, 0xec909e1d, 0x719f7f6b, 0x8cdd8f29, 0x11d26e5f, 0x6db34b84, 0xf0bcaaf2, 0x95710032, 0x087ee144, 0x741fc49f, 0xe91025e9, 0xbf84911f, 0x228b7069, 0x5eea55b2, 0xc3e5b4c4, 0xa6281e04, 0x3b27ff72, 0x4746daa9, 0xda493bdf, 0xea6fb345, 0x77605233, 0x0b0177e8, 0x960e969e, 0xf3c33c5e, 0x6eccdd28, 0x12adf8f3, 0x8fa21985, 0xd936ad73, 0x44394c05, 0x385869de, 0xa55788a8, 0xc09a2268, 0x5d95c31e, 0x21f4e6c5, 0xbcfb07b3, 0x8373efe2, 0x1e7c0e94, 0x621d2b4f, 0xff12ca39, 0x9adf60f9, 0x07d0818f, 0x7bb1a454, 0xe6be4522, 0xb02af1d4, 0x2d2510a2, 0x51443579, 0xcc4bd40f, 0xa9867ecf, 0x34899fb9, 0x48e8ba62, 0xd5e75b14, 0xe5c1d38e, 0x78ce32f8, 0x04af1723, 0x99a0f655, 0xfc6d5c95, 0x6162bde3, 0x1d039838, 0x800c794e, 0xd698cdb8, 0x4b972cce, 0x37f60915, 0xaaf9e863, 0xcf3442a3, 0x523ba3d5, 0x2e5a860e, 0xb3556778, 0x4e17973a, 0xd318764c, 0xaf795397, 0x3276b2e1, 0x57bb1821, 0xcab4f957, 0xb6d5dc8c, 0x2bda3dfa, 0x7d4e890c, 0xe041687a, 0x9c204da1, 0x012facd7, 0x64e20617, 0xf9ede761, 0x858cc2ba, 0x188323cc, 0x28a5ab56, 0xb5aa4a20, 0xc9cb6ffb, 0x54c48e8d, 0x3109244d, 0xac06c53b, 0xd067e0e0, 0x4d680196, 0x1bfcb560, 0x86f35416, 0xfa9271cd, 0x679d90bb, 0x02503a7b, 0x9f5fdb0d, 0xe33efed6, 0x7e311fa0, 0xc2ca1813, 0x5fc5f965, 0x23a4dcbe, 0xbeab3dc8, 0xdb669708, 0x4669767e, 0x3a0853a5, 0xa707b2d3, 0xf1930625, 0x6c9ce753, 0x10fdc288, 0x8df223fe, 0xe83f893e, 0x75306848, 0x09514d93, 0x945eace5, 0xa478247f, 0x3977c509, 0x4516e0d2, 0xd81901a4, 0xbdd4ab64, 0x20db4a12, 0x5cba6fc9, 0xc1b58ebf, 0x97213a49, 0x0a2edb3f, 0x764ffee4, 0xeb401f92, 0x8e8db552, 0x13825424, 0x6fe371ff, 0xf2ec9089, 0x0fae60cb, 0x92a181bd, 0xeec0a466, 0x73cf4510, 0x1602efd0, 0x8b0d0ea6, 0xf76c2b7d, 0x6a63ca0b, 0x3cf77efd, 0xa1f89f8b, 0xdd99ba50, 0x40965b26, 0x255bf1e6, 0xb8541090, 0xc435354b, 0x593ad43d, 0x691c5ca7, 0xf413bdd1, 0x8872980a, 0x157d797c, 0x70b0d3bc, 0xedbf32ca, 0x91de1711, 0x0cd1f667, 0x5a454291, 0xc74aa3e7, 0xbb2b863c, 0x2624674a, 0x43e9cd8a, 0xdee62cfc, 0xa2870927, 0x3f88e851}, {0x00000000, 0xdd96d985, 0x605cb54b, 0xbdca6cce, 0xc0b96a96, 0x1d2fb313, 0xa0e5dfdd, 0x7d730658, 0x5a03d36d, 0x87950ae8, 0x3a5f6626, 0xe7c9bfa3, 0x9abab9fb, 0x472c607e, 0xfae60cb0, 0x2770d535, 0xb407a6da, 0x69917f5f, 0xd45b1391, 0x09cdca14, 0x74becc4c, 0xa92815c9, 0x14e27907, 0xc974a082, 0xee0475b7, 0x3392ac32, 0x8e58c0fc, 0x53ce1979, 0x2ebd1f21, 0xf32bc6a4, 0x4ee1aa6a, 0x937773ef, 0xb37e4bf5, 0x6ee89270, 0xd322febe, 0x0eb4273b, 0x73c72163, 0xae51f8e6, 0x139b9428, 0xce0d4dad, 0xe97d9898, 0x34eb411d, 0x89212dd3, 0x54b7f456, 0x29c4f20e, 0xf4522b8b, 0x49984745, 0x940e9ec0, 0x0779ed2f, 0xdaef34aa, 0x67255864, 0xbab381e1, 0xc7c087b9, 0x1a565e3c, 0xa79c32f2, 0x7a0aeb77, 0x5d7a3e42, 0x80ece7c7, 0x3d268b09, 0xe0b0528c, 0x9dc354d4, 0x40558d51, 0xfd9fe19f, 0x2009381a, 0xbd8d91ab, 0x601b482e, 0xddd124e0, 0x0047fd65, 0x7d34fb3d, 0xa0a222b8, 0x1d684e76, 0xc0fe97f3, 0xe78e42c6, 0x3a189b43, 0x87d2f78d, 0x5a442e08, 0x27372850, 0xfaa1f1d5, 0x476b9d1b, 0x9afd449e, 0x098a3771, 0xd41ceef4, 0x69d6823a, 0xb4405bbf, 0xc9335de7, 0x14a58462, 0xa96fe8ac, 0x74f93129, 0x5389e41c, 0x8e1f3d99, 0x33d55157, 0xee4388d2, 0x93308e8a, 0x4ea6570f, 0xf36c3bc1, 0x2efae244, 0x0ef3da5e, 0xd36503db, 0x6eaf6f15, 0xb339b690, 0xce4ab0c8, 0x13dc694d, 0xae160583, 0x7380dc06, 0x54f00933, 0x8966d0b6, 0x34acbc78, 0xe93a65fd, 0x944963a5, 0x49dfba20, 0xf415d6ee, 0x29830f6b, 0xbaf47c84, 0x6762a501, 0xdaa8c9cf, 0x073e104a, 0x7a4d1612, 0xa7dbcf97, 0x1a11a359, 0xc7877adc, 0xe0f7afe9, 0x3d61766c, 0x80ab1aa2, 0x5d3dc327, 0x204ec57f, 0xfdd81cfa, 0x40127034, 0x9d84a9b1, 0xa06a2517, 0x7dfcfc92, 0xc036905c, 0x1da049d9, 0x60d34f81, 0xbd459604, 0x008ffaca, 0xdd19234f, 0xfa69f67a, 0x27ff2fff, 0x9a354331, 0x47a39ab4, 0x3ad09cec, 0xe7464569, 0x5a8c29a7, 0x871af022, 0x146d83cd, 0xc9fb5a48, 0x74313686, 0xa9a7ef03, 0xd4d4e95b, 0x094230de, 0xb4885c10, 0x691e8595, 0x4e6e50a0, 0x93f88925, 0x2e32e5eb, 0xf3a43c6e, 0x8ed73a36, 0x5341e3b3, 0xee8b8f7d, 0x331d56f8, 0x13146ee2, 0xce82b767, 0x7348dba9, 0xaede022c, 0xd3ad0474, 0x0e3bddf1, 0xb3f1b13f, 0x6e6768ba, 0x4917bd8f, 0x9481640a, 0x294b08c4, 0xf4ddd141, 0x89aed719, 0x54380e9c, 0xe9f26252, 0x3464bbd7, 0xa713c838, 0x7a8511bd, 0xc74f7d73, 0x1ad9a4f6, 0x67aaa2ae, 0xba3c7b2b, 0x07f617e5, 0xda60ce60, 0xfd101b55, 0x2086c2d0, 0x9d4cae1e, 0x40da779b, 0x3da971c3, 0xe03fa846, 0x5df5c488, 0x80631d0d, 0x1de7b4bc, 0xc0716d39, 0x7dbb01f7, 0xa02dd872, 0xdd5ede2a, 0x00c807af, 0xbd026b61, 0x6094b2e4, 0x47e467d1, 0x9a72be54, 0x27b8d29a, 0xfa2e0b1f, 0x875d0d47, 0x5acbd4c2, 0xe701b80c, 0x3a976189, 0xa9e01266, 0x7476cbe3, 0xc9bca72d, 0x142a7ea8, 0x695978f0, 0xb4cfa175, 0x0905cdbb, 0xd493143e, 0xf3e3c10b, 0x2e75188e, 0x93bf7440, 0x4e29adc5, 0x335aab9d, 0xeecc7218, 0x53061ed6, 0x8e90c753, 0xae99ff49, 0x730f26cc, 0xcec54a02, 0x13539387, 0x6e2095df, 0xb3b64c5a, 0x0e7c2094, 0xd3eaf911, 0xf49a2c24, 0x290cf5a1, 0x94c6996f, 0x495040ea, 0x342346b2, 0xe9b59f37, 0x547ff3f9, 0x89e92a7c, 0x1a9e5993, 0xc7088016, 0x7ac2ecd8, 0xa754355d, 0xda273305, 0x07b1ea80, 0xba7b864e, 0x67ed5fcb, 0x409d8afe, 0x9d0b537b, 0x20c13fb5, 0xfd57e630, 0x8024e068, 0x5db239ed, 0xe0785523, 0x3dee8ca6}, {0x00000000, 0x9ba54c6f, 0xec3b9e9f, 0x779ed2f0, 0x03063b7f, 0x98a37710, 0xef3da5e0, 0x7498e98f, 0x060c76fe, 0x9da93a91, 0xea37e861, 0x7192a40e, 0x050a4d81, 0x9eaf01ee, 0xe931d31e, 0x72949f71, 0x0c18edfc, 0x97bda193, 0xe0237363, 0x7b863f0c, 0x0f1ed683, 0x94bb9aec, 0xe325481c, 0x78800473, 0x0a149b02, 0x91b1d76d, 0xe62f059d, 0x7d8a49f2, 0x0912a07d, 0x92b7ec12, 0xe5293ee2, 0x7e8c728d, 0x1831dbf8, 0x83949797, 0xf40a4567, 0x6faf0908, 0x1b37e087, 0x8092ace8, 0xf70c7e18, 0x6ca93277, 0x1e3dad06, 0x8598e169, 0xf2063399, 0x69a37ff6, 0x1d3b9679, 0x869eda16, 0xf10008e6, 0x6aa54489, 0x14293604, 0x8f8c7a6b, 0xf812a89b, 0x63b7e4f4, 0x172f0d7b, 0x8c8a4114, 0xfb1493e4, 0x60b1df8b, 0x122540fa, 0x89800c95, 0xfe1ede65, 0x65bb920a, 0x11237b85, 0x8a8637ea, 0xfd18e51a, 0x66bda975, 0x3063b7f0, 0xabc6fb9f, 0xdc58296f, 0x47fd6500, 0x33658c8f, 0xa8c0c0e0, 0xdf5e1210, 0x44fb5e7f, 0x366fc10e, 0xadca8d61, 0xda545f91, 0x41f113fe, 0x3569fa71, 0xaeccb61e, 0xd95264ee, 0x42f72881, 0x3c7b5a0c, 0xa7de1663, 0xd040c493, 0x4be588fc, 0x3f7d6173, 0xa4d82d1c, 0xd346ffec, 0x48e3b383, 0x3a772cf2, 0xa1d2609d, 0xd64cb26d, 0x4de9fe02, 0x3971178d, 0xa2d45be2, 0xd54a8912, 0x4eefc57d, 0x28526c08, 0xb3f72067, 0xc469f297, 0x5fccbef8, 0x2b545777, 0xb0f11b18, 0xc76fc9e8, 0x5cca8587, 0x2e5e1af6, 0xb5fb5699, 0xc2658469, 0x59c0c806, 0x2d582189, 0xb6fd6de6, 0xc163bf16, 0x5ac6f379, 0x244a81f4, 0xbfefcd9b, 0xc8711f6b, 0x53d45304, 0x274cba8b, 0xbce9f6e4, 0xcb772414, 0x50d2687b, 0x2246f70a, 0xb9e3bb65, 0xce7d6995, 0x55d825fa, 0x2140cc75, 0xbae5801a, 0xcd7b52ea, 0x56de1e85, 0x60c76fe0, 0xfb62238f, 0x8cfcf17f, 0x1759bd10, 0x63c1549f, 0xf86418f0, 0x8ffaca00, 0x145f866f, 0x66cb191e, 0xfd6e5571, 0x8af08781, 0x1155cbee, 0x65cd2261, 0xfe686e0e, 0x89f6bcfe, 0x1253f091, 0x6cdf821c, 0xf77ace73, 0x80e41c83, 0x1b4150ec, 0x6fd9b963, 0xf47cf50c, 0x83e227fc, 0x18476b93, 0x6ad3f4e2, 0xf176b88d, 0x86e86a7d, 0x1d4d2612, 0x69d5cf9d, 0xf27083f2, 0x85ee5102, 0x1e4b1d6d, 0x78f6b418, 0xe353f877, 0x94cd2a87, 0x0f6866e8, 0x7bf08f67, 0xe055c308, 0x97cb11f8, 0x0c6e5d97, 0x7efac2e6, 0xe55f8e89, 0x92c15c79, 0x09641016, 0x7dfcf999, 0xe659b5f6, 0x91c76706, 0x0a622b69, 0x74ee59e4, 0xef4b158b, 0x98d5c77b, 0x03708b14, 0x77e8629b, 0xec4d2ef4, 0x9bd3fc04, 0x0076b06b, 0x72e22f1a, 0xe9476375, 0x9ed9b185, 0x057cfdea, 0x71e41465, 0xea41580a, 0x9ddf8afa, 0x067ac695, 0x50a4d810, 0xcb01947f, 0xbc9f468f, 0x273a0ae0, 0x53a2e36f, 0xc807af00, 0xbf997df0, 0x243c319f, 0x56a8aeee, 0xcd0de281, 0xba933071, 0x21367c1e, 0x55ae9591, 0xce0bd9fe, 0xb9950b0e, 0x22304761, 0x5cbc35ec, 0xc7197983, 0xb087ab73, 0x2b22e71c, 0x5fba0e93, 0xc41f42fc, 0xb381900c, 0x2824dc63, 0x5ab04312, 0xc1150f7d, 0xb68bdd8d, 0x2d2e91e2, 0x59b6786d, 0xc2133402, 0xb58de6f2, 0x2e28aa9d, 0x489503e8, 0xd3304f87, 0xa4ae9d77, 0x3f0bd118, 0x4b933897, 0xd03674f8, 0xa7a8a608, 0x3c0dea67, 0x4e997516, 0xd53c3979, 0xa2a2eb89, 0x3907a7e6, 0x4d9f4e69, 0xd63a0206, 0xa1a4d0f6, 0x3a019c99, 0x448dee14, 0xdf28a27b, 0xa8b6708b, 0x33133ce4, 0x478bd56b, 0xdc2e9904, 0xabb04bf4, 0x3015079b, 0x428198ea, 0xd924d485, 0xaeba0675, 0x351f4a1a, 0x4187a395, 0xda22effa, 0xadbc3d0a, 0x36197165}, {0x00000000, 0xc18edfc0, 0x586cb9c1, 0x99e26601, 0xb0d97382, 0x7157ac42, 0xe8b5ca43, 0x293b1583, 0xbac3e145, 0x7b4d3e85, 0xe2af5884, 0x23218744, 0x0a1a92c7, 0xcb944d07, 0x52762b06, 0x93f8f4c6, 0xaef6c4cb, 0x6f781b0b, 0xf69a7d0a, 0x3714a2ca, 0x1e2fb749, 0xdfa16889, 0x46430e88, 0x87cdd148, 0x1435258e, 0xd5bbfa4e, 0x4c599c4f, 0x8dd7438f, 0xa4ec560c, 0x656289cc, 0xfc80efcd, 0x3d0e300d, 0x869c8fd7, 0x47125017, 0xdef03616, 0x1f7ee9d6, 0x3645fc55, 0xf7cb2395, 0x6e294594, 0xafa79a54, 0x3c5f6e92, 0xfdd1b152, 0x6433d753, 0xa5bd0893, 0x8c861d10, 0x4d08c2d0, 0xd4eaa4d1, 0x15647b11, 0x286a4b1c, 0xe9e494dc, 0x7006f2dd, 0xb1882d1d, 0x98b3389e, 0x593de75e, 0xc0df815f, 0x01515e9f, 0x92a9aa59, 0x53277599, 0xcac51398, 0x0b4bcc58, 0x2270d9db, 0xe3fe061b, 0x7a1c601a, 0xbb92bfda, 0xd64819ef, 0x17c6c62f, 0x8e24a02e, 0x4faa7fee, 0x66916a6d, 0xa71fb5ad, 0x3efdd3ac, 0xff730c6c, 0x6c8bf8aa, 0xad05276a, 0x34e7416b, 0xf5699eab, 0xdc528b28, 0x1ddc54e8, 0x843e32e9, 0x45b0ed29, 0x78bedd24, 0xb93002e4, 0x20d264e5, 0xe15cbb25, 0xc867aea6, 0x09e97166, 0x900b1767, 0x5185c8a7, 0xc27d3c61, 0x03f3e3a1, 0x9a1185a0, 0x5b9f5a60, 0x72a44fe3, 0xb32a9023, 0x2ac8f622, 0xeb4629e2, 0x50d49638, 0x915a49f8, 0x08b82ff9, 0xc936f039, 0xe00de5ba, 0x21833a7a, 0xb8615c7b, 0x79ef83bb, 0xea17777d, 0x2b99a8bd, 0xb27bcebc, 0x73f5117c, 0x5ace04ff, 0x9b40db3f, 0x02a2bd3e, 0xc32c62fe, 0xfe2252f3, 0x3fac8d33, 0xa64eeb32, 0x67c034f2, 0x4efb2171, 0x8f75feb1, 0x169798b0, 0xd7194770, 0x44e1b3b6, 0x856f6c76, 0x1c8d0a77, 0xdd03d5b7, 0xf438c034, 0x35b61ff4, 0xac5479f5, 0x6ddaa635, 0x77e1359f, 0xb66fea5f, 0x2f8d8c5e, 0xee03539e, 0xc738461d, 0x06b699dd, 0x9f54ffdc, 0x5eda201c, 0xcd22d4da, 0x0cac0b1a, 0x954e6d1b, 0x54c0b2db, 0x7dfba758, 0xbc757898, 0x25971e99, 0xe419c159, 0xd917f154, 0x18992e94, 0x817b4895, 0x40f59755, 0x69ce82d6, 0xa8405d16, 0x31a23b17, 0xf02ce4d7, 0x63d41011, 0xa25acfd1, 0x3bb8a9d0, 0xfa367610, 0xd30d6393, 0x1283bc53, 0x8b61da52, 0x4aef0592, 0xf17dba48, 0x30f36588, 0xa9110389, 0x689fdc49, 0x41a4c9ca, 0x802a160a, 0x19c8700b, 0xd846afcb, 0x4bbe5b0d, 0x8a3084cd, 0x13d2e2cc, 0xd25c3d0c, 0xfb67288f, 0x3ae9f74f, 0xa30b914e, 0x62854e8e, 0x5f8b7e83, 0x9e05a143, 0x07e7c742, 0xc6691882, 0xef520d01, 0x2edcd2c1, 0xb73eb4c0, 0x76b06b00, 0xe5489fc6, 0x24c64006, 0xbd242607, 0x7caaf9c7, 0x5591ec44, 0x941f3384, 0x0dfd5585, 0xcc738a45, 0xa1a92c70, 0x6027f3b0, 0xf9c595b1, 0x384b4a71, 0x11705ff2, 0xd0fe8032, 0x491ce633, 0x889239f3, 0x1b6acd35, 0xdae412f5, 0x430674f4, 0x8288ab34, 0xabb3beb7, 0x6a3d6177, 0xf3df0776, 0x3251d8b6, 0x0f5fe8bb, 0xced1377b, 0x5733517a, 0x96bd8eba, 0xbf869b39, 0x7e0844f9, 0xe7ea22f8, 0x2664fd38, 0xb59c09fe, 0x7412d63e, 0xedf0b03f, 0x2c7e6fff, 0x05457a7c, 0xc4cba5bc, 0x5d29c3bd, 0x9ca71c7d, 0x2735a3a7, 0xe6bb7c67, 0x7f591a66, 0xbed7c5a6, 0x97ecd025, 0x56620fe5, 0xcf8069e4, 0x0e0eb624, 0x9df642e2, 0x5c789d22, 0xc59afb23, 0x041424e3, 0x2d2f3160, 0xeca1eea0, 0x754388a1, 0xb4cd5761, 0x89c3676c, 0x484db8ac, 0xd1afdead, 0x1021016d, 0x391a14ee, 0xf894cb2e, 0x6176ad2f, 0xa0f872ef, 0x33008629, 0xf28e59e9, 0x6b6c3fe8, 0xaae2e028, 0x83d9f5ab, 0x42572a6b, 0xdbb54c6a, 0x1a3b93aa}, {0x00000000, 0xefc26b3e, 0x04f5d03d, 0xeb37bb03, 0x09eba07a, 0xe629cb44, 0x0d1e7047, 0xe2dc1b79, 0x13d740f4, 0xfc152bca, 0x172290c9, 0xf8e0fbf7, 0x1a3ce08e, 0xf5fe8bb0, 0x1ec930b3, 0xf10b5b8d, 0x27ae81e8, 0xc86cead6, 0x235b51d5, 0xcc993aeb, 0x2e452192, 0xc1874aac, 0x2ab0f1af, 0xc5729a91, 0x3479c11c, 0xdbbbaa22, 0x308c1121, 0xdf4e7a1f, 0x3d926166, 0xd2500a58, 0x3967b15b, 0xd6a5da65, 0x4f5d03d0, 0xa09f68ee, 0x4ba8d3ed, 0xa46ab8d3, 0x46b6a3aa, 0xa974c894, 0x42437397, 0xad8118a9, 0x5c8a4324, 0xb348281a, 0x587f9319, 0xb7bdf827, 0x5561e35e, 0xbaa38860, 0x51943363, 0xbe56585d, 0x68f38238, 0x8731e906, 0x6c065205, 0x83c4393b, 0x61182242, 0x8eda497c, 0x65edf27f, 0x8a2f9941, 0x7b24c2cc, 0x94e6a9f2, 0x7fd112f1, 0x901379cf, 0x72cf62b6, 0x9d0d0988, 0x763ab28b, 0x99f8d9b5, 0x9eba07a0, 0x71786c9e, 0x9a4fd79d, 0x758dbca3, 0x9751a7da, 0x7893cce4, 0x93a477e7, 0x7c661cd9, 0x8d6d4754, 0x62af2c6a, 0x89989769, 0x665afc57, 0x8486e72e, 0x6b448c10, 0x80733713, 0x6fb15c2d, 0xb9148648, 0x56d6ed76, 0xbde15675, 0x52233d4b, 0xb0ff2632, 0x5f3d4d0c, 0xb40af60f, 0x5bc89d31, 0xaac3c6bc, 0x4501ad82, 0xae361681, 0x41f47dbf, 0xa32866c6, 0x4cea0df8, 0xa7ddb6fb, 0x481fddc5, 0xd1e70470, 0x3e256f4e, 0xd512d44d, 0x3ad0bf73, 0xd80ca40a, 0x37cecf34, 0xdcf97437, 0x333b1f09, 0xc2304484, 0x2df22fba, 0xc6c594b9, 0x2907ff87, 0xcbdbe4fe, 0x24198fc0, 0xcf2e34c3, 0x20ec5ffd, 0xf6498598, 0x198beea6, 0xf2bc55a5, 0x1d7e3e9b, 0xffa225e2, 0x10604edc, 0xfb57f5df, 0x14959ee1, 0xe59ec56c, 0x0a5cae52, 0xe16b1551, 0x0ea97e6f, 0xec756516, 0x03b70e28, 0xe880b52b, 0x0742de15, 0xe6050901, 0x09c7623f, 0xe2f0d93c, 0x0d32b202, 0xefeea97b, 0x002cc245, 0xeb1b7946, 0x04d91278, 0xf5d249f5, 0x1a1022cb, 0xf12799c8, 0x1ee5f2f6, 0xfc39e98f, 0x13fb82b1, 0xf8cc39b2, 0x170e528c, 0xc1ab88e9, 0x2e69e3d7, 0xc55e58d4, 0x2a9c33ea, 0xc8402893, 0x278243ad, 0xccb5f8ae, 0x23779390, 0xd27cc81d, 0x3dbea323, 0xd6891820, 0x394b731e, 0xdb976867, 0x34550359, 0xdf62b85a, 0x30a0d364, 0xa9580ad1, 0x469a61ef, 0xadaddaec, 0x426fb1d2, 0xa0b3aaab, 0x4f71c195, 0xa4467a96, 0x4b8411a8, 0xba8f4a25, 0x554d211b, 0xbe7a9a18, 0x51b8f126, 0xb364ea5f, 0x5ca68161, 0xb7913a62, 0x5853515c, 0x8ef68b39, 0x6134e007, 0x8a035b04, 0x65c1303a, 0x871d2b43, 0x68df407d, 0x83e8fb7e, 0x6c2a9040, 0x9d21cbcd, 0x72e3a0f3, 0x99d41bf0, 0x761670ce, 0x94ca6bb7, 0x7b080089, 0x903fbb8a, 0x7ffdd0b4, 0x78bf0ea1, 0x977d659f, 0x7c4ade9c, 0x9388b5a2, 0x7154aedb, 0x9e96c5e5, 0x75a17ee6, 0x9a6315d8, 0x6b684e55, 0x84aa256b, 0x6f9d9e68, 0x805ff556, 0x6283ee2f, 0x8d418511, 0x66763e12, 0x89b4552c, 0x5f118f49, 0xb0d3e477, 0x5be45f74, 0xb426344a, 0x56fa2f33, 0xb938440d, 0x520fff0e, 0xbdcd9430, 0x4cc6cfbd, 0xa304a483, 0x48331f80, 0xa7f174be, 0x452d6fc7, 0xaaef04f9, 0x41d8bffa, 0xae1ad4c4, 0x37e20d71, 0xd820664f, 0x3317dd4c, 0xdcd5b672, 0x3e09ad0b, 0xd1cbc635, 0x3afc7d36, 0xd53e1608, 0x24354d85, 0xcbf726bb, 0x20c09db8, 0xcf02f686, 0x2ddeedff, 0xc21c86c1, 0x292b3dc2, 0xc6e956fc, 0x104c8c99, 0xff8ee7a7, 0x14b95ca4, 0xfb7b379a, 0x19a72ce3, 0xf66547dd, 0x1d52fcde, 0xf29097e0, 0x039bcc6d, 0xec59a753, 0x076e1c50, 0xe8ac776e, 0x0a706c17, 0xe5b20729, 0x0e85bc2a, 0xe147d714}, {0x00000000, 0x177b1443, 0x2ef62886, 0x398d3cc5, 0x5dec510c, 0x4a97454f, 0x731a798a, 0x64616dc9, 0xbbd8a218, 0xaca3b65b, 0x952e8a9e, 0x82559edd, 0xe634f314, 0xf14fe757, 0xc8c2db92, 0xdfb9cfd1, 0xacc04271, 0xbbbb5632, 0x82366af7, 0x954d7eb4, 0xf12c137d, 0xe657073e, 0xdfda3bfb, 0xc8a12fb8, 0x1718e069, 0x0063f42a, 0x39eec8ef, 0x2e95dcac, 0x4af4b165, 0x5d8fa526, 0x640299e3, 0x73798da0, 0x82f182a3, 0x958a96e0, 0xac07aa25, 0xbb7cbe66, 0xdf1dd3af, 0xc866c7ec, 0xf1ebfb29, 0xe690ef6a, 0x392920bb, 0x2e5234f8, 0x17df083d, 0x00a41c7e, 0x64c571b7, 0x73be65f4, 0x4a335931, 0x5d484d72, 0x2e31c0d2, 0x394ad491, 0x00c7e854, 0x17bcfc17, 0x73dd91de, 0x64a6859d, 0x5d2bb958, 0x4a50ad1b, 0x95e962ca, 0x82927689, 0xbb1f4a4c, 0xac645e0f, 0xc80533c6, 0xdf7e2785, 0xe6f31b40, 0xf1880f03, 0xde920307, 0xc9e91744, 0xf0642b81, 0xe71f3fc2, 0x837e520b, 0x94054648, 0xad887a8d, 0xbaf36ece, 0x654aa11f, 0x7231b55c, 0x4bbc8999, 0x5cc79dda, 0x38a6f013, 0x2fdde450, 0x1650d895, 0x012bccd6, 0x72524176, 0x65295535, 0x5ca469f0, 0x4bdf7db3, 0x2fbe107a, 0x38c50439, 0x014838fc, 0x16332cbf, 0xc98ae36e, 0xdef1f72d, 0xe77ccbe8, 0xf007dfab, 0x9466b262, 0x831da621, 0xba909ae4, 0xadeb8ea7, 0x5c6381a4, 0x4b1895e7, 0x7295a922, 0x65eebd61, 0x018fd0a8, 0x16f4c4eb, 0x2f79f82e, 0x3802ec6d, 0xe7bb23bc, 0xf0c037ff, 0xc94d0b3a, 0xde361f79, 0xba5772b0, 0xad2c66f3, 0x94a15a36, 0x83da4e75, 0xf0a3c3d5, 0xe7d8d796, 0xde55eb53, 0xc92eff10, 0xad4f92d9, 0xba34869a, 0x83b9ba5f, 0x94c2ae1c, 0x4b7b61cd, 0x5c00758e, 0x658d494b, 0x72f65d08, 0x169730c1, 0x01ec2482, 0x38611847, 0x2f1a0c04, 0x6655004f, 0x712e140c, 0x48a328c9, 0x5fd83c8a, 0x3bb95143, 0x2cc24500, 0x154f79c5, 0x02346d86, 0xdd8da257, 0xcaf6b614, 0xf37b8ad1, 0xe4009e92, 0x8061f35b, 0x971ae718, 0xae97dbdd, 0xb9eccf9e, 0xca95423e, 0xddee567d, 0xe4636ab8, 0xf3187efb, 0x97791332, 0x80020771, 0xb98f3bb4, 0xaef42ff7, 0x714de026, 0x6636f465, 0x5fbbc8a0, 0x48c0dce3, 0x2ca1b12a, 0x3bdaa569, 0x025799ac, 0x152c8def, 0xe4a482ec, 0xf3df96af, 0xca52aa6a, 0xdd29be29, 0xb948d3e0, 0xae33c7a3, 0x97befb66, 0x80c5ef25, 0x5f7c20f4, 0x480734b7, 0x718a0872, 0x66f11c31, 0x029071f8, 0x15eb65bb, 0x2c66597e, 0x3b1d4d3d, 0x4864c09d, 0x5f1fd4de, 0x6692e81b, 0x71e9fc58, 0x15889191, 0x02f385d2, 0x3b7eb917, 0x2c05ad54, 0xf3bc6285, 0xe4c776c6, 0xdd4a4a03, 0xca315e40, 0xae503389, 0xb92b27ca, 0x80a61b0f, 0x97dd0f4c, 0xb8c70348, 0xafbc170b, 0x96312bce, 0x814a3f8d, 0xe52b5244, 0xf2504607, 0xcbdd7ac2, 0xdca66e81, 0x031fa150, 0x1464b513, 0x2de989d6, 0x3a929d95, 0x5ef3f05c, 0x4988e41f, 0x7005d8da, 0x677ecc99, 0x14074139, 0x037c557a, 0x3af169bf, 0x2d8a7dfc, 0x49eb1035, 0x5e900476, 0x671d38b3, 0x70662cf0, 0xafdfe321, 0xb8a4f762, 0x8129cba7, 0x9652dfe4, 0xf233b22d, 0xe548a66e, 0xdcc59aab, 0xcbbe8ee8, 0x3a3681eb, 0x2d4d95a8, 0x14c0a96d, 0x03bbbd2e, 0x67dad0e7, 0x70a1c4a4, 0x492cf861, 0x5e57ec22, 0x81ee23f3, 0x969537b0, 0xaf180b75, 0xb8631f36, 0xdc0272ff, 0xcb7966bc, 0xf2f45a79, 0xe58f4e3a, 0x96f6c39a, 0x818dd7d9, 0xb800eb1c, 0xaf7bff5f, 0xcb1a9296, 0xdc6186d5, 0xe5ecba10, 0xf297ae53, 0x2d2e6182, 0x3a5575c1, 0x03d84904, 0x14a35d47, 0x70c2308e, 0x67b924cd, 0x5e341808, 0x494f0c4b}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x0000000000000000, 0x43147b1700000000, 0x8628f62e00000000, 0xc53c8d3900000000, 0x0c51ec5d00000000, 0x4f45974a00000000, 0x8a791a7300000000, 0xc96d616400000000, 0x18a2d8bb00000000, 0x5bb6a3ac00000000, 0x9e8a2e9500000000, 0xdd9e558200000000, 0x14f334e600000000, 0x57e74ff100000000, 0x92dbc2c800000000, 0xd1cfb9df00000000, 0x7142c0ac00000000, 0x3256bbbb00000000, 0xf76a368200000000, 0xb47e4d9500000000, 0x7d132cf100000000, 0x3e0757e600000000, 0xfb3bdadf00000000, 0xb82fa1c800000000, 0x69e0181700000000, 0x2af4630000000000, 0xefc8ee3900000000, 0xacdc952e00000000, 0x65b1f44a00000000, 0x26a58f5d00000000, 0xe399026400000000, 0xa08d797300000000, 0xa382f18200000000, 0xe0968a9500000000, 0x25aa07ac00000000, 0x66be7cbb00000000, 0xafd31ddf00000000, 0xecc766c800000000, 0x29fbebf100000000, 0x6aef90e600000000, 0xbb20293900000000, 0xf834522e00000000, 0x3d08df1700000000, 0x7e1ca40000000000, 0xb771c56400000000, 0xf465be7300000000, 0x3159334a00000000, 0x724d485d00000000, 0xd2c0312e00000000, 0x91d44a3900000000, 0x54e8c70000000000, 0x17fcbc1700000000, 0xde91dd7300000000, 0x9d85a66400000000, 0x58b92b5d00000000, 0x1bad504a00000000, 0xca62e99500000000, 0x8976928200000000, 0x4c4a1fbb00000000, 0x0f5e64ac00000000, 0xc63305c800000000, 0x85277edf00000000, 0x401bf3e600000000, 0x030f88f100000000, 0x070392de00000000, 0x4417e9c900000000, 0x812b64f000000000, 0xc23f1fe700000000, 0x0b527e8300000000, 0x4846059400000000, 0x8d7a88ad00000000, 0xce6ef3ba00000000, 0x1fa14a6500000000, 0x5cb5317200000000, 0x9989bc4b00000000, 0xda9dc75c00000000, 0x13f0a63800000000, 0x50e4dd2f00000000, 0x95d8501600000000, 0xd6cc2b0100000000, 0x7641527200000000, 0x3555296500000000, 0xf069a45c00000000, 0xb37ddf4b00000000, 0x7a10be2f00000000, 0x3904c53800000000, 0xfc38480100000000, 0xbf2c331600000000, 0x6ee38ac900000000, 0x2df7f1de00000000, 0xe8cb7ce700000000, 0xabdf07f000000000, 0x62b2669400000000, 0x21a61d8300000000, 0xe49a90ba00000000, 0xa78eebad00000000, 0xa481635c00000000, 0xe795184b00000000, 0x22a9957200000000, 0x61bdee6500000000, 0xa8d08f0100000000, 0xebc4f41600000000, 0x2ef8792f00000000, 0x6dec023800000000, 0xbc23bbe700000000, 0xff37c0f000000000, 0x3a0b4dc900000000, 0x791f36de00000000, 0xb07257ba00000000, 0xf3662cad00000000, 0x365aa19400000000, 0x754eda8300000000, 0xd5c3a3f000000000, 0x96d7d8e700000000, 0x53eb55de00000000, 0x10ff2ec900000000, 0xd9924fad00000000, 0x9a8634ba00000000, 0x5fbab98300000000, 0x1caec29400000000, 0xcd617b4b00000000, 0x8e75005c00000000, 0x4b498d6500000000, 0x085df67200000000, 0xc130971600000000, 0x8224ec0100000000, 0x4718613800000000, 0x040c1a2f00000000, 0x4f00556600000000, 0x0c142e7100000000, 0xc928a34800000000, 0x8a3cd85f00000000, 0x4351b93b00000000, 0x0045c22c00000000, 0xc5794f1500000000, 0x866d340200000000, 0x57a28ddd00000000, 0x14b6f6ca00000000, 0xd18a7bf300000000, 0x929e00e400000000, 0x5bf3618000000000, 0x18e71a9700000000, 0xdddb97ae00000000, 0x9ecfecb900000000, 0x3e4295ca00000000, 0x7d56eedd00000000, 0xb86a63e400000000, 0xfb7e18f300000000, 0x3213799700000000, 0x7107028000000000, 0xb43b8fb900000000, 0xf72ff4ae00000000, 0x26e04d7100000000, 0x65f4366600000000, 0xa0c8bb5f00000000, 0xe3dcc04800000000, 0x2ab1a12c00000000, 0x69a5da3b00000000, 0xac99570200000000, 0xef8d2c1500000000, 0xec82a4e400000000, 0xaf96dff300000000, 0x6aaa52ca00000000, 0x29be29dd00000000, 0xe0d348b900000000, 0xa3c733ae00000000, 0x66fbbe9700000000, 0x25efc58000000000, 0xf4207c5f00000000, 0xb734074800000000, 0x72088a7100000000, 0x311cf16600000000, 0xf871900200000000, 0xbb65eb1500000000, 0x7e59662c00000000, 0x3d4d1d3b00000000, 0x9dc0644800000000, 0xded41f5f00000000, 0x1be8926600000000, 0x58fce97100000000, 0x9191881500000000, 0xd285f30200000000, 0x17b97e3b00000000, 0x54ad052c00000000, 0x8562bcf300000000, 0xc676c7e400000000, 0x034a4add00000000, 0x405e31ca00000000, 0x893350ae00000000, 0xca272bb900000000, 0x0f1ba68000000000, 0x4c0fdd9700000000, 0x4803c7b800000000, 0x0b17bcaf00000000, 0xce2b319600000000, 0x8d3f4a8100000000, 0x44522be500000000, 0x074650f200000000, 0xc27addcb00000000, 0x816ea6dc00000000, 0x50a11f0300000000, 0x13b5641400000000, 0xd689e92d00000000, 0x959d923a00000000, 0x5cf0f35e00000000, 0x1fe4884900000000, 0xdad8057000000000, 0x99cc7e6700000000, 0x3941071400000000, 0x7a557c0300000000, 0xbf69f13a00000000, 0xfc7d8a2d00000000, 0x3510eb4900000000, 0x7604905e00000000, 0xb3381d6700000000, 0xf02c667000000000, 0x21e3dfaf00000000, 0x62f7a4b800000000, 0xa7cb298100000000, 0xe4df529600000000, 0x2db233f200000000, 0x6ea648e500000000, 0xab9ac5dc00000000, 0xe88ebecb00000000, 0xeb81363a00000000, 0xa8954d2d00000000, 0x6da9c01400000000, 0x2ebdbb0300000000, 0xe7d0da6700000000, 0xa4c4a17000000000, 0x61f82c4900000000, 0x22ec575e00000000, 0xf323ee8100000000, 0xb037959600000000, 0x750b18af00000000, 0x361f63b800000000, 0xff7202dc00000000, 0xbc6679cb00000000, 0x795af4f200000000, 0x3a4e8fe500000000, 0x9ac3f69600000000, 0xd9d78d8100000000, 0x1ceb00b800000000, 0x5fff7baf00000000, 0x96921acb00000000, 0xd58661dc00000000, 0x10baece500000000, 0x53ae97f200000000, 0x82612e2d00000000, 0xc175553a00000000, 0x0449d80300000000, 0x475da31400000000, 0x8e30c27000000000, 0xcd24b96700000000, 0x0818345e00000000, 0x4b0c4f4900000000}, {0x0000000000000000, 0x3e6bc2ef00000000, 0x3dd0f50400000000, 0x03bb37eb00000000, 0x7aa0eb0900000000, 0x44cb29e600000000, 0x47701e0d00000000, 0x791bdce200000000, 0xf440d71300000000, 0xca2b15fc00000000, 0xc990221700000000, 0xf7fbe0f800000000, 0x8ee03c1a00000000, 0xb08bfef500000000, 0xb330c91e00000000, 0x8d5b0bf100000000, 0xe881ae2700000000, 0xd6ea6cc800000000, 0xd5515b2300000000, 0xeb3a99cc00000000, 0x9221452e00000000, 0xac4a87c100000000, 0xaff1b02a00000000, 0x919a72c500000000, 0x1cc1793400000000, 0x22aabbdb00000000, 0x21118c3000000000, 0x1f7a4edf00000000, 0x6661923d00000000, 0x580a50d200000000, 0x5bb1673900000000, 0x65daa5d600000000, 0xd0035d4f00000000, 0xee689fa000000000, 0xedd3a84b00000000, 0xd3b86aa400000000, 0xaaa3b64600000000, 0x94c874a900000000, 0x9773434200000000, 0xa91881ad00000000, 0x24438a5c00000000, 0x1a2848b300000000, 0x19937f5800000000, 0x27f8bdb700000000, 0x5ee3615500000000, 0x6088a3ba00000000, 0x6333945100000000, 0x5d5856be00000000, 0x3882f36800000000, 0x06e9318700000000, 0x0552066c00000000, 0x3b39c48300000000, 0x4222186100000000, 0x7c49da8e00000000, 0x7ff2ed6500000000, 0x41992f8a00000000, 0xccc2247b00000000, 0xf2a9e69400000000, 0xf112d17f00000000, 0xcf79139000000000, 0xb662cf7200000000, 0x88090d9d00000000, 0x8bb23a7600000000, 0xb5d9f89900000000, 0xa007ba9e00000000, 0x9e6c787100000000, 0x9dd74f9a00000000, 0xa3bc8d7500000000, 0xdaa7519700000000, 0xe4cc937800000000, 0xe777a49300000000, 0xd91c667c00000000, 0x54476d8d00000000, 0x6a2caf6200000000, 0x6997988900000000, 0x57fc5a6600000000, 0x2ee7868400000000, 0x108c446b00000000, 0x1337738000000000, 0x2d5cb16f00000000, 0x488614b900000000, 0x76edd65600000000, 0x7556e1bd00000000, 0x4b3d235200000000, 0x3226ffb000000000, 0x0c4d3d5f00000000, 0x0ff60ab400000000, 0x319dc85b00000000, 0xbcc6c3aa00000000, 0x82ad014500000000, 0x811636ae00000000, 0xbf7df44100000000, 0xc66628a300000000, 0xf80dea4c00000000, 0xfbb6dda700000000, 0xc5dd1f4800000000, 0x7004e7d100000000, 0x4e6f253e00000000, 0x4dd412d500000000, 0x73bfd03a00000000, 0x0aa40cd800000000, 0x34cfce3700000000, 0x3774f9dc00000000, 0x091f3b3300000000, 0x844430c200000000, 0xba2ff22d00000000, 0xb994c5c600000000, 0x87ff072900000000, 0xfee4dbcb00000000, 0xc08f192400000000, 0xc3342ecf00000000, 0xfd5fec2000000000, 0x988549f600000000, 0xa6ee8b1900000000, 0xa555bcf200000000, 0x9b3e7e1d00000000, 0xe225a2ff00000000, 0xdc4e601000000000, 0xdff557fb00000000, 0xe19e951400000000, 0x6cc59ee500000000, 0x52ae5c0a00000000, 0x51156be100000000, 0x6f7ea90e00000000, 0x166575ec00000000, 0x280eb70300000000, 0x2bb580e800000000, 0x15de420700000000, 0x010905e600000000, 0x3f62c70900000000, 0x3cd9f0e200000000, 0x02b2320d00000000, 0x7ba9eeef00000000, 0x45c22c0000000000, 0x46791beb00000000, 0x7812d90400000000, 0xf549d2f500000000, 0xcb22101a00000000, 0xc89927f100000000, 0xf6f2e51e00000000, 0x8fe939fc00000000, 0xb182fb1300000000, 0xb239ccf800000000, 0x8c520e1700000000, 0xe988abc100000000, 0xd7e3692e00000000, 0xd4585ec500000000, 0xea339c2a00000000, 0x932840c800000000, 0xad43822700000000, 0xaef8b5cc00000000, 0x9093772300000000, 0x1dc87cd200000000, 0x23a3be3d00000000, 0x201889d600000000, 0x1e734b3900000000, 0x676897db00000000, 0x5903553400000000, 0x5ab862df00000000, 0x64d3a03000000000, 0xd10a58a900000000, 0xef619a4600000000, 0xecdaadad00000000, 0xd2b16f4200000000, 0xabaab3a000000000, 0x95c1714f00000000, 0x967a46a400000000, 0xa811844b00000000, 0x254a8fba00000000, 0x1b214d5500000000, 0x189a7abe00000000, 0x26f1b85100000000, 0x5fea64b300000000, 0x6181a65c00000000, 0x623a91b700000000, 0x5c51535800000000, 0x398bf68e00000000, 0x07e0346100000000, 0x045b038a00000000, 0x3a30c16500000000, 0x432b1d8700000000, 0x7d40df6800000000, 0x7efbe88300000000, 0x40902a6c00000000, 0xcdcb219d00000000, 0xf3a0e37200000000, 0xf01bd49900000000, 0xce70167600000000, 0xb76bca9400000000, 0x8900087b00000000, 0x8abb3f9000000000, 0xb4d0fd7f00000000, 0xa10ebf7800000000, 0x9f657d9700000000, 0x9cde4a7c00000000, 0xa2b5889300000000, 0xdbae547100000000, 0xe5c5969e00000000, 0xe67ea17500000000, 0xd815639a00000000, 0x554e686b00000000, 0x6b25aa8400000000, 0x689e9d6f00000000, 0x56f55f8000000000, 0x2fee836200000000, 0x1185418d00000000, 0x123e766600000000, 0x2c55b48900000000, 0x498f115f00000000, 0x77e4d3b000000000, 0x745fe45b00000000, 0x4a3426b400000000, 0x332ffa5600000000, 0x0d4438b900000000, 0x0eff0f5200000000, 0x3094cdbd00000000, 0xbdcfc64c00000000, 0x83a404a300000000, 0x801f334800000000, 0xbe74f1a700000000, 0xc76f2d4500000000, 0xf904efaa00000000, 0xfabfd84100000000, 0xc4d41aae00000000, 0x710de23700000000, 0x4f6620d800000000, 0x4cdd173300000000, 0x72b6d5dc00000000, 0x0bad093e00000000, 0x35c6cbd100000000, 0x367dfc3a00000000, 0x08163ed500000000, 0x854d352400000000, 0xbb26f7cb00000000, 0xb89dc02000000000, 0x86f602cf00000000, 0xffedde2d00000000, 0xc1861cc200000000, 0xc23d2b2900000000, 0xfc56e9c600000000, 0x998c4c1000000000, 0xa7e78eff00000000, 0xa45cb91400000000, 0x9a377bfb00000000, 0xe32ca71900000000, 0xdd4765f600000000, 0xdefc521d00000000, 0xe09790f200000000, 0x6dcc9b0300000000, 0x53a759ec00000000, 0x501c6e0700000000, 0x6e77ace800000000, 0x176c700a00000000, 0x2907b2e500000000, 0x2abc850e00000000, 0x14d747e100000000}, {0x0000000000000000, 0xc0df8ec100000000, 0xc1b96c5800000000, 0x0166e29900000000, 0x8273d9b000000000, 0x42ac577100000000, 0x43cab5e800000000, 0x83153b2900000000, 0x45e1c3ba00000000, 0x853e4d7b00000000, 0x8458afe200000000, 0x4487212300000000, 0xc7921a0a00000000, 0x074d94cb00000000, 0x062b765200000000, 0xc6f4f89300000000, 0xcbc4f6ae00000000, 0x0b1b786f00000000, 0x0a7d9af600000000, 0xcaa2143700000000, 0x49b72f1e00000000, 0x8968a1df00000000, 0x880e434600000000, 0x48d1cd8700000000, 0x8e25351400000000, 0x4efabbd500000000, 0x4f9c594c00000000, 0x8f43d78d00000000, 0x0c56eca400000000, 0xcc89626500000000, 0xcdef80fc00000000, 0x0d300e3d00000000, 0xd78f9c8600000000, 0x1750124700000000, 0x1636f0de00000000, 0xd6e97e1f00000000, 0x55fc453600000000, 0x9523cbf700000000, 0x9445296e00000000, 0x549aa7af00000000, 0x926e5f3c00000000, 0x52b1d1fd00000000, 0x53d7336400000000, 0x9308bda500000000, 0x101d868c00000000, 0xd0c2084d00000000, 0xd1a4ead400000000, 0x117b641500000000, 0x1c4b6a2800000000, 0xdc94e4e900000000, 0xddf2067000000000, 0x1d2d88b100000000, 0x9e38b39800000000, 0x5ee73d5900000000, 0x5f81dfc000000000, 0x9f5e510100000000, 0x59aaa99200000000, 0x9975275300000000, 0x9813c5ca00000000, 0x58cc4b0b00000000, 0xdbd9702200000000, 0x1b06fee300000000, 0x1a601c7a00000000, 0xdabf92bb00000000, 0xef1948d600000000, 0x2fc6c61700000000, 0x2ea0248e00000000, 0xee7faa4f00000000, 0x6d6a916600000000, 0xadb51fa700000000, 0xacd3fd3e00000000, 0x6c0c73ff00000000, 0xaaf88b6c00000000, 0x6a2705ad00000000, 0x6b41e73400000000, 0xab9e69f500000000, 0x288b52dc00000000, 0xe854dc1d00000000, 0xe9323e8400000000, 0x29edb04500000000, 0x24ddbe7800000000, 0xe40230b900000000, 0xe564d22000000000, 0x25bb5ce100000000, 0xa6ae67c800000000, 0x6671e90900000000, 0x67170b9000000000, 0xa7c8855100000000, 0x613c7dc200000000, 0xa1e3f30300000000, 0xa085119a00000000, 0x605a9f5b00000000, 0xe34fa47200000000, 0x23902ab300000000, 0x22f6c82a00000000, 0xe22946eb00000000, 0x3896d45000000000, 0xf8495a9100000000, 0xf92fb80800000000, 0x39f036c900000000, 0xbae50de000000000, 0x7a3a832100000000, 0x7b5c61b800000000, 0xbb83ef7900000000, 0x7d7717ea00000000, 0xbda8992b00000000, 0xbcce7bb200000000, 0x7c11f57300000000, 0xff04ce5a00000000, 0x3fdb409b00000000, 0x3ebda20200000000, 0xfe622cc300000000, 0xf35222fe00000000, 0x338dac3f00000000, 0x32eb4ea600000000, 0xf234c06700000000, 0x7121fb4e00000000, 0xb1fe758f00000000, 0xb098971600000000, 0x704719d700000000, 0xb6b3e14400000000, 0x766c6f8500000000, 0x770a8d1c00000000, 0xb7d503dd00000000, 0x34c038f400000000, 0xf41fb63500000000, 0xf57954ac00000000, 0x35a6da6d00000000, 0x9f35e17700000000, 0x5fea6fb600000000, 0x5e8c8d2f00000000, 0x9e5303ee00000000, 0x1d4638c700000000, 0xdd99b60600000000, 0xdcff549f00000000, 0x1c20da5e00000000, 0xdad422cd00000000, 0x1a0bac0c00000000, 0x1b6d4e9500000000, 0xdbb2c05400000000, 0x58a7fb7d00000000, 0x987875bc00000000, 0x991e972500000000, 0x59c119e400000000, 0x54f117d900000000, 0x942e991800000000, 0x95487b8100000000, 0x5597f54000000000, 0xd682ce6900000000, 0x165d40a800000000, 0x173ba23100000000, 0xd7e42cf000000000, 0x1110d46300000000, 0xd1cf5aa200000000, 0xd0a9b83b00000000, 0x107636fa00000000, 0x93630dd300000000, 0x53bc831200000000, 0x52da618b00000000, 0x9205ef4a00000000, 0x48ba7df100000000, 0x8865f33000000000, 0x890311a900000000, 0x49dc9f6800000000, 0xcac9a44100000000, 0x0a162a8000000000, 0x0b70c81900000000, 0xcbaf46d800000000, 0x0d5bbe4b00000000, 0xcd84308a00000000, 0xcce2d21300000000, 0x0c3d5cd200000000, 0x8f2867fb00000000, 0x4ff7e93a00000000, 0x4e910ba300000000, 0x8e4e856200000000, 0x837e8b5f00000000, 0x43a1059e00000000, 0x42c7e70700000000, 0x821869c600000000, 0x010d52ef00000000, 0xc1d2dc2e00000000, 0xc0b43eb700000000, 0x006bb07600000000, 0xc69f48e500000000, 0x0640c62400000000, 0x072624bd00000000, 0xc7f9aa7c00000000, 0x44ec915500000000, 0x84331f9400000000, 0x8555fd0d00000000, 0x458a73cc00000000, 0x702ca9a100000000, 0xb0f3276000000000, 0xb195c5f900000000, 0x714a4b3800000000, 0xf25f701100000000, 0x3280fed000000000, 0x33e61c4900000000, 0xf339928800000000, 0x35cd6a1b00000000, 0xf512e4da00000000, 0xf474064300000000, 0x34ab888200000000, 0xb7beb3ab00000000, 0x77613d6a00000000, 0x7607dff300000000, 0xb6d8513200000000, 0xbbe85f0f00000000, 0x7b37d1ce00000000, 0x7a51335700000000, 0xba8ebd9600000000, 0x399b86bf00000000, 0xf944087e00000000, 0xf822eae700000000, 0x38fd642600000000, 0xfe099cb500000000, 0x3ed6127400000000, 0x3fb0f0ed00000000, 0xff6f7e2c00000000, 0x7c7a450500000000, 0xbca5cbc400000000, 0xbdc3295d00000000, 0x7d1ca79c00000000, 0xa7a3352700000000, 0x677cbbe600000000, 0x661a597f00000000, 0xa6c5d7be00000000, 0x25d0ec9700000000, 0xe50f625600000000, 0xe46980cf00000000, 0x24b60e0e00000000, 0xe242f69d00000000, 0x229d785c00000000, 0x23fb9ac500000000, 0xe324140400000000, 0x60312f2d00000000, 0xa0eea1ec00000000, 0xa188437500000000, 0x6157cdb400000000, 0x6c67c38900000000, 0xacb84d4800000000, 0xaddeafd100000000, 0x6d01211000000000, 0xee141a3900000000, 0x2ecb94f800000000, 0x2fad766100000000, 0xef72f8a000000000, 0x2986003300000000, 0xe9598ef200000000, 0xe83f6c6b00000000, 0x28e0e2aa00000000, 0xabf5d98300000000, 0x6b2a574200000000, 0x6a4cb5db00000000, 0xaa933b1a00000000}, {0x0000000000000000, 0x6f4ca59b00000000, 0x9f9e3bec00000000, 0xf0d29e7700000000, 0x7f3b060300000000, 0x1077a39800000000, 0xe0a53def00000000, 0x8fe9987400000000, 0xfe760c0600000000, 0x913aa99d00000000, 0x61e837ea00000000, 0x0ea4927100000000, 0x814d0a0500000000, 0xee01af9e00000000, 0x1ed331e900000000, 0x719f947200000000, 0xfced180c00000000, 0x93a1bd9700000000, 0x637323e000000000, 0x0c3f867b00000000, 0x83d61e0f00000000, 0xec9abb9400000000, 0x1c4825e300000000, 0x7304807800000000, 0x029b140a00000000, 0x6dd7b19100000000, 0x9d052fe600000000, 0xf2498a7d00000000, 0x7da0120900000000, 0x12ecb79200000000, 0xe23e29e500000000, 0x8d728c7e00000000, 0xf8db311800000000, 0x9797948300000000, 0x67450af400000000, 0x0809af6f00000000, 0x87e0371b00000000, 0xe8ac928000000000, 0x187e0cf700000000, 0x7732a96c00000000, 0x06ad3d1e00000000, 0x69e1988500000000, 0x993306f200000000, 0xf67fa36900000000, 0x79963b1d00000000, 0x16da9e8600000000, 0xe60800f100000000, 0x8944a56a00000000, 0x0436291400000000, 0x6b7a8c8f00000000, 0x9ba812f800000000, 0xf4e4b76300000000, 0x7b0d2f1700000000, 0x14418a8c00000000, 0xe49314fb00000000, 0x8bdfb16000000000, 0xfa40251200000000, 0x950c808900000000, 0x65de1efe00000000, 0x0a92bb6500000000, 0x857b231100000000, 0xea37868a00000000, 0x1ae518fd00000000, 0x75a9bd6600000000, 0xf0b7633000000000, 0x9ffbc6ab00000000, 0x6f2958dc00000000, 0x0065fd4700000000, 0x8f8c653300000000, 0xe0c0c0a800000000, 0x10125edf00000000, 0x7f5efb4400000000, 0x0ec16f3600000000, 0x618dcaad00000000, 0x915f54da00000000, 0xfe13f14100000000, 0x71fa693500000000, 0x1eb6ccae00000000, 0xee6452d900000000, 0x8128f74200000000, 0x0c5a7b3c00000000, 0x6316dea700000000, 0x93c440d000000000, 0xfc88e54b00000000, 0x73617d3f00000000, 0x1c2dd8a400000000, 0xecff46d300000000, 0x83b3e34800000000, 0xf22c773a00000000, 0x9d60d2a100000000, 0x6db24cd600000000, 0x02fee94d00000000, 0x8d17713900000000, 0xe25bd4a200000000, 0x12894ad500000000, 0x7dc5ef4e00000000, 0x086c522800000000, 0x6720f7b300000000, 0x97f269c400000000, 0xf8becc5f00000000, 0x7757542b00000000, 0x181bf1b000000000, 0xe8c96fc700000000, 0x8785ca5c00000000, 0xf61a5e2e00000000, 0x9956fbb500000000, 0x698465c200000000, 0x06c8c05900000000, 0x8921582d00000000, 0xe66dfdb600000000, 0x16bf63c100000000, 0x79f3c65a00000000, 0xf4814a2400000000, 0x9bcdefbf00000000, 0x6b1f71c800000000, 0x0453d45300000000, 0x8bba4c2700000000, 0xe4f6e9bc00000000, 0x142477cb00000000, 0x7b68d25000000000, 0x0af7462200000000, 0x65bbe3b900000000, 0x95697dce00000000, 0xfa25d85500000000, 0x75cc402100000000, 0x1a80e5ba00000000, 0xea527bcd00000000, 0x851ede5600000000, 0xe06fc76000000000, 0x8f2362fb00000000, 0x7ff1fc8c00000000, 0x10bd591700000000, 0x9f54c16300000000, 0xf01864f800000000, 0x00cafa8f00000000, 0x6f865f1400000000, 0x1e19cb6600000000, 0x71556efd00000000, 0x8187f08a00000000, 0xeecb551100000000, 0x6122cd6500000000, 0x0e6e68fe00000000, 0xfebcf68900000000, 0x91f0531200000000, 0x1c82df6c00000000, 0x73ce7af700000000, 0x831ce48000000000, 0xec50411b00000000, 0x63b9d96f00000000, 0x0cf57cf400000000, 0xfc27e28300000000, 0x936b471800000000, 0xe2f4d36a00000000, 0x8db876f100000000, 0x7d6ae88600000000, 0x12264d1d00000000, 0x9dcfd56900000000, 0xf28370f200000000, 0x0251ee8500000000, 0x6d1d4b1e00000000, 0x18b4f67800000000, 0x77f853e300000000, 0x872acd9400000000, 0xe866680f00000000, 0x678ff07b00000000, 0x08c355e000000000, 0xf811cb9700000000, 0x975d6e0c00000000, 0xe6c2fa7e00000000, 0x898e5fe500000000, 0x795cc19200000000, 0x1610640900000000, 0x99f9fc7d00000000, 0xf6b559e600000000, 0x0667c79100000000, 0x692b620a00000000, 0xe459ee7400000000, 0x8b154bef00000000, 0x7bc7d59800000000, 0x148b700300000000, 0x9b62e87700000000, 0xf42e4dec00000000, 0x04fcd39b00000000, 0x6bb0760000000000, 0x1a2fe27200000000, 0x756347e900000000, 0x85b1d99e00000000, 0xeafd7c0500000000, 0x6514e47100000000, 0x0a5841ea00000000, 0xfa8adf9d00000000, 0x95c67a0600000000, 0x10d8a45000000000, 0x7f9401cb00000000, 0x8f469fbc00000000, 0xe00a3a2700000000, 0x6fe3a25300000000, 0x00af07c800000000, 0xf07d99bf00000000, 0x9f313c2400000000, 0xeeaea85600000000, 0x81e20dcd00000000, 0x713093ba00000000, 0x1e7c362100000000, 0x9195ae5500000000, 0xfed90bce00000000, 0x0e0b95b900000000, 0x6147302200000000, 0xec35bc5c00000000, 0x837919c700000000, 0x73ab87b000000000, 0x1ce7222b00000000, 0x930eba5f00000000, 0xfc421fc400000000, 0x0c9081b300000000, 0x63dc242800000000, 0x1243b05a00000000, 0x7d0f15c100000000, 0x8ddd8bb600000000, 0xe2912e2d00000000, 0x6d78b65900000000, 0x023413c200000000, 0xf2e68db500000000, 0x9daa282e00000000, 0xe803954800000000, 0x874f30d300000000, 0x779daea400000000, 0x18d10b3f00000000, 0x9738934b00000000, 0xf87436d000000000, 0x08a6a8a700000000, 0x67ea0d3c00000000, 0x1675994e00000000, 0x79393cd500000000, 0x89eba2a200000000, 0xe6a7073900000000, 0x694e9f4d00000000, 0x06023ad600000000, 0xf6d0a4a100000000, 0x999c013a00000000, 0x14ee8d4400000000, 0x7ba228df00000000, 0x8b70b6a800000000, 0xe43c133300000000, 0x6bd58b4700000000, 0x04992edc00000000, 0xf44bb0ab00000000, 0x9b07153000000000, 0xea98814200000000, 0x85d424d900000000, 0x7506baae00000000, 0x1a4a1f3500000000, 0x95a3874100000000, 0xfaef22da00000000, 0x0a3dbcad00000000, 0x6571193600000000}, {0x0000000000000000, 0x85d996dd00000000, 0x4bb55c6000000000, 0xce6ccabd00000000, 0x966ab9c000000000, 0x13b32f1d00000000, 0xdddfe5a000000000, 0x5806737d00000000, 0x6dd3035a00000000, 0xe80a958700000000, 0x26665f3a00000000, 0xa3bfc9e700000000, 0xfbb9ba9a00000000, 0x7e602c4700000000, 0xb00ce6fa00000000, 0x35d5702700000000, 0xdaa607b400000000, 0x5f7f916900000000, 0x91135bd400000000, 0x14cacd0900000000, 0x4cccbe7400000000, 0xc91528a900000000, 0x0779e21400000000, 0x82a074c900000000, 0xb77504ee00000000, 0x32ac923300000000, 0xfcc0588e00000000, 0x7919ce5300000000, 0x211fbd2e00000000, 0xa4c62bf300000000, 0x6aaae14e00000000, 0xef73779300000000, 0xf54b7eb300000000, 0x7092e86e00000000, 0xbefe22d300000000, 0x3b27b40e00000000, 0x6321c77300000000, 0xe6f851ae00000000, 0x28949b1300000000, 0xad4d0dce00000000, 0x98987de900000000, 0x1d41eb3400000000, 0xd32d218900000000, 0x56f4b75400000000, 0x0ef2c42900000000, 0x8b2b52f400000000, 0x4547984900000000, 0xc09e0e9400000000, 0x2fed790700000000, 0xaa34efda00000000, 0x6458256700000000, 0xe181b3ba00000000, 0xb987c0c700000000, 0x3c5e561a00000000, 0xf2329ca700000000, 0x77eb0a7a00000000, 0x423e7a5d00000000, 0xc7e7ec8000000000, 0x098b263d00000000, 0x8c52b0e000000000, 0xd454c39d00000000, 0x518d554000000000, 0x9fe19ffd00000000, 0x1a38092000000000, 0xab918dbd00000000, 0x2e481b6000000000, 0xe024d1dd00000000, 0x65fd470000000000, 0x3dfb347d00000000, 0xb822a2a000000000, 0x764e681d00000000, 0xf397fec000000000, 0xc6428ee700000000, 0x439b183a00000000, 0x8df7d28700000000, 0x082e445a00000000, 0x5028372700000000, 0xd5f1a1fa00000000, 0x1b9d6b4700000000, 0x9e44fd9a00000000, 0x71378a0900000000, 0xf4ee1cd400000000, 0x3a82d66900000000, 0xbf5b40b400000000, 0xe75d33c900000000, 0x6284a51400000000, 0xace86fa900000000, 0x2931f97400000000, 0x1ce4895300000000, 0x993d1f8e00000000, 0x5751d53300000000, 0xd28843ee00000000, 0x8a8e309300000000, 0x0f57a64e00000000, 0xc13b6cf300000000, 0x44e2fa2e00000000, 0x5edaf30e00000000, 0xdb0365d300000000, 0x156faf6e00000000, 0x90b639b300000000, 0xc8b04ace00000000, 0x4d69dc1300000000, 0x830516ae00000000, 0x06dc807300000000, 0x3309f05400000000, 0xb6d0668900000000, 0x78bcac3400000000, 0xfd653ae900000000, 0xa563499400000000, 0x20badf4900000000, 0xeed615f400000000, 0x6b0f832900000000, 0x847cf4ba00000000, 0x01a5626700000000, 0xcfc9a8da00000000, 0x4a103e0700000000, 0x12164d7a00000000, 0x97cfdba700000000, 0x59a3111a00000000, 0xdc7a87c700000000, 0xe9aff7e000000000, 0x6c76613d00000000, 0xa21aab8000000000, 0x27c33d5d00000000, 0x7fc54e2000000000, 0xfa1cd8fd00000000, 0x3470124000000000, 0xb1a9849d00000000, 0x17256aa000000000, 0x92fcfc7d00000000, 0x5c9036c000000000, 0xd949a01d00000000, 0x814fd36000000000, 0x049645bd00000000, 0xcafa8f0000000000, 0x4f2319dd00000000, 0x7af669fa00000000, 0xff2fff2700000000, 0x3143359a00000000, 0xb49aa34700000000, 0xec9cd03a00000000, 0x694546e700000000, 0xa7298c5a00000000, 0x22f01a8700000000, 0xcd836d1400000000, 0x485afbc900000000, 0x8636317400000000, 0x03efa7a900000000, 0x5be9d4d400000000, 0xde30420900000000, 0x105c88b400000000, 0x95851e6900000000, 0xa0506e4e00000000, 0x2589f89300000000, 0xebe5322e00000000, 0x6e3ca4f300000000, 0x363ad78e00000000, 0xb3e3415300000000, 0x7d8f8bee00000000, 0xf8561d3300000000, 0xe26e141300000000, 0x67b782ce00000000, 0xa9db487300000000, 0x2c02deae00000000, 0x7404add300000000, 0xf1dd3b0e00000000, 0x3fb1f1b300000000, 0xba68676e00000000, 0x8fbd174900000000, 0x0a64819400000000, 0xc4084b2900000000, 0x41d1ddf400000000, 0x19d7ae8900000000, 0x9c0e385400000000, 0x5262f2e900000000, 0xd7bb643400000000, 0x38c813a700000000, 0xbd11857a00000000, 0x737d4fc700000000, 0xf6a4d91a00000000, 0xaea2aa6700000000, 0x2b7b3cba00000000, 0xe517f60700000000, 0x60ce60da00000000, 0x551b10fd00000000, 0xd0c2862000000000, 0x1eae4c9d00000000, 0x9b77da4000000000, 0xc371a93d00000000, 0x46a83fe000000000, 0x88c4f55d00000000, 0x0d1d638000000000, 0xbcb4e71d00000000, 0x396d71c000000000, 0xf701bb7d00000000, 0x72d82da000000000, 0x2ade5edd00000000, 0xaf07c80000000000, 0x616b02bd00000000, 0xe4b2946000000000, 0xd167e44700000000, 0x54be729a00000000, 0x9ad2b82700000000, 0x1f0b2efa00000000, 0x470d5d8700000000, 0xc2d4cb5a00000000, 0x0cb801e700000000, 0x8961973a00000000, 0x6612e0a900000000, 0xe3cb767400000000, 0x2da7bcc900000000, 0xa87e2a1400000000, 0xf078596900000000, 0x75a1cfb400000000, 0xbbcd050900000000, 0x3e1493d400000000, 0x0bc1e3f300000000, 0x8e18752e00000000, 0x4074bf9300000000, 0xc5ad294e00000000, 0x9dab5a3300000000, 0x1872ccee00000000, 0xd61e065300000000, 0x53c7908e00000000, 0x49ff99ae00000000, 0xcc260f7300000000, 0x024ac5ce00000000, 0x8793531300000000, 0xdf95206e00000000, 0x5a4cb6b300000000, 0x94207c0e00000000, 0x11f9ead300000000, 0x242c9af400000000, 0xa1f50c2900000000, 0x6f99c69400000000, 0xea40504900000000, 0xb246233400000000, 0x379fb5e900000000, 0xf9f37f5400000000, 0x7c2ae98900000000, 0x93599e1a00000000, 0x168008c700000000, 0xd8ecc27a00000000, 0x5d3554a700000000, 0x053327da00000000, 0x80eab10700000000, 0x4e867bba00000000, 0xcb5fed6700000000, 0xfe8a9d4000000000, 0x7b530b9d00000000, 0xb53fc12000000000, 0x30e657fd00000000, 0x68e0248000000000, 0xed39b25d00000000, 0x235578e000000000, 0xa68cee3d00000000}, {0x0000000000000000, 0x76e10f9d00000000, 0xadc46ee100000000, 0xdb25617c00000000, 0x1b8fac1900000000, 0x6d6ea38400000000, 0xb64bc2f800000000, 0xc0aacd6500000000, 0x361e593300000000, 0x40ff56ae00000000, 0x9bda37d200000000, 0xed3b384f00000000, 0x2d91f52a00000000, 0x5b70fab700000000, 0x80559bcb00000000, 0xf6b4945600000000, 0x6c3cb26600000000, 0x1addbdfb00000000, 0xc1f8dc8700000000, 0xb719d31a00000000, 0x77b31e7f00000000, 0x015211e200000000, 0xda77709e00000000, 0xac967f0300000000, 0x5a22eb5500000000, 0x2cc3e4c800000000, 0xf7e685b400000000, 0x81078a2900000000, 0x41ad474c00000000, 0x374c48d100000000, 0xec6929ad00000000, 0x9a88263000000000, 0xd87864cd00000000, 0xae996b5000000000, 0x75bc0a2c00000000, 0x035d05b100000000, 0xc3f7c8d400000000, 0xb516c74900000000, 0x6e33a63500000000, 0x18d2a9a800000000, 0xee663dfe00000000, 0x9887326300000000, 0x43a2531f00000000, 0x35435c8200000000, 0xf5e991e700000000, 0x83089e7a00000000, 0x582dff0600000000, 0x2eccf09b00000000, 0xb444d6ab00000000, 0xc2a5d93600000000, 0x1980b84a00000000, 0x6f61b7d700000000, 0xafcb7ab200000000, 0xd92a752f00000000, 0x020f145300000000, 0x74ee1bce00000000, 0x825a8f9800000000, 0xf4bb800500000000, 0x2f9ee17900000000, 0x597feee400000000, 0x99d5238100000000, 0xef342c1c00000000, 0x34114d6000000000, 0x42f042fd00000000, 0xf1f7b94100000000, 0x8716b6dc00000000, 0x5c33d7a000000000, 0x2ad2d83d00000000, 0xea78155800000000, 0x9c991ac500000000, 0x47bc7bb900000000, 0x315d742400000000, 0xc7e9e07200000000, 0xb108efef00000000, 0x6a2d8e9300000000, 0x1ccc810e00000000, 0xdc664c6b00000000, 0xaa8743f600000000, 0x71a2228a00000000, 0x07432d1700000000, 0x9dcb0b2700000000, 0xeb2a04ba00000000, 0x300f65c600000000, 0x46ee6a5b00000000, 0x8644a73e00000000, 0xf0a5a8a300000000, 0x2b80c9df00000000, 0x5d61c64200000000, 0xabd5521400000000, 0xdd345d8900000000, 0x06113cf500000000, 0x70f0336800000000, 0xb05afe0d00000000, 0xc6bbf19000000000, 0x1d9e90ec00000000, 0x6b7f9f7100000000, 0x298fdd8c00000000, 0x5f6ed21100000000, 0x844bb36d00000000, 0xf2aabcf000000000, 0x3200719500000000, 0x44e17e0800000000, 0x9fc41f7400000000, 0xe92510e900000000, 0x1f9184bf00000000, 0x69708b2200000000, 0xb255ea5e00000000, 0xc4b4e5c300000000, 0x041e28a600000000, 0x72ff273b00000000, 0xa9da464700000000, 0xdf3b49da00000000, 0x45b36fea00000000, 0x3352607700000000, 0xe877010b00000000, 0x9e960e9600000000, 0x5e3cc3f300000000, 0x28ddcc6e00000000, 0xf3f8ad1200000000, 0x8519a28f00000000, 0x73ad36d900000000, 0x054c394400000000, 0xde69583800000000, 0xa88857a500000000, 0x68229ac000000000, 0x1ec3955d00000000, 0xc5e6f42100000000, 0xb307fbbc00000000, 0xe2ef738300000000, 0x940e7c1e00000000, 0x4f2b1d6200000000, 0x39ca12ff00000000, 0xf960df9a00000000, 0x8f81d00700000000, 0x54a4b17b00000000, 0x2245bee600000000, 0xd4f12ab000000000, 0xa210252d00000000, 0x7935445100000000, 0x0fd44bcc00000000, 0xcf7e86a900000000, 0xb99f893400000000, 0x62bae84800000000, 0x145be7d500000000, 0x8ed3c1e500000000, 0xf832ce7800000000, 0x2317af0400000000, 0x55f6a09900000000, 0x955c6dfc00000000, 0xe3bd626100000000, 0x3898031d00000000, 0x4e790c8000000000, 0xb8cd98d600000000, 0xce2c974b00000000, 0x1509f63700000000, 0x63e8f9aa00000000, 0xa34234cf00000000, 0xd5a33b5200000000, 0x0e865a2e00000000, 0x786755b300000000, 0x3a97174e00000000, 0x4c7618d300000000, 0x975379af00000000, 0xe1b2763200000000, 0x2118bb5700000000, 0x57f9b4ca00000000, 0x8cdcd5b600000000, 0xfa3dda2b00000000, 0x0c894e7d00000000, 0x7a6841e000000000, 0xa14d209c00000000, 0xd7ac2f0100000000, 0x1706e26400000000, 0x61e7edf900000000, 0xbac28c8500000000, 0xcc23831800000000, 0x56aba52800000000, 0x204aaab500000000, 0xfb6fcbc900000000, 0x8d8ec45400000000, 0x4d24093100000000, 0x3bc506ac00000000, 0xe0e067d000000000, 0x9601684d00000000, 0x60b5fc1b00000000, 0x1654f38600000000, 0xcd7192fa00000000, 0xbb909d6700000000, 0x7b3a500200000000, 0x0ddb5f9f00000000, 0xd6fe3ee300000000, 0xa01f317e00000000, 0x1318cac200000000, 0x65f9c55f00000000, 0xbedca42300000000, 0xc83dabbe00000000, 0x089766db00000000, 0x7e76694600000000, 0xa553083a00000000, 0xd3b207a700000000, 0x250693f100000000, 0x53e79c6c00000000, 0x88c2fd1000000000, 0xfe23f28d00000000, 0x3e893fe800000000, 0x4868307500000000, 0x934d510900000000, 0xe5ac5e9400000000, 0x7f2478a400000000, 0x09c5773900000000, 0xd2e0164500000000, 0xa40119d800000000, 0x64abd4bd00000000, 0x124adb2000000000, 0xc96fba5c00000000, 0xbf8eb5c100000000, 0x493a219700000000, 0x3fdb2e0a00000000, 0xe4fe4f7600000000, 0x921f40eb00000000, 0x52b58d8e00000000, 0x2454821300000000, 0xff71e36f00000000, 0x8990ecf200000000, 0xcb60ae0f00000000, 0xbd81a19200000000, 0x66a4c0ee00000000, 0x1045cf7300000000, 0xd0ef021600000000, 0xa60e0d8b00000000, 0x7d2b6cf700000000, 0x0bca636a00000000, 0xfd7ef73c00000000, 0x8b9ff8a100000000, 0x50ba99dd00000000, 0x265b964000000000, 0xe6f15b2500000000, 0x901054b800000000, 0x4b3535c400000000, 0x3dd43a5900000000, 0xa75c1c6900000000, 0xd1bd13f400000000, 0x0a98728800000000, 0x7c797d1500000000, 0xbcd3b07000000000, 0xca32bfed00000000, 0x1117de9100000000, 0x67f6d10c00000000, 0x9142455a00000000, 0xe7a34ac700000000, 0x3c862bbb00000000, 0x4a67242600000000, 0x8acde94300000000, 0xfc2ce6de00000000, 0x270987a200000000, 0x51e8883f00000000}, {0x0000000000000000, 0xe8dbfbb900000000, 0x91b186a800000000, 0x796a7d1100000000, 0x63657c8a00000000, 0x8bbe873300000000, 0xf2d4fa2200000000, 0x1a0f019b00000000, 0x87cc89cf00000000, 0x6f17727600000000, 0x167d0f6700000000, 0xfea6f4de00000000, 0xe4a9f54500000000, 0x0c720efc00000000, 0x751873ed00000000, 0x9dc3885400000000, 0x4f9f624400000000, 0xa74499fd00000000, 0xde2ee4ec00000000, 0x36f51f5500000000, 0x2cfa1ece00000000, 0xc421e57700000000, 0xbd4b986600000000, 0x559063df00000000, 0xc853eb8b00000000, 0x2088103200000000, 0x59e26d2300000000, 0xb139969a00000000, 0xab36970100000000, 0x43ed6cb800000000, 0x3a8711a900000000, 0xd25cea1000000000, 0x9e3ec58800000000, 0x76e53e3100000000, 0x0f8f432000000000, 0xe754b89900000000, 0xfd5bb90200000000, 0x158042bb00000000, 0x6cea3faa00000000, 0x8431c41300000000, 0x19f24c4700000000, 0xf129b7fe00000000, 0x8843caef00000000, 0x6098315600000000, 0x7a9730cd00000000, 0x924ccb7400000000, 0xeb26b66500000000, 0x03fd4ddc00000000, 0xd1a1a7cc00000000, 0x397a5c7500000000, 0x4010216400000000, 0xa8cbdadd00000000, 0xb2c4db4600000000, 0x5a1f20ff00000000, 0x23755dee00000000, 0xcbaea65700000000, 0x566d2e0300000000, 0xbeb6d5ba00000000, 0xc7dca8ab00000000, 0x2f07531200000000, 0x3508528900000000, 0xddd3a93000000000, 0xa4b9d42100000000, 0x4c622f9800000000, 0x7d7bfbca00000000, 0x95a0007300000000, 0xecca7d6200000000, 0x041186db00000000, 0x1e1e874000000000, 0xf6c57cf900000000, 0x8faf01e800000000, 0x6774fa5100000000, 0xfab7720500000000, 0x126c89bc00000000, 0x6b06f4ad00000000, 0x83dd0f1400000000, 0x99d20e8f00000000, 0x7109f53600000000, 0x0863882700000000, 0xe0b8739e00000000, 0x32e4998e00000000, 0xda3f623700000000, 0xa3551f2600000000, 0x4b8ee49f00000000, 0x5181e50400000000, 0xb95a1ebd00000000, 0xc03063ac00000000, 0x28eb981500000000, 0xb528104100000000, 0x5df3ebf800000000, 0x249996e900000000, 0xcc426d5000000000, 0xd64d6ccb00000000, 0x3e96977200000000, 0x47fcea6300000000, 0xaf2711da00000000, 0xe3453e4200000000, 0x0b9ec5fb00000000, 0x72f4b8ea00000000, 0x9a2f435300000000, 0x802042c800000000, 0x68fbb97100000000, 0x1191c46000000000, 0xf94a3fd900000000, 0x6489b78d00000000, 0x8c524c3400000000, 0xf538312500000000, 0x1de3ca9c00000000, 0x07eccb0700000000, 0xef3730be00000000, 0x965d4daf00000000, 0x7e86b61600000000, 0xacda5c0600000000, 0x4401a7bf00000000, 0x3d6bdaae00000000, 0xd5b0211700000000, 0xcfbf208c00000000, 0x2764db3500000000, 0x5e0ea62400000000, 0xb6d55d9d00000000, 0x2b16d5c900000000, 0xc3cd2e7000000000, 0xbaa7536100000000, 0x527ca8d800000000, 0x4873a94300000000, 0xa0a852fa00000000, 0xd9c22feb00000000, 0x3119d45200000000, 0xbbf0874e00000000, 0x532b7cf700000000, 0x2a4101e600000000, 0xc29afa5f00000000, 0xd895fbc400000000, 0x304e007d00000000, 0x49247d6c00000000, 0xa1ff86d500000000, 0x3c3c0e8100000000, 0xd4e7f53800000000, 0xad8d882900000000, 0x4556739000000000, 0x5f59720b00000000, 0xb78289b200000000, 0xcee8f4a300000000, 0x26330f1a00000000, 0xf46fe50a00000000, 0x1cb41eb300000000, 0x65de63a200000000, 0x8d05981b00000000, 0x970a998000000000, 0x7fd1623900000000, 0x06bb1f2800000000, 0xee60e49100000000, 0x73a36cc500000000, 0x9b78977c00000000, 0xe212ea6d00000000, 0x0ac911d400000000, 0x10c6104f00000000, 0xf81debf600000000, 0x817796e700000000, 0x69ac6d5e00000000, 0x25ce42c600000000, 0xcd15b97f00000000, 0xb47fc46e00000000, 0x5ca43fd700000000, 0x46ab3e4c00000000, 0xae70c5f500000000, 0xd71ab8e400000000, 0x3fc1435d00000000, 0xa202cb0900000000, 0x4ad930b000000000, 0x33b34da100000000, 0xdb68b61800000000, 0xc167b78300000000, 0x29bc4c3a00000000, 0x50d6312b00000000, 0xb80dca9200000000, 0x6a51208200000000, 0x828adb3b00000000, 0xfbe0a62a00000000, 0x133b5d9300000000, 0x09345c0800000000, 0xe1efa7b100000000, 0x9885daa000000000, 0x705e211900000000, 0xed9da94d00000000, 0x054652f400000000, 0x7c2c2fe500000000, 0x94f7d45c00000000, 0x8ef8d5c700000000, 0x66232e7e00000000, 0x1f49536f00000000, 0xf792a8d600000000, 0xc68b7c8400000000, 0x2e50873d00000000, 0x573afa2c00000000, 0xbfe1019500000000, 0xa5ee000e00000000, 0x4d35fbb700000000, 0x345f86a600000000, 0xdc847d1f00000000, 0x4147f54b00000000, 0xa99c0ef200000000, 0xd0f673e300000000, 0x382d885a00000000, 0x222289c100000000, 0xcaf9727800000000, 0xb3930f6900000000, 0x5b48f4d000000000, 0x89141ec000000000, 0x61cfe57900000000, 0x18a5986800000000, 0xf07e63d100000000, 0xea71624a00000000, 0x02aa99f300000000, 0x7bc0e4e200000000, 0x931b1f5b00000000, 0x0ed8970f00000000, 0xe6036cb600000000, 0x9f6911a700000000, 0x77b2ea1e00000000, 0x6dbdeb8500000000, 0x8566103c00000000, 0xfc0c6d2d00000000, 0x14d7969400000000, 0x58b5b90c00000000, 0xb06e42b500000000, 0xc9043fa400000000, 0x21dfc41d00000000, 0x3bd0c58600000000, 0xd30b3e3f00000000, 0xaa61432e00000000, 0x42bab89700000000, 0xdf7930c300000000, 0x37a2cb7a00000000, 0x4ec8b66b00000000, 0xa6134dd200000000, 0xbc1c4c4900000000, 0x54c7b7f000000000, 0x2dadcae100000000, 0xc576315800000000, 0x172adb4800000000, 0xfff120f100000000, 0x869b5de000000000, 0x6e40a65900000000, 0x744fa7c200000000, 0x9c945c7b00000000, 0xe5fe216a00000000, 0x0d25dad300000000, 0x90e6528700000000, 0x783da93e00000000, 0x0157d42f00000000, 0xe98c2f9600000000, 0xf3832e0d00000000, 0x1b58d5b400000000, 0x6232a8a500000000, 0x8ae9531c00000000}, {0x0000000000000000, 0x919168ae00000000, 0x6325a08700000000, 0xf2b4c82900000000, 0x874c31d400000000, 0x16dd597a00000000, 0xe469915300000000, 0x75f8f9fd00000000, 0x4f9f137300000000, 0xde0e7bdd00000000, 0x2cbab3f400000000, 0xbd2bdb5a00000000, 0xc8d322a700000000, 0x59424a0900000000, 0xabf6822000000000, 0x3a67ea8e00000000, 0x9e3e27e600000000, 0x0faf4f4800000000, 0xfd1b876100000000, 0x6c8aefcf00000000, 0x1972163200000000, 0x88e37e9c00000000, 0x7a57b6b500000000, 0xebc6de1b00000000, 0xd1a1349500000000, 0x40305c3b00000000, 0xb284941200000000, 0x2315fcbc00000000, 0x56ed054100000000, 0xc77c6def00000000, 0x35c8a5c600000000, 0xa459cd6800000000, 0x7d7b3f1700000000, 0xecea57b900000000, 0x1e5e9f9000000000, 0x8fcff73e00000000, 0xfa370ec300000000, 0x6ba6666d00000000, 0x9912ae4400000000, 0x0883c6ea00000000, 0x32e42c6400000000, 0xa37544ca00000000, 0x51c18ce300000000, 0xc050e44d00000000, 0xb5a81db000000000, 0x2439751e00000000, 0xd68dbd3700000000, 0x471cd59900000000, 0xe34518f100000000, 0x72d4705f00000000, 0x8060b87600000000, 0x11f1d0d800000000, 0x6409292500000000, 0xf598418b00000000, 0x072c89a200000000, 0x96bde10c00000000, 0xacda0b8200000000, 0x3d4b632c00000000, 0xcfffab0500000000, 0x5e6ec3ab00000000, 0x2b963a5600000000, 0xba0752f800000000, 0x48b39ad100000000, 0xd922f27f00000000, 0xfaf67e2e00000000, 0x6b67168000000000, 0x99d3dea900000000, 0x0842b60700000000, 0x7dba4ffa00000000, 0xec2b275400000000, 0x1e9fef7d00000000, 0x8f0e87d300000000, 0xb5696d5d00000000, 0x24f805f300000000, 0xd64ccdda00000000, 0x47dda57400000000, 0x32255c8900000000, 0xa3b4342700000000, 0x5100fc0e00000000, 0xc09194a000000000, 0x64c859c800000000, 0xf559316600000000, 0x07edf94f00000000, 0x967c91e100000000, 0xe384681c00000000, 0x721500b200000000, 0x80a1c89b00000000, 0x1130a03500000000, 0x2b574abb00000000, 0xbac6221500000000, 0x4872ea3c00000000, 0xd9e3829200000000, 0xac1b7b6f00000000, 0x3d8a13c100000000, 0xcf3edbe800000000, 0x5eafb34600000000, 0x878d413900000000, 0x161c299700000000, 0xe4a8e1be00000000, 0x7539891000000000, 0x00c170ed00000000, 0x9150184300000000, 0x63e4d06a00000000, 0xf275b8c400000000, 0xc812524a00000000, 0x59833ae400000000, 0xab37f2cd00000000, 0x3aa69a6300000000, 0x4f5e639e00000000, 0xdecf0b3000000000, 0x2c7bc31900000000, 0xbdeaabb700000000, 0x19b366df00000000, 0x88220e7100000000, 0x7a96c65800000000, 0xeb07aef600000000, 0x9eff570b00000000, 0x0f6e3fa500000000, 0xfddaf78c00000000, 0x6c4b9f2200000000, 0x562c75ac00000000, 0xc7bd1d0200000000, 0x3509d52b00000000, 0xa498bd8500000000, 0xd160447800000000, 0x40f12cd600000000, 0xb245e4ff00000000, 0x23d48c5100000000, 0xf4edfd5c00000000, 0x657c95f200000000, 0x97c85ddb00000000, 0x0659357500000000, 0x73a1cc8800000000, 0xe230a42600000000, 0x10846c0f00000000, 0x811504a100000000, 0xbb72ee2f00000000, 0x2ae3868100000000, 0xd8574ea800000000, 0x49c6260600000000, 0x3c3edffb00000000, 0xadafb75500000000, 0x5f1b7f7c00000000, 0xce8a17d200000000, 0x6ad3daba00000000, 0xfb42b21400000000, 0x09f67a3d00000000, 0x9867129300000000, 0xed9feb6e00000000, 0x7c0e83c000000000, 0x8eba4be900000000, 0x1f2b234700000000, 0x254cc9c900000000, 0xb4dda16700000000, 0x4669694e00000000, 0xd7f801e000000000, 0xa200f81d00000000, 0x339190b300000000, 0xc125589a00000000, 0x50b4303400000000, 0x8996c24b00000000, 0x1807aae500000000, 0xeab362cc00000000, 0x7b220a6200000000, 0x0edaf39f00000000, 0x9f4b9b3100000000, 0x6dff531800000000, 0xfc6e3bb600000000, 0xc609d13800000000, 0x5798b99600000000, 0xa52c71bf00000000, 0x34bd191100000000, 0x4145e0ec00000000, 0xd0d4884200000000, 0x2260406b00000000, 0xb3f128c500000000, 0x17a8e5ad00000000, 0x86398d0300000000, 0x748d452a00000000, 0xe51c2d8400000000, 0x90e4d47900000000, 0x0175bcd700000000, 0xf3c174fe00000000, 0x62501c5000000000, 0x5837f6de00000000, 0xc9a69e7000000000, 0x3b12565900000000, 0xaa833ef700000000, 0xdf7bc70a00000000, 0x4eeaafa400000000, 0xbc5e678d00000000, 0x2dcf0f2300000000, 0x0e1b837200000000, 0x9f8aebdc00000000, 0x6d3e23f500000000, 0xfcaf4b5b00000000, 0x8957b2a600000000, 0x18c6da0800000000, 0xea72122100000000, 0x7be37a8f00000000, 0x4184900100000000, 0xd015f8af00000000, 0x22a1308600000000, 0xb330582800000000, 0xc6c8a1d500000000, 0x5759c97b00000000, 0xa5ed015200000000, 0x347c69fc00000000, 0x9025a49400000000, 0x01b4cc3a00000000, 0xf300041300000000, 0x62916cbd00000000, 0x1769954000000000, 0x86f8fdee00000000, 0x744c35c700000000, 0xe5dd5d6900000000, 0xdfbab7e700000000, 0x4e2bdf4900000000, 0xbc9f176000000000, 0x2d0e7fce00000000, 0x58f6863300000000, 0xc967ee9d00000000, 0x3bd326b400000000, 0xaa424e1a00000000, 0x7360bc6500000000, 0xe2f1d4cb00000000, 0x10451ce200000000, 0x81d4744c00000000, 0xf42c8db100000000, 0x65bde51f00000000, 0x97092d3600000000, 0x0698459800000000, 0x3cffaf1600000000, 0xad6ec7b800000000, 0x5fda0f9100000000, 0xce4b673f00000000, 0xbbb39ec200000000, 0x2a22f66c00000000, 0xd8963e4500000000, 0x490756eb00000000, 0xed5e9b8300000000, 0x7ccff32d00000000, 0x8e7b3b0400000000, 0x1fea53aa00000000, 0x6a12aa5700000000, 0xfb83c2f900000000, 0x09370ad000000000, 0x98a6627e00000000, 0xa2c188f000000000, 0x3350e05e00000000, 0xc1e4287700000000, 0x507540d900000000, 0x258db92400000000, 0xb41cd18a00000000, 0x46a819a300000000, 0xd739710d00000000}}; #else /* W == 4 */ local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0xccaa009e, 0x4225077d, 0x8e8f07e3, 0x844a0efa, 0x48e00e64, 0xc66f0987, 0x0ac50919, 0xd3e51bb5, 0x1f4f1b2b, 0x91c01cc8, 0x5d6a1c56, 0x57af154f, 0x9b0515d1, 0x158a1232, 0xd92012ac, 0x7cbb312b, 0xb01131b5, 0x3e9e3656, 0xf23436c8, 0xf8f13fd1, 0x345b3f4f, 0xbad438ac, 0x767e3832, 0xaf5e2a9e, 0x63f42a00, 0xed7b2de3, 0x21d12d7d, 0x2b142464, 0xe7be24fa, 0x69312319, 0xa59b2387, 0xf9766256, 0x35dc62c8, 0xbb53652b, 0x77f965b5, 0x7d3c6cac, 0xb1966c32, 0x3f196bd1, 0xf3b36b4f, 0x2a9379e3, 0xe639797d, 0x68b67e9e, 0xa41c7e00, 0xaed97719, 0x62737787, 0xecfc7064, 0x205670fa, 0x85cd537d, 0x496753e3, 0xc7e85400, 0x0b42549e, 0x01875d87, 0xcd2d5d19, 0x43a25afa, 0x8f085a64, 0x562848c8, 0x9a824856, 0x140d4fb5, 0xd8a74f2b, 0xd2624632, 0x1ec846ac, 0x9047414f, 0x5ced41d1, 0x299dc2ed, 0xe537c273, 0x6bb8c590, 0xa712c50e, 0xadd7cc17, 0x617dcc89, 0xeff2cb6a, 0x2358cbf4, 0xfa78d958, 0x36d2d9c6, 0xb85dde25, 0x74f7debb, 0x7e32d7a2, 0xb298d73c, 0x3c17d0df, 0xf0bdd041, 0x5526f3c6, 0x998cf358, 0x1703f4bb, 0xdba9f425, 0xd16cfd3c, 0x1dc6fda2, 0x9349fa41, 0x5fe3fadf, 0x86c3e873, 0x4a69e8ed, 0xc4e6ef0e, 0x084cef90, 0x0289e689, 0xce23e617, 0x40ace1f4, 0x8c06e16a, 0xd0eba0bb, 0x1c41a025, 0x92cea7c6, 0x5e64a758, 0x54a1ae41, 0x980baedf, 0x1684a93c, 0xda2ea9a2, 0x030ebb0e, 0xcfa4bb90, 0x412bbc73, 0x8d81bced, 0x8744b5f4, 0x4beeb56a, 0xc561b289, 0x09cbb217, 0xac509190, 0x60fa910e, 0xee7596ed, 0x22df9673, 0x281a9f6a, 0xe4b09ff4, 0x6a3f9817, 0xa6959889, 0x7fb58a25, 0xb31f8abb, 0x3d908d58, 0xf13a8dc6, 0xfbff84df, 0x37558441, 0xb9da83a2, 0x7570833c, 0x533b85da, 0x9f918544, 0x111e82a7, 0xddb48239, 0xd7718b20, 0x1bdb8bbe, 0x95548c5d, 0x59fe8cc3, 0x80de9e6f, 0x4c749ef1, 0xc2fb9912, 0x0e51998c, 0x04949095, 0xc83e900b, 0x46b197e8, 0x8a1b9776, 0x2f80b4f1, 0xe32ab46f, 0x6da5b38c, 0xa10fb312, 0xabcaba0b, 0x6760ba95, 0xe9efbd76, 0x2545bde8, 0xfc65af44, 0x30cfafda, 0xbe40a839, 0x72eaa8a7, 0x782fa1be, 0xb485a120, 0x3a0aa6c3, 0xf6a0a65d, 0xaa4de78c, 0x66e7e712, 0xe868e0f1, 0x24c2e06f, 0x2e07e976, 0xe2ade9e8, 0x6c22ee0b, 0xa088ee95, 0x79a8fc39, 0xb502fca7, 0x3b8dfb44, 0xf727fbda, 0xfde2f2c3, 0x3148f25d, 0xbfc7f5be, 0x736df520, 0xd6f6d6a7, 0x1a5cd639, 0x94d3d1da, 0x5879d144, 0x52bcd85d, 0x9e16d8c3, 0x1099df20, 0xdc33dfbe, 0x0513cd12, 0xc9b9cd8c, 0x4736ca6f, 0x8b9ccaf1, 0x8159c3e8, 0x4df3c376, 0xc37cc495, 0x0fd6c40b, 0x7aa64737, 0xb60c47a9, 0x3883404a, 0xf42940d4, 0xfeec49cd, 0x32464953, 0xbcc94eb0, 0x70634e2e, 0xa9435c82, 0x65e95c1c, 0xeb665bff, 0x27cc5b61, 0x2d095278, 0xe1a352e6, 0x6f2c5505, 0xa386559b, 0x061d761c, 0xcab77682, 0x44387161, 0x889271ff, 0x825778e6, 0x4efd7878, 0xc0727f9b, 0x0cd87f05, 0xd5f86da9, 0x19526d37, 0x97dd6ad4, 0x5b776a4a, 0x51b26353, 0x9d1863cd, 0x1397642e, 0xdf3d64b0, 0x83d02561, 0x4f7a25ff, 0xc1f5221c, 0x0d5f2282, 0x079a2b9b, 0xcb302b05, 0x45bf2ce6, 0x89152c78, 0x50353ed4, 0x9c9f3e4a, 0x121039a9, 0xdeba3937, 0xd47f302e, 0x18d530b0, 0x965a3753, 0x5af037cd, 0xff6b144a, 0x33c114d4, 0xbd4e1337, 0x71e413a9, 0x7b211ab0, 0xb78b1a2e, 0x39041dcd, 0xf5ae1d53, 0x2c8e0fff, 0xe0240f61, 0x6eab0882, 0xa201081c, 0xa8c40105, 0x646e019b, 0xeae10678, 0x264b06e6}, {0x00000000, 0xa6770bb4, 0x979f1129, 0x31e81a9d, 0xf44f2413, 0x52382fa7, 0x63d0353a, 0xc5a73e8e, 0x33ef4e67, 0x959845d3, 0xa4705f4e, 0x020754fa, 0xc7a06a74, 0x61d761c0, 0x503f7b5d, 0xf64870e9, 0x67de9cce, 0xc1a9977a, 0xf0418de7, 0x56368653, 0x9391b8dd, 0x35e6b369, 0x040ea9f4, 0xa279a240, 0x5431d2a9, 0xf246d91d, 0xc3aec380, 0x65d9c834, 0xa07ef6ba, 0x0609fd0e, 0x37e1e793, 0x9196ec27, 0xcfbd399c, 0x69ca3228, 0x582228b5, 0xfe552301, 0x3bf21d8f, 0x9d85163b, 0xac6d0ca6, 0x0a1a0712, 0xfc5277fb, 0x5a257c4f, 0x6bcd66d2, 0xcdba6d66, 0x081d53e8, 0xae6a585c, 0x9f8242c1, 0x39f54975, 0xa863a552, 0x0e14aee6, 0x3ffcb47b, 0x998bbfcf, 0x5c2c8141, 0xfa5b8af5, 0xcbb39068, 0x6dc49bdc, 0x9b8ceb35, 0x3dfbe081, 0x0c13fa1c, 0xaa64f1a8, 0x6fc3cf26, 0xc9b4c492, 0xf85cde0f, 0x5e2bd5bb, 0x440b7579, 0xe27c7ecd, 0xd3946450, 0x75e36fe4, 0xb044516a, 0x16335ade, 0x27db4043, 0x81ac4bf7, 0x77e43b1e, 0xd19330aa, 0xe07b2a37, 0x460c2183, 0x83ab1f0d, 0x25dc14b9, 0x14340e24, 0xb2430590, 0x23d5e9b7, 0x85a2e203, 0xb44af89e, 0x123df32a, 0xd79acda4, 0x71edc610, 0x4005dc8d, 0xe672d739, 0x103aa7d0, 0xb64dac64, 0x87a5b6f9, 0x21d2bd4d, 0xe47583c3, 0x42028877, 0x73ea92ea, 0xd59d995e, 0x8bb64ce5, 0x2dc14751, 0x1c295dcc, 0xba5e5678, 0x7ff968f6, 0xd98e6342, 0xe86679df, 0x4e11726b, 0xb8590282, 0x1e2e0936, 0x2fc613ab, 0x89b1181f, 0x4c162691, 0xea612d25, 0xdb8937b8, 0x7dfe3c0c, 0xec68d02b, 0x4a1fdb9f, 0x7bf7c102, 0xdd80cab6, 0x1827f438, 0xbe50ff8c, 0x8fb8e511, 0x29cfeea5, 0xdf879e4c, 0x79f095f8, 0x48188f65, 0xee6f84d1, 0x2bc8ba5f, 0x8dbfb1eb, 0xbc57ab76, 0x1a20a0c2, 0x8816eaf2, 0x2e61e146, 0x1f89fbdb, 0xb9fef06f, 0x7c59cee1, 0xda2ec555, 0xebc6dfc8, 0x4db1d47c, 0xbbf9a495, 0x1d8eaf21, 0x2c66b5bc, 0x8a11be08, 0x4fb68086, 0xe9c18b32, 0xd82991af, 0x7e5e9a1b, 0xefc8763c, 0x49bf7d88, 0x78576715, 0xde206ca1, 0x1b87522f, 0xbdf0599b, 0x8c184306, 0x2a6f48b2, 0xdc27385b, 0x7a5033ef, 0x4bb82972, 0xedcf22c6, 0x28681c48, 0x8e1f17fc, 0xbff70d61, 0x198006d5, 0x47abd36e, 0xe1dcd8da, 0xd034c247, 0x7643c9f3, 0xb3e4f77d, 0x1593fcc9, 0x247be654, 0x820cede0, 0x74449d09, 0xd23396bd, 0xe3db8c20, 0x45ac8794, 0x800bb91a, 0x267cb2ae, 0x1794a833, 0xb1e3a387, 0x20754fa0, 0x86024414, 0xb7ea5e89, 0x119d553d, 0xd43a6bb3, 0x724d6007, 0x43a57a9a, 0xe5d2712e, 0x139a01c7, 0xb5ed0a73, 0x840510ee, 0x22721b5a, 0xe7d525d4, 0x41a22e60, 0x704a34fd, 0xd63d3f49, 0xcc1d9f8b, 0x6a6a943f, 0x5b828ea2, 0xfdf58516, 0x3852bb98, 0x9e25b02c, 0xafcdaab1, 0x09baa105, 0xfff2d1ec, 0x5985da58, 0x686dc0c5, 0xce1acb71, 0x0bbdf5ff, 0xadcafe4b, 0x9c22e4d6, 0x3a55ef62, 0xabc30345, 0x0db408f1, 0x3c5c126c, 0x9a2b19d8, 0x5f8c2756, 0xf9fb2ce2, 0xc813367f, 0x6e643dcb, 0x982c4d22, 0x3e5b4696, 0x0fb35c0b, 0xa9c457bf, 0x6c636931, 0xca146285, 0xfbfc7818, 0x5d8b73ac, 0x03a0a617, 0xa5d7ada3, 0x943fb73e, 0x3248bc8a, 0xf7ef8204, 0x519889b0, 0x6070932d, 0xc6079899, 0x304fe870, 0x9638e3c4, 0xa7d0f959, 0x01a7f2ed, 0xc400cc63, 0x6277c7d7, 0x539fdd4a, 0xf5e8d6fe, 0x647e3ad9, 0xc209316d, 0xf3e12bf0, 0x55962044, 0x90311eca, 0x3646157e, 0x07ae0fe3, 0xa1d90457, 0x579174be, 0xf1e67f0a, 0xc00e6597, 0x66796e23, 0xa3de50ad, 0x05a95b19, 0x34414184, 0x92364a30}, {0x00000000, 0xcb5cd3a5, 0x4dc8a10b, 0x869472ae, 0x9b914216, 0x50cd91b3, 0xd659e31d, 0x1d0530b8, 0xec53826d, 0x270f51c8, 0xa19b2366, 0x6ac7f0c3, 0x77c2c07b, 0xbc9e13de, 0x3a0a6170, 0xf156b2d5, 0x03d6029b, 0xc88ad13e, 0x4e1ea390, 0x85427035, 0x9847408d, 0x531b9328, 0xd58fe186, 0x1ed33223, 0xef8580f6, 0x24d95353, 0xa24d21fd, 0x6911f258, 0x7414c2e0, 0xbf481145, 0x39dc63eb, 0xf280b04e, 0x07ac0536, 0xccf0d693, 0x4a64a43d, 0x81387798, 0x9c3d4720, 0x57619485, 0xd1f5e62b, 0x1aa9358e, 0xebff875b, 0x20a354fe, 0xa6372650, 0x6d6bf5f5, 0x706ec54d, 0xbb3216e8, 0x3da66446, 0xf6fab7e3, 0x047a07ad, 0xcf26d408, 0x49b2a6a6, 0x82ee7503, 0x9feb45bb, 0x54b7961e, 0xd223e4b0, 0x197f3715, 0xe82985c0, 0x23755665, 0xa5e124cb, 0x6ebdf76e, 0x73b8c7d6, 0xb8e41473, 0x3e7066dd, 0xf52cb578, 0x0f580a6c, 0xc404d9c9, 0x4290ab67, 0x89cc78c2, 0x94c9487a, 0x5f959bdf, 0xd901e971, 0x125d3ad4, 0xe30b8801, 0x28575ba4, 0xaec3290a, 0x659ffaaf, 0x789aca17, 0xb3c619b2, 0x35526b1c, 0xfe0eb8b9, 0x0c8e08f7, 0xc7d2db52, 0x4146a9fc, 0x8a1a7a59, 0x971f4ae1, 0x5c439944, 0xdad7ebea, 0x118b384f, 0xe0dd8a9a, 0x2b81593f, 0xad152b91, 0x6649f834, 0x7b4cc88c, 0xb0101b29, 0x36846987, 0xfdd8ba22, 0x08f40f5a, 0xc3a8dcff, 0x453cae51, 0x8e607df4, 0x93654d4c, 0x58399ee9, 0xdeadec47, 0x15f13fe2, 0xe4a78d37, 0x2ffb5e92, 0xa96f2c3c, 0x6233ff99, 0x7f36cf21, 0xb46a1c84, 0x32fe6e2a, 0xf9a2bd8f, 0x0b220dc1, 0xc07ede64, 0x46eaacca, 0x8db67f6f, 0x90b34fd7, 0x5bef9c72, 0xdd7beedc, 0x16273d79, 0xe7718fac, 0x2c2d5c09, 0xaab92ea7, 0x61e5fd02, 0x7ce0cdba, 0xb7bc1e1f, 0x31286cb1, 0xfa74bf14, 0x1eb014d8, 0xd5ecc77d, 0x5378b5d3, 0x98246676, 0x852156ce, 0x4e7d856b, 0xc8e9f7c5, 0x03b52460, 0xf2e396b5, 0x39bf4510, 0xbf2b37be, 0x7477e41b, 0x6972d4a3, 0xa22e0706, 0x24ba75a8, 0xefe6a60d, 0x1d661643, 0xd63ac5e6, 0x50aeb748, 0x9bf264ed, 0x86f75455, 0x4dab87f0, 0xcb3ff55e, 0x006326fb, 0xf135942e, 0x3a69478b, 0xbcfd3525, 0x77a1e680, 0x6aa4d638, 0xa1f8059d, 0x276c7733, 0xec30a496, 0x191c11ee, 0xd240c24b, 0x54d4b0e5, 0x9f886340, 0x828d53f8, 0x49d1805d, 0xcf45f2f3, 0x04192156, 0xf54f9383, 0x3e134026, 0xb8873288, 0x73dbe12d, 0x6eded195, 0xa5820230, 0x2316709e, 0xe84aa33b, 0x1aca1375, 0xd196c0d0, 0x5702b27e, 0x9c5e61db, 0x815b5163, 0x4a0782c6, 0xcc93f068, 0x07cf23cd, 0xf6999118, 0x3dc542bd, 0xbb513013, 0x700de3b6, 0x6d08d30e, 0xa65400ab, 0x20c07205, 0xeb9ca1a0, 0x11e81eb4, 0xdab4cd11, 0x5c20bfbf, 0x977c6c1a, 0x8a795ca2, 0x41258f07, 0xc7b1fda9, 0x0ced2e0c, 0xfdbb9cd9, 0x36e74f7c, 0xb0733dd2, 0x7b2fee77, 0x662adecf, 0xad760d6a, 0x2be27fc4, 0xe0beac61, 0x123e1c2f, 0xd962cf8a, 0x5ff6bd24, 0x94aa6e81, 0x89af5e39, 0x42f38d9c, 0xc467ff32, 0x0f3b2c97, 0xfe6d9e42, 0x35314de7, 0xb3a53f49, 0x78f9ecec, 0x65fcdc54, 0xaea00ff1, 0x28347d5f, 0xe368aefa, 0x16441b82, 0xdd18c827, 0x5b8cba89, 0x90d0692c, 0x8dd55994, 0x46898a31, 0xc01df89f, 0x0b412b3a, 0xfa1799ef, 0x314b4a4a, 0xb7df38e4, 0x7c83eb41, 0x6186dbf9, 0xaada085c, 0x2c4e7af2, 0xe712a957, 0x15921919, 0xdececabc, 0x585ab812, 0x93066bb7, 0x8e035b0f, 0x455f88aa, 0xc3cbfa04, 0x089729a1, 0xf9c19b74, 0x329d48d1, 0xb4093a7f, 0x7f55e9da, 0x6250d962, 0xa90c0ac7, 0x2f987869, 0xe4c4abcc}, {0x00000000, 0x3d6029b0, 0x7ac05360, 0x47a07ad0, 0xf580a6c0, 0xc8e08f70, 0x8f40f5a0, 0xb220dc10, 0x30704bc1, 0x0d106271, 0x4ab018a1, 0x77d03111, 0xc5f0ed01, 0xf890c4b1, 0xbf30be61, 0x825097d1, 0x60e09782, 0x5d80be32, 0x1a20c4e2, 0x2740ed52, 0x95603142, 0xa80018f2, 0xefa06222, 0xd2c04b92, 0x5090dc43, 0x6df0f5f3, 0x2a508f23, 0x1730a693, 0xa5107a83, 0x98705333, 0xdfd029e3, 0xe2b00053, 0xc1c12f04, 0xfca106b4, 0xbb017c64, 0x866155d4, 0x344189c4, 0x0921a074, 0x4e81daa4, 0x73e1f314, 0xf1b164c5, 0xccd14d75, 0x8b7137a5, 0xb6111e15, 0x0431c205, 0x3951ebb5, 0x7ef19165, 0x4391b8d5, 0xa121b886, 0x9c419136, 0xdbe1ebe6, 0xe681c256, 0x54a11e46, 0x69c137f6, 0x2e614d26, 0x13016496, 0x9151f347, 0xac31daf7, 0xeb91a027, 0xd6f18997, 0x64d15587, 0x59b17c37, 0x1e1106e7, 0x23712f57, 0x58f35849, 0x659371f9, 0x22330b29, 0x1f532299, 0xad73fe89, 0x9013d739, 0xd7b3ade9, 0xead38459, 0x68831388, 0x55e33a38, 0x124340e8, 0x2f236958, 0x9d03b548, 0xa0639cf8, 0xe7c3e628, 0xdaa3cf98, 0x3813cfcb, 0x0573e67b, 0x42d39cab, 0x7fb3b51b, 0xcd93690b, 0xf0f340bb, 0xb7533a6b, 0x8a3313db, 0x0863840a, 0x3503adba, 0x72a3d76a, 0x4fc3feda, 0xfde322ca, 0xc0830b7a, 0x872371aa, 0xba43581a, 0x9932774d, 0xa4525efd, 0xe3f2242d, 0xde920d9d, 0x6cb2d18d, 0x51d2f83d, 0x167282ed, 0x2b12ab5d, 0xa9423c8c, 0x9422153c, 0xd3826fec, 0xeee2465c, 0x5cc29a4c, 0x61a2b3fc, 0x2602c92c, 0x1b62e09c, 0xf9d2e0cf, 0xc4b2c97f, 0x8312b3af, 0xbe729a1f, 0x0c52460f, 0x31326fbf, 0x7692156f, 0x4bf23cdf, 0xc9a2ab0e, 0xf4c282be, 0xb362f86e, 0x8e02d1de, 0x3c220dce, 0x0142247e, 0x46e25eae, 0x7b82771e, 0xb1e6b092, 0x8c869922, 0xcb26e3f2, 0xf646ca42, 0x44661652, 0x79063fe2, 0x3ea64532, 0x03c66c82, 0x8196fb53, 0xbcf6d2e3, 0xfb56a833, 0xc6368183, 0x74165d93, 0x49767423, 0x0ed60ef3, 0x33b62743, 0xd1062710, 0xec660ea0, 0xabc67470, 0x96a65dc0, 0x248681d0, 0x19e6a860, 0x5e46d2b0, 0x6326fb00, 0xe1766cd1, 0xdc164561, 0x9bb63fb1, 0xa6d61601, 0x14f6ca11, 0x2996e3a1, 0x6e369971, 0x5356b0c1, 0x70279f96, 0x4d47b626, 0x0ae7ccf6, 0x3787e546, 0x85a73956, 0xb8c710e6, 0xff676a36, 0xc2074386, 0x4057d457, 0x7d37fde7, 0x3a978737, 0x07f7ae87, 0xb5d77297, 0x88b75b27, 0xcf1721f7, 0xf2770847, 0x10c70814, 0x2da721a4, 0x6a075b74, 0x576772c4, 0xe547aed4, 0xd8278764, 0x9f87fdb4, 0xa2e7d404, 0x20b743d5, 0x1dd76a65, 0x5a7710b5, 0x67173905, 0xd537e515, 0xe857cca5, 0xaff7b675, 0x92979fc5, 0xe915e8db, 0xd475c16b, 0x93d5bbbb, 0xaeb5920b, 0x1c954e1b, 0x21f567ab, 0x66551d7b, 0x5b3534cb, 0xd965a31a, 0xe4058aaa, 0xa3a5f07a, 0x9ec5d9ca, 0x2ce505da, 0x11852c6a, 0x562556ba, 0x6b457f0a, 0x89f57f59, 0xb49556e9, 0xf3352c39, 0xce550589, 0x7c75d999, 0x4115f029, 0x06b58af9, 0x3bd5a349, 0xb9853498, 0x84e51d28, 0xc34567f8, 0xfe254e48, 0x4c059258, 0x7165bbe8, 0x36c5c138, 0x0ba5e888, 0x28d4c7df, 0x15b4ee6f, 0x521494bf, 0x6f74bd0f, 0xdd54611f, 0xe03448af, 0xa794327f, 0x9af41bcf, 0x18a48c1e, 0x25c4a5ae, 0x6264df7e, 0x5f04f6ce, 0xed242ade, 0xd044036e, 0x97e479be, 0xaa84500e, 0x4834505d, 0x755479ed, 0x32f4033d, 0x0f942a8d, 0xbdb4f69d, 0x80d4df2d, 0xc774a5fd, 0xfa148c4d, 0x78441b9c, 0x4524322c, 0x028448fc, 0x3fe4614c, 0x8dc4bd5c, 0xb0a494ec, 0xf704ee3c, 0xca64c78c}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x00000000, 0xb029603d, 0x6053c07a, 0xd07aa047, 0xc0a680f5, 0x708fe0c8, 0xa0f5408f, 0x10dc20b2, 0xc14b7030, 0x7162100d, 0xa118b04a, 0x1131d077, 0x01edf0c5, 0xb1c490f8, 0x61be30bf, 0xd1975082, 0x8297e060, 0x32be805d, 0xe2c4201a, 0x52ed4027, 0x42316095, 0xf21800a8, 0x2262a0ef, 0x924bc0d2, 0x43dc9050, 0xf3f5f06d, 0x238f502a, 0x93a63017, 0x837a10a5, 0x33537098, 0xe329d0df, 0x5300b0e2, 0x042fc1c1, 0xb406a1fc, 0x647c01bb, 0xd4556186, 0xc4894134, 0x74a02109, 0xa4da814e, 0x14f3e173, 0xc564b1f1, 0x754dd1cc, 0xa537718b, 0x151e11b6, 0x05c23104, 0xb5eb5139, 0x6591f17e, 0xd5b89143, 0x86b821a1, 0x3691419c, 0xe6ebe1db, 0x56c281e6, 0x461ea154, 0xf637c169, 0x264d612e, 0x96640113, 0x47f35191, 0xf7da31ac, 0x27a091eb, 0x9789f1d6, 0x8755d164, 0x377cb159, 0xe706111e, 0x572f7123, 0x4958f358, 0xf9719365, 0x290b3322, 0x9922531f, 0x89fe73ad, 0x39d71390, 0xe9adb3d7, 0x5984d3ea, 0x88138368, 0x383ae355, 0xe8404312, 0x5869232f, 0x48b5039d, 0xf89c63a0, 0x28e6c3e7, 0x98cfa3da, 0xcbcf1338, 0x7be67305, 0xab9cd342, 0x1bb5b37f, 0x0b6993cd, 0xbb40f3f0, 0x6b3a53b7, 0xdb13338a, 0x0a846308, 0xbaad0335, 0x6ad7a372, 0xdafec34f, 0xca22e3fd, 0x7a0b83c0, 0xaa712387, 0x1a5843ba, 0x4d773299, 0xfd5e52a4, 0x2d24f2e3, 0x9d0d92de, 0x8dd1b26c, 0x3df8d251, 0xed827216, 0x5dab122b, 0x8c3c42a9, 0x3c152294, 0xec6f82d3, 0x5c46e2ee, 0x4c9ac25c, 0xfcb3a261, 0x2cc90226, 0x9ce0621b, 0xcfe0d2f9, 0x7fc9b2c4, 0xafb31283, 0x1f9a72be, 0x0f46520c, 0xbf6f3231, 0x6f159276, 0xdf3cf24b, 0x0eaba2c9, 0xbe82c2f4, 0x6ef862b3, 0xded1028e, 0xce0d223c, 0x7e244201, 0xae5ee246, 0x1e77827b, 0x92b0e6b1, 0x2299868c, 0xf2e326cb, 0x42ca46f6, 0x52166644, 0xe23f0679, 0x3245a63e, 0x826cc603, 0x53fb9681, 0xe3d2f6bc, 0x33a856fb, 0x838136c6, 0x935d1674, 0x23747649, 0xf30ed60e, 0x4327b633, 0x102706d1, 0xa00e66ec, 0x7074c6ab, 0xc05da696, 0xd0818624, 0x60a8e619, 0xb0d2465e, 0x00fb2663, 0xd16c76e1, 0x614516dc, 0xb13fb69b, 0x0116d6a6, 0x11caf614, 0xa1e39629, 0x7199366e, 0xc1b05653, 0x969f2770, 0x26b6474d, 0xf6cce70a, 0x46e58737, 0x5639a785, 0xe610c7b8, 0x366a67ff, 0x864307c2, 0x57d45740, 0xe7fd377d, 0x3787973a, 0x87aef707, 0x9772d7b5, 0x275bb788, 0xf72117cf, 0x470877f2, 0x1408c710, 0xa421a72d, 0x745b076a, 0xc4726757, 0xd4ae47e5, 0x648727d8, 0xb4fd879f, 0x04d4e7a2, 0xd543b720, 0x656ad71d, 0xb510775a, 0x05391767, 0x15e537d5, 0xa5cc57e8, 0x75b6f7af, 0xc59f9792, 0xdbe815e9, 0x6bc175d4, 0xbbbbd593, 0x0b92b5ae, 0x1b4e951c, 0xab67f521, 0x7b1d5566, 0xcb34355b, 0x1aa365d9, 0xaa8a05e4, 0x7af0a5a3, 0xcad9c59e, 0xda05e52c, 0x6a2c8511, 0xba562556, 0x0a7f456b, 0x597ff589, 0xe95695b4, 0x392c35f3, 0x890555ce, 0x99d9757c, 0x29f01541, 0xf98ab506, 0x49a3d53b, 0x983485b9, 0x281de584, 0xf86745c3, 0x484e25fe, 0x5892054c, 0xe8bb6571, 0x38c1c536, 0x88e8a50b, 0xdfc7d428, 0x6feeb415, 0xbf941452, 0x0fbd746f, 0x1f6154dd, 0xaf4834e0, 0x7f3294a7, 0xcf1bf49a, 0x1e8ca418, 0xaea5c425, 0x7edf6462, 0xcef6045f, 0xde2a24ed, 0x6e0344d0, 0xbe79e497, 0x0e5084aa, 0x5d503448, 0xed795475, 0x3d03f432, 0x8d2a940f, 0x9df6b4bd, 0x2ddfd480, 0xfda574c7, 0x4d8c14fa, 0x9c1b4478, 0x2c322445, 0xfc488402, 0x4c61e43f, 0x5cbdc48d, 0xec94a4b0, 0x3cee04f7, 0x8cc764ca}, {0x00000000, 0xa5d35ccb, 0x0ba1c84d, 0xae729486, 0x1642919b, 0xb391cd50, 0x1de359d6, 0xb830051d, 0x6d8253ec, 0xc8510f27, 0x66239ba1, 0xc3f0c76a, 0x7bc0c277, 0xde139ebc, 0x70610a3a, 0xd5b256f1, 0x9b02d603, 0x3ed18ac8, 0x90a31e4e, 0x35704285, 0x8d404798, 0x28931b53, 0x86e18fd5, 0x2332d31e, 0xf68085ef, 0x5353d924, 0xfd214da2, 0x58f21169, 0xe0c21474, 0x451148bf, 0xeb63dc39, 0x4eb080f2, 0x3605ac07, 0x93d6f0cc, 0x3da4644a, 0x98773881, 0x20473d9c, 0x85946157, 0x2be6f5d1, 0x8e35a91a, 0x5b87ffeb, 0xfe54a320, 0x502637a6, 0xf5f56b6d, 0x4dc56e70, 0xe81632bb, 0x4664a63d, 0xe3b7faf6, 0xad077a04, 0x08d426cf, 0xa6a6b249, 0x0375ee82, 0xbb45eb9f, 0x1e96b754, 0xb0e423d2, 0x15377f19, 0xc08529e8, 0x65567523, 0xcb24e1a5, 0x6ef7bd6e, 0xd6c7b873, 0x7314e4b8, 0xdd66703e, 0x78b52cf5, 0x6c0a580f, 0xc9d904c4, 0x67ab9042, 0xc278cc89, 0x7a48c994, 0xdf9b955f, 0x71e901d9, 0xd43a5d12, 0x01880be3, 0xa45b5728, 0x0a29c3ae, 0xaffa9f65, 0x17ca9a78, 0xb219c6b3, 0x1c6b5235, 0xb9b80efe, 0xf7088e0c, 0x52dbd2c7, 0xfca94641, 0x597a1a8a, 0xe14a1f97, 0x4499435c, 0xeaebd7da, 0x4f388b11, 0x9a8adde0, 0x3f59812b, 0x912b15ad, 0x34f84966, 0x8cc84c7b, 0x291b10b0, 0x87698436, 0x22bad8fd, 0x5a0ff408, 0xffdca8c3, 0x51ae3c45, 0xf47d608e, 0x4c4d6593, 0xe99e3958, 0x47ecadde, 0xe23ff115, 0x378da7e4, 0x925efb2f, 0x3c2c6fa9, 0x99ff3362, 0x21cf367f, 0x841c6ab4, 0x2a6efe32, 0x8fbda2f9, 0xc10d220b, 0x64de7ec0, 0xcaacea46, 0x6f7fb68d, 0xd74fb390, 0x729cef5b, 0xdcee7bdd, 0x793d2716, 0xac8f71e7, 0x095c2d2c, 0xa72eb9aa, 0x02fde561, 0xbacde07c, 0x1f1ebcb7, 0xb16c2831, 0x14bf74fa, 0xd814b01e, 0x7dc7ecd5, 0xd3b57853, 0x76662498, 0xce562185, 0x6b857d4e, 0xc5f7e9c8, 0x6024b503, 0xb596e3f2, 0x1045bf39, 0xbe372bbf, 0x1be47774, 0xa3d47269, 0x06072ea2, 0xa875ba24, 0x0da6e6ef, 0x4316661d, 0xe6c53ad6, 0x48b7ae50, 0xed64f29b, 0x5554f786, 0xf087ab4d, 0x5ef53fcb, 0xfb266300, 0x2e9435f1, 0x8b47693a, 0x2535fdbc, 0x80e6a177, 0x38d6a46a, 0x9d05f8a1, 0x33776c27, 0x96a430ec, 0xee111c19, 0x4bc240d2, 0xe5b0d454, 0x4063889f, 0xf8538d82, 0x5d80d149, 0xf3f245cf, 0x56211904, 0x83934ff5, 0x2640133e, 0x883287b8, 0x2de1db73, 0x95d1de6e, 0x300282a5, 0x9e701623, 0x3ba34ae8, 0x7513ca1a, 0xd0c096d1, 0x7eb20257, 0xdb615e9c, 0x63515b81, 0xc682074a, 0x68f093cc, 0xcd23cf07, 0x189199f6, 0xbd42c53d, 0x133051bb, 0xb6e30d70, 0x0ed3086d, 0xab0054a6, 0x0572c020, 0xa0a19ceb, 0xb41ee811, 0x11cdb4da, 0xbfbf205c, 0x1a6c7c97, 0xa25c798a, 0x078f2541, 0xa9fdb1c7, 0x0c2eed0c, 0xd99cbbfd, 0x7c4fe736, 0xd23d73b0, 0x77ee2f7b, 0xcfde2a66, 0x6a0d76ad, 0xc47fe22b, 0x61acbee0, 0x2f1c3e12, 0x8acf62d9, 0x24bdf65f, 0x816eaa94, 0x395eaf89, 0x9c8df342, 0x32ff67c4, 0x972c3b0f, 0x429e6dfe, 0xe74d3135, 0x493fa5b3, 0xececf978, 0x54dcfc65, 0xf10fa0ae, 0x5f7d3428, 0xfaae68e3, 0x821b4416, 0x27c818dd, 0x89ba8c5b, 0x2c69d090, 0x9459d58d, 0x318a8946, 0x9ff81dc0, 0x3a2b410b, 0xef9917fa, 0x4a4a4b31, 0xe438dfb7, 0x41eb837c, 0xf9db8661, 0x5c08daaa, 0xf27a4e2c, 0x57a912e7, 0x19199215, 0xbccacede, 0x12b85a58, 0xb76b0693, 0x0f5b038e, 0xaa885f45, 0x04facbc3, 0xa1299708, 0x749bc1f9, 0xd1489d32, 0x7f3a09b4, 0xdae9557f, 0x62d95062, 0xc70a0ca9, 0x6978982f, 0xccabc4e4}, {0x00000000, 0xb40b77a6, 0x29119f97, 0x9d1ae831, 0x13244ff4, 0xa72f3852, 0x3a35d063, 0x8e3ea7c5, 0x674eef33, 0xd3459895, 0x4e5f70a4, 0xfa540702, 0x746aa0c7, 0xc061d761, 0x5d7b3f50, 0xe97048f6, 0xce9cde67, 0x7a97a9c1, 0xe78d41f0, 0x53863656, 0xddb89193, 0x69b3e635, 0xf4a90e04, 0x40a279a2, 0xa9d23154, 0x1dd946f2, 0x80c3aec3, 0x34c8d965, 0xbaf67ea0, 0x0efd0906, 0x93e7e137, 0x27ec9691, 0x9c39bdcf, 0x2832ca69, 0xb5282258, 0x012355fe, 0x8f1df23b, 0x3b16859d, 0xa60c6dac, 0x12071a0a, 0xfb7752fc, 0x4f7c255a, 0xd266cd6b, 0x666dbacd, 0xe8531d08, 0x5c586aae, 0xc142829f, 0x7549f539, 0x52a563a8, 0xe6ae140e, 0x7bb4fc3f, 0xcfbf8b99, 0x41812c5c, 0xf58a5bfa, 0x6890b3cb, 0xdc9bc46d, 0x35eb8c9b, 0x81e0fb3d, 0x1cfa130c, 0xa8f164aa, 0x26cfc36f, 0x92c4b4c9, 0x0fde5cf8, 0xbbd52b5e, 0x79750b44, 0xcd7e7ce2, 0x506494d3, 0xe46fe375, 0x6a5144b0, 0xde5a3316, 0x4340db27, 0xf74bac81, 0x1e3be477, 0xaa3093d1, 0x372a7be0, 0x83210c46, 0x0d1fab83, 0xb914dc25, 0x240e3414, 0x900543b2, 0xb7e9d523, 0x03e2a285, 0x9ef84ab4, 0x2af33d12, 0xa4cd9ad7, 0x10c6ed71, 0x8ddc0540, 0x39d772e6, 0xd0a73a10, 0x64ac4db6, 0xf9b6a587, 0x4dbdd221, 0xc38375e4, 0x77880242, 0xea92ea73, 0x5e999dd5, 0xe54cb68b, 0x5147c12d, 0xcc5d291c, 0x78565eba, 0xf668f97f, 0x42638ed9, 0xdf7966e8, 0x6b72114e, 0x820259b8, 0x36092e1e, 0xab13c62f, 0x1f18b189, 0x9126164c, 0x252d61ea, 0xb83789db, 0x0c3cfe7d, 0x2bd068ec, 0x9fdb1f4a, 0x02c1f77b, 0xb6ca80dd, 0x38f42718, 0x8cff50be, 0x11e5b88f, 0xa5eecf29, 0x4c9e87df, 0xf895f079, 0x658f1848, 0xd1846fee, 0x5fbac82b, 0xebb1bf8d, 0x76ab57bc, 0xc2a0201a, 0xf2ea1688, 0x46e1612e, 0xdbfb891f, 0x6ff0feb9, 0xe1ce597c, 0x55c52eda, 0xc8dfc6eb, 0x7cd4b14d, 0x95a4f9bb, 0x21af8e1d, 0xbcb5662c, 0x08be118a, 0x8680b64f, 0x328bc1e9, 0xaf9129d8, 0x1b9a5e7e, 0x3c76c8ef, 0x887dbf49, 0x15675778, 0xa16c20de, 0x2f52871b, 0x9b59f0bd, 0x0643188c, 0xb2486f2a, 0x5b3827dc, 0xef33507a, 0x7229b84b, 0xc622cfed, 0x481c6828, 0xfc171f8e, 0x610df7bf, 0xd5068019, 0x6ed3ab47, 0xdad8dce1, 0x47c234d0, 0xf3c94376, 0x7df7e4b3, 0xc9fc9315, 0x54e67b24, 0xe0ed0c82, 0x099d4474, 0xbd9633d2, 0x208cdbe3, 0x9487ac45, 0x1ab90b80, 0xaeb27c26, 0x33a89417, 0x87a3e3b1, 0xa04f7520, 0x14440286, 0x895eeab7, 0x3d559d11, 0xb36b3ad4, 0x07604d72, 0x9a7aa543, 0x2e71d2e5, 0xc7019a13, 0x730aedb5, 0xee100584, 0x5a1b7222, 0xd425d5e7, 0x602ea241, 0xfd344a70, 0x493f3dd6, 0x8b9f1dcc, 0x3f946a6a, 0xa28e825b, 0x1685f5fd, 0x98bb5238, 0x2cb0259e, 0xb1aacdaf, 0x05a1ba09, 0xecd1f2ff, 0x58da8559, 0xc5c06d68, 0x71cb1ace, 0xfff5bd0b, 0x4bfecaad, 0xd6e4229c, 0x62ef553a, 0x4503c3ab, 0xf108b40d, 0x6c125c3c, 0xd8192b9a, 0x56278c5f, 0xe22cfbf9, 0x7f3613c8, 0xcb3d646e, 0x224d2c98, 0x96465b3e, 0x0b5cb30f, 0xbf57c4a9, 0x3169636c, 0x856214ca, 0x1878fcfb, 0xac738b5d, 0x17a6a003, 0xa3add7a5, 0x3eb73f94, 0x8abc4832, 0x0482eff7, 0xb0899851, 0x2d937060, 0x999807c6, 0x70e84f30, 0xc4e33896, 0x59f9d0a7, 0xedf2a701, 0x63cc00c4, 0xd7c77762, 0x4add9f53, 0xfed6e8f5, 0xd93a7e64, 0x6d3109c2, 0xf02be1f3, 0x44209655, 0xca1e3190, 0x7e154636, 0xe30fae07, 0x5704d9a1, 0xbe749157, 0x0a7fe6f1, 0x97650ec0, 0x236e7966, 0xad50dea3, 0x195ba905, 0x84414134, 0x304a3692}, {0x00000000, 0x9e00aacc, 0x7d072542, 0xe3078f8e, 0xfa0e4a84, 0x640ee048, 0x87096fc6, 0x1909c50a, 0xb51be5d3, 0x2b1b4f1f, 0xc81cc091, 0x561c6a5d, 0x4f15af57, 0xd115059b, 0x32128a15, 0xac1220d9, 0x2b31bb7c, 0xb53111b0, 0x56369e3e, 0xc83634f2, 0xd13ff1f8, 0x4f3f5b34, 0xac38d4ba, 0x32387e76, 0x9e2a5eaf, 0x002af463, 0xe32d7bed, 0x7d2dd121, 0x6424142b, 0xfa24bee7, 0x19233169, 0x87239ba5, 0x566276f9, 0xc862dc35, 0x2b6553bb, 0xb565f977, 0xac6c3c7d, 0x326c96b1, 0xd16b193f, 0x4f6bb3f3, 0xe379932a, 0x7d7939e6, 0x9e7eb668, 0x007e1ca4, 0x1977d9ae, 0x87777362, 0x6470fcec, 0xfa705620, 0x7d53cd85, 0xe3536749, 0x0054e8c7, 0x9e54420b, 0x875d8701, 0x195d2dcd, 0xfa5aa243, 0x645a088f, 0xc8482856, 0x5648829a, 0xb54f0d14, 0x2b4fa7d8, 0x324662d2, 0xac46c81e, 0x4f414790, 0xd141ed5c, 0xedc29d29, 0x73c237e5, 0x90c5b86b, 0x0ec512a7, 0x17ccd7ad, 0x89cc7d61, 0x6acbf2ef, 0xf4cb5823, 0x58d978fa, 0xc6d9d236, 0x25de5db8, 0xbbdef774, 0xa2d7327e, 0x3cd798b2, 0xdfd0173c, 0x41d0bdf0, 0xc6f32655, 0x58f38c99, 0xbbf40317, 0x25f4a9db, 0x3cfd6cd1, 0xa2fdc61d, 0x41fa4993, 0xdffae35f, 0x73e8c386, 0xede8694a, 0x0eefe6c4, 0x90ef4c08, 0x89e68902, 0x17e623ce, 0xf4e1ac40, 0x6ae1068c, 0xbba0ebd0, 0x25a0411c, 0xc6a7ce92, 0x58a7645e, 0x41aea154, 0xdfae0b98, 0x3ca98416, 0xa2a92eda, 0x0ebb0e03, 0x90bba4cf, 0x73bc2b41, 0xedbc818d, 0xf4b54487, 0x6ab5ee4b, 0x89b261c5, 0x17b2cb09, 0x909150ac, 0x0e91fa60, 0xed9675ee, 0x7396df22, 0x6a9f1a28, 0xf49fb0e4, 0x17983f6a, 0x899895a6, 0x258ab57f, 0xbb8a1fb3, 0x588d903d, 0xc68d3af1, 0xdf84fffb, 0x41845537, 0xa283dab9, 0x3c837075, 0xda853b53, 0x4485919f, 0xa7821e11, 0x3982b4dd, 0x208b71d7, 0xbe8bdb1b, 0x5d8c5495, 0xc38cfe59, 0x6f9ede80, 0xf19e744c, 0x1299fbc2, 0x8c99510e, 0x95909404, 0x0b903ec8, 0xe897b146, 0x76971b8a, 0xf1b4802f, 0x6fb42ae3, 0x8cb3a56d, 0x12b30fa1, 0x0bbacaab, 0x95ba6067, 0x76bdefe9, 0xe8bd4525, 0x44af65fc, 0xdaafcf30, 0x39a840be, 0xa7a8ea72, 0xbea12f78, 0x20a185b4, 0xc3a60a3a, 0x5da6a0f6, 0x8ce74daa, 0x12e7e766, 0xf1e068e8, 0x6fe0c224, 0x76e9072e, 0xe8e9ade2, 0x0bee226c, 0x95ee88a0, 0x39fca879, 0xa7fc02b5, 0x44fb8d3b, 0xdafb27f7, 0xc3f2e2fd, 0x5df24831, 0xbef5c7bf, 0x20f56d73, 0xa7d6f6d6, 0x39d65c1a, 0xdad1d394, 0x44d17958, 0x5dd8bc52, 0xc3d8169e, 0x20df9910, 0xbedf33dc, 0x12cd1305, 0x8ccdb9c9, 0x6fca3647, 0xf1ca9c8b, 0xe8c35981, 0x76c3f34d, 0x95c47cc3, 0x0bc4d60f, 0x3747a67a, 0xa9470cb6, 0x4a408338, 0xd44029f4, 0xcd49ecfe, 0x53494632, 0xb04ec9bc, 0x2e4e6370, 0x825c43a9, 0x1c5ce965, 0xff5b66eb, 0x615bcc27, 0x7852092d, 0xe652a3e1, 0x05552c6f, 0x9b5586a3, 0x1c761d06, 0x8276b7ca, 0x61713844, 0xff719288, 0xe6785782, 0x7878fd4e, 0x9b7f72c0, 0x057fd80c, 0xa96df8d5, 0x376d5219, 0xd46add97, 0x4a6a775b, 0x5363b251, 0xcd63189d, 0x2e649713, 0xb0643ddf, 0x6125d083, 0xff257a4f, 0x1c22f5c1, 0x82225f0d, 0x9b2b9a07, 0x052b30cb, 0xe62cbf45, 0x782c1589, 0xd43e3550, 0x4a3e9f9c, 0xa9391012, 0x3739bade, 0x2e307fd4, 0xb030d518, 0x53375a96, 0xcd37f05a, 0x4a146bff, 0xd414c133, 0x37134ebd, 0xa913e471, 0xb01a217b, 0x2e1a8bb7, 0xcd1d0439, 0x531daef5, 0xff0f8e2c, 0x610f24e0, 0x8208ab6e, 0x1c0801a2, 0x0501c4a8, 0x9b016e64, 0x7806e1ea, 0xe6064b26}}; #endif #endif #if N == 3 #if W == 8 local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0x81256527, 0xd93bcc0f, 0x581ea928, 0x69069e5f, 0xe823fb78, 0xb03d5250, 0x31183777, 0xd20d3cbe, 0x53285999, 0x0b36f0b1, 0x8a139596, 0xbb0ba2e1, 0x3a2ec7c6, 0x62306eee, 0xe3150bc9, 0x7f6b7f3d, 0xfe4e1a1a, 0xa650b332, 0x2775d615, 0x166de162, 0x97488445, 0xcf562d6d, 0x4e73484a, 0xad664383, 0x2c4326a4, 0x745d8f8c, 0xf578eaab, 0xc460dddc, 0x4545b8fb, 0x1d5b11d3, 0x9c7e74f4, 0xfed6fe7a, 0x7ff39b5d, 0x27ed3275, 0xa6c85752, 0x97d06025, 0x16f50502, 0x4eebac2a, 0xcfcec90d, 0x2cdbc2c4, 0xadfea7e3, 0xf5e00ecb, 0x74c56bec, 0x45dd5c9b, 0xc4f839bc, 0x9ce69094, 0x1dc3f5b3, 0x81bd8147, 0x0098e460, 0x58864d48, 0xd9a3286f, 0xe8bb1f18, 0x699e7a3f, 0x3180d317, 0xb0a5b630, 0x53b0bdf9, 0xd295d8de, 0x8a8b71f6, 0x0bae14d1, 0x3ab623a6, 0xbb934681, 0xe38defa9, 0x62a88a8e, 0x26dcfab5, 0xa7f99f92, 0xffe736ba, 0x7ec2539d, 0x4fda64ea, 0xceff01cd, 0x96e1a8e5, 0x17c4cdc2, 0xf4d1c60b, 0x75f4a32c, 0x2dea0a04, 0xaccf6f23, 0x9dd75854, 0x1cf23d73, 0x44ec945b, 0xc5c9f17c, 0x59b78588, 0xd892e0af, 0x808c4987, 0x01a92ca0, 0x30b11bd7, 0xb1947ef0, 0xe98ad7d8, 0x68afb2ff, 0x8bbab936, 0x0a9fdc11, 0x52817539, 0xd3a4101e, 0xe2bc2769, 0x6399424e, 0x3b87eb66, 0xbaa28e41, 0xd80a04cf, 0x592f61e8, 0x0131c8c0, 0x8014ade7, 0xb10c9a90, 0x3029ffb7, 0x6837569f, 0xe91233b8, 0x0a073871, 0x8b225d56, 0xd33cf47e, 0x52199159, 0x6301a62e, 0xe224c309, 0xba3a6a21, 0x3b1f0f06, 0xa7617bf2, 0x26441ed5, 0x7e5ab7fd, 0xff7fd2da, 0xce67e5ad, 0x4f42808a, 0x175c29a2, 0x96794c85, 0x756c474c, 0xf449226b, 0xac578b43, 0x2d72ee64, 0x1c6ad913, 0x9d4fbc34, 0xc551151c, 0x4474703b, 0x4db9f56a, 0xcc9c904d, 0x94823965, 0x15a75c42, 0x24bf6b35, 0xa59a0e12, 0xfd84a73a, 0x7ca1c21d, 0x9fb4c9d4, 0x1e91acf3, 0x468f05db, 0xc7aa60fc, 0xf6b2578b, 0x779732ac, 0x2f899b84, 0xaeacfea3, 0x32d28a57, 0xb3f7ef70, 0xebe94658, 0x6acc237f, 0x5bd41408, 0xdaf1712f, 0x82efd807, 0x03cabd20, 0xe0dfb6e9, 0x61fad3ce, 0x39e47ae6, 0xb8c11fc1, 0x89d928b6, 0x08fc4d91, 0x50e2e4b9, 0xd1c7819e, 0xb36f0b10, 0x324a6e37, 0x6a54c71f, 0xeb71a238, 0xda69954f, 0x5b4cf068, 0x03525940, 0x82773c67, 0x616237ae, 0xe0475289, 0xb859fba1, 0x397c9e86, 0x0864a9f1, 0x8941ccd6, 0xd15f65fe, 0x507a00d9, 0xcc04742d, 0x4d21110a, 0x153fb822, 0x941add05, 0xa502ea72, 0x24278f55, 0x7c39267d, 0xfd1c435a, 0x1e094893, 0x9f2c2db4, 0xc732849c, 0x4617e1bb, 0x770fd6cc, 0xf62ab3eb, 0xae341ac3, 0x2f117fe4, 0x6b650fdf, 0xea406af8, 0xb25ec3d0, 0x337ba6f7, 0x02639180, 0x8346f4a7, 0xdb585d8f, 0x5a7d38a8, 0xb9683361, 0x384d5646, 0x6053ff6e, 0xe1769a49, 0xd06ead3e, 0x514bc819, 0x09556131, 0x88700416, 0x140e70e2, 0x952b15c5, 0xcd35bced, 0x4c10d9ca, 0x7d08eebd, 0xfc2d8b9a, 0xa43322b2, 0x25164795, 0xc6034c5c, 0x4726297b, 0x1f388053, 0x9e1de574, 0xaf05d203, 0x2e20b724, 0x763e1e0c, 0xf71b7b2b, 0x95b3f1a5, 0x14969482, 0x4c883daa, 0xcdad588d, 0xfcb56ffa, 0x7d900add, 0x258ea3f5, 0xa4abc6d2, 0x47becd1b, 0xc69ba83c, 0x9e850114, 0x1fa06433, 0x2eb85344, 0xaf9d3663, 0xf7839f4b, 0x76a6fa6c, 0xead88e98, 0x6bfdebbf, 0x33e34297, 0xb2c627b0, 0x83de10c7, 0x02fb75e0, 0x5ae5dcc8, 0xdbc0b9ef, 0x38d5b226, 0xb9f0d701, 0xe1ee7e29, 0x60cb1b0e, 0x51d32c79, 0xd0f6495e, 0x88e8e076, 0x09cd8551}, {0x00000000, 0x9b73ead4, 0xed96d3e9, 0x76e5393d, 0x005ca193, 0x9b2f4b47, 0xedca727a, 0x76b998ae, 0x00b94326, 0x9bcaa9f2, 0xed2f90cf, 0x765c7a1b, 0x00e5e2b5, 0x9b960861, 0xed73315c, 0x7600db88, 0x0172864c, 0x9a016c98, 0xece455a5, 0x7797bf71, 0x012e27df, 0x9a5dcd0b, 0xecb8f436, 0x77cb1ee2, 0x01cbc56a, 0x9ab82fbe, 0xec5d1683, 0x772efc57, 0x019764f9, 0x9ae48e2d, 0xec01b710, 0x77725dc4, 0x02e50c98, 0x9996e64c, 0xef73df71, 0x740035a5, 0x02b9ad0b, 0x99ca47df, 0xef2f7ee2, 0x745c9436, 0x025c4fbe, 0x992fa56a, 0xefca9c57, 0x74b97683, 0x0200ee2d, 0x997304f9, 0xef963dc4, 0x74e5d710, 0x03978ad4, 0x98e46000, 0xee01593d, 0x7572b3e9, 0x03cb2b47, 0x98b8c193, 0xee5df8ae, 0x752e127a, 0x032ec9f2, 0x985d2326, 0xeeb81a1b, 0x75cbf0cf, 0x03726861, 0x980182b5, 0xeee4bb88, 0x7597515c, 0x05ca1930, 0x9eb9f3e4, 0xe85ccad9, 0x732f200d, 0x0596b8a3, 0x9ee55277, 0xe8006b4a, 0x7373819e, 0x05735a16, 0x9e00b0c2, 0xe8e589ff, 0x7396632b, 0x052ffb85, 0x9e5c1151, 0xe8b9286c, 0x73cac2b8, 0x04b89f7c, 0x9fcb75a8, 0xe92e4c95, 0x725da641, 0x04e43eef, 0x9f97d43b, 0xe972ed06, 0x720107d2, 0x0401dc5a, 0x9f72368e, 0xe9970fb3, 0x72e4e567, 0x045d7dc9, 0x9f2e971d, 0xe9cbae20, 0x72b844f4, 0x072f15a8, 0x9c5cff7c, 0xeab9c641, 0x71ca2c95, 0x0773b43b, 0x9c005eef, 0xeae567d2, 0x71968d06, 0x0796568e, 0x9ce5bc5a, 0xea008567, 0x71736fb3, 0x07caf71d, 0x9cb91dc9, 0xea5c24f4, 0x712fce20, 0x065d93e4, 0x9d2e7930, 0xebcb400d, 0x70b8aad9, 0x06013277, 0x9d72d8a3, 0xeb97e19e, 0x70e40b4a, 0x06e4d0c2, 0x9d973a16, 0xeb72032b, 0x7001e9ff, 0x06b87151, 0x9dcb9b85, 0xeb2ea2b8, 0x705d486c, 0x0b943260, 0x90e7d8b4, 0xe602e189, 0x7d710b5d, 0x0bc893f3, 0x90bb7927, 0xe65e401a, 0x7d2daace, 0x0b2d7146, 0x905e9b92, 0xe6bba2af, 0x7dc8487b, 0x0b71d0d5, 0x90023a01, 0xe6e7033c, 0x7d94e9e8, 0x0ae6b42c, 0x91955ef8, 0xe77067c5, 0x7c038d11, 0x0aba15bf, 0x91c9ff6b, 0xe72cc656, 0x7c5f2c82, 0x0a5ff70a, 0x912c1dde, 0xe7c924e3, 0x7cbace37, 0x0a035699, 0x9170bc4d, 0xe7958570, 0x7ce66fa4, 0x09713ef8, 0x9202d42c, 0xe4e7ed11, 0x7f9407c5, 0x092d9f6b, 0x925e75bf, 0xe4bb4c82, 0x7fc8a656, 0x09c87dde, 0x92bb970a, 0xe45eae37, 0x7f2d44e3, 0x0994dc4d, 0x92e73699, 0xe4020fa4, 0x7f71e570, 0x0803b8b4, 0x93705260, 0xe5956b5d, 0x7ee68189, 0x085f1927, 0x932cf3f3, 0xe5c9cace, 0x7eba201a, 0x08bafb92, 0x93c91146, 0xe52c287b, 0x7e5fc2af, 0x08e65a01, 0x9395b0d5, 0xe57089e8, 0x7e03633c, 0x0e5e2b50, 0x952dc184, 0xe3c8f8b9, 0x78bb126d, 0x0e028ac3, 0x95716017, 0xe394592a, 0x78e7b3fe, 0x0ee76876, 0x959482a2, 0xe371bb9f, 0x7802514b, 0x0ebbc9e5, 0x95c82331, 0xe32d1a0c, 0x785ef0d8, 0x0f2cad1c, 0x945f47c8, 0xe2ba7ef5, 0x79c99421, 0x0f700c8f, 0x9403e65b, 0xe2e6df66, 0x799535b2, 0x0f95ee3a, 0x94e604ee, 0xe2033dd3, 0x7970d707, 0x0fc94fa9, 0x94baa57d, 0xe25f9c40, 0x792c7694, 0x0cbb27c8, 0x97c8cd1c, 0xe12df421, 0x7a5e1ef5, 0x0ce7865b, 0x97946c8f, 0xe17155b2, 0x7a02bf66, 0x0c0264ee, 0x97718e3a, 0xe194b707, 0x7ae75dd3, 0x0c5ec57d, 0x972d2fa9, 0xe1c81694, 0x7abbfc40, 0x0dc9a184, 0x96ba4b50, 0xe05f726d, 0x7b2c98b9, 0x0d950017, 0x96e6eac3, 0xe003d3fe, 0x7b70392a, 0x0d70e2a2, 0x96030876, 0xe0e6314b, 0x7b95db9f, 0x0d2c4331, 0x965fa9e5, 0xe0ba90d8, 0x7bc97a0c}, {0x00000000, 0x172864c0, 0x2e50c980, 0x3978ad40, 0x5ca19300, 0x4b89f7c0, 0x72f15a80, 0x65d93e40, 0xb9432600, 0xae6b42c0, 0x9713ef80, 0x803b8b40, 0xe5e2b500, 0xf2cad1c0, 0xcbb27c80, 0xdc9a1840, 0xa9f74a41, 0xbedf2e81, 0x87a783c1, 0x908fe701, 0xf556d941, 0xe27ebd81, 0xdb0610c1, 0xcc2e7401, 0x10b46c41, 0x079c0881, 0x3ee4a5c1, 0x29ccc101, 0x4c15ff41, 0x5b3d9b81, 0x624536c1, 0x756d5201, 0x889f92c3, 0x9fb7f603, 0xa6cf5b43, 0xb1e73f83, 0xd43e01c3, 0xc3166503, 0xfa6ec843, 0xed46ac83, 0x31dcb4c3, 0x26f4d003, 0x1f8c7d43, 0x08a41983, 0x6d7d27c3, 0x7a554303, 0x432dee43, 0x54058a83, 0x2168d882, 0x3640bc42, 0x0f381102, 0x181075c2, 0x7dc94b82, 0x6ae12f42, 0x53998202, 0x44b1e6c2, 0x982bfe82, 0x8f039a42, 0xb67b3702, 0xa15353c2, 0xc48a6d82, 0xd3a20942, 0xeadaa402, 0xfdf2c0c2, 0xca4e23c7, 0xdd664707, 0xe41eea47, 0xf3368e87, 0x96efb0c7, 0x81c7d407, 0xb8bf7947, 0xaf971d87, 0x730d05c7, 0x64256107, 0x5d5dcc47, 0x4a75a887, 0x2fac96c7, 0x3884f207, 0x01fc5f47, 0x16d43b87, 0x63b96986, 0x74910d46, 0x4de9a006, 0x5ac1c4c6, 0x3f18fa86, 0x28309e46, 0x11483306, 0x066057c6, 0xdafa4f86, 0xcdd22b46, 0xf4aa8606, 0xe382e2c6, 0x865bdc86, 0x9173b846, 0xa80b1506, 0xbf2371c6, 0x42d1b104, 0x55f9d5c4, 0x6c817884, 0x7ba91c44, 0x1e702204, 0x095846c4, 0x3020eb84, 0x27088f44, 0xfb929704, 0xecbaf3c4, 0xd5c25e84, 0xc2ea3a44, 0xa7330404, 0xb01b60c4, 0x8963cd84, 0x9e4ba944, 0xeb26fb45, 0xfc0e9f85, 0xc57632c5, 0xd25e5605, 0xb7876845, 0xa0af0c85, 0x99d7a1c5, 0x8effc505, 0x5265dd45, 0x454db985, 0x7c3514c5, 0x6b1d7005, 0x0ec44e45, 0x19ec2a85, 0x209487c5, 0x37bce305, 0x4fed41cf, 0x58c5250f, 0x61bd884f, 0x7695ec8f, 0x134cd2cf, 0x0464b60f, 0x3d1c1b4f, 0x2a347f8f, 0xf6ae67cf, 0xe186030f, 0xd8feae4f, 0xcfd6ca8f, 0xaa0ff4cf, 0xbd27900f, 0x845f3d4f, 0x9377598f, 0xe61a0b8e, 0xf1326f4e, 0xc84ac20e, 0xdf62a6ce, 0xbabb988e, 0xad93fc4e, 0x94eb510e, 0x83c335ce, 0x5f592d8e, 0x4871494e, 0x7109e40e, 0x662180ce, 0x03f8be8e, 0x14d0da4e, 0x2da8770e, 0x3a8013ce, 0xc772d30c, 0xd05ab7cc, 0xe9221a8c, 0xfe0a7e4c, 0x9bd3400c, 0x8cfb24cc, 0xb583898c, 0xa2abed4c, 0x7e31f50c, 0x691991cc, 0x50613c8c, 0x4749584c, 0x2290660c, 0x35b802cc, 0x0cc0af8c, 0x1be8cb4c, 0x6e85994d, 0x79adfd8d, 0x40d550cd, 0x57fd340d, 0x32240a4d, 0x250c6e8d, 0x1c74c3cd, 0x0b5ca70d, 0xd7c6bf4d, 0xc0eedb8d, 0xf99676cd, 0xeebe120d, 0x8b672c4d, 0x9c4f488d, 0xa537e5cd, 0xb21f810d, 0x85a36208, 0x928b06c8, 0xabf3ab88, 0xbcdbcf48, 0xd902f108, 0xce2a95c8, 0xf7523888, 0xe07a5c48, 0x3ce04408, 0x2bc820c8, 0x12b08d88, 0x0598e948, 0x6041d708, 0x7769b3c8, 0x4e111e88, 0x59397a48, 0x2c542849, 0x3b7c4c89, 0x0204e1c9, 0x152c8509, 0x70f5bb49, 0x67dddf89, 0x5ea572c9, 0x498d1609, 0x95170e49, 0x823f6a89, 0xbb47c7c9, 0xac6fa309, 0xc9b69d49, 0xde9ef989, 0xe7e654c9, 0xf0ce3009, 0x0d3cf0cb, 0x1a14940b, 0x236c394b, 0x34445d8b, 0x519d63cb, 0x46b5070b, 0x7fcdaa4b, 0x68e5ce8b, 0xb47fd6cb, 0xa357b20b, 0x9a2f1f4b, 0x8d077b8b, 0xe8de45cb, 0xfff6210b, 0xc68e8c4b, 0xd1a6e88b, 0xa4cbba8a, 0xb3e3de4a, 0x8a9b730a, 0x9db317ca, 0xf86a298a, 0xef424d4a, 0xd63ae00a, 0xc11284ca, 0x1d889c8a, 0x0aa0f84a, 0x33d8550a, 0x24f031ca, 0x41290f8a, 0x56016b4a, 0x6f79c60a, 0x7851a2ca}, {0x00000000, 0x9fda839e, 0xe4c4017d, 0x7b1e82e3, 0x12f904bb, 0x8d238725, 0xf63d05c6, 0x69e78658, 0x25f20976, 0xba288ae8, 0xc136080b, 0x5eec8b95, 0x370b0dcd, 0xa8d18e53, 0xd3cf0cb0, 0x4c158f2e, 0x4be412ec, 0xd43e9172, 0xaf201391, 0x30fa900f, 0x591d1657, 0xc6c795c9, 0xbdd9172a, 0x220394b4, 0x6e161b9a, 0xf1cc9804, 0x8ad21ae7, 0x15089979, 0x7cef1f21, 0xe3359cbf, 0x982b1e5c, 0x07f19dc2, 0x97c825d8, 0x0812a646, 0x730c24a5, 0xecd6a73b, 0x85312163, 0x1aeba2fd, 0x61f5201e, 0xfe2fa380, 0xb23a2cae, 0x2de0af30, 0x56fe2dd3, 0xc924ae4d, 0xa0c32815, 0x3f19ab8b, 0x44072968, 0xdbddaaf6, 0xdc2c3734, 0x43f6b4aa, 0x38e83649, 0xa732b5d7, 0xced5338f, 0x510fb011, 0x2a1132f2, 0xb5cbb16c, 0xf9de3e42, 0x6604bddc, 0x1d1a3f3f, 0x82c0bca1, 0xeb273af9, 0x74fdb967, 0x0fe33b84, 0x9039b81a, 0xf4e14df1, 0x6b3bce6f, 0x10254c8c, 0x8fffcf12, 0xe618494a, 0x79c2cad4, 0x02dc4837, 0x9d06cba9, 0xd1134487, 0x4ec9c719, 0x35d745fa, 0xaa0dc664, 0xc3ea403c, 0x5c30c3a2, 0x272e4141, 0xb8f4c2df, 0xbf055f1d, 0x20dfdc83, 0x5bc15e60, 0xc41bddfe, 0xadfc5ba6, 0x3226d838, 0x49385adb, 0xd6e2d945, 0x9af7566b, 0x052dd5f5, 0x7e335716, 0xe1e9d488, 0x880e52d0, 0x17d4d14e, 0x6cca53ad, 0xf310d033, 0x63296829, 0xfcf3ebb7, 0x87ed6954, 0x1837eaca, 0x71d06c92, 0xee0aef0c, 0x95146def, 0x0aceee71, 0x46db615f, 0xd901e2c1, 0xa21f6022, 0x3dc5e3bc, 0x542265e4, 0xcbf8e67a, 0xb0e66499, 0x2f3ce707, 0x28cd7ac5, 0xb717f95b, 0xcc097bb8, 0x53d3f826, 0x3a347e7e, 0xa5eefde0, 0xdef07f03, 0x412afc9d, 0x0d3f73b3, 0x92e5f02d, 0xe9fb72ce, 0x7621f150, 0x1fc67708, 0x801cf496, 0xfb027675, 0x64d8f5eb, 0x32b39da3, 0xad691e3d, 0xd6779cde, 0x49ad1f40, 0x204a9918, 0xbf901a86, 0xc48e9865, 0x5b541bfb, 0x174194d5, 0x889b174b, 0xf38595a8, 0x6c5f1636, 0x05b8906e, 0x9a6213f0, 0xe17c9113, 0x7ea6128d, 0x79578f4f, 0xe68d0cd1, 0x9d938e32, 0x02490dac, 0x6bae8bf4, 0xf474086a, 0x8f6a8a89, 0x10b00917, 0x5ca58639, 0xc37f05a7, 0xb8618744, 0x27bb04da, 0x4e5c8282, 0xd186011c, 0xaa9883ff, 0x35420061, 0xa57bb87b, 0x3aa13be5, 0x41bfb906, 0xde653a98, 0xb782bcc0, 0x28583f5e, 0x5346bdbd, 0xcc9c3e23, 0x8089b10d, 0x1f533293, 0x644db070, 0xfb9733ee, 0x9270b5b6, 0x0daa3628, 0x76b4b4cb, 0xe96e3755, 0xee9faa97, 0x71452909, 0x0a5babea, 0x95812874, 0xfc66ae2c, 0x63bc2db2, 0x18a2af51, 0x87782ccf, 0xcb6da3e1, 0x54b7207f, 0x2fa9a29c, 0xb0732102, 0xd994a75a, 0x464e24c4, 0x3d50a627, 0xa28a25b9, 0xc652d052, 0x598853cc, 0x2296d12f, 0xbd4c52b1, 0xd4abd4e9, 0x4b715777, 0x306fd594, 0xafb5560a, 0xe3a0d924, 0x7c7a5aba, 0x0764d859, 0x98be5bc7, 0xf159dd9f, 0x6e835e01, 0x159ddce2, 0x8a475f7c, 0x8db6c2be, 0x126c4120, 0x6972c3c3, 0xf6a8405d, 0x9f4fc605, 0x0095459b, 0x7b8bc778, 0xe45144e6, 0xa844cbc8, 0x379e4856, 0x4c80cab5, 0xd35a492b, 0xbabdcf73, 0x25674ced, 0x5e79ce0e, 0xc1a34d90, 0x519af58a, 0xce407614, 0xb55ef4f7, 0x2a847769, 0x4363f131, 0xdcb972af, 0xa7a7f04c, 0x387d73d2, 0x7468fcfc, 0xebb27f62, 0x90acfd81, 0x0f767e1f, 0x6691f847, 0xf94b7bd9, 0x8255f93a, 0x1d8f7aa4, 0x1a7ee766, 0x85a464f8, 0xfebae61b, 0x61606585, 0x0887e3dd, 0x975d6043, 0xec43e2a0, 0x7399613e, 0x3f8cee10, 0xa0566d8e, 0xdb48ef6d, 0x44926cf3, 0x2d75eaab, 0xb2af6935, 0xc9b1ebd6, 0x566b6848}, {0x00000000, 0x65673b46, 0xcace768c, 0xafa94dca, 0x4eedeb59, 0x2b8ad01f, 0x84239dd5, 0xe144a693, 0x9ddbd6b2, 0xf8bcedf4, 0x5715a03e, 0x32729b78, 0xd3363deb, 0xb65106ad, 0x19f84b67, 0x7c9f7021, 0xe0c6ab25, 0x85a19063, 0x2a08dda9, 0x4f6fe6ef, 0xae2b407c, 0xcb4c7b3a, 0x64e536f0, 0x01820db6, 0x7d1d7d97, 0x187a46d1, 0xb7d30b1b, 0xd2b4305d, 0x33f096ce, 0x5697ad88, 0xf93ee042, 0x9c59db04, 0x1afc500b, 0x7f9b6b4d, 0xd0322687, 0xb5551dc1, 0x5411bb52, 0x31768014, 0x9edfcdde, 0xfbb8f698, 0x872786b9, 0xe240bdff, 0x4de9f035, 0x288ecb73, 0xc9ca6de0, 0xacad56a6, 0x03041b6c, 0x6663202a, 0xfa3afb2e, 0x9f5dc068, 0x30f48da2, 0x5593b6e4, 0xb4d71077, 0xd1b02b31, 0x7e1966fb, 0x1b7e5dbd, 0x67e12d9c, 0x028616da, 0xad2f5b10, 0xc8486056, 0x290cc6c5, 0x4c6bfd83, 0xe3c2b049, 0x86a58b0f, 0x35f8a016, 0x509f9b50, 0xff36d69a, 0x9a51eddc, 0x7b154b4f, 0x1e727009, 0xb1db3dc3, 0xd4bc0685, 0xa82376a4, 0xcd444de2, 0x62ed0028, 0x078a3b6e, 0xe6ce9dfd, 0x83a9a6bb, 0x2c00eb71, 0x4967d037, 0xd53e0b33, 0xb0593075, 0x1ff07dbf, 0x7a9746f9, 0x9bd3e06a, 0xfeb4db2c, 0x511d96e6, 0x347aada0, 0x48e5dd81, 0x2d82e6c7, 0x822bab0d, 0xe74c904b, 0x060836d8, 0x636f0d9e, 0xccc64054, 0xa9a17b12, 0x2f04f01d, 0x4a63cb5b, 0xe5ca8691, 0x80adbdd7, 0x61e91b44, 0x048e2002, 0xab276dc8, 0xce40568e, 0xb2df26af, 0xd7b81de9, 0x78115023, 0x1d766b65, 0xfc32cdf6, 0x9955f6b0, 0x36fcbb7a, 0x539b803c, 0xcfc25b38, 0xaaa5607e, 0x050c2db4, 0x606b16f2, 0x812fb061, 0xe4488b27, 0x4be1c6ed, 0x2e86fdab, 0x52198d8a, 0x377eb6cc, 0x98d7fb06, 0xfdb0c040, 0x1cf466d3, 0x79935d95, 0xd63a105f, 0xb35d2b19, 0x6bf1402c, 0x0e967b6a, 0xa13f36a0, 0xc4580de6, 0x251cab75, 0x407b9033, 0xefd2ddf9, 0x8ab5e6bf, 0xf62a969e, 0x934dadd8, 0x3ce4e012, 0x5983db54, 0xb8c77dc7, 0xdda04681, 0x72090b4b, 0x176e300d, 0x8b37eb09, 0xee50d04f, 0x41f99d85, 0x249ea6c3, 0xc5da0050, 0xa0bd3b16, 0x0f1476dc, 0x6a734d9a, 0x16ec3dbb, 0x738b06fd, 0xdc224b37, 0xb9457071, 0x5801d6e2, 0x3d66eda4, 0x92cfa06e, 0xf7a89b28, 0x710d1027, 0x146a2b61, 0xbbc366ab, 0xdea45ded, 0x3fe0fb7e, 0x5a87c038, 0xf52e8df2, 0x9049b6b4, 0xecd6c695, 0x89b1fdd3, 0x2618b019, 0x437f8b5f, 0xa23b2dcc, 0xc75c168a, 0x68f55b40, 0x0d926006, 0x91cbbb02, 0xf4ac8044, 0x5b05cd8e, 0x3e62f6c8, 0xdf26505b, 0xba416b1d, 0x15e826d7, 0x708f1d91, 0x0c106db0, 0x697756f6, 0xc6de1b3c, 0xa3b9207a, 0x42fd86e9, 0x279abdaf, 0x8833f065, 0xed54cb23, 0x5e09e03a, 0x3b6edb7c, 0x94c796b6, 0xf1a0adf0, 0x10e40b63, 0x75833025, 0xda2a7def, 0xbf4d46a9, 0xc3d23688, 0xa6b50dce, 0x091c4004, 0x6c7b7b42, 0x8d3fddd1, 0xe858e697, 0x47f1ab5d, 0x2296901b, 0xbecf4b1f, 0xdba87059, 0x74013d93, 0x116606d5, 0xf022a046, 0x95459b00, 0x3aecd6ca, 0x5f8bed8c, 0x23149dad, 0x4673a6eb, 0xe9daeb21, 0x8cbdd067, 0x6df976f4, 0x089e4db2, 0xa7370078, 0xc2503b3e, 0x44f5b031, 0x21928b77, 0x8e3bc6bd, 0xeb5cfdfb, 0x0a185b68, 0x6f7f602e, 0xc0d62de4, 0xa5b116a2, 0xd92e6683, 0xbc495dc5, 0x13e0100f, 0x76872b49, 0x97c38dda, 0xf2a4b69c, 0x5d0dfb56, 0x386ac010, 0xa4331b14, 0xc1542052, 0x6efd6d98, 0x0b9a56de, 0xeadef04d, 0x8fb9cb0b, 0x201086c1, 0x4577bd87, 0x39e8cda6, 0x5c8ff6e0, 0xf326bb2a, 0x9641806c, 0x770526ff, 0x12621db9, 0xbdcb5073, 0xd8ac6b35}, {0x00000000, 0xd7e28058, 0x74b406f1, 0xa35686a9, 0xe9680de2, 0x3e8a8dba, 0x9ddc0b13, 0x4a3e8b4b, 0x09a11d85, 0xde439ddd, 0x7d151b74, 0xaaf79b2c, 0xe0c91067, 0x372b903f, 0x947d1696, 0x439f96ce, 0x13423b0a, 0xc4a0bb52, 0x67f63dfb, 0xb014bda3, 0xfa2a36e8, 0x2dc8b6b0, 0x8e9e3019, 0x597cb041, 0x1ae3268f, 0xcd01a6d7, 0x6e57207e, 0xb9b5a026, 0xf38b2b6d, 0x2469ab35, 0x873f2d9c, 0x50ddadc4, 0x26847614, 0xf166f64c, 0x523070e5, 0x85d2f0bd, 0xcfec7bf6, 0x180efbae, 0xbb587d07, 0x6cbafd5f, 0x2f256b91, 0xf8c7ebc9, 0x5b916d60, 0x8c73ed38, 0xc64d6673, 0x11afe62b, 0xb2f96082, 0x651be0da, 0x35c64d1e, 0xe224cd46, 0x41724bef, 0x9690cbb7, 0xdcae40fc, 0x0b4cc0a4, 0xa81a460d, 0x7ff8c655, 0x3c67509b, 0xeb85d0c3, 0x48d3566a, 0x9f31d632, 0xd50f5d79, 0x02eddd21, 0xa1bb5b88, 0x7659dbd0, 0x4d08ec28, 0x9aea6c70, 0x39bcead9, 0xee5e6a81, 0xa460e1ca, 0x73826192, 0xd0d4e73b, 0x07366763, 0x44a9f1ad, 0x934b71f5, 0x301df75c, 0xe7ff7704, 0xadc1fc4f, 0x7a237c17, 0xd975fabe, 0x0e977ae6, 0x5e4ad722, 0x89a8577a, 0x2afed1d3, 0xfd1c518b, 0xb722dac0, 0x60c05a98, 0xc396dc31, 0x14745c69, 0x57ebcaa7, 0x80094aff, 0x235fcc56, 0xf4bd4c0e, 0xbe83c745, 0x6961471d, 0xca37c1b4, 0x1dd541ec, 0x6b8c9a3c, 0xbc6e1a64, 0x1f389ccd, 0xc8da1c95, 0x82e497de, 0x55061786, 0xf650912f, 0x21b21177, 0x622d87b9, 0xb5cf07e1, 0x16998148, 0xc17b0110, 0x8b458a5b, 0x5ca70a03, 0xfff18caa, 0x28130cf2, 0x78cea136, 0xaf2c216e, 0x0c7aa7c7, 0xdb98279f, 0x91a6acd4, 0x46442c8c, 0xe512aa25, 0x32f02a7d, 0x716fbcb3, 0xa68d3ceb, 0x05dbba42, 0xd2393a1a, 0x9807b151, 0x4fe53109, 0xecb3b7a0, 0x3b5137f8, 0x9a11d850, 0x4df35808, 0xeea5dea1, 0x39475ef9, 0x7379d5b2, 0xa49b55ea, 0x07cdd343, 0xd02f531b, 0x93b0c5d5, 0x4452458d, 0xe704c324, 0x30e6437c, 0x7ad8c837, 0xad3a486f, 0x0e6ccec6, 0xd98e4e9e, 0x8953e35a, 0x5eb16302, 0xfde7e5ab, 0x2a0565f3, 0x603beeb8, 0xb7d96ee0, 0x148fe849, 0xc36d6811, 0x80f2fedf, 0x57107e87, 0xf446f82e, 0x23a47876, 0x699af33d, 0xbe787365, 0x1d2ef5cc, 0xcacc7594, 0xbc95ae44, 0x6b772e1c, 0xc821a8b5, 0x1fc328ed, 0x55fda3a6, 0x821f23fe, 0x2149a557, 0xf6ab250f, 0xb534b3c1, 0x62d63399, 0xc180b530, 0x16623568, 0x5c5cbe23, 0x8bbe3e7b, 0x28e8b8d2, 0xff0a388a, 0xafd7954e, 0x78351516, 0xdb6393bf, 0x0c8113e7, 0x46bf98ac, 0x915d18f4, 0x320b9e5d, 0xe5e91e05, 0xa67688cb, 0x71940893, 0xd2c28e3a, 0x05200e62, 0x4f1e8529, 0x98fc0571, 0x3baa83d8, 0xec480380, 0xd7193478, 0x00fbb420, 0xa3ad3289, 0x744fb2d1, 0x3e71399a, 0xe993b9c2, 0x4ac53f6b, 0x9d27bf33, 0xdeb829fd, 0x095aa9a5, 0xaa0c2f0c, 0x7deeaf54, 0x37d0241f, 0xe032a447, 0x436422ee, 0x9486a2b6, 0xc45b0f72, 0x13b98f2a, 0xb0ef0983, 0x670d89db, 0x2d330290, 0xfad182c8, 0x59870461, 0x8e658439, 0xcdfa12f7, 0x1a1892af, 0xb94e1406, 0x6eac945e, 0x24921f15, 0xf3709f4d, 0x502619e4, 0x87c499bc, 0xf19d426c, 0x267fc234, 0x8529449d, 0x52cbc4c5, 0x18f54f8e, 0xcf17cfd6, 0x6c41497f, 0xbba3c927, 0xf83c5fe9, 0x2fdedfb1, 0x8c885918, 0x5b6ad940, 0x1154520b, 0xc6b6d253, 0x65e054fa, 0xb202d4a2, 0xe2df7966, 0x353df93e, 0x966b7f97, 0x4189ffcf, 0x0bb77484, 0xdc55f4dc, 0x7f037275, 0xa8e1f22d, 0xeb7e64e3, 0x3c9ce4bb, 0x9fca6212, 0x4828e24a, 0x02166901, 0xd5f4e959, 0x76a26ff0, 0xa140efa8}, {0x00000000, 0xef52b6e1, 0x05d46b83, 0xea86dd62, 0x0ba8d706, 0xe4fa61e7, 0x0e7cbc85, 0xe12e0a64, 0x1751ae0c, 0xf80318ed, 0x1285c58f, 0xfdd7736e, 0x1cf9790a, 0xf3abcfeb, 0x192d1289, 0xf67fa468, 0x2ea35c18, 0xc1f1eaf9, 0x2b77379b, 0xc425817a, 0x250b8b1e, 0xca593dff, 0x20dfe09d, 0xcf8d567c, 0x39f2f214, 0xd6a044f5, 0x3c269997, 0xd3742f76, 0x325a2512, 0xdd0893f3, 0x378e4e91, 0xd8dcf870, 0x5d46b830, 0xb2140ed1, 0x5892d3b3, 0xb7c06552, 0x56ee6f36, 0xb9bcd9d7, 0x533a04b5, 0xbc68b254, 0x4a17163c, 0xa545a0dd, 0x4fc37dbf, 0xa091cb5e, 0x41bfc13a, 0xaeed77db, 0x446baab9, 0xab391c58, 0x73e5e428, 0x9cb752c9, 0x76318fab, 0x9963394a, 0x784d332e, 0x971f85cf, 0x7d9958ad, 0x92cbee4c, 0x64b44a24, 0x8be6fcc5, 0x616021a7, 0x8e329746, 0x6f1c9d22, 0x804e2bc3, 0x6ac8f6a1, 0x859a4040, 0xba8d7060, 0x55dfc681, 0xbf591be3, 0x500bad02, 0xb125a766, 0x5e771187, 0xb4f1cce5, 0x5ba37a04, 0xaddcde6c, 0x428e688d, 0xa808b5ef, 0x475a030e, 0xa674096a, 0x4926bf8b, 0xa3a062e9, 0x4cf2d408, 0x942e2c78, 0x7b7c9a99, 0x91fa47fb, 0x7ea8f11a, 0x9f86fb7e, 0x70d44d9f, 0x9a5290fd, 0x7500261c, 0x837f8274, 0x6c2d3495, 0x86abe9f7, 0x69f95f16, 0x88d75572, 0x6785e393, 0x8d033ef1, 0x62518810, 0xe7cbc850, 0x08997eb1, 0xe21fa3d3, 0x0d4d1532, 0xec631f56, 0x0331a9b7, 0xe9b774d5, 0x06e5c234, 0xf09a665c, 0x1fc8d0bd, 0xf54e0ddf, 0x1a1cbb3e, 0xfb32b15a, 0x146007bb, 0xfee6dad9, 0x11b46c38, 0xc9689448, 0x263a22a9, 0xccbcffcb, 0x23ee492a, 0xc2c0434e, 0x2d92f5af, 0xc71428cd, 0x28469e2c, 0xde393a44, 0x316b8ca5, 0xdbed51c7, 0x34bfe726, 0xd591ed42, 0x3ac35ba3, 0xd04586c1, 0x3f173020, 0xae6be681, 0x41395060, 0xabbf8d02, 0x44ed3be3, 0xa5c33187, 0x4a918766, 0xa0175a04, 0x4f45ece5, 0xb93a488d, 0x5668fe6c, 0xbcee230e, 0x53bc95ef, 0xb2929f8b, 0x5dc0296a, 0xb746f408, 0x581442e9, 0x80c8ba99, 0x6f9a0c78, 0x851cd11a, 0x6a4e67fb, 0x8b606d9f, 0x6432db7e, 0x8eb4061c, 0x61e6b0fd, 0x97991495, 0x78cba274, 0x924d7f16, 0x7d1fc9f7, 0x9c31c393, 0x73637572, 0x99e5a810, 0x76b71ef1, 0xf32d5eb1, 0x1c7fe850, 0xf6f93532, 0x19ab83d3, 0xf88589b7, 0x17d73f56, 0xfd51e234, 0x120354d5, 0xe47cf0bd, 0x0b2e465c, 0xe1a89b3e, 0x0efa2ddf, 0xefd427bb, 0x0086915a, 0xea004c38, 0x0552fad9, 0xdd8e02a9, 0x32dcb448, 0xd85a692a, 0x3708dfcb, 0xd626d5af, 0x3974634e, 0xd3f2be2c, 0x3ca008cd, 0xcadfaca5, 0x258d1a44, 0xcf0bc726, 0x205971c7, 0xc1777ba3, 0x2e25cd42, 0xc4a31020, 0x2bf1a6c1, 0x14e696e1, 0xfbb42000, 0x1132fd62, 0xfe604b83, 0x1f4e41e7, 0xf01cf706, 0x1a9a2a64, 0xf5c89c85, 0x03b738ed, 0xece58e0c, 0x0663536e, 0xe931e58f, 0x081fefeb, 0xe74d590a, 0x0dcb8468, 0xe2993289, 0x3a45caf9, 0xd5177c18, 0x3f91a17a, 0xd0c3179b, 0x31ed1dff, 0xdebfab1e, 0x3439767c, 0xdb6bc09d, 0x2d1464f5, 0xc246d214, 0x28c00f76, 0xc792b997, 0x26bcb3f3, 0xc9ee0512, 0x2368d870, 0xcc3a6e91, 0x49a02ed1, 0xa6f29830, 0x4c744552, 0xa326f3b3, 0x4208f9d7, 0xad5a4f36, 0x47dc9254, 0xa88e24b5, 0x5ef180dd, 0xb1a3363c, 0x5b25eb5e, 0xb4775dbf, 0x555957db, 0xba0be13a, 0x508d3c58, 0xbfdf8ab9, 0x670372c9, 0x8851c428, 0x62d7194a, 0x8d85afab, 0x6caba5cf, 0x83f9132e, 0x697fce4c, 0x862d78ad, 0x7052dcc5, 0x9f006a24, 0x7586b746, 0x9ad401a7, 0x7bfa0bc3, 0x94a8bd22, 0x7e2e6040, 0x917cd6a1}, {0x00000000, 0x87a6cb43, 0xd43c90c7, 0x539a5b84, 0x730827cf, 0xf4aeec8c, 0xa734b708, 0x20927c4b, 0xe6104f9e, 0x61b684dd, 0x322cdf59, 0xb58a141a, 0x95186851, 0x12bea312, 0x4124f896, 0xc68233d5, 0x1751997d, 0x90f7523e, 0xc36d09ba, 0x44cbc2f9, 0x6459beb2, 0xe3ff75f1, 0xb0652e75, 0x37c3e536, 0xf141d6e3, 0x76e71da0, 0x257d4624, 0xa2db8d67, 0x8249f12c, 0x05ef3a6f, 0x567561eb, 0xd1d3aaa8, 0x2ea332fa, 0xa905f9b9, 0xfa9fa23d, 0x7d39697e, 0x5dab1535, 0xda0dde76, 0x899785f2, 0x0e314eb1, 0xc8b37d64, 0x4f15b627, 0x1c8feda3, 0x9b2926e0, 0xbbbb5aab, 0x3c1d91e8, 0x6f87ca6c, 0xe821012f, 0x39f2ab87, 0xbe5460c4, 0xedce3b40, 0x6a68f003, 0x4afa8c48, 0xcd5c470b, 0x9ec61c8f, 0x1960d7cc, 0xdfe2e419, 0x58442f5a, 0x0bde74de, 0x8c78bf9d, 0xaceac3d6, 0x2b4c0895, 0x78d65311, 0xff709852, 0x5d4665f4, 0xdae0aeb7, 0x897af533, 0x0edc3e70, 0x2e4e423b, 0xa9e88978, 0xfa72d2fc, 0x7dd419bf, 0xbb562a6a, 0x3cf0e129, 0x6f6abaad, 0xe8cc71ee, 0xc85e0da5, 0x4ff8c6e6, 0x1c629d62, 0x9bc45621, 0x4a17fc89, 0xcdb137ca, 0x9e2b6c4e, 0x198da70d, 0x391fdb46, 0xbeb91005, 0xed234b81, 0x6a8580c2, 0xac07b317, 0x2ba17854, 0x783b23d0, 0xff9de893, 0xdf0f94d8, 0x58a95f9b, 0x0b33041f, 0x8c95cf5c, 0x73e5570e, 0xf4439c4d, 0xa7d9c7c9, 0x207f0c8a, 0x00ed70c1, 0x874bbb82, 0xd4d1e006, 0x53772b45, 0x95f51890, 0x1253d3d3, 0x41c98857, 0xc66f4314, 0xe6fd3f5f, 0x615bf41c, 0x32c1af98, 0xb56764db, 0x64b4ce73, 0xe3120530, 0xb0885eb4, 0x372e95f7, 0x17bce9bc, 0x901a22ff, 0xc380797b, 0x4426b238, 0x82a481ed, 0x05024aae, 0x5698112a, 0xd13eda69, 0xf1aca622, 0x760a6d61, 0x259036e5, 0xa236fda6, 0xba8ccbe8, 0x3d2a00ab, 0x6eb05b2f, 0xe916906c, 0xc984ec27, 0x4e222764, 0x1db87ce0, 0x9a1eb7a3, 0x5c9c8476, 0xdb3a4f35, 0x88a014b1, 0x0f06dff2, 0x2f94a3b9, 0xa83268fa, 0xfba8337e, 0x7c0ef83d, 0xaddd5295, 0x2a7b99d6, 0x79e1c252, 0xfe470911, 0xded5755a, 0x5973be19, 0x0ae9e59d, 0x8d4f2ede, 0x4bcd1d0b, 0xcc6bd648, 0x9ff18dcc, 0x1857468f, 0x38c53ac4, 0xbf63f187, 0xecf9aa03, 0x6b5f6140, 0x942ff912, 0x13893251, 0x401369d5, 0xc7b5a296, 0xe727dedd, 0x6081159e, 0x331b4e1a, 0xb4bd8559, 0x723fb68c, 0xf5997dcf, 0xa603264b, 0x21a5ed08, 0x01379143, 0x86915a00, 0xd50b0184, 0x52adcac7, 0x837e606f, 0x04d8ab2c, 0x5742f0a8, 0xd0e43beb, 0xf07647a0, 0x77d08ce3, 0x244ad767, 0xa3ec1c24, 0x656e2ff1, 0xe2c8e4b2, 0xb152bf36, 0x36f47475, 0x1666083e, 0x91c0c37d, 0xc25a98f9, 0x45fc53ba, 0xe7caae1c, 0x606c655f, 0x33f63edb, 0xb450f598, 0x94c289d3, 0x13644290, 0x40fe1914, 0xc758d257, 0x01dae182, 0x867c2ac1, 0xd5e67145, 0x5240ba06, 0x72d2c64d, 0xf5740d0e, 0xa6ee568a, 0x21489dc9, 0xf09b3761, 0x773dfc22, 0x24a7a7a6, 0xa3016ce5, 0x839310ae, 0x0435dbed, 0x57af8069, 0xd0094b2a, 0x168b78ff, 0x912db3bc, 0xc2b7e838, 0x4511237b, 0x65835f30, 0xe2259473, 0xb1bfcff7, 0x361904b4, 0xc9699ce6, 0x4ecf57a5, 0x1d550c21, 0x9af3c762, 0xba61bb29, 0x3dc7706a, 0x6e5d2bee, 0xe9fbe0ad, 0x2f79d378, 0xa8df183b, 0xfb4543bf, 0x7ce388fc, 0x5c71f4b7, 0xdbd73ff4, 0x884d6470, 0x0febaf33, 0xde38059b, 0x599eced8, 0x0a04955c, 0x8da25e1f, 0xad302254, 0x2a96e917, 0x790cb293, 0xfeaa79d0, 0x38284a05, 0xbf8e8146, 0xec14dac2, 0x6bb21181, 0x4b206dca, 0xcc86a689, 0x9f1cfd0d, 0x18ba364e}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x0000000000000000, 0x43cba68700000000, 0xc7903cd400000000, 0x845b9a5300000000, 0xcf27087300000000, 0x8cecaef400000000, 0x08b734a700000000, 0x4b7c922000000000, 0x9e4f10e600000000, 0xdd84b66100000000, 0x59df2c3200000000, 0x1a148ab500000000, 0x5168189500000000, 0x12a3be1200000000, 0x96f8244100000000, 0xd53382c600000000, 0x7d99511700000000, 0x3e52f79000000000, 0xba096dc300000000, 0xf9c2cb4400000000, 0xb2be596400000000, 0xf175ffe300000000, 0x752e65b000000000, 0x36e5c33700000000, 0xe3d641f100000000, 0xa01de77600000000, 0x24467d2500000000, 0x678ddba200000000, 0x2cf1498200000000, 0x6f3aef0500000000, 0xeb61755600000000, 0xa8aad3d100000000, 0xfa32a32e00000000, 0xb9f905a900000000, 0x3da29ffa00000000, 0x7e69397d00000000, 0x3515ab5d00000000, 0x76de0dda00000000, 0xf285978900000000, 0xb14e310e00000000, 0x647db3c800000000, 0x27b6154f00000000, 0xa3ed8f1c00000000, 0xe026299b00000000, 0xab5abbbb00000000, 0xe8911d3c00000000, 0x6cca876f00000000, 0x2f0121e800000000, 0x87abf23900000000, 0xc46054be00000000, 0x403bceed00000000, 0x03f0686a00000000, 0x488cfa4a00000000, 0x0b475ccd00000000, 0x8f1cc69e00000000, 0xccd7601900000000, 0x19e4e2df00000000, 0x5a2f445800000000, 0xde74de0b00000000, 0x9dbf788c00000000, 0xd6c3eaac00000000, 0x95084c2b00000000, 0x1153d67800000000, 0x529870ff00000000, 0xf465465d00000000, 0xb7aee0da00000000, 0x33f57a8900000000, 0x703edc0e00000000, 0x3b424e2e00000000, 0x7889e8a900000000, 0xfcd272fa00000000, 0xbf19d47d00000000, 0x6a2a56bb00000000, 0x29e1f03c00000000, 0xadba6a6f00000000, 0xee71cce800000000, 0xa50d5ec800000000, 0xe6c6f84f00000000, 0x629d621c00000000, 0x2156c49b00000000, 0x89fc174a00000000, 0xca37b1cd00000000, 0x4e6c2b9e00000000, 0x0da78d1900000000, 0x46db1f3900000000, 0x0510b9be00000000, 0x814b23ed00000000, 0xc280856a00000000, 0x17b307ac00000000, 0x5478a12b00000000, 0xd0233b7800000000, 0x93e89dff00000000, 0xd8940fdf00000000, 0x9b5fa95800000000, 0x1f04330b00000000, 0x5ccf958c00000000, 0x0e57e57300000000, 0x4d9c43f400000000, 0xc9c7d9a700000000, 0x8a0c7f2000000000, 0xc170ed0000000000, 0x82bb4b8700000000, 0x06e0d1d400000000, 0x452b775300000000, 0x9018f59500000000, 0xd3d3531200000000, 0x5788c94100000000, 0x14436fc600000000, 0x5f3ffde600000000, 0x1cf45b6100000000, 0x98afc13200000000, 0xdb6467b500000000, 0x73ceb46400000000, 0x300512e300000000, 0xb45e88b000000000, 0xf7952e3700000000, 0xbce9bc1700000000, 0xff221a9000000000, 0x7b7980c300000000, 0x38b2264400000000, 0xed81a48200000000, 0xae4a020500000000, 0x2a11985600000000, 0x69da3ed100000000, 0x22a6acf100000000, 0x616d0a7600000000, 0xe536902500000000, 0xa6fd36a200000000, 0xe8cb8cba00000000, 0xab002a3d00000000, 0x2f5bb06e00000000, 0x6c9016e900000000, 0x27ec84c900000000, 0x6427224e00000000, 0xe07cb81d00000000, 0xa3b71e9a00000000, 0x76849c5c00000000, 0x354f3adb00000000, 0xb114a08800000000, 0xf2df060f00000000, 0xb9a3942f00000000, 0xfa6832a800000000, 0x7e33a8fb00000000, 0x3df80e7c00000000, 0x9552ddad00000000, 0xd6997b2a00000000, 0x52c2e17900000000, 0x110947fe00000000, 0x5a75d5de00000000, 0x19be735900000000, 0x9de5e90a00000000, 0xde2e4f8d00000000, 0x0b1dcd4b00000000, 0x48d66bcc00000000, 0xcc8df19f00000000, 0x8f46571800000000, 0xc43ac53800000000, 0x87f163bf00000000, 0x03aaf9ec00000000, 0x40615f6b00000000, 0x12f92f9400000000, 0x5132891300000000, 0xd569134000000000, 0x96a2b5c700000000, 0xddde27e700000000, 0x9e15816000000000, 0x1a4e1b3300000000, 0x5985bdb400000000, 0x8cb63f7200000000, 0xcf7d99f500000000, 0x4b2603a600000000, 0x08eda52100000000, 0x4391370100000000, 0x005a918600000000, 0x84010bd500000000, 0xc7caad5200000000, 0x6f607e8300000000, 0x2cabd80400000000, 0xa8f0425700000000, 0xeb3be4d000000000, 0xa04776f000000000, 0xe38cd07700000000, 0x67d74a2400000000, 0x241ceca300000000, 0xf12f6e6500000000, 0xb2e4c8e200000000, 0x36bf52b100000000, 0x7574f43600000000, 0x3e08661600000000, 0x7dc3c09100000000, 0xf9985ac200000000, 0xba53fc4500000000, 0x1caecae700000000, 0x5f656c6000000000, 0xdb3ef63300000000, 0x98f550b400000000, 0xd389c29400000000, 0x9042641300000000, 0x1419fe4000000000, 0x57d258c700000000, 0x82e1da0100000000, 0xc12a7c8600000000, 0x4571e6d500000000, 0x06ba405200000000, 0x4dc6d27200000000, 0x0e0d74f500000000, 0x8a56eea600000000, 0xc99d482100000000, 0x61379bf000000000, 0x22fc3d7700000000, 0xa6a7a72400000000, 0xe56c01a300000000, 0xae10938300000000, 0xeddb350400000000, 0x6980af5700000000, 0x2a4b09d000000000, 0xff788b1600000000, 0xbcb32d9100000000, 0x38e8b7c200000000, 0x7b23114500000000, 0x305f836500000000, 0x739425e200000000, 0xf7cfbfb100000000, 0xb404193600000000, 0xe69c69c900000000, 0xa557cf4e00000000, 0x210c551d00000000, 0x62c7f39a00000000, 0x29bb61ba00000000, 0x6a70c73d00000000, 0xee2b5d6e00000000, 0xade0fbe900000000, 0x78d3792f00000000, 0x3b18dfa800000000, 0xbf4345fb00000000, 0xfc88e37c00000000, 0xb7f4715c00000000, 0xf43fd7db00000000, 0x70644d8800000000, 0x33afeb0f00000000, 0x9b0538de00000000, 0xd8ce9e5900000000, 0x5c95040a00000000, 0x1f5ea28d00000000, 0x542230ad00000000, 0x17e9962a00000000, 0x93b20c7900000000, 0xd079aafe00000000, 0x054a283800000000, 0x46818ebf00000000, 0xc2da14ec00000000, 0x8111b26b00000000, 0xca6d204b00000000, 0x89a686cc00000000, 0x0dfd1c9f00000000, 0x4e36ba1800000000}, {0x0000000000000000, 0xe1b652ef00000000, 0x836bd40500000000, 0x62dd86ea00000000, 0x06d7a80b00000000, 0xe761fae400000000, 0x85bc7c0e00000000, 0x640a2ee100000000, 0x0cae511700000000, 0xed1803f800000000, 0x8fc5851200000000, 0x6e73d7fd00000000, 0x0a79f91c00000000, 0xebcfabf300000000, 0x89122d1900000000, 0x68a47ff600000000, 0x185ca32e00000000, 0xf9eaf1c100000000, 0x9b37772b00000000, 0x7a8125c400000000, 0x1e8b0b2500000000, 0xff3d59ca00000000, 0x9de0df2000000000, 0x7c568dcf00000000, 0x14f2f23900000000, 0xf544a0d600000000, 0x9799263c00000000, 0x762f74d300000000, 0x12255a3200000000, 0xf39308dd00000000, 0x914e8e3700000000, 0x70f8dcd800000000, 0x30b8465d00000000, 0xd10e14b200000000, 0xb3d3925800000000, 0x5265c0b700000000, 0x366fee5600000000, 0xd7d9bcb900000000, 0xb5043a5300000000, 0x54b268bc00000000, 0x3c16174a00000000, 0xdda045a500000000, 0xbf7dc34f00000000, 0x5ecb91a000000000, 0x3ac1bf4100000000, 0xdb77edae00000000, 0xb9aa6b4400000000, 0x581c39ab00000000, 0x28e4e57300000000, 0xc952b79c00000000, 0xab8f317600000000, 0x4a39639900000000, 0x2e334d7800000000, 0xcf851f9700000000, 0xad58997d00000000, 0x4ceecb9200000000, 0x244ab46400000000, 0xc5fce68b00000000, 0xa721606100000000, 0x4697328e00000000, 0x229d1c6f00000000, 0xc32b4e8000000000, 0xa1f6c86a00000000, 0x40409a8500000000, 0x60708dba00000000, 0x81c6df5500000000, 0xe31b59bf00000000, 0x02ad0b5000000000, 0x66a725b100000000, 0x8711775e00000000, 0xe5ccf1b400000000, 0x047aa35b00000000, 0x6cdedcad00000000, 0x8d688e4200000000, 0xefb508a800000000, 0x0e035a4700000000, 0x6a0974a600000000, 0x8bbf264900000000, 0xe962a0a300000000, 0x08d4f24c00000000, 0x782c2e9400000000, 0x999a7c7b00000000, 0xfb47fa9100000000, 0x1af1a87e00000000, 0x7efb869f00000000, 0x9f4dd47000000000, 0xfd90529a00000000, 0x1c26007500000000, 0x74827f8300000000, 0x95342d6c00000000, 0xf7e9ab8600000000, 0x165ff96900000000, 0x7255d78800000000, 0x93e3856700000000, 0xf13e038d00000000, 0x1088516200000000, 0x50c8cbe700000000, 0xb17e990800000000, 0xd3a31fe200000000, 0x32154d0d00000000, 0x561f63ec00000000, 0xb7a9310300000000, 0xd574b7e900000000, 0x34c2e50600000000, 0x5c669af000000000, 0xbdd0c81f00000000, 0xdf0d4ef500000000, 0x3ebb1c1a00000000, 0x5ab132fb00000000, 0xbb07601400000000, 0xd9dae6fe00000000, 0x386cb41100000000, 0x489468c900000000, 0xa9223a2600000000, 0xcbffbccc00000000, 0x2a49ee2300000000, 0x4e43c0c200000000, 0xaff5922d00000000, 0xcd2814c700000000, 0x2c9e462800000000, 0x443a39de00000000, 0xa58c6b3100000000, 0xc751eddb00000000, 0x26e7bf3400000000, 0x42ed91d500000000, 0xa35bc33a00000000, 0xc18645d000000000, 0x2030173f00000000, 0x81e66bae00000000, 0x6050394100000000, 0x028dbfab00000000, 0xe33bed4400000000, 0x8731c3a500000000, 0x6687914a00000000, 0x045a17a000000000, 0xe5ec454f00000000, 0x8d483ab900000000, 0x6cfe685600000000, 0x0e23eebc00000000, 0xef95bc5300000000, 0x8b9f92b200000000, 0x6a29c05d00000000, 0x08f446b700000000, 0xe942145800000000, 0x99bac88000000000, 0x780c9a6f00000000, 0x1ad11c8500000000, 0xfb674e6a00000000, 0x9f6d608b00000000, 0x7edb326400000000, 0x1c06b48e00000000, 0xfdb0e66100000000, 0x9514999700000000, 0x74a2cb7800000000, 0x167f4d9200000000, 0xf7c91f7d00000000, 0x93c3319c00000000, 0x7275637300000000, 0x10a8e59900000000, 0xf11eb77600000000, 0xb15e2df300000000, 0x50e87f1c00000000, 0x3235f9f600000000, 0xd383ab1900000000, 0xb78985f800000000, 0x563fd71700000000, 0x34e251fd00000000, 0xd554031200000000, 0xbdf07ce400000000, 0x5c462e0b00000000, 0x3e9ba8e100000000, 0xdf2dfa0e00000000, 0xbb27d4ef00000000, 0x5a91860000000000, 0x384c00ea00000000, 0xd9fa520500000000, 0xa9028edd00000000, 0x48b4dc3200000000, 0x2a695ad800000000, 0xcbdf083700000000, 0xafd526d600000000, 0x4e63743900000000, 0x2cbef2d300000000, 0xcd08a03c00000000, 0xa5acdfca00000000, 0x441a8d2500000000, 0x26c70bcf00000000, 0xc771592000000000, 0xa37b77c100000000, 0x42cd252e00000000, 0x2010a3c400000000, 0xc1a6f12b00000000, 0xe196e61400000000, 0x0020b4fb00000000, 0x62fd321100000000, 0x834b60fe00000000, 0xe7414e1f00000000, 0x06f71cf000000000, 0x642a9a1a00000000, 0x859cc8f500000000, 0xed38b70300000000, 0x0c8ee5ec00000000, 0x6e53630600000000, 0x8fe531e900000000, 0xebef1f0800000000, 0x0a594de700000000, 0x6884cb0d00000000, 0x893299e200000000, 0xf9ca453a00000000, 0x187c17d500000000, 0x7aa1913f00000000, 0x9b17c3d000000000, 0xff1ded3100000000, 0x1eabbfde00000000, 0x7c76393400000000, 0x9dc06bdb00000000, 0xf564142d00000000, 0x14d246c200000000, 0x760fc02800000000, 0x97b992c700000000, 0xf3b3bc2600000000, 0x1205eec900000000, 0x70d8682300000000, 0x916e3acc00000000, 0xd12ea04900000000, 0x3098f2a600000000, 0x5245744c00000000, 0xb3f326a300000000, 0xd7f9084200000000, 0x364f5aad00000000, 0x5492dc4700000000, 0xb5248ea800000000, 0xdd80f15e00000000, 0x3c36a3b100000000, 0x5eeb255b00000000, 0xbf5d77b400000000, 0xdb57595500000000, 0x3ae10bba00000000, 0x583c8d5000000000, 0xb98adfbf00000000, 0xc972036700000000, 0x28c4518800000000, 0x4a19d76200000000, 0xabaf858d00000000, 0xcfa5ab6c00000000, 0x2e13f98300000000, 0x4cce7f6900000000, 0xad782d8600000000, 0xc5dc527000000000, 0x246a009f00000000, 0x46b7867500000000, 0xa701d49a00000000, 0xc30bfa7b00000000, 0x22bda89400000000, 0x40602e7e00000000, 0xa1d67c9100000000}, {0x0000000000000000, 0x5880e2d700000000, 0xf106b47400000000, 0xa98656a300000000, 0xe20d68e900000000, 0xba8d8a3e00000000, 0x130bdc9d00000000, 0x4b8b3e4a00000000, 0x851da10900000000, 0xdd9d43de00000000, 0x741b157d00000000, 0x2c9bf7aa00000000, 0x6710c9e000000000, 0x3f902b3700000000, 0x96167d9400000000, 0xce969f4300000000, 0x0a3b421300000000, 0x52bba0c400000000, 0xfb3df66700000000, 0xa3bd14b000000000, 0xe8362afa00000000, 0xb0b6c82d00000000, 0x19309e8e00000000, 0x41b07c5900000000, 0x8f26e31a00000000, 0xd7a601cd00000000, 0x7e20576e00000000, 0x26a0b5b900000000, 0x6d2b8bf300000000, 0x35ab692400000000, 0x9c2d3f8700000000, 0xc4addd5000000000, 0x1476842600000000, 0x4cf666f100000000, 0xe570305200000000, 0xbdf0d28500000000, 0xf67beccf00000000, 0xaefb0e1800000000, 0x077d58bb00000000, 0x5ffdba6c00000000, 0x916b252f00000000, 0xc9ebc7f800000000, 0x606d915b00000000, 0x38ed738c00000000, 0x73664dc600000000, 0x2be6af1100000000, 0x8260f9b200000000, 0xdae01b6500000000, 0x1e4dc63500000000, 0x46cd24e200000000, 0xef4b724100000000, 0xb7cb909600000000, 0xfc40aedc00000000, 0xa4c04c0b00000000, 0x0d461aa800000000, 0x55c6f87f00000000, 0x9b50673c00000000, 0xc3d085eb00000000, 0x6a56d34800000000, 0x32d6319f00000000, 0x795d0fd500000000, 0x21dded0200000000, 0x885bbba100000000, 0xd0db597600000000, 0x28ec084d00000000, 0x706cea9a00000000, 0xd9eabc3900000000, 0x816a5eee00000000, 0xcae160a400000000, 0x9261827300000000, 0x3be7d4d000000000, 0x6367360700000000, 0xadf1a94400000000, 0xf5714b9300000000, 0x5cf71d3000000000, 0x0477ffe700000000, 0x4ffcc1ad00000000, 0x177c237a00000000, 0xbefa75d900000000, 0xe67a970e00000000, 0x22d74a5e00000000, 0x7a57a88900000000, 0xd3d1fe2a00000000, 0x8b511cfd00000000, 0xc0da22b700000000, 0x985ac06000000000, 0x31dc96c300000000, 0x695c741400000000, 0xa7caeb5700000000, 0xff4a098000000000, 0x56cc5f2300000000, 0x0e4cbdf400000000, 0x45c783be00000000, 0x1d47616900000000, 0xb4c137ca00000000, 0xec41d51d00000000, 0x3c9a8c6b00000000, 0x641a6ebc00000000, 0xcd9c381f00000000, 0x951cdac800000000, 0xde97e48200000000, 0x8617065500000000, 0x2f9150f600000000, 0x7711b22100000000, 0xb9872d6200000000, 0xe107cfb500000000, 0x4881991600000000, 0x10017bc100000000, 0x5b8a458b00000000, 0x030aa75c00000000, 0xaa8cf1ff00000000, 0xf20c132800000000, 0x36a1ce7800000000, 0x6e212caf00000000, 0xc7a77a0c00000000, 0x9f2798db00000000, 0xd4aca69100000000, 0x8c2c444600000000, 0x25aa12e500000000, 0x7d2af03200000000, 0xb3bc6f7100000000, 0xeb3c8da600000000, 0x42badb0500000000, 0x1a3a39d200000000, 0x51b1079800000000, 0x0931e54f00000000, 0xa0b7b3ec00000000, 0xf837513b00000000, 0x50d8119a00000000, 0x0858f34d00000000, 0xa1dea5ee00000000, 0xf95e473900000000, 0xb2d5797300000000, 0xea559ba400000000, 0x43d3cd0700000000, 0x1b532fd000000000, 0xd5c5b09300000000, 0x8d45524400000000, 0x24c304e700000000, 0x7c43e63000000000, 0x37c8d87a00000000, 0x6f483aad00000000, 0xc6ce6c0e00000000, 0x9e4e8ed900000000, 0x5ae3538900000000, 0x0263b15e00000000, 0xabe5e7fd00000000, 0xf365052a00000000, 0xb8ee3b6000000000, 0xe06ed9b700000000, 0x49e88f1400000000, 0x11686dc300000000, 0xdffef28000000000, 0x877e105700000000, 0x2ef846f400000000, 0x7678a42300000000, 0x3df39a6900000000, 0x657378be00000000, 0xccf52e1d00000000, 0x9475ccca00000000, 0x44ae95bc00000000, 0x1c2e776b00000000, 0xb5a821c800000000, 0xed28c31f00000000, 0xa6a3fd5500000000, 0xfe231f8200000000, 0x57a5492100000000, 0x0f25abf600000000, 0xc1b334b500000000, 0x9933d66200000000, 0x30b580c100000000, 0x6835621600000000, 0x23be5c5c00000000, 0x7b3ebe8b00000000, 0xd2b8e82800000000, 0x8a380aff00000000, 0x4e95d7af00000000, 0x1615357800000000, 0xbf9363db00000000, 0xe713810c00000000, 0xac98bf4600000000, 0xf4185d9100000000, 0x5d9e0b3200000000, 0x051ee9e500000000, 0xcb8876a600000000, 0x9308947100000000, 0x3a8ec2d200000000, 0x620e200500000000, 0x29851e4f00000000, 0x7105fc9800000000, 0xd883aa3b00000000, 0x800348ec00000000, 0x783419d700000000, 0x20b4fb0000000000, 0x8932ada300000000, 0xd1b24f7400000000, 0x9a39713e00000000, 0xc2b993e900000000, 0x6b3fc54a00000000, 0x33bf279d00000000, 0xfd29b8de00000000, 0xa5a95a0900000000, 0x0c2f0caa00000000, 0x54afee7d00000000, 0x1f24d03700000000, 0x47a432e000000000, 0xee22644300000000, 0xb6a2869400000000, 0x720f5bc400000000, 0x2a8fb91300000000, 0x8309efb000000000, 0xdb890d6700000000, 0x9002332d00000000, 0xc882d1fa00000000, 0x6104875900000000, 0x3984658e00000000, 0xf712facd00000000, 0xaf92181a00000000, 0x06144eb900000000, 0x5e94ac6e00000000, 0x151f922400000000, 0x4d9f70f300000000, 0xe419265000000000, 0xbc99c48700000000, 0x6c429df100000000, 0x34c27f2600000000, 0x9d44298500000000, 0xc5c4cb5200000000, 0x8e4ff51800000000, 0xd6cf17cf00000000, 0x7f49416c00000000, 0x27c9a3bb00000000, 0xe95f3cf800000000, 0xb1dfde2f00000000, 0x1859888c00000000, 0x40d96a5b00000000, 0x0b52541100000000, 0x53d2b6c600000000, 0xfa54e06500000000, 0xa2d402b200000000, 0x6679dfe200000000, 0x3ef93d3500000000, 0x977f6b9600000000, 0xcfff894100000000, 0x8474b70b00000000, 0xdcf455dc00000000, 0x7572037f00000000, 0x2df2e1a800000000, 0xe3647eeb00000000, 0xbbe49c3c00000000, 0x1262ca9f00000000, 0x4ae2284800000000, 0x0169160200000000, 0x59e9f4d500000000, 0xf06fa27600000000, 0xa8ef40a100000000}, {0x0000000000000000, 0x463b676500000000, 0x8c76ceca00000000, 0xca4da9af00000000, 0x59ebed4e00000000, 0x1fd08a2b00000000, 0xd59d238400000000, 0x93a644e100000000, 0xb2d6db9d00000000, 0xf4edbcf800000000, 0x3ea0155700000000, 0x789b723200000000, 0xeb3d36d300000000, 0xad0651b600000000, 0x674bf81900000000, 0x21709f7c00000000, 0x25abc6e000000000, 0x6390a18500000000, 0xa9dd082a00000000, 0xefe66f4f00000000, 0x7c402bae00000000, 0x3a7b4ccb00000000, 0xf036e56400000000, 0xb60d820100000000, 0x977d1d7d00000000, 0xd1467a1800000000, 0x1b0bd3b700000000, 0x5d30b4d200000000, 0xce96f03300000000, 0x88ad975600000000, 0x42e03ef900000000, 0x04db599c00000000, 0x0b50fc1a00000000, 0x4d6b9b7f00000000, 0x872632d000000000, 0xc11d55b500000000, 0x52bb115400000000, 0x1480763100000000, 0xdecddf9e00000000, 0x98f6b8fb00000000, 0xb986278700000000, 0xffbd40e200000000, 0x35f0e94d00000000, 0x73cb8e2800000000, 0xe06dcac900000000, 0xa656adac00000000, 0x6c1b040300000000, 0x2a20636600000000, 0x2efb3afa00000000, 0x68c05d9f00000000, 0xa28df43000000000, 0xe4b6935500000000, 0x7710d7b400000000, 0x312bb0d100000000, 0xfb66197e00000000, 0xbd5d7e1b00000000, 0x9c2de16700000000, 0xda16860200000000, 0x105b2fad00000000, 0x566048c800000000, 0xc5c60c2900000000, 0x83fd6b4c00000000, 0x49b0c2e300000000, 0x0f8ba58600000000, 0x16a0f83500000000, 0x509b9f5000000000, 0x9ad636ff00000000, 0xdced519a00000000, 0x4f4b157b00000000, 0x0970721e00000000, 0xc33ddbb100000000, 0x8506bcd400000000, 0xa47623a800000000, 0xe24d44cd00000000, 0x2800ed6200000000, 0x6e3b8a0700000000, 0xfd9dcee600000000, 0xbba6a98300000000, 0x71eb002c00000000, 0x37d0674900000000, 0x330b3ed500000000, 0x753059b000000000, 0xbf7df01f00000000, 0xf946977a00000000, 0x6ae0d39b00000000, 0x2cdbb4fe00000000, 0xe6961d5100000000, 0xa0ad7a3400000000, 0x81dde54800000000, 0xc7e6822d00000000, 0x0dab2b8200000000, 0x4b904ce700000000, 0xd836080600000000, 0x9e0d6f6300000000, 0x5440c6cc00000000, 0x127ba1a900000000, 0x1df0042f00000000, 0x5bcb634a00000000, 0x9186cae500000000, 0xd7bdad8000000000, 0x441be96100000000, 0x02208e0400000000, 0xc86d27ab00000000, 0x8e5640ce00000000, 0xaf26dfb200000000, 0xe91db8d700000000, 0x2350117800000000, 0x656b761d00000000, 0xf6cd32fc00000000, 0xb0f6559900000000, 0x7abbfc3600000000, 0x3c809b5300000000, 0x385bc2cf00000000, 0x7e60a5aa00000000, 0xb42d0c0500000000, 0xf2166b6000000000, 0x61b02f8100000000, 0x278b48e400000000, 0xedc6e14b00000000, 0xabfd862e00000000, 0x8a8d195200000000, 0xccb67e3700000000, 0x06fbd79800000000, 0x40c0b0fd00000000, 0xd366f41c00000000, 0x955d937900000000, 0x5f103ad600000000, 0x192b5db300000000, 0x2c40f16b00000000, 0x6a7b960e00000000, 0xa0363fa100000000, 0xe60d58c400000000, 0x75ab1c2500000000, 0x33907b4000000000, 0xf9ddd2ef00000000, 0xbfe6b58a00000000, 0x9e962af600000000, 0xd8ad4d9300000000, 0x12e0e43c00000000, 0x54db835900000000, 0xc77dc7b800000000, 0x8146a0dd00000000, 0x4b0b097200000000, 0x0d306e1700000000, 0x09eb378b00000000, 0x4fd050ee00000000, 0x859df94100000000, 0xc3a69e2400000000, 0x5000dac500000000, 0x163bbda000000000, 0xdc76140f00000000, 0x9a4d736a00000000, 0xbb3dec1600000000, 0xfd068b7300000000, 0x374b22dc00000000, 0x717045b900000000, 0xe2d6015800000000, 0xa4ed663d00000000, 0x6ea0cf9200000000, 0x289ba8f700000000, 0x27100d7100000000, 0x612b6a1400000000, 0xab66c3bb00000000, 0xed5da4de00000000, 0x7efbe03f00000000, 0x38c0875a00000000, 0xf28d2ef500000000, 0xb4b6499000000000, 0x95c6d6ec00000000, 0xd3fdb18900000000, 0x19b0182600000000, 0x5f8b7f4300000000, 0xcc2d3ba200000000, 0x8a165cc700000000, 0x405bf56800000000, 0x0660920d00000000, 0x02bbcb9100000000, 0x4480acf400000000, 0x8ecd055b00000000, 0xc8f6623e00000000, 0x5b5026df00000000, 0x1d6b41ba00000000, 0xd726e81500000000, 0x911d8f7000000000, 0xb06d100c00000000, 0xf656776900000000, 0x3c1bdec600000000, 0x7a20b9a300000000, 0xe986fd4200000000, 0xafbd9a2700000000, 0x65f0338800000000, 0x23cb54ed00000000, 0x3ae0095e00000000, 0x7cdb6e3b00000000, 0xb696c79400000000, 0xf0ada0f100000000, 0x630be41000000000, 0x2530837500000000, 0xef7d2ada00000000, 0xa9464dbf00000000, 0x8836d2c300000000, 0xce0db5a600000000, 0x04401c0900000000, 0x427b7b6c00000000, 0xd1dd3f8d00000000, 0x97e658e800000000, 0x5dabf14700000000, 0x1b90962200000000, 0x1f4bcfbe00000000, 0x5970a8db00000000, 0x933d017400000000, 0xd506661100000000, 0x46a022f000000000, 0x009b459500000000, 0xcad6ec3a00000000, 0x8ced8b5f00000000, 0xad9d142300000000, 0xeba6734600000000, 0x21ebdae900000000, 0x67d0bd8c00000000, 0xf476f96d00000000, 0xb24d9e0800000000, 0x780037a700000000, 0x3e3b50c200000000, 0x31b0f54400000000, 0x778b922100000000, 0xbdc63b8e00000000, 0xfbfd5ceb00000000, 0x685b180a00000000, 0x2e607f6f00000000, 0xe42dd6c000000000, 0xa216b1a500000000, 0x83662ed900000000, 0xc55d49bc00000000, 0x0f10e01300000000, 0x492b877600000000, 0xda8dc39700000000, 0x9cb6a4f200000000, 0x56fb0d5d00000000, 0x10c06a3800000000, 0x141b33a400000000, 0x522054c100000000, 0x986dfd6e00000000, 0xde569a0b00000000, 0x4df0deea00000000, 0x0bcbb98f00000000, 0xc186102000000000, 0x87bd774500000000, 0xa6cde83900000000, 0xe0f68f5c00000000, 0x2abb26f300000000, 0x6c80419600000000, 0xff26057700000000, 0xb91d621200000000, 0x7350cbbd00000000, 0x356bacd800000000}, {0x0000000000000000, 0x9e83da9f00000000, 0x7d01c4e400000000, 0xe3821e7b00000000, 0xbb04f91200000000, 0x2587238d00000000, 0xc6053df600000000, 0x5886e76900000000, 0x7609f22500000000, 0xe88a28ba00000000, 0x0b0836c100000000, 0x958bec5e00000000, 0xcd0d0b3700000000, 0x538ed1a800000000, 0xb00ccfd300000000, 0x2e8f154c00000000, 0xec12e44b00000000, 0x72913ed400000000, 0x911320af00000000, 0x0f90fa3000000000, 0x57161d5900000000, 0xc995c7c600000000, 0x2a17d9bd00000000, 0xb494032200000000, 0x9a1b166e00000000, 0x0498ccf100000000, 0xe71ad28a00000000, 0x7999081500000000, 0x211fef7c00000000, 0xbf9c35e300000000, 0x5c1e2b9800000000, 0xc29df10700000000, 0xd825c89700000000, 0x46a6120800000000, 0xa5240c7300000000, 0x3ba7d6ec00000000, 0x6321318500000000, 0xfda2eb1a00000000, 0x1e20f56100000000, 0x80a32ffe00000000, 0xae2c3ab200000000, 0x30afe02d00000000, 0xd32dfe5600000000, 0x4dae24c900000000, 0x1528c3a000000000, 0x8bab193f00000000, 0x6829074400000000, 0xf6aadddb00000000, 0x34372cdc00000000, 0xaab4f64300000000, 0x4936e83800000000, 0xd7b532a700000000, 0x8f33d5ce00000000, 0x11b00f5100000000, 0xf232112a00000000, 0x6cb1cbb500000000, 0x423edef900000000, 0xdcbd046600000000, 0x3f3f1a1d00000000, 0xa1bcc08200000000, 0xf93a27eb00000000, 0x67b9fd7400000000, 0x843be30f00000000, 0x1ab8399000000000, 0xf14de1f400000000, 0x6fce3b6b00000000, 0x8c4c251000000000, 0x12cfff8f00000000, 0x4a4918e600000000, 0xd4cac27900000000, 0x3748dc0200000000, 0xa9cb069d00000000, 0x874413d100000000, 0x19c7c94e00000000, 0xfa45d73500000000, 0x64c60daa00000000, 0x3c40eac300000000, 0xa2c3305c00000000, 0x41412e2700000000, 0xdfc2f4b800000000, 0x1d5f05bf00000000, 0x83dcdf2000000000, 0x605ec15b00000000, 0xfedd1bc400000000, 0xa65bfcad00000000, 0x38d8263200000000, 0xdb5a384900000000, 0x45d9e2d600000000, 0x6b56f79a00000000, 0xf5d52d0500000000, 0x1657337e00000000, 0x88d4e9e100000000, 0xd0520e8800000000, 0x4ed1d41700000000, 0xad53ca6c00000000, 0x33d010f300000000, 0x2968296300000000, 0xb7ebf3fc00000000, 0x5469ed8700000000, 0xcaea371800000000, 0x926cd07100000000, 0x0cef0aee00000000, 0xef6d149500000000, 0x71eece0a00000000, 0x5f61db4600000000, 0xc1e201d900000000, 0x22601fa200000000, 0xbce3c53d00000000, 0xe465225400000000, 0x7ae6f8cb00000000, 0x9964e6b000000000, 0x07e73c2f00000000, 0xc57acd2800000000, 0x5bf917b700000000, 0xb87b09cc00000000, 0x26f8d35300000000, 0x7e7e343a00000000, 0xe0fdeea500000000, 0x037ff0de00000000, 0x9dfc2a4100000000, 0xb3733f0d00000000, 0x2df0e59200000000, 0xce72fbe900000000, 0x50f1217600000000, 0x0877c61f00000000, 0x96f41c8000000000, 0x757602fb00000000, 0xebf5d86400000000, 0xa39db33200000000, 0x3d1e69ad00000000, 0xde9c77d600000000, 0x401fad4900000000, 0x18994a2000000000, 0x861a90bf00000000, 0x65988ec400000000, 0xfb1b545b00000000, 0xd594411700000000, 0x4b179b8800000000, 0xa89585f300000000, 0x36165f6c00000000, 0x6e90b80500000000, 0xf013629a00000000, 0x13917ce100000000, 0x8d12a67e00000000, 0x4f8f577900000000, 0xd10c8de600000000, 0x328e939d00000000, 0xac0d490200000000, 0xf48bae6b00000000, 0x6a0874f400000000, 0x898a6a8f00000000, 0x1709b01000000000, 0x3986a55c00000000, 0xa7057fc300000000, 0x448761b800000000, 0xda04bb2700000000, 0x82825c4e00000000, 0x1c0186d100000000, 0xff8398aa00000000, 0x6100423500000000, 0x7bb87ba500000000, 0xe53ba13a00000000, 0x06b9bf4100000000, 0x983a65de00000000, 0xc0bc82b700000000, 0x5e3f582800000000, 0xbdbd465300000000, 0x233e9ccc00000000, 0x0db1898000000000, 0x9332531f00000000, 0x70b04d6400000000, 0xee3397fb00000000, 0xb6b5709200000000, 0x2836aa0d00000000, 0xcbb4b47600000000, 0x55376ee900000000, 0x97aa9fee00000000, 0x0929457100000000, 0xeaab5b0a00000000, 0x7428819500000000, 0x2cae66fc00000000, 0xb22dbc6300000000, 0x51afa21800000000, 0xcf2c788700000000, 0xe1a36dcb00000000, 0x7f20b75400000000, 0x9ca2a92f00000000, 0x022173b000000000, 0x5aa794d900000000, 0xc4244e4600000000, 0x27a6503d00000000, 0xb9258aa200000000, 0x52d052c600000000, 0xcc53885900000000, 0x2fd1962200000000, 0xb1524cbd00000000, 0xe9d4abd400000000, 0x7757714b00000000, 0x94d56f3000000000, 0x0a56b5af00000000, 0x24d9a0e300000000, 0xba5a7a7c00000000, 0x59d8640700000000, 0xc75bbe9800000000, 0x9fdd59f100000000, 0x015e836e00000000, 0xe2dc9d1500000000, 0x7c5f478a00000000, 0xbec2b68d00000000, 0x20416c1200000000, 0xc3c3726900000000, 0x5d40a8f600000000, 0x05c64f9f00000000, 0x9b45950000000000, 0x78c78b7b00000000, 0xe64451e400000000, 0xc8cb44a800000000, 0x56489e3700000000, 0xb5ca804c00000000, 0x2b495ad300000000, 0x73cfbdba00000000, 0xed4c672500000000, 0x0ece795e00000000, 0x904da3c100000000, 0x8af59a5100000000, 0x147640ce00000000, 0xf7f45eb500000000, 0x6977842a00000000, 0x31f1634300000000, 0xaf72b9dc00000000, 0x4cf0a7a700000000, 0xd2737d3800000000, 0xfcfc687400000000, 0x627fb2eb00000000, 0x81fdac9000000000, 0x1f7e760f00000000, 0x47f8916600000000, 0xd97b4bf900000000, 0x3af9558200000000, 0xa47a8f1d00000000, 0x66e77e1a00000000, 0xf864a48500000000, 0x1be6bafe00000000, 0x8565606100000000, 0xdde3870800000000, 0x43605d9700000000, 0xa0e243ec00000000, 0x3e61997300000000, 0x10ee8c3f00000000, 0x8e6d56a000000000, 0x6def48db00000000, 0xf36c924400000000, 0xabea752d00000000, 0x3569afb200000000, 0xd6ebb1c900000000, 0x48686b5600000000}, {0x0000000000000000, 0xc064281700000000, 0x80c9502e00000000, 0x40ad783900000000, 0x0093a15c00000000, 0xc0f7894b00000000, 0x805af17200000000, 0x403ed96500000000, 0x002643b900000000, 0xc0426bae00000000, 0x80ef139700000000, 0x408b3b8000000000, 0x00b5e2e500000000, 0xc0d1caf200000000, 0x807cb2cb00000000, 0x40189adc00000000, 0x414af7a900000000, 0x812edfbe00000000, 0xc183a78700000000, 0x01e78f9000000000, 0x41d956f500000000, 0x81bd7ee200000000, 0xc11006db00000000, 0x01742ecc00000000, 0x416cb41000000000, 0x81089c0700000000, 0xc1a5e43e00000000, 0x01c1cc2900000000, 0x41ff154c00000000, 0x819b3d5b00000000, 0xc136456200000000, 0x01526d7500000000, 0xc3929f8800000000, 0x03f6b79f00000000, 0x435bcfa600000000, 0x833fe7b100000000, 0xc3013ed400000000, 0x036516c300000000, 0x43c86efa00000000, 0x83ac46ed00000000, 0xc3b4dc3100000000, 0x03d0f42600000000, 0x437d8c1f00000000, 0x8319a40800000000, 0xc3277d6d00000000, 0x0343557a00000000, 0x43ee2d4300000000, 0x838a055400000000, 0x82d8682100000000, 0x42bc403600000000, 0x0211380f00000000, 0xc275101800000000, 0x824bc97d00000000, 0x422fe16a00000000, 0x0282995300000000, 0xc2e6b14400000000, 0x82fe2b9800000000, 0x429a038f00000000, 0x02377bb600000000, 0xc25353a100000000, 0x826d8ac400000000, 0x4209a2d300000000, 0x02a4daea00000000, 0xc2c0f2fd00000000, 0xc7234eca00000000, 0x074766dd00000000, 0x47ea1ee400000000, 0x878e36f300000000, 0xc7b0ef9600000000, 0x07d4c78100000000, 0x4779bfb800000000, 0x871d97af00000000, 0xc7050d7300000000, 0x0761256400000000, 0x47cc5d5d00000000, 0x87a8754a00000000, 0xc796ac2f00000000, 0x07f2843800000000, 0x475ffc0100000000, 0x873bd41600000000, 0x8669b96300000000, 0x460d917400000000, 0x06a0e94d00000000, 0xc6c4c15a00000000, 0x86fa183f00000000, 0x469e302800000000, 0x0633481100000000, 0xc657600600000000, 0x864ffada00000000, 0x462bd2cd00000000, 0x0686aaf400000000, 0xc6e282e300000000, 0x86dc5b8600000000, 0x46b8739100000000, 0x06150ba800000000, 0xc67123bf00000000, 0x04b1d14200000000, 0xc4d5f95500000000, 0x8478816c00000000, 0x441ca97b00000000, 0x0422701e00000000, 0xc446580900000000, 0x84eb203000000000, 0x448f082700000000, 0x049792fb00000000, 0xc4f3baec00000000, 0x845ec2d500000000, 0x443aeac200000000, 0x040433a700000000, 0xc4601bb000000000, 0x84cd638900000000, 0x44a94b9e00000000, 0x45fb26eb00000000, 0x859f0efc00000000, 0xc53276c500000000, 0x05565ed200000000, 0x456887b700000000, 0x850cafa000000000, 0xc5a1d79900000000, 0x05c5ff8e00000000, 0x45dd655200000000, 0x85b94d4500000000, 0xc514357c00000000, 0x05701d6b00000000, 0x454ec40e00000000, 0x852aec1900000000, 0xc587942000000000, 0x05e3bc3700000000, 0xcf41ed4f00000000, 0x0f25c55800000000, 0x4f88bd6100000000, 0x8fec957600000000, 0xcfd24c1300000000, 0x0fb6640400000000, 0x4f1b1c3d00000000, 0x8f7f342a00000000, 0xcf67aef600000000, 0x0f0386e100000000, 0x4faefed800000000, 0x8fcad6cf00000000, 0xcff40faa00000000, 0x0f9027bd00000000, 0x4f3d5f8400000000, 0x8f59779300000000, 0x8e0b1ae600000000, 0x4e6f32f100000000, 0x0ec24ac800000000, 0xcea662df00000000, 0x8e98bbba00000000, 0x4efc93ad00000000, 0x0e51eb9400000000, 0xce35c38300000000, 0x8e2d595f00000000, 0x4e49714800000000, 0x0ee4097100000000, 0xce80216600000000, 0x8ebef80300000000, 0x4edad01400000000, 0x0e77a82d00000000, 0xce13803a00000000, 0x0cd372c700000000, 0xccb75ad000000000, 0x8c1a22e900000000, 0x4c7e0afe00000000, 0x0c40d39b00000000, 0xcc24fb8c00000000, 0x8c8983b500000000, 0x4cedaba200000000, 0x0cf5317e00000000, 0xcc91196900000000, 0x8c3c615000000000, 0x4c58494700000000, 0x0c66902200000000, 0xcc02b83500000000, 0x8cafc00c00000000, 0x4ccbe81b00000000, 0x4d99856e00000000, 0x8dfdad7900000000, 0xcd50d54000000000, 0x0d34fd5700000000, 0x4d0a243200000000, 0x8d6e0c2500000000, 0xcdc3741c00000000, 0x0da75c0b00000000, 0x4dbfc6d700000000, 0x8ddbeec000000000, 0xcd7696f900000000, 0x0d12beee00000000, 0x4d2c678b00000000, 0x8d484f9c00000000, 0xcde537a500000000, 0x0d811fb200000000, 0x0862a38500000000, 0xc8068b9200000000, 0x88abf3ab00000000, 0x48cfdbbc00000000, 0x08f102d900000000, 0xc8952ace00000000, 0x883852f700000000, 0x485c7ae000000000, 0x0844e03c00000000, 0xc820c82b00000000, 0x888db01200000000, 0x48e9980500000000, 0x08d7416000000000, 0xc8b3697700000000, 0x881e114e00000000, 0x487a395900000000, 0x4928542c00000000, 0x894c7c3b00000000, 0xc9e1040200000000, 0x09852c1500000000, 0x49bbf57000000000, 0x89dfdd6700000000, 0xc972a55e00000000, 0x09168d4900000000, 0x490e179500000000, 0x896a3f8200000000, 0xc9c747bb00000000, 0x09a36fac00000000, 0x499db6c900000000, 0x89f99ede00000000, 0xc954e6e700000000, 0x0930cef000000000, 0xcbf03c0d00000000, 0x0b94141a00000000, 0x4b396c2300000000, 0x8b5d443400000000, 0xcb639d5100000000, 0x0b07b54600000000, 0x4baacd7f00000000, 0x8bcee56800000000, 0xcbd67fb400000000, 0x0bb257a300000000, 0x4b1f2f9a00000000, 0x8b7b078d00000000, 0xcb45dee800000000, 0x0b21f6ff00000000, 0x4b8c8ec600000000, 0x8be8a6d100000000, 0x8abacba400000000, 0x4adee3b300000000, 0x0a739b8a00000000, 0xca17b39d00000000, 0x8a296af800000000, 0x4a4d42ef00000000, 0x0ae03ad600000000, 0xca8412c100000000, 0x8a9c881d00000000, 0x4af8a00a00000000, 0x0a55d83300000000, 0xca31f02400000000, 0x8a0f294100000000, 0x4a6b015600000000, 0x0ac6796f00000000, 0xcaa2517800000000}, {0x0000000000000000, 0xd4ea739b00000000, 0xe9d396ed00000000, 0x3d39e57600000000, 0x93a15c0000000000, 0x474b2f9b00000000, 0x7a72caed00000000, 0xae98b97600000000, 0x2643b90000000000, 0xf2a9ca9b00000000, 0xcf902fed00000000, 0x1b7a5c7600000000, 0xb5e2e50000000000, 0x6108969b00000000, 0x5c3173ed00000000, 0x88db007600000000, 0x4c86720100000000, 0x986c019a00000000, 0xa555e4ec00000000, 0x71bf977700000000, 0xdf272e0100000000, 0x0bcd5d9a00000000, 0x36f4b8ec00000000, 0xe21ecb7700000000, 0x6ac5cb0100000000, 0xbe2fb89a00000000, 0x83165dec00000000, 0x57fc2e7700000000, 0xf964970100000000, 0x2d8ee49a00000000, 0x10b701ec00000000, 0xc45d727700000000, 0x980ce50200000000, 0x4ce6969900000000, 0x71df73ef00000000, 0xa535007400000000, 0x0badb90200000000, 0xdf47ca9900000000, 0xe27e2fef00000000, 0x36945c7400000000, 0xbe4f5c0200000000, 0x6aa52f9900000000, 0x579ccaef00000000, 0x8376b97400000000, 0x2dee000200000000, 0xf904739900000000, 0xc43d96ef00000000, 0x10d7e57400000000, 0xd48a970300000000, 0x0060e49800000000, 0x3d5901ee00000000, 0xe9b3727500000000, 0x472bcb0300000000, 0x93c1b89800000000, 0xaef85dee00000000, 0x7a122e7500000000, 0xf2c92e0300000000, 0x26235d9800000000, 0x1b1ab8ee00000000, 0xcff0cb7500000000, 0x6168720300000000, 0xb582019800000000, 0x88bbe4ee00000000, 0x5c51977500000000, 0x3019ca0500000000, 0xe4f3b99e00000000, 0xd9ca5ce800000000, 0x0d202f7300000000, 0xa3b8960500000000, 0x7752e59e00000000, 0x4a6b00e800000000, 0x9e81737300000000, 0x165a730500000000, 0xc2b0009e00000000, 0xff89e5e800000000, 0x2b63967300000000, 0x85fb2f0500000000, 0x51115c9e00000000, 0x6c28b9e800000000, 0xb8c2ca7300000000, 0x7c9fb80400000000, 0xa875cb9f00000000, 0x954c2ee900000000, 0x41a65d7200000000, 0xef3ee40400000000, 0x3bd4979f00000000, 0x06ed72e900000000, 0xd207017200000000, 0x5adc010400000000, 0x8e36729f00000000, 0xb30f97e900000000, 0x67e5e47200000000, 0xc97d5d0400000000, 0x1d972e9f00000000, 0x20aecbe900000000, 0xf444b87200000000, 0xa8152f0700000000, 0x7cff5c9c00000000, 0x41c6b9ea00000000, 0x952cca7100000000, 0x3bb4730700000000, 0xef5e009c00000000, 0xd267e5ea00000000, 0x068d967100000000, 0x8e56960700000000, 0x5abce59c00000000, 0x678500ea00000000, 0xb36f737100000000, 0x1df7ca0700000000, 0xc91db99c00000000, 0xf4245cea00000000, 0x20ce2f7100000000, 0xe4935d0600000000, 0x30792e9d00000000, 0x0d40cbeb00000000, 0xd9aab87000000000, 0x7732010600000000, 0xa3d8729d00000000, 0x9ee197eb00000000, 0x4a0be47000000000, 0xc2d0e40600000000, 0x163a979d00000000, 0x2b0372eb00000000, 0xffe9017000000000, 0x5171b80600000000, 0x859bcb9d00000000, 0xb8a22eeb00000000, 0x6c485d7000000000, 0x6032940b00000000, 0xb4d8e79000000000, 0x89e102e600000000, 0x5d0b717d00000000, 0xf393c80b00000000, 0x2779bb9000000000, 0x1a405ee600000000, 0xceaa2d7d00000000, 0x46712d0b00000000, 0x929b5e9000000000, 0xafa2bbe600000000, 0x7b48c87d00000000, 0xd5d0710b00000000, 0x013a029000000000, 0x3c03e7e600000000, 0xe8e9947d00000000, 0x2cb4e60a00000000, 0xf85e959100000000, 0xc56770e700000000, 0x118d037c00000000, 0xbf15ba0a00000000, 0x6bffc99100000000, 0x56c62ce700000000, 0x822c5f7c00000000, 0x0af75f0a00000000, 0xde1d2c9100000000, 0xe324c9e700000000, 0x37ceba7c00000000, 0x9956030a00000000, 0x4dbc709100000000, 0x708595e700000000, 0xa46fe67c00000000, 0xf83e710900000000, 0x2cd4029200000000, 0x11ede7e400000000, 0xc507947f00000000, 0x6b9f2d0900000000, 0xbf755e9200000000, 0x824cbbe400000000, 0x56a6c87f00000000, 0xde7dc80900000000, 0x0a97bb9200000000, 0x37ae5ee400000000, 0xe3442d7f00000000, 0x4ddc940900000000, 0x9936e79200000000, 0xa40f02e400000000, 0x70e5717f00000000, 0xb4b8030800000000, 0x6052709300000000, 0x5d6b95e500000000, 0x8981e67e00000000, 0x27195f0800000000, 0xf3f32c9300000000, 0xcecac9e500000000, 0x1a20ba7e00000000, 0x92fbba0800000000, 0x4611c99300000000, 0x7b282ce500000000, 0xafc25f7e00000000, 0x015ae60800000000, 0xd5b0959300000000, 0xe88970e500000000, 0x3c63037e00000000, 0x502b5e0e00000000, 0x84c12d9500000000, 0xb9f8c8e300000000, 0x6d12bb7800000000, 0xc38a020e00000000, 0x1760719500000000, 0x2a5994e300000000, 0xfeb3e77800000000, 0x7668e70e00000000, 0xa282949500000000, 0x9fbb71e300000000, 0x4b51027800000000, 0xe5c9bb0e00000000, 0x3123c89500000000, 0x0c1a2de300000000, 0xd8f05e7800000000, 0x1cad2c0f00000000, 0xc8475f9400000000, 0xf57ebae200000000, 0x2194c97900000000, 0x8f0c700f00000000, 0x5be6039400000000, 0x66dfe6e200000000, 0xb235957900000000, 0x3aee950f00000000, 0xee04e69400000000, 0xd33d03e200000000, 0x07d7707900000000, 0xa94fc90f00000000, 0x7da5ba9400000000, 0x409c5fe200000000, 0x94762c7900000000, 0xc827bb0c00000000, 0x1ccdc89700000000, 0x21f42de100000000, 0xf51e5e7a00000000, 0x5b86e70c00000000, 0x8f6c949700000000, 0xb25571e100000000, 0x66bf027a00000000, 0xee64020c00000000, 0x3a8e719700000000, 0x07b794e100000000, 0xd35de77a00000000, 0x7dc55e0c00000000, 0xa92f2d9700000000, 0x9416c8e100000000, 0x40fcbb7a00000000, 0x84a1c90d00000000, 0x504bba9600000000, 0x6d725fe000000000, 0xb9982c7b00000000, 0x1700950d00000000, 0xc3eae69600000000, 0xfed303e000000000, 0x2a39707b00000000, 0xa2e2700d00000000, 0x7608039600000000, 0x4b31e6e000000000, 0x9fdb957b00000000, 0x31432c0d00000000, 0xe5a95f9600000000, 0xd890bae000000000, 0x0c7ac97b00000000}, {0x0000000000000000, 0x2765258100000000, 0x0fcc3bd900000000, 0x28a91e5800000000, 0x5f9e066900000000, 0x78fb23e800000000, 0x50523db000000000, 0x7737183100000000, 0xbe3c0dd200000000, 0x9959285300000000, 0xb1f0360b00000000, 0x9695138a00000000, 0xe1a20bbb00000000, 0xc6c72e3a00000000, 0xee6e306200000000, 0xc90b15e300000000, 0x3d7f6b7f00000000, 0x1a1a4efe00000000, 0x32b350a600000000, 0x15d6752700000000, 0x62e16d1600000000, 0x4584489700000000, 0x6d2d56cf00000000, 0x4a48734e00000000, 0x834366ad00000000, 0xa426432c00000000, 0x8c8f5d7400000000, 0xabea78f500000000, 0xdcdd60c400000000, 0xfbb8454500000000, 0xd3115b1d00000000, 0xf4747e9c00000000, 0x7afed6fe00000000, 0x5d9bf37f00000000, 0x7532ed2700000000, 0x5257c8a600000000, 0x2560d09700000000, 0x0205f51600000000, 0x2aaceb4e00000000, 0x0dc9cecf00000000, 0xc4c2db2c00000000, 0xe3a7fead00000000, 0xcb0ee0f500000000, 0xec6bc57400000000, 0x9b5cdd4500000000, 0xbc39f8c400000000, 0x9490e69c00000000, 0xb3f5c31d00000000, 0x4781bd8100000000, 0x60e4980000000000, 0x484d865800000000, 0x6f28a3d900000000, 0x181fbbe800000000, 0x3f7a9e6900000000, 0x17d3803100000000, 0x30b6a5b000000000, 0xf9bdb05300000000, 0xded895d200000000, 0xf6718b8a00000000, 0xd114ae0b00000000, 0xa623b63a00000000, 0x814693bb00000000, 0xa9ef8de300000000, 0x8e8aa86200000000, 0xb5fadc2600000000, 0x929ff9a700000000, 0xba36e7ff00000000, 0x9d53c27e00000000, 0xea64da4f00000000, 0xcd01ffce00000000, 0xe5a8e19600000000, 0xc2cdc41700000000, 0x0bc6d1f400000000, 0x2ca3f47500000000, 0x040aea2d00000000, 0x236fcfac00000000, 0x5458d79d00000000, 0x733df21c00000000, 0x5b94ec4400000000, 0x7cf1c9c500000000, 0x8885b75900000000, 0xafe092d800000000, 0x87498c8000000000, 0xa02ca90100000000, 0xd71bb13000000000, 0xf07e94b100000000, 0xd8d78ae900000000, 0xffb2af6800000000, 0x36b9ba8b00000000, 0x11dc9f0a00000000, 0x3975815200000000, 0x1e10a4d300000000, 0x6927bce200000000, 0x4e42996300000000, 0x66eb873b00000000, 0x418ea2ba00000000, 0xcf040ad800000000, 0xe8612f5900000000, 0xc0c8310100000000, 0xe7ad148000000000, 0x909a0cb100000000, 0xb7ff293000000000, 0x9f56376800000000, 0xb83312e900000000, 0x7138070a00000000, 0x565d228b00000000, 0x7ef43cd300000000, 0x5991195200000000, 0x2ea6016300000000, 0x09c324e200000000, 0x216a3aba00000000, 0x060f1f3b00000000, 0xf27b61a700000000, 0xd51e442600000000, 0xfdb75a7e00000000, 0xdad27fff00000000, 0xade567ce00000000, 0x8a80424f00000000, 0xa2295c1700000000, 0x854c799600000000, 0x4c476c7500000000, 0x6b2249f400000000, 0x438b57ac00000000, 0x64ee722d00000000, 0x13d96a1c00000000, 0x34bc4f9d00000000, 0x1c1551c500000000, 0x3b70744400000000, 0x6af5b94d00000000, 0x4d909ccc00000000, 0x6539829400000000, 0x425ca71500000000, 0x356bbf2400000000, 0x120e9aa500000000, 0x3aa784fd00000000, 0x1dc2a17c00000000, 0xd4c9b49f00000000, 0xf3ac911e00000000, 0xdb058f4600000000, 0xfc60aac700000000, 0x8b57b2f600000000, 0xac32977700000000, 0x849b892f00000000, 0xa3feacae00000000, 0x578ad23200000000, 0x70eff7b300000000, 0x5846e9eb00000000, 0x7f23cc6a00000000, 0x0814d45b00000000, 0x2f71f1da00000000, 0x07d8ef8200000000, 0x20bdca0300000000, 0xe9b6dfe000000000, 0xced3fa6100000000, 0xe67ae43900000000, 0xc11fc1b800000000, 0xb628d98900000000, 0x914dfc0800000000, 0xb9e4e25000000000, 0x9e81c7d100000000, 0x100b6fb300000000, 0x376e4a3200000000, 0x1fc7546a00000000, 0x38a271eb00000000, 0x4f9569da00000000, 0x68f04c5b00000000, 0x4059520300000000, 0x673c778200000000, 0xae37626100000000, 0x895247e000000000, 0xa1fb59b800000000, 0x869e7c3900000000, 0xf1a9640800000000, 0xd6cc418900000000, 0xfe655fd100000000, 0xd9007a5000000000, 0x2d7404cc00000000, 0x0a11214d00000000, 0x22b83f1500000000, 0x05dd1a9400000000, 0x72ea02a500000000, 0x558f272400000000, 0x7d26397c00000000, 0x5a431cfd00000000, 0x9348091e00000000, 0xb42d2c9f00000000, 0x9c8432c700000000, 0xbbe1174600000000, 0xccd60f7700000000, 0xebb32af600000000, 0xc31a34ae00000000, 0xe47f112f00000000, 0xdf0f656b00000000, 0xf86a40ea00000000, 0xd0c35eb200000000, 0xf7a67b3300000000, 0x8091630200000000, 0xa7f4468300000000, 0x8f5d58db00000000, 0xa8387d5a00000000, 0x613368b900000000, 0x46564d3800000000, 0x6eff536000000000, 0x499a76e100000000, 0x3ead6ed000000000, 0x19c84b5100000000, 0x3161550900000000, 0x1604708800000000, 0xe2700e1400000000, 0xc5152b9500000000, 0xedbc35cd00000000, 0xcad9104c00000000, 0xbdee087d00000000, 0x9a8b2dfc00000000, 0xb22233a400000000, 0x9547162500000000, 0x5c4c03c600000000, 0x7b29264700000000, 0x5380381f00000000, 0x74e51d9e00000000, 0x03d205af00000000, 0x24b7202e00000000, 0x0c1e3e7600000000, 0x2b7b1bf700000000, 0xa5f1b39500000000, 0x8294961400000000, 0xaa3d884c00000000, 0x8d58adcd00000000, 0xfa6fb5fc00000000, 0xdd0a907d00000000, 0xf5a38e2500000000, 0xd2c6aba400000000, 0x1bcdbe4700000000, 0x3ca89bc600000000, 0x1401859e00000000, 0x3364a01f00000000, 0x4453b82e00000000, 0x63369daf00000000, 0x4b9f83f700000000, 0x6cfaa67600000000, 0x988ed8ea00000000, 0xbfebfd6b00000000, 0x9742e33300000000, 0xb027c6b200000000, 0xc710de8300000000, 0xe075fb0200000000, 0xc8dce55a00000000, 0xefb9c0db00000000, 0x26b2d53800000000, 0x01d7f0b900000000, 0x297eeee100000000, 0x0e1bcb6000000000, 0x792cd35100000000, 0x5e49f6d000000000, 0x76e0e88800000000, 0x5185cd0900000000}}; #else /* W == 4 */ local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0x9ba54c6f, 0xec3b9e9f, 0x779ed2f0, 0x03063b7f, 0x98a37710, 0xef3da5e0, 0x7498e98f, 0x060c76fe, 0x9da93a91, 0xea37e861, 0x7192a40e, 0x050a4d81, 0x9eaf01ee, 0xe931d31e, 0x72949f71, 0x0c18edfc, 0x97bda193, 0xe0237363, 0x7b863f0c, 0x0f1ed683, 0x94bb9aec, 0xe325481c, 0x78800473, 0x0a149b02, 0x91b1d76d, 0xe62f059d, 0x7d8a49f2, 0x0912a07d, 0x92b7ec12, 0xe5293ee2, 0x7e8c728d, 0x1831dbf8, 0x83949797, 0xf40a4567, 0x6faf0908, 0x1b37e087, 0x8092ace8, 0xf70c7e18, 0x6ca93277, 0x1e3dad06, 0x8598e169, 0xf2063399, 0x69a37ff6, 0x1d3b9679, 0x869eda16, 0xf10008e6, 0x6aa54489, 0x14293604, 0x8f8c7a6b, 0xf812a89b, 0x63b7e4f4, 0x172f0d7b, 0x8c8a4114, 0xfb1493e4, 0x60b1df8b, 0x122540fa, 0x89800c95, 0xfe1ede65, 0x65bb920a, 0x11237b85, 0x8a8637ea, 0xfd18e51a, 0x66bda975, 0x3063b7f0, 0xabc6fb9f, 0xdc58296f, 0x47fd6500, 0x33658c8f, 0xa8c0c0e0, 0xdf5e1210, 0x44fb5e7f, 0x366fc10e, 0xadca8d61, 0xda545f91, 0x41f113fe, 0x3569fa71, 0xaeccb61e, 0xd95264ee, 0x42f72881, 0x3c7b5a0c, 0xa7de1663, 0xd040c493, 0x4be588fc, 0x3f7d6173, 0xa4d82d1c, 0xd346ffec, 0x48e3b383, 0x3a772cf2, 0xa1d2609d, 0xd64cb26d, 0x4de9fe02, 0x3971178d, 0xa2d45be2, 0xd54a8912, 0x4eefc57d, 0x28526c08, 0xb3f72067, 0xc469f297, 0x5fccbef8, 0x2b545777, 0xb0f11b18, 0xc76fc9e8, 0x5cca8587, 0x2e5e1af6, 0xb5fb5699, 0xc2658469, 0x59c0c806, 0x2d582189, 0xb6fd6de6, 0xc163bf16, 0x5ac6f379, 0x244a81f4, 0xbfefcd9b, 0xc8711f6b, 0x53d45304, 0x274cba8b, 0xbce9f6e4, 0xcb772414, 0x50d2687b, 0x2246f70a, 0xb9e3bb65, 0xce7d6995, 0x55d825fa, 0x2140cc75, 0xbae5801a, 0xcd7b52ea, 0x56de1e85, 0x60c76fe0, 0xfb62238f, 0x8cfcf17f, 0x1759bd10, 0x63c1549f, 0xf86418f0, 0x8ffaca00, 0x145f866f, 0x66cb191e, 0xfd6e5571, 0x8af08781, 0x1155cbee, 0x65cd2261, 0xfe686e0e, 0x89f6bcfe, 0x1253f091, 0x6cdf821c, 0xf77ace73, 0x80e41c83, 0x1b4150ec, 0x6fd9b963, 0xf47cf50c, 0x83e227fc, 0x18476b93, 0x6ad3f4e2, 0xf176b88d, 0x86e86a7d, 0x1d4d2612, 0x69d5cf9d, 0xf27083f2, 0x85ee5102, 0x1e4b1d6d, 0x78f6b418, 0xe353f877, 0x94cd2a87, 0x0f6866e8, 0x7bf08f67, 0xe055c308, 0x97cb11f8, 0x0c6e5d97, 0x7efac2e6, 0xe55f8e89, 0x92c15c79, 0x09641016, 0x7dfcf999, 0xe659b5f6, 0x91c76706, 0x0a622b69, 0x74ee59e4, 0xef4b158b, 0x98d5c77b, 0x03708b14, 0x77e8629b, 0xec4d2ef4, 0x9bd3fc04, 0x0076b06b, 0x72e22f1a, 0xe9476375, 0x9ed9b185, 0x057cfdea, 0x71e41465, 0xea41580a, 0x9ddf8afa, 0x067ac695, 0x50a4d810, 0xcb01947f, 0xbc9f468f, 0x273a0ae0, 0x53a2e36f, 0xc807af00, 0xbf997df0, 0x243c319f, 0x56a8aeee, 0xcd0de281, 0xba933071, 0x21367c1e, 0x55ae9591, 0xce0bd9fe, 0xb9950b0e, 0x22304761, 0x5cbc35ec, 0xc7197983, 0xb087ab73, 0x2b22e71c, 0x5fba0e93, 0xc41f42fc, 0xb381900c, 0x2824dc63, 0x5ab04312, 0xc1150f7d, 0xb68bdd8d, 0x2d2e91e2, 0x59b6786d, 0xc2133402, 0xb58de6f2, 0x2e28aa9d, 0x489503e8, 0xd3304f87, 0xa4ae9d77, 0x3f0bd118, 0x4b933897, 0xd03674f8, 0xa7a8a608, 0x3c0dea67, 0x4e997516, 0xd53c3979, 0xa2a2eb89, 0x3907a7e6, 0x4d9f4e69, 0xd63a0206, 0xa1a4d0f6, 0x3a019c99, 0x448dee14, 0xdf28a27b, 0xa8b6708b, 0x33133ce4, 0x478bd56b, 0xdc2e9904, 0xabb04bf4, 0x3015079b, 0x428198ea, 0xd924d485, 0xaeba0675, 0x351f4a1a, 0x4187a395, 0xda22effa, 0xadbc3d0a, 0x36197165}, {0x00000000, 0xc18edfc0, 0x586cb9c1, 0x99e26601, 0xb0d97382, 0x7157ac42, 0xe8b5ca43, 0x293b1583, 0xbac3e145, 0x7b4d3e85, 0xe2af5884, 0x23218744, 0x0a1a92c7, 0xcb944d07, 0x52762b06, 0x93f8f4c6, 0xaef6c4cb, 0x6f781b0b, 0xf69a7d0a, 0x3714a2ca, 0x1e2fb749, 0xdfa16889, 0x46430e88, 0x87cdd148, 0x1435258e, 0xd5bbfa4e, 0x4c599c4f, 0x8dd7438f, 0xa4ec560c, 0x656289cc, 0xfc80efcd, 0x3d0e300d, 0x869c8fd7, 0x47125017, 0xdef03616, 0x1f7ee9d6, 0x3645fc55, 0xf7cb2395, 0x6e294594, 0xafa79a54, 0x3c5f6e92, 0xfdd1b152, 0x6433d753, 0xa5bd0893, 0x8c861d10, 0x4d08c2d0, 0xd4eaa4d1, 0x15647b11, 0x286a4b1c, 0xe9e494dc, 0x7006f2dd, 0xb1882d1d, 0x98b3389e, 0x593de75e, 0xc0df815f, 0x01515e9f, 0x92a9aa59, 0x53277599, 0xcac51398, 0x0b4bcc58, 0x2270d9db, 0xe3fe061b, 0x7a1c601a, 0xbb92bfda, 0xd64819ef, 0x17c6c62f, 0x8e24a02e, 0x4faa7fee, 0x66916a6d, 0xa71fb5ad, 0x3efdd3ac, 0xff730c6c, 0x6c8bf8aa, 0xad05276a, 0x34e7416b, 0xf5699eab, 0xdc528b28, 0x1ddc54e8, 0x843e32e9, 0x45b0ed29, 0x78bedd24, 0xb93002e4, 0x20d264e5, 0xe15cbb25, 0xc867aea6, 0x09e97166, 0x900b1767, 0x5185c8a7, 0xc27d3c61, 0x03f3e3a1, 0x9a1185a0, 0x5b9f5a60, 0x72a44fe3, 0xb32a9023, 0x2ac8f622, 0xeb4629e2, 0x50d49638, 0x915a49f8, 0x08b82ff9, 0xc936f039, 0xe00de5ba, 0x21833a7a, 0xb8615c7b, 0x79ef83bb, 0xea17777d, 0x2b99a8bd, 0xb27bcebc, 0x73f5117c, 0x5ace04ff, 0x9b40db3f, 0x02a2bd3e, 0xc32c62fe, 0xfe2252f3, 0x3fac8d33, 0xa64eeb32, 0x67c034f2, 0x4efb2171, 0x8f75feb1, 0x169798b0, 0xd7194770, 0x44e1b3b6, 0x856f6c76, 0x1c8d0a77, 0xdd03d5b7, 0xf438c034, 0x35b61ff4, 0xac5479f5, 0x6ddaa635, 0x77e1359f, 0xb66fea5f, 0x2f8d8c5e, 0xee03539e, 0xc738461d, 0x06b699dd, 0x9f54ffdc, 0x5eda201c, 0xcd22d4da, 0x0cac0b1a, 0x954e6d1b, 0x54c0b2db, 0x7dfba758, 0xbc757898, 0x25971e99, 0xe419c159, 0xd917f154, 0x18992e94, 0x817b4895, 0x40f59755, 0x69ce82d6, 0xa8405d16, 0x31a23b17, 0xf02ce4d7, 0x63d41011, 0xa25acfd1, 0x3bb8a9d0, 0xfa367610, 0xd30d6393, 0x1283bc53, 0x8b61da52, 0x4aef0592, 0xf17dba48, 0x30f36588, 0xa9110389, 0x689fdc49, 0x41a4c9ca, 0x802a160a, 0x19c8700b, 0xd846afcb, 0x4bbe5b0d, 0x8a3084cd, 0x13d2e2cc, 0xd25c3d0c, 0xfb67288f, 0x3ae9f74f, 0xa30b914e, 0x62854e8e, 0x5f8b7e83, 0x9e05a143, 0x07e7c742, 0xc6691882, 0xef520d01, 0x2edcd2c1, 0xb73eb4c0, 0x76b06b00, 0xe5489fc6, 0x24c64006, 0xbd242607, 0x7caaf9c7, 0x5591ec44, 0x941f3384, 0x0dfd5585, 0xcc738a45, 0xa1a92c70, 0x6027f3b0, 0xf9c595b1, 0x384b4a71, 0x11705ff2, 0xd0fe8032, 0x491ce633, 0x889239f3, 0x1b6acd35, 0xdae412f5, 0x430674f4, 0x8288ab34, 0xabb3beb7, 0x6a3d6177, 0xf3df0776, 0x3251d8b6, 0x0f5fe8bb, 0xced1377b, 0x5733517a, 0x96bd8eba, 0xbf869b39, 0x7e0844f9, 0xe7ea22f8, 0x2664fd38, 0xb59c09fe, 0x7412d63e, 0xedf0b03f, 0x2c7e6fff, 0x05457a7c, 0xc4cba5bc, 0x5d29c3bd, 0x9ca71c7d, 0x2735a3a7, 0xe6bb7c67, 0x7f591a66, 0xbed7c5a6, 0x97ecd025, 0x56620fe5, 0xcf8069e4, 0x0e0eb624, 0x9df642e2, 0x5c789d22, 0xc59afb23, 0x041424e3, 0x2d2f3160, 0xeca1eea0, 0x754388a1, 0xb4cd5761, 0x89c3676c, 0x484db8ac, 0xd1afdead, 0x1021016d, 0x391a14ee, 0xf894cb2e, 0x6176ad2f, 0xa0f872ef, 0x33008629, 0xf28e59e9, 0x6b6c3fe8, 0xaae2e028, 0x83d9f5ab, 0x42572a6b, 0xdbb54c6a, 0x1a3b93aa}, {0x00000000, 0xefc26b3e, 0x04f5d03d, 0xeb37bb03, 0x09eba07a, 0xe629cb44, 0x0d1e7047, 0xe2dc1b79, 0x13d740f4, 0xfc152bca, 0x172290c9, 0xf8e0fbf7, 0x1a3ce08e, 0xf5fe8bb0, 0x1ec930b3, 0xf10b5b8d, 0x27ae81e8, 0xc86cead6, 0x235b51d5, 0xcc993aeb, 0x2e452192, 0xc1874aac, 0x2ab0f1af, 0xc5729a91, 0x3479c11c, 0xdbbbaa22, 0x308c1121, 0xdf4e7a1f, 0x3d926166, 0xd2500a58, 0x3967b15b, 0xd6a5da65, 0x4f5d03d0, 0xa09f68ee, 0x4ba8d3ed, 0xa46ab8d3, 0x46b6a3aa, 0xa974c894, 0x42437397, 0xad8118a9, 0x5c8a4324, 0xb348281a, 0x587f9319, 0xb7bdf827, 0x5561e35e, 0xbaa38860, 0x51943363, 0xbe56585d, 0x68f38238, 0x8731e906, 0x6c065205, 0x83c4393b, 0x61182242, 0x8eda497c, 0x65edf27f, 0x8a2f9941, 0x7b24c2cc, 0x94e6a9f2, 0x7fd112f1, 0x901379cf, 0x72cf62b6, 0x9d0d0988, 0x763ab28b, 0x99f8d9b5, 0x9eba07a0, 0x71786c9e, 0x9a4fd79d, 0x758dbca3, 0x9751a7da, 0x7893cce4, 0x93a477e7, 0x7c661cd9, 0x8d6d4754, 0x62af2c6a, 0x89989769, 0x665afc57, 0x8486e72e, 0x6b448c10, 0x80733713, 0x6fb15c2d, 0xb9148648, 0x56d6ed76, 0xbde15675, 0x52233d4b, 0xb0ff2632, 0x5f3d4d0c, 0xb40af60f, 0x5bc89d31, 0xaac3c6bc, 0x4501ad82, 0xae361681, 0x41f47dbf, 0xa32866c6, 0x4cea0df8, 0xa7ddb6fb, 0x481fddc5, 0xd1e70470, 0x3e256f4e, 0xd512d44d, 0x3ad0bf73, 0xd80ca40a, 0x37cecf34, 0xdcf97437, 0x333b1f09, 0xc2304484, 0x2df22fba, 0xc6c594b9, 0x2907ff87, 0xcbdbe4fe, 0x24198fc0, 0xcf2e34c3, 0x20ec5ffd, 0xf6498598, 0x198beea6, 0xf2bc55a5, 0x1d7e3e9b, 0xffa225e2, 0x10604edc, 0xfb57f5df, 0x14959ee1, 0xe59ec56c, 0x0a5cae52, 0xe16b1551, 0x0ea97e6f, 0xec756516, 0x03b70e28, 0xe880b52b, 0x0742de15, 0xe6050901, 0x09c7623f, 0xe2f0d93c, 0x0d32b202, 0xefeea97b, 0x002cc245, 0xeb1b7946, 0x04d91278, 0xf5d249f5, 0x1a1022cb, 0xf12799c8, 0x1ee5f2f6, 0xfc39e98f, 0x13fb82b1, 0xf8cc39b2, 0x170e528c, 0xc1ab88e9, 0x2e69e3d7, 0xc55e58d4, 0x2a9c33ea, 0xc8402893, 0x278243ad, 0xccb5f8ae, 0x23779390, 0xd27cc81d, 0x3dbea323, 0xd6891820, 0x394b731e, 0xdb976867, 0x34550359, 0xdf62b85a, 0x30a0d364, 0xa9580ad1, 0x469a61ef, 0xadaddaec, 0x426fb1d2, 0xa0b3aaab, 0x4f71c195, 0xa4467a96, 0x4b8411a8, 0xba8f4a25, 0x554d211b, 0xbe7a9a18, 0x51b8f126, 0xb364ea5f, 0x5ca68161, 0xb7913a62, 0x5853515c, 0x8ef68b39, 0x6134e007, 0x8a035b04, 0x65c1303a, 0x871d2b43, 0x68df407d, 0x83e8fb7e, 0x6c2a9040, 0x9d21cbcd, 0x72e3a0f3, 0x99d41bf0, 0x761670ce, 0x94ca6bb7, 0x7b080089, 0x903fbb8a, 0x7ffdd0b4, 0x78bf0ea1, 0x977d659f, 0x7c4ade9c, 0x9388b5a2, 0x7154aedb, 0x9e96c5e5, 0x75a17ee6, 0x9a6315d8, 0x6b684e55, 0x84aa256b, 0x6f9d9e68, 0x805ff556, 0x6283ee2f, 0x8d418511, 0x66763e12, 0x89b4552c, 0x5f118f49, 0xb0d3e477, 0x5be45f74, 0xb426344a, 0x56fa2f33, 0xb938440d, 0x520fff0e, 0xbdcd9430, 0x4cc6cfbd, 0xa304a483, 0x48331f80, 0xa7f174be, 0x452d6fc7, 0xaaef04f9, 0x41d8bffa, 0xae1ad4c4, 0x37e20d71, 0xd820664f, 0x3317dd4c, 0xdcd5b672, 0x3e09ad0b, 0xd1cbc635, 0x3afc7d36, 0xd53e1608, 0x24354d85, 0xcbf726bb, 0x20c09db8, 0xcf02f686, 0x2ddeedff, 0xc21c86c1, 0x292b3dc2, 0xc6e956fc, 0x104c8c99, 0xff8ee7a7, 0x14b95ca4, 0xfb7b379a, 0x19a72ce3, 0xf66547dd, 0x1d52fcde, 0xf29097e0, 0x039bcc6d, 0xec59a753, 0x076e1c50, 0xe8ac776e, 0x0a706c17, 0xe5b20729, 0x0e85bc2a, 0xe147d714}, {0x00000000, 0x177b1443, 0x2ef62886, 0x398d3cc5, 0x5dec510c, 0x4a97454f, 0x731a798a, 0x64616dc9, 0xbbd8a218, 0xaca3b65b, 0x952e8a9e, 0x82559edd, 0xe634f314, 0xf14fe757, 0xc8c2db92, 0xdfb9cfd1, 0xacc04271, 0xbbbb5632, 0x82366af7, 0x954d7eb4, 0xf12c137d, 0xe657073e, 0xdfda3bfb, 0xc8a12fb8, 0x1718e069, 0x0063f42a, 0x39eec8ef, 0x2e95dcac, 0x4af4b165, 0x5d8fa526, 0x640299e3, 0x73798da0, 0x82f182a3, 0x958a96e0, 0xac07aa25, 0xbb7cbe66, 0xdf1dd3af, 0xc866c7ec, 0xf1ebfb29, 0xe690ef6a, 0x392920bb, 0x2e5234f8, 0x17df083d, 0x00a41c7e, 0x64c571b7, 0x73be65f4, 0x4a335931, 0x5d484d72, 0x2e31c0d2, 0x394ad491, 0x00c7e854, 0x17bcfc17, 0x73dd91de, 0x64a6859d, 0x5d2bb958, 0x4a50ad1b, 0x95e962ca, 0x82927689, 0xbb1f4a4c, 0xac645e0f, 0xc80533c6, 0xdf7e2785, 0xe6f31b40, 0xf1880f03, 0xde920307, 0xc9e91744, 0xf0642b81, 0xe71f3fc2, 0x837e520b, 0x94054648, 0xad887a8d, 0xbaf36ece, 0x654aa11f, 0x7231b55c, 0x4bbc8999, 0x5cc79dda, 0x38a6f013, 0x2fdde450, 0x1650d895, 0x012bccd6, 0x72524176, 0x65295535, 0x5ca469f0, 0x4bdf7db3, 0x2fbe107a, 0x38c50439, 0x014838fc, 0x16332cbf, 0xc98ae36e, 0xdef1f72d, 0xe77ccbe8, 0xf007dfab, 0x9466b262, 0x831da621, 0xba909ae4, 0xadeb8ea7, 0x5c6381a4, 0x4b1895e7, 0x7295a922, 0x65eebd61, 0x018fd0a8, 0x16f4c4eb, 0x2f79f82e, 0x3802ec6d, 0xe7bb23bc, 0xf0c037ff, 0xc94d0b3a, 0xde361f79, 0xba5772b0, 0xad2c66f3, 0x94a15a36, 0x83da4e75, 0xf0a3c3d5, 0xe7d8d796, 0xde55eb53, 0xc92eff10, 0xad4f92d9, 0xba34869a, 0x83b9ba5f, 0x94c2ae1c, 0x4b7b61cd, 0x5c00758e, 0x658d494b, 0x72f65d08, 0x169730c1, 0x01ec2482, 0x38611847, 0x2f1a0c04, 0x6655004f, 0x712e140c, 0x48a328c9, 0x5fd83c8a, 0x3bb95143, 0x2cc24500, 0x154f79c5, 0x02346d86, 0xdd8da257, 0xcaf6b614, 0xf37b8ad1, 0xe4009e92, 0x8061f35b, 0x971ae718, 0xae97dbdd, 0xb9eccf9e, 0xca95423e, 0xddee567d, 0xe4636ab8, 0xf3187efb, 0x97791332, 0x80020771, 0xb98f3bb4, 0xaef42ff7, 0x714de026, 0x6636f465, 0x5fbbc8a0, 0x48c0dce3, 0x2ca1b12a, 0x3bdaa569, 0x025799ac, 0x152c8def, 0xe4a482ec, 0xf3df96af, 0xca52aa6a, 0xdd29be29, 0xb948d3e0, 0xae33c7a3, 0x97befb66, 0x80c5ef25, 0x5f7c20f4, 0x480734b7, 0x718a0872, 0x66f11c31, 0x029071f8, 0x15eb65bb, 0x2c66597e, 0x3b1d4d3d, 0x4864c09d, 0x5f1fd4de, 0x6692e81b, 0x71e9fc58, 0x15889191, 0x02f385d2, 0x3b7eb917, 0x2c05ad54, 0xf3bc6285, 0xe4c776c6, 0xdd4a4a03, 0xca315e40, 0xae503389, 0xb92b27ca, 0x80a61b0f, 0x97dd0f4c, 0xb8c70348, 0xafbc170b, 0x96312bce, 0x814a3f8d, 0xe52b5244, 0xf2504607, 0xcbdd7ac2, 0xdca66e81, 0x031fa150, 0x1464b513, 0x2de989d6, 0x3a929d95, 0x5ef3f05c, 0x4988e41f, 0x7005d8da, 0x677ecc99, 0x14074139, 0x037c557a, 0x3af169bf, 0x2d8a7dfc, 0x49eb1035, 0x5e900476, 0x671d38b3, 0x70662cf0, 0xafdfe321, 0xb8a4f762, 0x8129cba7, 0x9652dfe4, 0xf233b22d, 0xe548a66e, 0xdcc59aab, 0xcbbe8ee8, 0x3a3681eb, 0x2d4d95a8, 0x14c0a96d, 0x03bbbd2e, 0x67dad0e7, 0x70a1c4a4, 0x492cf861, 0x5e57ec22, 0x81ee23f3, 0x969537b0, 0xaf180b75, 0xb8631f36, 0xdc0272ff, 0xcb7966bc, 0xf2f45a79, 0xe58f4e3a, 0x96f6c39a, 0x818dd7d9, 0xb800eb1c, 0xaf7bff5f, 0xcb1a9296, 0xdc6186d5, 0xe5ecba10, 0xf297ae53, 0x2d2e6182, 0x3a5575c1, 0x03d84904, 0x14a35d47, 0x70c2308e, 0x67b924cd, 0x5e341808, 0x494f0c4b}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x00000000, 0x43147b17, 0x8628f62e, 0xc53c8d39, 0x0c51ec5d, 0x4f45974a, 0x8a791a73, 0xc96d6164, 0x18a2d8bb, 0x5bb6a3ac, 0x9e8a2e95, 0xdd9e5582, 0x14f334e6, 0x57e74ff1, 0x92dbc2c8, 0xd1cfb9df, 0x7142c0ac, 0x3256bbbb, 0xf76a3682, 0xb47e4d95, 0x7d132cf1, 0x3e0757e6, 0xfb3bdadf, 0xb82fa1c8, 0x69e01817, 0x2af46300, 0xefc8ee39, 0xacdc952e, 0x65b1f44a, 0x26a58f5d, 0xe3990264, 0xa08d7973, 0xa382f182, 0xe0968a95, 0x25aa07ac, 0x66be7cbb, 0xafd31ddf, 0xecc766c8, 0x29fbebf1, 0x6aef90e6, 0xbb202939, 0xf834522e, 0x3d08df17, 0x7e1ca400, 0xb771c564, 0xf465be73, 0x3159334a, 0x724d485d, 0xd2c0312e, 0x91d44a39, 0x54e8c700, 0x17fcbc17, 0xde91dd73, 0x9d85a664, 0x58b92b5d, 0x1bad504a, 0xca62e995, 0x89769282, 0x4c4a1fbb, 0x0f5e64ac, 0xc63305c8, 0x85277edf, 0x401bf3e6, 0x030f88f1, 0x070392de, 0x4417e9c9, 0x812b64f0, 0xc23f1fe7, 0x0b527e83, 0x48460594, 0x8d7a88ad, 0xce6ef3ba, 0x1fa14a65, 0x5cb53172, 0x9989bc4b, 0xda9dc75c, 0x13f0a638, 0x50e4dd2f, 0x95d85016, 0xd6cc2b01, 0x76415272, 0x35552965, 0xf069a45c, 0xb37ddf4b, 0x7a10be2f, 0x3904c538, 0xfc384801, 0xbf2c3316, 0x6ee38ac9, 0x2df7f1de, 0xe8cb7ce7, 0xabdf07f0, 0x62b26694, 0x21a61d83, 0xe49a90ba, 0xa78eebad, 0xa481635c, 0xe795184b, 0x22a99572, 0x61bdee65, 0xa8d08f01, 0xebc4f416, 0x2ef8792f, 0x6dec0238, 0xbc23bbe7, 0xff37c0f0, 0x3a0b4dc9, 0x791f36de, 0xb07257ba, 0xf3662cad, 0x365aa194, 0x754eda83, 0xd5c3a3f0, 0x96d7d8e7, 0x53eb55de, 0x10ff2ec9, 0xd9924fad, 0x9a8634ba, 0x5fbab983, 0x1caec294, 0xcd617b4b, 0x8e75005c, 0x4b498d65, 0x085df672, 0xc1309716, 0x8224ec01, 0x47186138, 0x040c1a2f, 0x4f005566, 0x0c142e71, 0xc928a348, 0x8a3cd85f, 0x4351b93b, 0x0045c22c, 0xc5794f15, 0x866d3402, 0x57a28ddd, 0x14b6f6ca, 0xd18a7bf3, 0x929e00e4, 0x5bf36180, 0x18e71a97, 0xdddb97ae, 0x9ecfecb9, 0x3e4295ca, 0x7d56eedd, 0xb86a63e4, 0xfb7e18f3, 0x32137997, 0x71070280, 0xb43b8fb9, 0xf72ff4ae, 0x26e04d71, 0x65f43666, 0xa0c8bb5f, 0xe3dcc048, 0x2ab1a12c, 0x69a5da3b, 0xac995702, 0xef8d2c15, 0xec82a4e4, 0xaf96dff3, 0x6aaa52ca, 0x29be29dd, 0xe0d348b9, 0xa3c733ae, 0x66fbbe97, 0x25efc580, 0xf4207c5f, 0xb7340748, 0x72088a71, 0x311cf166, 0xf8719002, 0xbb65eb15, 0x7e59662c, 0x3d4d1d3b, 0x9dc06448, 0xded41f5f, 0x1be89266, 0x58fce971, 0x91918815, 0xd285f302, 0x17b97e3b, 0x54ad052c, 0x8562bcf3, 0xc676c7e4, 0x034a4add, 0x405e31ca, 0x893350ae, 0xca272bb9, 0x0f1ba680, 0x4c0fdd97, 0x4803c7b8, 0x0b17bcaf, 0xce2b3196, 0x8d3f4a81, 0x44522be5, 0x074650f2, 0xc27addcb, 0x816ea6dc, 0x50a11f03, 0x13b56414, 0xd689e92d, 0x959d923a, 0x5cf0f35e, 0x1fe48849, 0xdad80570, 0x99cc7e67, 0x39410714, 0x7a557c03, 0xbf69f13a, 0xfc7d8a2d, 0x3510eb49, 0x7604905e, 0xb3381d67, 0xf02c6670, 0x21e3dfaf, 0x62f7a4b8, 0xa7cb2981, 0xe4df5296, 0x2db233f2, 0x6ea648e5, 0xab9ac5dc, 0xe88ebecb, 0xeb81363a, 0xa8954d2d, 0x6da9c014, 0x2ebdbb03, 0xe7d0da67, 0xa4c4a170, 0x61f82c49, 0x22ec575e, 0xf323ee81, 0xb0379596, 0x750b18af, 0x361f63b8, 0xff7202dc, 0xbc6679cb, 0x795af4f2, 0x3a4e8fe5, 0x9ac3f696, 0xd9d78d81, 0x1ceb00b8, 0x5fff7baf, 0x96921acb, 0xd58661dc, 0x10baece5, 0x53ae97f2, 0x82612e2d, 0xc175553a, 0x0449d803, 0x475da314, 0x8e30c270, 0xcd24b967, 0x0818345e, 0x4b0c4f49}, {0x00000000, 0x3e6bc2ef, 0x3dd0f504, 0x03bb37eb, 0x7aa0eb09, 0x44cb29e6, 0x47701e0d, 0x791bdce2, 0xf440d713, 0xca2b15fc, 0xc9902217, 0xf7fbe0f8, 0x8ee03c1a, 0xb08bfef5, 0xb330c91e, 0x8d5b0bf1, 0xe881ae27, 0xd6ea6cc8, 0xd5515b23, 0xeb3a99cc, 0x9221452e, 0xac4a87c1, 0xaff1b02a, 0x919a72c5, 0x1cc17934, 0x22aabbdb, 0x21118c30, 0x1f7a4edf, 0x6661923d, 0x580a50d2, 0x5bb16739, 0x65daa5d6, 0xd0035d4f, 0xee689fa0, 0xedd3a84b, 0xd3b86aa4, 0xaaa3b646, 0x94c874a9, 0x97734342, 0xa91881ad, 0x24438a5c, 0x1a2848b3, 0x19937f58, 0x27f8bdb7, 0x5ee36155, 0x6088a3ba, 0x63339451, 0x5d5856be, 0x3882f368, 0x06e93187, 0x0552066c, 0x3b39c483, 0x42221861, 0x7c49da8e, 0x7ff2ed65, 0x41992f8a, 0xccc2247b, 0xf2a9e694, 0xf112d17f, 0xcf791390, 0xb662cf72, 0x88090d9d, 0x8bb23a76, 0xb5d9f899, 0xa007ba9e, 0x9e6c7871, 0x9dd74f9a, 0xa3bc8d75, 0xdaa75197, 0xe4cc9378, 0xe777a493, 0xd91c667c, 0x54476d8d, 0x6a2caf62, 0x69979889, 0x57fc5a66, 0x2ee78684, 0x108c446b, 0x13377380, 0x2d5cb16f, 0x488614b9, 0x76edd656, 0x7556e1bd, 0x4b3d2352, 0x3226ffb0, 0x0c4d3d5f, 0x0ff60ab4, 0x319dc85b, 0xbcc6c3aa, 0x82ad0145, 0x811636ae, 0xbf7df441, 0xc66628a3, 0xf80dea4c, 0xfbb6dda7, 0xc5dd1f48, 0x7004e7d1, 0x4e6f253e, 0x4dd412d5, 0x73bfd03a, 0x0aa40cd8, 0x34cfce37, 0x3774f9dc, 0x091f3b33, 0x844430c2, 0xba2ff22d, 0xb994c5c6, 0x87ff0729, 0xfee4dbcb, 0xc08f1924, 0xc3342ecf, 0xfd5fec20, 0x988549f6, 0xa6ee8b19, 0xa555bcf2, 0x9b3e7e1d, 0xe225a2ff, 0xdc4e6010, 0xdff557fb, 0xe19e9514, 0x6cc59ee5, 0x52ae5c0a, 0x51156be1, 0x6f7ea90e, 0x166575ec, 0x280eb703, 0x2bb580e8, 0x15de4207, 0x010905e6, 0x3f62c709, 0x3cd9f0e2, 0x02b2320d, 0x7ba9eeef, 0x45c22c00, 0x46791beb, 0x7812d904, 0xf549d2f5, 0xcb22101a, 0xc89927f1, 0xf6f2e51e, 0x8fe939fc, 0xb182fb13, 0xb239ccf8, 0x8c520e17, 0xe988abc1, 0xd7e3692e, 0xd4585ec5, 0xea339c2a, 0x932840c8, 0xad438227, 0xaef8b5cc, 0x90937723, 0x1dc87cd2, 0x23a3be3d, 0x201889d6, 0x1e734b39, 0x676897db, 0x59035534, 0x5ab862df, 0x64d3a030, 0xd10a58a9, 0xef619a46, 0xecdaadad, 0xd2b16f42, 0xabaab3a0, 0x95c1714f, 0x967a46a4, 0xa811844b, 0x254a8fba, 0x1b214d55, 0x189a7abe, 0x26f1b851, 0x5fea64b3, 0x6181a65c, 0x623a91b7, 0x5c515358, 0x398bf68e, 0x07e03461, 0x045b038a, 0x3a30c165, 0x432b1d87, 0x7d40df68, 0x7efbe883, 0x40902a6c, 0xcdcb219d, 0xf3a0e372, 0xf01bd499, 0xce701676, 0xb76bca94, 0x8900087b, 0x8abb3f90, 0xb4d0fd7f, 0xa10ebf78, 0x9f657d97, 0x9cde4a7c, 0xa2b58893, 0xdbae5471, 0xe5c5969e, 0xe67ea175, 0xd815639a, 0x554e686b, 0x6b25aa84, 0x689e9d6f, 0x56f55f80, 0x2fee8362, 0x1185418d, 0x123e7666, 0x2c55b489, 0x498f115f, 0x77e4d3b0, 0x745fe45b, 0x4a3426b4, 0x332ffa56, 0x0d4438b9, 0x0eff0f52, 0x3094cdbd, 0xbdcfc64c, 0x83a404a3, 0x801f3348, 0xbe74f1a7, 0xc76f2d45, 0xf904efaa, 0xfabfd841, 0xc4d41aae, 0x710de237, 0x4f6620d8, 0x4cdd1733, 0x72b6d5dc, 0x0bad093e, 0x35c6cbd1, 0x367dfc3a, 0x08163ed5, 0x854d3524, 0xbb26f7cb, 0xb89dc020, 0x86f602cf, 0xffedde2d, 0xc1861cc2, 0xc23d2b29, 0xfc56e9c6, 0x998c4c10, 0xa7e78eff, 0xa45cb914, 0x9a377bfb, 0xe32ca719, 0xdd4765f6, 0xdefc521d, 0xe09790f2, 0x6dcc9b03, 0x53a759ec, 0x501c6e07, 0x6e77ace8, 0x176c700a, 0x2907b2e5, 0x2abc850e, 0x14d747e1}, {0x00000000, 0xc0df8ec1, 0xc1b96c58, 0x0166e299, 0x8273d9b0, 0x42ac5771, 0x43cab5e8, 0x83153b29, 0x45e1c3ba, 0x853e4d7b, 0x8458afe2, 0x44872123, 0xc7921a0a, 0x074d94cb, 0x062b7652, 0xc6f4f893, 0xcbc4f6ae, 0x0b1b786f, 0x0a7d9af6, 0xcaa21437, 0x49b72f1e, 0x8968a1df, 0x880e4346, 0x48d1cd87, 0x8e253514, 0x4efabbd5, 0x4f9c594c, 0x8f43d78d, 0x0c56eca4, 0xcc896265, 0xcdef80fc, 0x0d300e3d, 0xd78f9c86, 0x17501247, 0x1636f0de, 0xd6e97e1f, 0x55fc4536, 0x9523cbf7, 0x9445296e, 0x549aa7af, 0x926e5f3c, 0x52b1d1fd, 0x53d73364, 0x9308bda5, 0x101d868c, 0xd0c2084d, 0xd1a4ead4, 0x117b6415, 0x1c4b6a28, 0xdc94e4e9, 0xddf20670, 0x1d2d88b1, 0x9e38b398, 0x5ee73d59, 0x5f81dfc0, 0x9f5e5101, 0x59aaa992, 0x99752753, 0x9813c5ca, 0x58cc4b0b, 0xdbd97022, 0x1b06fee3, 0x1a601c7a, 0xdabf92bb, 0xef1948d6, 0x2fc6c617, 0x2ea0248e, 0xee7faa4f, 0x6d6a9166, 0xadb51fa7, 0xacd3fd3e, 0x6c0c73ff, 0xaaf88b6c, 0x6a2705ad, 0x6b41e734, 0xab9e69f5, 0x288b52dc, 0xe854dc1d, 0xe9323e84, 0x29edb045, 0x24ddbe78, 0xe40230b9, 0xe564d220, 0x25bb5ce1, 0xa6ae67c8, 0x6671e909, 0x67170b90, 0xa7c88551, 0x613c7dc2, 0xa1e3f303, 0xa085119a, 0x605a9f5b, 0xe34fa472, 0x23902ab3, 0x22f6c82a, 0xe22946eb, 0x3896d450, 0xf8495a91, 0xf92fb808, 0x39f036c9, 0xbae50de0, 0x7a3a8321, 0x7b5c61b8, 0xbb83ef79, 0x7d7717ea, 0xbda8992b, 0xbcce7bb2, 0x7c11f573, 0xff04ce5a, 0x3fdb409b, 0x3ebda202, 0xfe622cc3, 0xf35222fe, 0x338dac3f, 0x32eb4ea6, 0xf234c067, 0x7121fb4e, 0xb1fe758f, 0xb0989716, 0x704719d7, 0xb6b3e144, 0x766c6f85, 0x770a8d1c, 0xb7d503dd, 0x34c038f4, 0xf41fb635, 0xf57954ac, 0x35a6da6d, 0x9f35e177, 0x5fea6fb6, 0x5e8c8d2f, 0x9e5303ee, 0x1d4638c7, 0xdd99b606, 0xdcff549f, 0x1c20da5e, 0xdad422cd, 0x1a0bac0c, 0x1b6d4e95, 0xdbb2c054, 0x58a7fb7d, 0x987875bc, 0x991e9725, 0x59c119e4, 0x54f117d9, 0x942e9918, 0x95487b81, 0x5597f540, 0xd682ce69, 0x165d40a8, 0x173ba231, 0xd7e42cf0, 0x1110d463, 0xd1cf5aa2, 0xd0a9b83b, 0x107636fa, 0x93630dd3, 0x53bc8312, 0x52da618b, 0x9205ef4a, 0x48ba7df1, 0x8865f330, 0x890311a9, 0x49dc9f68, 0xcac9a441, 0x0a162a80, 0x0b70c819, 0xcbaf46d8, 0x0d5bbe4b, 0xcd84308a, 0xcce2d213, 0x0c3d5cd2, 0x8f2867fb, 0x4ff7e93a, 0x4e910ba3, 0x8e4e8562, 0x837e8b5f, 0x43a1059e, 0x42c7e707, 0x821869c6, 0x010d52ef, 0xc1d2dc2e, 0xc0b43eb7, 0x006bb076, 0xc69f48e5, 0x0640c624, 0x072624bd, 0xc7f9aa7c, 0x44ec9155, 0x84331f94, 0x8555fd0d, 0x458a73cc, 0x702ca9a1, 0xb0f32760, 0xb195c5f9, 0x714a4b38, 0xf25f7011, 0x3280fed0, 0x33e61c49, 0xf3399288, 0x35cd6a1b, 0xf512e4da, 0xf4740643, 0x34ab8882, 0xb7beb3ab, 0x77613d6a, 0x7607dff3, 0xb6d85132, 0xbbe85f0f, 0x7b37d1ce, 0x7a513357, 0xba8ebd96, 0x399b86bf, 0xf944087e, 0xf822eae7, 0x38fd6426, 0xfe099cb5, 0x3ed61274, 0x3fb0f0ed, 0xff6f7e2c, 0x7c7a4505, 0xbca5cbc4, 0xbdc3295d, 0x7d1ca79c, 0xa7a33527, 0x677cbbe6, 0x661a597f, 0xa6c5d7be, 0x25d0ec97, 0xe50f6256, 0xe46980cf, 0x24b60e0e, 0xe242f69d, 0x229d785c, 0x23fb9ac5, 0xe3241404, 0x60312f2d, 0xa0eea1ec, 0xa1884375, 0x6157cdb4, 0x6c67c389, 0xacb84d48, 0xaddeafd1, 0x6d012110, 0xee141a39, 0x2ecb94f8, 0x2fad7661, 0xef72f8a0, 0x29860033, 0xe9598ef2, 0xe83f6c6b, 0x28e0e2aa, 0xabf5d983, 0x6b2a5742, 0x6a4cb5db, 0xaa933b1a}, {0x00000000, 0x6f4ca59b, 0x9f9e3bec, 0xf0d29e77, 0x7f3b0603, 0x1077a398, 0xe0a53def, 0x8fe99874, 0xfe760c06, 0x913aa99d, 0x61e837ea, 0x0ea49271, 0x814d0a05, 0xee01af9e, 0x1ed331e9, 0x719f9472, 0xfced180c, 0x93a1bd97, 0x637323e0, 0x0c3f867b, 0x83d61e0f, 0xec9abb94, 0x1c4825e3, 0x73048078, 0x029b140a, 0x6dd7b191, 0x9d052fe6, 0xf2498a7d, 0x7da01209, 0x12ecb792, 0xe23e29e5, 0x8d728c7e, 0xf8db3118, 0x97979483, 0x67450af4, 0x0809af6f, 0x87e0371b, 0xe8ac9280, 0x187e0cf7, 0x7732a96c, 0x06ad3d1e, 0x69e19885, 0x993306f2, 0xf67fa369, 0x79963b1d, 0x16da9e86, 0xe60800f1, 0x8944a56a, 0x04362914, 0x6b7a8c8f, 0x9ba812f8, 0xf4e4b763, 0x7b0d2f17, 0x14418a8c, 0xe49314fb, 0x8bdfb160, 0xfa402512, 0x950c8089, 0x65de1efe, 0x0a92bb65, 0x857b2311, 0xea37868a, 0x1ae518fd, 0x75a9bd66, 0xf0b76330, 0x9ffbc6ab, 0x6f2958dc, 0x0065fd47, 0x8f8c6533, 0xe0c0c0a8, 0x10125edf, 0x7f5efb44, 0x0ec16f36, 0x618dcaad, 0x915f54da, 0xfe13f141, 0x71fa6935, 0x1eb6ccae, 0xee6452d9, 0x8128f742, 0x0c5a7b3c, 0x6316dea7, 0x93c440d0, 0xfc88e54b, 0x73617d3f, 0x1c2dd8a4, 0xecff46d3, 0x83b3e348, 0xf22c773a, 0x9d60d2a1, 0x6db24cd6, 0x02fee94d, 0x8d177139, 0xe25bd4a2, 0x12894ad5, 0x7dc5ef4e, 0x086c5228, 0x6720f7b3, 0x97f269c4, 0xf8becc5f, 0x7757542b, 0x181bf1b0, 0xe8c96fc7, 0x8785ca5c, 0xf61a5e2e, 0x9956fbb5, 0x698465c2, 0x06c8c059, 0x8921582d, 0xe66dfdb6, 0x16bf63c1, 0x79f3c65a, 0xf4814a24, 0x9bcdefbf, 0x6b1f71c8, 0x0453d453, 0x8bba4c27, 0xe4f6e9bc, 0x142477cb, 0x7b68d250, 0x0af74622, 0x65bbe3b9, 0x95697dce, 0xfa25d855, 0x75cc4021, 0x1a80e5ba, 0xea527bcd, 0x851ede56, 0xe06fc760, 0x8f2362fb, 0x7ff1fc8c, 0x10bd5917, 0x9f54c163, 0xf01864f8, 0x00cafa8f, 0x6f865f14, 0x1e19cb66, 0x71556efd, 0x8187f08a, 0xeecb5511, 0x6122cd65, 0x0e6e68fe, 0xfebcf689, 0x91f05312, 0x1c82df6c, 0x73ce7af7, 0x831ce480, 0xec50411b, 0x63b9d96f, 0x0cf57cf4, 0xfc27e283, 0x936b4718, 0xe2f4d36a, 0x8db876f1, 0x7d6ae886, 0x12264d1d, 0x9dcfd569, 0xf28370f2, 0x0251ee85, 0x6d1d4b1e, 0x18b4f678, 0x77f853e3, 0x872acd94, 0xe866680f, 0x678ff07b, 0x08c355e0, 0xf811cb97, 0x975d6e0c, 0xe6c2fa7e, 0x898e5fe5, 0x795cc192, 0x16106409, 0x99f9fc7d, 0xf6b559e6, 0x0667c791, 0x692b620a, 0xe459ee74, 0x8b154bef, 0x7bc7d598, 0x148b7003, 0x9b62e877, 0xf42e4dec, 0x04fcd39b, 0x6bb07600, 0x1a2fe272, 0x756347e9, 0x85b1d99e, 0xeafd7c05, 0x6514e471, 0x0a5841ea, 0xfa8adf9d, 0x95c67a06, 0x10d8a450, 0x7f9401cb, 0x8f469fbc, 0xe00a3a27, 0x6fe3a253, 0x00af07c8, 0xf07d99bf, 0x9f313c24, 0xeeaea856, 0x81e20dcd, 0x713093ba, 0x1e7c3621, 0x9195ae55, 0xfed90bce, 0x0e0b95b9, 0x61473022, 0xec35bc5c, 0x837919c7, 0x73ab87b0, 0x1ce7222b, 0x930eba5f, 0xfc421fc4, 0x0c9081b3, 0x63dc2428, 0x1243b05a, 0x7d0f15c1, 0x8ddd8bb6, 0xe2912e2d, 0x6d78b659, 0x023413c2, 0xf2e68db5, 0x9daa282e, 0xe8039548, 0x874f30d3, 0x779daea4, 0x18d10b3f, 0x9738934b, 0xf87436d0, 0x08a6a8a7, 0x67ea0d3c, 0x1675994e, 0x79393cd5, 0x89eba2a2, 0xe6a70739, 0x694e9f4d, 0x06023ad6, 0xf6d0a4a1, 0x999c013a, 0x14ee8d44, 0x7ba228df, 0x8b70b6a8, 0xe43c1333, 0x6bd58b47, 0x04992edc, 0xf44bb0ab, 0x9b071530, 0xea988142, 0x85d424d9, 0x7506baae, 0x1a4a1f35, 0x95a38741, 0xfaef22da, 0x0a3dbcad, 0x65711936}}; #endif #endif #if N == 4 #if W == 8 local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0xf1da05aa, 0x38c50d15, 0xc91f08bf, 0x718a1a2a, 0x80501f80, 0x494f173f, 0xb8951295, 0xe3143454, 0x12ce31fe, 0xdbd13941, 0x2a0b3ceb, 0x929e2e7e, 0x63442bd4, 0xaa5b236b, 0x5b8126c1, 0x1d596ee9, 0xec836b43, 0x259c63fc, 0xd4466656, 0x6cd374c3, 0x9d097169, 0x541679d6, 0xa5cc7c7c, 0xfe4d5abd, 0x0f975f17, 0xc68857a8, 0x37525202, 0x8fc74097, 0x7e1d453d, 0xb7024d82, 0x46d84828, 0x3ab2ddd2, 0xcb68d878, 0x0277d0c7, 0xf3add56d, 0x4b38c7f8, 0xbae2c252, 0x73fdcaed, 0x8227cf47, 0xd9a6e986, 0x287cec2c, 0xe163e493, 0x10b9e139, 0xa82cf3ac, 0x59f6f606, 0x90e9feb9, 0x6133fb13, 0x27ebb33b, 0xd631b691, 0x1f2ebe2e, 0xeef4bb84, 0x5661a911, 0xa7bbacbb, 0x6ea4a404, 0x9f7ea1ae, 0xc4ff876f, 0x352582c5, 0xfc3a8a7a, 0x0de08fd0, 0xb5759d45, 0x44af98ef, 0x8db09050, 0x7c6a95fa, 0x7565bba4, 0x84bfbe0e, 0x4da0b6b1, 0xbc7ab31b, 0x04efa18e, 0xf535a424, 0x3c2aac9b, 0xcdf0a931, 0x96718ff0, 0x67ab8a5a, 0xaeb482e5, 0x5f6e874f, 0xe7fb95da, 0x16219070, 0xdf3e98cf, 0x2ee49d65, 0x683cd54d, 0x99e6d0e7, 0x50f9d858, 0xa123ddf2, 0x19b6cf67, 0xe86ccacd, 0x2173c272, 0xd0a9c7d8, 0x8b28e119, 0x7af2e4b3, 0xb3edec0c, 0x4237e9a6, 0xfaa2fb33, 0x0b78fe99, 0xc267f626, 0x33bdf38c, 0x4fd76676, 0xbe0d63dc, 0x77126b63, 0x86c86ec9, 0x3e5d7c5c, 0xcf8779f6, 0x06987149, 0xf74274e3, 0xacc35222, 0x5d195788, 0x94065f37, 0x65dc5a9d, 0xdd494808, 0x2c934da2, 0xe58c451d, 0x145640b7, 0x528e089f, 0xa3540d35, 0x6a4b058a, 0x9b910020, 0x230412b5, 0xd2de171f, 0x1bc11fa0, 0xea1b1a0a, 0xb19a3ccb, 0x40403961, 0x895f31de, 0x78853474, 0xc01026e1, 0x31ca234b, 0xf8d52bf4, 0x090f2e5e, 0xeacb7748, 0x1b1172e2, 0xd20e7a5d, 0x23d47ff7, 0x9b416d62, 0x6a9b68c8, 0xa3846077, 0x525e65dd, 0x09df431c, 0xf80546b6, 0x311a4e09, 0xc0c04ba3, 0x78555936, 0x898f5c9c, 0x40905423, 0xb14a5189, 0xf79219a1, 0x06481c0b, 0xcf5714b4, 0x3e8d111e, 0x8618038b, 0x77c20621, 0xbedd0e9e, 0x4f070b34, 0x14862df5, 0xe55c285f, 0x2c4320e0, 0xdd99254a, 0x650c37df, 0x94d63275, 0x5dc93aca, 0xac133f60, 0xd079aa9a, 0x21a3af30, 0xe8bca78f, 0x1966a225, 0xa1f3b0b0, 0x5029b51a, 0x9936bda5, 0x68ecb80f, 0x336d9ece, 0xc2b79b64, 0x0ba893db, 0xfa729671, 0x42e784e4, 0xb33d814e, 0x7a2289f1, 0x8bf88c5b, 0xcd20c473, 0x3cfac1d9, 0xf5e5c966, 0x043fcccc, 0xbcaade59, 0x4d70dbf3, 0x846fd34c, 0x75b5d6e6, 0x2e34f027, 0xdfeef58d, 0x16f1fd32, 0xe72bf898, 0x5fbeea0d, 0xae64efa7, 0x677be718, 0x96a1e2b2, 0x9faeccec, 0x6e74c946, 0xa76bc1f9, 0x56b1c453, 0xee24d6c6, 0x1ffed36c, 0xd6e1dbd3, 0x273bde79, 0x7cbaf8b8, 0x8d60fd12, 0x447ff5ad, 0xb5a5f007, 0x0d30e292, 0xfceae738, 0x35f5ef87, 0xc42fea2d, 0x82f7a205, 0x732da7af, 0xba32af10, 0x4be8aaba, 0xf37db82f, 0x02a7bd85, 0xcbb8b53a, 0x3a62b090, 0x61e39651, 0x903993fb, 0x59269b44, 0xa8fc9eee, 0x10698c7b, 0xe1b389d1, 0x28ac816e, 0xd97684c4, 0xa51c113e, 0x54c61494, 0x9dd91c2b, 0x6c031981, 0xd4960b14, 0x254c0ebe, 0xec530601, 0x1d8903ab, 0x4608256a, 0xb7d220c0, 0x7ecd287f, 0x8f172dd5, 0x37823f40, 0xc6583aea, 0x0f473255, 0xfe9d37ff, 0xb8457fd7, 0x499f7a7d, 0x808072c2, 0x715a7768, 0xc9cf65fd, 0x38156057, 0xf10a68e8, 0x00d06d42, 0x5b514b83, 0xaa8b4e29, 0x63944696, 0x924e433c, 0x2adb51a9, 0xdb015403, 0x121e5cbc, 0xe3c45916}, {0x00000000, 0x0ee7e8d1, 0x1dcfd1a2, 0x13283973, 0x3b9fa344, 0x35784b95, 0x265072e6, 0x28b79a37, 0x773f4688, 0x79d8ae59, 0x6af0972a, 0x64177ffb, 0x4ca0e5cc, 0x42470d1d, 0x516f346e, 0x5f88dcbf, 0xee7e8d10, 0xe09965c1, 0xf3b15cb2, 0xfd56b463, 0xd5e12e54, 0xdb06c685, 0xc82efff6, 0xc6c91727, 0x9941cb98, 0x97a62349, 0x848e1a3a, 0x8a69f2eb, 0xa2de68dc, 0xac39800d, 0xbf11b97e, 0xb1f651af, 0x078c1c61, 0x096bf4b0, 0x1a43cdc3, 0x14a42512, 0x3c13bf25, 0x32f457f4, 0x21dc6e87, 0x2f3b8656, 0x70b35ae9, 0x7e54b238, 0x6d7c8b4b, 0x639b639a, 0x4b2cf9ad, 0x45cb117c, 0x56e3280f, 0x5804c0de, 0xe9f29171, 0xe71579a0, 0xf43d40d3, 0xfadaa802, 0xd26d3235, 0xdc8adae4, 0xcfa2e397, 0xc1450b46, 0x9ecdd7f9, 0x902a3f28, 0x8302065b, 0x8de5ee8a, 0xa55274bd, 0xabb59c6c, 0xb89da51f, 0xb67a4dce, 0x0f1838c2, 0x01ffd013, 0x12d7e960, 0x1c3001b1, 0x34879b86, 0x3a607357, 0x29484a24, 0x27afa2f5, 0x78277e4a, 0x76c0969b, 0x65e8afe8, 0x6b0f4739, 0x43b8dd0e, 0x4d5f35df, 0x5e770cac, 0x5090e47d, 0xe166b5d2, 0xef815d03, 0xfca96470, 0xf24e8ca1, 0xdaf91696, 0xd41efe47, 0xc736c734, 0xc9d12fe5, 0x9659f35a, 0x98be1b8b, 0x8b9622f8, 0x8571ca29, 0xadc6501e, 0xa321b8cf, 0xb00981bc, 0xbeee696d, 0x089424a3, 0x0673cc72, 0x155bf501, 0x1bbc1dd0, 0x330b87e7, 0x3dec6f36, 0x2ec45645, 0x2023be94, 0x7fab622b, 0x714c8afa, 0x6264b389, 0x6c835b58, 0x4434c16f, 0x4ad329be, 0x59fb10cd, 0x571cf81c, 0xe6eaa9b3, 0xe80d4162, 0xfb257811, 0xf5c290c0, 0xdd750af7, 0xd392e226, 0xc0badb55, 0xce5d3384, 0x91d5ef3b, 0x9f3207ea, 0x8c1a3e99, 0x82fdd648, 0xaa4a4c7f, 0xa4ada4ae, 0xb7859ddd, 0xb962750c, 0x1e307184, 0x10d79955, 0x03ffa026, 0x0d1848f7, 0x25afd2c0, 0x2b483a11, 0x38600362, 0x3687ebb3, 0x690f370c, 0x67e8dfdd, 0x74c0e6ae, 0x7a270e7f, 0x52909448, 0x5c777c99, 0x4f5f45ea, 0x41b8ad3b, 0xf04efc94, 0xfea91445, 0xed812d36, 0xe366c5e7, 0xcbd15fd0, 0xc536b701, 0xd61e8e72, 0xd8f966a3, 0x8771ba1c, 0x899652cd, 0x9abe6bbe, 0x9459836f, 0xbcee1958, 0xb209f189, 0xa121c8fa, 0xafc6202b, 0x19bc6de5, 0x175b8534, 0x0473bc47, 0x0a945496, 0x2223cea1, 0x2cc42670, 0x3fec1f03, 0x310bf7d2, 0x6e832b6d, 0x6064c3bc, 0x734cfacf, 0x7dab121e, 0x551c8829, 0x5bfb60f8, 0x48d3598b, 0x4634b15a, 0xf7c2e0f5, 0xf9250824, 0xea0d3157, 0xe4ead986, 0xcc5d43b1, 0xc2baab60, 0xd1929213, 0xdf757ac2, 0x80fda67d, 0x8e1a4eac, 0x9d3277df, 0x93d59f0e, 0xbb620539, 0xb585ede8, 0xa6add49b, 0xa84a3c4a, 0x11284946, 0x1fcfa197, 0x0ce798e4, 0x02007035, 0x2ab7ea02, 0x245002d3, 0x37783ba0, 0x399fd371, 0x66170fce, 0x68f0e71f, 0x7bd8de6c, 0x753f36bd, 0x5d88ac8a, 0x536f445b, 0x40477d28, 0x4ea095f9, 0xff56c456, 0xf1b12c87, 0xe29915f4, 0xec7efd25, 0xc4c96712, 0xca2e8fc3, 0xd906b6b0, 0xd7e15e61, 0x886982de, 0x868e6a0f, 0x95a6537c, 0x9b41bbad, 0xb3f6219a, 0xbd11c94b, 0xae39f038, 0xa0de18e9, 0x16a45527, 0x1843bdf6, 0x0b6b8485, 0x058c6c54, 0x2d3bf663, 0x23dc1eb2, 0x30f427c1, 0x3e13cf10, 0x619b13af, 0x6f7cfb7e, 0x7c54c20d, 0x72b32adc, 0x5a04b0eb, 0x54e3583a, 0x47cb6149, 0x492c8998, 0xf8dad837, 0xf63d30e6, 0xe5150995, 0xebf2e144, 0xc3457b73, 0xcda293a2, 0xde8aaad1, 0xd06d4200, 0x8fe59ebf, 0x8102766e, 0x922a4f1d, 0x9ccda7cc, 0xb47a3dfb, 0xba9dd52a, 0xa9b5ec59, 0xa7520488}, {0x00000000, 0x3c60e308, 0x78c1c610, 0x44a12518, 0xf1838c20, 0xcde36f28, 0x89424a30, 0xb522a938, 0x38761e01, 0x0416fd09, 0x40b7d811, 0x7cd73b19, 0xc9f59221, 0xf5957129, 0xb1345431, 0x8d54b739, 0x70ec3c02, 0x4c8cdf0a, 0x082dfa12, 0x344d191a, 0x816fb022, 0xbd0f532a, 0xf9ae7632, 0xc5ce953a, 0x489a2203, 0x74fac10b, 0x305be413, 0x0c3b071b, 0xb919ae23, 0x85794d2b, 0xc1d86833, 0xfdb88b3b, 0xe1d87804, 0xddb89b0c, 0x9919be14, 0xa5795d1c, 0x105bf424, 0x2c3b172c, 0x689a3234, 0x54fad13c, 0xd9ae6605, 0xe5ce850d, 0xa16fa015, 0x9d0f431d, 0x282dea25, 0x144d092d, 0x50ec2c35, 0x6c8ccf3d, 0x91344406, 0xad54a70e, 0xe9f58216, 0xd595611e, 0x60b7c826, 0x5cd72b2e, 0x18760e36, 0x2416ed3e, 0xa9425a07, 0x9522b90f, 0xd1839c17, 0xede37f1f, 0x58c1d627, 0x64a1352f, 0x20001037, 0x1c60f33f, 0x18c1f649, 0x24a11541, 0x60003059, 0x5c60d351, 0xe9427a69, 0xd5229961, 0x9183bc79, 0xade35f71, 0x20b7e848, 0x1cd70b40, 0x58762e58, 0x6416cd50, 0xd1346468, 0xed548760, 0xa9f5a278, 0x95954170, 0x682dca4b, 0x544d2943, 0x10ec0c5b, 0x2c8cef53, 0x99ae466b, 0xa5cea563, 0xe16f807b, 0xdd0f6373, 0x505bd44a, 0x6c3b3742, 0x289a125a, 0x14faf152, 0xa1d8586a, 0x9db8bb62, 0xd9199e7a, 0xe5797d72, 0xf9198e4d, 0xc5796d45, 0x81d8485d, 0xbdb8ab55, 0x089a026d, 0x34fae165, 0x705bc47d, 0x4c3b2775, 0xc16f904c, 0xfd0f7344, 0xb9ae565c, 0x85ceb554, 0x30ec1c6c, 0x0c8cff64, 0x482dda7c, 0x744d3974, 0x89f5b24f, 0xb5955147, 0xf134745f, 0xcd549757, 0x78763e6f, 0x4416dd67, 0x00b7f87f, 0x3cd71b77, 0xb183ac4e, 0x8de34f46, 0xc9426a5e, 0xf5228956, 0x4000206e, 0x7c60c366, 0x38c1e67e, 0x04a10576, 0x3183ec92, 0x0de30f9a, 0x49422a82, 0x7522c98a, 0xc00060b2, 0xfc6083ba, 0xb8c1a6a2, 0x84a145aa, 0x09f5f293, 0x3595119b, 0x71343483, 0x4d54d78b, 0xf8767eb3, 0xc4169dbb, 0x80b7b8a3, 0xbcd75bab, 0x416fd090, 0x7d0f3398, 0x39ae1680, 0x05cef588, 0xb0ec5cb0, 0x8c8cbfb8, 0xc82d9aa0, 0xf44d79a8, 0x7919ce91, 0x45792d99, 0x01d80881, 0x3db8eb89, 0x889a42b1, 0xb4faa1b9, 0xf05b84a1, 0xcc3b67a9, 0xd05b9496, 0xec3b779e, 0xa89a5286, 0x94fab18e, 0x21d818b6, 0x1db8fbbe, 0x5919dea6, 0x65793dae, 0xe82d8a97, 0xd44d699f, 0x90ec4c87, 0xac8caf8f, 0x19ae06b7, 0x25cee5bf, 0x616fc0a7, 0x5d0f23af, 0xa0b7a894, 0x9cd74b9c, 0xd8766e84, 0xe4168d8c, 0x513424b4, 0x6d54c7bc, 0x29f5e2a4, 0x159501ac, 0x98c1b695, 0xa4a1559d, 0xe0007085, 0xdc60938d, 0x69423ab5, 0x5522d9bd, 0x1183fca5, 0x2de31fad, 0x29421adb, 0x1522f9d3, 0x5183dccb, 0x6de33fc3, 0xd8c196fb, 0xe4a175f3, 0xa00050eb, 0x9c60b3e3, 0x113404da, 0x2d54e7d2, 0x69f5c2ca, 0x559521c2, 0xe0b788fa, 0xdcd76bf2, 0x98764eea, 0xa416ade2, 0x59ae26d9, 0x65cec5d1, 0x216fe0c9, 0x1d0f03c1, 0xa82daaf9, 0x944d49f1, 0xd0ec6ce9, 0xec8c8fe1, 0x61d838d8, 0x5db8dbd0, 0x1919fec8, 0x25791dc0, 0x905bb4f8, 0xac3b57f0, 0xe89a72e8, 0xd4fa91e0, 0xc89a62df, 0xf4fa81d7, 0xb05ba4cf, 0x8c3b47c7, 0x3919eeff, 0x05790df7, 0x41d828ef, 0x7db8cbe7, 0xf0ec7cde, 0xcc8c9fd6, 0x882dbace, 0xb44d59c6, 0x016ff0fe, 0x3d0f13f6, 0x79ae36ee, 0x45ced5e6, 0xb8765edd, 0x8416bdd5, 0xc0b798cd, 0xfcd77bc5, 0x49f5d2fd, 0x759531f5, 0x313414ed, 0x0d54f7e5, 0x800040dc, 0xbc60a3d4, 0xf8c186cc, 0xc4a165c4, 0x7183ccfc, 0x4de32ff4, 0x09420aec, 0x3522e9e4}, {0x00000000, 0x6307d924, 0xc60fb248, 0xa5086b6c, 0x576e62d1, 0x3469bbf5, 0x9161d099, 0xf26609bd, 0xaedcc5a2, 0xcddb1c86, 0x68d377ea, 0x0bd4aece, 0xf9b2a773, 0x9ab57e57, 0x3fbd153b, 0x5cbacc1f, 0x86c88d05, 0xe5cf5421, 0x40c73f4d, 0x23c0e669, 0xd1a6efd4, 0xb2a136f0, 0x17a95d9c, 0x74ae84b8, 0x281448a7, 0x4b139183, 0xee1bfaef, 0x8d1c23cb, 0x7f7a2a76, 0x1c7df352, 0xb975983e, 0xda72411a, 0xd6e01c4b, 0xb5e7c56f, 0x10efae03, 0x73e87727, 0x818e7e9a, 0xe289a7be, 0x4781ccd2, 0x248615f6, 0x783cd9e9, 0x1b3b00cd, 0xbe336ba1, 0xdd34b285, 0x2f52bb38, 0x4c55621c, 0xe95d0970, 0x8a5ad054, 0x5028914e, 0x332f486a, 0x96272306, 0xf520fa22, 0x0746f39f, 0x64412abb, 0xc14941d7, 0xa24e98f3, 0xfef454ec, 0x9df38dc8, 0x38fbe6a4, 0x5bfc3f80, 0xa99a363d, 0xca9def19, 0x6f958475, 0x0c925d51, 0x76b13ed7, 0x15b6e7f3, 0xb0be8c9f, 0xd3b955bb, 0x21df5c06, 0x42d88522, 0xe7d0ee4e, 0x84d7376a, 0xd86dfb75, 0xbb6a2251, 0x1e62493d, 0x7d659019, 0x8f0399a4, 0xec044080, 0x490c2bec, 0x2a0bf2c8, 0xf079b3d2, 0x937e6af6, 0x3676019a, 0x5571d8be, 0xa717d103, 0xc4100827, 0x6118634b, 0x021fba6f, 0x5ea57670, 0x3da2af54, 0x98aac438, 0xfbad1d1c, 0x09cb14a1, 0x6acccd85, 0xcfc4a6e9, 0xacc37fcd, 0xa051229c, 0xc356fbb8, 0x665e90d4, 0x055949f0, 0xf73f404d, 0x94389969, 0x3130f205, 0x52372b21, 0x0e8de73e, 0x6d8a3e1a, 0xc8825576, 0xab858c52, 0x59e385ef, 0x3ae45ccb, 0x9fec37a7, 0xfcebee83, 0x2699af99, 0x459e76bd, 0xe0961dd1, 0x8391c4f5, 0x71f7cd48, 0x12f0146c, 0xb7f87f00, 0xd4ffa624, 0x88456a3b, 0xeb42b31f, 0x4e4ad873, 0x2d4d0157, 0xdf2b08ea, 0xbc2cd1ce, 0x1924baa2, 0x7a236386, 0xed627dae, 0x8e65a48a, 0x2b6dcfe6, 0x486a16c2, 0xba0c1f7f, 0xd90bc65b, 0x7c03ad37, 0x1f047413, 0x43beb80c, 0x20b96128, 0x85b10a44, 0xe6b6d360, 0x14d0dadd, 0x77d703f9, 0xd2df6895, 0xb1d8b1b1, 0x6baaf0ab, 0x08ad298f, 0xada542e3, 0xcea29bc7, 0x3cc4927a, 0x5fc34b5e, 0xfacb2032, 0x99ccf916, 0xc5763509, 0xa671ec2d, 0x03798741, 0x607e5e65, 0x921857d8, 0xf11f8efc, 0x5417e590, 0x37103cb4, 0x3b8261e5, 0x5885b8c1, 0xfd8dd3ad, 0x9e8a0a89, 0x6cec0334, 0x0febda10, 0xaae3b17c, 0xc9e46858, 0x955ea447, 0xf6597d63, 0x5351160f, 0x3056cf2b, 0xc230c696, 0xa1371fb2, 0x043f74de, 0x6738adfa, 0xbd4aece0, 0xde4d35c4, 0x7b455ea8, 0x1842878c, 0xea248e31, 0x89235715, 0x2c2b3c79, 0x4f2ce55d, 0x13962942, 0x7091f066, 0xd5999b0a, 0xb69e422e, 0x44f84b93, 0x27ff92b7, 0x82f7f9db, 0xe1f020ff, 0x9bd34379, 0xf8d49a5d, 0x5ddcf131, 0x3edb2815, 0xccbd21a8, 0xafbaf88c, 0x0ab293e0, 0x69b54ac4, 0x350f86db, 0x56085fff, 0xf3003493, 0x9007edb7, 0x6261e40a, 0x01663d2e, 0xa46e5642, 0xc7698f66, 0x1d1bce7c, 0x7e1c1758, 0xdb147c34, 0xb813a510, 0x4a75acad, 0x29727589, 0x8c7a1ee5, 0xef7dc7c1, 0xb3c70bde, 0xd0c0d2fa, 0x75c8b996, 0x16cf60b2, 0xe4a9690f, 0x87aeb02b, 0x22a6db47, 0x41a10263, 0x4d335f32, 0x2e348616, 0x8b3ced7a, 0xe83b345e, 0x1a5d3de3, 0x795ae4c7, 0xdc528fab, 0xbf55568f, 0xe3ef9a90, 0x80e843b4, 0x25e028d8, 0x46e7f1fc, 0xb481f841, 0xd7862165, 0x728e4a09, 0x1189932d, 0xcbfbd237, 0xa8fc0b13, 0x0df4607f, 0x6ef3b95b, 0x9c95b0e6, 0xff9269c2, 0x5a9a02ae, 0x399ddb8a, 0x65271795, 0x0620ceb1, 0xa328a5dd, 0xc02f7cf9, 0x32497544, 0x514eac60, 0xf446c70c, 0x97411e28}, {0x00000000, 0x01b5fd1d, 0x036bfa3a, 0x02de0727, 0x06d7f474, 0x07620969, 0x05bc0e4e, 0x0409f353, 0x0dafe8e8, 0x0c1a15f5, 0x0ec412d2, 0x0f71efcf, 0x0b781c9c, 0x0acde181, 0x0813e6a6, 0x09a61bbb, 0x1b5fd1d0, 0x1aea2ccd, 0x18342bea, 0x1981d6f7, 0x1d8825a4, 0x1c3dd8b9, 0x1ee3df9e, 0x1f562283, 0x16f03938, 0x1745c425, 0x159bc302, 0x142e3e1f, 0x1027cd4c, 0x11923051, 0x134c3776, 0x12f9ca6b, 0x36bfa3a0, 0x370a5ebd, 0x35d4599a, 0x3461a487, 0x306857d4, 0x31ddaac9, 0x3303adee, 0x32b650f3, 0x3b104b48, 0x3aa5b655, 0x387bb172, 0x39ce4c6f, 0x3dc7bf3c, 0x3c724221, 0x3eac4506, 0x3f19b81b, 0x2de07270, 0x2c558f6d, 0x2e8b884a, 0x2f3e7557, 0x2b378604, 0x2a827b19, 0x285c7c3e, 0x29e98123, 0x204f9a98, 0x21fa6785, 0x232460a2, 0x22919dbf, 0x26986eec, 0x272d93f1, 0x25f394d6, 0x244669cb, 0x6d7f4740, 0x6ccaba5d, 0x6e14bd7a, 0x6fa14067, 0x6ba8b334, 0x6a1d4e29, 0x68c3490e, 0x6976b413, 0x60d0afa8, 0x616552b5, 0x63bb5592, 0x620ea88f, 0x66075bdc, 0x67b2a6c1, 0x656ca1e6, 0x64d95cfb, 0x76209690, 0x77956b8d, 0x754b6caa, 0x74fe91b7, 0x70f762e4, 0x71429ff9, 0x739c98de, 0x722965c3, 0x7b8f7e78, 0x7a3a8365, 0x78e48442, 0x7951795f, 0x7d588a0c, 0x7ced7711, 0x7e337036, 0x7f868d2b, 0x5bc0e4e0, 0x5a7519fd, 0x58ab1eda, 0x591ee3c7, 0x5d171094, 0x5ca2ed89, 0x5e7ceaae, 0x5fc917b3, 0x566f0c08, 0x57daf115, 0x5504f632, 0x54b10b2f, 0x50b8f87c, 0x510d0561, 0x53d30246, 0x5266ff5b, 0x409f3530, 0x412ac82d, 0x43f4cf0a, 0x42413217, 0x4648c144, 0x47fd3c59, 0x45233b7e, 0x4496c663, 0x4d30ddd8, 0x4c8520c5, 0x4e5b27e2, 0x4feedaff, 0x4be729ac, 0x4a52d4b1, 0x488cd396, 0x49392e8b, 0xdafe8e80, 0xdb4b739d, 0xd99574ba, 0xd82089a7, 0xdc297af4, 0xdd9c87e9, 0xdf4280ce, 0xdef77dd3, 0xd7516668, 0xd6e49b75, 0xd43a9c52, 0xd58f614f, 0xd186921c, 0xd0336f01, 0xd2ed6826, 0xd358953b, 0xc1a15f50, 0xc014a24d, 0xc2caa56a, 0xc37f5877, 0xc776ab24, 0xc6c35639, 0xc41d511e, 0xc5a8ac03, 0xcc0eb7b8, 0xcdbb4aa5, 0xcf654d82, 0xced0b09f, 0xcad943cc, 0xcb6cbed1, 0xc9b2b9f6, 0xc80744eb, 0xec412d20, 0xedf4d03d, 0xef2ad71a, 0xee9f2a07, 0xea96d954, 0xeb232449, 0xe9fd236e, 0xe848de73, 0xe1eec5c8, 0xe05b38d5, 0xe2853ff2, 0xe330c2ef, 0xe73931bc, 0xe68ccca1, 0xe452cb86, 0xe5e7369b, 0xf71efcf0, 0xf6ab01ed, 0xf47506ca, 0xf5c0fbd7, 0xf1c90884, 0xf07cf599, 0xf2a2f2be, 0xf3170fa3, 0xfab11418, 0xfb04e905, 0xf9daee22, 0xf86f133f, 0xfc66e06c, 0xfdd31d71, 0xff0d1a56, 0xfeb8e74b, 0xb781c9c0, 0xb63434dd, 0xb4ea33fa, 0xb55fcee7, 0xb1563db4, 0xb0e3c0a9, 0xb23dc78e, 0xb3883a93, 0xba2e2128, 0xbb9bdc35, 0xb945db12, 0xb8f0260f, 0xbcf9d55c, 0xbd4c2841, 0xbf922f66, 0xbe27d27b, 0xacde1810, 0xad6be50d, 0xafb5e22a, 0xae001f37, 0xaa09ec64, 0xabbc1179, 0xa962165e, 0xa8d7eb43, 0xa171f0f8, 0xa0c40de5, 0xa21a0ac2, 0xa3aff7df, 0xa7a6048c, 0xa613f991, 0xa4cdfeb6, 0xa57803ab, 0x813e6a60, 0x808b977d, 0x8255905a, 0x83e06d47, 0x87e99e14, 0x865c6309, 0x8482642e, 0x85379933, 0x8c918288, 0x8d247f95, 0x8ffa78b2, 0x8e4f85af, 0x8a4676fc, 0x8bf38be1, 0x892d8cc6, 0x889871db, 0x9a61bbb0, 0x9bd446ad, 0x990a418a, 0x98bfbc97, 0x9cb64fc4, 0x9d03b2d9, 0x9fddb5fe, 0x9e6848e3, 0x97ce5358, 0x967bae45, 0x94a5a962, 0x9510547f, 0x9119a72c, 0x90ac5a31, 0x92725d16, 0x93c7a00b}, {0x00000000, 0x6e8c1b41, 0xdd183682, 0xb3942dc3, 0x61416b45, 0x0fcd7004, 0xbc595dc7, 0xd2d54686, 0xc282d68a, 0xac0ecdcb, 0x1f9ae008, 0x7116fb49, 0xa3c3bdcf, 0xcd4fa68e, 0x7edb8b4d, 0x1057900c, 0x5e74ab55, 0x30f8b014, 0x836c9dd7, 0xede08696, 0x3f35c010, 0x51b9db51, 0xe22df692, 0x8ca1edd3, 0x9cf67ddf, 0xf27a669e, 0x41ee4b5d, 0x2f62501c, 0xfdb7169a, 0x933b0ddb, 0x20af2018, 0x4e233b59, 0xbce956aa, 0xd2654deb, 0x61f16028, 0x0f7d7b69, 0xdda83def, 0xb32426ae, 0x00b00b6d, 0x6e3c102c, 0x7e6b8020, 0x10e79b61, 0xa373b6a2, 0xcdffade3, 0x1f2aeb65, 0x71a6f024, 0xc232dde7, 0xacbec6a6, 0xe29dfdff, 0x8c11e6be, 0x3f85cb7d, 0x5109d03c, 0x83dc96ba, 0xed508dfb, 0x5ec4a038, 0x3048bb79, 0x201f2b75, 0x4e933034, 0xfd071df7, 0x938b06b6, 0x415e4030, 0x2fd25b71, 0x9c4676b2, 0xf2ca6df3, 0xa2a3ab15, 0xcc2fb054, 0x7fbb9d97, 0x113786d6, 0xc3e2c050, 0xad6edb11, 0x1efaf6d2, 0x7076ed93, 0x60217d9f, 0x0ead66de, 0xbd394b1d, 0xd3b5505c, 0x016016da, 0x6fec0d9b, 0xdc782058, 0xb2f43b19, 0xfcd70040, 0x925b1b01, 0x21cf36c2, 0x4f432d83, 0x9d966b05, 0xf31a7044, 0x408e5d87, 0x2e0246c6, 0x3e55d6ca, 0x50d9cd8b, 0xe34de048, 0x8dc1fb09, 0x5f14bd8f, 0x3198a6ce, 0x820c8b0d, 0xec80904c, 0x1e4afdbf, 0x70c6e6fe, 0xc352cb3d, 0xadded07c, 0x7f0b96fa, 0x11878dbb, 0xa213a078, 0xcc9fbb39, 0xdcc82b35, 0xb2443074, 0x01d01db7, 0x6f5c06f6, 0xbd894070, 0xd3055b31, 0x609176f2, 0x0e1d6db3, 0x403e56ea, 0x2eb24dab, 0x9d266068, 0xf3aa7b29, 0x217f3daf, 0x4ff326ee, 0xfc670b2d, 0x92eb106c, 0x82bc8060, 0xec309b21, 0x5fa4b6e2, 0x3128ada3, 0xe3fdeb25, 0x8d71f064, 0x3ee5dda7, 0x5069c6e6, 0x9e36506b, 0xf0ba4b2a, 0x432e66e9, 0x2da27da8, 0xff773b2e, 0x91fb206f, 0x226f0dac, 0x4ce316ed, 0x5cb486e1, 0x32389da0, 0x81acb063, 0xef20ab22, 0x3df5eda4, 0x5379f6e5, 0xe0eddb26, 0x8e61c067, 0xc042fb3e, 0xaecee07f, 0x1d5acdbc, 0x73d6d6fd, 0xa103907b, 0xcf8f8b3a, 0x7c1ba6f9, 0x1297bdb8, 0x02c02db4, 0x6c4c36f5, 0xdfd81b36, 0xb1540077, 0x638146f1, 0x0d0d5db0, 0xbe997073, 0xd0156b32, 0x22df06c1, 0x4c531d80, 0xffc73043, 0x914b2b02, 0x439e6d84, 0x2d1276c5, 0x9e865b06, 0xf00a4047, 0xe05dd04b, 0x8ed1cb0a, 0x3d45e6c9, 0x53c9fd88, 0x811cbb0e, 0xef90a04f, 0x5c048d8c, 0x328896cd, 0x7cabad94, 0x1227b6d5, 0xa1b39b16, 0xcf3f8057, 0x1deac6d1, 0x7366dd90, 0xc0f2f053, 0xae7eeb12, 0xbe297b1e, 0xd0a5605f, 0x63314d9c, 0x0dbd56dd, 0xdf68105b, 0xb1e40b1a, 0x027026d9, 0x6cfc3d98, 0x3c95fb7e, 0x5219e03f, 0xe18dcdfc, 0x8f01d6bd, 0x5dd4903b, 0x33588b7a, 0x80cca6b9, 0xee40bdf8, 0xfe172df4, 0x909b36b5, 0x230f1b76, 0x4d830037, 0x9f5646b1, 0xf1da5df0, 0x424e7033, 0x2cc26b72, 0x62e1502b, 0x0c6d4b6a, 0xbff966a9, 0xd1757de8, 0x03a03b6e, 0x6d2c202f, 0xdeb80dec, 0xb03416ad, 0xa06386a1, 0xceef9de0, 0x7d7bb023, 0x13f7ab62, 0xc122ede4, 0xafaef6a5, 0x1c3adb66, 0x72b6c027, 0x807cadd4, 0xeef0b695, 0x5d649b56, 0x33e88017, 0xe13dc691, 0x8fb1ddd0, 0x3c25f013, 0x52a9eb52, 0x42fe7b5e, 0x2c72601f, 0x9fe64ddc, 0xf16a569d, 0x23bf101b, 0x4d330b5a, 0xfea72699, 0x902b3dd8, 0xde080681, 0xb0841dc0, 0x03103003, 0x6d9c2b42, 0xbf496dc4, 0xd1c57685, 0x62515b46, 0x0cdd4007, 0x1c8ad00b, 0x7206cb4a, 0xc192e689, 0xaf1efdc8, 0x7dcbbb4e, 0x1347a00f, 0xa0d38dcc, 0xce5f968d}, {0x00000000, 0xe71da697, 0x154a4b6f, 0xf257edf8, 0x2a9496de, 0xcd893049, 0x3fdeddb1, 0xd8c37b26, 0x55292dbc, 0xb2348b2b, 0x406366d3, 0xa77ec044, 0x7fbdbb62, 0x98a01df5, 0x6af7f00d, 0x8dea569a, 0xaa525b78, 0x4d4ffdef, 0xbf181017, 0x5805b680, 0x80c6cda6, 0x67db6b31, 0x958c86c9, 0x7291205e, 0xff7b76c4, 0x1866d053, 0xea313dab, 0x0d2c9b3c, 0xd5efe01a, 0x32f2468d, 0xc0a5ab75, 0x27b80de2, 0x8fd5b0b1, 0x68c81626, 0x9a9ffbde, 0x7d825d49, 0xa541266f, 0x425c80f8, 0xb00b6d00, 0x5716cb97, 0xdafc9d0d, 0x3de13b9a, 0xcfb6d662, 0x28ab70f5, 0xf0680bd3, 0x1775ad44, 0xe52240bc, 0x023fe62b, 0x2587ebc9, 0xc29a4d5e, 0x30cda0a6, 0xd7d00631, 0x0f137d17, 0xe80edb80, 0x1a593678, 0xfd4490ef, 0x70aec675, 0x97b360e2, 0x65e48d1a, 0x82f92b8d, 0x5a3a50ab, 0xbd27f63c, 0x4f701bc4, 0xa86dbd53, 0xc4da6723, 0x23c7c1b4, 0xd1902c4c, 0x368d8adb, 0xee4ef1fd, 0x0953576a, 0xfb04ba92, 0x1c191c05, 0x91f34a9f, 0x76eeec08, 0x84b901f0, 0x63a4a767, 0xbb67dc41, 0x5c7a7ad6, 0xae2d972e, 0x493031b9, 0x6e883c5b, 0x89959acc, 0x7bc27734, 0x9cdfd1a3, 0x441caa85, 0xa3010c12, 0x5156e1ea, 0xb64b477d, 0x3ba111e7, 0xdcbcb770, 0x2eeb5a88, 0xc9f6fc1f, 0x11358739, 0xf62821ae, 0x047fcc56, 0xe3626ac1, 0x4b0fd792, 0xac127105, 0x5e459cfd, 0xb9583a6a, 0x619b414c, 0x8686e7db, 0x74d10a23, 0x93ccacb4, 0x1e26fa2e, 0xf93b5cb9, 0x0b6cb141, 0xec7117d6, 0x34b26cf0, 0xd3afca67, 0x21f8279f, 0xc6e58108, 0xe15d8cea, 0x06402a7d, 0xf417c785, 0x130a6112, 0xcbc91a34, 0x2cd4bca3, 0xde83515b, 0x399ef7cc, 0xb474a156, 0x536907c1, 0xa13eea39, 0x46234cae, 0x9ee03788, 0x79fd911f, 0x8baa7ce7, 0x6cb7da70, 0x52c5c807, 0xb5d86e90, 0x478f8368, 0xa09225ff, 0x78515ed9, 0x9f4cf84e, 0x6d1b15b6, 0x8a06b321, 0x07ece5bb, 0xe0f1432c, 0x12a6aed4, 0xf5bb0843, 0x2d787365, 0xca65d5f2, 0x3832380a, 0xdf2f9e9d, 0xf897937f, 0x1f8a35e8, 0xedddd810, 0x0ac07e87, 0xd20305a1, 0x351ea336, 0xc7494ece, 0x2054e859, 0xadbebec3, 0x4aa31854, 0xb8f4f5ac, 0x5fe9533b, 0x872a281d, 0x60378e8a, 0x92606372, 0x757dc5e5, 0xdd1078b6, 0x3a0dde21, 0xc85a33d9, 0x2f47954e, 0xf784ee68, 0x109948ff, 0xe2cea507, 0x05d30390, 0x8839550a, 0x6f24f39d, 0x9d731e65, 0x7a6eb8f2, 0xa2adc3d4, 0x45b06543, 0xb7e788bb, 0x50fa2e2c, 0x774223ce, 0x905f8559, 0x620868a1, 0x8515ce36, 0x5dd6b510, 0xbacb1387, 0x489cfe7f, 0xaf8158e8, 0x226b0e72, 0xc576a8e5, 0x3721451d, 0xd03ce38a, 0x08ff98ac, 0xefe23e3b, 0x1db5d3c3, 0xfaa87554, 0x961faf24, 0x710209b3, 0x8355e44b, 0x644842dc, 0xbc8b39fa, 0x5b969f6d, 0xa9c17295, 0x4edcd402, 0xc3368298, 0x242b240f, 0xd67cc9f7, 0x31616f60, 0xe9a21446, 0x0ebfb2d1, 0xfce85f29, 0x1bf5f9be, 0x3c4df45c, 0xdb5052cb, 0x2907bf33, 0xce1a19a4, 0x16d96282, 0xf1c4c415, 0x039329ed, 0xe48e8f7a, 0x6964d9e0, 0x8e797f77, 0x7c2e928f, 0x9b333418, 0x43f04f3e, 0xa4ede9a9, 0x56ba0451, 0xb1a7a2c6, 0x19ca1f95, 0xfed7b902, 0x0c8054fa, 0xeb9df26d, 0x335e894b, 0xd4432fdc, 0x2614c224, 0xc10964b3, 0x4ce33229, 0xabfe94be, 0x59a97946, 0xbeb4dfd1, 0x6677a4f7, 0x816a0260, 0x733def98, 0x9420490f, 0xb39844ed, 0x5485e27a, 0xa6d20f82, 0x41cfa915, 0x990cd233, 0x7e1174a4, 0x8c46995c, 0x6b5b3fcb, 0xe6b16951, 0x01accfc6, 0xf3fb223e, 0x14e684a9, 0xcc25ff8f, 0x2b385918, 0xd96fb4e0, 0x3e721277}, {0x00000000, 0xa58b900e, 0x9066265d, 0x35edb653, 0xfbbd4afb, 0x5e36daf5, 0x6bdb6ca6, 0xce50fca8, 0x2c0b93b7, 0x898003b9, 0xbc6db5ea, 0x19e625e4, 0xd7b6d94c, 0x723d4942, 0x47d0ff11, 0xe25b6f1f, 0x5817276e, 0xfd9cb760, 0xc8710133, 0x6dfa913d, 0xa3aa6d95, 0x0621fd9b, 0x33cc4bc8, 0x9647dbc6, 0x741cb4d9, 0xd19724d7, 0xe47a9284, 0x41f1028a, 0x8fa1fe22, 0x2a2a6e2c, 0x1fc7d87f, 0xba4c4871, 0xb02e4edc, 0x15a5ded2, 0x20486881, 0x85c3f88f, 0x4b930427, 0xee189429, 0xdbf5227a, 0x7e7eb274, 0x9c25dd6b, 0x39ae4d65, 0x0c43fb36, 0xa9c86b38, 0x67989790, 0xc213079e, 0xf7feb1cd, 0x527521c3, 0xe83969b2, 0x4db2f9bc, 0x785f4fef, 0xddd4dfe1, 0x13842349, 0xb60fb347, 0x83e20514, 0x2669951a, 0xc432fa05, 0x61b96a0b, 0x5454dc58, 0xf1df4c56, 0x3f8fb0fe, 0x9a0420f0, 0xafe996a3, 0x0a6206ad, 0xbb2d9bf9, 0x1ea60bf7, 0x2b4bbda4, 0x8ec02daa, 0x4090d102, 0xe51b410c, 0xd0f6f75f, 0x757d6751, 0x9726084e, 0x32ad9840, 0x07402e13, 0xa2cbbe1d, 0x6c9b42b5, 0xc910d2bb, 0xfcfd64e8, 0x5976f4e6, 0xe33abc97, 0x46b12c99, 0x735c9aca, 0xd6d70ac4, 0x1887f66c, 0xbd0c6662, 0x88e1d031, 0x2d6a403f, 0xcf312f20, 0x6ababf2e, 0x5f57097d, 0xfadc9973, 0x348c65db, 0x9107f5d5, 0xa4ea4386, 0x0161d388, 0x0b03d525, 0xae88452b, 0x9b65f378, 0x3eee6376, 0xf0be9fde, 0x55350fd0, 0x60d8b983, 0xc553298d, 0x27084692, 0x8283d69c, 0xb76e60cf, 0x12e5f0c1, 0xdcb50c69, 0x793e9c67, 0x4cd32a34, 0xe958ba3a, 0x5314f24b, 0xf69f6245, 0xc372d416, 0x66f94418, 0xa8a9b8b0, 0x0d2228be, 0x38cf9eed, 0x9d440ee3, 0x7f1f61fc, 0xda94f1f2, 0xef7947a1, 0x4af2d7af, 0x84a22b07, 0x2129bb09, 0x14c40d5a, 0xb14f9d54, 0xad2a31b3, 0x08a1a1bd, 0x3d4c17ee, 0x98c787e0, 0x56977b48, 0xf31ceb46, 0xc6f15d15, 0x637acd1b, 0x8121a204, 0x24aa320a, 0x11478459, 0xb4cc1457, 0x7a9ce8ff, 0xdf1778f1, 0xeafacea2, 0x4f715eac, 0xf53d16dd, 0x50b686d3, 0x655b3080, 0xc0d0a08e, 0x0e805c26, 0xab0bcc28, 0x9ee67a7b, 0x3b6dea75, 0xd936856a, 0x7cbd1564, 0x4950a337, 0xecdb3339, 0x228bcf91, 0x87005f9f, 0xb2ede9cc, 0x176679c2, 0x1d047f6f, 0xb88fef61, 0x8d625932, 0x28e9c93c, 0xe6b93594, 0x4332a59a, 0x76df13c9, 0xd35483c7, 0x310fecd8, 0x94847cd6, 0xa169ca85, 0x04e25a8b, 0xcab2a623, 0x6f39362d, 0x5ad4807e, 0xff5f1070, 0x45135801, 0xe098c80f, 0xd5757e5c, 0x70feee52, 0xbeae12fa, 0x1b2582f4, 0x2ec834a7, 0x8b43a4a9, 0x6918cbb6, 0xcc935bb8, 0xf97eedeb, 0x5cf57de5, 0x92a5814d, 0x372e1143, 0x02c3a710, 0xa748371e, 0x1607aa4a, 0xb38c3a44, 0x86618c17, 0x23ea1c19, 0xedbae0b1, 0x483170bf, 0x7ddcc6ec, 0xd85756e2, 0x3a0c39fd, 0x9f87a9f3, 0xaa6a1fa0, 0x0fe18fae, 0xc1b17306, 0x643ae308, 0x51d7555b, 0xf45cc555, 0x4e108d24, 0xeb9b1d2a, 0xde76ab79, 0x7bfd3b77, 0xb5adc7df, 0x102657d1, 0x25cbe182, 0x8040718c, 0x621b1e93, 0xc7908e9d, 0xf27d38ce, 0x57f6a8c0, 0x99a65468, 0x3c2dc466, 0x09c07235, 0xac4be23b, 0xa629e496, 0x03a27498, 0x364fc2cb, 0x93c452c5, 0x5d94ae6d, 0xf81f3e63, 0xcdf28830, 0x6879183e, 0x8a227721, 0x2fa9e72f, 0x1a44517c, 0xbfcfc172, 0x719f3dda, 0xd414add4, 0xe1f91b87, 0x44728b89, 0xfe3ec3f8, 0x5bb553f6, 0x6e58e5a5, 0xcbd375ab, 0x05838903, 0xa008190d, 0x95e5af5e, 0x306e3f50, 0xd235504f, 0x77bec041, 0x42537612, 0xe7d8e61c, 0x29881ab4, 0x8c038aba, 0xb9ee3ce9, 0x1c65ace7}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x0000000000000000, 0x0e908ba500000000, 0x5d26669000000000, 0x53b6ed3500000000, 0xfb4abdfb00000000, 0xf5da365e00000000, 0xa66cdb6b00000000, 0xa8fc50ce00000000, 0xb7930b2c00000000, 0xb903808900000000, 0xeab56dbc00000000, 0xe425e61900000000, 0x4cd9b6d700000000, 0x42493d7200000000, 0x11ffd04700000000, 0x1f6f5be200000000, 0x6e27175800000000, 0x60b79cfd00000000, 0x330171c800000000, 0x3d91fa6d00000000, 0x956daaa300000000, 0x9bfd210600000000, 0xc84bcc3300000000, 0xc6db479600000000, 0xd9b41c7400000000, 0xd72497d100000000, 0x84927ae400000000, 0x8a02f14100000000, 0x22fea18f00000000, 0x2c6e2a2a00000000, 0x7fd8c71f00000000, 0x71484cba00000000, 0xdc4e2eb000000000, 0xd2dea51500000000, 0x8168482000000000, 0x8ff8c38500000000, 0x2704934b00000000, 0x299418ee00000000, 0x7a22f5db00000000, 0x74b27e7e00000000, 0x6bdd259c00000000, 0x654dae3900000000, 0x36fb430c00000000, 0x386bc8a900000000, 0x9097986700000000, 0x9e0713c200000000, 0xcdb1fef700000000, 0xc321755200000000, 0xb26939e800000000, 0xbcf9b24d00000000, 0xef4f5f7800000000, 0xe1dfd4dd00000000, 0x4923841300000000, 0x47b30fb600000000, 0x1405e28300000000, 0x1a95692600000000, 0x05fa32c400000000, 0x0b6ab96100000000, 0x58dc545400000000, 0x564cdff100000000, 0xfeb08f3f00000000, 0xf020049a00000000, 0xa396e9af00000000, 0xad06620a00000000, 0xf99b2dbb00000000, 0xf70ba61e00000000, 0xa4bd4b2b00000000, 0xaa2dc08e00000000, 0x02d1904000000000, 0x0c411be500000000, 0x5ff7f6d000000000, 0x51677d7500000000, 0x4e08269700000000, 0x4098ad3200000000, 0x132e400700000000, 0x1dbecba200000000, 0xb5429b6c00000000, 0xbbd210c900000000, 0xe864fdfc00000000, 0xe6f4765900000000, 0x97bc3ae300000000, 0x992cb14600000000, 0xca9a5c7300000000, 0xc40ad7d600000000, 0x6cf6871800000000, 0x62660cbd00000000, 0x31d0e18800000000, 0x3f406a2d00000000, 0x202f31cf00000000, 0x2ebfba6a00000000, 0x7d09575f00000000, 0x7399dcfa00000000, 0xdb658c3400000000, 0xd5f5079100000000, 0x8643eaa400000000, 0x88d3610100000000, 0x25d5030b00000000, 0x2b4588ae00000000, 0x78f3659b00000000, 0x7663ee3e00000000, 0xde9fbef000000000, 0xd00f355500000000, 0x83b9d86000000000, 0x8d2953c500000000, 0x9246082700000000, 0x9cd6838200000000, 0xcf606eb700000000, 0xc1f0e51200000000, 0x690cb5dc00000000, 0x679c3e7900000000, 0x342ad34c00000000, 0x3aba58e900000000, 0x4bf2145300000000, 0x45629ff600000000, 0x16d472c300000000, 0x1844f96600000000, 0xb0b8a9a800000000, 0xbe28220d00000000, 0xed9ecf3800000000, 0xe30e449d00000000, 0xfc611f7f00000000, 0xf2f194da00000000, 0xa14779ef00000000, 0xafd7f24a00000000, 0x072ba28400000000, 0x09bb292100000000, 0x5a0dc41400000000, 0x549d4fb100000000, 0xb3312aad00000000, 0xbda1a10800000000, 0xee174c3d00000000, 0xe087c79800000000, 0x487b975600000000, 0x46eb1cf300000000, 0x155df1c600000000, 0x1bcd7a6300000000, 0x04a2218100000000, 0x0a32aa2400000000, 0x5984471100000000, 0x5714ccb400000000, 0xffe89c7a00000000, 0xf17817df00000000, 0xa2cefaea00000000, 0xac5e714f00000000, 0xdd163df500000000, 0xd386b65000000000, 0x80305b6500000000, 0x8ea0d0c000000000, 0x265c800e00000000, 0x28cc0bab00000000, 0x7b7ae69e00000000, 0x75ea6d3b00000000, 0x6a8536d900000000, 0x6415bd7c00000000, 0x37a3504900000000, 0x3933dbec00000000, 0x91cf8b2200000000, 0x9f5f008700000000, 0xcce9edb200000000, 0xc279661700000000, 0x6f7f041d00000000, 0x61ef8fb800000000, 0x3259628d00000000, 0x3cc9e92800000000, 0x9435b9e600000000, 0x9aa5324300000000, 0xc913df7600000000, 0xc78354d300000000, 0xd8ec0f3100000000, 0xd67c849400000000, 0x85ca69a100000000, 0x8b5ae20400000000, 0x23a6b2ca00000000, 0x2d36396f00000000, 0x7e80d45a00000000, 0x70105fff00000000, 0x0158134500000000, 0x0fc898e000000000, 0x5c7e75d500000000, 0x52eefe7000000000, 0xfa12aebe00000000, 0xf482251b00000000, 0xa734c82e00000000, 0xa9a4438b00000000, 0xb6cb186900000000, 0xb85b93cc00000000, 0xebed7ef900000000, 0xe57df55c00000000, 0x4d81a59200000000, 0x43112e3700000000, 0x10a7c30200000000, 0x1e3748a700000000, 0x4aaa071600000000, 0x443a8cb300000000, 0x178c618600000000, 0x191cea2300000000, 0xb1e0baed00000000, 0xbf70314800000000, 0xecc6dc7d00000000, 0xe25657d800000000, 0xfd390c3a00000000, 0xf3a9879f00000000, 0xa01f6aaa00000000, 0xae8fe10f00000000, 0x0673b1c100000000, 0x08e33a6400000000, 0x5b55d75100000000, 0x55c55cf400000000, 0x248d104e00000000, 0x2a1d9beb00000000, 0x79ab76de00000000, 0x773bfd7b00000000, 0xdfc7adb500000000, 0xd157261000000000, 0x82e1cb2500000000, 0x8c71408000000000, 0x931e1b6200000000, 0x9d8e90c700000000, 0xce387df200000000, 0xc0a8f65700000000, 0x6854a69900000000, 0x66c42d3c00000000, 0x3572c00900000000, 0x3be24bac00000000, 0x96e429a600000000, 0x9874a20300000000, 0xcbc24f3600000000, 0xc552c49300000000, 0x6dae945d00000000, 0x633e1ff800000000, 0x3088f2cd00000000, 0x3e18796800000000, 0x2177228a00000000, 0x2fe7a92f00000000, 0x7c51441a00000000, 0x72c1cfbf00000000, 0xda3d9f7100000000, 0xd4ad14d400000000, 0x871bf9e100000000, 0x898b724400000000, 0xf8c33efe00000000, 0xf653b55b00000000, 0xa5e5586e00000000, 0xab75d3cb00000000, 0x0389830500000000, 0x0d1908a000000000, 0x5eafe59500000000, 0x503f6e3000000000, 0x4f5035d200000000, 0x41c0be7700000000, 0x1276534200000000, 0x1ce6d8e700000000, 0xb41a882900000000, 0xba8a038c00000000, 0xe93ceeb900000000, 0xe7ac651c00000000}, {0x0000000000000000, 0x97a61de700000000, 0x6f4b4a1500000000, 0xf8ed57f200000000, 0xde96942a00000000, 0x493089cd00000000, 0xb1ddde3f00000000, 0x267bc3d800000000, 0xbc2d295500000000, 0x2b8b34b200000000, 0xd366634000000000, 0x44c07ea700000000, 0x62bbbd7f00000000, 0xf51da09800000000, 0x0df0f76a00000000, 0x9a56ea8d00000000, 0x785b52aa00000000, 0xeffd4f4d00000000, 0x171018bf00000000, 0x80b6055800000000, 0xa6cdc68000000000, 0x316bdb6700000000, 0xc9868c9500000000, 0x5e20917200000000, 0xc4767bff00000000, 0x53d0661800000000, 0xab3d31ea00000000, 0x3c9b2c0d00000000, 0x1ae0efd500000000, 0x8d46f23200000000, 0x75aba5c000000000, 0xe20db82700000000, 0xb1b0d58f00000000, 0x2616c86800000000, 0xdefb9f9a00000000, 0x495d827d00000000, 0x6f2641a500000000, 0xf8805c4200000000, 0x006d0bb000000000, 0x97cb165700000000, 0x0d9dfcda00000000, 0x9a3be13d00000000, 0x62d6b6cf00000000, 0xf570ab2800000000, 0xd30b68f000000000, 0x44ad751700000000, 0xbc4022e500000000, 0x2be63f0200000000, 0xc9eb872500000000, 0x5e4d9ac200000000, 0xa6a0cd3000000000, 0x3106d0d700000000, 0x177d130f00000000, 0x80db0ee800000000, 0x7836591a00000000, 0xef9044fd00000000, 0x75c6ae7000000000, 0xe260b39700000000, 0x1a8de46500000000, 0x8d2bf98200000000, 0xab503a5a00000000, 0x3cf627bd00000000, 0xc41b704f00000000, 0x53bd6da800000000, 0x2367dac400000000, 0xb4c1c72300000000, 0x4c2c90d100000000, 0xdb8a8d3600000000, 0xfdf14eee00000000, 0x6a57530900000000, 0x92ba04fb00000000, 0x051c191c00000000, 0x9f4af39100000000, 0x08ecee7600000000, 0xf001b98400000000, 0x67a7a46300000000, 0x41dc67bb00000000, 0xd67a7a5c00000000, 0x2e972dae00000000, 0xb931304900000000, 0x5b3c886e00000000, 0xcc9a958900000000, 0x3477c27b00000000, 0xa3d1df9c00000000, 0x85aa1c4400000000, 0x120c01a300000000, 0xeae1565100000000, 0x7d474bb600000000, 0xe711a13b00000000, 0x70b7bcdc00000000, 0x885aeb2e00000000, 0x1ffcf6c900000000, 0x3987351100000000, 0xae2128f600000000, 0x56cc7f0400000000, 0xc16a62e300000000, 0x92d70f4b00000000, 0x057112ac00000000, 0xfd9c455e00000000, 0x6a3a58b900000000, 0x4c419b6100000000, 0xdbe7868600000000, 0x230ad17400000000, 0xb4accc9300000000, 0x2efa261e00000000, 0xb95c3bf900000000, 0x41b16c0b00000000, 0xd61771ec00000000, 0xf06cb23400000000, 0x67caafd300000000, 0x9f27f82100000000, 0x0881e5c600000000, 0xea8c5de100000000, 0x7d2a400600000000, 0x85c717f400000000, 0x12610a1300000000, 0x341ac9cb00000000, 0xa3bcd42c00000000, 0x5b5183de00000000, 0xccf79e3900000000, 0x56a174b400000000, 0xc107695300000000, 0x39ea3ea100000000, 0xae4c234600000000, 0x8837e09e00000000, 0x1f91fd7900000000, 0xe77caa8b00000000, 0x70dab76c00000000, 0x07c8c55200000000, 0x906ed8b500000000, 0x68838f4700000000, 0xff2592a000000000, 0xd95e517800000000, 0x4ef84c9f00000000, 0xb6151b6d00000000, 0x21b3068a00000000, 0xbbe5ec0700000000, 0x2c43f1e000000000, 0xd4aea61200000000, 0x4308bbf500000000, 0x6573782d00000000, 0xf2d565ca00000000, 0x0a38323800000000, 0x9d9e2fdf00000000, 0x7f9397f800000000, 0xe8358a1f00000000, 0x10d8dded00000000, 0x877ec00a00000000, 0xa10503d200000000, 0x36a31e3500000000, 0xce4e49c700000000, 0x59e8542000000000, 0xc3bebead00000000, 0x5418a34a00000000, 0xacf5f4b800000000, 0x3b53e95f00000000, 0x1d282a8700000000, 0x8a8e376000000000, 0x7263609200000000, 0xe5c57d7500000000, 0xb67810dd00000000, 0x21de0d3a00000000, 0xd9335ac800000000, 0x4e95472f00000000, 0x68ee84f700000000, 0xff48991000000000, 0x07a5cee200000000, 0x9003d30500000000, 0x0a55398800000000, 0x9df3246f00000000, 0x651e739d00000000, 0xf2b86e7a00000000, 0xd4c3ada200000000, 0x4365b04500000000, 0xbb88e7b700000000, 0x2c2efa5000000000, 0xce23427700000000, 0x59855f9000000000, 0xa168086200000000, 0x36ce158500000000, 0x10b5d65d00000000, 0x8713cbba00000000, 0x7ffe9c4800000000, 0xe85881af00000000, 0x720e6b2200000000, 0xe5a876c500000000, 0x1d45213700000000, 0x8ae33cd000000000, 0xac98ff0800000000, 0x3b3ee2ef00000000, 0xc3d3b51d00000000, 0x5475a8fa00000000, 0x24af1f9600000000, 0xb309027100000000, 0x4be4558300000000, 0xdc42486400000000, 0xfa398bbc00000000, 0x6d9f965b00000000, 0x9572c1a900000000, 0x02d4dc4e00000000, 0x988236c300000000, 0x0f242b2400000000, 0xf7c97cd600000000, 0x606f613100000000, 0x4614a2e900000000, 0xd1b2bf0e00000000, 0x295fe8fc00000000, 0xbef9f51b00000000, 0x5cf44d3c00000000, 0xcb5250db00000000, 0x33bf072900000000, 0xa4191ace00000000, 0x8262d91600000000, 0x15c4c4f100000000, 0xed29930300000000, 0x7a8f8ee400000000, 0xe0d9646900000000, 0x777f798e00000000, 0x8f922e7c00000000, 0x1834339b00000000, 0x3e4ff04300000000, 0xa9e9eda400000000, 0x5104ba5600000000, 0xc6a2a7b100000000, 0x951fca1900000000, 0x02b9d7fe00000000, 0xfa54800c00000000, 0x6df29deb00000000, 0x4b895e3300000000, 0xdc2f43d400000000, 0x24c2142600000000, 0xb36409c100000000, 0x2932e34c00000000, 0xbe94feab00000000, 0x4679a95900000000, 0xd1dfb4be00000000, 0xf7a4776600000000, 0x60026a8100000000, 0x98ef3d7300000000, 0x0f49209400000000, 0xed4498b300000000, 0x7ae2855400000000, 0x820fd2a600000000, 0x15a9cf4100000000, 0x33d20c9900000000, 0xa474117e00000000, 0x5c99468c00000000, 0xcb3f5b6b00000000, 0x5169b1e600000000, 0xc6cfac0100000000, 0x3e22fbf300000000, 0xa984e61400000000, 0x8fff25cc00000000, 0x1859382b00000000, 0xe0b46fd900000000, 0x7712723e00000000}, {0x0000000000000000, 0x411b8c6e00000000, 0x823618dd00000000, 0xc32d94b300000000, 0x456b416100000000, 0x0470cd0f00000000, 0xc75d59bc00000000, 0x8646d5d200000000, 0x8ad682c200000000, 0xcbcd0eac00000000, 0x08e09a1f00000000, 0x49fb167100000000, 0xcfbdc3a300000000, 0x8ea64fcd00000000, 0x4d8bdb7e00000000, 0x0c90571000000000, 0x55ab745e00000000, 0x14b0f83000000000, 0xd79d6c8300000000, 0x9686e0ed00000000, 0x10c0353f00000000, 0x51dbb95100000000, 0x92f62de200000000, 0xd3eda18c00000000, 0xdf7df69c00000000, 0x9e667af200000000, 0x5d4bee4100000000, 0x1c50622f00000000, 0x9a16b7fd00000000, 0xdb0d3b9300000000, 0x1820af2000000000, 0x593b234e00000000, 0xaa56e9bc00000000, 0xeb4d65d200000000, 0x2860f16100000000, 0x697b7d0f00000000, 0xef3da8dd00000000, 0xae2624b300000000, 0x6d0bb00000000000, 0x2c103c6e00000000, 0x20806b7e00000000, 0x619be71000000000, 0xa2b673a300000000, 0xe3adffcd00000000, 0x65eb2a1f00000000, 0x24f0a67100000000, 0xe7dd32c200000000, 0xa6c6beac00000000, 0xfffd9de200000000, 0xbee6118c00000000, 0x7dcb853f00000000, 0x3cd0095100000000, 0xba96dc8300000000, 0xfb8d50ed00000000, 0x38a0c45e00000000, 0x79bb483000000000, 0x752b1f2000000000, 0x3430934e00000000, 0xf71d07fd00000000, 0xb6068b9300000000, 0x30405e4100000000, 0x715bd22f00000000, 0xb276469c00000000, 0xf36dcaf200000000, 0x15aba3a200000000, 0x54b02fcc00000000, 0x979dbb7f00000000, 0xd686371100000000, 0x50c0e2c300000000, 0x11db6ead00000000, 0xd2f6fa1e00000000, 0x93ed767000000000, 0x9f7d216000000000, 0xde66ad0e00000000, 0x1d4b39bd00000000, 0x5c50b5d300000000, 0xda16600100000000, 0x9b0dec6f00000000, 0x582078dc00000000, 0x193bf4b200000000, 0x4000d7fc00000000, 0x011b5b9200000000, 0xc236cf2100000000, 0x832d434f00000000, 0x056b969d00000000, 0x44701af300000000, 0x875d8e4000000000, 0xc646022e00000000, 0xcad6553e00000000, 0x8bcdd95000000000, 0x48e04de300000000, 0x09fbc18d00000000, 0x8fbd145f00000000, 0xcea6983100000000, 0x0d8b0c8200000000, 0x4c9080ec00000000, 0xbffd4a1e00000000, 0xfee6c67000000000, 0x3dcb52c300000000, 0x7cd0dead00000000, 0xfa960b7f00000000, 0xbb8d871100000000, 0x78a013a200000000, 0x39bb9fcc00000000, 0x352bc8dc00000000, 0x743044b200000000, 0xb71dd00100000000, 0xf6065c6f00000000, 0x704089bd00000000, 0x315b05d300000000, 0xf276916000000000, 0xb36d1d0e00000000, 0xea563e4000000000, 0xab4db22e00000000, 0x6860269d00000000, 0x297baaf300000000, 0xaf3d7f2100000000, 0xee26f34f00000000, 0x2d0b67fc00000000, 0x6c10eb9200000000, 0x6080bc8200000000, 0x219b30ec00000000, 0xe2b6a45f00000000, 0xa3ad283100000000, 0x25ebfde300000000, 0x64f0718d00000000, 0xa7dde53e00000000, 0xe6c6695000000000, 0x6b50369e00000000, 0x2a4bbaf000000000, 0xe9662e4300000000, 0xa87da22d00000000, 0x2e3b77ff00000000, 0x6f20fb9100000000, 0xac0d6f2200000000, 0xed16e34c00000000, 0xe186b45c00000000, 0xa09d383200000000, 0x63b0ac8100000000, 0x22ab20ef00000000, 0xa4edf53d00000000, 0xe5f6795300000000, 0x26dbede000000000, 0x67c0618e00000000, 0x3efb42c000000000, 0x7fe0ceae00000000, 0xbccd5a1d00000000, 0xfdd6d67300000000, 0x7b9003a100000000, 0x3a8b8fcf00000000, 0xf9a61b7c00000000, 0xb8bd971200000000, 0xb42dc00200000000, 0xf5364c6c00000000, 0x361bd8df00000000, 0x770054b100000000, 0xf146816300000000, 0xb05d0d0d00000000, 0x737099be00000000, 0x326b15d000000000, 0xc106df2200000000, 0x801d534c00000000, 0x4330c7ff00000000, 0x022b4b9100000000, 0x846d9e4300000000, 0xc576122d00000000, 0x065b869e00000000, 0x47400af000000000, 0x4bd05de000000000, 0x0acbd18e00000000, 0xc9e6453d00000000, 0x88fdc95300000000, 0x0ebb1c8100000000, 0x4fa090ef00000000, 0x8c8d045c00000000, 0xcd96883200000000, 0x94adab7c00000000, 0xd5b6271200000000, 0x169bb3a100000000, 0x57803fcf00000000, 0xd1c6ea1d00000000, 0x90dd667300000000, 0x53f0f2c000000000, 0x12eb7eae00000000, 0x1e7b29be00000000, 0x5f60a5d000000000, 0x9c4d316300000000, 0xdd56bd0d00000000, 0x5b1068df00000000, 0x1a0be4b100000000, 0xd926700200000000, 0x983dfc6c00000000, 0x7efb953c00000000, 0x3fe0195200000000, 0xfccd8de100000000, 0xbdd6018f00000000, 0x3b90d45d00000000, 0x7a8b583300000000, 0xb9a6cc8000000000, 0xf8bd40ee00000000, 0xf42d17fe00000000, 0xb5369b9000000000, 0x761b0f2300000000, 0x3700834d00000000, 0xb146569f00000000, 0xf05ddaf100000000, 0x33704e4200000000, 0x726bc22c00000000, 0x2b50e16200000000, 0x6a4b6d0c00000000, 0xa966f9bf00000000, 0xe87d75d100000000, 0x6e3ba00300000000, 0x2f202c6d00000000, 0xec0db8de00000000, 0xad1634b000000000, 0xa18663a000000000, 0xe09defce00000000, 0x23b07b7d00000000, 0x62abf71300000000, 0xe4ed22c100000000, 0xa5f6aeaf00000000, 0x66db3a1c00000000, 0x27c0b67200000000, 0xd4ad7c8000000000, 0x95b6f0ee00000000, 0x569b645d00000000, 0x1780e83300000000, 0x91c63de100000000, 0xd0ddb18f00000000, 0x13f0253c00000000, 0x52eba95200000000, 0x5e7bfe4200000000, 0x1f60722c00000000, 0xdc4de69f00000000, 0x9d566af100000000, 0x1b10bf2300000000, 0x5a0b334d00000000, 0x9926a7fe00000000, 0xd83d2b9000000000, 0x810608de00000000, 0xc01d84b000000000, 0x0330100300000000, 0x422b9c6d00000000, 0xc46d49bf00000000, 0x8576c5d100000000, 0x465b516200000000, 0x0740dd0c00000000, 0x0bd08a1c00000000, 0x4acb067200000000, 0x89e692c100000000, 0xc8fd1eaf00000000, 0x4ebbcb7d00000000, 0x0fa0471300000000, 0xcc8dd3a000000000, 0x8d965fce00000000}, {0x0000000000000000, 0x1dfdb50100000000, 0x3afa6b0300000000, 0x2707de0200000000, 0x74f4d70600000000, 0x6909620700000000, 0x4e0ebc0500000000, 0x53f3090400000000, 0xe8e8af0d00000000, 0xf5151a0c00000000, 0xd212c40e00000000, 0xcfef710f00000000, 0x9c1c780b00000000, 0x81e1cd0a00000000, 0xa6e6130800000000, 0xbb1ba60900000000, 0xd0d15f1b00000000, 0xcd2cea1a00000000, 0xea2b341800000000, 0xf7d6811900000000, 0xa425881d00000000, 0xb9d83d1c00000000, 0x9edfe31e00000000, 0x8322561f00000000, 0x3839f01600000000, 0x25c4451700000000, 0x02c39b1500000000, 0x1f3e2e1400000000, 0x4ccd271000000000, 0x5130921100000000, 0x76374c1300000000, 0x6bcaf91200000000, 0xa0a3bf3600000000, 0xbd5e0a3700000000, 0x9a59d43500000000, 0x87a4613400000000, 0xd457683000000000, 0xc9aadd3100000000, 0xeead033300000000, 0xf350b63200000000, 0x484b103b00000000, 0x55b6a53a00000000, 0x72b17b3800000000, 0x6f4cce3900000000, 0x3cbfc73d00000000, 0x2142723c00000000, 0x0645ac3e00000000, 0x1bb8193f00000000, 0x7072e02d00000000, 0x6d8f552c00000000, 0x4a888b2e00000000, 0x57753e2f00000000, 0x0486372b00000000, 0x197b822a00000000, 0x3e7c5c2800000000, 0x2381e92900000000, 0x989a4f2000000000, 0x8567fa2100000000, 0xa260242300000000, 0xbf9d912200000000, 0xec6e982600000000, 0xf1932d2700000000, 0xd694f32500000000, 0xcb69462400000000, 0x40477f6d00000000, 0x5dbaca6c00000000, 0x7abd146e00000000, 0x6740a16f00000000, 0x34b3a86b00000000, 0x294e1d6a00000000, 0x0e49c36800000000, 0x13b4766900000000, 0xa8afd06000000000, 0xb552656100000000, 0x9255bb6300000000, 0x8fa80e6200000000, 0xdc5b076600000000, 0xc1a6b26700000000, 0xe6a16c6500000000, 0xfb5cd96400000000, 0x9096207600000000, 0x8d6b957700000000, 0xaa6c4b7500000000, 0xb791fe7400000000, 0xe462f77000000000, 0xf99f427100000000, 0xde989c7300000000, 0xc365297200000000, 0x787e8f7b00000000, 0x65833a7a00000000, 0x4284e47800000000, 0x5f79517900000000, 0x0c8a587d00000000, 0x1177ed7c00000000, 0x3670337e00000000, 0x2b8d867f00000000, 0xe0e4c05b00000000, 0xfd19755a00000000, 0xda1eab5800000000, 0xc7e31e5900000000, 0x9410175d00000000, 0x89eda25c00000000, 0xaeea7c5e00000000, 0xb317c95f00000000, 0x080c6f5600000000, 0x15f1da5700000000, 0x32f6045500000000, 0x2f0bb15400000000, 0x7cf8b85000000000, 0x61050d5100000000, 0x4602d35300000000, 0x5bff665200000000, 0x30359f4000000000, 0x2dc82a4100000000, 0x0acff44300000000, 0x1732414200000000, 0x44c1484600000000, 0x593cfd4700000000, 0x7e3b234500000000, 0x63c6964400000000, 0xd8dd304d00000000, 0xc520854c00000000, 0xe2275b4e00000000, 0xffdaee4f00000000, 0xac29e74b00000000, 0xb1d4524a00000000, 0x96d38c4800000000, 0x8b2e394900000000, 0x808efeda00000000, 0x9d734bdb00000000, 0xba7495d900000000, 0xa78920d800000000, 0xf47a29dc00000000, 0xe9879cdd00000000, 0xce8042df00000000, 0xd37df7de00000000, 0x686651d700000000, 0x759be4d600000000, 0x529c3ad400000000, 0x4f618fd500000000, 0x1c9286d100000000, 0x016f33d000000000, 0x2668edd200000000, 0x3b9558d300000000, 0x505fa1c100000000, 0x4da214c000000000, 0x6aa5cac200000000, 0x77587fc300000000, 0x24ab76c700000000, 0x3956c3c600000000, 0x1e511dc400000000, 0x03aca8c500000000, 0xb8b70ecc00000000, 0xa54abbcd00000000, 0x824d65cf00000000, 0x9fb0d0ce00000000, 0xcc43d9ca00000000, 0xd1be6ccb00000000, 0xf6b9b2c900000000, 0xeb4407c800000000, 0x202d41ec00000000, 0x3dd0f4ed00000000, 0x1ad72aef00000000, 0x072a9fee00000000, 0x54d996ea00000000, 0x492423eb00000000, 0x6e23fde900000000, 0x73de48e800000000, 0xc8c5eee100000000, 0xd5385be000000000, 0xf23f85e200000000, 0xefc230e300000000, 0xbc3139e700000000, 0xa1cc8ce600000000, 0x86cb52e400000000, 0x9b36e7e500000000, 0xf0fc1ef700000000, 0xed01abf600000000, 0xca0675f400000000, 0xd7fbc0f500000000, 0x8408c9f100000000, 0x99f57cf000000000, 0xbef2a2f200000000, 0xa30f17f300000000, 0x1814b1fa00000000, 0x05e904fb00000000, 0x22eedaf900000000, 0x3f136ff800000000, 0x6ce066fc00000000, 0x711dd3fd00000000, 0x561a0dff00000000, 0x4be7b8fe00000000, 0xc0c981b700000000, 0xdd3434b600000000, 0xfa33eab400000000, 0xe7ce5fb500000000, 0xb43d56b100000000, 0xa9c0e3b000000000, 0x8ec73db200000000, 0x933a88b300000000, 0x28212eba00000000, 0x35dc9bbb00000000, 0x12db45b900000000, 0x0f26f0b800000000, 0x5cd5f9bc00000000, 0x41284cbd00000000, 0x662f92bf00000000, 0x7bd227be00000000, 0x1018deac00000000, 0x0de56bad00000000, 0x2ae2b5af00000000, 0x371f00ae00000000, 0x64ec09aa00000000, 0x7911bcab00000000, 0x5e1662a900000000, 0x43ebd7a800000000, 0xf8f071a100000000, 0xe50dc4a000000000, 0xc20a1aa200000000, 0xdff7afa300000000, 0x8c04a6a700000000, 0x91f913a600000000, 0xb6fecda400000000, 0xab0378a500000000, 0x606a3e8100000000, 0x7d978b8000000000, 0x5a90558200000000, 0x476de08300000000, 0x149ee98700000000, 0x09635c8600000000, 0x2e64828400000000, 0x3399378500000000, 0x8882918c00000000, 0x957f248d00000000, 0xb278fa8f00000000, 0xaf854f8e00000000, 0xfc76468a00000000, 0xe18bf38b00000000, 0xc68c2d8900000000, 0xdb71988800000000, 0xb0bb619a00000000, 0xad46d49b00000000, 0x8a410a9900000000, 0x97bcbf9800000000, 0xc44fb69c00000000, 0xd9b2039d00000000, 0xfeb5dd9f00000000, 0xe348689e00000000, 0x5853ce9700000000, 0x45ae7b9600000000, 0x62a9a59400000000, 0x7f54109500000000, 0x2ca7199100000000, 0x315aac9000000000, 0x165d729200000000, 0x0ba0c79300000000}, {0x0000000000000000, 0x24d9076300000000, 0x48b20fc600000000, 0x6c6b08a500000000, 0xd1626e5700000000, 0xf5bb693400000000, 0x99d0619100000000, 0xbd0966f200000000, 0xa2c5dcae00000000, 0x861cdbcd00000000, 0xea77d36800000000, 0xceaed40b00000000, 0x73a7b2f900000000, 0x577eb59a00000000, 0x3b15bd3f00000000, 0x1fccba5c00000000, 0x058dc88600000000, 0x2154cfe500000000, 0x4d3fc74000000000, 0x69e6c02300000000, 0xd4efa6d100000000, 0xf036a1b200000000, 0x9c5da91700000000, 0xb884ae7400000000, 0xa748142800000000, 0x8391134b00000000, 0xeffa1bee00000000, 0xcb231c8d00000000, 0x762a7a7f00000000, 0x52f37d1c00000000, 0x3e9875b900000000, 0x1a4172da00000000, 0x4b1ce0d600000000, 0x6fc5e7b500000000, 0x03aeef1000000000, 0x2777e87300000000, 0x9a7e8e8100000000, 0xbea789e200000000, 0xd2cc814700000000, 0xf615862400000000, 0xe9d93c7800000000, 0xcd003b1b00000000, 0xa16b33be00000000, 0x85b234dd00000000, 0x38bb522f00000000, 0x1c62554c00000000, 0x70095de900000000, 0x54d05a8a00000000, 0x4e91285000000000, 0x6a482f3300000000, 0x0623279600000000, 0x22fa20f500000000, 0x9ff3460700000000, 0xbb2a416400000000, 0xd74149c100000000, 0xf3984ea200000000, 0xec54f4fe00000000, 0xc88df39d00000000, 0xa4e6fb3800000000, 0x803ffc5b00000000, 0x3d369aa900000000, 0x19ef9dca00000000, 0x7584956f00000000, 0x515d920c00000000, 0xd73eb17600000000, 0xf3e7b61500000000, 0x9f8cbeb000000000, 0xbb55b9d300000000, 0x065cdf2100000000, 0x2285d84200000000, 0x4eeed0e700000000, 0x6a37d78400000000, 0x75fb6dd800000000, 0x51226abb00000000, 0x3d49621e00000000, 0x1990657d00000000, 0xa499038f00000000, 0x804004ec00000000, 0xec2b0c4900000000, 0xc8f20b2a00000000, 0xd2b379f000000000, 0xf66a7e9300000000, 0x9a01763600000000, 0xbed8715500000000, 0x03d117a700000000, 0x270810c400000000, 0x4b63186100000000, 0x6fba1f0200000000, 0x7076a55e00000000, 0x54afa23d00000000, 0x38c4aa9800000000, 0x1c1dadfb00000000, 0xa114cb0900000000, 0x85cdcc6a00000000, 0xe9a6c4cf00000000, 0xcd7fc3ac00000000, 0x9c2251a000000000, 0xb8fb56c300000000, 0xd4905e6600000000, 0xf049590500000000, 0x4d403ff700000000, 0x6999389400000000, 0x05f2303100000000, 0x212b375200000000, 0x3ee78d0e00000000, 0x1a3e8a6d00000000, 0x765582c800000000, 0x528c85ab00000000, 0xef85e35900000000, 0xcb5ce43a00000000, 0xa737ec9f00000000, 0x83eeebfc00000000, 0x99af992600000000, 0xbd769e4500000000, 0xd11d96e000000000, 0xf5c4918300000000, 0x48cdf77100000000, 0x6c14f01200000000, 0x007ff8b700000000, 0x24a6ffd400000000, 0x3b6a458800000000, 0x1fb342eb00000000, 0x73d84a4e00000000, 0x57014d2d00000000, 0xea082bdf00000000, 0xced12cbc00000000, 0xa2ba241900000000, 0x8663237a00000000, 0xae7d62ed00000000, 0x8aa4658e00000000, 0xe6cf6d2b00000000, 0xc2166a4800000000, 0x7f1f0cba00000000, 0x5bc60bd900000000, 0x37ad037c00000000, 0x1374041f00000000, 0x0cb8be4300000000, 0x2861b92000000000, 0x440ab18500000000, 0x60d3b6e600000000, 0xdddad01400000000, 0xf903d77700000000, 0x9568dfd200000000, 0xb1b1d8b100000000, 0xabf0aa6b00000000, 0x8f29ad0800000000, 0xe342a5ad00000000, 0xc79ba2ce00000000, 0x7a92c43c00000000, 0x5e4bc35f00000000, 0x3220cbfa00000000, 0x16f9cc9900000000, 0x093576c500000000, 0x2dec71a600000000, 0x4187790300000000, 0x655e7e6000000000, 0xd857189200000000, 0xfc8e1ff100000000, 0x90e5175400000000, 0xb43c103700000000, 0xe561823b00000000, 0xc1b8855800000000, 0xadd38dfd00000000, 0x890a8a9e00000000, 0x3403ec6c00000000, 0x10daeb0f00000000, 0x7cb1e3aa00000000, 0x5868e4c900000000, 0x47a45e9500000000, 0x637d59f600000000, 0x0f16515300000000, 0x2bcf563000000000, 0x96c630c200000000, 0xb21f37a100000000, 0xde743f0400000000, 0xfaad386700000000, 0xe0ec4abd00000000, 0xc4354dde00000000, 0xa85e457b00000000, 0x8c87421800000000, 0x318e24ea00000000, 0x1557238900000000, 0x793c2b2c00000000, 0x5de52c4f00000000, 0x4229961300000000, 0x66f0917000000000, 0x0a9b99d500000000, 0x2e429eb600000000, 0x934bf84400000000, 0xb792ff2700000000, 0xdbf9f78200000000, 0xff20f0e100000000, 0x7943d39b00000000, 0x5d9ad4f800000000, 0x31f1dc5d00000000, 0x1528db3e00000000, 0xa821bdcc00000000, 0x8cf8baaf00000000, 0xe093b20a00000000, 0xc44ab56900000000, 0xdb860f3500000000, 0xff5f085600000000, 0x933400f300000000, 0xb7ed079000000000, 0x0ae4616200000000, 0x2e3d660100000000, 0x42566ea400000000, 0x668f69c700000000, 0x7cce1b1d00000000, 0x58171c7e00000000, 0x347c14db00000000, 0x10a513b800000000, 0xadac754a00000000, 0x8975722900000000, 0xe51e7a8c00000000, 0xc1c77def00000000, 0xde0bc7b300000000, 0xfad2c0d000000000, 0x96b9c87500000000, 0xb260cf1600000000, 0x0f69a9e400000000, 0x2bb0ae8700000000, 0x47dba62200000000, 0x6302a14100000000, 0x325f334d00000000, 0x1686342e00000000, 0x7aed3c8b00000000, 0x5e343be800000000, 0xe33d5d1a00000000, 0xc7e45a7900000000, 0xab8f52dc00000000, 0x8f5655bf00000000, 0x909aefe300000000, 0xb443e88000000000, 0xd828e02500000000, 0xfcf1e74600000000, 0x41f881b400000000, 0x652186d700000000, 0x094a8e7200000000, 0x2d93891100000000, 0x37d2fbcb00000000, 0x130bfca800000000, 0x7f60f40d00000000, 0x5bb9f36e00000000, 0xe6b0959c00000000, 0xc26992ff00000000, 0xae029a5a00000000, 0x8adb9d3900000000, 0x9517276500000000, 0xb1ce200600000000, 0xdda528a300000000, 0xf97c2fc000000000, 0x4475493200000000, 0x60ac4e5100000000, 0x0cc746f400000000, 0x281e419700000000}, {0x0000000000000000, 0x08e3603c00000000, 0x10c6c17800000000, 0x1825a14400000000, 0x208c83f100000000, 0x286fe3cd00000000, 0x304a428900000000, 0x38a922b500000000, 0x011e763800000000, 0x09fd160400000000, 0x11d8b74000000000, 0x193bd77c00000000, 0x2192f5c900000000, 0x297195f500000000, 0x315434b100000000, 0x39b7548d00000000, 0x023cec7000000000, 0x0adf8c4c00000000, 0x12fa2d0800000000, 0x1a194d3400000000, 0x22b06f8100000000, 0x2a530fbd00000000, 0x3276aef900000000, 0x3a95cec500000000, 0x03229a4800000000, 0x0bc1fa7400000000, 0x13e45b3000000000, 0x1b073b0c00000000, 0x23ae19b900000000, 0x2b4d798500000000, 0x3368d8c100000000, 0x3b8bb8fd00000000, 0x0478d8e100000000, 0x0c9bb8dd00000000, 0x14be199900000000, 0x1c5d79a500000000, 0x24f45b1000000000, 0x2c173b2c00000000, 0x34329a6800000000, 0x3cd1fa5400000000, 0x0566aed900000000, 0x0d85cee500000000, 0x15a06fa100000000, 0x1d430f9d00000000, 0x25ea2d2800000000, 0x2d094d1400000000, 0x352cec5000000000, 0x3dcf8c6c00000000, 0x0644349100000000, 0x0ea754ad00000000, 0x1682f5e900000000, 0x1e6195d500000000, 0x26c8b76000000000, 0x2e2bd75c00000000, 0x360e761800000000, 0x3eed162400000000, 0x075a42a900000000, 0x0fb9229500000000, 0x179c83d100000000, 0x1f7fe3ed00000000, 0x27d6c15800000000, 0x2f35a16400000000, 0x3710002000000000, 0x3ff3601c00000000, 0x49f6c11800000000, 0x4115a12400000000, 0x5930006000000000, 0x51d3605c00000000, 0x697a42e900000000, 0x619922d500000000, 0x79bc839100000000, 0x715fe3ad00000000, 0x48e8b72000000000, 0x400bd71c00000000, 0x582e765800000000, 0x50cd166400000000, 0x686434d100000000, 0x608754ed00000000, 0x78a2f5a900000000, 0x7041959500000000, 0x4bca2d6800000000, 0x43294d5400000000, 0x5b0cec1000000000, 0x53ef8c2c00000000, 0x6b46ae9900000000, 0x63a5cea500000000, 0x7b806fe100000000, 0x73630fdd00000000, 0x4ad45b5000000000, 0x42373b6c00000000, 0x5a129a2800000000, 0x52f1fa1400000000, 0x6a58d8a100000000, 0x62bbb89d00000000, 0x7a9e19d900000000, 0x727d79e500000000, 0x4d8e19f900000000, 0x456d79c500000000, 0x5d48d88100000000, 0x55abb8bd00000000, 0x6d029a0800000000, 0x65e1fa3400000000, 0x7dc45b7000000000, 0x75273b4c00000000, 0x4c906fc100000000, 0x44730ffd00000000, 0x5c56aeb900000000, 0x54b5ce8500000000, 0x6c1cec3000000000, 0x64ff8c0c00000000, 0x7cda2d4800000000, 0x74394d7400000000, 0x4fb2f58900000000, 0x475195b500000000, 0x5f7434f100000000, 0x579754cd00000000, 0x6f3e767800000000, 0x67dd164400000000, 0x7ff8b70000000000, 0x771bd73c00000000, 0x4eac83b100000000, 0x464fe38d00000000, 0x5e6a42c900000000, 0x568922f500000000, 0x6e20004000000000, 0x66c3607c00000000, 0x7ee6c13800000000, 0x7605a10400000000, 0x92ec833100000000, 0x9a0fe30d00000000, 0x822a424900000000, 0x8ac9227500000000, 0xb26000c000000000, 0xba8360fc00000000, 0xa2a6c1b800000000, 0xaa45a18400000000, 0x93f2f50900000000, 0x9b11953500000000, 0x8334347100000000, 0x8bd7544d00000000, 0xb37e76f800000000, 0xbb9d16c400000000, 0xa3b8b78000000000, 0xab5bd7bc00000000, 0x90d06f4100000000, 0x98330f7d00000000, 0x8016ae3900000000, 0x88f5ce0500000000, 0xb05cecb000000000, 0xb8bf8c8c00000000, 0xa09a2dc800000000, 0xa8794df400000000, 0x91ce197900000000, 0x992d794500000000, 0x8108d80100000000, 0x89ebb83d00000000, 0xb1429a8800000000, 0xb9a1fab400000000, 0xa1845bf000000000, 0xa9673bcc00000000, 0x96945bd000000000, 0x9e773bec00000000, 0x86529aa800000000, 0x8eb1fa9400000000, 0xb618d82100000000, 0xbefbb81d00000000, 0xa6de195900000000, 0xae3d796500000000, 0x978a2de800000000, 0x9f694dd400000000, 0x874cec9000000000, 0x8faf8cac00000000, 0xb706ae1900000000, 0xbfe5ce2500000000, 0xa7c06f6100000000, 0xaf230f5d00000000, 0x94a8b7a000000000, 0x9c4bd79c00000000, 0x846e76d800000000, 0x8c8d16e400000000, 0xb424345100000000, 0xbcc7546d00000000, 0xa4e2f52900000000, 0xac01951500000000, 0x95b6c19800000000, 0x9d55a1a400000000, 0x857000e000000000, 0x8d9360dc00000000, 0xb53a426900000000, 0xbdd9225500000000, 0xa5fc831100000000, 0xad1fe32d00000000, 0xdb1a422900000000, 0xd3f9221500000000, 0xcbdc835100000000, 0xc33fe36d00000000, 0xfb96c1d800000000, 0xf375a1e400000000, 0xeb5000a000000000, 0xe3b3609c00000000, 0xda04341100000000, 0xd2e7542d00000000, 0xcac2f56900000000, 0xc221955500000000, 0xfa88b7e000000000, 0xf26bd7dc00000000, 0xea4e769800000000, 0xe2ad16a400000000, 0xd926ae5900000000, 0xd1c5ce6500000000, 0xc9e06f2100000000, 0xc1030f1d00000000, 0xf9aa2da800000000, 0xf1494d9400000000, 0xe96cecd000000000, 0xe18f8cec00000000, 0xd838d86100000000, 0xd0dbb85d00000000, 0xc8fe191900000000, 0xc01d792500000000, 0xf8b45b9000000000, 0xf0573bac00000000, 0xe8729ae800000000, 0xe091fad400000000, 0xdf629ac800000000, 0xd781faf400000000, 0xcfa45bb000000000, 0xc7473b8c00000000, 0xffee193900000000, 0xf70d790500000000, 0xef28d84100000000, 0xe7cbb87d00000000, 0xde7cecf000000000, 0xd69f8ccc00000000, 0xceba2d8800000000, 0xc6594db400000000, 0xfef06f0100000000, 0xf6130f3d00000000, 0xee36ae7900000000, 0xe6d5ce4500000000, 0xdd5e76b800000000, 0xd5bd168400000000, 0xcd98b7c000000000, 0xc57bd7fc00000000, 0xfdd2f54900000000, 0xf531957500000000, 0xed14343100000000, 0xe5f7540d00000000, 0xdc40008000000000, 0xd4a360bc00000000, 0xcc86c1f800000000, 0xc465a1c400000000, 0xfccc837100000000, 0xf42fe34d00000000, 0xec0a420900000000, 0xe4e9223500000000}, {0x0000000000000000, 0xd1e8e70e00000000, 0xa2d1cf1d00000000, 0x7339281300000000, 0x44a39f3b00000000, 0x954b783500000000, 0xe672502600000000, 0x379ab72800000000, 0x88463f7700000000, 0x59aed87900000000, 0x2a97f06a00000000, 0xfb7f176400000000, 0xcce5a04c00000000, 0x1d0d474200000000, 0x6e346f5100000000, 0xbfdc885f00000000, 0x108d7eee00000000, 0xc16599e000000000, 0xb25cb1f300000000, 0x63b456fd00000000, 0x542ee1d500000000, 0x85c606db00000000, 0xf6ff2ec800000000, 0x2717c9c600000000, 0x98cb419900000000, 0x4923a69700000000, 0x3a1a8e8400000000, 0xebf2698a00000000, 0xdc68dea200000000, 0x0d8039ac00000000, 0x7eb911bf00000000, 0xaf51f6b100000000, 0x611c8c0700000000, 0xb0f46b0900000000, 0xc3cd431a00000000, 0x1225a41400000000, 0x25bf133c00000000, 0xf457f43200000000, 0x876edc2100000000, 0x56863b2f00000000, 0xe95ab37000000000, 0x38b2547e00000000, 0x4b8b7c6d00000000, 0x9a639b6300000000, 0xadf92c4b00000000, 0x7c11cb4500000000, 0x0f28e35600000000, 0xdec0045800000000, 0x7191f2e900000000, 0xa07915e700000000, 0xd3403df400000000, 0x02a8dafa00000000, 0x35326dd200000000, 0xe4da8adc00000000, 0x97e3a2cf00000000, 0x460b45c100000000, 0xf9d7cd9e00000000, 0x283f2a9000000000, 0x5b06028300000000, 0x8aeee58d00000000, 0xbd7452a500000000, 0x6c9cb5ab00000000, 0x1fa59db800000000, 0xce4d7ab600000000, 0xc238180f00000000, 0x13d0ff0100000000, 0x60e9d71200000000, 0xb101301c00000000, 0x869b873400000000, 0x5773603a00000000, 0x244a482900000000, 0xf5a2af2700000000, 0x4a7e277800000000, 0x9b96c07600000000, 0xe8afe86500000000, 0x39470f6b00000000, 0x0eddb84300000000, 0xdf355f4d00000000, 0xac0c775e00000000, 0x7de4905000000000, 0xd2b566e100000000, 0x035d81ef00000000, 0x7064a9fc00000000, 0xa18c4ef200000000, 0x9616f9da00000000, 0x47fe1ed400000000, 0x34c736c700000000, 0xe52fd1c900000000, 0x5af3599600000000, 0x8b1bbe9800000000, 0xf822968b00000000, 0x29ca718500000000, 0x1e50c6ad00000000, 0xcfb821a300000000, 0xbc8109b000000000, 0x6d69eebe00000000, 0xa324940800000000, 0x72cc730600000000, 0x01f55b1500000000, 0xd01dbc1b00000000, 0xe7870b3300000000, 0x366fec3d00000000, 0x4556c42e00000000, 0x94be232000000000, 0x2b62ab7f00000000, 0xfa8a4c7100000000, 0x89b3646200000000, 0x585b836c00000000, 0x6fc1344400000000, 0xbe29d34a00000000, 0xcd10fb5900000000, 0x1cf81c5700000000, 0xb3a9eae600000000, 0x62410de800000000, 0x117825fb00000000, 0xc090c2f500000000, 0xf70a75dd00000000, 0x26e292d300000000, 0x55dbbac000000000, 0x84335dce00000000, 0x3befd59100000000, 0xea07329f00000000, 0x993e1a8c00000000, 0x48d6fd8200000000, 0x7f4c4aaa00000000, 0xaea4ada400000000, 0xdd9d85b700000000, 0x0c7562b900000000, 0x8471301e00000000, 0x5599d71000000000, 0x26a0ff0300000000, 0xf748180d00000000, 0xc0d2af2500000000, 0x113a482b00000000, 0x6203603800000000, 0xb3eb873600000000, 0x0c370f6900000000, 0xdddfe86700000000, 0xaee6c07400000000, 0x7f0e277a00000000, 0x4894905200000000, 0x997c775c00000000, 0xea455f4f00000000, 0x3badb84100000000, 0x94fc4ef000000000, 0x4514a9fe00000000, 0x362d81ed00000000, 0xe7c566e300000000, 0xd05fd1cb00000000, 0x01b736c500000000, 0x728e1ed600000000, 0xa366f9d800000000, 0x1cba718700000000, 0xcd52968900000000, 0xbe6bbe9a00000000, 0x6f83599400000000, 0x5819eebc00000000, 0x89f109b200000000, 0xfac821a100000000, 0x2b20c6af00000000, 0xe56dbc1900000000, 0x34855b1700000000, 0x47bc730400000000, 0x9654940a00000000, 0xa1ce232200000000, 0x7026c42c00000000, 0x031fec3f00000000, 0xd2f70b3100000000, 0x6d2b836e00000000, 0xbcc3646000000000, 0xcffa4c7300000000, 0x1e12ab7d00000000, 0x29881c5500000000, 0xf860fb5b00000000, 0x8b59d34800000000, 0x5ab1344600000000, 0xf5e0c2f700000000, 0x240825f900000000, 0x57310dea00000000, 0x86d9eae400000000, 0xb1435dcc00000000, 0x60abbac200000000, 0x139292d100000000, 0xc27a75df00000000, 0x7da6fd8000000000, 0xac4e1a8e00000000, 0xdf77329d00000000, 0x0e9fd59300000000, 0x390562bb00000000, 0xe8ed85b500000000, 0x9bd4ada600000000, 0x4a3c4aa800000000, 0x4649281100000000, 0x97a1cf1f00000000, 0xe498e70c00000000, 0x3570000200000000, 0x02eab72a00000000, 0xd302502400000000, 0xa03b783700000000, 0x71d39f3900000000, 0xce0f176600000000, 0x1fe7f06800000000, 0x6cded87b00000000, 0xbd363f7500000000, 0x8aac885d00000000, 0x5b446f5300000000, 0x287d474000000000, 0xf995a04e00000000, 0x56c456ff00000000, 0x872cb1f100000000, 0xf41599e200000000, 0x25fd7eec00000000, 0x1267c9c400000000, 0xc38f2eca00000000, 0xb0b606d900000000, 0x615ee1d700000000, 0xde82698800000000, 0x0f6a8e8600000000, 0x7c53a69500000000, 0xadbb419b00000000, 0x9a21f6b300000000, 0x4bc911bd00000000, 0x38f039ae00000000, 0xe918dea000000000, 0x2755a41600000000, 0xf6bd431800000000, 0x85846b0b00000000, 0x546c8c0500000000, 0x63f63b2d00000000, 0xb21edc2300000000, 0xc127f43000000000, 0x10cf133e00000000, 0xaf139b6100000000, 0x7efb7c6f00000000, 0x0dc2547c00000000, 0xdc2ab37200000000, 0xebb0045a00000000, 0x3a58e35400000000, 0x4961cb4700000000, 0x98892c4900000000, 0x37d8daf800000000, 0xe6303df600000000, 0x950915e500000000, 0x44e1f2eb00000000, 0x737b45c300000000, 0xa293a2cd00000000, 0xd1aa8ade00000000, 0x00426dd000000000, 0xbf9ee58f00000000, 0x6e76028100000000, 0x1d4f2a9200000000, 0xcca7cd9c00000000, 0xfb3d7ab400000000, 0x2ad59dba00000000, 0x59ecb5a900000000, 0x880452a700000000}, {0x0000000000000000, 0xaa05daf100000000, 0x150dc53800000000, 0xbf081fc900000000, 0x2a1a8a7100000000, 0x801f508000000000, 0x3f174f4900000000, 0x951295b800000000, 0x543414e300000000, 0xfe31ce1200000000, 0x4139d1db00000000, 0xeb3c0b2a00000000, 0x7e2e9e9200000000, 0xd42b446300000000, 0x6b235baa00000000, 0xc126815b00000000, 0xe96e591d00000000, 0x436b83ec00000000, 0xfc639c2500000000, 0x566646d400000000, 0xc374d36c00000000, 0x6971099d00000000, 0xd679165400000000, 0x7c7ccca500000000, 0xbd5a4dfe00000000, 0x175f970f00000000, 0xa85788c600000000, 0x0252523700000000, 0x9740c78f00000000, 0x3d451d7e00000000, 0x824d02b700000000, 0x2848d84600000000, 0xd2ddb23a00000000, 0x78d868cb00000000, 0xc7d0770200000000, 0x6dd5adf300000000, 0xf8c7384b00000000, 0x52c2e2ba00000000, 0xedcafd7300000000, 0x47cf278200000000, 0x86e9a6d900000000, 0x2cec7c2800000000, 0x93e463e100000000, 0x39e1b91000000000, 0xacf32ca800000000, 0x06f6f65900000000, 0xb9fee99000000000, 0x13fb336100000000, 0x3bb3eb2700000000, 0x91b631d600000000, 0x2ebe2e1f00000000, 0x84bbf4ee00000000, 0x11a9615600000000, 0xbbacbba700000000, 0x04a4a46e00000000, 0xaea17e9f00000000, 0x6f87ffc400000000, 0xc582253500000000, 0x7a8a3afc00000000, 0xd08fe00d00000000, 0x459d75b500000000, 0xef98af4400000000, 0x5090b08d00000000, 0xfa956a7c00000000, 0xa4bb657500000000, 0x0ebebf8400000000, 0xb1b6a04d00000000, 0x1bb37abc00000000, 0x8ea1ef0400000000, 0x24a435f500000000, 0x9bac2a3c00000000, 0x31a9f0cd00000000, 0xf08f719600000000, 0x5a8aab6700000000, 0xe582b4ae00000000, 0x4f876e5f00000000, 0xda95fbe700000000, 0x7090211600000000, 0xcf983edf00000000, 0x659de42e00000000, 0x4dd53c6800000000, 0xe7d0e69900000000, 0x58d8f95000000000, 0xf2dd23a100000000, 0x67cfb61900000000, 0xcdca6ce800000000, 0x72c2732100000000, 0xd8c7a9d000000000, 0x19e1288b00000000, 0xb3e4f27a00000000, 0x0cecedb300000000, 0xa6e9374200000000, 0x33fba2fa00000000, 0x99fe780b00000000, 0x26f667c200000000, 0x8cf3bd3300000000, 0x7666d74f00000000, 0xdc630dbe00000000, 0x636b127700000000, 0xc96ec88600000000, 0x5c7c5d3e00000000, 0xf67987cf00000000, 0x4971980600000000, 0xe37442f700000000, 0x2252c3ac00000000, 0x8857195d00000000, 0x375f069400000000, 0x9d5adc6500000000, 0x084849dd00000000, 0xa24d932c00000000, 0x1d458ce500000000, 0xb740561400000000, 0x9f088e5200000000, 0x350d54a300000000, 0x8a054b6a00000000, 0x2000919b00000000, 0xb512042300000000, 0x1f17ded200000000, 0xa01fc11b00000000, 0x0a1a1bea00000000, 0xcb3c9ab100000000, 0x6139404000000000, 0xde315f8900000000, 0x7434857800000000, 0xe12610c000000000, 0x4b23ca3100000000, 0xf42bd5f800000000, 0x5e2e0f0900000000, 0x4877cbea00000000, 0xe272111b00000000, 0x5d7a0ed200000000, 0xf77fd42300000000, 0x626d419b00000000, 0xc8689b6a00000000, 0x776084a300000000, 0xdd655e5200000000, 0x1c43df0900000000, 0xb64605f800000000, 0x094e1a3100000000, 0xa34bc0c000000000, 0x3659557800000000, 0x9c5c8f8900000000, 0x2354904000000000, 0x89514ab100000000, 0xa11992f700000000, 0x0b1c480600000000, 0xb41457cf00000000, 0x1e118d3e00000000, 0x8b03188600000000, 0x2106c27700000000, 0x9e0eddbe00000000, 0x340b074f00000000, 0xf52d861400000000, 0x5f285ce500000000, 0xe020432c00000000, 0x4a2599dd00000000, 0xdf370c6500000000, 0x7532d69400000000, 0xca3ac95d00000000, 0x603f13ac00000000, 0x9aaa79d000000000, 0x30afa32100000000, 0x8fa7bce800000000, 0x25a2661900000000, 0xb0b0f3a100000000, 0x1ab5295000000000, 0xa5bd369900000000, 0x0fb8ec6800000000, 0xce9e6d3300000000, 0x649bb7c200000000, 0xdb93a80b00000000, 0x719672fa00000000, 0xe484e74200000000, 0x4e813db300000000, 0xf189227a00000000, 0x5b8cf88b00000000, 0x73c420cd00000000, 0xd9c1fa3c00000000, 0x66c9e5f500000000, 0xcccc3f0400000000, 0x59deaabc00000000, 0xf3db704d00000000, 0x4cd36f8400000000, 0xe6d6b57500000000, 0x27f0342e00000000, 0x8df5eedf00000000, 0x32fdf11600000000, 0x98f82be700000000, 0x0deabe5f00000000, 0xa7ef64ae00000000, 0x18e77b6700000000, 0xb2e2a19600000000, 0xecccae9f00000000, 0x46c9746e00000000, 0xf9c16ba700000000, 0x53c4b15600000000, 0xc6d624ee00000000, 0x6cd3fe1f00000000, 0xd3dbe1d600000000, 0x79de3b2700000000, 0xb8f8ba7c00000000, 0x12fd608d00000000, 0xadf57f4400000000, 0x07f0a5b500000000, 0x92e2300d00000000, 0x38e7eafc00000000, 0x87eff53500000000, 0x2dea2fc400000000, 0x05a2f78200000000, 0xafa72d7300000000, 0x10af32ba00000000, 0xbaaae84b00000000, 0x2fb87df300000000, 0x85bda70200000000, 0x3ab5b8cb00000000, 0x90b0623a00000000, 0x5196e36100000000, 0xfb93399000000000, 0x449b265900000000, 0xee9efca800000000, 0x7b8c691000000000, 0xd189b3e100000000, 0x6e81ac2800000000, 0xc48476d900000000, 0x3e111ca500000000, 0x9414c65400000000, 0x2b1cd99d00000000, 0x8119036c00000000, 0x140b96d400000000, 0xbe0e4c2500000000, 0x010653ec00000000, 0xab03891d00000000, 0x6a25084600000000, 0xc020d2b700000000, 0x7f28cd7e00000000, 0xd52d178f00000000, 0x403f823700000000, 0xea3a58c600000000, 0x5532470f00000000, 0xff379dfe00000000, 0xd77f45b800000000, 0x7d7a9f4900000000, 0xc272808000000000, 0x68775a7100000000, 0xfd65cfc900000000, 0x5760153800000000, 0xe8680af100000000, 0x426dd00000000000, 0x834b515b00000000, 0x294e8baa00000000, 0x9646946300000000, 0x3c434e9200000000, 0xa951db2a00000000, 0x035401db00000000, 0xbc5c1e1200000000, 0x1659c4e300000000}}; #else /* W == 4 */ local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0xae689191, 0x87a02563, 0x29c8b4f2, 0xd4314c87, 0x7a59dd16, 0x539169e4, 0xfdf9f875, 0x73139f4f, 0xdd7b0ede, 0xf4b3ba2c, 0x5adb2bbd, 0xa722d3c8, 0x094a4259, 0x2082f6ab, 0x8eea673a, 0xe6273e9e, 0x484faf0f, 0x61871bfd, 0xcfef8a6c, 0x32167219, 0x9c7ee388, 0xb5b6577a, 0x1bdec6eb, 0x9534a1d1, 0x3b5c3040, 0x129484b2, 0xbcfc1523, 0x4105ed56, 0xef6d7cc7, 0xc6a5c835, 0x68cd59a4, 0x173f7b7d, 0xb957eaec, 0x909f5e1e, 0x3ef7cf8f, 0xc30e37fa, 0x6d66a66b, 0x44ae1299, 0xeac68308, 0x642ce432, 0xca4475a3, 0xe38cc151, 0x4de450c0, 0xb01da8b5, 0x1e753924, 0x37bd8dd6, 0x99d51c47, 0xf11845e3, 0x5f70d472, 0x76b86080, 0xd8d0f111, 0x25290964, 0x8b4198f5, 0xa2892c07, 0x0ce1bd96, 0x820bdaac, 0x2c634b3d, 0x05abffcf, 0xabc36e5e, 0x563a962b, 0xf85207ba, 0xd19ab348, 0x7ff222d9, 0x2e7ef6fa, 0x8016676b, 0xa9ded399, 0x07b64208, 0xfa4fba7d, 0x54272bec, 0x7def9f1e, 0xd3870e8f, 0x5d6d69b5, 0xf305f824, 0xdacd4cd6, 0x74a5dd47, 0x895c2532, 0x2734b4a3, 0x0efc0051, 0xa09491c0, 0xc859c864, 0x663159f5, 0x4ff9ed07, 0xe1917c96, 0x1c6884e3, 0xb2001572, 0x9bc8a180, 0x35a03011, 0xbb4a572b, 0x1522c6ba, 0x3cea7248, 0x9282e3d9, 0x6f7b1bac, 0xc1138a3d, 0xe8db3ecf, 0x46b3af5e, 0x39418d87, 0x97291c16, 0xbee1a8e4, 0x10893975, 0xed70c100, 0x43185091, 0x6ad0e463, 0xc4b875f2, 0x4a5212c8, 0xe43a8359, 0xcdf237ab, 0x639aa63a, 0x9e635e4f, 0x300bcfde, 0x19c37b2c, 0xb7abeabd, 0xdf66b319, 0x710e2288, 0x58c6967a, 0xf6ae07eb, 0x0b57ff9e, 0xa53f6e0f, 0x8cf7dafd, 0x229f4b6c, 0xac752c56, 0x021dbdc7, 0x2bd50935, 0x85bd98a4, 0x784460d1, 0xd62cf140, 0xffe445b2, 0x518cd423, 0x5cfdedf4, 0xf2957c65, 0xdb5dc897, 0x75355906, 0x88cca173, 0x26a430e2, 0x0f6c8410, 0xa1041581, 0x2fee72bb, 0x8186e32a, 0xa84e57d8, 0x0626c649, 0xfbdf3e3c, 0x55b7afad, 0x7c7f1b5f, 0xd2178ace, 0xbadad36a, 0x14b242fb, 0x3d7af609, 0x93126798, 0x6eeb9fed, 0xc0830e7c, 0xe94bba8e, 0x47232b1f, 0xc9c94c25, 0x67a1ddb4, 0x4e696946, 0xe001f8d7, 0x1df800a2, 0xb3909133, 0x9a5825c1, 0x3430b450, 0x4bc29689, 0xe5aa0718, 0xcc62b3ea, 0x620a227b, 0x9ff3da0e, 0x319b4b9f, 0x1853ff6d, 0xb63b6efc, 0x38d109c6, 0x96b99857, 0xbf712ca5, 0x1119bd34, 0xece04541, 0x4288d4d0, 0x6b406022, 0xc528f1b3, 0xade5a817, 0x038d3986, 0x2a458d74, 0x842d1ce5, 0x79d4e490, 0xd7bc7501, 0xfe74c1f3, 0x501c5062, 0xdef63758, 0x709ea6c9, 0x5956123b, 0xf73e83aa, 0x0ac77bdf, 0xa4afea4e, 0x8d675ebc, 0x230fcf2d, 0x72831b0e, 0xdceb8a9f, 0xf5233e6d, 0x5b4baffc, 0xa6b25789, 0x08dac618, 0x211272ea, 0x8f7ae37b, 0x01908441, 0xaff815d0, 0x8630a122, 0x285830b3, 0xd5a1c8c6, 0x7bc95957, 0x5201eda5, 0xfc697c34, 0x94a42590, 0x3accb401, 0x130400f3, 0xbd6c9162, 0x40956917, 0xeefdf886, 0xc7354c74, 0x695ddde5, 0xe7b7badf, 0x49df2b4e, 0x60179fbc, 0xce7f0e2d, 0x3386f658, 0x9dee67c9, 0xb426d33b, 0x1a4e42aa, 0x65bc6073, 0xcbd4f1e2, 0xe21c4510, 0x4c74d481, 0xb18d2cf4, 0x1fe5bd65, 0x362d0997, 0x98459806, 0x16afff3c, 0xb8c76ead, 0x910fda5f, 0x3f674bce, 0xc29eb3bb, 0x6cf6222a, 0x453e96d8, 0xeb560749, 0x839b5eed, 0x2df3cf7c, 0x043b7b8e, 0xaa53ea1f, 0x57aa126a, 0xf9c283fb, 0xd00a3709, 0x7e62a698, 0xf088c1a2, 0x5ee05033, 0x7728e4c1, 0xd9407550, 0x24b98d25, 0x8ad11cb4, 0xa319a846, 0x0d7139d7}, {0x00000000, 0xb9fbdbe8, 0xa886b191, 0x117d6a79, 0x8a7c6563, 0x3387be8b, 0x22fad4f2, 0x9b010f1a, 0xcf89cc87, 0x7672176f, 0x670f7d16, 0xdef4a6fe, 0x45f5a9e4, 0xfc0e720c, 0xed731875, 0x5488c39d, 0x44629f4f, 0xfd9944a7, 0xece42ede, 0x551ff536, 0xce1efa2c, 0x77e521c4, 0x66984bbd, 0xdf639055, 0x8beb53c8, 0x32108820, 0x236de259, 0x9a9639b1, 0x019736ab, 0xb86ced43, 0xa911873a, 0x10ea5cd2, 0x88c53e9e, 0x313ee576, 0x20438f0f, 0x99b854e7, 0x02b95bfd, 0xbb428015, 0xaa3fea6c, 0x13c43184, 0x474cf219, 0xfeb729f1, 0xefca4388, 0x56319860, 0xcd30977a, 0x74cb4c92, 0x65b626eb, 0xdc4dfd03, 0xcca7a1d1, 0x755c7a39, 0x64211040, 0xdddacba8, 0x46dbc4b2, 0xff201f5a, 0xee5d7523, 0x57a6aecb, 0x032e6d56, 0xbad5b6be, 0xaba8dcc7, 0x1253072f, 0x89520835, 0x30a9d3dd, 0x21d4b9a4, 0x982f624c, 0xcafb7b7d, 0x7300a095, 0x627dcaec, 0xdb861104, 0x40871e1e, 0xf97cc5f6, 0xe801af8f, 0x51fa7467, 0x0572b7fa, 0xbc896c12, 0xadf4066b, 0x140fdd83, 0x8f0ed299, 0x36f50971, 0x27886308, 0x9e73b8e0, 0x8e99e432, 0x37623fda, 0x261f55a3, 0x9fe48e4b, 0x04e58151, 0xbd1e5ab9, 0xac6330c0, 0x1598eb28, 0x411028b5, 0xf8ebf35d, 0xe9969924, 0x506d42cc, 0xcb6c4dd6, 0x7297963e, 0x63eafc47, 0xda1127af, 0x423e45e3, 0xfbc59e0b, 0xeab8f472, 0x53432f9a, 0xc8422080, 0x71b9fb68, 0x60c49111, 0xd93f4af9, 0x8db78964, 0x344c528c, 0x253138f5, 0x9ccae31d, 0x07cbec07, 0xbe3037ef, 0xaf4d5d96, 0x16b6867e, 0x065cdaac, 0xbfa70144, 0xaeda6b3d, 0x1721b0d5, 0x8c20bfcf, 0x35db6427, 0x24a60e5e, 0x9d5dd5b6, 0xc9d5162b, 0x702ecdc3, 0x6153a7ba, 0xd8a87c52, 0x43a97348, 0xfa52a8a0, 0xeb2fc2d9, 0x52d41931, 0x4e87f0bb, 0xf77c2b53, 0xe601412a, 0x5ffa9ac2, 0xc4fb95d8, 0x7d004e30, 0x6c7d2449, 0xd586ffa1, 0x810e3c3c, 0x38f5e7d4, 0x29888dad, 0x90735645, 0x0b72595f, 0xb28982b7, 0xa3f4e8ce, 0x1a0f3326, 0x0ae56ff4, 0xb31eb41c, 0xa263de65, 0x1b98058d, 0x80990a97, 0x3962d17f, 0x281fbb06, 0x91e460ee, 0xc56ca373, 0x7c97789b, 0x6dea12e2, 0xd411c90a, 0x4f10c610, 0xf6eb1df8, 0xe7967781, 0x5e6dac69, 0xc642ce25, 0x7fb915cd, 0x6ec47fb4, 0xd73fa45c, 0x4c3eab46, 0xf5c570ae, 0xe4b81ad7, 0x5d43c13f, 0x09cb02a2, 0xb030d94a, 0xa14db333, 0x18b668db, 0x83b767c1, 0x3a4cbc29, 0x2b31d650, 0x92ca0db8, 0x8220516a, 0x3bdb8a82, 0x2aa6e0fb, 0x935d3b13, 0x085c3409, 0xb1a7efe1, 0xa0da8598, 0x19215e70, 0x4da99ded, 0xf4524605, 0xe52f2c7c, 0x5cd4f794, 0xc7d5f88e, 0x7e2e2366, 0x6f53491f, 0xd6a892f7, 0x847c8bc6, 0x3d87502e, 0x2cfa3a57, 0x9501e1bf, 0x0e00eea5, 0xb7fb354d, 0xa6865f34, 0x1f7d84dc, 0x4bf54741, 0xf20e9ca9, 0xe373f6d0, 0x5a882d38, 0xc1892222, 0x7872f9ca, 0x690f93b3, 0xd0f4485b, 0xc01e1489, 0x79e5cf61, 0x6898a518, 0xd1637ef0, 0x4a6271ea, 0xf399aa02, 0xe2e4c07b, 0x5b1f1b93, 0x0f97d80e, 0xb66c03e6, 0xa711699f, 0x1eeab277, 0x85ebbd6d, 0x3c106685, 0x2d6d0cfc, 0x9496d714, 0x0cb9b558, 0xb5426eb0, 0xa43f04c9, 0x1dc4df21, 0x86c5d03b, 0x3f3e0bd3, 0x2e4361aa, 0x97b8ba42, 0xc33079df, 0x7acba237, 0x6bb6c84e, 0xd24d13a6, 0x494c1cbc, 0xf0b7c754, 0xe1caad2d, 0x583176c5, 0x48db2a17, 0xf120f1ff, 0xe05d9b86, 0x59a6406e, 0xc2a74f74, 0x7b5c949c, 0x6a21fee5, 0xd3da250d, 0x8752e690, 0x3ea93d78, 0x2fd45701, 0x962f8ce9, 0x0d2e83f3, 0xb4d5581b, 0xa5a83262, 0x1c53e98a}, {0x00000000, 0x9d0fe176, 0xe16ec4ad, 0x7c6125db, 0x19ac8f1b, 0x84a36e6d, 0xf8c24bb6, 0x65cdaac0, 0x33591e36, 0xae56ff40, 0xd237da9b, 0x4f383bed, 0x2af5912d, 0xb7fa705b, 0xcb9b5580, 0x5694b4f6, 0x66b23c6c, 0xfbbddd1a, 0x87dcf8c1, 0x1ad319b7, 0x7f1eb377, 0xe2115201, 0x9e7077da, 0x037f96ac, 0x55eb225a, 0xc8e4c32c, 0xb485e6f7, 0x298a0781, 0x4c47ad41, 0xd1484c37, 0xad2969ec, 0x3026889a, 0xcd6478d8, 0x506b99ae, 0x2c0abc75, 0xb1055d03, 0xd4c8f7c3, 0x49c716b5, 0x35a6336e, 0xa8a9d218, 0xfe3d66ee, 0x63328798, 0x1f53a243, 0x825c4335, 0xe791e9f5, 0x7a9e0883, 0x06ff2d58, 0x9bf0cc2e, 0xabd644b4, 0x36d9a5c2, 0x4ab88019, 0xd7b7616f, 0xb27acbaf, 0x2f752ad9, 0x53140f02, 0xce1bee74, 0x988f5a82, 0x0580bbf4, 0x79e19e2f, 0xe4ee7f59, 0x8123d599, 0x1c2c34ef, 0x604d1134, 0xfd42f042, 0x41b9f7f1, 0xdcb61687, 0xa0d7335c, 0x3dd8d22a, 0x581578ea, 0xc51a999c, 0xb97bbc47, 0x24745d31, 0x72e0e9c7, 0xefef08b1, 0x938e2d6a, 0x0e81cc1c, 0x6b4c66dc, 0xf64387aa, 0x8a22a271, 0x172d4307, 0x270bcb9d, 0xba042aeb, 0xc6650f30, 0x5b6aee46, 0x3ea74486, 0xa3a8a5f0, 0xdfc9802b, 0x42c6615d, 0x1452d5ab, 0x895d34dd, 0xf53c1106, 0x6833f070, 0x0dfe5ab0, 0x90f1bbc6, 0xec909e1d, 0x719f7f6b, 0x8cdd8f29, 0x11d26e5f, 0x6db34b84, 0xf0bcaaf2, 0x95710032, 0x087ee144, 0x741fc49f, 0xe91025e9, 0xbf84911f, 0x228b7069, 0x5eea55b2, 0xc3e5b4c4, 0xa6281e04, 0x3b27ff72, 0x4746daa9, 0xda493bdf, 0xea6fb345, 0x77605233, 0x0b0177e8, 0x960e969e, 0xf3c33c5e, 0x6eccdd28, 0x12adf8f3, 0x8fa21985, 0xd936ad73, 0x44394c05, 0x385869de, 0xa55788a8, 0xc09a2268, 0x5d95c31e, 0x21f4e6c5, 0xbcfb07b3, 0x8373efe2, 0x1e7c0e94, 0x621d2b4f, 0xff12ca39, 0x9adf60f9, 0x07d0818f, 0x7bb1a454, 0xe6be4522, 0xb02af1d4, 0x2d2510a2, 0x51443579, 0xcc4bd40f, 0xa9867ecf, 0x34899fb9, 0x48e8ba62, 0xd5e75b14, 0xe5c1d38e, 0x78ce32f8, 0x04af1723, 0x99a0f655, 0xfc6d5c95, 0x6162bde3, 0x1d039838, 0x800c794e, 0xd698cdb8, 0x4b972cce, 0x37f60915, 0xaaf9e863, 0xcf3442a3, 0x523ba3d5, 0x2e5a860e, 0xb3556778, 0x4e17973a, 0xd318764c, 0xaf795397, 0x3276b2e1, 0x57bb1821, 0xcab4f957, 0xb6d5dc8c, 0x2bda3dfa, 0x7d4e890c, 0xe041687a, 0x9c204da1, 0x012facd7, 0x64e20617, 0xf9ede761, 0x858cc2ba, 0x188323cc, 0x28a5ab56, 0xb5aa4a20, 0xc9cb6ffb, 0x54c48e8d, 0x3109244d, 0xac06c53b, 0xd067e0e0, 0x4d680196, 0x1bfcb560, 0x86f35416, 0xfa9271cd, 0x679d90bb, 0x02503a7b, 0x9f5fdb0d, 0xe33efed6, 0x7e311fa0, 0xc2ca1813, 0x5fc5f965, 0x23a4dcbe, 0xbeab3dc8, 0xdb669708, 0x4669767e, 0x3a0853a5, 0xa707b2d3, 0xf1930625, 0x6c9ce753, 0x10fdc288, 0x8df223fe, 0xe83f893e, 0x75306848, 0x09514d93, 0x945eace5, 0xa478247f, 0x3977c509, 0x4516e0d2, 0xd81901a4, 0xbdd4ab64, 0x20db4a12, 0x5cba6fc9, 0xc1b58ebf, 0x97213a49, 0x0a2edb3f, 0x764ffee4, 0xeb401f92, 0x8e8db552, 0x13825424, 0x6fe371ff, 0xf2ec9089, 0x0fae60cb, 0x92a181bd, 0xeec0a466, 0x73cf4510, 0x1602efd0, 0x8b0d0ea6, 0xf76c2b7d, 0x6a63ca0b, 0x3cf77efd, 0xa1f89f8b, 0xdd99ba50, 0x40965b26, 0x255bf1e6, 0xb8541090, 0xc435354b, 0x593ad43d, 0x691c5ca7, 0xf413bdd1, 0x8872980a, 0x157d797c, 0x70b0d3bc, 0xedbf32ca, 0x91de1711, 0x0cd1f667, 0x5a454291, 0xc74aa3e7, 0xbb2b863c, 0x2624674a, 0x43e9cd8a, 0xdee62cfc, 0xa2870927, 0x3f88e851}, {0x00000000, 0xdd96d985, 0x605cb54b, 0xbdca6cce, 0xc0b96a96, 0x1d2fb313, 0xa0e5dfdd, 0x7d730658, 0x5a03d36d, 0x87950ae8, 0x3a5f6626, 0xe7c9bfa3, 0x9abab9fb, 0x472c607e, 0xfae60cb0, 0x2770d535, 0xb407a6da, 0x69917f5f, 0xd45b1391, 0x09cdca14, 0x74becc4c, 0xa92815c9, 0x14e27907, 0xc974a082, 0xee0475b7, 0x3392ac32, 0x8e58c0fc, 0x53ce1979, 0x2ebd1f21, 0xf32bc6a4, 0x4ee1aa6a, 0x937773ef, 0xb37e4bf5, 0x6ee89270, 0xd322febe, 0x0eb4273b, 0x73c72163, 0xae51f8e6, 0x139b9428, 0xce0d4dad, 0xe97d9898, 0x34eb411d, 0x89212dd3, 0x54b7f456, 0x29c4f20e, 0xf4522b8b, 0x49984745, 0x940e9ec0, 0x0779ed2f, 0xdaef34aa, 0x67255864, 0xbab381e1, 0xc7c087b9, 0x1a565e3c, 0xa79c32f2, 0x7a0aeb77, 0x5d7a3e42, 0x80ece7c7, 0x3d268b09, 0xe0b0528c, 0x9dc354d4, 0x40558d51, 0xfd9fe19f, 0x2009381a, 0xbd8d91ab, 0x601b482e, 0xddd124e0, 0x0047fd65, 0x7d34fb3d, 0xa0a222b8, 0x1d684e76, 0xc0fe97f3, 0xe78e42c6, 0x3a189b43, 0x87d2f78d, 0x5a442e08, 0x27372850, 0xfaa1f1d5, 0x476b9d1b, 0x9afd449e, 0x098a3771, 0xd41ceef4, 0x69d6823a, 0xb4405bbf, 0xc9335de7, 0x14a58462, 0xa96fe8ac, 0x74f93129, 0x5389e41c, 0x8e1f3d99, 0x33d55157, 0xee4388d2, 0x93308e8a, 0x4ea6570f, 0xf36c3bc1, 0x2efae244, 0x0ef3da5e, 0xd36503db, 0x6eaf6f15, 0xb339b690, 0xce4ab0c8, 0x13dc694d, 0xae160583, 0x7380dc06, 0x54f00933, 0x8966d0b6, 0x34acbc78, 0xe93a65fd, 0x944963a5, 0x49dfba20, 0xf415d6ee, 0x29830f6b, 0xbaf47c84, 0x6762a501, 0xdaa8c9cf, 0x073e104a, 0x7a4d1612, 0xa7dbcf97, 0x1a11a359, 0xc7877adc, 0xe0f7afe9, 0x3d61766c, 0x80ab1aa2, 0x5d3dc327, 0x204ec57f, 0xfdd81cfa, 0x40127034, 0x9d84a9b1, 0xa06a2517, 0x7dfcfc92, 0xc036905c, 0x1da049d9, 0x60d34f81, 0xbd459604, 0x008ffaca, 0xdd19234f, 0xfa69f67a, 0x27ff2fff, 0x9a354331, 0x47a39ab4, 0x3ad09cec, 0xe7464569, 0x5a8c29a7, 0x871af022, 0x146d83cd, 0xc9fb5a48, 0x74313686, 0xa9a7ef03, 0xd4d4e95b, 0x094230de, 0xb4885c10, 0x691e8595, 0x4e6e50a0, 0x93f88925, 0x2e32e5eb, 0xf3a43c6e, 0x8ed73a36, 0x5341e3b3, 0xee8b8f7d, 0x331d56f8, 0x13146ee2, 0xce82b767, 0x7348dba9, 0xaede022c, 0xd3ad0474, 0x0e3bddf1, 0xb3f1b13f, 0x6e6768ba, 0x4917bd8f, 0x9481640a, 0x294b08c4, 0xf4ddd141, 0x89aed719, 0x54380e9c, 0xe9f26252, 0x3464bbd7, 0xa713c838, 0x7a8511bd, 0xc74f7d73, 0x1ad9a4f6, 0x67aaa2ae, 0xba3c7b2b, 0x07f617e5, 0xda60ce60, 0xfd101b55, 0x2086c2d0, 0x9d4cae1e, 0x40da779b, 0x3da971c3, 0xe03fa846, 0x5df5c488, 0x80631d0d, 0x1de7b4bc, 0xc0716d39, 0x7dbb01f7, 0xa02dd872, 0xdd5ede2a, 0x00c807af, 0xbd026b61, 0x6094b2e4, 0x47e467d1, 0x9a72be54, 0x27b8d29a, 0xfa2e0b1f, 0x875d0d47, 0x5acbd4c2, 0xe701b80c, 0x3a976189, 0xa9e01266, 0x7476cbe3, 0xc9bca72d, 0x142a7ea8, 0x695978f0, 0xb4cfa175, 0x0905cdbb, 0xd493143e, 0xf3e3c10b, 0x2e75188e, 0x93bf7440, 0x4e29adc5, 0x335aab9d, 0xeecc7218, 0x53061ed6, 0x8e90c753, 0xae99ff49, 0x730f26cc, 0xcec54a02, 0x13539387, 0x6e2095df, 0xb3b64c5a, 0x0e7c2094, 0xd3eaf911, 0xf49a2c24, 0x290cf5a1, 0x94c6996f, 0x495040ea, 0x342346b2, 0xe9b59f37, 0x547ff3f9, 0x89e92a7c, 0x1a9e5993, 0xc7088016, 0x7ac2ecd8, 0xa754355d, 0xda273305, 0x07b1ea80, 0xba7b864e, 0x67ed5fcb, 0x409d8afe, 0x9d0b537b, 0x20c13fb5, 0xfd57e630, 0x8024e068, 0x5db239ed, 0xe0785523, 0x3dee8ca6}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x00000000, 0x85d996dd, 0x4bb55c60, 0xce6ccabd, 0x966ab9c0, 0x13b32f1d, 0xdddfe5a0, 0x5806737d, 0x6dd3035a, 0xe80a9587, 0x26665f3a, 0xa3bfc9e7, 0xfbb9ba9a, 0x7e602c47, 0xb00ce6fa, 0x35d57027, 0xdaa607b4, 0x5f7f9169, 0x91135bd4, 0x14cacd09, 0x4cccbe74, 0xc91528a9, 0x0779e214, 0x82a074c9, 0xb77504ee, 0x32ac9233, 0xfcc0588e, 0x7919ce53, 0x211fbd2e, 0xa4c62bf3, 0x6aaae14e, 0xef737793, 0xf54b7eb3, 0x7092e86e, 0xbefe22d3, 0x3b27b40e, 0x6321c773, 0xe6f851ae, 0x28949b13, 0xad4d0dce, 0x98987de9, 0x1d41eb34, 0xd32d2189, 0x56f4b754, 0x0ef2c429, 0x8b2b52f4, 0x45479849, 0xc09e0e94, 0x2fed7907, 0xaa34efda, 0x64582567, 0xe181b3ba, 0xb987c0c7, 0x3c5e561a, 0xf2329ca7, 0x77eb0a7a, 0x423e7a5d, 0xc7e7ec80, 0x098b263d, 0x8c52b0e0, 0xd454c39d, 0x518d5540, 0x9fe19ffd, 0x1a380920, 0xab918dbd, 0x2e481b60, 0xe024d1dd, 0x65fd4700, 0x3dfb347d, 0xb822a2a0, 0x764e681d, 0xf397fec0, 0xc6428ee7, 0x439b183a, 0x8df7d287, 0x082e445a, 0x50283727, 0xd5f1a1fa, 0x1b9d6b47, 0x9e44fd9a, 0x71378a09, 0xf4ee1cd4, 0x3a82d669, 0xbf5b40b4, 0xe75d33c9, 0x6284a514, 0xace86fa9, 0x2931f974, 0x1ce48953, 0x993d1f8e, 0x5751d533, 0xd28843ee, 0x8a8e3093, 0x0f57a64e, 0xc13b6cf3, 0x44e2fa2e, 0x5edaf30e, 0xdb0365d3, 0x156faf6e, 0x90b639b3, 0xc8b04ace, 0x4d69dc13, 0x830516ae, 0x06dc8073, 0x3309f054, 0xb6d06689, 0x78bcac34, 0xfd653ae9, 0xa5634994, 0x20badf49, 0xeed615f4, 0x6b0f8329, 0x847cf4ba, 0x01a56267, 0xcfc9a8da, 0x4a103e07, 0x12164d7a, 0x97cfdba7, 0x59a3111a, 0xdc7a87c7, 0xe9aff7e0, 0x6c76613d, 0xa21aab80, 0x27c33d5d, 0x7fc54e20, 0xfa1cd8fd, 0x34701240, 0xb1a9849d, 0x17256aa0, 0x92fcfc7d, 0x5c9036c0, 0xd949a01d, 0x814fd360, 0x049645bd, 0xcafa8f00, 0x4f2319dd, 0x7af669fa, 0xff2fff27, 0x3143359a, 0xb49aa347, 0xec9cd03a, 0x694546e7, 0xa7298c5a, 0x22f01a87, 0xcd836d14, 0x485afbc9, 0x86363174, 0x03efa7a9, 0x5be9d4d4, 0xde304209, 0x105c88b4, 0x95851e69, 0xa0506e4e, 0x2589f893, 0xebe5322e, 0x6e3ca4f3, 0x363ad78e, 0xb3e34153, 0x7d8f8bee, 0xf8561d33, 0xe26e1413, 0x67b782ce, 0xa9db4873, 0x2c02deae, 0x7404add3, 0xf1dd3b0e, 0x3fb1f1b3, 0xba68676e, 0x8fbd1749, 0x0a648194, 0xc4084b29, 0x41d1ddf4, 0x19d7ae89, 0x9c0e3854, 0x5262f2e9, 0xd7bb6434, 0x38c813a7, 0xbd11857a, 0x737d4fc7, 0xf6a4d91a, 0xaea2aa67, 0x2b7b3cba, 0xe517f607, 0x60ce60da, 0x551b10fd, 0xd0c28620, 0x1eae4c9d, 0x9b77da40, 0xc371a93d, 0x46a83fe0, 0x88c4f55d, 0x0d1d6380, 0xbcb4e71d, 0x396d71c0, 0xf701bb7d, 0x72d82da0, 0x2ade5edd, 0xaf07c800, 0x616b02bd, 0xe4b29460, 0xd167e447, 0x54be729a, 0x9ad2b827, 0x1f0b2efa, 0x470d5d87, 0xc2d4cb5a, 0x0cb801e7, 0x8961973a, 0x6612e0a9, 0xe3cb7674, 0x2da7bcc9, 0xa87e2a14, 0xf0785969, 0x75a1cfb4, 0xbbcd0509, 0x3e1493d4, 0x0bc1e3f3, 0x8e18752e, 0x4074bf93, 0xc5ad294e, 0x9dab5a33, 0x1872ccee, 0xd61e0653, 0x53c7908e, 0x49ff99ae, 0xcc260f73, 0x024ac5ce, 0x87935313, 0xdf95206e, 0x5a4cb6b3, 0x94207c0e, 0x11f9ead3, 0x242c9af4, 0xa1f50c29, 0x6f99c694, 0xea405049, 0xb2462334, 0x379fb5e9, 0xf9f37f54, 0x7c2ae989, 0x93599e1a, 0x168008c7, 0xd8ecc27a, 0x5d3554a7, 0x053327da, 0x80eab107, 0x4e867bba, 0xcb5fed67, 0xfe8a9d40, 0x7b530b9d, 0xb53fc120, 0x30e657fd, 0x68e02480, 0xed39b25d, 0x235578e0, 0xa68cee3d}, {0x00000000, 0x76e10f9d, 0xadc46ee1, 0xdb25617c, 0x1b8fac19, 0x6d6ea384, 0xb64bc2f8, 0xc0aacd65, 0x361e5933, 0x40ff56ae, 0x9bda37d2, 0xed3b384f, 0x2d91f52a, 0x5b70fab7, 0x80559bcb, 0xf6b49456, 0x6c3cb266, 0x1addbdfb, 0xc1f8dc87, 0xb719d31a, 0x77b31e7f, 0x015211e2, 0xda77709e, 0xac967f03, 0x5a22eb55, 0x2cc3e4c8, 0xf7e685b4, 0x81078a29, 0x41ad474c, 0x374c48d1, 0xec6929ad, 0x9a882630, 0xd87864cd, 0xae996b50, 0x75bc0a2c, 0x035d05b1, 0xc3f7c8d4, 0xb516c749, 0x6e33a635, 0x18d2a9a8, 0xee663dfe, 0x98873263, 0x43a2531f, 0x35435c82, 0xf5e991e7, 0x83089e7a, 0x582dff06, 0x2eccf09b, 0xb444d6ab, 0xc2a5d936, 0x1980b84a, 0x6f61b7d7, 0xafcb7ab2, 0xd92a752f, 0x020f1453, 0x74ee1bce, 0x825a8f98, 0xf4bb8005, 0x2f9ee179, 0x597feee4, 0x99d52381, 0xef342c1c, 0x34114d60, 0x42f042fd, 0xf1f7b941, 0x8716b6dc, 0x5c33d7a0, 0x2ad2d83d, 0xea781558, 0x9c991ac5, 0x47bc7bb9, 0x315d7424, 0xc7e9e072, 0xb108efef, 0x6a2d8e93, 0x1ccc810e, 0xdc664c6b, 0xaa8743f6, 0x71a2228a, 0x07432d17, 0x9dcb0b27, 0xeb2a04ba, 0x300f65c6, 0x46ee6a5b, 0x8644a73e, 0xf0a5a8a3, 0x2b80c9df, 0x5d61c642, 0xabd55214, 0xdd345d89, 0x06113cf5, 0x70f03368, 0xb05afe0d, 0xc6bbf190, 0x1d9e90ec, 0x6b7f9f71, 0x298fdd8c, 0x5f6ed211, 0x844bb36d, 0xf2aabcf0, 0x32007195, 0x44e17e08, 0x9fc41f74, 0xe92510e9, 0x1f9184bf, 0x69708b22, 0xb255ea5e, 0xc4b4e5c3, 0x041e28a6, 0x72ff273b, 0xa9da4647, 0xdf3b49da, 0x45b36fea, 0x33526077, 0xe877010b, 0x9e960e96, 0x5e3cc3f3, 0x28ddcc6e, 0xf3f8ad12, 0x8519a28f, 0x73ad36d9, 0x054c3944, 0xde695838, 0xa88857a5, 0x68229ac0, 0x1ec3955d, 0xc5e6f421, 0xb307fbbc, 0xe2ef7383, 0x940e7c1e, 0x4f2b1d62, 0x39ca12ff, 0xf960df9a, 0x8f81d007, 0x54a4b17b, 0x2245bee6, 0xd4f12ab0, 0xa210252d, 0x79354451, 0x0fd44bcc, 0xcf7e86a9, 0xb99f8934, 0x62bae848, 0x145be7d5, 0x8ed3c1e5, 0xf832ce78, 0x2317af04, 0x55f6a099, 0x955c6dfc, 0xe3bd6261, 0x3898031d, 0x4e790c80, 0xb8cd98d6, 0xce2c974b, 0x1509f637, 0x63e8f9aa, 0xa34234cf, 0xd5a33b52, 0x0e865a2e, 0x786755b3, 0x3a97174e, 0x4c7618d3, 0x975379af, 0xe1b27632, 0x2118bb57, 0x57f9b4ca, 0x8cdcd5b6, 0xfa3dda2b, 0x0c894e7d, 0x7a6841e0, 0xa14d209c, 0xd7ac2f01, 0x1706e264, 0x61e7edf9, 0xbac28c85, 0xcc238318, 0x56aba528, 0x204aaab5, 0xfb6fcbc9, 0x8d8ec454, 0x4d240931, 0x3bc506ac, 0xe0e067d0, 0x9601684d, 0x60b5fc1b, 0x1654f386, 0xcd7192fa, 0xbb909d67, 0x7b3a5002, 0x0ddb5f9f, 0xd6fe3ee3, 0xa01f317e, 0x1318cac2, 0x65f9c55f, 0xbedca423, 0xc83dabbe, 0x089766db, 0x7e766946, 0xa553083a, 0xd3b207a7, 0x250693f1, 0x53e79c6c, 0x88c2fd10, 0xfe23f28d, 0x3e893fe8, 0x48683075, 0x934d5109, 0xe5ac5e94, 0x7f2478a4, 0x09c57739, 0xd2e01645, 0xa40119d8, 0x64abd4bd, 0x124adb20, 0xc96fba5c, 0xbf8eb5c1, 0x493a2197, 0x3fdb2e0a, 0xe4fe4f76, 0x921f40eb, 0x52b58d8e, 0x24548213, 0xff71e36f, 0x8990ecf2, 0xcb60ae0f, 0xbd81a192, 0x66a4c0ee, 0x1045cf73, 0xd0ef0216, 0xa60e0d8b, 0x7d2b6cf7, 0x0bca636a, 0xfd7ef73c, 0x8b9ff8a1, 0x50ba99dd, 0x265b9640, 0xe6f15b25, 0x901054b8, 0x4b3535c4, 0x3dd43a59, 0xa75c1c69, 0xd1bd13f4, 0x0a987288, 0x7c797d15, 0xbcd3b070, 0xca32bfed, 0x1117de91, 0x67f6d10c, 0x9142455a, 0xe7a34ac7, 0x3c862bbb, 0x4a672426, 0x8acde943, 0xfc2ce6de, 0x270987a2, 0x51e8883f}, {0x00000000, 0xe8dbfbb9, 0x91b186a8, 0x796a7d11, 0x63657c8a, 0x8bbe8733, 0xf2d4fa22, 0x1a0f019b, 0x87cc89cf, 0x6f177276, 0x167d0f67, 0xfea6f4de, 0xe4a9f545, 0x0c720efc, 0x751873ed, 0x9dc38854, 0x4f9f6244, 0xa74499fd, 0xde2ee4ec, 0x36f51f55, 0x2cfa1ece, 0xc421e577, 0xbd4b9866, 0x559063df, 0xc853eb8b, 0x20881032, 0x59e26d23, 0xb139969a, 0xab369701, 0x43ed6cb8, 0x3a8711a9, 0xd25cea10, 0x9e3ec588, 0x76e53e31, 0x0f8f4320, 0xe754b899, 0xfd5bb902, 0x158042bb, 0x6cea3faa, 0x8431c413, 0x19f24c47, 0xf129b7fe, 0x8843caef, 0x60983156, 0x7a9730cd, 0x924ccb74, 0xeb26b665, 0x03fd4ddc, 0xd1a1a7cc, 0x397a5c75, 0x40102164, 0xa8cbdadd, 0xb2c4db46, 0x5a1f20ff, 0x23755dee, 0xcbaea657, 0x566d2e03, 0xbeb6d5ba, 0xc7dca8ab, 0x2f075312, 0x35085289, 0xddd3a930, 0xa4b9d421, 0x4c622f98, 0x7d7bfbca, 0x95a00073, 0xecca7d62, 0x041186db, 0x1e1e8740, 0xf6c57cf9, 0x8faf01e8, 0x6774fa51, 0xfab77205, 0x126c89bc, 0x6b06f4ad, 0x83dd0f14, 0x99d20e8f, 0x7109f536, 0x08638827, 0xe0b8739e, 0x32e4998e, 0xda3f6237, 0xa3551f26, 0x4b8ee49f, 0x5181e504, 0xb95a1ebd, 0xc03063ac, 0x28eb9815, 0xb5281041, 0x5df3ebf8, 0x249996e9, 0xcc426d50, 0xd64d6ccb, 0x3e969772, 0x47fcea63, 0xaf2711da, 0xe3453e42, 0x0b9ec5fb, 0x72f4b8ea, 0x9a2f4353, 0x802042c8, 0x68fbb971, 0x1191c460, 0xf94a3fd9, 0x6489b78d, 0x8c524c34, 0xf5383125, 0x1de3ca9c, 0x07eccb07, 0xef3730be, 0x965d4daf, 0x7e86b616, 0xacda5c06, 0x4401a7bf, 0x3d6bdaae, 0xd5b02117, 0xcfbf208c, 0x2764db35, 0x5e0ea624, 0xb6d55d9d, 0x2b16d5c9, 0xc3cd2e70, 0xbaa75361, 0x527ca8d8, 0x4873a943, 0xa0a852fa, 0xd9c22feb, 0x3119d452, 0xbbf0874e, 0x532b7cf7, 0x2a4101e6, 0xc29afa5f, 0xd895fbc4, 0x304e007d, 0x49247d6c, 0xa1ff86d5, 0x3c3c0e81, 0xd4e7f538, 0xad8d8829, 0x45567390, 0x5f59720b, 0xb78289b2, 0xcee8f4a3, 0x26330f1a, 0xf46fe50a, 0x1cb41eb3, 0x65de63a2, 0x8d05981b, 0x970a9980, 0x7fd16239, 0x06bb1f28, 0xee60e491, 0x73a36cc5, 0x9b78977c, 0xe212ea6d, 0x0ac911d4, 0x10c6104f, 0xf81debf6, 0x817796e7, 0x69ac6d5e, 0x25ce42c6, 0xcd15b97f, 0xb47fc46e, 0x5ca43fd7, 0x46ab3e4c, 0xae70c5f5, 0xd71ab8e4, 0x3fc1435d, 0xa202cb09, 0x4ad930b0, 0x33b34da1, 0xdb68b618, 0xc167b783, 0x29bc4c3a, 0x50d6312b, 0xb80dca92, 0x6a512082, 0x828adb3b, 0xfbe0a62a, 0x133b5d93, 0x09345c08, 0xe1efa7b1, 0x9885daa0, 0x705e2119, 0xed9da94d, 0x054652f4, 0x7c2c2fe5, 0x94f7d45c, 0x8ef8d5c7, 0x66232e7e, 0x1f49536f, 0xf792a8d6, 0xc68b7c84, 0x2e50873d, 0x573afa2c, 0xbfe10195, 0xa5ee000e, 0x4d35fbb7, 0x345f86a6, 0xdc847d1f, 0x4147f54b, 0xa99c0ef2, 0xd0f673e3, 0x382d885a, 0x222289c1, 0xcaf97278, 0xb3930f69, 0x5b48f4d0, 0x89141ec0, 0x61cfe579, 0x18a59868, 0xf07e63d1, 0xea71624a, 0x02aa99f3, 0x7bc0e4e2, 0x931b1f5b, 0x0ed8970f, 0xe6036cb6, 0x9f6911a7, 0x77b2ea1e, 0x6dbdeb85, 0x8566103c, 0xfc0c6d2d, 0x14d79694, 0x58b5b90c, 0xb06e42b5, 0xc9043fa4, 0x21dfc41d, 0x3bd0c586, 0xd30b3e3f, 0xaa61432e, 0x42bab897, 0xdf7930c3, 0x37a2cb7a, 0x4ec8b66b, 0xa6134dd2, 0xbc1c4c49, 0x54c7b7f0, 0x2dadcae1, 0xc5763158, 0x172adb48, 0xfff120f1, 0x869b5de0, 0x6e40a659, 0x744fa7c2, 0x9c945c7b, 0xe5fe216a, 0x0d25dad3, 0x90e65287, 0x783da93e, 0x0157d42f, 0xe98c2f96, 0xf3832e0d, 0x1b58d5b4, 0x6232a8a5, 0x8ae9531c}, {0x00000000, 0x919168ae, 0x6325a087, 0xf2b4c829, 0x874c31d4, 0x16dd597a, 0xe4699153, 0x75f8f9fd, 0x4f9f1373, 0xde0e7bdd, 0x2cbab3f4, 0xbd2bdb5a, 0xc8d322a7, 0x59424a09, 0xabf68220, 0x3a67ea8e, 0x9e3e27e6, 0x0faf4f48, 0xfd1b8761, 0x6c8aefcf, 0x19721632, 0x88e37e9c, 0x7a57b6b5, 0xebc6de1b, 0xd1a13495, 0x40305c3b, 0xb2849412, 0x2315fcbc, 0x56ed0541, 0xc77c6def, 0x35c8a5c6, 0xa459cd68, 0x7d7b3f17, 0xecea57b9, 0x1e5e9f90, 0x8fcff73e, 0xfa370ec3, 0x6ba6666d, 0x9912ae44, 0x0883c6ea, 0x32e42c64, 0xa37544ca, 0x51c18ce3, 0xc050e44d, 0xb5a81db0, 0x2439751e, 0xd68dbd37, 0x471cd599, 0xe34518f1, 0x72d4705f, 0x8060b876, 0x11f1d0d8, 0x64092925, 0xf598418b, 0x072c89a2, 0x96bde10c, 0xacda0b82, 0x3d4b632c, 0xcfffab05, 0x5e6ec3ab, 0x2b963a56, 0xba0752f8, 0x48b39ad1, 0xd922f27f, 0xfaf67e2e, 0x6b671680, 0x99d3dea9, 0x0842b607, 0x7dba4ffa, 0xec2b2754, 0x1e9fef7d, 0x8f0e87d3, 0xb5696d5d, 0x24f805f3, 0xd64ccdda, 0x47dda574, 0x32255c89, 0xa3b43427, 0x5100fc0e, 0xc09194a0, 0x64c859c8, 0xf5593166, 0x07edf94f, 0x967c91e1, 0xe384681c, 0x721500b2, 0x80a1c89b, 0x1130a035, 0x2b574abb, 0xbac62215, 0x4872ea3c, 0xd9e38292, 0xac1b7b6f, 0x3d8a13c1, 0xcf3edbe8, 0x5eafb346, 0x878d4139, 0x161c2997, 0xe4a8e1be, 0x75398910, 0x00c170ed, 0x91501843, 0x63e4d06a, 0xf275b8c4, 0xc812524a, 0x59833ae4, 0xab37f2cd, 0x3aa69a63, 0x4f5e639e, 0xdecf0b30, 0x2c7bc319, 0xbdeaabb7, 0x19b366df, 0x88220e71, 0x7a96c658, 0xeb07aef6, 0x9eff570b, 0x0f6e3fa5, 0xfddaf78c, 0x6c4b9f22, 0x562c75ac, 0xc7bd1d02, 0x3509d52b, 0xa498bd85, 0xd1604478, 0x40f12cd6, 0xb245e4ff, 0x23d48c51, 0xf4edfd5c, 0x657c95f2, 0x97c85ddb, 0x06593575, 0x73a1cc88, 0xe230a426, 0x10846c0f, 0x811504a1, 0xbb72ee2f, 0x2ae38681, 0xd8574ea8, 0x49c62606, 0x3c3edffb, 0xadafb755, 0x5f1b7f7c, 0xce8a17d2, 0x6ad3daba, 0xfb42b214, 0x09f67a3d, 0x98671293, 0xed9feb6e, 0x7c0e83c0, 0x8eba4be9, 0x1f2b2347, 0x254cc9c9, 0xb4dda167, 0x4669694e, 0xd7f801e0, 0xa200f81d, 0x339190b3, 0xc125589a, 0x50b43034, 0x8996c24b, 0x1807aae5, 0xeab362cc, 0x7b220a62, 0x0edaf39f, 0x9f4b9b31, 0x6dff5318, 0xfc6e3bb6, 0xc609d138, 0x5798b996, 0xa52c71bf, 0x34bd1911, 0x4145e0ec, 0xd0d48842, 0x2260406b, 0xb3f128c5, 0x17a8e5ad, 0x86398d03, 0x748d452a, 0xe51c2d84, 0x90e4d479, 0x0175bcd7, 0xf3c174fe, 0x62501c50, 0x5837f6de, 0xc9a69e70, 0x3b125659, 0xaa833ef7, 0xdf7bc70a, 0x4eeaafa4, 0xbc5e678d, 0x2dcf0f23, 0x0e1b8372, 0x9f8aebdc, 0x6d3e23f5, 0xfcaf4b5b, 0x8957b2a6, 0x18c6da08, 0xea721221, 0x7be37a8f, 0x41849001, 0xd015f8af, 0x22a13086, 0xb3305828, 0xc6c8a1d5, 0x5759c97b, 0xa5ed0152, 0x347c69fc, 0x9025a494, 0x01b4cc3a, 0xf3000413, 0x62916cbd, 0x17699540, 0x86f8fdee, 0x744c35c7, 0xe5dd5d69, 0xdfbab7e7, 0x4e2bdf49, 0xbc9f1760, 0x2d0e7fce, 0x58f68633, 0xc967ee9d, 0x3bd326b4, 0xaa424e1a, 0x7360bc65, 0xe2f1d4cb, 0x10451ce2, 0x81d4744c, 0xf42c8db1, 0x65bde51f, 0x97092d36, 0x06984598, 0x3cffaf16, 0xad6ec7b8, 0x5fda0f91, 0xce4b673f, 0xbbb39ec2, 0x2a22f66c, 0xd8963e45, 0x490756eb, 0xed5e9b83, 0x7ccff32d, 0x8e7b3b04, 0x1fea53aa, 0x6a12aa57, 0xfb83c2f9, 0x09370ad0, 0x98a6627e, 0xa2c188f0, 0x3350e05e, 0xc1e42877, 0x507540d9, 0x258db924, 0xb41cd18a, 0x46a819a3, 0xd739710d}}; #endif #endif #if N == 5 #if W == 8 local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0xaf449247, 0x85f822cf, 0x2abcb088, 0xd08143df, 0x7fc5d198, 0x55796110, 0xfa3df357, 0x7a7381ff, 0xd53713b8, 0xff8ba330, 0x50cf3177, 0xaaf2c220, 0x05b65067, 0x2f0ae0ef, 0x804e72a8, 0xf4e703fe, 0x5ba391b9, 0x711f2131, 0xde5bb376, 0x24664021, 0x8b22d266, 0xa19e62ee, 0x0edaf0a9, 0x8e948201, 0x21d01046, 0x0b6ca0ce, 0xa4283289, 0x5e15c1de, 0xf1515399, 0xdbede311, 0x74a97156, 0x32bf01bd, 0x9dfb93fa, 0xb7472372, 0x1803b135, 0xe23e4262, 0x4d7ad025, 0x67c660ad, 0xc882f2ea, 0x48cc8042, 0xe7881205, 0xcd34a28d, 0x627030ca, 0x984dc39d, 0x370951da, 0x1db5e152, 0xb2f17315, 0xc6580243, 0x691c9004, 0x43a0208c, 0xece4b2cb, 0x16d9419c, 0xb99dd3db, 0x93216353, 0x3c65f114, 0xbc2b83bc, 0x136f11fb, 0x39d3a173, 0x96973334, 0x6caac063, 0xc3ee5224, 0xe952e2ac, 0x461670eb, 0x657e037a, 0xca3a913d, 0xe08621b5, 0x4fc2b3f2, 0xb5ff40a5, 0x1abbd2e2, 0x3007626a, 0x9f43f02d, 0x1f0d8285, 0xb04910c2, 0x9af5a04a, 0x35b1320d, 0xcf8cc15a, 0x60c8531d, 0x4a74e395, 0xe53071d2, 0x91990084, 0x3edd92c3, 0x1461224b, 0xbb25b00c, 0x4118435b, 0xee5cd11c, 0xc4e06194, 0x6ba4f3d3, 0xebea817b, 0x44ae133c, 0x6e12a3b4, 0xc15631f3, 0x3b6bc2a4, 0x942f50e3, 0xbe93e06b, 0x11d7722c, 0x57c102c7, 0xf8859080, 0xd2392008, 0x7d7db24f, 0x87404118, 0x2804d35f, 0x02b863d7, 0xadfcf190, 0x2db28338, 0x82f6117f, 0xa84aa1f7, 0x070e33b0, 0xfd33c0e7, 0x527752a0, 0x78cbe228, 0xd78f706f, 0xa3260139, 0x0c62937e, 0x26de23f6, 0x899ab1b1, 0x73a742e6, 0xdce3d0a1, 0xf65f6029, 0x591bf26e, 0xd95580c6, 0x76111281, 0x5cada209, 0xf3e9304e, 0x09d4c319, 0xa690515e, 0x8c2ce1d6, 0x23687391, 0xcafc06f4, 0x65b894b3, 0x4f04243b, 0xe040b67c, 0x1a7d452b, 0xb539d76c, 0x9f8567e4, 0x30c1f5a3, 0xb08f870b, 0x1fcb154c, 0x3577a5c4, 0x9a333783, 0x600ec4d4, 0xcf4a5693, 0xe5f6e61b, 0x4ab2745c, 0x3e1b050a, 0x915f974d, 0xbbe327c5, 0x14a7b582, 0xee9a46d5, 0x41ded492, 0x6b62641a, 0xc426f65d, 0x446884f5, 0xeb2c16b2, 0xc190a63a, 0x6ed4347d, 0x94e9c72a, 0x3bad556d, 0x1111e5e5, 0xbe5577a2, 0xf8430749, 0x5707950e, 0x7dbb2586, 0xd2ffb7c1, 0x28c24496, 0x8786d6d1, 0xad3a6659, 0x027ef41e, 0x823086b6, 0x2d7414f1, 0x07c8a479, 0xa88c363e, 0x52b1c569, 0xfdf5572e, 0xd749e7a6, 0x780d75e1, 0x0ca404b7, 0xa3e096f0, 0x895c2678, 0x2618b43f, 0xdc254768, 0x7361d52f, 0x59dd65a7, 0xf699f7e0, 0x76d78548, 0xd993170f, 0xf32fa787, 0x5c6b35c0, 0xa656c697, 0x091254d0, 0x23aee458, 0x8cea761f, 0xaf82058e, 0x00c697c9, 0x2a7a2741, 0x853eb506, 0x7f034651, 0xd047d416, 0xfafb649e, 0x55bff6d9, 0xd5f18471, 0x7ab51636, 0x5009a6be, 0xff4d34f9, 0x0570c7ae, 0xaa3455e9, 0x8088e561, 0x2fcc7726, 0x5b650670, 0xf4219437, 0xde9d24bf, 0x71d9b6f8, 0x8be445af, 0x24a0d7e8, 0x0e1c6760, 0xa158f527, 0x2116878f, 0x8e5215c8, 0xa4eea540, 0x0baa3707, 0xf197c450, 0x5ed35617, 0x746fe69f, 0xdb2b74d8, 0x9d3d0433, 0x32799674, 0x18c526fc, 0xb781b4bb, 0x4dbc47ec, 0xe2f8d5ab, 0xc8446523, 0x6700f764, 0xe74e85cc, 0x480a178b, 0x62b6a703, 0xcdf23544, 0x37cfc613, 0x988b5454, 0xb237e4dc, 0x1d73769b, 0x69da07cd, 0xc69e958a, 0xec222502, 0x4366b745, 0xb95b4412, 0x161fd655, 0x3ca366dd, 0x93e7f49a, 0x13a98632, 0xbced1475, 0x9651a4fd, 0x391536ba, 0xc328c5ed, 0x6c6c57aa, 0x46d0e722, 0xe9947565}, {0x00000000, 0x4e890ba9, 0x9d121752, 0xd39b1cfb, 0xe15528e5, 0xafdc234c, 0x7c473fb7, 0x32ce341e, 0x19db578b, 0x57525c22, 0x84c940d9, 0xca404b70, 0xf88e7f6e, 0xb60774c7, 0x659c683c, 0x2b156395, 0x33b6af16, 0x7d3fa4bf, 0xaea4b844, 0xe02db3ed, 0xd2e387f3, 0x9c6a8c5a, 0x4ff190a1, 0x01789b08, 0x2a6df89d, 0x64e4f334, 0xb77fefcf, 0xf9f6e466, 0xcb38d078, 0x85b1dbd1, 0x562ac72a, 0x18a3cc83, 0x676d5e2c, 0x29e45585, 0xfa7f497e, 0xb4f642d7, 0x863876c9, 0xc8b17d60, 0x1b2a619b, 0x55a36a32, 0x7eb609a7, 0x303f020e, 0xe3a41ef5, 0xad2d155c, 0x9fe32142, 0xd16a2aeb, 0x02f13610, 0x4c783db9, 0x54dbf13a, 0x1a52fa93, 0xc9c9e668, 0x8740edc1, 0xb58ed9df, 0xfb07d276, 0x289cce8d, 0x6615c524, 0x4d00a6b1, 0x0389ad18, 0xd012b1e3, 0x9e9bba4a, 0xac558e54, 0xe2dc85fd, 0x31479906, 0x7fce92af, 0xcedabc58, 0x8053b7f1, 0x53c8ab0a, 0x1d41a0a3, 0x2f8f94bd, 0x61069f14, 0xb29d83ef, 0xfc148846, 0xd701ebd3, 0x9988e07a, 0x4a13fc81, 0x049af728, 0x3654c336, 0x78ddc89f, 0xab46d464, 0xe5cfdfcd, 0xfd6c134e, 0xb3e518e7, 0x607e041c, 0x2ef70fb5, 0x1c393bab, 0x52b03002, 0x812b2cf9, 0xcfa22750, 0xe4b744c5, 0xaa3e4f6c, 0x79a55397, 0x372c583e, 0x05e26c20, 0x4b6b6789, 0x98f07b72, 0xd67970db, 0xa9b7e274, 0xe73ee9dd, 0x34a5f526, 0x7a2cfe8f, 0x48e2ca91, 0x066bc138, 0xd5f0ddc3, 0x9b79d66a, 0xb06cb5ff, 0xfee5be56, 0x2d7ea2ad, 0x63f7a904, 0x51399d1a, 0x1fb096b3, 0xcc2b8a48, 0x82a281e1, 0x9a014d62, 0xd48846cb, 0x07135a30, 0x499a5199, 0x7b546587, 0x35dd6e2e, 0xe64672d5, 0xa8cf797c, 0x83da1ae9, 0xcd531140, 0x1ec80dbb, 0x50410612, 0x628f320c, 0x2c0639a5, 0xff9d255e, 0xb1142ef7, 0x46c47ef1, 0x084d7558, 0xdbd669a3, 0x955f620a, 0xa7915614, 0xe9185dbd, 0x3a834146, 0x740a4aef, 0x5f1f297a, 0x119622d3, 0xc20d3e28, 0x8c843581, 0xbe4a019f, 0xf0c30a36, 0x235816cd, 0x6dd11d64, 0x7572d1e7, 0x3bfbda4e, 0xe860c6b5, 0xa6e9cd1c, 0x9427f902, 0xdaaef2ab, 0x0935ee50, 0x47bce5f9, 0x6ca9866c, 0x22208dc5, 0xf1bb913e, 0xbf329a97, 0x8dfcae89, 0xc375a520, 0x10eeb9db, 0x5e67b272, 0x21a920dd, 0x6f202b74, 0xbcbb378f, 0xf2323c26, 0xc0fc0838, 0x8e750391, 0x5dee1f6a, 0x136714c3, 0x38727756, 0x76fb7cff, 0xa5606004, 0xebe96bad, 0xd9275fb3, 0x97ae541a, 0x443548e1, 0x0abc4348, 0x121f8fcb, 0x5c968462, 0x8f0d9899, 0xc1849330, 0xf34aa72e, 0xbdc3ac87, 0x6e58b07c, 0x20d1bbd5, 0x0bc4d840, 0x454dd3e9, 0x96d6cf12, 0xd85fc4bb, 0xea91f0a5, 0xa418fb0c, 0x7783e7f7, 0x390aec5e, 0x881ec2a9, 0xc697c900, 0x150cd5fb, 0x5b85de52, 0x694bea4c, 0x27c2e1e5, 0xf459fd1e, 0xbad0f6b7, 0x91c59522, 0xdf4c9e8b, 0x0cd78270, 0x425e89d9, 0x7090bdc7, 0x3e19b66e, 0xed82aa95, 0xa30ba13c, 0xbba86dbf, 0xf5216616, 0x26ba7aed, 0x68337144, 0x5afd455a, 0x14744ef3, 0xc7ef5208, 0x896659a1, 0xa2733a34, 0xecfa319d, 0x3f612d66, 0x71e826cf, 0x432612d1, 0x0daf1978, 0xde340583, 0x90bd0e2a, 0xef739c85, 0xa1fa972c, 0x72618bd7, 0x3ce8807e, 0x0e26b460, 0x40afbfc9, 0x9334a332, 0xddbda89b, 0xf6a8cb0e, 0xb821c0a7, 0x6bbadc5c, 0x2533d7f5, 0x17fde3eb, 0x5974e842, 0x8aeff4b9, 0xc466ff10, 0xdcc53393, 0x924c383a, 0x41d724c1, 0x0f5e2f68, 0x3d901b76, 0x731910df, 0xa0820c24, 0xee0b078d, 0xc51e6418, 0x8b976fb1, 0x580c734a, 0x168578e3, 0x244b4cfd, 0x6ac24754, 0xb9595baf, 0xf7d05006}, {0x00000000, 0x8d88fde2, 0xc060fd85, 0x4de80067, 0x5bb0fd4b, 0xd63800a9, 0x9bd000ce, 0x1658fd2c, 0xb761fa96, 0x3ae90774, 0x77010713, 0xfa89faf1, 0xecd107dd, 0x6159fa3f, 0x2cb1fa58, 0xa13907ba, 0xb5b2f36d, 0x383a0e8f, 0x75d20ee8, 0xf85af30a, 0xee020e26, 0x638af3c4, 0x2e62f3a3, 0xa3ea0e41, 0x02d309fb, 0x8f5bf419, 0xc2b3f47e, 0x4f3b099c, 0x5963f4b0, 0xd4eb0952, 0x99030935, 0x148bf4d7, 0xb014e09b, 0x3d9c1d79, 0x70741d1e, 0xfdfce0fc, 0xeba41dd0, 0x662ce032, 0x2bc4e055, 0xa64c1db7, 0x07751a0d, 0x8afde7ef, 0xc715e788, 0x4a9d1a6a, 0x5cc5e746, 0xd14d1aa4, 0x9ca51ac3, 0x112de721, 0x05a613f6, 0x882eee14, 0xc5c6ee73, 0x484e1391, 0x5e16eebd, 0xd39e135f, 0x9e761338, 0x13feeeda, 0xb2c7e960, 0x3f4f1482, 0x72a714e5, 0xff2fe907, 0xe977142b, 0x64ffe9c9, 0x2917e9ae, 0xa49f144c, 0xbb58c777, 0x36d03a95, 0x7b383af2, 0xf6b0c710, 0xe0e83a3c, 0x6d60c7de, 0x2088c7b9, 0xad003a5b, 0x0c393de1, 0x81b1c003, 0xcc59c064, 0x41d13d86, 0x5789c0aa, 0xda013d48, 0x97e93d2f, 0x1a61c0cd, 0x0eea341a, 0x8362c9f8, 0xce8ac99f, 0x4302347d, 0x555ac951, 0xd8d234b3, 0x953a34d4, 0x18b2c936, 0xb98bce8c, 0x3403336e, 0x79eb3309, 0xf463ceeb, 0xe23b33c7, 0x6fb3ce25, 0x225bce42, 0xafd333a0, 0x0b4c27ec, 0x86c4da0e, 0xcb2cda69, 0x46a4278b, 0x50fcdaa7, 0xdd742745, 0x909c2722, 0x1d14dac0, 0xbc2ddd7a, 0x31a52098, 0x7c4d20ff, 0xf1c5dd1d, 0xe79d2031, 0x6a15ddd3, 0x27fdddb4, 0xaa752056, 0xbefed481, 0x33762963, 0x7e9e2904, 0xf316d4e6, 0xe54e29ca, 0x68c6d428, 0x252ed44f, 0xa8a629ad, 0x099f2e17, 0x8417d3f5, 0xc9ffd392, 0x44772e70, 0x522fd35c, 0xdfa72ebe, 0x924f2ed9, 0x1fc7d33b, 0xadc088af, 0x2048754d, 0x6da0752a, 0xe02888c8, 0xf67075e4, 0x7bf88806, 0x36108861, 0xbb987583, 0x1aa17239, 0x97298fdb, 0xdac18fbc, 0x5749725e, 0x41118f72, 0xcc997290, 0x817172f7, 0x0cf98f15, 0x18727bc2, 0x95fa8620, 0xd8128647, 0x559a7ba5, 0x43c28689, 0xce4a7b6b, 0x83a27b0c, 0x0e2a86ee, 0xaf138154, 0x229b7cb6, 0x6f737cd1, 0xe2fb8133, 0xf4a37c1f, 0x792b81fd, 0x34c3819a, 0xb94b7c78, 0x1dd46834, 0x905c95d6, 0xddb495b1, 0x503c6853, 0x4664957f, 0xcbec689d, 0x860468fa, 0x0b8c9518, 0xaab592a2, 0x273d6f40, 0x6ad56f27, 0xe75d92c5, 0xf1056fe9, 0x7c8d920b, 0x3165926c, 0xbced6f8e, 0xa8669b59, 0x25ee66bb, 0x680666dc, 0xe58e9b3e, 0xf3d66612, 0x7e5e9bf0, 0x33b69b97, 0xbe3e6675, 0x1f0761cf, 0x928f9c2d, 0xdf679c4a, 0x52ef61a8, 0x44b79c84, 0xc93f6166, 0x84d76101, 0x095f9ce3, 0x16984fd8, 0x9b10b23a, 0xd6f8b25d, 0x5b704fbf, 0x4d28b293, 0xc0a04f71, 0x8d484f16, 0x00c0b2f4, 0xa1f9b54e, 0x2c7148ac, 0x619948cb, 0xec11b529, 0xfa494805, 0x77c1b5e7, 0x3a29b580, 0xb7a14862, 0xa32abcb5, 0x2ea24157, 0x634a4130, 0xeec2bcd2, 0xf89a41fe, 0x7512bc1c, 0x38fabc7b, 0xb5724199, 0x144b4623, 0x99c3bbc1, 0xd42bbba6, 0x59a34644, 0x4ffbbb68, 0xc273468a, 0x8f9b46ed, 0x0213bb0f, 0xa68caf43, 0x2b0452a1, 0x66ec52c6, 0xeb64af24, 0xfd3c5208, 0x70b4afea, 0x3d5caf8d, 0xb0d4526f, 0x11ed55d5, 0x9c65a837, 0xd18da850, 0x5c0555b2, 0x4a5da89e, 0xc7d5557c, 0x8a3d551b, 0x07b5a8f9, 0x133e5c2e, 0x9eb6a1cc, 0xd35ea1ab, 0x5ed65c49, 0x488ea165, 0xc5065c87, 0x88ee5ce0, 0x0566a102, 0xa45fa6b8, 0x29d75b5a, 0x643f5b3d, 0xe9b7a6df, 0xffef5bf3, 0x7267a611, 0x3f8fa676, 0xb2075b94}, {0x00000000, 0x80f0171f, 0xda91287f, 0x5a613f60, 0x6e5356bf, 0xeea341a0, 0xb4c27ec0, 0x343269df, 0xdca6ad7e, 0x5c56ba61, 0x06378501, 0x86c7921e, 0xb2f5fbc1, 0x3205ecde, 0x6864d3be, 0xe894c4a1, 0x623c5cbd, 0xe2cc4ba2, 0xb8ad74c2, 0x385d63dd, 0x0c6f0a02, 0x8c9f1d1d, 0xd6fe227d, 0x560e3562, 0xbe9af1c3, 0x3e6ae6dc, 0x640bd9bc, 0xe4fbcea3, 0xd0c9a77c, 0x5039b063, 0x0a588f03, 0x8aa8981c, 0xc478b97a, 0x4488ae65, 0x1ee99105, 0x9e19861a, 0xaa2befc5, 0x2adbf8da, 0x70bac7ba, 0xf04ad0a5, 0x18de1404, 0x982e031b, 0xc24f3c7b, 0x42bf2b64, 0x768d42bb, 0xf67d55a4, 0xac1c6ac4, 0x2cec7ddb, 0xa644e5c7, 0x26b4f2d8, 0x7cd5cdb8, 0xfc25daa7, 0xc817b378, 0x48e7a467, 0x12869b07, 0x92768c18, 0x7ae248b9, 0xfa125fa6, 0xa07360c6, 0x208377d9, 0x14b11e06, 0x94410919, 0xce203679, 0x4ed02166, 0x538074b5, 0xd37063aa, 0x89115cca, 0x09e14bd5, 0x3dd3220a, 0xbd233515, 0xe7420a75, 0x67b21d6a, 0x8f26d9cb, 0x0fd6ced4, 0x55b7f1b4, 0xd547e6ab, 0xe1758f74, 0x6185986b, 0x3be4a70b, 0xbb14b014, 0x31bc2808, 0xb14c3f17, 0xeb2d0077, 0x6bdd1768, 0x5fef7eb7, 0xdf1f69a8, 0x857e56c8, 0x058e41d7, 0xed1a8576, 0x6dea9269, 0x378bad09, 0xb77bba16, 0x8349d3c9, 0x03b9c4d6, 0x59d8fbb6, 0xd928eca9, 0x97f8cdcf, 0x1708dad0, 0x4d69e5b0, 0xcd99f2af, 0xf9ab9b70, 0x795b8c6f, 0x233ab30f, 0xa3caa410, 0x4b5e60b1, 0xcbae77ae, 0x91cf48ce, 0x113f5fd1, 0x250d360e, 0xa5fd2111, 0xff9c1e71, 0x7f6c096e, 0xf5c49172, 0x7534866d, 0x2f55b90d, 0xafa5ae12, 0x9b97c7cd, 0x1b67d0d2, 0x4106efb2, 0xc1f6f8ad, 0x29623c0c, 0xa9922b13, 0xf3f31473, 0x7303036c, 0x47316ab3, 0xc7c17dac, 0x9da042cc, 0x1d5055d3, 0xa700e96a, 0x27f0fe75, 0x7d91c115, 0xfd61d60a, 0xc953bfd5, 0x49a3a8ca, 0x13c297aa, 0x933280b5, 0x7ba64414, 0xfb56530b, 0xa1376c6b, 0x21c77b74, 0x15f512ab, 0x950505b4, 0xcf643ad4, 0x4f942dcb, 0xc53cb5d7, 0x45cca2c8, 0x1fad9da8, 0x9f5d8ab7, 0xab6fe368, 0x2b9ff477, 0x71fecb17, 0xf10edc08, 0x199a18a9, 0x996a0fb6, 0xc30b30d6, 0x43fb27c9, 0x77c94e16, 0xf7395909, 0xad586669, 0x2da87176, 0x63785010, 0xe388470f, 0xb9e9786f, 0x39196f70, 0x0d2b06af, 0x8ddb11b0, 0xd7ba2ed0, 0x574a39cf, 0xbfdefd6e, 0x3f2eea71, 0x654fd511, 0xe5bfc20e, 0xd18dabd1, 0x517dbcce, 0x0b1c83ae, 0x8bec94b1, 0x01440cad, 0x81b41bb2, 0xdbd524d2, 0x5b2533cd, 0x6f175a12, 0xefe74d0d, 0xb586726d, 0x35766572, 0xdde2a1d3, 0x5d12b6cc, 0x077389ac, 0x87839eb3, 0xb3b1f76c, 0x3341e073, 0x6920df13, 0xe9d0c80c, 0xf4809ddf, 0x74708ac0, 0x2e11b5a0, 0xaee1a2bf, 0x9ad3cb60, 0x1a23dc7f, 0x4042e31f, 0xc0b2f400, 0x282630a1, 0xa8d627be, 0xf2b718de, 0x72470fc1, 0x4675661e, 0xc6857101, 0x9ce44e61, 0x1c14597e, 0x96bcc162, 0x164cd67d, 0x4c2de91d, 0xccddfe02, 0xf8ef97dd, 0x781f80c2, 0x227ebfa2, 0xa28ea8bd, 0x4a1a6c1c, 0xcaea7b03, 0x908b4463, 0x107b537c, 0x24493aa3, 0xa4b92dbc, 0xfed812dc, 0x7e2805c3, 0x30f824a5, 0xb00833ba, 0xea690cda, 0x6a991bc5, 0x5eab721a, 0xde5b6505, 0x843a5a65, 0x04ca4d7a, 0xec5e89db, 0x6cae9ec4, 0x36cfa1a4, 0xb63fb6bb, 0x820ddf64, 0x02fdc87b, 0x589cf71b, 0xd86ce004, 0x52c47818, 0xd2346f07, 0x88555067, 0x08a54778, 0x3c972ea7, 0xbc6739b8, 0xe60606d8, 0x66f611c7, 0x8e62d566, 0x0e92c279, 0x54f3fd19, 0xd403ea06, 0xe03183d9, 0x60c194c6, 0x3aa0aba6, 0xba50bcb9}, {0x00000000, 0x9570d495, 0xf190af6b, 0x64e07bfe, 0x38505897, 0xad208c02, 0xc9c0f7fc, 0x5cb02369, 0x70a0b12e, 0xe5d065bb, 0x81301e45, 0x1440cad0, 0x48f0e9b9, 0xdd803d2c, 0xb96046d2, 0x2c109247, 0xe141625c, 0x7431b6c9, 0x10d1cd37, 0x85a119a2, 0xd9113acb, 0x4c61ee5e, 0x288195a0, 0xbdf14135, 0x91e1d372, 0x049107e7, 0x60717c19, 0xf501a88c, 0xa9b18be5, 0x3cc15f70, 0x5821248e, 0xcd51f01b, 0x19f3c2f9, 0x8c83166c, 0xe8636d92, 0x7d13b907, 0x21a39a6e, 0xb4d34efb, 0xd0333505, 0x4543e190, 0x695373d7, 0xfc23a742, 0x98c3dcbc, 0x0db30829, 0x51032b40, 0xc473ffd5, 0xa093842b, 0x35e350be, 0xf8b2a0a5, 0x6dc27430, 0x09220fce, 0x9c52db5b, 0xc0e2f832, 0x55922ca7, 0x31725759, 0xa40283cc, 0x8812118b, 0x1d62c51e, 0x7982bee0, 0xecf26a75, 0xb042491c, 0x25329d89, 0x41d2e677, 0xd4a232e2, 0x33e785f2, 0xa6975167, 0xc2772a99, 0x5707fe0c, 0x0bb7dd65, 0x9ec709f0, 0xfa27720e, 0x6f57a69b, 0x434734dc, 0xd637e049, 0xb2d79bb7, 0x27a74f22, 0x7b176c4b, 0xee67b8de, 0x8a87c320, 0x1ff717b5, 0xd2a6e7ae, 0x47d6333b, 0x233648c5, 0xb6469c50, 0xeaf6bf39, 0x7f866bac, 0x1b661052, 0x8e16c4c7, 0xa2065680, 0x37768215, 0x5396f9eb, 0xc6e62d7e, 0x9a560e17, 0x0f26da82, 0x6bc6a17c, 0xfeb675e9, 0x2a14470b, 0xbf64939e, 0xdb84e860, 0x4ef43cf5, 0x12441f9c, 0x8734cb09, 0xe3d4b0f7, 0x76a46462, 0x5ab4f625, 0xcfc422b0, 0xab24594e, 0x3e548ddb, 0x62e4aeb2, 0xf7947a27, 0x937401d9, 0x0604d54c, 0xcb552557, 0x5e25f1c2, 0x3ac58a3c, 0xafb55ea9, 0xf3057dc0, 0x6675a955, 0x0295d2ab, 0x97e5063e, 0xbbf59479, 0x2e8540ec, 0x4a653b12, 0xdf15ef87, 0x83a5ccee, 0x16d5187b, 0x72356385, 0xe745b710, 0x67cf0be4, 0xf2bfdf71, 0x965fa48f, 0x032f701a, 0x5f9f5373, 0xcaef87e6, 0xae0ffc18, 0x3b7f288d, 0x176fbaca, 0x821f6e5f, 0xe6ff15a1, 0x738fc134, 0x2f3fe25d, 0xba4f36c8, 0xdeaf4d36, 0x4bdf99a3, 0x868e69b8, 0x13febd2d, 0x771ec6d3, 0xe26e1246, 0xbede312f, 0x2baee5ba, 0x4f4e9e44, 0xda3e4ad1, 0xf62ed896, 0x635e0c03, 0x07be77fd, 0x92cea368, 0xce7e8001, 0x5b0e5494, 0x3fee2f6a, 0xaa9efbff, 0x7e3cc91d, 0xeb4c1d88, 0x8fac6676, 0x1adcb2e3, 0x466c918a, 0xd31c451f, 0xb7fc3ee1, 0x228cea74, 0x0e9c7833, 0x9becaca6, 0xff0cd758, 0x6a7c03cd, 0x36cc20a4, 0xa3bcf431, 0xc75c8fcf, 0x522c5b5a, 0x9f7dab41, 0x0a0d7fd4, 0x6eed042a, 0xfb9dd0bf, 0xa72df3d6, 0x325d2743, 0x56bd5cbd, 0xc3cd8828, 0xefdd1a6f, 0x7aadcefa, 0x1e4db504, 0x8b3d6191, 0xd78d42f8, 0x42fd966d, 0x261ded93, 0xb36d3906, 0x54288e16, 0xc1585a83, 0xa5b8217d, 0x30c8f5e8, 0x6c78d681, 0xf9080214, 0x9de879ea, 0x0898ad7f, 0x24883f38, 0xb1f8ebad, 0xd5189053, 0x406844c6, 0x1cd867af, 0x89a8b33a, 0xed48c8c4, 0x78381c51, 0xb569ec4a, 0x201938df, 0x44f94321, 0xd18997b4, 0x8d39b4dd, 0x18496048, 0x7ca91bb6, 0xe9d9cf23, 0xc5c95d64, 0x50b989f1, 0x3459f20f, 0xa129269a, 0xfd9905f3, 0x68e9d166, 0x0c09aa98, 0x99797e0d, 0x4ddb4cef, 0xd8ab987a, 0xbc4be384, 0x293b3711, 0x758b1478, 0xe0fbc0ed, 0x841bbb13, 0x116b6f86, 0x3d7bfdc1, 0xa80b2954, 0xcceb52aa, 0x599b863f, 0x052ba556, 0x905b71c3, 0xf4bb0a3d, 0x61cbdea8, 0xac9a2eb3, 0x39eafa26, 0x5d0a81d8, 0xc87a554d, 0x94ca7624, 0x01baa2b1, 0x655ad94f, 0xf02a0dda, 0xdc3a9f9d, 0x494a4b08, 0x2daa30f6, 0xb8dae463, 0xe46ac70a, 0x711a139f, 0x15fa6861, 0x808abcf4}, {0x00000000, 0xcf9e17c8, 0x444d29d1, 0x8bd33e19, 0x889a53a2, 0x4704446a, 0xccd77a73, 0x03496dbb, 0xca45a105, 0x05dbb6cd, 0x8e0888d4, 0x41969f1c, 0x42dff2a7, 0x8d41e56f, 0x0692db76, 0xc90cccbe, 0x4ffa444b, 0x80645383, 0x0bb76d9a, 0xc4297a52, 0xc76017e9, 0x08fe0021, 0x832d3e38, 0x4cb329f0, 0x85bfe54e, 0x4a21f286, 0xc1f2cc9f, 0x0e6cdb57, 0x0d25b6ec, 0xc2bba124, 0x49689f3d, 0x86f688f5, 0x9ff48896, 0x506a9f5e, 0xdbb9a147, 0x1427b68f, 0x176edb34, 0xd8f0ccfc, 0x5323f2e5, 0x9cbde52d, 0x55b12993, 0x9a2f3e5b, 0x11fc0042, 0xde62178a, 0xdd2b7a31, 0x12b56df9, 0x996653e0, 0x56f84428, 0xd00eccdd, 0x1f90db15, 0x9443e50c, 0x5bddf2c4, 0x58949f7f, 0x970a88b7, 0x1cd9b6ae, 0xd347a166, 0x1a4b6dd8, 0xd5d57a10, 0x5e064409, 0x919853c1, 0x92d13e7a, 0x5d4f29b2, 0xd69c17ab, 0x19020063, 0xe498176d, 0x2b0600a5, 0xa0d53ebc, 0x6f4b2974, 0x6c0244cf, 0xa39c5307, 0x284f6d1e, 0xe7d17ad6, 0x2eddb668, 0xe143a1a0, 0x6a909fb9, 0xa50e8871, 0xa647e5ca, 0x69d9f202, 0xe20acc1b, 0x2d94dbd3, 0xab625326, 0x64fc44ee, 0xef2f7af7, 0x20b16d3f, 0x23f80084, 0xec66174c, 0x67b52955, 0xa82b3e9d, 0x6127f223, 0xaeb9e5eb, 0x256adbf2, 0xeaf4cc3a, 0xe9bda181, 0x2623b649, 0xadf08850, 0x626e9f98, 0x7b6c9ffb, 0xb4f28833, 0x3f21b62a, 0xf0bfa1e2, 0xf3f6cc59, 0x3c68db91, 0xb7bbe588, 0x7825f240, 0xb1293efe, 0x7eb72936, 0xf564172f, 0x3afa00e7, 0x39b36d5c, 0xf62d7a94, 0x7dfe448d, 0xb2605345, 0x3496dbb0, 0xfb08cc78, 0x70dbf261, 0xbf45e5a9, 0xbc0c8812, 0x73929fda, 0xf841a1c3, 0x37dfb60b, 0xfed37ab5, 0x314d6d7d, 0xba9e5364, 0x750044ac, 0x76492917, 0xb9d73edf, 0x320400c6, 0xfd9a170e, 0x1241289b, 0xdddf3f53, 0x560c014a, 0x99921682, 0x9adb7b39, 0x55456cf1, 0xde9652e8, 0x11084520, 0xd804899e, 0x179a9e56, 0x9c49a04f, 0x53d7b787, 0x509eda3c, 0x9f00cdf4, 0x14d3f3ed, 0xdb4de425, 0x5dbb6cd0, 0x92257b18, 0x19f64501, 0xd66852c9, 0xd5213f72, 0x1abf28ba, 0x916c16a3, 0x5ef2016b, 0x97fecdd5, 0x5860da1d, 0xd3b3e404, 0x1c2df3cc, 0x1f649e77, 0xd0fa89bf, 0x5b29b7a6, 0x94b7a06e, 0x8db5a00d, 0x422bb7c5, 0xc9f889dc, 0x06669e14, 0x052ff3af, 0xcab1e467, 0x4162da7e, 0x8efccdb6, 0x47f00108, 0x886e16c0, 0x03bd28d9, 0xcc233f11, 0xcf6a52aa, 0x00f44562, 0x8b277b7b, 0x44b96cb3, 0xc24fe446, 0x0dd1f38e, 0x8602cd97, 0x499cda5f, 0x4ad5b7e4, 0x854ba02c, 0x0e989e35, 0xc10689fd, 0x080a4543, 0xc794528b, 0x4c476c92, 0x83d97b5a, 0x809016e1, 0x4f0e0129, 0xc4dd3f30, 0x0b4328f8, 0xf6d93ff6, 0x3947283e, 0xb2941627, 0x7d0a01ef, 0x7e436c54, 0xb1dd7b9c, 0x3a0e4585, 0xf590524d, 0x3c9c9ef3, 0xf302893b, 0x78d1b722, 0xb74fa0ea, 0xb406cd51, 0x7b98da99, 0xf04be480, 0x3fd5f348, 0xb9237bbd, 0x76bd6c75, 0xfd6e526c, 0x32f045a4, 0x31b9281f, 0xfe273fd7, 0x75f401ce, 0xba6a1606, 0x7366dab8, 0xbcf8cd70, 0x372bf369, 0xf8b5e4a1, 0xfbfc891a, 0x34629ed2, 0xbfb1a0cb, 0x702fb703, 0x692db760, 0xa6b3a0a8, 0x2d609eb1, 0xe2fe8979, 0xe1b7e4c2, 0x2e29f30a, 0xa5facd13, 0x6a64dadb, 0xa3681665, 0x6cf601ad, 0xe7253fb4, 0x28bb287c, 0x2bf245c7, 0xe46c520f, 0x6fbf6c16, 0xa0217bde, 0x26d7f32b, 0xe949e4e3, 0x629adafa, 0xad04cd32, 0xae4da089, 0x61d3b741, 0xea008958, 0x259e9e90, 0xec92522e, 0x230c45e6, 0xa8df7bff, 0x67416c37, 0x6408018c, 0xab961644, 0x2045285d, 0xefdb3f95}, {0x00000000, 0x24825136, 0x4904a26c, 0x6d86f35a, 0x920944d8, 0xb68b15ee, 0xdb0de6b4, 0xff8fb782, 0xff638ff1, 0xdbe1dec7, 0xb6672d9d, 0x92e57cab, 0x6d6acb29, 0x49e89a1f, 0x246e6945, 0x00ec3873, 0x25b619a3, 0x01344895, 0x6cb2bbcf, 0x4830eaf9, 0xb7bf5d7b, 0x933d0c4d, 0xfebbff17, 0xda39ae21, 0xdad59652, 0xfe57c764, 0x93d1343e, 0xb7536508, 0x48dcd28a, 0x6c5e83bc, 0x01d870e6, 0x255a21d0, 0x4b6c3346, 0x6fee6270, 0x0268912a, 0x26eac01c, 0xd965779e, 0xfde726a8, 0x9061d5f2, 0xb4e384c4, 0xb40fbcb7, 0x908ded81, 0xfd0b1edb, 0xd9894fed, 0x2606f86f, 0x0284a959, 0x6f025a03, 0x4b800b35, 0x6eda2ae5, 0x4a587bd3, 0x27de8889, 0x035cd9bf, 0xfcd36e3d, 0xd8513f0b, 0xb5d7cc51, 0x91559d67, 0x91b9a514, 0xb53bf422, 0xd8bd0778, 0xfc3f564e, 0x03b0e1cc, 0x2732b0fa, 0x4ab443a0, 0x6e361296, 0x96d8668c, 0xb25a37ba, 0xdfdcc4e0, 0xfb5e95d6, 0x04d12254, 0x20537362, 0x4dd58038, 0x6957d10e, 0x69bbe97d, 0x4d39b84b, 0x20bf4b11, 0x043d1a27, 0xfbb2ada5, 0xdf30fc93, 0xb2b60fc9, 0x96345eff, 0xb36e7f2f, 0x97ec2e19, 0xfa6add43, 0xdee88c75, 0x21673bf7, 0x05e56ac1, 0x6863999b, 0x4ce1c8ad, 0x4c0df0de, 0x688fa1e8, 0x050952b2, 0x218b0384, 0xde04b406, 0xfa86e530, 0x9700166a, 0xb382475c, 0xddb455ca, 0xf93604fc, 0x94b0f7a6, 0xb032a690, 0x4fbd1112, 0x6b3f4024, 0x06b9b37e, 0x223be248, 0x22d7da3b, 0x06558b0d, 0x6bd37857, 0x4f512961, 0xb0de9ee3, 0x945ccfd5, 0xf9da3c8f, 0xdd586db9, 0xf8024c69, 0xdc801d5f, 0xb106ee05, 0x9584bf33, 0x6a0b08b1, 0x4e895987, 0x230faadd, 0x078dfbeb, 0x0761c398, 0x23e392ae, 0x4e6561f4, 0x6ae730c2, 0x95688740, 0xb1ead676, 0xdc6c252c, 0xf8ee741a, 0xf6c1cb59, 0xd2439a6f, 0xbfc56935, 0x9b473803, 0x64c88f81, 0x404adeb7, 0x2dcc2ded, 0x094e7cdb, 0x09a244a8, 0x2d20159e, 0x40a6e6c4, 0x6424b7f2, 0x9bab0070, 0xbf295146, 0xd2afa21c, 0xf62df32a, 0xd377d2fa, 0xf7f583cc, 0x9a737096, 0xbef121a0, 0x417e9622, 0x65fcc714, 0x087a344e, 0x2cf86578, 0x2c145d0b, 0x08960c3d, 0x6510ff67, 0x4192ae51, 0xbe1d19d3, 0x9a9f48e5, 0xf719bbbf, 0xd39bea89, 0xbdadf81f, 0x992fa929, 0xf4a95a73, 0xd02b0b45, 0x2fa4bcc7, 0x0b26edf1, 0x66a01eab, 0x42224f9d, 0x42ce77ee, 0x664c26d8, 0x0bcad582, 0x2f4884b4, 0xd0c73336, 0xf4456200, 0x99c3915a, 0xbd41c06c, 0x981be1bc, 0xbc99b08a, 0xd11f43d0, 0xf59d12e6, 0x0a12a564, 0x2e90f452, 0x43160708, 0x6794563e, 0x67786e4d, 0x43fa3f7b, 0x2e7ccc21, 0x0afe9d17, 0xf5712a95, 0xd1f37ba3, 0xbc7588f9, 0x98f7d9cf, 0x6019add5, 0x449bfce3, 0x291d0fb9, 0x0d9f5e8f, 0xf210e90d, 0xd692b83b, 0xbb144b61, 0x9f961a57, 0x9f7a2224, 0xbbf87312, 0xd67e8048, 0xf2fcd17e, 0x0d7366fc, 0x29f137ca, 0x4477c490, 0x60f595a6, 0x45afb476, 0x612de540, 0x0cab161a, 0x2829472c, 0xd7a6f0ae, 0xf324a198, 0x9ea252c2, 0xba2003f4, 0xbacc3b87, 0x9e4e6ab1, 0xf3c899eb, 0xd74ac8dd, 0x28c57f5f, 0x0c472e69, 0x61c1dd33, 0x45438c05, 0x2b759e93, 0x0ff7cfa5, 0x62713cff, 0x46f36dc9, 0xb97cda4b, 0x9dfe8b7d, 0xf0787827, 0xd4fa2911, 0xd4161162, 0xf0944054, 0x9d12b30e, 0xb990e238, 0x461f55ba, 0x629d048c, 0x0f1bf7d6, 0x2b99a6e0, 0x0ec38730, 0x2a41d606, 0x47c7255c, 0x6345746a, 0x9ccac3e8, 0xb84892de, 0xd5ce6184, 0xf14c30b2, 0xf1a008c1, 0xd52259f7, 0xb8a4aaad, 0x9c26fb9b, 0x63a94c19, 0x472b1d2f, 0x2aadee75, 0x0e2fbf43}, {0x00000000, 0x36f290f3, 0x6de521e6, 0x5b17b115, 0xdbca43cc, 0xed38d33f, 0xb62f622a, 0x80ddf2d9, 0x6ce581d9, 0x5a17112a, 0x0100a03f, 0x37f230cc, 0xb72fc215, 0x81dd52e6, 0xdacae3f3, 0xec387300, 0xd9cb03b2, 0xef399341, 0xb42e2254, 0x82dcb2a7, 0x0201407e, 0x34f3d08d, 0x6fe46198, 0x5916f16b, 0xb52e826b, 0x83dc1298, 0xd8cba38d, 0xee39337e, 0x6ee4c1a7, 0x58165154, 0x0301e041, 0x35f370b2, 0x68e70125, 0x5e1591d6, 0x050220c3, 0x33f0b030, 0xb32d42e9, 0x85dfd21a, 0xdec8630f, 0xe83af3fc, 0x040280fc, 0x32f0100f, 0x69e7a11a, 0x5f1531e9, 0xdfc8c330, 0xe93a53c3, 0xb22de2d6, 0x84df7225, 0xb12c0297, 0x87de9264, 0xdcc92371, 0xea3bb382, 0x6ae6415b, 0x5c14d1a8, 0x070360bd, 0x31f1f04e, 0xddc9834e, 0xeb3b13bd, 0xb02ca2a8, 0x86de325b, 0x0603c082, 0x30f15071, 0x6be6e164, 0x5d147197, 0xd1ce024a, 0xe73c92b9, 0xbc2b23ac, 0x8ad9b35f, 0x0a044186, 0x3cf6d175, 0x67e16060, 0x5113f093, 0xbd2b8393, 0x8bd91360, 0xd0cea275, 0xe63c3286, 0x66e1c05f, 0x501350ac, 0x0b04e1b9, 0x3df6714a, 0x080501f8, 0x3ef7910b, 0x65e0201e, 0x5312b0ed, 0xd3cf4234, 0xe53dd2c7, 0xbe2a63d2, 0x88d8f321, 0x64e08021, 0x521210d2, 0x0905a1c7, 0x3ff73134, 0xbf2ac3ed, 0x89d8531e, 0xd2cfe20b, 0xe43d72f8, 0xb929036f, 0x8fdb939c, 0xd4cc2289, 0xe23eb27a, 0x62e340a3, 0x5411d050, 0x0f066145, 0x39f4f1b6, 0xd5cc82b6, 0xe33e1245, 0xb829a350, 0x8edb33a3, 0x0e06c17a, 0x38f45189, 0x63e3e09c, 0x5511706f, 0x60e200dd, 0x5610902e, 0x0d07213b, 0x3bf5b1c8, 0xbb284311, 0x8ddad3e2, 0xd6cd62f7, 0xe03ff204, 0x0c078104, 0x3af511f7, 0x61e2a0e2, 0x57103011, 0xd7cdc2c8, 0xe13f523b, 0xba28e32e, 0x8cda73dd, 0x78ed02d5, 0x4e1f9226, 0x15082333, 0x23fab3c0, 0xa3274119, 0x95d5d1ea, 0xcec260ff, 0xf830f00c, 0x1408830c, 0x22fa13ff, 0x79eda2ea, 0x4f1f3219, 0xcfc2c0c0, 0xf9305033, 0xa227e126, 0x94d571d5, 0xa1260167, 0x97d49194, 0xccc32081, 0xfa31b072, 0x7aec42ab, 0x4c1ed258, 0x1709634d, 0x21fbf3be, 0xcdc380be, 0xfb31104d, 0xa026a158, 0x96d431ab, 0x1609c372, 0x20fb5381, 0x7bece294, 0x4d1e7267, 0x100a03f0, 0x26f89303, 0x7def2216, 0x4b1db2e5, 0xcbc0403c, 0xfd32d0cf, 0xa62561da, 0x90d7f129, 0x7cef8229, 0x4a1d12da, 0x110aa3cf, 0x27f8333c, 0xa725c1e5, 0x91d75116, 0xcac0e003, 0xfc3270f0, 0xc9c10042, 0xff3390b1, 0xa42421a4, 0x92d6b157, 0x120b438e, 0x24f9d37d, 0x7fee6268, 0x491cf29b, 0xa524819b, 0x93d61168, 0xc8c1a07d, 0xfe33308e, 0x7eeec257, 0x481c52a4, 0x130be3b1, 0x25f97342, 0xa923009f, 0x9fd1906c, 0xc4c62179, 0xf234b18a, 0x72e94353, 0x441bd3a0, 0x1f0c62b5, 0x29fef246, 0xc5c68146, 0xf33411b5, 0xa823a0a0, 0x9ed13053, 0x1e0cc28a, 0x28fe5279, 0x73e9e36c, 0x451b739f, 0x70e8032d, 0x461a93de, 0x1d0d22cb, 0x2bffb238, 0xab2240e1, 0x9dd0d012, 0xc6c76107, 0xf035f1f4, 0x1c0d82f4, 0x2aff1207, 0x71e8a312, 0x471a33e1, 0xc7c7c138, 0xf13551cb, 0xaa22e0de, 0x9cd0702d, 0xc1c401ba, 0xf7369149, 0xac21205c, 0x9ad3b0af, 0x1a0e4276, 0x2cfcd285, 0x77eb6390, 0x4119f363, 0xad218063, 0x9bd31090, 0xc0c4a185, 0xf6363176, 0x76ebc3af, 0x4019535c, 0x1b0ee249, 0x2dfc72ba, 0x180f0208, 0x2efd92fb, 0x75ea23ee, 0x4318b31d, 0xc3c541c4, 0xf537d137, 0xae206022, 0x98d2f0d1, 0x74ea83d1, 0x42181322, 0x190fa237, 0x2ffd32c4, 0xaf20c01d, 0x99d250ee, 0xc2c5e1fb, 0xf4377108}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x0000000000000000, 0xf390f23600000000, 0xe621e56d00000000, 0x15b1175b00000000, 0xcc43cadb00000000, 0x3fd338ed00000000, 0x2a622fb600000000, 0xd9f2dd8000000000, 0xd981e56c00000000, 0x2a11175a00000000, 0x3fa0000100000000, 0xcc30f23700000000, 0x15c22fb700000000, 0xe652dd8100000000, 0xf3e3cada00000000, 0x007338ec00000000, 0xb203cbd900000000, 0x419339ef00000000, 0x54222eb400000000, 0xa7b2dc8200000000, 0x7e40010200000000, 0x8dd0f33400000000, 0x9861e46f00000000, 0x6bf1165900000000, 0x6b822eb500000000, 0x9812dc8300000000, 0x8da3cbd800000000, 0x7e3339ee00000000, 0xa7c1e46e00000000, 0x5451165800000000, 0x41e0010300000000, 0xb270f33500000000, 0x2501e76800000000, 0xd691155e00000000, 0xc320020500000000, 0x30b0f03300000000, 0xe9422db300000000, 0x1ad2df8500000000, 0x0f63c8de00000000, 0xfcf33ae800000000, 0xfc80020400000000, 0x0f10f03200000000, 0x1aa1e76900000000, 0xe931155f00000000, 0x30c3c8df00000000, 0xc3533ae900000000, 0xd6e22db200000000, 0x2572df8400000000, 0x97022cb100000000, 0x6492de8700000000, 0x7123c9dc00000000, 0x82b33bea00000000, 0x5b41e66a00000000, 0xa8d1145c00000000, 0xbd60030700000000, 0x4ef0f13100000000, 0x4e83c9dd00000000, 0xbd133beb00000000, 0xa8a22cb000000000, 0x5b32de8600000000, 0x82c0030600000000, 0x7150f13000000000, 0x64e1e66b00000000, 0x9771145d00000000, 0x4a02ced100000000, 0xb9923ce700000000, 0xac232bbc00000000, 0x5fb3d98a00000000, 0x8641040a00000000, 0x75d1f63c00000000, 0x6060e16700000000, 0x93f0135100000000, 0x93832bbd00000000, 0x6013d98b00000000, 0x75a2ced000000000, 0x86323ce600000000, 0x5fc0e16600000000, 0xac50135000000000, 0xb9e1040b00000000, 0x4a71f63d00000000, 0xf801050800000000, 0x0b91f73e00000000, 0x1e20e06500000000, 0xedb0125300000000, 0x3442cfd300000000, 0xc7d23de500000000, 0xd2632abe00000000, 0x21f3d88800000000, 0x2180e06400000000, 0xd210125200000000, 0xc7a1050900000000, 0x3431f73f00000000, 0xedc32abf00000000, 0x1e53d88900000000, 0x0be2cfd200000000, 0xf8723de400000000, 0x6f0329b900000000, 0x9c93db8f00000000, 0x8922ccd400000000, 0x7ab23ee200000000, 0xa340e36200000000, 0x50d0115400000000, 0x4561060f00000000, 0xb6f1f43900000000, 0xb682ccd500000000, 0x45123ee300000000, 0x50a329b800000000, 0xa333db8e00000000, 0x7ac1060e00000000, 0x8951f43800000000, 0x9ce0e36300000000, 0x6f70115500000000, 0xdd00e26000000000, 0x2e90105600000000, 0x3b21070d00000000, 0xc8b1f53b00000000, 0x114328bb00000000, 0xe2d3da8d00000000, 0xf762cdd600000000, 0x04f23fe000000000, 0x0481070c00000000, 0xf711f53a00000000, 0xe2a0e26100000000, 0x1130105700000000, 0xc8c2cdd700000000, 0x3b523fe100000000, 0x2ee328ba00000000, 0xdd73da8c00000000, 0xd502ed7800000000, 0x26921f4e00000000, 0x3323081500000000, 0xc0b3fa2300000000, 0x194127a300000000, 0xead1d59500000000, 0xff60c2ce00000000, 0x0cf030f800000000, 0x0c83081400000000, 0xff13fa2200000000, 0xeaa2ed7900000000, 0x19321f4f00000000, 0xc0c0c2cf00000000, 0x335030f900000000, 0x26e127a200000000, 0xd571d59400000000, 0x670126a100000000, 0x9491d49700000000, 0x8120c3cc00000000, 0x72b031fa00000000, 0xab42ec7a00000000, 0x58d21e4c00000000, 0x4d63091700000000, 0xbef3fb2100000000, 0xbe80c3cd00000000, 0x4d1031fb00000000, 0x58a126a000000000, 0xab31d49600000000, 0x72c3091600000000, 0x8153fb2000000000, 0x94e2ec7b00000000, 0x67721e4d00000000, 0xf0030a1000000000, 0x0393f82600000000, 0x1622ef7d00000000, 0xe5b21d4b00000000, 0x3c40c0cb00000000, 0xcfd032fd00000000, 0xda6125a600000000, 0x29f1d79000000000, 0x2982ef7c00000000, 0xda121d4a00000000, 0xcfa30a1100000000, 0x3c33f82700000000, 0xe5c125a700000000, 0x1651d79100000000, 0x03e0c0ca00000000, 0xf07032fc00000000, 0x4200c1c900000000, 0xb19033ff00000000, 0xa42124a400000000, 0x57b1d69200000000, 0x8e430b1200000000, 0x7dd3f92400000000, 0x6862ee7f00000000, 0x9bf21c4900000000, 0x9b8124a500000000, 0x6811d69300000000, 0x7da0c1c800000000, 0x8e3033fe00000000, 0x57c2ee7e00000000, 0xa4521c4800000000, 0xb1e30b1300000000, 0x4273f92500000000, 0x9f0023a900000000, 0x6c90d19f00000000, 0x7921c6c400000000, 0x8ab134f200000000, 0x5343e97200000000, 0xa0d31b4400000000, 0xb5620c1f00000000, 0x46f2fe2900000000, 0x4681c6c500000000, 0xb51134f300000000, 0xa0a023a800000000, 0x5330d19e00000000, 0x8ac20c1e00000000, 0x7952fe2800000000, 0x6ce3e97300000000, 0x9f731b4500000000, 0x2d03e87000000000, 0xde931a4600000000, 0xcb220d1d00000000, 0x38b2ff2b00000000, 0xe14022ab00000000, 0x12d0d09d00000000, 0x0761c7c600000000, 0xf4f135f000000000, 0xf4820d1c00000000, 0x0712ff2a00000000, 0x12a3e87100000000, 0xe1331a4700000000, 0x38c1c7c700000000, 0xcb5135f100000000, 0xdee022aa00000000, 0x2d70d09c00000000, 0xba01c4c100000000, 0x499136f700000000, 0x5c2021ac00000000, 0xafb0d39a00000000, 0x76420e1a00000000, 0x85d2fc2c00000000, 0x9063eb7700000000, 0x63f3194100000000, 0x638021ad00000000, 0x9010d39b00000000, 0x85a1c4c000000000, 0x763136f600000000, 0xafc3eb7600000000, 0x5c53194000000000, 0x49e20e1b00000000, 0xba72fc2d00000000, 0x08020f1800000000, 0xfb92fd2e00000000, 0xee23ea7500000000, 0x1db3184300000000, 0xc441c5c300000000, 0x37d137f500000000, 0x226020ae00000000, 0xd1f0d29800000000, 0xd183ea7400000000, 0x2213184200000000, 0x37a20f1900000000, 0xc432fd2f00000000, 0x1dc020af00000000, 0xee50d29900000000, 0xfbe1c5c200000000, 0x087137f400000000}, {0x0000000000000000, 0x3651822400000000, 0x6ca2044900000000, 0x5af3866d00000000, 0xd844099200000000, 0xee158bb600000000, 0xb4e60ddb00000000, 0x82b78fff00000000, 0xf18f63ff00000000, 0xc7dee1db00000000, 0x9d2d67b600000000, 0xab7ce59200000000, 0x29cb6a6d00000000, 0x1f9ae84900000000, 0x45696e2400000000, 0x7338ec0000000000, 0xa319b62500000000, 0x9548340100000000, 0xcfbbb26c00000000, 0xf9ea304800000000, 0x7b5dbfb700000000, 0x4d0c3d9300000000, 0x17ffbbfe00000000, 0x21ae39da00000000, 0x5296d5da00000000, 0x64c757fe00000000, 0x3e34d19300000000, 0x086553b700000000, 0x8ad2dc4800000000, 0xbc835e6c00000000, 0xe670d80100000000, 0xd0215a2500000000, 0x46336c4b00000000, 0x7062ee6f00000000, 0x2a91680200000000, 0x1cc0ea2600000000, 0x9e7765d900000000, 0xa826e7fd00000000, 0xf2d5619000000000, 0xc484e3b400000000, 0xb7bc0fb400000000, 0x81ed8d9000000000, 0xdb1e0bfd00000000, 0xed4f89d900000000, 0x6ff8062600000000, 0x59a9840200000000, 0x035a026f00000000, 0x350b804b00000000, 0xe52ada6e00000000, 0xd37b584a00000000, 0x8988de2700000000, 0xbfd95c0300000000, 0x3d6ed3fc00000000, 0x0b3f51d800000000, 0x51ccd7b500000000, 0x679d559100000000, 0x14a5b99100000000, 0x22f43bb500000000, 0x7807bdd800000000, 0x4e563ffc00000000, 0xcce1b00300000000, 0xfab0322700000000, 0xa043b44a00000000, 0x9612366e00000000, 0x8c66d89600000000, 0xba375ab200000000, 0xe0c4dcdf00000000, 0xd6955efb00000000, 0x5422d10400000000, 0x6273532000000000, 0x3880d54d00000000, 0x0ed1576900000000, 0x7de9bb6900000000, 0x4bb8394d00000000, 0x114bbf2000000000, 0x271a3d0400000000, 0xa5adb2fb00000000, 0x93fc30df00000000, 0xc90fb6b200000000, 0xff5e349600000000, 0x2f7f6eb300000000, 0x192eec9700000000, 0x43dd6afa00000000, 0x758ce8de00000000, 0xf73b672100000000, 0xc16ae50500000000, 0x9b99636800000000, 0xadc8e14c00000000, 0xdef00d4c00000000, 0xe8a18f6800000000, 0xb252090500000000, 0x84038b2100000000, 0x06b404de00000000, 0x30e586fa00000000, 0x6a16009700000000, 0x5c4782b300000000, 0xca55b4dd00000000, 0xfc0436f900000000, 0xa6f7b09400000000, 0x90a632b000000000, 0x1211bd4f00000000, 0x24403f6b00000000, 0x7eb3b90600000000, 0x48e23b2200000000, 0x3bdad72200000000, 0x0d8b550600000000, 0x5778d36b00000000, 0x6129514f00000000, 0xe39edeb000000000, 0xd5cf5c9400000000, 0x8f3cdaf900000000, 0xb96d58dd00000000, 0x694c02f800000000, 0x5f1d80dc00000000, 0x05ee06b100000000, 0x33bf849500000000, 0xb1080b6a00000000, 0x8759894e00000000, 0xddaa0f2300000000, 0xebfb8d0700000000, 0x98c3610700000000, 0xae92e32300000000, 0xf461654e00000000, 0xc230e76a00000000, 0x4087689500000000, 0x76d6eab100000000, 0x2c256cdc00000000, 0x1a74eef800000000, 0x59cbc1f600000000, 0x6f9a43d200000000, 0x3569c5bf00000000, 0x0338479b00000000, 0x818fc86400000000, 0xb7de4a4000000000, 0xed2dcc2d00000000, 0xdb7c4e0900000000, 0xa844a20900000000, 0x9e15202d00000000, 0xc4e6a64000000000, 0xf2b7246400000000, 0x7000ab9b00000000, 0x465129bf00000000, 0x1ca2afd200000000, 0x2af32df600000000, 0xfad277d300000000, 0xcc83f5f700000000, 0x9670739a00000000, 0xa021f1be00000000, 0x22967e4100000000, 0x14c7fc6500000000, 0x4e347a0800000000, 0x7865f82c00000000, 0x0b5d142c00000000, 0x3d0c960800000000, 0x67ff106500000000, 0x51ae924100000000, 0xd3191dbe00000000, 0xe5489f9a00000000, 0xbfbb19f700000000, 0x89ea9bd300000000, 0x1ff8adbd00000000, 0x29a92f9900000000, 0x735aa9f400000000, 0x450b2bd000000000, 0xc7bca42f00000000, 0xf1ed260b00000000, 0xab1ea06600000000, 0x9d4f224200000000, 0xee77ce4200000000, 0xd8264c6600000000, 0x82d5ca0b00000000, 0xb484482f00000000, 0x3633c7d000000000, 0x006245f400000000, 0x5a91c39900000000, 0x6cc041bd00000000, 0xbce11b9800000000, 0x8ab099bc00000000, 0xd0431fd100000000, 0xe6129df500000000, 0x64a5120a00000000, 0x52f4902e00000000, 0x0807164300000000, 0x3e56946700000000, 0x4d6e786700000000, 0x7b3ffa4300000000, 0x21cc7c2e00000000, 0x179dfe0a00000000, 0x952a71f500000000, 0xa37bf3d100000000, 0xf98875bc00000000, 0xcfd9f79800000000, 0xd5ad196000000000, 0xe3fc9b4400000000, 0xb90f1d2900000000, 0x8f5e9f0d00000000, 0x0de910f200000000, 0x3bb892d600000000, 0x614b14bb00000000, 0x571a969f00000000, 0x24227a9f00000000, 0x1273f8bb00000000, 0x48807ed600000000, 0x7ed1fcf200000000, 0xfc66730d00000000, 0xca37f12900000000, 0x90c4774400000000, 0xa695f56000000000, 0x76b4af4500000000, 0x40e52d6100000000, 0x1a16ab0c00000000, 0x2c47292800000000, 0xaef0a6d700000000, 0x98a124f300000000, 0xc252a29e00000000, 0xf40320ba00000000, 0x873bccba00000000, 0xb16a4e9e00000000, 0xeb99c8f300000000, 0xddc84ad700000000, 0x5f7fc52800000000, 0x692e470c00000000, 0x33ddc16100000000, 0x058c434500000000, 0x939e752b00000000, 0xa5cff70f00000000, 0xff3c716200000000, 0xc96df34600000000, 0x4bda7cb900000000, 0x7d8bfe9d00000000, 0x277878f000000000, 0x1129fad400000000, 0x621116d400000000, 0x544094f000000000, 0x0eb3129d00000000, 0x38e290b900000000, 0xba551f4600000000, 0x8c049d6200000000, 0xd6f71b0f00000000, 0xe0a6992b00000000, 0x3087c30e00000000, 0x06d6412a00000000, 0x5c25c74700000000, 0x6a74456300000000, 0xe8c3ca9c00000000, 0xde9248b800000000, 0x8461ced500000000, 0xb2304cf100000000, 0xc108a0f100000000, 0xf75922d500000000, 0xadaaa4b800000000, 0x9bfb269c00000000, 0x194ca96300000000, 0x2f1d2b4700000000, 0x75eead2a00000000, 0x43bf2f0e00000000}, {0x0000000000000000, 0xc8179ecf00000000, 0xd1294d4400000000, 0x193ed38b00000000, 0xa2539a8800000000, 0x6a44044700000000, 0x737ad7cc00000000, 0xbb6d490300000000, 0x05a145ca00000000, 0xcdb6db0500000000, 0xd488088e00000000, 0x1c9f964100000000, 0xa7f2df4200000000, 0x6fe5418d00000000, 0x76db920600000000, 0xbecc0cc900000000, 0x4b44fa4f00000000, 0x8353648000000000, 0x9a6db70b00000000, 0x527a29c400000000, 0xe91760c700000000, 0x2100fe0800000000, 0x383e2d8300000000, 0xf029b34c00000000, 0x4ee5bf8500000000, 0x86f2214a00000000, 0x9fccf2c100000000, 0x57db6c0e00000000, 0xecb6250d00000000, 0x24a1bbc200000000, 0x3d9f684900000000, 0xf588f68600000000, 0x9688f49f00000000, 0x5e9f6a5000000000, 0x47a1b9db00000000, 0x8fb6271400000000, 0x34db6e1700000000, 0xfcccf0d800000000, 0xe5f2235300000000, 0x2de5bd9c00000000, 0x9329b15500000000, 0x5b3e2f9a00000000, 0x4200fc1100000000, 0x8a1762de00000000, 0x317a2bdd00000000, 0xf96db51200000000, 0xe053669900000000, 0x2844f85600000000, 0xddcc0ed000000000, 0x15db901f00000000, 0x0ce5439400000000, 0xc4f2dd5b00000000, 0x7f9f945800000000, 0xb7880a9700000000, 0xaeb6d91c00000000, 0x66a147d300000000, 0xd86d4b1a00000000, 0x107ad5d500000000, 0x0944065e00000000, 0xc153989100000000, 0x7a3ed19200000000, 0xb2294f5d00000000, 0xab179cd600000000, 0x6300021900000000, 0x6d1798e400000000, 0xa500062b00000000, 0xbc3ed5a000000000, 0x74294b6f00000000, 0xcf44026c00000000, 0x07539ca300000000, 0x1e6d4f2800000000, 0xd67ad1e700000000, 0x68b6dd2e00000000, 0xa0a143e100000000, 0xb99f906a00000000, 0x71880ea500000000, 0xcae547a600000000, 0x02f2d96900000000, 0x1bcc0ae200000000, 0xd3db942d00000000, 0x265362ab00000000, 0xee44fc6400000000, 0xf77a2fef00000000, 0x3f6db12000000000, 0x8400f82300000000, 0x4c1766ec00000000, 0x5529b56700000000, 0x9d3e2ba800000000, 0x23f2276100000000, 0xebe5b9ae00000000, 0xf2db6a2500000000, 0x3accf4ea00000000, 0x81a1bde900000000, 0x49b6232600000000, 0x5088f0ad00000000, 0x989f6e6200000000, 0xfb9f6c7b00000000, 0x3388f2b400000000, 0x2ab6213f00000000, 0xe2a1bff000000000, 0x59ccf6f300000000, 0x91db683c00000000, 0x88e5bbb700000000, 0x40f2257800000000, 0xfe3e29b100000000, 0x3629b77e00000000, 0x2f1764f500000000, 0xe700fa3a00000000, 0x5c6db33900000000, 0x947a2df600000000, 0x8d44fe7d00000000, 0x455360b200000000, 0xb0db963400000000, 0x78cc08fb00000000, 0x61f2db7000000000, 0xa9e545bf00000000, 0x12880cbc00000000, 0xda9f927300000000, 0xc3a141f800000000, 0x0bb6df3700000000, 0xb57ad3fe00000000, 0x7d6d4d3100000000, 0x64539eba00000000, 0xac44007500000000, 0x1729497600000000, 0xdf3ed7b900000000, 0xc600043200000000, 0x0e179afd00000000, 0x9b28411200000000, 0x533fdfdd00000000, 0x4a010c5600000000, 0x8216929900000000, 0x397bdb9a00000000, 0xf16c455500000000, 0xe85296de00000000, 0x2045081100000000, 0x9e8904d800000000, 0x569e9a1700000000, 0x4fa0499c00000000, 0x87b7d75300000000, 0x3cda9e5000000000, 0xf4cd009f00000000, 0xedf3d31400000000, 0x25e44ddb00000000, 0xd06cbb5d00000000, 0x187b259200000000, 0x0145f61900000000, 0xc95268d600000000, 0x723f21d500000000, 0xba28bf1a00000000, 0xa3166c9100000000, 0x6b01f25e00000000, 0xd5cdfe9700000000, 0x1dda605800000000, 0x04e4b3d300000000, 0xccf32d1c00000000, 0x779e641f00000000, 0xbf89fad000000000, 0xa6b7295b00000000, 0x6ea0b79400000000, 0x0da0b58d00000000, 0xc5b72b4200000000, 0xdc89f8c900000000, 0x149e660600000000, 0xaff32f0500000000, 0x67e4b1ca00000000, 0x7eda624100000000, 0xb6cdfc8e00000000, 0x0801f04700000000, 0xc0166e8800000000, 0xd928bd0300000000, 0x113f23cc00000000, 0xaa526acf00000000, 0x6245f40000000000, 0x7b7b278b00000000, 0xb36cb94400000000, 0x46e44fc200000000, 0x8ef3d10d00000000, 0x97cd028600000000, 0x5fda9c4900000000, 0xe4b7d54a00000000, 0x2ca04b8500000000, 0x359e980e00000000, 0xfd8906c100000000, 0x43450a0800000000, 0x8b5294c700000000, 0x926c474c00000000, 0x5a7bd98300000000, 0xe116908000000000, 0x29010e4f00000000, 0x303fddc400000000, 0xf828430b00000000, 0xf63fd9f600000000, 0x3e28473900000000, 0x271694b200000000, 0xef010a7d00000000, 0x546c437e00000000, 0x9c7bddb100000000, 0x85450e3a00000000, 0x4d5290f500000000, 0xf39e9c3c00000000, 0x3b8902f300000000, 0x22b7d17800000000, 0xeaa04fb700000000, 0x51cd06b400000000, 0x99da987b00000000, 0x80e44bf000000000, 0x48f3d53f00000000, 0xbd7b23b900000000, 0x756cbd7600000000, 0x6c526efd00000000, 0xa445f03200000000, 0x1f28b93100000000, 0xd73f27fe00000000, 0xce01f47500000000, 0x06166aba00000000, 0xb8da667300000000, 0x70cdf8bc00000000, 0x69f32b3700000000, 0xa1e4b5f800000000, 0x1a89fcfb00000000, 0xd29e623400000000, 0xcba0b1bf00000000, 0x03b72f7000000000, 0x60b72d6900000000, 0xa8a0b3a600000000, 0xb19e602d00000000, 0x7989fee200000000, 0xc2e4b7e100000000, 0x0af3292e00000000, 0x13cdfaa500000000, 0xdbda646a00000000, 0x651668a300000000, 0xad01f66c00000000, 0xb43f25e700000000, 0x7c28bb2800000000, 0xc745f22b00000000, 0x0f526ce400000000, 0x166cbf6f00000000, 0xde7b21a000000000, 0x2bf3d72600000000, 0xe3e449e900000000, 0xfada9a6200000000, 0x32cd04ad00000000, 0x89a04dae00000000, 0x41b7d36100000000, 0x588900ea00000000, 0x909e9e2500000000, 0x2e5292ec00000000, 0xe6450c2300000000, 0xff7bdfa800000000, 0x376c416700000000, 0x8c01086400000000, 0x441696ab00000000, 0x5d28452000000000, 0x953fdbef00000000}, {0x0000000000000000, 0x95d4709500000000, 0x6baf90f100000000, 0xfe7be06400000000, 0x9758503800000000, 0x028c20ad00000000, 0xfcf7c0c900000000, 0x6923b05c00000000, 0x2eb1a07000000000, 0xbb65d0e500000000, 0x451e308100000000, 0xd0ca401400000000, 0xb9e9f04800000000, 0x2c3d80dd00000000, 0xd24660b900000000, 0x4792102c00000000, 0x5c6241e100000000, 0xc9b6317400000000, 0x37cdd11000000000, 0xa219a18500000000, 0xcb3a11d900000000, 0x5eee614c00000000, 0xa095812800000000, 0x3541f1bd00000000, 0x72d3e19100000000, 0xe707910400000000, 0x197c716000000000, 0x8ca801f500000000, 0xe58bb1a900000000, 0x705fc13c00000000, 0x8e24215800000000, 0x1bf051cd00000000, 0xf9c2f31900000000, 0x6c16838c00000000, 0x926d63e800000000, 0x07b9137d00000000, 0x6e9aa32100000000, 0xfb4ed3b400000000, 0x053533d000000000, 0x90e1434500000000, 0xd773536900000000, 0x42a723fc00000000, 0xbcdcc39800000000, 0x2908b30d00000000, 0x402b035100000000, 0xd5ff73c400000000, 0x2b8493a000000000, 0xbe50e33500000000, 0xa5a0b2f800000000, 0x3074c26d00000000, 0xce0f220900000000, 0x5bdb529c00000000, 0x32f8e2c000000000, 0xa72c925500000000, 0x5957723100000000, 0xcc8302a400000000, 0x8b11128800000000, 0x1ec5621d00000000, 0xe0be827900000000, 0x756af2ec00000000, 0x1c4942b000000000, 0x899d322500000000, 0x77e6d24100000000, 0xe232a2d400000000, 0xf285e73300000000, 0x675197a600000000, 0x992a77c200000000, 0x0cfe075700000000, 0x65ddb70b00000000, 0xf009c79e00000000, 0x0e7227fa00000000, 0x9ba6576f00000000, 0xdc34474300000000, 0x49e037d600000000, 0xb79bd7b200000000, 0x224fa72700000000, 0x4b6c177b00000000, 0xdeb867ee00000000, 0x20c3878a00000000, 0xb517f71f00000000, 0xaee7a6d200000000, 0x3b33d64700000000, 0xc548362300000000, 0x509c46b600000000, 0x39bff6ea00000000, 0xac6b867f00000000, 0x5210661b00000000, 0xc7c4168e00000000, 0x805606a200000000, 0x1582763700000000, 0xebf9965300000000, 0x7e2de6c600000000, 0x170e569a00000000, 0x82da260f00000000, 0x7ca1c66b00000000, 0xe975b6fe00000000, 0x0b47142a00000000, 0x9e9364bf00000000, 0x60e884db00000000, 0xf53cf44e00000000, 0x9c1f441200000000, 0x09cb348700000000, 0xf7b0d4e300000000, 0x6264a47600000000, 0x25f6b45a00000000, 0xb022c4cf00000000, 0x4e5924ab00000000, 0xdb8d543e00000000, 0xb2aee46200000000, 0x277a94f700000000, 0xd901749300000000, 0x4cd5040600000000, 0x572555cb00000000, 0xc2f1255e00000000, 0x3c8ac53a00000000, 0xa95eb5af00000000, 0xc07d05f300000000, 0x55a9756600000000, 0xabd2950200000000, 0x3e06e59700000000, 0x7994f5bb00000000, 0xec40852e00000000, 0x123b654a00000000, 0x87ef15df00000000, 0xeecca58300000000, 0x7b18d51600000000, 0x8563357200000000, 0x10b745e700000000, 0xe40bcf6700000000, 0x71dfbff200000000, 0x8fa45f9600000000, 0x1a702f0300000000, 0x73539f5f00000000, 0xe687efca00000000, 0x18fc0fae00000000, 0x8d287f3b00000000, 0xcaba6f1700000000, 0x5f6e1f8200000000, 0xa115ffe600000000, 0x34c18f7300000000, 0x5de23f2f00000000, 0xc8364fba00000000, 0x364dafde00000000, 0xa399df4b00000000, 0xb8698e8600000000, 0x2dbdfe1300000000, 0xd3c61e7700000000, 0x46126ee200000000, 0x2f31debe00000000, 0xbae5ae2b00000000, 0x449e4e4f00000000, 0xd14a3eda00000000, 0x96d82ef600000000, 0x030c5e6300000000, 0xfd77be0700000000, 0x68a3ce9200000000, 0x01807ece00000000, 0x94540e5b00000000, 0x6a2fee3f00000000, 0xfffb9eaa00000000, 0x1dc93c7e00000000, 0x881d4ceb00000000, 0x7666ac8f00000000, 0xe3b2dc1a00000000, 0x8a916c4600000000, 0x1f451cd300000000, 0xe13efcb700000000, 0x74ea8c2200000000, 0x33789c0e00000000, 0xa6acec9b00000000, 0x58d70cff00000000, 0xcd037c6a00000000, 0xa420cc3600000000, 0x31f4bca300000000, 0xcf8f5cc700000000, 0x5a5b2c5200000000, 0x41ab7d9f00000000, 0xd47f0d0a00000000, 0x2a04ed6e00000000, 0xbfd09dfb00000000, 0xd6f32da700000000, 0x43275d3200000000, 0xbd5cbd5600000000, 0x2888cdc300000000, 0x6f1addef00000000, 0xfacead7a00000000, 0x04b54d1e00000000, 0x91613d8b00000000, 0xf8428dd700000000, 0x6d96fd4200000000, 0x93ed1d2600000000, 0x06396db300000000, 0x168e285400000000, 0x835a58c100000000, 0x7d21b8a500000000, 0xe8f5c83000000000, 0x81d6786c00000000, 0x140208f900000000, 0xea79e89d00000000, 0x7fad980800000000, 0x383f882400000000, 0xadebf8b100000000, 0x539018d500000000, 0xc644684000000000, 0xaf67d81c00000000, 0x3ab3a88900000000, 0xc4c848ed00000000, 0x511c387800000000, 0x4aec69b500000000, 0xdf38192000000000, 0x2143f94400000000, 0xb49789d100000000, 0xddb4398d00000000, 0x4860491800000000, 0xb61ba97c00000000, 0x23cfd9e900000000, 0x645dc9c500000000, 0xf189b95000000000, 0x0ff2593400000000, 0x9a2629a100000000, 0xf30599fd00000000, 0x66d1e96800000000, 0x98aa090c00000000, 0x0d7e799900000000, 0xef4cdb4d00000000, 0x7a98abd800000000, 0x84e34bbc00000000, 0x11373b2900000000, 0x78148b7500000000, 0xedc0fbe000000000, 0x13bb1b8400000000, 0x866f6b1100000000, 0xc1fd7b3d00000000, 0x54290ba800000000, 0xaa52ebcc00000000, 0x3f869b5900000000, 0x56a52b0500000000, 0xc3715b9000000000, 0x3d0abbf400000000, 0xa8decb6100000000, 0xb32e9aac00000000, 0x26faea3900000000, 0xd8810a5d00000000, 0x4d557ac800000000, 0x2476ca9400000000, 0xb1a2ba0100000000, 0x4fd95a6500000000, 0xda0d2af000000000, 0x9d9f3adc00000000, 0x084b4a4900000000, 0xf630aa2d00000000, 0x63e4dab800000000, 0x0ac76ae400000000, 0x9f131a7100000000, 0x6168fa1500000000, 0xf4bc8a8000000000}, {0x0000000000000000, 0x1f17f08000000000, 0x7f2891da00000000, 0x603f615a00000000, 0xbf56536e00000000, 0xa041a3ee00000000, 0xc07ec2b400000000, 0xdf69323400000000, 0x7eada6dc00000000, 0x61ba565c00000000, 0x0185370600000000, 0x1e92c78600000000, 0xc1fbf5b200000000, 0xdeec053200000000, 0xbed3646800000000, 0xa1c494e800000000, 0xbd5c3c6200000000, 0xa24bcce200000000, 0xc274adb800000000, 0xdd635d3800000000, 0x020a6f0c00000000, 0x1d1d9f8c00000000, 0x7d22fed600000000, 0x62350e5600000000, 0xc3f19abe00000000, 0xdce66a3e00000000, 0xbcd90b6400000000, 0xa3cefbe400000000, 0x7ca7c9d000000000, 0x63b0395000000000, 0x038f580a00000000, 0x1c98a88a00000000, 0x7ab978c400000000, 0x65ae884400000000, 0x0591e91e00000000, 0x1a86199e00000000, 0xc5ef2baa00000000, 0xdaf8db2a00000000, 0xbac7ba7000000000, 0xa5d04af000000000, 0x0414de1800000000, 0x1b032e9800000000, 0x7b3c4fc200000000, 0x642bbf4200000000, 0xbb428d7600000000, 0xa4557df600000000, 0xc46a1cac00000000, 0xdb7dec2c00000000, 0xc7e544a600000000, 0xd8f2b42600000000, 0xb8cdd57c00000000, 0xa7da25fc00000000, 0x78b317c800000000, 0x67a4e74800000000, 0x079b861200000000, 0x188c769200000000, 0xb948e27a00000000, 0xa65f12fa00000000, 0xc66073a000000000, 0xd977832000000000, 0x061eb11400000000, 0x1909419400000000, 0x793620ce00000000, 0x6621d04e00000000, 0xb574805300000000, 0xaa6370d300000000, 0xca5c118900000000, 0xd54be10900000000, 0x0a22d33d00000000, 0x153523bd00000000, 0x750a42e700000000, 0x6a1db26700000000, 0xcbd9268f00000000, 0xd4ced60f00000000, 0xb4f1b75500000000, 0xabe647d500000000, 0x748f75e100000000, 0x6b98856100000000, 0x0ba7e43b00000000, 0x14b014bb00000000, 0x0828bc3100000000, 0x173f4cb100000000, 0x77002deb00000000, 0x6817dd6b00000000, 0xb77eef5f00000000, 0xa8691fdf00000000, 0xc8567e8500000000, 0xd7418e0500000000, 0x76851aed00000000, 0x6992ea6d00000000, 0x09ad8b3700000000, 0x16ba7bb700000000, 0xc9d3498300000000, 0xd6c4b90300000000, 0xb6fbd85900000000, 0xa9ec28d900000000, 0xcfcdf89700000000, 0xd0da081700000000, 0xb0e5694d00000000, 0xaff299cd00000000, 0x709babf900000000, 0x6f8c5b7900000000, 0x0fb33a2300000000, 0x10a4caa300000000, 0xb1605e4b00000000, 0xae77aecb00000000, 0xce48cf9100000000, 0xd15f3f1100000000, 0x0e360d2500000000, 0x1121fda500000000, 0x711e9cff00000000, 0x6e096c7f00000000, 0x7291c4f500000000, 0x6d86347500000000, 0x0db9552f00000000, 0x12aea5af00000000, 0xcdc7979b00000000, 0xd2d0671b00000000, 0xb2ef064100000000, 0xadf8f6c100000000, 0x0c3c622900000000, 0x132b92a900000000, 0x7314f3f300000000, 0x6c03037300000000, 0xb36a314700000000, 0xac7dc1c700000000, 0xcc42a09d00000000, 0xd355501d00000000, 0x6ae900a700000000, 0x75fef02700000000, 0x15c1917d00000000, 0x0ad661fd00000000, 0xd5bf53c900000000, 0xcaa8a34900000000, 0xaa97c21300000000, 0xb580329300000000, 0x1444a67b00000000, 0x0b5356fb00000000, 0x6b6c37a100000000, 0x747bc72100000000, 0xab12f51500000000, 0xb405059500000000, 0xd43a64cf00000000, 0xcb2d944f00000000, 0xd7b53cc500000000, 0xc8a2cc4500000000, 0xa89dad1f00000000, 0xb78a5d9f00000000, 0x68e36fab00000000, 0x77f49f2b00000000, 0x17cbfe7100000000, 0x08dc0ef100000000, 0xa9189a1900000000, 0xb60f6a9900000000, 0xd6300bc300000000, 0xc927fb4300000000, 0x164ec97700000000, 0x095939f700000000, 0x696658ad00000000, 0x7671a82d00000000, 0x1050786300000000, 0x0f4788e300000000, 0x6f78e9b900000000, 0x706f193900000000, 0xaf062b0d00000000, 0xb011db8d00000000, 0xd02ebad700000000, 0xcf394a5700000000, 0x6efddebf00000000, 0x71ea2e3f00000000, 0x11d54f6500000000, 0x0ec2bfe500000000, 0xd1ab8dd100000000, 0xcebc7d5100000000, 0xae831c0b00000000, 0xb194ec8b00000000, 0xad0c440100000000, 0xb21bb48100000000, 0xd224d5db00000000, 0xcd33255b00000000, 0x125a176f00000000, 0x0d4de7ef00000000, 0x6d7286b500000000, 0x7265763500000000, 0xd3a1e2dd00000000, 0xccb6125d00000000, 0xac89730700000000, 0xb39e838700000000, 0x6cf7b1b300000000, 0x73e0413300000000, 0x13df206900000000, 0x0cc8d0e900000000, 0xdf9d80f400000000, 0xc08a707400000000, 0xa0b5112e00000000, 0xbfa2e1ae00000000, 0x60cbd39a00000000, 0x7fdc231a00000000, 0x1fe3424000000000, 0x00f4b2c000000000, 0xa130262800000000, 0xbe27d6a800000000, 0xde18b7f200000000, 0xc10f477200000000, 0x1e66754600000000, 0x017185c600000000, 0x614ee49c00000000, 0x7e59141c00000000, 0x62c1bc9600000000, 0x7dd64c1600000000, 0x1de92d4c00000000, 0x02feddcc00000000, 0xdd97eff800000000, 0xc2801f7800000000, 0xa2bf7e2200000000, 0xbda88ea200000000, 0x1c6c1a4a00000000, 0x037beaca00000000, 0x63448b9000000000, 0x7c537b1000000000, 0xa33a492400000000, 0xbc2db9a400000000, 0xdc12d8fe00000000, 0xc305287e00000000, 0xa524f83000000000, 0xba3308b000000000, 0xda0c69ea00000000, 0xc51b996a00000000, 0x1a72ab5e00000000, 0x05655bde00000000, 0x655a3a8400000000, 0x7a4dca0400000000, 0xdb895eec00000000, 0xc49eae6c00000000, 0xa4a1cf3600000000, 0xbbb63fb600000000, 0x64df0d8200000000, 0x7bc8fd0200000000, 0x1bf79c5800000000, 0x04e06cd800000000, 0x1878c45200000000, 0x076f34d200000000, 0x6750558800000000, 0x7847a50800000000, 0xa72e973c00000000, 0xb83967bc00000000, 0xd80606e600000000, 0xc711f66600000000, 0x66d5628e00000000, 0x79c2920e00000000, 0x19fdf35400000000, 0x06ea03d400000000, 0xd98331e000000000, 0xc694c16000000000, 0xa6aba03a00000000, 0xb9bc50ba00000000}, {0x0000000000000000, 0xe2fd888d00000000, 0x85fd60c000000000, 0x6700e84d00000000, 0x4bfdb05b00000000, 0xa90038d600000000, 0xce00d09b00000000, 0x2cfd581600000000, 0x96fa61b700000000, 0x7407e93a00000000, 0x1307017700000000, 0xf1fa89fa00000000, 0xdd07d1ec00000000, 0x3ffa596100000000, 0x58fab12c00000000, 0xba0739a100000000, 0x6df3b2b500000000, 0x8f0e3a3800000000, 0xe80ed27500000000, 0x0af35af800000000, 0x260e02ee00000000, 0xc4f38a6300000000, 0xa3f3622e00000000, 0x410eeaa300000000, 0xfb09d30200000000, 0x19f45b8f00000000, 0x7ef4b3c200000000, 0x9c093b4f00000000, 0xb0f4635900000000, 0x5209ebd400000000, 0x3509039900000000, 0xd7f48b1400000000, 0x9be014b000000000, 0x791d9c3d00000000, 0x1e1d747000000000, 0xfce0fcfd00000000, 0xd01da4eb00000000, 0x32e02c6600000000, 0x55e0c42b00000000, 0xb71d4ca600000000, 0x0d1a750700000000, 0xefe7fd8a00000000, 0x88e715c700000000, 0x6a1a9d4a00000000, 0x46e7c55c00000000, 0xa41a4dd100000000, 0xc31aa59c00000000, 0x21e72d1100000000, 0xf613a60500000000, 0x14ee2e8800000000, 0x73eec6c500000000, 0x91134e4800000000, 0xbdee165e00000000, 0x5f139ed300000000, 0x3813769e00000000, 0xdaeefe1300000000, 0x60e9c7b200000000, 0x82144f3f00000000, 0xe514a77200000000, 0x07e92fff00000000, 0x2b1477e900000000, 0xc9e9ff6400000000, 0xaee9172900000000, 0x4c149fa400000000, 0x77c758bb00000000, 0x953ad03600000000, 0xf23a387b00000000, 0x10c7b0f600000000, 0x3c3ae8e000000000, 0xdec7606d00000000, 0xb9c7882000000000, 0x5b3a00ad00000000, 0xe13d390c00000000, 0x03c0b18100000000, 0x64c059cc00000000, 0x863dd14100000000, 0xaac0895700000000, 0x483d01da00000000, 0x2f3de99700000000, 0xcdc0611a00000000, 0x1a34ea0e00000000, 0xf8c9628300000000, 0x9fc98ace00000000, 0x7d34024300000000, 0x51c95a5500000000, 0xb334d2d800000000, 0xd4343a9500000000, 0x36c9b21800000000, 0x8cce8bb900000000, 0x6e33033400000000, 0x0933eb7900000000, 0xebce63f400000000, 0xc7333be200000000, 0x25ceb36f00000000, 0x42ce5b2200000000, 0xa033d3af00000000, 0xec274c0b00000000, 0x0edac48600000000, 0x69da2ccb00000000, 0x8b27a44600000000, 0xa7dafc5000000000, 0x452774dd00000000, 0x22279c9000000000, 0xc0da141d00000000, 0x7add2dbc00000000, 0x9820a53100000000, 0xff204d7c00000000, 0x1dddc5f100000000, 0x31209de700000000, 0xd3dd156a00000000, 0xb4ddfd2700000000, 0x562075aa00000000, 0x81d4febe00000000, 0x6329763300000000, 0x04299e7e00000000, 0xe6d416f300000000, 0xca294ee500000000, 0x28d4c66800000000, 0x4fd42e2500000000, 0xad29a6a800000000, 0x172e9f0900000000, 0xf5d3178400000000, 0x92d3ffc900000000, 0x702e774400000000, 0x5cd32f5200000000, 0xbe2ea7df00000000, 0xd92e4f9200000000, 0x3bd3c71f00000000, 0xaf88c0ad00000000, 0x4d75482000000000, 0x2a75a06d00000000, 0xc88828e000000000, 0xe47570f600000000, 0x0688f87b00000000, 0x6188103600000000, 0x837598bb00000000, 0x3972a11a00000000, 0xdb8f299700000000, 0xbc8fc1da00000000, 0x5e72495700000000, 0x728f114100000000, 0x907299cc00000000, 0xf772718100000000, 0x158ff90c00000000, 0xc27b721800000000, 0x2086fa9500000000, 0x478612d800000000, 0xa57b9a5500000000, 0x8986c24300000000, 0x6b7b4ace00000000, 0x0c7ba28300000000, 0xee862a0e00000000, 0x548113af00000000, 0xb67c9b2200000000, 0xd17c736f00000000, 0x3381fbe200000000, 0x1f7ca3f400000000, 0xfd812b7900000000, 0x9a81c33400000000, 0x787c4bb900000000, 0x3468d41d00000000, 0xd6955c9000000000, 0xb195b4dd00000000, 0x53683c5000000000, 0x7f95644600000000, 0x9d68eccb00000000, 0xfa68048600000000, 0x18958c0b00000000, 0xa292b5aa00000000, 0x406f3d2700000000, 0x276fd56a00000000, 0xc5925de700000000, 0xe96f05f100000000, 0x0b928d7c00000000, 0x6c92653100000000, 0x8e6fedbc00000000, 0x599b66a800000000, 0xbb66ee2500000000, 0xdc66066800000000, 0x3e9b8ee500000000, 0x1266d6f300000000, 0xf09b5e7e00000000, 0x979bb63300000000, 0x75663ebe00000000, 0xcf61071f00000000, 0x2d9c8f9200000000, 0x4a9c67df00000000, 0xa861ef5200000000, 0x849cb74400000000, 0x66613fc900000000, 0x0161d78400000000, 0xe39c5f0900000000, 0xd84f981600000000, 0x3ab2109b00000000, 0x5db2f8d600000000, 0xbf4f705b00000000, 0x93b2284d00000000, 0x714fa0c000000000, 0x164f488d00000000, 0xf4b2c00000000000, 0x4eb5f9a100000000, 0xac48712c00000000, 0xcb48996100000000, 0x29b511ec00000000, 0x054849fa00000000, 0xe7b5c17700000000, 0x80b5293a00000000, 0x6248a1b700000000, 0xb5bc2aa300000000, 0x5741a22e00000000, 0x30414a6300000000, 0xd2bcc2ee00000000, 0xfe419af800000000, 0x1cbc127500000000, 0x7bbcfa3800000000, 0x994172b500000000, 0x23464b1400000000, 0xc1bbc39900000000, 0xa6bb2bd400000000, 0x4446a35900000000, 0x68bbfb4f00000000, 0x8a4673c200000000, 0xed469b8f00000000, 0x0fbb130200000000, 0x43af8ca600000000, 0xa152042b00000000, 0xc652ec6600000000, 0x24af64eb00000000, 0x08523cfd00000000, 0xeaafb47000000000, 0x8daf5c3d00000000, 0x6f52d4b000000000, 0xd555ed1100000000, 0x37a8659c00000000, 0x50a88dd100000000, 0xb255055c00000000, 0x9ea85d4a00000000, 0x7c55d5c700000000, 0x1b553d8a00000000, 0xf9a8b50700000000, 0x2e5c3e1300000000, 0xcca1b69e00000000, 0xaba15ed300000000, 0x495cd65e00000000, 0x65a18e4800000000, 0x875c06c500000000, 0xe05cee8800000000, 0x02a1660500000000, 0xb8a65fa400000000, 0x5a5bd72900000000, 0x3d5b3f6400000000, 0xdfa6b7e900000000, 0xf35befff00000000, 0x11a6677200000000, 0x76a68f3f00000000, 0x945b07b200000000}, {0x0000000000000000, 0xa90b894e00000000, 0x5217129d00000000, 0xfb1c9bd300000000, 0xe52855e100000000, 0x4c23dcaf00000000, 0xb73f477c00000000, 0x1e34ce3200000000, 0x8b57db1900000000, 0x225c525700000000, 0xd940c98400000000, 0x704b40ca00000000, 0x6e7f8ef800000000, 0xc77407b600000000, 0x3c689c6500000000, 0x9563152b00000000, 0x16afb63300000000, 0xbfa43f7d00000000, 0x44b8a4ae00000000, 0xedb32de000000000, 0xf387e3d200000000, 0x5a8c6a9c00000000, 0xa190f14f00000000, 0x089b780100000000, 0x9df86d2a00000000, 0x34f3e46400000000, 0xcfef7fb700000000, 0x66e4f6f900000000, 0x78d038cb00000000, 0xd1dbb18500000000, 0x2ac72a5600000000, 0x83cca31800000000, 0x2c5e6d6700000000, 0x8555e42900000000, 0x7e497ffa00000000, 0xd742f6b400000000, 0xc976388600000000, 0x607db1c800000000, 0x9b612a1b00000000, 0x326aa35500000000, 0xa709b67e00000000, 0x0e023f3000000000, 0xf51ea4e300000000, 0x5c152dad00000000, 0x4221e39f00000000, 0xeb2a6ad100000000, 0x1036f10200000000, 0xb93d784c00000000, 0x3af1db5400000000, 0x93fa521a00000000, 0x68e6c9c900000000, 0xc1ed408700000000, 0xdfd98eb500000000, 0x76d207fb00000000, 0x8dce9c2800000000, 0x24c5156600000000, 0xb1a6004d00000000, 0x18ad890300000000, 0xe3b112d000000000, 0x4aba9b9e00000000, 0x548e55ac00000000, 0xfd85dce200000000, 0x0699473100000000, 0xaf92ce7f00000000, 0x58bcdace00000000, 0xf1b7538000000000, 0x0aabc85300000000, 0xa3a0411d00000000, 0xbd948f2f00000000, 0x149f066100000000, 0xef839db200000000, 0x468814fc00000000, 0xd3eb01d700000000, 0x7ae0889900000000, 0x81fc134a00000000, 0x28f79a0400000000, 0x36c3543600000000, 0x9fc8dd7800000000, 0x64d446ab00000000, 0xcddfcfe500000000, 0x4e136cfd00000000, 0xe718e5b300000000, 0x1c047e6000000000, 0xb50ff72e00000000, 0xab3b391c00000000, 0x0230b05200000000, 0xf92c2b8100000000, 0x5027a2cf00000000, 0xc544b7e400000000, 0x6c4f3eaa00000000, 0x9753a57900000000, 0x3e582c3700000000, 0x206ce20500000000, 0x89676b4b00000000, 0x727bf09800000000, 0xdb7079d600000000, 0x74e2b7a900000000, 0xdde93ee700000000, 0x26f5a53400000000, 0x8ffe2c7a00000000, 0x91cae24800000000, 0x38c16b0600000000, 0xc3ddf0d500000000, 0x6ad6799b00000000, 0xffb56cb000000000, 0x56bee5fe00000000, 0xada27e2d00000000, 0x04a9f76300000000, 0x1a9d395100000000, 0xb396b01f00000000, 0x488a2bcc00000000, 0xe181a28200000000, 0x624d019a00000000, 0xcb4688d400000000, 0x305a130700000000, 0x99519a4900000000, 0x8765547b00000000, 0x2e6edd3500000000, 0xd57246e600000000, 0x7c79cfa800000000, 0xe91ada8300000000, 0x401153cd00000000, 0xbb0dc81e00000000, 0x1206415000000000, 0x0c328f6200000000, 0xa539062c00000000, 0x5e259dff00000000, 0xf72e14b100000000, 0xf17ec44600000000, 0x58754d0800000000, 0xa369d6db00000000, 0x0a625f9500000000, 0x145691a700000000, 0xbd5d18e900000000, 0x4641833a00000000, 0xef4a0a7400000000, 0x7a291f5f00000000, 0xd322961100000000, 0x283e0dc200000000, 0x8135848c00000000, 0x9f014abe00000000, 0x360ac3f000000000, 0xcd16582300000000, 0x641dd16d00000000, 0xe7d1727500000000, 0x4edafb3b00000000, 0xb5c660e800000000, 0x1ccde9a600000000, 0x02f9279400000000, 0xabf2aeda00000000, 0x50ee350900000000, 0xf9e5bc4700000000, 0x6c86a96c00000000, 0xc58d202200000000, 0x3e91bbf100000000, 0x979a32bf00000000, 0x89aefc8d00000000, 0x20a575c300000000, 0xdbb9ee1000000000, 0x72b2675e00000000, 0xdd20a92100000000, 0x742b206f00000000, 0x8f37bbbc00000000, 0x263c32f200000000, 0x3808fcc000000000, 0x9103758e00000000, 0x6a1fee5d00000000, 0xc314671300000000, 0x5677723800000000, 0xff7cfb7600000000, 0x046060a500000000, 0xad6be9eb00000000, 0xb35f27d900000000, 0x1a54ae9700000000, 0xe148354400000000, 0x4843bc0a00000000, 0xcb8f1f1200000000, 0x6284965c00000000, 0x99980d8f00000000, 0x309384c100000000, 0x2ea74af300000000, 0x87acc3bd00000000, 0x7cb0586e00000000, 0xd5bbd12000000000, 0x40d8c40b00000000, 0xe9d34d4500000000, 0x12cfd69600000000, 0xbbc45fd800000000, 0xa5f091ea00000000, 0x0cfb18a400000000, 0xf7e7837700000000, 0x5eec0a3900000000, 0xa9c21e8800000000, 0x00c997c600000000, 0xfbd50c1500000000, 0x52de855b00000000, 0x4cea4b6900000000, 0xe5e1c22700000000, 0x1efd59f400000000, 0xb7f6d0ba00000000, 0x2295c59100000000, 0x8b9e4cdf00000000, 0x7082d70c00000000, 0xd9895e4200000000, 0xc7bd907000000000, 0x6eb6193e00000000, 0x95aa82ed00000000, 0x3ca10ba300000000, 0xbf6da8bb00000000, 0x166621f500000000, 0xed7aba2600000000, 0x4471336800000000, 0x5a45fd5a00000000, 0xf34e741400000000, 0x0852efc700000000, 0xa159668900000000, 0x343a73a200000000, 0x9d31faec00000000, 0x662d613f00000000, 0xcf26e87100000000, 0xd112264300000000, 0x7819af0d00000000, 0x830534de00000000, 0x2a0ebd9000000000, 0x859c73ef00000000, 0x2c97faa100000000, 0xd78b617200000000, 0x7e80e83c00000000, 0x60b4260e00000000, 0xc9bfaf4000000000, 0x32a3349300000000, 0x9ba8bddd00000000, 0x0ecba8f600000000, 0xa7c021b800000000, 0x5cdcba6b00000000, 0xf5d7332500000000, 0xebe3fd1700000000, 0x42e8745900000000, 0xb9f4ef8a00000000, 0x10ff66c400000000, 0x9333c5dc00000000, 0x3a384c9200000000, 0xc124d74100000000, 0x682f5e0f00000000, 0x761b903d00000000, 0xdf10197300000000, 0x240c82a000000000, 0x8d070bee00000000, 0x18641ec500000000, 0xb16f978b00000000, 0x4a730c5800000000, 0xe378851600000000, 0xfd4c4b2400000000, 0x5447c26a00000000, 0xaf5b59b900000000, 0x0650d0f700000000}, {0x0000000000000000, 0x479244af00000000, 0xcf22f88500000000, 0x88b0bc2a00000000, 0xdf4381d000000000, 0x98d1c57f00000000, 0x1061795500000000, 0x57f33dfa00000000, 0xff81737a00000000, 0xb81337d500000000, 0x30a38bff00000000, 0x7731cf5000000000, 0x20c2f2aa00000000, 0x6750b60500000000, 0xefe00a2f00000000, 0xa8724e8000000000, 0xfe03e7f400000000, 0xb991a35b00000000, 0x31211f7100000000, 0x76b35bde00000000, 0x2140662400000000, 0x66d2228b00000000, 0xee629ea100000000, 0xa9f0da0e00000000, 0x0182948e00000000, 0x4610d02100000000, 0xcea06c0b00000000, 0x893228a400000000, 0xdec1155e00000000, 0x995351f100000000, 0x11e3eddb00000000, 0x5671a97400000000, 0xbd01bf3200000000, 0xfa93fb9d00000000, 0x722347b700000000, 0x35b1031800000000, 0x62423ee200000000, 0x25d07a4d00000000, 0xad60c66700000000, 0xeaf282c800000000, 0x4280cc4800000000, 0x051288e700000000, 0x8da234cd00000000, 0xca30706200000000, 0x9dc34d9800000000, 0xda51093700000000, 0x52e1b51d00000000, 0x1573f1b200000000, 0x430258c600000000, 0x04901c6900000000, 0x8c20a04300000000, 0xcbb2e4ec00000000, 0x9c41d91600000000, 0xdbd39db900000000, 0x5363219300000000, 0x14f1653c00000000, 0xbc832bbc00000000, 0xfb116f1300000000, 0x73a1d33900000000, 0x3433979600000000, 0x63c0aa6c00000000, 0x2452eec300000000, 0xace252e900000000, 0xeb70164600000000, 0x7a037e6500000000, 0x3d913aca00000000, 0xb52186e000000000, 0xf2b3c24f00000000, 0xa540ffb500000000, 0xe2d2bb1a00000000, 0x6a62073000000000, 0x2df0439f00000000, 0x85820d1f00000000, 0xc21049b000000000, 0x4aa0f59a00000000, 0x0d32b13500000000, 0x5ac18ccf00000000, 0x1d53c86000000000, 0x95e3744a00000000, 0xd27130e500000000, 0x8400999100000000, 0xc392dd3e00000000, 0x4b22611400000000, 0x0cb025bb00000000, 0x5b43184100000000, 0x1cd15cee00000000, 0x9461e0c400000000, 0xd3f3a46b00000000, 0x7b81eaeb00000000, 0x3c13ae4400000000, 0xb4a3126e00000000, 0xf33156c100000000, 0xa4c26b3b00000000, 0xe3502f9400000000, 0x6be093be00000000, 0x2c72d71100000000, 0xc702c15700000000, 0x809085f800000000, 0x082039d200000000, 0x4fb27d7d00000000, 0x1841408700000000, 0x5fd3042800000000, 0xd763b80200000000, 0x90f1fcad00000000, 0x3883b22d00000000, 0x7f11f68200000000, 0xf7a14aa800000000, 0xb0330e0700000000, 0xe7c033fd00000000, 0xa052775200000000, 0x28e2cb7800000000, 0x6f708fd700000000, 0x390126a300000000, 0x7e93620c00000000, 0xf623de2600000000, 0xb1b19a8900000000, 0xe642a77300000000, 0xa1d0e3dc00000000, 0x29605ff600000000, 0x6ef21b5900000000, 0xc68055d900000000, 0x8112117600000000, 0x09a2ad5c00000000, 0x4e30e9f300000000, 0x19c3d40900000000, 0x5e5190a600000000, 0xd6e12c8c00000000, 0x9173682300000000, 0xf406fcca00000000, 0xb394b86500000000, 0x3b24044f00000000, 0x7cb640e000000000, 0x2b457d1a00000000, 0x6cd739b500000000, 0xe467859f00000000, 0xa3f5c13000000000, 0x0b878fb000000000, 0x4c15cb1f00000000, 0xc4a5773500000000, 0x8337339a00000000, 0xd4c40e6000000000, 0x93564acf00000000, 0x1be6f6e500000000, 0x5c74b24a00000000, 0x0a051b3e00000000, 0x4d975f9100000000, 0xc527e3bb00000000, 0x82b5a71400000000, 0xd5469aee00000000, 0x92d4de4100000000, 0x1a64626b00000000, 0x5df626c400000000, 0xf584684400000000, 0xb2162ceb00000000, 0x3aa690c100000000, 0x7d34d46e00000000, 0x2ac7e99400000000, 0x6d55ad3b00000000, 0xe5e5111100000000, 0xa27755be00000000, 0x490743f800000000, 0x0e95075700000000, 0x8625bb7d00000000, 0xc1b7ffd200000000, 0x9644c22800000000, 0xd1d6868700000000, 0x59663aad00000000, 0x1ef47e0200000000, 0xb686308200000000, 0xf114742d00000000, 0x79a4c80700000000, 0x3e368ca800000000, 0x69c5b15200000000, 0x2e57f5fd00000000, 0xa6e749d700000000, 0xe1750d7800000000, 0xb704a40c00000000, 0xf096e0a300000000, 0x78265c8900000000, 0x3fb4182600000000, 0x684725dc00000000, 0x2fd5617300000000, 0xa765dd5900000000, 0xe0f799f600000000, 0x4885d77600000000, 0x0f1793d900000000, 0x87a72ff300000000, 0xc0356b5c00000000, 0x97c656a600000000, 0xd054120900000000, 0x58e4ae2300000000, 0x1f76ea8c00000000, 0x8e0582af00000000, 0xc997c60000000000, 0x41277a2a00000000, 0x06b53e8500000000, 0x5146037f00000000, 0x16d447d000000000, 0x9e64fbfa00000000, 0xd9f6bf5500000000, 0x7184f1d500000000, 0x3616b57a00000000, 0xbea6095000000000, 0xf9344dff00000000, 0xaec7700500000000, 0xe95534aa00000000, 0x61e5888000000000, 0x2677cc2f00000000, 0x7006655b00000000, 0x379421f400000000, 0xbf249dde00000000, 0xf8b6d97100000000, 0xaf45e48b00000000, 0xe8d7a02400000000, 0x60671c0e00000000, 0x27f558a100000000, 0x8f87162100000000, 0xc815528e00000000, 0x40a5eea400000000, 0x0737aa0b00000000, 0x50c497f100000000, 0x1756d35e00000000, 0x9fe66f7400000000, 0xd8742bdb00000000, 0x33043d9d00000000, 0x7496793200000000, 0xfc26c51800000000, 0xbbb481b700000000, 0xec47bc4d00000000, 0xabd5f8e200000000, 0x236544c800000000, 0x64f7006700000000, 0xcc854ee700000000, 0x8b170a4800000000, 0x03a7b66200000000, 0x4435f2cd00000000, 0x13c6cf3700000000, 0x54548b9800000000, 0xdce437b200000000, 0x9b76731d00000000, 0xcd07da6900000000, 0x8a959ec600000000, 0x022522ec00000000, 0x45b7664300000000, 0x12445bb900000000, 0x55d61f1600000000, 0xdd66a33c00000000, 0x9af4e79300000000, 0x3286a91300000000, 0x7514edbc00000000, 0xfda4519600000000, 0xba36153900000000, 0xedc528c300000000, 0xaa576c6c00000000, 0x22e7d04600000000, 0x657594e900000000}}; #else /* W == 4 */ local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0x65673b46, 0xcace768c, 0xafa94dca, 0x4eedeb59, 0x2b8ad01f, 0x84239dd5, 0xe144a693, 0x9ddbd6b2, 0xf8bcedf4, 0x5715a03e, 0x32729b78, 0xd3363deb, 0xb65106ad, 0x19f84b67, 0x7c9f7021, 0xe0c6ab25, 0x85a19063, 0x2a08dda9, 0x4f6fe6ef, 0xae2b407c, 0xcb4c7b3a, 0x64e536f0, 0x01820db6, 0x7d1d7d97, 0x187a46d1, 0xb7d30b1b, 0xd2b4305d, 0x33f096ce, 0x5697ad88, 0xf93ee042, 0x9c59db04, 0x1afc500b, 0x7f9b6b4d, 0xd0322687, 0xb5551dc1, 0x5411bb52, 0x31768014, 0x9edfcdde, 0xfbb8f698, 0x872786b9, 0xe240bdff, 0x4de9f035, 0x288ecb73, 0xc9ca6de0, 0xacad56a6, 0x03041b6c, 0x6663202a, 0xfa3afb2e, 0x9f5dc068, 0x30f48da2, 0x5593b6e4, 0xb4d71077, 0xd1b02b31, 0x7e1966fb, 0x1b7e5dbd, 0x67e12d9c, 0x028616da, 0xad2f5b10, 0xc8486056, 0x290cc6c5, 0x4c6bfd83, 0xe3c2b049, 0x86a58b0f, 0x35f8a016, 0x509f9b50, 0xff36d69a, 0x9a51eddc, 0x7b154b4f, 0x1e727009, 0xb1db3dc3, 0xd4bc0685, 0xa82376a4, 0xcd444de2, 0x62ed0028, 0x078a3b6e, 0xe6ce9dfd, 0x83a9a6bb, 0x2c00eb71, 0x4967d037, 0xd53e0b33, 0xb0593075, 0x1ff07dbf, 0x7a9746f9, 0x9bd3e06a, 0xfeb4db2c, 0x511d96e6, 0x347aada0, 0x48e5dd81, 0x2d82e6c7, 0x822bab0d, 0xe74c904b, 0x060836d8, 0x636f0d9e, 0xccc64054, 0xa9a17b12, 0x2f04f01d, 0x4a63cb5b, 0xe5ca8691, 0x80adbdd7, 0x61e91b44, 0x048e2002, 0xab276dc8, 0xce40568e, 0xb2df26af, 0xd7b81de9, 0x78115023, 0x1d766b65, 0xfc32cdf6, 0x9955f6b0, 0x36fcbb7a, 0x539b803c, 0xcfc25b38, 0xaaa5607e, 0x050c2db4, 0x606b16f2, 0x812fb061, 0xe4488b27, 0x4be1c6ed, 0x2e86fdab, 0x52198d8a, 0x377eb6cc, 0x98d7fb06, 0xfdb0c040, 0x1cf466d3, 0x79935d95, 0xd63a105f, 0xb35d2b19, 0x6bf1402c, 0x0e967b6a, 0xa13f36a0, 0xc4580de6, 0x251cab75, 0x407b9033, 0xefd2ddf9, 0x8ab5e6bf, 0xf62a969e, 0x934dadd8, 0x3ce4e012, 0x5983db54, 0xb8c77dc7, 0xdda04681, 0x72090b4b, 0x176e300d, 0x8b37eb09, 0xee50d04f, 0x41f99d85, 0x249ea6c3, 0xc5da0050, 0xa0bd3b16, 0x0f1476dc, 0x6a734d9a, 0x16ec3dbb, 0x738b06fd, 0xdc224b37, 0xb9457071, 0x5801d6e2, 0x3d66eda4, 0x92cfa06e, 0xf7a89b28, 0x710d1027, 0x146a2b61, 0xbbc366ab, 0xdea45ded, 0x3fe0fb7e, 0x5a87c038, 0xf52e8df2, 0x9049b6b4, 0xecd6c695, 0x89b1fdd3, 0x2618b019, 0x437f8b5f, 0xa23b2dcc, 0xc75c168a, 0x68f55b40, 0x0d926006, 0x91cbbb02, 0xf4ac8044, 0x5b05cd8e, 0x3e62f6c8, 0xdf26505b, 0xba416b1d, 0x15e826d7, 0x708f1d91, 0x0c106db0, 0x697756f6, 0xc6de1b3c, 0xa3b9207a, 0x42fd86e9, 0x279abdaf, 0x8833f065, 0xed54cb23, 0x5e09e03a, 0x3b6edb7c, 0x94c796b6, 0xf1a0adf0, 0x10e40b63, 0x75833025, 0xda2a7def, 0xbf4d46a9, 0xc3d23688, 0xa6b50dce, 0x091c4004, 0x6c7b7b42, 0x8d3fddd1, 0xe858e697, 0x47f1ab5d, 0x2296901b, 0xbecf4b1f, 0xdba87059, 0x74013d93, 0x116606d5, 0xf022a046, 0x95459b00, 0x3aecd6ca, 0x5f8bed8c, 0x23149dad, 0x4673a6eb, 0xe9daeb21, 0x8cbdd067, 0x6df976f4, 0x089e4db2, 0xa7370078, 0xc2503b3e, 0x44f5b031, 0x21928b77, 0x8e3bc6bd, 0xeb5cfdfb, 0x0a185b68, 0x6f7f602e, 0xc0d62de4, 0xa5b116a2, 0xd92e6683, 0xbc495dc5, 0x13e0100f, 0x76872b49, 0x97c38dda, 0xf2a4b69c, 0x5d0dfb56, 0x386ac010, 0xa4331b14, 0xc1542052, 0x6efd6d98, 0x0b9a56de, 0xeadef04d, 0x8fb9cb0b, 0x201086c1, 0x4577bd87, 0x39e8cda6, 0x5c8ff6e0, 0xf326bb2a, 0x9641806c, 0x770526ff, 0x12621db9, 0xbdcb5073, 0xd8ac6b35}, {0x00000000, 0xd7e28058, 0x74b406f1, 0xa35686a9, 0xe9680de2, 0x3e8a8dba, 0x9ddc0b13, 0x4a3e8b4b, 0x09a11d85, 0xde439ddd, 0x7d151b74, 0xaaf79b2c, 0xe0c91067, 0x372b903f, 0x947d1696, 0x439f96ce, 0x13423b0a, 0xc4a0bb52, 0x67f63dfb, 0xb014bda3, 0xfa2a36e8, 0x2dc8b6b0, 0x8e9e3019, 0x597cb041, 0x1ae3268f, 0xcd01a6d7, 0x6e57207e, 0xb9b5a026, 0xf38b2b6d, 0x2469ab35, 0x873f2d9c, 0x50ddadc4, 0x26847614, 0xf166f64c, 0x523070e5, 0x85d2f0bd, 0xcfec7bf6, 0x180efbae, 0xbb587d07, 0x6cbafd5f, 0x2f256b91, 0xf8c7ebc9, 0x5b916d60, 0x8c73ed38, 0xc64d6673, 0x11afe62b, 0xb2f96082, 0x651be0da, 0x35c64d1e, 0xe224cd46, 0x41724bef, 0x9690cbb7, 0xdcae40fc, 0x0b4cc0a4, 0xa81a460d, 0x7ff8c655, 0x3c67509b, 0xeb85d0c3, 0x48d3566a, 0x9f31d632, 0xd50f5d79, 0x02eddd21, 0xa1bb5b88, 0x7659dbd0, 0x4d08ec28, 0x9aea6c70, 0x39bcead9, 0xee5e6a81, 0xa460e1ca, 0x73826192, 0xd0d4e73b, 0x07366763, 0x44a9f1ad, 0x934b71f5, 0x301df75c, 0xe7ff7704, 0xadc1fc4f, 0x7a237c17, 0xd975fabe, 0x0e977ae6, 0x5e4ad722, 0x89a8577a, 0x2afed1d3, 0xfd1c518b, 0xb722dac0, 0x60c05a98, 0xc396dc31, 0x14745c69, 0x57ebcaa7, 0x80094aff, 0x235fcc56, 0xf4bd4c0e, 0xbe83c745, 0x6961471d, 0xca37c1b4, 0x1dd541ec, 0x6b8c9a3c, 0xbc6e1a64, 0x1f389ccd, 0xc8da1c95, 0x82e497de, 0x55061786, 0xf650912f, 0x21b21177, 0x622d87b9, 0xb5cf07e1, 0x16998148, 0xc17b0110, 0x8b458a5b, 0x5ca70a03, 0xfff18caa, 0x28130cf2, 0x78cea136, 0xaf2c216e, 0x0c7aa7c7, 0xdb98279f, 0x91a6acd4, 0x46442c8c, 0xe512aa25, 0x32f02a7d, 0x716fbcb3, 0xa68d3ceb, 0x05dbba42, 0xd2393a1a, 0x9807b151, 0x4fe53109, 0xecb3b7a0, 0x3b5137f8, 0x9a11d850, 0x4df35808, 0xeea5dea1, 0x39475ef9, 0x7379d5b2, 0xa49b55ea, 0x07cdd343, 0xd02f531b, 0x93b0c5d5, 0x4452458d, 0xe704c324, 0x30e6437c, 0x7ad8c837, 0xad3a486f, 0x0e6ccec6, 0xd98e4e9e, 0x8953e35a, 0x5eb16302, 0xfde7e5ab, 0x2a0565f3, 0x603beeb8, 0xb7d96ee0, 0x148fe849, 0xc36d6811, 0x80f2fedf, 0x57107e87, 0xf446f82e, 0x23a47876, 0x699af33d, 0xbe787365, 0x1d2ef5cc, 0xcacc7594, 0xbc95ae44, 0x6b772e1c, 0xc821a8b5, 0x1fc328ed, 0x55fda3a6, 0x821f23fe, 0x2149a557, 0xf6ab250f, 0xb534b3c1, 0x62d63399, 0xc180b530, 0x16623568, 0x5c5cbe23, 0x8bbe3e7b, 0x28e8b8d2, 0xff0a388a, 0xafd7954e, 0x78351516, 0xdb6393bf, 0x0c8113e7, 0x46bf98ac, 0x915d18f4, 0x320b9e5d, 0xe5e91e05, 0xa67688cb, 0x71940893, 0xd2c28e3a, 0x05200e62, 0x4f1e8529, 0x98fc0571, 0x3baa83d8, 0xec480380, 0xd7193478, 0x00fbb420, 0xa3ad3289, 0x744fb2d1, 0x3e71399a, 0xe993b9c2, 0x4ac53f6b, 0x9d27bf33, 0xdeb829fd, 0x095aa9a5, 0xaa0c2f0c, 0x7deeaf54, 0x37d0241f, 0xe032a447, 0x436422ee, 0x9486a2b6, 0xc45b0f72, 0x13b98f2a, 0xb0ef0983, 0x670d89db, 0x2d330290, 0xfad182c8, 0x59870461, 0x8e658439, 0xcdfa12f7, 0x1a1892af, 0xb94e1406, 0x6eac945e, 0x24921f15, 0xf3709f4d, 0x502619e4, 0x87c499bc, 0xf19d426c, 0x267fc234, 0x8529449d, 0x52cbc4c5, 0x18f54f8e, 0xcf17cfd6, 0x6c41497f, 0xbba3c927, 0xf83c5fe9, 0x2fdedfb1, 0x8c885918, 0x5b6ad940, 0x1154520b, 0xc6b6d253, 0x65e054fa, 0xb202d4a2, 0xe2df7966, 0x353df93e, 0x966b7f97, 0x4189ffcf, 0x0bb77484, 0xdc55f4dc, 0x7f037275, 0xa8e1f22d, 0xeb7e64e3, 0x3c9ce4bb, 0x9fca6212, 0x4828e24a, 0x02166901, 0xd5f4e959, 0x76a26ff0, 0xa140efa8}, {0x00000000, 0xef52b6e1, 0x05d46b83, 0xea86dd62, 0x0ba8d706, 0xe4fa61e7, 0x0e7cbc85, 0xe12e0a64, 0x1751ae0c, 0xf80318ed, 0x1285c58f, 0xfdd7736e, 0x1cf9790a, 0xf3abcfeb, 0x192d1289, 0xf67fa468, 0x2ea35c18, 0xc1f1eaf9, 0x2b77379b, 0xc425817a, 0x250b8b1e, 0xca593dff, 0x20dfe09d, 0xcf8d567c, 0x39f2f214, 0xd6a044f5, 0x3c269997, 0xd3742f76, 0x325a2512, 0xdd0893f3, 0x378e4e91, 0xd8dcf870, 0x5d46b830, 0xb2140ed1, 0x5892d3b3, 0xb7c06552, 0x56ee6f36, 0xb9bcd9d7, 0x533a04b5, 0xbc68b254, 0x4a17163c, 0xa545a0dd, 0x4fc37dbf, 0xa091cb5e, 0x41bfc13a, 0xaeed77db, 0x446baab9, 0xab391c58, 0x73e5e428, 0x9cb752c9, 0x76318fab, 0x9963394a, 0x784d332e, 0x971f85cf, 0x7d9958ad, 0x92cbee4c, 0x64b44a24, 0x8be6fcc5, 0x616021a7, 0x8e329746, 0x6f1c9d22, 0x804e2bc3, 0x6ac8f6a1, 0x859a4040, 0xba8d7060, 0x55dfc681, 0xbf591be3, 0x500bad02, 0xb125a766, 0x5e771187, 0xb4f1cce5, 0x5ba37a04, 0xaddcde6c, 0x428e688d, 0xa808b5ef, 0x475a030e, 0xa674096a, 0x4926bf8b, 0xa3a062e9, 0x4cf2d408, 0x942e2c78, 0x7b7c9a99, 0x91fa47fb, 0x7ea8f11a, 0x9f86fb7e, 0x70d44d9f, 0x9a5290fd, 0x7500261c, 0x837f8274, 0x6c2d3495, 0x86abe9f7, 0x69f95f16, 0x88d75572, 0x6785e393, 0x8d033ef1, 0x62518810, 0xe7cbc850, 0x08997eb1, 0xe21fa3d3, 0x0d4d1532, 0xec631f56, 0x0331a9b7, 0xe9b774d5, 0x06e5c234, 0xf09a665c, 0x1fc8d0bd, 0xf54e0ddf, 0x1a1cbb3e, 0xfb32b15a, 0x146007bb, 0xfee6dad9, 0x11b46c38, 0xc9689448, 0x263a22a9, 0xccbcffcb, 0x23ee492a, 0xc2c0434e, 0x2d92f5af, 0xc71428cd, 0x28469e2c, 0xde393a44, 0x316b8ca5, 0xdbed51c7, 0x34bfe726, 0xd591ed42, 0x3ac35ba3, 0xd04586c1, 0x3f173020, 0xae6be681, 0x41395060, 0xabbf8d02, 0x44ed3be3, 0xa5c33187, 0x4a918766, 0xa0175a04, 0x4f45ece5, 0xb93a488d, 0x5668fe6c, 0xbcee230e, 0x53bc95ef, 0xb2929f8b, 0x5dc0296a, 0xb746f408, 0x581442e9, 0x80c8ba99, 0x6f9a0c78, 0x851cd11a, 0x6a4e67fb, 0x8b606d9f, 0x6432db7e, 0x8eb4061c, 0x61e6b0fd, 0x97991495, 0x78cba274, 0x924d7f16, 0x7d1fc9f7, 0x9c31c393, 0x73637572, 0x99e5a810, 0x76b71ef1, 0xf32d5eb1, 0x1c7fe850, 0xf6f93532, 0x19ab83d3, 0xf88589b7, 0x17d73f56, 0xfd51e234, 0x120354d5, 0xe47cf0bd, 0x0b2e465c, 0xe1a89b3e, 0x0efa2ddf, 0xefd427bb, 0x0086915a, 0xea004c38, 0x0552fad9, 0xdd8e02a9, 0x32dcb448, 0xd85a692a, 0x3708dfcb, 0xd626d5af, 0x3974634e, 0xd3f2be2c, 0x3ca008cd, 0xcadfaca5, 0x258d1a44, 0xcf0bc726, 0x205971c7, 0xc1777ba3, 0x2e25cd42, 0xc4a31020, 0x2bf1a6c1, 0x14e696e1, 0xfbb42000, 0x1132fd62, 0xfe604b83, 0x1f4e41e7, 0xf01cf706, 0x1a9a2a64, 0xf5c89c85, 0x03b738ed, 0xece58e0c, 0x0663536e, 0xe931e58f, 0x081fefeb, 0xe74d590a, 0x0dcb8468, 0xe2993289, 0x3a45caf9, 0xd5177c18, 0x3f91a17a, 0xd0c3179b, 0x31ed1dff, 0xdebfab1e, 0x3439767c, 0xdb6bc09d, 0x2d1464f5, 0xc246d214, 0x28c00f76, 0xc792b997, 0x26bcb3f3, 0xc9ee0512, 0x2368d870, 0xcc3a6e91, 0x49a02ed1, 0xa6f29830, 0x4c744552, 0xa326f3b3, 0x4208f9d7, 0xad5a4f36, 0x47dc9254, 0xa88e24b5, 0x5ef180dd, 0xb1a3363c, 0x5b25eb5e, 0xb4775dbf, 0x555957db, 0xba0be13a, 0x508d3c58, 0xbfdf8ab9, 0x670372c9, 0x8851c428, 0x62d7194a, 0x8d85afab, 0x6caba5cf, 0x83f9132e, 0x697fce4c, 0x862d78ad, 0x7052dcc5, 0x9f006a24, 0x7586b746, 0x9ad401a7, 0x7bfa0bc3, 0x94a8bd22, 0x7e2e6040, 0x917cd6a1}, {0x00000000, 0x87a6cb43, 0xd43c90c7, 0x539a5b84, 0x730827cf, 0xf4aeec8c, 0xa734b708, 0x20927c4b, 0xe6104f9e, 0x61b684dd, 0x322cdf59, 0xb58a141a, 0x95186851, 0x12bea312, 0x4124f896, 0xc68233d5, 0x1751997d, 0x90f7523e, 0xc36d09ba, 0x44cbc2f9, 0x6459beb2, 0xe3ff75f1, 0xb0652e75, 0x37c3e536, 0xf141d6e3, 0x76e71da0, 0x257d4624, 0xa2db8d67, 0x8249f12c, 0x05ef3a6f, 0x567561eb, 0xd1d3aaa8, 0x2ea332fa, 0xa905f9b9, 0xfa9fa23d, 0x7d39697e, 0x5dab1535, 0xda0dde76, 0x899785f2, 0x0e314eb1, 0xc8b37d64, 0x4f15b627, 0x1c8feda3, 0x9b2926e0, 0xbbbb5aab, 0x3c1d91e8, 0x6f87ca6c, 0xe821012f, 0x39f2ab87, 0xbe5460c4, 0xedce3b40, 0x6a68f003, 0x4afa8c48, 0xcd5c470b, 0x9ec61c8f, 0x1960d7cc, 0xdfe2e419, 0x58442f5a, 0x0bde74de, 0x8c78bf9d, 0xaceac3d6, 0x2b4c0895, 0x78d65311, 0xff709852, 0x5d4665f4, 0xdae0aeb7, 0x897af533, 0x0edc3e70, 0x2e4e423b, 0xa9e88978, 0xfa72d2fc, 0x7dd419bf, 0xbb562a6a, 0x3cf0e129, 0x6f6abaad, 0xe8cc71ee, 0xc85e0da5, 0x4ff8c6e6, 0x1c629d62, 0x9bc45621, 0x4a17fc89, 0xcdb137ca, 0x9e2b6c4e, 0x198da70d, 0x391fdb46, 0xbeb91005, 0xed234b81, 0x6a8580c2, 0xac07b317, 0x2ba17854, 0x783b23d0, 0xff9de893, 0xdf0f94d8, 0x58a95f9b, 0x0b33041f, 0x8c95cf5c, 0x73e5570e, 0xf4439c4d, 0xa7d9c7c9, 0x207f0c8a, 0x00ed70c1, 0x874bbb82, 0xd4d1e006, 0x53772b45, 0x95f51890, 0x1253d3d3, 0x41c98857, 0xc66f4314, 0xe6fd3f5f, 0x615bf41c, 0x32c1af98, 0xb56764db, 0x64b4ce73, 0xe3120530, 0xb0885eb4, 0x372e95f7, 0x17bce9bc, 0x901a22ff, 0xc380797b, 0x4426b238, 0x82a481ed, 0x05024aae, 0x5698112a, 0xd13eda69, 0xf1aca622, 0x760a6d61, 0x259036e5, 0xa236fda6, 0xba8ccbe8, 0x3d2a00ab, 0x6eb05b2f, 0xe916906c, 0xc984ec27, 0x4e222764, 0x1db87ce0, 0x9a1eb7a3, 0x5c9c8476, 0xdb3a4f35, 0x88a014b1, 0x0f06dff2, 0x2f94a3b9, 0xa83268fa, 0xfba8337e, 0x7c0ef83d, 0xaddd5295, 0x2a7b99d6, 0x79e1c252, 0xfe470911, 0xded5755a, 0x5973be19, 0x0ae9e59d, 0x8d4f2ede, 0x4bcd1d0b, 0xcc6bd648, 0x9ff18dcc, 0x1857468f, 0x38c53ac4, 0xbf63f187, 0xecf9aa03, 0x6b5f6140, 0x942ff912, 0x13893251, 0x401369d5, 0xc7b5a296, 0xe727dedd, 0x6081159e, 0x331b4e1a, 0xb4bd8559, 0x723fb68c, 0xf5997dcf, 0xa603264b, 0x21a5ed08, 0x01379143, 0x86915a00, 0xd50b0184, 0x52adcac7, 0x837e606f, 0x04d8ab2c, 0x5742f0a8, 0xd0e43beb, 0xf07647a0, 0x77d08ce3, 0x244ad767, 0xa3ec1c24, 0x656e2ff1, 0xe2c8e4b2, 0xb152bf36, 0x36f47475, 0x1666083e, 0x91c0c37d, 0xc25a98f9, 0x45fc53ba, 0xe7caae1c, 0x606c655f, 0x33f63edb, 0xb450f598, 0x94c289d3, 0x13644290, 0x40fe1914, 0xc758d257, 0x01dae182, 0x867c2ac1, 0xd5e67145, 0x5240ba06, 0x72d2c64d, 0xf5740d0e, 0xa6ee568a, 0x21489dc9, 0xf09b3761, 0x773dfc22, 0x24a7a7a6, 0xa3016ce5, 0x839310ae, 0x0435dbed, 0x57af8069, 0xd0094b2a, 0x168b78ff, 0x912db3bc, 0xc2b7e838, 0x4511237b, 0x65835f30, 0xe2259473, 0xb1bfcff7, 0x361904b4, 0xc9699ce6, 0x4ecf57a5, 0x1d550c21, 0x9af3c762, 0xba61bb29, 0x3dc7706a, 0x6e5d2bee, 0xe9fbe0ad, 0x2f79d378, 0xa8df183b, 0xfb4543bf, 0x7ce388fc, 0x5c71f4b7, 0xdbd73ff4, 0x884d6470, 0x0febaf33, 0xde38059b, 0x599eced8, 0x0a04955c, 0x8da25e1f, 0xad302254, 0x2a96e917, 0x790cb293, 0xfeaa79d0, 0x38284a05, 0xbf8e8146, 0xec14dac2, 0x6bb21181, 0x4b206dca, 0xcc86a689, 0x9f1cfd0d, 0x18ba364e}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x00000000, 0x43cba687, 0xc7903cd4, 0x845b9a53, 0xcf270873, 0x8cecaef4, 0x08b734a7, 0x4b7c9220, 0x9e4f10e6, 0xdd84b661, 0x59df2c32, 0x1a148ab5, 0x51681895, 0x12a3be12, 0x96f82441, 0xd53382c6, 0x7d995117, 0x3e52f790, 0xba096dc3, 0xf9c2cb44, 0xb2be5964, 0xf175ffe3, 0x752e65b0, 0x36e5c337, 0xe3d641f1, 0xa01de776, 0x24467d25, 0x678ddba2, 0x2cf14982, 0x6f3aef05, 0xeb617556, 0xa8aad3d1, 0xfa32a32e, 0xb9f905a9, 0x3da29ffa, 0x7e69397d, 0x3515ab5d, 0x76de0dda, 0xf2859789, 0xb14e310e, 0x647db3c8, 0x27b6154f, 0xa3ed8f1c, 0xe026299b, 0xab5abbbb, 0xe8911d3c, 0x6cca876f, 0x2f0121e8, 0x87abf239, 0xc46054be, 0x403bceed, 0x03f0686a, 0x488cfa4a, 0x0b475ccd, 0x8f1cc69e, 0xccd76019, 0x19e4e2df, 0x5a2f4458, 0xde74de0b, 0x9dbf788c, 0xd6c3eaac, 0x95084c2b, 0x1153d678, 0x529870ff, 0xf465465d, 0xb7aee0da, 0x33f57a89, 0x703edc0e, 0x3b424e2e, 0x7889e8a9, 0xfcd272fa, 0xbf19d47d, 0x6a2a56bb, 0x29e1f03c, 0xadba6a6f, 0xee71cce8, 0xa50d5ec8, 0xe6c6f84f, 0x629d621c, 0x2156c49b, 0x89fc174a, 0xca37b1cd, 0x4e6c2b9e, 0x0da78d19, 0x46db1f39, 0x0510b9be, 0x814b23ed, 0xc280856a, 0x17b307ac, 0x5478a12b, 0xd0233b78, 0x93e89dff, 0xd8940fdf, 0x9b5fa958, 0x1f04330b, 0x5ccf958c, 0x0e57e573, 0x4d9c43f4, 0xc9c7d9a7, 0x8a0c7f20, 0xc170ed00, 0x82bb4b87, 0x06e0d1d4, 0x452b7753, 0x9018f595, 0xd3d35312, 0x5788c941, 0x14436fc6, 0x5f3ffde6, 0x1cf45b61, 0x98afc132, 0xdb6467b5, 0x73ceb464, 0x300512e3, 0xb45e88b0, 0xf7952e37, 0xbce9bc17, 0xff221a90, 0x7b7980c3, 0x38b22644, 0xed81a482, 0xae4a0205, 0x2a119856, 0x69da3ed1, 0x22a6acf1, 0x616d0a76, 0xe5369025, 0xa6fd36a2, 0xe8cb8cba, 0xab002a3d, 0x2f5bb06e, 0x6c9016e9, 0x27ec84c9, 0x6427224e, 0xe07cb81d, 0xa3b71e9a, 0x76849c5c, 0x354f3adb, 0xb114a088, 0xf2df060f, 0xb9a3942f, 0xfa6832a8, 0x7e33a8fb, 0x3df80e7c, 0x9552ddad, 0xd6997b2a, 0x52c2e179, 0x110947fe, 0x5a75d5de, 0x19be7359, 0x9de5e90a, 0xde2e4f8d, 0x0b1dcd4b, 0x48d66bcc, 0xcc8df19f, 0x8f465718, 0xc43ac538, 0x87f163bf, 0x03aaf9ec, 0x40615f6b, 0x12f92f94, 0x51328913, 0xd5691340, 0x96a2b5c7, 0xddde27e7, 0x9e158160, 0x1a4e1b33, 0x5985bdb4, 0x8cb63f72, 0xcf7d99f5, 0x4b2603a6, 0x08eda521, 0x43913701, 0x005a9186, 0x84010bd5, 0xc7caad52, 0x6f607e83, 0x2cabd804, 0xa8f04257, 0xeb3be4d0, 0xa04776f0, 0xe38cd077, 0x67d74a24, 0x241ceca3, 0xf12f6e65, 0xb2e4c8e2, 0x36bf52b1, 0x7574f436, 0x3e086616, 0x7dc3c091, 0xf9985ac2, 0xba53fc45, 0x1caecae7, 0x5f656c60, 0xdb3ef633, 0x98f550b4, 0xd389c294, 0x90426413, 0x1419fe40, 0x57d258c7, 0x82e1da01, 0xc12a7c86, 0x4571e6d5, 0x06ba4052, 0x4dc6d272, 0x0e0d74f5, 0x8a56eea6, 0xc99d4821, 0x61379bf0, 0x22fc3d77, 0xa6a7a724, 0xe56c01a3, 0xae109383, 0xeddb3504, 0x6980af57, 0x2a4b09d0, 0xff788b16, 0xbcb32d91, 0x38e8b7c2, 0x7b231145, 0x305f8365, 0x739425e2, 0xf7cfbfb1, 0xb4041936, 0xe69c69c9, 0xa557cf4e, 0x210c551d, 0x62c7f39a, 0x29bb61ba, 0x6a70c73d, 0xee2b5d6e, 0xade0fbe9, 0x78d3792f, 0x3b18dfa8, 0xbf4345fb, 0xfc88e37c, 0xb7f4715c, 0xf43fd7db, 0x70644d88, 0x33afeb0f, 0x9b0538de, 0xd8ce9e59, 0x5c95040a, 0x1f5ea28d, 0x542230ad, 0x17e9962a, 0x93b20c79, 0xd079aafe, 0x054a2838, 0x46818ebf, 0xc2da14ec, 0x8111b26b, 0xca6d204b, 0x89a686cc, 0x0dfd1c9f, 0x4e36ba18}, {0x00000000, 0xe1b652ef, 0x836bd405, 0x62dd86ea, 0x06d7a80b, 0xe761fae4, 0x85bc7c0e, 0x640a2ee1, 0x0cae5117, 0xed1803f8, 0x8fc58512, 0x6e73d7fd, 0x0a79f91c, 0xebcfabf3, 0x89122d19, 0x68a47ff6, 0x185ca32e, 0xf9eaf1c1, 0x9b37772b, 0x7a8125c4, 0x1e8b0b25, 0xff3d59ca, 0x9de0df20, 0x7c568dcf, 0x14f2f239, 0xf544a0d6, 0x9799263c, 0x762f74d3, 0x12255a32, 0xf39308dd, 0x914e8e37, 0x70f8dcd8, 0x30b8465d, 0xd10e14b2, 0xb3d39258, 0x5265c0b7, 0x366fee56, 0xd7d9bcb9, 0xb5043a53, 0x54b268bc, 0x3c16174a, 0xdda045a5, 0xbf7dc34f, 0x5ecb91a0, 0x3ac1bf41, 0xdb77edae, 0xb9aa6b44, 0x581c39ab, 0x28e4e573, 0xc952b79c, 0xab8f3176, 0x4a396399, 0x2e334d78, 0xcf851f97, 0xad58997d, 0x4ceecb92, 0x244ab464, 0xc5fce68b, 0xa7216061, 0x4697328e, 0x229d1c6f, 0xc32b4e80, 0xa1f6c86a, 0x40409a85, 0x60708dba, 0x81c6df55, 0xe31b59bf, 0x02ad0b50, 0x66a725b1, 0x8711775e, 0xe5ccf1b4, 0x047aa35b, 0x6cdedcad, 0x8d688e42, 0xefb508a8, 0x0e035a47, 0x6a0974a6, 0x8bbf2649, 0xe962a0a3, 0x08d4f24c, 0x782c2e94, 0x999a7c7b, 0xfb47fa91, 0x1af1a87e, 0x7efb869f, 0x9f4dd470, 0xfd90529a, 0x1c260075, 0x74827f83, 0x95342d6c, 0xf7e9ab86, 0x165ff969, 0x7255d788, 0x93e38567, 0xf13e038d, 0x10885162, 0x50c8cbe7, 0xb17e9908, 0xd3a31fe2, 0x32154d0d, 0x561f63ec, 0xb7a93103, 0xd574b7e9, 0x34c2e506, 0x5c669af0, 0xbdd0c81f, 0xdf0d4ef5, 0x3ebb1c1a, 0x5ab132fb, 0xbb076014, 0xd9dae6fe, 0x386cb411, 0x489468c9, 0xa9223a26, 0xcbffbccc, 0x2a49ee23, 0x4e43c0c2, 0xaff5922d, 0xcd2814c7, 0x2c9e4628, 0x443a39de, 0xa58c6b31, 0xc751eddb, 0x26e7bf34, 0x42ed91d5, 0xa35bc33a, 0xc18645d0, 0x2030173f, 0x81e66bae, 0x60503941, 0x028dbfab, 0xe33bed44, 0x8731c3a5, 0x6687914a, 0x045a17a0, 0xe5ec454f, 0x8d483ab9, 0x6cfe6856, 0x0e23eebc, 0xef95bc53, 0x8b9f92b2, 0x6a29c05d, 0x08f446b7, 0xe9421458, 0x99bac880, 0x780c9a6f, 0x1ad11c85, 0xfb674e6a, 0x9f6d608b, 0x7edb3264, 0x1c06b48e, 0xfdb0e661, 0x95149997, 0x74a2cb78, 0x167f4d92, 0xf7c91f7d, 0x93c3319c, 0x72756373, 0x10a8e599, 0xf11eb776, 0xb15e2df3, 0x50e87f1c, 0x3235f9f6, 0xd383ab19, 0xb78985f8, 0x563fd717, 0x34e251fd, 0xd5540312, 0xbdf07ce4, 0x5c462e0b, 0x3e9ba8e1, 0xdf2dfa0e, 0xbb27d4ef, 0x5a918600, 0x384c00ea, 0xd9fa5205, 0xa9028edd, 0x48b4dc32, 0x2a695ad8, 0xcbdf0837, 0xafd526d6, 0x4e637439, 0x2cbef2d3, 0xcd08a03c, 0xa5acdfca, 0x441a8d25, 0x26c70bcf, 0xc7715920, 0xa37b77c1, 0x42cd252e, 0x2010a3c4, 0xc1a6f12b, 0xe196e614, 0x0020b4fb, 0x62fd3211, 0x834b60fe, 0xe7414e1f, 0x06f71cf0, 0x642a9a1a, 0x859cc8f5, 0xed38b703, 0x0c8ee5ec, 0x6e536306, 0x8fe531e9, 0xebef1f08, 0x0a594de7, 0x6884cb0d, 0x893299e2, 0xf9ca453a, 0x187c17d5, 0x7aa1913f, 0x9b17c3d0, 0xff1ded31, 0x1eabbfde, 0x7c763934, 0x9dc06bdb, 0xf564142d, 0x14d246c2, 0x760fc028, 0x97b992c7, 0xf3b3bc26, 0x1205eec9, 0x70d86823, 0x916e3acc, 0xd12ea049, 0x3098f2a6, 0x5245744c, 0xb3f326a3, 0xd7f90842, 0x364f5aad, 0x5492dc47, 0xb5248ea8, 0xdd80f15e, 0x3c36a3b1, 0x5eeb255b, 0xbf5d77b4, 0xdb575955, 0x3ae10bba, 0x583c8d50, 0xb98adfbf, 0xc9720367, 0x28c45188, 0x4a19d762, 0xabaf858d, 0xcfa5ab6c, 0x2e13f983, 0x4cce7f69, 0xad782d86, 0xc5dc5270, 0x246a009f, 0x46b78675, 0xa701d49a, 0xc30bfa7b, 0x22bda894, 0x40602e7e, 0xa1d67c91}, {0x00000000, 0x5880e2d7, 0xf106b474, 0xa98656a3, 0xe20d68e9, 0xba8d8a3e, 0x130bdc9d, 0x4b8b3e4a, 0x851da109, 0xdd9d43de, 0x741b157d, 0x2c9bf7aa, 0x6710c9e0, 0x3f902b37, 0x96167d94, 0xce969f43, 0x0a3b4213, 0x52bba0c4, 0xfb3df667, 0xa3bd14b0, 0xe8362afa, 0xb0b6c82d, 0x19309e8e, 0x41b07c59, 0x8f26e31a, 0xd7a601cd, 0x7e20576e, 0x26a0b5b9, 0x6d2b8bf3, 0x35ab6924, 0x9c2d3f87, 0xc4addd50, 0x14768426, 0x4cf666f1, 0xe5703052, 0xbdf0d285, 0xf67beccf, 0xaefb0e18, 0x077d58bb, 0x5ffdba6c, 0x916b252f, 0xc9ebc7f8, 0x606d915b, 0x38ed738c, 0x73664dc6, 0x2be6af11, 0x8260f9b2, 0xdae01b65, 0x1e4dc635, 0x46cd24e2, 0xef4b7241, 0xb7cb9096, 0xfc40aedc, 0xa4c04c0b, 0x0d461aa8, 0x55c6f87f, 0x9b50673c, 0xc3d085eb, 0x6a56d348, 0x32d6319f, 0x795d0fd5, 0x21dded02, 0x885bbba1, 0xd0db5976, 0x28ec084d, 0x706cea9a, 0xd9eabc39, 0x816a5eee, 0xcae160a4, 0x92618273, 0x3be7d4d0, 0x63673607, 0xadf1a944, 0xf5714b93, 0x5cf71d30, 0x0477ffe7, 0x4ffcc1ad, 0x177c237a, 0xbefa75d9, 0xe67a970e, 0x22d74a5e, 0x7a57a889, 0xd3d1fe2a, 0x8b511cfd, 0xc0da22b7, 0x985ac060, 0x31dc96c3, 0x695c7414, 0xa7caeb57, 0xff4a0980, 0x56cc5f23, 0x0e4cbdf4, 0x45c783be, 0x1d476169, 0xb4c137ca, 0xec41d51d, 0x3c9a8c6b, 0x641a6ebc, 0xcd9c381f, 0x951cdac8, 0xde97e482, 0x86170655, 0x2f9150f6, 0x7711b221, 0xb9872d62, 0xe107cfb5, 0x48819916, 0x10017bc1, 0x5b8a458b, 0x030aa75c, 0xaa8cf1ff, 0xf20c1328, 0x36a1ce78, 0x6e212caf, 0xc7a77a0c, 0x9f2798db, 0xd4aca691, 0x8c2c4446, 0x25aa12e5, 0x7d2af032, 0xb3bc6f71, 0xeb3c8da6, 0x42badb05, 0x1a3a39d2, 0x51b10798, 0x0931e54f, 0xa0b7b3ec, 0xf837513b, 0x50d8119a, 0x0858f34d, 0xa1dea5ee, 0xf95e4739, 0xb2d57973, 0xea559ba4, 0x43d3cd07, 0x1b532fd0, 0xd5c5b093, 0x8d455244, 0x24c304e7, 0x7c43e630, 0x37c8d87a, 0x6f483aad, 0xc6ce6c0e, 0x9e4e8ed9, 0x5ae35389, 0x0263b15e, 0xabe5e7fd, 0xf365052a, 0xb8ee3b60, 0xe06ed9b7, 0x49e88f14, 0x11686dc3, 0xdffef280, 0x877e1057, 0x2ef846f4, 0x7678a423, 0x3df39a69, 0x657378be, 0xccf52e1d, 0x9475ccca, 0x44ae95bc, 0x1c2e776b, 0xb5a821c8, 0xed28c31f, 0xa6a3fd55, 0xfe231f82, 0x57a54921, 0x0f25abf6, 0xc1b334b5, 0x9933d662, 0x30b580c1, 0x68356216, 0x23be5c5c, 0x7b3ebe8b, 0xd2b8e828, 0x8a380aff, 0x4e95d7af, 0x16153578, 0xbf9363db, 0xe713810c, 0xac98bf46, 0xf4185d91, 0x5d9e0b32, 0x051ee9e5, 0xcb8876a6, 0x93089471, 0x3a8ec2d2, 0x620e2005, 0x29851e4f, 0x7105fc98, 0xd883aa3b, 0x800348ec, 0x783419d7, 0x20b4fb00, 0x8932ada3, 0xd1b24f74, 0x9a39713e, 0xc2b993e9, 0x6b3fc54a, 0x33bf279d, 0xfd29b8de, 0xa5a95a09, 0x0c2f0caa, 0x54afee7d, 0x1f24d037, 0x47a432e0, 0xee226443, 0xb6a28694, 0x720f5bc4, 0x2a8fb913, 0x8309efb0, 0xdb890d67, 0x9002332d, 0xc882d1fa, 0x61048759, 0x3984658e, 0xf712facd, 0xaf92181a, 0x06144eb9, 0x5e94ac6e, 0x151f9224, 0x4d9f70f3, 0xe4192650, 0xbc99c487, 0x6c429df1, 0x34c27f26, 0x9d442985, 0xc5c4cb52, 0x8e4ff518, 0xd6cf17cf, 0x7f49416c, 0x27c9a3bb, 0xe95f3cf8, 0xb1dfde2f, 0x1859888c, 0x40d96a5b, 0x0b525411, 0x53d2b6c6, 0xfa54e065, 0xa2d402b2, 0x6679dfe2, 0x3ef93d35, 0x977f6b96, 0xcfff8941, 0x8474b70b, 0xdcf455dc, 0x7572037f, 0x2df2e1a8, 0xe3647eeb, 0xbbe49c3c, 0x1262ca9f, 0x4ae22848, 0x01691602, 0x59e9f4d5, 0xf06fa276, 0xa8ef40a1}, {0x00000000, 0x463b6765, 0x8c76ceca, 0xca4da9af, 0x59ebed4e, 0x1fd08a2b, 0xd59d2384, 0x93a644e1, 0xb2d6db9d, 0xf4edbcf8, 0x3ea01557, 0x789b7232, 0xeb3d36d3, 0xad0651b6, 0x674bf819, 0x21709f7c, 0x25abc6e0, 0x6390a185, 0xa9dd082a, 0xefe66f4f, 0x7c402bae, 0x3a7b4ccb, 0xf036e564, 0xb60d8201, 0x977d1d7d, 0xd1467a18, 0x1b0bd3b7, 0x5d30b4d2, 0xce96f033, 0x88ad9756, 0x42e03ef9, 0x04db599c, 0x0b50fc1a, 0x4d6b9b7f, 0x872632d0, 0xc11d55b5, 0x52bb1154, 0x14807631, 0xdecddf9e, 0x98f6b8fb, 0xb9862787, 0xffbd40e2, 0x35f0e94d, 0x73cb8e28, 0xe06dcac9, 0xa656adac, 0x6c1b0403, 0x2a206366, 0x2efb3afa, 0x68c05d9f, 0xa28df430, 0xe4b69355, 0x7710d7b4, 0x312bb0d1, 0xfb66197e, 0xbd5d7e1b, 0x9c2de167, 0xda168602, 0x105b2fad, 0x566048c8, 0xc5c60c29, 0x83fd6b4c, 0x49b0c2e3, 0x0f8ba586, 0x16a0f835, 0x509b9f50, 0x9ad636ff, 0xdced519a, 0x4f4b157b, 0x0970721e, 0xc33ddbb1, 0x8506bcd4, 0xa47623a8, 0xe24d44cd, 0x2800ed62, 0x6e3b8a07, 0xfd9dcee6, 0xbba6a983, 0x71eb002c, 0x37d06749, 0x330b3ed5, 0x753059b0, 0xbf7df01f, 0xf946977a, 0x6ae0d39b, 0x2cdbb4fe, 0xe6961d51, 0xa0ad7a34, 0x81dde548, 0xc7e6822d, 0x0dab2b82, 0x4b904ce7, 0xd8360806, 0x9e0d6f63, 0x5440c6cc, 0x127ba1a9, 0x1df0042f, 0x5bcb634a, 0x9186cae5, 0xd7bdad80, 0x441be961, 0x02208e04, 0xc86d27ab, 0x8e5640ce, 0xaf26dfb2, 0xe91db8d7, 0x23501178, 0x656b761d, 0xf6cd32fc, 0xb0f65599, 0x7abbfc36, 0x3c809b53, 0x385bc2cf, 0x7e60a5aa, 0xb42d0c05, 0xf2166b60, 0x61b02f81, 0x278b48e4, 0xedc6e14b, 0xabfd862e, 0x8a8d1952, 0xccb67e37, 0x06fbd798, 0x40c0b0fd, 0xd366f41c, 0x955d9379, 0x5f103ad6, 0x192b5db3, 0x2c40f16b, 0x6a7b960e, 0xa0363fa1, 0xe60d58c4, 0x75ab1c25, 0x33907b40, 0xf9ddd2ef, 0xbfe6b58a, 0x9e962af6, 0xd8ad4d93, 0x12e0e43c, 0x54db8359, 0xc77dc7b8, 0x8146a0dd, 0x4b0b0972, 0x0d306e17, 0x09eb378b, 0x4fd050ee, 0x859df941, 0xc3a69e24, 0x5000dac5, 0x163bbda0, 0xdc76140f, 0x9a4d736a, 0xbb3dec16, 0xfd068b73, 0x374b22dc, 0x717045b9, 0xe2d60158, 0xa4ed663d, 0x6ea0cf92, 0x289ba8f7, 0x27100d71, 0x612b6a14, 0xab66c3bb, 0xed5da4de, 0x7efbe03f, 0x38c0875a, 0xf28d2ef5, 0xb4b64990, 0x95c6d6ec, 0xd3fdb189, 0x19b01826, 0x5f8b7f43, 0xcc2d3ba2, 0x8a165cc7, 0x405bf568, 0x0660920d, 0x02bbcb91, 0x4480acf4, 0x8ecd055b, 0xc8f6623e, 0x5b5026df, 0x1d6b41ba, 0xd726e815, 0x911d8f70, 0xb06d100c, 0xf6567769, 0x3c1bdec6, 0x7a20b9a3, 0xe986fd42, 0xafbd9a27, 0x65f03388, 0x23cb54ed, 0x3ae0095e, 0x7cdb6e3b, 0xb696c794, 0xf0ada0f1, 0x630be410, 0x25308375, 0xef7d2ada, 0xa9464dbf, 0x8836d2c3, 0xce0db5a6, 0x04401c09, 0x427b7b6c, 0xd1dd3f8d, 0x97e658e8, 0x5dabf147, 0x1b909622, 0x1f4bcfbe, 0x5970a8db, 0x933d0174, 0xd5066611, 0x46a022f0, 0x009b4595, 0xcad6ec3a, 0x8ced8b5f, 0xad9d1423, 0xeba67346, 0x21ebdae9, 0x67d0bd8c, 0xf476f96d, 0xb24d9e08, 0x780037a7, 0x3e3b50c2, 0x31b0f544, 0x778b9221, 0xbdc63b8e, 0xfbfd5ceb, 0x685b180a, 0x2e607f6f, 0xe42dd6c0, 0xa216b1a5, 0x83662ed9, 0xc55d49bc, 0x0f10e013, 0x492b8776, 0xda8dc397, 0x9cb6a4f2, 0x56fb0d5d, 0x10c06a38, 0x141b33a4, 0x522054c1, 0x986dfd6e, 0xde569a0b, 0x4df0deea, 0x0bcbb98f, 0xc1861020, 0x87bd7745, 0xa6cde839, 0xe0f68f5c, 0x2abb26f3, 0x6c804196, 0xff260577, 0xb91d6212, 0x7350cbbd, 0x356bacd8}}; #endif #endif #if N == 6 #if W == 8 local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0x3db1ecdc, 0x7b63d9b8, 0x46d23564, 0xf6c7b370, 0xcb765fac, 0x8da46ac8, 0xb0158614, 0x36fe60a1, 0x0b4f8c7d, 0x4d9db919, 0x702c55c5, 0xc039d3d1, 0xfd883f0d, 0xbb5a0a69, 0x86ebe6b5, 0x6dfcc142, 0x504d2d9e, 0x169f18fa, 0x2b2ef426, 0x9b3b7232, 0xa68a9eee, 0xe058ab8a, 0xdde94756, 0x5b02a1e3, 0x66b34d3f, 0x2061785b, 0x1dd09487, 0xadc51293, 0x9074fe4f, 0xd6a6cb2b, 0xeb1727f7, 0xdbf98284, 0xe6486e58, 0xa09a5b3c, 0x9d2bb7e0, 0x2d3e31f4, 0x108fdd28, 0x565de84c, 0x6bec0490, 0xed07e225, 0xd0b60ef9, 0x96643b9d, 0xabd5d741, 0x1bc05155, 0x2671bd89, 0x60a388ed, 0x5d126431, 0xb60543c6, 0x8bb4af1a, 0xcd669a7e, 0xf0d776a2, 0x40c2f0b6, 0x7d731c6a, 0x3ba1290e, 0x0610c5d2, 0x80fb2367, 0xbd4acfbb, 0xfb98fadf, 0xc6291603, 0x763c9017, 0x4b8d7ccb, 0x0d5f49af, 0x30eea573, 0x6c820349, 0x5133ef95, 0x17e1daf1, 0x2a50362d, 0x9a45b039, 0xa7f45ce5, 0xe1266981, 0xdc97855d, 0x5a7c63e8, 0x67cd8f34, 0x211fba50, 0x1cae568c, 0xacbbd098, 0x910a3c44, 0xd7d80920, 0xea69e5fc, 0x017ec20b, 0x3ccf2ed7, 0x7a1d1bb3, 0x47acf76f, 0xf7b9717b, 0xca089da7, 0x8cdaa8c3, 0xb16b441f, 0x3780a2aa, 0x0a314e76, 0x4ce37b12, 0x715297ce, 0xc14711da, 0xfcf6fd06, 0xba24c862, 0x879524be, 0xb77b81cd, 0x8aca6d11, 0xcc185875, 0xf1a9b4a9, 0x41bc32bd, 0x7c0dde61, 0x3adfeb05, 0x076e07d9, 0x8185e16c, 0xbc340db0, 0xfae638d4, 0xc757d408, 0x7742521c, 0x4af3bec0, 0x0c218ba4, 0x31906778, 0xda87408f, 0xe736ac53, 0xa1e49937, 0x9c5575eb, 0x2c40f3ff, 0x11f11f23, 0x57232a47, 0x6a92c69b, 0xec79202e, 0xd1c8ccf2, 0x971af996, 0xaaab154a, 0x1abe935e, 0x270f7f82, 0x61dd4ae6, 0x5c6ca63a, 0xd9040692, 0xe4b5ea4e, 0xa267df2a, 0x9fd633f6, 0x2fc3b5e2, 0x1272593e, 0x54a06c5a, 0x69118086, 0xeffa6633, 0xd24b8aef, 0x9499bf8b, 0xa9285357, 0x193dd543, 0x248c399f, 0x625e0cfb, 0x5fefe027, 0xb4f8c7d0, 0x89492b0c, 0xcf9b1e68, 0xf22af2b4, 0x423f74a0, 0x7f8e987c, 0x395cad18, 0x04ed41c4, 0x8206a771, 0xbfb74bad, 0xf9657ec9, 0xc4d49215, 0x74c11401, 0x4970f8dd, 0x0fa2cdb9, 0x32132165, 0x02fd8416, 0x3f4c68ca, 0x799e5dae, 0x442fb172, 0xf43a3766, 0xc98bdbba, 0x8f59eede, 0xb2e80202, 0x3403e4b7, 0x09b2086b, 0x4f603d0f, 0x72d1d1d3, 0xc2c457c7, 0xff75bb1b, 0xb9a78e7f, 0x841662a3, 0x6f014554, 0x52b0a988, 0x14629cec, 0x29d37030, 0x99c6f624, 0xa4771af8, 0xe2a52f9c, 0xdf14c340, 0x59ff25f5, 0x644ec929, 0x229cfc4d, 0x1f2d1091, 0xaf389685, 0x92897a59, 0xd45b4f3d, 0xe9eaa3e1, 0xb58605db, 0x8837e907, 0xcee5dc63, 0xf35430bf, 0x4341b6ab, 0x7ef05a77, 0x38226f13, 0x059383cf, 0x8378657a, 0xbec989a6, 0xf81bbcc2, 0xc5aa501e, 0x75bfd60a, 0x480e3ad6, 0x0edc0fb2, 0x336de36e, 0xd87ac499, 0xe5cb2845, 0xa3191d21, 0x9ea8f1fd, 0x2ebd77e9, 0x130c9b35, 0x55deae51, 0x686f428d, 0xee84a438, 0xd33548e4, 0x95e77d80, 0xa856915c, 0x18431748, 0x25f2fb94, 0x6320cef0, 0x5e91222c, 0x6e7f875f, 0x53ce6b83, 0x151c5ee7, 0x28adb23b, 0x98b8342f, 0xa509d8f3, 0xe3dbed97, 0xde6a014b, 0x5881e7fe, 0x65300b22, 0x23e23e46, 0x1e53d29a, 0xae46548e, 0x93f7b852, 0xd5258d36, 0xe89461ea, 0x0383461d, 0x3e32aac1, 0x78e09fa5, 0x45517379, 0xf544f56d, 0xc8f519b1, 0x8e272cd5, 0xb396c009, 0x357d26bc, 0x08ccca60, 0x4e1eff04, 0x73af13d8, 0xc3ba95cc, 0xfe0b7910, 0xb8d94c74, 0x8568a0a8}, {0x00000000, 0x69790b65, 0xd2f216ca, 0xbb8b1daf, 0x7e952bd5, 0x17ec20b0, 0xac673d1f, 0xc51e367a, 0xfd2a57aa, 0x94535ccf, 0x2fd84160, 0x46a14a05, 0x83bf7c7f, 0xeac6771a, 0x514d6ab5, 0x383461d0, 0x2125a915, 0x485ca270, 0xf3d7bfdf, 0x9aaeb4ba, 0x5fb082c0, 0x36c989a5, 0x8d42940a, 0xe43b9f6f, 0xdc0ffebf, 0xb576f5da, 0x0efde875, 0x6784e310, 0xa29ad56a, 0xcbe3de0f, 0x7068c3a0, 0x1911c8c5, 0x424b522a, 0x2b32594f, 0x90b944e0, 0xf9c04f85, 0x3cde79ff, 0x55a7729a, 0xee2c6f35, 0x87556450, 0xbf610580, 0xd6180ee5, 0x6d93134a, 0x04ea182f, 0xc1f42e55, 0xa88d2530, 0x1306389f, 0x7a7f33fa, 0x636efb3f, 0x0a17f05a, 0xb19cedf5, 0xd8e5e690, 0x1dfbd0ea, 0x7482db8f, 0xcf09c620, 0xa670cd45, 0x9e44ac95, 0xf73da7f0, 0x4cb6ba5f, 0x25cfb13a, 0xe0d18740, 0x89a88c25, 0x3223918a, 0x5b5a9aef, 0x8496a454, 0xedefaf31, 0x5664b29e, 0x3f1db9fb, 0xfa038f81, 0x937a84e4, 0x28f1994b, 0x4188922e, 0x79bcf3fe, 0x10c5f89b, 0xab4ee534, 0xc237ee51, 0x0729d82b, 0x6e50d34e, 0xd5dbcee1, 0xbca2c584, 0xa5b30d41, 0xccca0624, 0x77411b8b, 0x1e3810ee, 0xdb262694, 0xb25f2df1, 0x09d4305e, 0x60ad3b3b, 0x58995aeb, 0x31e0518e, 0x8a6b4c21, 0xe3124744, 0x260c713e, 0x4f757a5b, 0xf4fe67f4, 0x9d876c91, 0xc6ddf67e, 0xafa4fd1b, 0x142fe0b4, 0x7d56ebd1, 0xb848ddab, 0xd131d6ce, 0x6abacb61, 0x03c3c004, 0x3bf7a1d4, 0x528eaab1, 0xe905b71e, 0x807cbc7b, 0x45628a01, 0x2c1b8164, 0x97909ccb, 0xfee997ae, 0xe7f85f6b, 0x8e81540e, 0x350a49a1, 0x5c7342c4, 0x996d74be, 0xf0147fdb, 0x4b9f6274, 0x22e66911, 0x1ad208c1, 0x73ab03a4, 0xc8201e0b, 0xa159156e, 0x64472314, 0x0d3e2871, 0xb6b535de, 0xdfcc3ebb, 0xd25c4ee9, 0xbb25458c, 0x00ae5823, 0x69d75346, 0xacc9653c, 0xc5b06e59, 0x7e3b73f6, 0x17427893, 0x2f761943, 0x460f1226, 0xfd840f89, 0x94fd04ec, 0x51e33296, 0x389a39f3, 0x8311245c, 0xea682f39, 0xf379e7fc, 0x9a00ec99, 0x218bf136, 0x48f2fa53, 0x8deccc29, 0xe495c74c, 0x5f1edae3, 0x3667d186, 0x0e53b056, 0x672abb33, 0xdca1a69c, 0xb5d8adf9, 0x70c69b83, 0x19bf90e6, 0xa2348d49, 0xcb4d862c, 0x90171cc3, 0xf96e17a6, 0x42e50a09, 0x2b9c016c, 0xee823716, 0x87fb3c73, 0x3c7021dc, 0x55092ab9, 0x6d3d4b69, 0x0444400c, 0xbfcf5da3, 0xd6b656c6, 0x13a860bc, 0x7ad16bd9, 0xc15a7676, 0xa8237d13, 0xb132b5d6, 0xd84bbeb3, 0x63c0a31c, 0x0ab9a879, 0xcfa79e03, 0xa6de9566, 0x1d5588c9, 0x742c83ac, 0x4c18e27c, 0x2561e919, 0x9eeaf4b6, 0xf793ffd3, 0x328dc9a9, 0x5bf4c2cc, 0xe07fdf63, 0x8906d406, 0x56caeabd, 0x3fb3e1d8, 0x8438fc77, 0xed41f712, 0x285fc168, 0x4126ca0d, 0xfaadd7a2, 0x93d4dcc7, 0xabe0bd17, 0xc299b672, 0x7912abdd, 0x106ba0b8, 0xd57596c2, 0xbc0c9da7, 0x07878008, 0x6efe8b6d, 0x77ef43a8, 0x1e9648cd, 0xa51d5562, 0xcc645e07, 0x097a687d, 0x60036318, 0xdb887eb7, 0xb2f175d2, 0x8ac51402, 0xe3bc1f67, 0x583702c8, 0x314e09ad, 0xf4503fd7, 0x9d2934b2, 0x26a2291d, 0x4fdb2278, 0x1481b897, 0x7df8b3f2, 0xc673ae5d, 0xaf0aa538, 0x6a149342, 0x036d9827, 0xb8e68588, 0xd19f8eed, 0xe9abef3d, 0x80d2e458, 0x3b59f9f7, 0x5220f292, 0x973ec4e8, 0xfe47cf8d, 0x45ccd222, 0x2cb5d947, 0x35a41182, 0x5cdd1ae7, 0xe7560748, 0x8e2f0c2d, 0x4b313a57, 0x22483132, 0x99c32c9d, 0xf0ba27f8, 0xc88e4628, 0xa1f74d4d, 0x1a7c50e2, 0x73055b87, 0xb61b6dfd, 0xdf626698, 0x64e97b37, 0x0d907052}, {0x00000000, 0x7fc99b93, 0xff933726, 0x805aacb5, 0x2457680d, 0x5b9ef39e, 0xdbc45f2b, 0xa40dc4b8, 0x48aed01a, 0x37674b89, 0xb73de73c, 0xc8f47caf, 0x6cf9b817, 0x13302384, 0x936a8f31, 0xeca314a2, 0x915da034, 0xee943ba7, 0x6ece9712, 0x11070c81, 0xb50ac839, 0xcac353aa, 0x4a99ff1f, 0x3550648c, 0xd9f3702e, 0xa63aebbd, 0x26604708, 0x59a9dc9b, 0xfda41823, 0x826d83b0, 0x02372f05, 0x7dfeb496, 0xf9ca4629, 0x8603ddba, 0x0659710f, 0x7990ea9c, 0xdd9d2e24, 0xa254b5b7, 0x220e1902, 0x5dc78291, 0xb1649633, 0xcead0da0, 0x4ef7a115, 0x313e3a86, 0x9533fe3e, 0xeafa65ad, 0x6aa0c918, 0x1569528b, 0x6897e61d, 0x175e7d8e, 0x9704d13b, 0xe8cd4aa8, 0x4cc08e10, 0x33091583, 0xb353b936, 0xcc9a22a5, 0x20393607, 0x5ff0ad94, 0xdfaa0121, 0xa0639ab2, 0x046e5e0a, 0x7ba7c599, 0xfbfd692c, 0x8434f2bf, 0x28e58a13, 0x572c1180, 0xd776bd35, 0xa8bf26a6, 0x0cb2e21e, 0x737b798d, 0xf321d538, 0x8ce84eab, 0x604b5a09, 0x1f82c19a, 0x9fd86d2f, 0xe011f6bc, 0x441c3204, 0x3bd5a997, 0xbb8f0522, 0xc4469eb1, 0xb9b82a27, 0xc671b1b4, 0x462b1d01, 0x39e28692, 0x9def422a, 0xe226d9b9, 0x627c750c, 0x1db5ee9f, 0xf116fa3d, 0x8edf61ae, 0x0e85cd1b, 0x714c5688, 0xd5419230, 0xaa8809a3, 0x2ad2a516, 0x551b3e85, 0xd12fcc3a, 0xaee657a9, 0x2ebcfb1c, 0x5175608f, 0xf578a437, 0x8ab13fa4, 0x0aeb9311, 0x75220882, 0x99811c20, 0xe64887b3, 0x66122b06, 0x19dbb095, 0xbdd6742d, 0xc21fefbe, 0x4245430b, 0x3d8cd898, 0x40726c0e, 0x3fbbf79d, 0xbfe15b28, 0xc028c0bb, 0x64250403, 0x1bec9f90, 0x9bb63325, 0xe47fa8b6, 0x08dcbc14, 0x77152787, 0xf74f8b32, 0x888610a1, 0x2c8bd419, 0x53424f8a, 0xd318e33f, 0xacd178ac, 0x51cb1426, 0x2e028fb5, 0xae582300, 0xd191b893, 0x759c7c2b, 0x0a55e7b8, 0x8a0f4b0d, 0xf5c6d09e, 0x1965c43c, 0x66ac5faf, 0xe6f6f31a, 0x993f6889, 0x3d32ac31, 0x42fb37a2, 0xc2a19b17, 0xbd680084, 0xc096b412, 0xbf5f2f81, 0x3f058334, 0x40cc18a7, 0xe4c1dc1f, 0x9b08478c, 0x1b52eb39, 0x649b70aa, 0x88386408, 0xf7f1ff9b, 0x77ab532e, 0x0862c8bd, 0xac6f0c05, 0xd3a69796, 0x53fc3b23, 0x2c35a0b0, 0xa801520f, 0xd7c8c99c, 0x57926529, 0x285bfeba, 0x8c563a02, 0xf39fa191, 0x73c50d24, 0x0c0c96b7, 0xe0af8215, 0x9f661986, 0x1f3cb533, 0x60f52ea0, 0xc4f8ea18, 0xbb31718b, 0x3b6bdd3e, 0x44a246ad, 0x395cf23b, 0x469569a8, 0xc6cfc51d, 0xb9065e8e, 0x1d0b9a36, 0x62c201a5, 0xe298ad10, 0x9d513683, 0x71f22221, 0x0e3bb9b2, 0x8e611507, 0xf1a88e94, 0x55a54a2c, 0x2a6cd1bf, 0xaa367d0a, 0xd5ffe699, 0x792e9e35, 0x06e705a6, 0x86bda913, 0xf9743280, 0x5d79f638, 0x22b06dab, 0xa2eac11e, 0xdd235a8d, 0x31804e2f, 0x4e49d5bc, 0xce137909, 0xb1dae29a, 0x15d72622, 0x6a1ebdb1, 0xea441104, 0x958d8a97, 0xe8733e01, 0x97baa592, 0x17e00927, 0x682992b4, 0xcc24560c, 0xb3edcd9f, 0x33b7612a, 0x4c7efab9, 0xa0ddee1b, 0xdf147588, 0x5f4ed93d, 0x208742ae, 0x848a8616, 0xfb431d85, 0x7b19b130, 0x04d02aa3, 0x80e4d81c, 0xff2d438f, 0x7f77ef3a, 0x00be74a9, 0xa4b3b011, 0xdb7a2b82, 0x5b208737, 0x24e91ca4, 0xc84a0806, 0xb7839395, 0x37d93f20, 0x4810a4b3, 0xec1d600b, 0x93d4fb98, 0x138e572d, 0x6c47ccbe, 0x11b97828, 0x6e70e3bb, 0xee2a4f0e, 0x91e3d49d, 0x35ee1025, 0x4a278bb6, 0xca7d2703, 0xb5b4bc90, 0x5917a832, 0x26de33a1, 0xa6849f14, 0xd94d0487, 0x7d40c03f, 0x02895bac, 0x82d3f719, 0xfd1a6c8a}, {0x00000000, 0xa396284c, 0x9c5d56d9, 0x3fcb7e95, 0xe3cbabf3, 0x405d83bf, 0x7f96fd2a, 0xdc00d566, 0x1ce651a7, 0xbf7079eb, 0x80bb077e, 0x232d2f32, 0xff2dfa54, 0x5cbbd218, 0x6370ac8d, 0xc0e684c1, 0x39cca34e, 0x9a5a8b02, 0xa591f597, 0x0607dddb, 0xda0708bd, 0x799120f1, 0x465a5e64, 0xe5cc7628, 0x252af2e9, 0x86bcdaa5, 0xb977a430, 0x1ae18c7c, 0xc6e1591a, 0x65777156, 0x5abc0fc3, 0xf92a278f, 0x7399469c, 0xd00f6ed0, 0xefc41045, 0x4c523809, 0x9052ed6f, 0x33c4c523, 0x0c0fbbb6, 0xaf9993fa, 0x6f7f173b, 0xcce93f77, 0xf32241e2, 0x50b469ae, 0x8cb4bcc8, 0x2f229484, 0x10e9ea11, 0xb37fc25d, 0x4a55e5d2, 0xe9c3cd9e, 0xd608b30b, 0x759e9b47, 0xa99e4e21, 0x0a08666d, 0x35c318f8, 0x965530b4, 0x56b3b475, 0xf5259c39, 0xcaeee2ac, 0x6978cae0, 0xb5781f86, 0x16ee37ca, 0x2925495f, 0x8ab36113, 0xe7328d38, 0x44a4a574, 0x7b6fdbe1, 0xd8f9f3ad, 0x04f926cb, 0xa76f0e87, 0x98a47012, 0x3b32585e, 0xfbd4dc9f, 0x5842f4d3, 0x67898a46, 0xc41fa20a, 0x181f776c, 0xbb895f20, 0x844221b5, 0x27d409f9, 0xdefe2e76, 0x7d68063a, 0x42a378af, 0xe13550e3, 0x3d358585, 0x9ea3adc9, 0xa168d35c, 0x02fefb10, 0xc2187fd1, 0x618e579d, 0x5e452908, 0xfdd30144, 0x21d3d422, 0x8245fc6e, 0xbd8e82fb, 0x1e18aab7, 0x94abcba4, 0x373de3e8, 0x08f69d7d, 0xab60b531, 0x77606057, 0xd4f6481b, 0xeb3d368e, 0x48ab1ec2, 0x884d9a03, 0x2bdbb24f, 0x1410ccda, 0xb786e496, 0x6b8631f0, 0xc81019bc, 0xf7db6729, 0x544d4f65, 0xad6768ea, 0x0ef140a6, 0x313a3e33, 0x92ac167f, 0x4eacc319, 0xed3aeb55, 0xd2f195c0, 0x7167bd8c, 0xb181394d, 0x12171101, 0x2ddc6f94, 0x8e4a47d8, 0x524a92be, 0xf1dcbaf2, 0xce17c467, 0x6d81ec2b, 0x15141c31, 0xb682347d, 0x89494ae8, 0x2adf62a4, 0xf6dfb7c2, 0x55499f8e, 0x6a82e11b, 0xc914c957, 0x09f24d96, 0xaa6465da, 0x95af1b4f, 0x36393303, 0xea39e665, 0x49afce29, 0x7664b0bc, 0xd5f298f0, 0x2cd8bf7f, 0x8f4e9733, 0xb085e9a6, 0x1313c1ea, 0xcf13148c, 0x6c853cc0, 0x534e4255, 0xf0d86a19, 0x303eeed8, 0x93a8c694, 0xac63b801, 0x0ff5904d, 0xd3f5452b, 0x70636d67, 0x4fa813f2, 0xec3e3bbe, 0x668d5aad, 0xc51b72e1, 0xfad00c74, 0x59462438, 0x8546f15e, 0x26d0d912, 0x191ba787, 0xba8d8fcb, 0x7a6b0b0a, 0xd9fd2346, 0xe6365dd3, 0x45a0759f, 0x99a0a0f9, 0x3a3688b5, 0x05fdf620, 0xa66bde6c, 0x5f41f9e3, 0xfcd7d1af, 0xc31caf3a, 0x608a8776, 0xbc8a5210, 0x1f1c7a5c, 0x20d704c9, 0x83412c85, 0x43a7a844, 0xe0318008, 0xdffafe9d, 0x7c6cd6d1, 0xa06c03b7, 0x03fa2bfb, 0x3c31556e, 0x9fa77d22, 0xf2269109, 0x51b0b945, 0x6e7bc7d0, 0xcdedef9c, 0x11ed3afa, 0xb27b12b6, 0x8db06c23, 0x2e26446f, 0xeec0c0ae, 0x4d56e8e2, 0x729d9677, 0xd10bbe3b, 0x0d0b6b5d, 0xae9d4311, 0x91563d84, 0x32c015c8, 0xcbea3247, 0x687c1a0b, 0x57b7649e, 0xf4214cd2, 0x282199b4, 0x8bb7b1f8, 0xb47ccf6d, 0x17eae721, 0xd70c63e0, 0x749a4bac, 0x4b513539, 0xe8c71d75, 0x34c7c813, 0x9751e05f, 0xa89a9eca, 0x0b0cb686, 0x81bfd795, 0x2229ffd9, 0x1de2814c, 0xbe74a900, 0x62747c66, 0xc1e2542a, 0xfe292abf, 0x5dbf02f3, 0x9d598632, 0x3ecfae7e, 0x0104d0eb, 0xa292f8a7, 0x7e922dc1, 0xdd04058d, 0xe2cf7b18, 0x41595354, 0xb87374db, 0x1be55c97, 0x242e2202, 0x87b80a4e, 0x5bb8df28, 0xf82ef764, 0xc7e589f1, 0x6473a1bd, 0xa495257c, 0x07030d30, 0x38c873a5, 0x9b5e5be9, 0x475e8e8f, 0xe4c8a6c3, 0xdb03d856, 0x7895f01a}, {0x00000000, 0x2a283862, 0x545070c4, 0x7e7848a6, 0xa8a0e188, 0x8288d9ea, 0xfcf0914c, 0xd6d8a92e, 0x8a30c551, 0xa018fd33, 0xde60b595, 0xf4488df7, 0x229024d9, 0x08b81cbb, 0x76c0541d, 0x5ce86c7f, 0xcf108ce3, 0xe538b481, 0x9b40fc27, 0xb168c445, 0x67b06d6b, 0x4d985509, 0x33e01daf, 0x19c825cd, 0x452049b2, 0x6f0871d0, 0x11703976, 0x3b580114, 0xed80a83a, 0xc7a89058, 0xb9d0d8fe, 0x93f8e09c, 0x45501f87, 0x6f7827e5, 0x11006f43, 0x3b285721, 0xedf0fe0f, 0xc7d8c66d, 0xb9a08ecb, 0x9388b6a9, 0xcf60dad6, 0xe548e2b4, 0x9b30aa12, 0xb1189270, 0x67c03b5e, 0x4de8033c, 0x33904b9a, 0x19b873f8, 0x8a409364, 0xa068ab06, 0xde10e3a0, 0xf438dbc2, 0x22e072ec, 0x08c84a8e, 0x76b00228, 0x5c983a4a, 0x00705635, 0x2a586e57, 0x542026f1, 0x7e081e93, 0xa8d0b7bd, 0x82f88fdf, 0xfc80c779, 0xd6a8ff1b, 0x8aa03f0e, 0xa088076c, 0xdef04fca, 0xf4d877a8, 0x2200de86, 0x0828e6e4, 0x7650ae42, 0x5c789620, 0x0090fa5f, 0x2ab8c23d, 0x54c08a9b, 0x7ee8b2f9, 0xa8301bd7, 0x821823b5, 0xfc606b13, 0xd6485371, 0x45b0b3ed, 0x6f988b8f, 0x11e0c329, 0x3bc8fb4b, 0xed105265, 0xc7386a07, 0xb94022a1, 0x93681ac3, 0xcf8076bc, 0xe5a84ede, 0x9bd00678, 0xb1f83e1a, 0x67209734, 0x4d08af56, 0x3370e7f0, 0x1958df92, 0xcff02089, 0xe5d818eb, 0x9ba0504d, 0xb188682f, 0x6750c101, 0x4d78f963, 0x3300b1c5, 0x192889a7, 0x45c0e5d8, 0x6fe8ddba, 0x1190951c, 0x3bb8ad7e, 0xed600450, 0xc7483c32, 0xb9307494, 0x93184cf6, 0x00e0ac6a, 0x2ac89408, 0x54b0dcae, 0x7e98e4cc, 0xa8404de2, 0x82687580, 0xfc103d26, 0xd6380544, 0x8ad0693b, 0xa0f85159, 0xde8019ff, 0xf4a8219d, 0x227088b3, 0x0858b0d1, 0x7620f877, 0x5c08c015, 0xce31785d, 0xe419403f, 0x9a610899, 0xb04930fb, 0x669199d5, 0x4cb9a1b7, 0x32c1e911, 0x18e9d173, 0x4401bd0c, 0x6e29856e, 0x1051cdc8, 0x3a79f5aa, 0xeca15c84, 0xc68964e6, 0xb8f12c40, 0x92d91422, 0x0121f4be, 0x2b09ccdc, 0x5571847a, 0x7f59bc18, 0xa9811536, 0x83a92d54, 0xfdd165f2, 0xd7f95d90, 0x8b1131ef, 0xa139098d, 0xdf41412b, 0xf5697949, 0x23b1d067, 0x0999e805, 0x77e1a0a3, 0x5dc998c1, 0x8b6167da, 0xa1495fb8, 0xdf31171e, 0xf5192f7c, 0x23c18652, 0x09e9be30, 0x7791f696, 0x5db9cef4, 0x0151a28b, 0x2b799ae9, 0x5501d24f, 0x7f29ea2d, 0xa9f14303, 0x83d97b61, 0xfda133c7, 0xd7890ba5, 0x4471eb39, 0x6e59d35b, 0x10219bfd, 0x3a09a39f, 0xecd10ab1, 0xc6f932d3, 0xb8817a75, 0x92a94217, 0xce412e68, 0xe469160a, 0x9a115eac, 0xb03966ce, 0x66e1cfe0, 0x4cc9f782, 0x32b1bf24, 0x18998746, 0x44914753, 0x6eb97f31, 0x10c13797, 0x3ae90ff5, 0xec31a6db, 0xc6199eb9, 0xb861d61f, 0x9249ee7d, 0xcea18202, 0xe489ba60, 0x9af1f2c6, 0xb0d9caa4, 0x6601638a, 0x4c295be8, 0x3251134e, 0x18792b2c, 0x8b81cbb0, 0xa1a9f3d2, 0xdfd1bb74, 0xf5f98316, 0x23212a38, 0x0909125a, 0x77715afc, 0x5d59629e, 0x01b10ee1, 0x2b993683, 0x55e17e25, 0x7fc94647, 0xa911ef69, 0x8339d70b, 0xfd419fad, 0xd769a7cf, 0x01c158d4, 0x2be960b6, 0x55912810, 0x7fb91072, 0xa961b95c, 0x8349813e, 0xfd31c998, 0xd719f1fa, 0x8bf19d85, 0xa1d9a5e7, 0xdfa1ed41, 0xf589d523, 0x23517c0d, 0x0979446f, 0x77010cc9, 0x5d2934ab, 0xced1d437, 0xe4f9ec55, 0x9a81a4f3, 0xb0a99c91, 0x667135bf, 0x4c590ddd, 0x3221457b, 0x18097d19, 0x44e11166, 0x6ec92904, 0x10b161a2, 0x3a9959c0, 0xec41f0ee, 0xc669c88c, 0xb811802a, 0x9239b848}, {0x00000000, 0x4713f6fb, 0x8e27edf6, 0xc9341b0d, 0xc73eddad, 0x802d2b56, 0x4919305b, 0x0e0ac6a0, 0x550cbd1b, 0x121f4be0, 0xdb2b50ed, 0x9c38a616, 0x923260b6, 0xd521964d, 0x1c158d40, 0x5b067bbb, 0xaa197a36, 0xed0a8ccd, 0x243e97c0, 0x632d613b, 0x6d27a79b, 0x2a345160, 0xe3004a6d, 0xa413bc96, 0xff15c72d, 0xb80631d6, 0x71322adb, 0x3621dc20, 0x382b1a80, 0x7f38ec7b, 0xb60cf776, 0xf11f018d, 0x8f43f22d, 0xc85004d6, 0x01641fdb, 0x4677e920, 0x487d2f80, 0x0f6ed97b, 0xc65ac276, 0x8149348d, 0xda4f4f36, 0x9d5cb9cd, 0x5468a2c0, 0x137b543b, 0x1d71929b, 0x5a626460, 0x93567f6d, 0xd4458996, 0x255a881b, 0x62497ee0, 0xab7d65ed, 0xec6e9316, 0xe26455b6, 0xa577a34d, 0x6c43b840, 0x2b504ebb, 0x70563500, 0x3745c3fb, 0xfe71d8f6, 0xb9622e0d, 0xb768e8ad, 0xf07b1e56, 0x394f055b, 0x7e5cf3a0, 0xc5f6e21b, 0x82e514e0, 0x4bd10fed, 0x0cc2f916, 0x02c83fb6, 0x45dbc94d, 0x8cefd240, 0xcbfc24bb, 0x90fa5f00, 0xd7e9a9fb, 0x1eddb2f6, 0x59ce440d, 0x57c482ad, 0x10d77456, 0xd9e36f5b, 0x9ef099a0, 0x6fef982d, 0x28fc6ed6, 0xe1c875db, 0xa6db8320, 0xa8d14580, 0xefc2b37b, 0x26f6a876, 0x61e55e8d, 0x3ae32536, 0x7df0d3cd, 0xb4c4c8c0, 0xf3d73e3b, 0xfdddf89b, 0xbace0e60, 0x73fa156d, 0x34e9e396, 0x4ab51036, 0x0da6e6cd, 0xc492fdc0, 0x83810b3b, 0x8d8bcd9b, 0xca983b60, 0x03ac206d, 0x44bfd696, 0x1fb9ad2d, 0x58aa5bd6, 0x919e40db, 0xd68db620, 0xd8877080, 0x9f94867b, 0x56a09d76, 0x11b36b8d, 0xe0ac6a00, 0xa7bf9cfb, 0x6e8b87f6, 0x2998710d, 0x2792b7ad, 0x60814156, 0xa9b55a5b, 0xeea6aca0, 0xb5a0d71b, 0xf2b321e0, 0x3b873aed, 0x7c94cc16, 0x729e0ab6, 0x358dfc4d, 0xfcb9e740, 0xbbaa11bb, 0x509cc277, 0x178f348c, 0xdebb2f81, 0x99a8d97a, 0x97a21fda, 0xd0b1e921, 0x1985f22c, 0x5e9604d7, 0x05907f6c, 0x42838997, 0x8bb7929a, 0xcca46461, 0xc2aea2c1, 0x85bd543a, 0x4c894f37, 0x0b9ab9cc, 0xfa85b841, 0xbd964eba, 0x74a255b7, 0x33b1a34c, 0x3dbb65ec, 0x7aa89317, 0xb39c881a, 0xf48f7ee1, 0xaf89055a, 0xe89af3a1, 0x21aee8ac, 0x66bd1e57, 0x68b7d8f7, 0x2fa42e0c, 0xe6903501, 0xa183c3fa, 0xdfdf305a, 0x98ccc6a1, 0x51f8ddac, 0x16eb2b57, 0x18e1edf7, 0x5ff21b0c, 0x96c60001, 0xd1d5f6fa, 0x8ad38d41, 0xcdc07bba, 0x04f460b7, 0x43e7964c, 0x4ded50ec, 0x0afea617, 0xc3cabd1a, 0x84d94be1, 0x75c64a6c, 0x32d5bc97, 0xfbe1a79a, 0xbcf25161, 0xb2f897c1, 0xf5eb613a, 0x3cdf7a37, 0x7bcc8ccc, 0x20caf777, 0x67d9018c, 0xaeed1a81, 0xe9feec7a, 0xe7f42ada, 0xa0e7dc21, 0x69d3c72c, 0x2ec031d7, 0x956a206c, 0xd279d697, 0x1b4dcd9a, 0x5c5e3b61, 0x5254fdc1, 0x15470b3a, 0xdc731037, 0x9b60e6cc, 0xc0669d77, 0x87756b8c, 0x4e417081, 0x0952867a, 0x075840da, 0x404bb621, 0x897fad2c, 0xce6c5bd7, 0x3f735a5a, 0x7860aca1, 0xb154b7ac, 0xf6474157, 0xf84d87f7, 0xbf5e710c, 0x766a6a01, 0x31799cfa, 0x6a7fe741, 0x2d6c11ba, 0xe4580ab7, 0xa34bfc4c, 0xad413aec, 0xea52cc17, 0x2366d71a, 0x647521e1, 0x1a29d241, 0x5d3a24ba, 0x940e3fb7, 0xd31dc94c, 0xdd170fec, 0x9a04f917, 0x5330e21a, 0x142314e1, 0x4f256f5a, 0x083699a1, 0xc10282ac, 0x86117457, 0x881bb2f7, 0xcf08440c, 0x063c5f01, 0x412fa9fa, 0xb030a877, 0xf7235e8c, 0x3e174581, 0x7904b37a, 0x770e75da, 0x301d8321, 0xf929982c, 0xbe3a6ed7, 0xe53c156c, 0xa22fe397, 0x6b1bf89a, 0x2c080e61, 0x2202c8c1, 0x65113e3a, 0xac252537, 0xeb36d3cc}, {0x00000000, 0xa13984ee, 0x99020f9d, 0x383b8b73, 0xe975197b, 0x484c9d95, 0x707716e6, 0xd14e9208, 0x099b34b7, 0xa8a2b059, 0x90993b2a, 0x31a0bfc4, 0xe0ee2dcc, 0x41d7a922, 0x79ec2251, 0xd8d5a6bf, 0x1336696e, 0xb20fed80, 0x8a3466f3, 0x2b0de21d, 0xfa437015, 0x5b7af4fb, 0x63417f88, 0xc278fb66, 0x1aad5dd9, 0xbb94d937, 0x83af5244, 0x2296d6aa, 0xf3d844a2, 0x52e1c04c, 0x6ada4b3f, 0xcbe3cfd1, 0x266cd2dc, 0x87555632, 0xbf6edd41, 0x1e5759af, 0xcf19cba7, 0x6e204f49, 0x561bc43a, 0xf72240d4, 0x2ff7e66b, 0x8ece6285, 0xb6f5e9f6, 0x17cc6d18, 0xc682ff10, 0x67bb7bfe, 0x5f80f08d, 0xfeb97463, 0x355abbb2, 0x94633f5c, 0xac58b42f, 0x0d6130c1, 0xdc2fa2c9, 0x7d162627, 0x452dad54, 0xe41429ba, 0x3cc18f05, 0x9df80beb, 0xa5c38098, 0x04fa0476, 0xd5b4967e, 0x748d1290, 0x4cb699e3, 0xed8f1d0d, 0x4cd9a5b8, 0xede02156, 0xd5dbaa25, 0x74e22ecb, 0xa5acbcc3, 0x0495382d, 0x3caeb35e, 0x9d9737b0, 0x4542910f, 0xe47b15e1, 0xdc409e92, 0x7d791a7c, 0xac378874, 0x0d0e0c9a, 0x353587e9, 0x940c0307, 0x5fefccd6, 0xfed64838, 0xc6edc34b, 0x67d447a5, 0xb69ad5ad, 0x17a35143, 0x2f98da30, 0x8ea15ede, 0x5674f861, 0xf74d7c8f, 0xcf76f7fc, 0x6e4f7312, 0xbf01e11a, 0x1e3865f4, 0x2603ee87, 0x873a6a69, 0x6ab57764, 0xcb8cf38a, 0xf3b778f9, 0x528efc17, 0x83c06e1f, 0x22f9eaf1, 0x1ac26182, 0xbbfbe56c, 0x632e43d3, 0xc217c73d, 0xfa2c4c4e, 0x5b15c8a0, 0x8a5b5aa8, 0x2b62de46, 0x13595535, 0xb260d1db, 0x79831e0a, 0xd8ba9ae4, 0xe0811197, 0x41b89579, 0x90f60771, 0x31cf839f, 0x09f408ec, 0xa8cd8c02, 0x70182abd, 0xd121ae53, 0xe91a2520, 0x4823a1ce, 0x996d33c6, 0x3854b728, 0x006f3c5b, 0xa156b8b5, 0x99b34b70, 0x388acf9e, 0x00b144ed, 0xa188c003, 0x70c6520b, 0xd1ffd6e5, 0xe9c45d96, 0x48fdd978, 0x90287fc7, 0x3111fb29, 0x092a705a, 0xa813f4b4, 0x795d66bc, 0xd864e252, 0xe05f6921, 0x4166edcf, 0x8a85221e, 0x2bbca6f0, 0x13872d83, 0xb2bea96d, 0x63f03b65, 0xc2c9bf8b, 0xfaf234f8, 0x5bcbb016, 0x831e16a9, 0x22279247, 0x1a1c1934, 0xbb259dda, 0x6a6b0fd2, 0xcb528b3c, 0xf369004f, 0x525084a1, 0xbfdf99ac, 0x1ee61d42, 0x26dd9631, 0x87e412df, 0x56aa80d7, 0xf7930439, 0xcfa88f4a, 0x6e910ba4, 0xb644ad1b, 0x177d29f5, 0x2f46a286, 0x8e7f2668, 0x5f31b460, 0xfe08308e, 0xc633bbfd, 0x670a3f13, 0xace9f0c2, 0x0dd0742c, 0x35ebff5f, 0x94d27bb1, 0x459ce9b9, 0xe4a56d57, 0xdc9ee624, 0x7da762ca, 0xa572c475, 0x044b409b, 0x3c70cbe8, 0x9d494f06, 0x4c07dd0e, 0xed3e59e0, 0xd505d293, 0x743c567d, 0xd56aeec8, 0x74536a26, 0x4c68e155, 0xed5165bb, 0x3c1ff7b3, 0x9d26735d, 0xa51df82e, 0x04247cc0, 0xdcf1da7f, 0x7dc85e91, 0x45f3d5e2, 0xe4ca510c, 0x3584c304, 0x94bd47ea, 0xac86cc99, 0x0dbf4877, 0xc65c87a6, 0x67650348, 0x5f5e883b, 0xfe670cd5, 0x2f299edd, 0x8e101a33, 0xb62b9140, 0x171215ae, 0xcfc7b311, 0x6efe37ff, 0x56c5bc8c, 0xf7fc3862, 0x26b2aa6a, 0x878b2e84, 0xbfb0a5f7, 0x1e892119, 0xf3063c14, 0x523fb8fa, 0x6a043389, 0xcb3db767, 0x1a73256f, 0xbb4aa181, 0x83712af2, 0x2248ae1c, 0xfa9d08a3, 0x5ba48c4d, 0x639f073e, 0xc2a683d0, 0x13e811d8, 0xb2d19536, 0x8aea1e45, 0x2bd39aab, 0xe030557a, 0x4109d194, 0x79325ae7, 0xd80bde09, 0x09454c01, 0xa87cc8ef, 0x9047439c, 0x317ec772, 0xe9ab61cd, 0x4892e523, 0x70a96e50, 0xd190eabe, 0x00de78b6, 0xa1e7fc58, 0x99dc772b, 0x38e5f3c5}, {0x00000000, 0xe81790a1, 0x0b5e2703, 0xe349b7a2, 0x16bc4e06, 0xfeabdea7, 0x1de26905, 0xf5f5f9a4, 0x2d789c0c, 0xc56f0cad, 0x2626bb0f, 0xce312bae, 0x3bc4d20a, 0xd3d342ab, 0x309af509, 0xd88d65a8, 0x5af13818, 0xb2e6a8b9, 0x51af1f1b, 0xb9b88fba, 0x4c4d761e, 0xa45ae6bf, 0x4713511d, 0xaf04c1bc, 0x7789a414, 0x9f9e34b5, 0x7cd78317, 0x94c013b6, 0x6135ea12, 0x89227ab3, 0x6a6bcd11, 0x827c5db0, 0xb5e27030, 0x5df5e091, 0xbebc5733, 0x56abc792, 0xa35e3e36, 0x4b49ae97, 0xa8001935, 0x40178994, 0x989aec3c, 0x708d7c9d, 0x93c4cb3f, 0x7bd35b9e, 0x8e26a23a, 0x6631329b, 0x85788539, 0x6d6f1598, 0xef134828, 0x0704d889, 0xe44d6f2b, 0x0c5aff8a, 0xf9af062e, 0x11b8968f, 0xf2f1212d, 0x1ae6b18c, 0xc26bd424, 0x2a7c4485, 0xc935f327, 0x21226386, 0xd4d79a22, 0x3cc00a83, 0xdf89bd21, 0x379e2d80, 0xb0b5e621, 0x58a27680, 0xbbebc122, 0x53fc5183, 0xa609a827, 0x4e1e3886, 0xad578f24, 0x45401f85, 0x9dcd7a2d, 0x75daea8c, 0x96935d2e, 0x7e84cd8f, 0x8b71342b, 0x6366a48a, 0x802f1328, 0x68388389, 0xea44de39, 0x02534e98, 0xe11af93a, 0x090d699b, 0xfcf8903f, 0x14ef009e, 0xf7a6b73c, 0x1fb1279d, 0xc73c4235, 0x2f2bd294, 0xcc626536, 0x2475f597, 0xd1800c33, 0x39979c92, 0xdade2b30, 0x32c9bb91, 0x05579611, 0xed4006b0, 0x0e09b112, 0xe61e21b3, 0x13ebd817, 0xfbfc48b6, 0x18b5ff14, 0xf0a26fb5, 0x282f0a1d, 0xc0389abc, 0x23712d1e, 0xcb66bdbf, 0x3e93441b, 0xd684d4ba, 0x35cd6318, 0xdddaf3b9, 0x5fa6ae09, 0xb7b13ea8, 0x54f8890a, 0xbcef19ab, 0x491ae00f, 0xa10d70ae, 0x4244c70c, 0xaa5357ad, 0x72de3205, 0x9ac9a2a4, 0x79801506, 0x919785a7, 0x64627c03, 0x8c75eca2, 0x6f3c5b00, 0x872bcba1, 0xba1aca03, 0x520d5aa2, 0xb144ed00, 0x59537da1, 0xaca68405, 0x44b114a4, 0xa7f8a306, 0x4fef33a7, 0x9762560f, 0x7f75c6ae, 0x9c3c710c, 0x742be1ad, 0x81de1809, 0x69c988a8, 0x8a803f0a, 0x6297afab, 0xe0ebf21b, 0x08fc62ba, 0xebb5d518, 0x03a245b9, 0xf657bc1d, 0x1e402cbc, 0xfd099b1e, 0x151e0bbf, 0xcd936e17, 0x2584feb6, 0xc6cd4914, 0x2edad9b5, 0xdb2f2011, 0x3338b0b0, 0xd0710712, 0x386697b3, 0x0ff8ba33, 0xe7ef2a92, 0x04a69d30, 0xecb10d91, 0x1944f435, 0xf1536494, 0x121ad336, 0xfa0d4397, 0x2280263f, 0xca97b69e, 0x29de013c, 0xc1c9919d, 0x343c6839, 0xdc2bf898, 0x3f624f3a, 0xd775df9b, 0x5509822b, 0xbd1e128a, 0x5e57a528, 0xb6403589, 0x43b5cc2d, 0xaba25c8c, 0x48ebeb2e, 0xa0fc7b8f, 0x78711e27, 0x90668e86, 0x732f3924, 0x9b38a985, 0x6ecd5021, 0x86dac080, 0x65937722, 0x8d84e783, 0x0aaf2c22, 0xe2b8bc83, 0x01f10b21, 0xe9e69b80, 0x1c136224, 0xf404f285, 0x174d4527, 0xff5ad586, 0x27d7b02e, 0xcfc0208f, 0x2c89972d, 0xc49e078c, 0x316bfe28, 0xd97c6e89, 0x3a35d92b, 0xd222498a, 0x505e143a, 0xb849849b, 0x5b003339, 0xb317a398, 0x46e25a3c, 0xaef5ca9d, 0x4dbc7d3f, 0xa5abed9e, 0x7d268836, 0x95311897, 0x7678af35, 0x9e6f3f94, 0x6b9ac630, 0x838d5691, 0x60c4e133, 0x88d37192, 0xbf4d5c12, 0x575accb3, 0xb4137b11, 0x5c04ebb0, 0xa9f11214, 0x41e682b5, 0xa2af3517, 0x4ab8a5b6, 0x9235c01e, 0x7a2250bf, 0x996be71d, 0x717c77bc, 0x84898e18, 0x6c9e1eb9, 0x8fd7a91b, 0x67c039ba, 0xe5bc640a, 0x0dabf4ab, 0xeee24309, 0x06f5d3a8, 0xf3002a0c, 0x1b17baad, 0xf85e0d0f, 0x10499dae, 0xc8c4f806, 0x20d368a7, 0xc39adf05, 0x2b8d4fa4, 0xde78b600, 0x366f26a1, 0xd5269103, 0x3d3101a2}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x0000000000000000, 0xa19017e800000000, 0x03275e0b00000000, 0xa2b749e300000000, 0x064ebc1600000000, 0xa7deabfe00000000, 0x0569e21d00000000, 0xa4f9f5f500000000, 0x0c9c782d00000000, 0xad0c6fc500000000, 0x0fbb262600000000, 0xae2b31ce00000000, 0x0ad2c43b00000000, 0xab42d3d300000000, 0x09f59a3000000000, 0xa8658dd800000000, 0x1838f15a00000000, 0xb9a8e6b200000000, 0x1b1faf5100000000, 0xba8fb8b900000000, 0x1e764d4c00000000, 0xbfe65aa400000000, 0x1d51134700000000, 0xbcc104af00000000, 0x14a4897700000000, 0xb5349e9f00000000, 0x1783d77c00000000, 0xb613c09400000000, 0x12ea356100000000, 0xb37a228900000000, 0x11cd6b6a00000000, 0xb05d7c8200000000, 0x3070e2b500000000, 0x91e0f55d00000000, 0x3357bcbe00000000, 0x92c7ab5600000000, 0x363e5ea300000000, 0x97ae494b00000000, 0x351900a800000000, 0x9489174000000000, 0x3cec9a9800000000, 0x9d7c8d7000000000, 0x3fcbc49300000000, 0x9e5bd37b00000000, 0x3aa2268e00000000, 0x9b32316600000000, 0x3985788500000000, 0x98156f6d00000000, 0x284813ef00000000, 0x89d8040700000000, 0x2b6f4de400000000, 0x8aff5a0c00000000, 0x2e06aff900000000, 0x8f96b81100000000, 0x2d21f1f200000000, 0x8cb1e61a00000000, 0x24d46bc200000000, 0x85447c2a00000000, 0x27f335c900000000, 0x8663222100000000, 0x229ad7d400000000, 0x830ac03c00000000, 0x21bd89df00000000, 0x802d9e3700000000, 0x21e6b5b000000000, 0x8076a25800000000, 0x22c1ebbb00000000, 0x8351fc5300000000, 0x27a809a600000000, 0x86381e4e00000000, 0x248f57ad00000000, 0x851f404500000000, 0x2d7acd9d00000000, 0x8ceada7500000000, 0x2e5d939600000000, 0x8fcd847e00000000, 0x2b34718b00000000, 0x8aa4666300000000, 0x28132f8000000000, 0x8983386800000000, 0x39de44ea00000000, 0x984e530200000000, 0x3af91ae100000000, 0x9b690d0900000000, 0x3f90f8fc00000000, 0x9e00ef1400000000, 0x3cb7a6f700000000, 0x9d27b11f00000000, 0x35423cc700000000, 0x94d22b2f00000000, 0x366562cc00000000, 0x97f5752400000000, 0x330c80d100000000, 0x929c973900000000, 0x302bdeda00000000, 0x91bbc93200000000, 0x1196570500000000, 0xb00640ed00000000, 0x12b1090e00000000, 0xb3211ee600000000, 0x17d8eb1300000000, 0xb648fcfb00000000, 0x14ffb51800000000, 0xb56fa2f000000000, 0x1d0a2f2800000000, 0xbc9a38c000000000, 0x1e2d712300000000, 0xbfbd66cb00000000, 0x1b44933e00000000, 0xbad484d600000000, 0x1863cd3500000000, 0xb9f3dadd00000000, 0x09aea65f00000000, 0xa83eb1b700000000, 0x0a89f85400000000, 0xab19efbc00000000, 0x0fe01a4900000000, 0xae700da100000000, 0x0cc7444200000000, 0xad5753aa00000000, 0x0532de7200000000, 0xa4a2c99a00000000, 0x0615807900000000, 0xa785979100000000, 0x037c626400000000, 0xa2ec758c00000000, 0x005b3c6f00000000, 0xa1cb2b8700000000, 0x03ca1aba00000000, 0xa25a0d5200000000, 0x00ed44b100000000, 0xa17d535900000000, 0x0584a6ac00000000, 0xa414b14400000000, 0x06a3f8a700000000, 0xa733ef4f00000000, 0x0f56629700000000, 0xaec6757f00000000, 0x0c713c9c00000000, 0xade12b7400000000, 0x0918de8100000000, 0xa888c96900000000, 0x0a3f808a00000000, 0xabaf976200000000, 0x1bf2ebe000000000, 0xba62fc0800000000, 0x18d5b5eb00000000, 0xb945a20300000000, 0x1dbc57f600000000, 0xbc2c401e00000000, 0x1e9b09fd00000000, 0xbf0b1e1500000000, 0x176e93cd00000000, 0xb6fe842500000000, 0x1449cdc600000000, 0xb5d9da2e00000000, 0x11202fdb00000000, 0xb0b0383300000000, 0x120771d000000000, 0xb397663800000000, 0x33baf80f00000000, 0x922aefe700000000, 0x309da60400000000, 0x910db1ec00000000, 0x35f4441900000000, 0x946453f100000000, 0x36d31a1200000000, 0x97430dfa00000000, 0x3f26802200000000, 0x9eb697ca00000000, 0x3c01de2900000000, 0x9d91c9c100000000, 0x39683c3400000000, 0x98f82bdc00000000, 0x3a4f623f00000000, 0x9bdf75d700000000, 0x2b82095500000000, 0x8a121ebd00000000, 0x28a5575e00000000, 0x893540b600000000, 0x2dccb54300000000, 0x8c5ca2ab00000000, 0x2eebeb4800000000, 0x8f7bfca000000000, 0x271e717800000000, 0x868e669000000000, 0x24392f7300000000, 0x85a9389b00000000, 0x2150cd6e00000000, 0x80c0da8600000000, 0x2277936500000000, 0x83e7848d00000000, 0x222caf0a00000000, 0x83bcb8e200000000, 0x210bf10100000000, 0x809be6e900000000, 0x2462131c00000000, 0x85f204f400000000, 0x27454d1700000000, 0x86d55aff00000000, 0x2eb0d72700000000, 0x8f20c0cf00000000, 0x2d97892c00000000, 0x8c079ec400000000, 0x28fe6b3100000000, 0x896e7cd900000000, 0x2bd9353a00000000, 0x8a4922d200000000, 0x3a145e5000000000, 0x9b8449b800000000, 0x3933005b00000000, 0x98a317b300000000, 0x3c5ae24600000000, 0x9dcaf5ae00000000, 0x3f7dbc4d00000000, 0x9eedaba500000000, 0x3688267d00000000, 0x9718319500000000, 0x35af787600000000, 0x943f6f9e00000000, 0x30c69a6b00000000, 0x91568d8300000000, 0x33e1c46000000000, 0x9271d38800000000, 0x125c4dbf00000000, 0xb3cc5a5700000000, 0x117b13b400000000, 0xb0eb045c00000000, 0x1412f1a900000000, 0xb582e64100000000, 0x1735afa200000000, 0xb6a5b84a00000000, 0x1ec0359200000000, 0xbf50227a00000000, 0x1de76b9900000000, 0xbc777c7100000000, 0x188e898400000000, 0xb91e9e6c00000000, 0x1ba9d78f00000000, 0xba39c06700000000, 0x0a64bce500000000, 0xabf4ab0d00000000, 0x0943e2ee00000000, 0xa8d3f50600000000, 0x0c2a00f300000000, 0xadba171b00000000, 0x0f0d5ef800000000, 0xae9d491000000000, 0x06f8c4c800000000, 0xa768d32000000000, 0x05df9ac300000000, 0xa44f8d2b00000000, 0x00b678de00000000, 0xa1266f3600000000, 0x039126d500000000, 0xa201313d00000000}, {0x0000000000000000, 0xee8439a100000000, 0x9d0f029900000000, 0x738b3b3800000000, 0x7b1975e900000000, 0x959d4c4800000000, 0xe616777000000000, 0x08924ed100000000, 0xb7349b0900000000, 0x59b0a2a800000000, 0x2a3b999000000000, 0xc4bfa03100000000, 0xcc2deee000000000, 0x22a9d74100000000, 0x5122ec7900000000, 0xbfa6d5d800000000, 0x6e69361300000000, 0x80ed0fb200000000, 0xf366348a00000000, 0x1de20d2b00000000, 0x157043fa00000000, 0xfbf47a5b00000000, 0x887f416300000000, 0x66fb78c200000000, 0xd95dad1a00000000, 0x37d994bb00000000, 0x4452af8300000000, 0xaad6962200000000, 0xa244d8f300000000, 0x4cc0e15200000000, 0x3f4bda6a00000000, 0xd1cfe3cb00000000, 0xdcd26c2600000000, 0x3256558700000000, 0x41dd6ebf00000000, 0xaf59571e00000000, 0xa7cb19cf00000000, 0x494f206e00000000, 0x3ac41b5600000000, 0xd44022f700000000, 0x6be6f72f00000000, 0x8562ce8e00000000, 0xf6e9f5b600000000, 0x186dcc1700000000, 0x10ff82c600000000, 0xfe7bbb6700000000, 0x8df0805f00000000, 0x6374b9fe00000000, 0xb2bb5a3500000000, 0x5c3f639400000000, 0x2fb458ac00000000, 0xc130610d00000000, 0xc9a22fdc00000000, 0x2726167d00000000, 0x54ad2d4500000000, 0xba2914e400000000, 0x058fc13c00000000, 0xeb0bf89d00000000, 0x9880c3a500000000, 0x7604fa0400000000, 0x7e96b4d500000000, 0x90128d7400000000, 0xe399b64c00000000, 0x0d1d8fed00000000, 0xb8a5d94c00000000, 0x5621e0ed00000000, 0x25aadbd500000000, 0xcb2ee27400000000, 0xc3bcaca500000000, 0x2d38950400000000, 0x5eb3ae3c00000000, 0xb037979d00000000, 0x0f91424500000000, 0xe1157be400000000, 0x929e40dc00000000, 0x7c1a797d00000000, 0x748837ac00000000, 0x9a0c0e0d00000000, 0xe987353500000000, 0x07030c9400000000, 0xd6ccef5f00000000, 0x3848d6fe00000000, 0x4bc3edc600000000, 0xa547d46700000000, 0xadd59ab600000000, 0x4351a31700000000, 0x30da982f00000000, 0xde5ea18e00000000, 0x61f8745600000000, 0x8f7c4df700000000, 0xfcf776cf00000000, 0x12734f6e00000000, 0x1ae101bf00000000, 0xf465381e00000000, 0x87ee032600000000, 0x696a3a8700000000, 0x6477b56a00000000, 0x8af38ccb00000000, 0xf978b7f300000000, 0x17fc8e5200000000, 0x1f6ec08300000000, 0xf1eaf92200000000, 0x8261c21a00000000, 0x6ce5fbbb00000000, 0xd3432e6300000000, 0x3dc717c200000000, 0x4e4c2cfa00000000, 0xa0c8155b00000000, 0xa85a5b8a00000000, 0x46de622b00000000, 0x3555591300000000, 0xdbd160b200000000, 0x0a1e837900000000, 0xe49abad800000000, 0x971181e000000000, 0x7995b84100000000, 0x7107f69000000000, 0x9f83cf3100000000, 0xec08f40900000000, 0x028ccda800000000, 0xbd2a187000000000, 0x53ae21d100000000, 0x20251ae900000000, 0xcea1234800000000, 0xc6336d9900000000, 0x28b7543800000000, 0x5b3c6f0000000000, 0xb5b856a100000000, 0x704bb39900000000, 0x9ecf8a3800000000, 0xed44b10000000000, 0x03c088a100000000, 0x0b52c67000000000, 0xe5d6ffd100000000, 0x965dc4e900000000, 0x78d9fd4800000000, 0xc77f289000000000, 0x29fb113100000000, 0x5a702a0900000000, 0xb4f413a800000000, 0xbc665d7900000000, 0x52e264d800000000, 0x21695fe000000000, 0xcfed664100000000, 0x1e22858a00000000, 0xf0a6bc2b00000000, 0x832d871300000000, 0x6da9beb200000000, 0x653bf06300000000, 0x8bbfc9c200000000, 0xf834f2fa00000000, 0x16b0cb5b00000000, 0xa9161e8300000000, 0x4792272200000000, 0x34191c1a00000000, 0xda9d25bb00000000, 0xd20f6b6a00000000, 0x3c8b52cb00000000, 0x4f0069f300000000, 0xa184505200000000, 0xac99dfbf00000000, 0x421de61e00000000, 0x3196dd2600000000, 0xdf12e48700000000, 0xd780aa5600000000, 0x390493f700000000, 0x4a8fa8cf00000000, 0xa40b916e00000000, 0x1bad44b600000000, 0xf5297d1700000000, 0x86a2462f00000000, 0x68267f8e00000000, 0x60b4315f00000000, 0x8e3008fe00000000, 0xfdbb33c600000000, 0x133f0a6700000000, 0xc2f0e9ac00000000, 0x2c74d00d00000000, 0x5fffeb3500000000, 0xb17bd29400000000, 0xb9e99c4500000000, 0x576da5e400000000, 0x24e69edc00000000, 0xca62a77d00000000, 0x75c472a500000000, 0x9b404b0400000000, 0xe8cb703c00000000, 0x064f499d00000000, 0x0edd074c00000000, 0xe0593eed00000000, 0x93d205d500000000, 0x7d563c7400000000, 0xc8ee6ad500000000, 0x266a537400000000, 0x55e1684c00000000, 0xbb6551ed00000000, 0xb3f71f3c00000000, 0x5d73269d00000000, 0x2ef81da500000000, 0xc07c240400000000, 0x7fdaf1dc00000000, 0x915ec87d00000000, 0xe2d5f34500000000, 0x0c51cae400000000, 0x04c3843500000000, 0xea47bd9400000000, 0x99cc86ac00000000, 0x7748bf0d00000000, 0xa6875cc600000000, 0x4803656700000000, 0x3b885e5f00000000, 0xd50c67fe00000000, 0xdd9e292f00000000, 0x331a108e00000000, 0x40912bb600000000, 0xae15121700000000, 0x11b3c7cf00000000, 0xff37fe6e00000000, 0x8cbcc55600000000, 0x6238fcf700000000, 0x6aaab22600000000, 0x842e8b8700000000, 0xf7a5b0bf00000000, 0x1921891e00000000, 0x143c06f300000000, 0xfab83f5200000000, 0x8933046a00000000, 0x67b73dcb00000000, 0x6f25731a00000000, 0x81a14abb00000000, 0xf22a718300000000, 0x1cae482200000000, 0xa3089dfa00000000, 0x4d8ca45b00000000, 0x3e079f6300000000, 0xd083a6c200000000, 0xd811e81300000000, 0x3695d1b200000000, 0x451eea8a00000000, 0xab9ad32b00000000, 0x7a5530e000000000, 0x94d1094100000000, 0xe75a327900000000, 0x09de0bd800000000, 0x014c450900000000, 0xefc87ca800000000, 0x9c43479000000000, 0x72c77e3100000000, 0xcd61abe900000000, 0x23e5924800000000, 0x506ea97000000000, 0xbeea90d100000000, 0xb678de0000000000, 0x58fce7a100000000, 0x2b77dc9900000000, 0xc5f3e53800000000}, {0x0000000000000000, 0xfbf6134700000000, 0xf6ed278e00000000, 0x0d1b34c900000000, 0xaddd3ec700000000, 0x562b2d8000000000, 0x5b30194900000000, 0xa0c60a0e00000000, 0x1bbd0c5500000000, 0xe04b1f1200000000, 0xed502bdb00000000, 0x16a6389c00000000, 0xb660329200000000, 0x4d9621d500000000, 0x408d151c00000000, 0xbb7b065b00000000, 0x367a19aa00000000, 0xcd8c0aed00000000, 0xc0973e2400000000, 0x3b612d6300000000, 0x9ba7276d00000000, 0x6051342a00000000, 0x6d4a00e300000000, 0x96bc13a400000000, 0x2dc715ff00000000, 0xd63106b800000000, 0xdb2a327100000000, 0x20dc213600000000, 0x801a2b3800000000, 0x7bec387f00000000, 0x76f70cb600000000, 0x8d011ff100000000, 0x2df2438f00000000, 0xd60450c800000000, 0xdb1f640100000000, 0x20e9774600000000, 0x802f7d4800000000, 0x7bd96e0f00000000, 0x76c25ac600000000, 0x8d34498100000000, 0x364f4fda00000000, 0xcdb95c9d00000000, 0xc0a2685400000000, 0x3b547b1300000000, 0x9b92711d00000000, 0x6064625a00000000, 0x6d7f569300000000, 0x968945d400000000, 0x1b885a2500000000, 0xe07e496200000000, 0xed657dab00000000, 0x16936eec00000000, 0xb65564e200000000, 0x4da377a500000000, 0x40b8436c00000000, 0xbb4e502b00000000, 0x0035567000000000, 0xfbc3453700000000, 0xf6d871fe00000000, 0x0d2e62b900000000, 0xade868b700000000, 0x561e7bf000000000, 0x5b054f3900000000, 0xa0f35c7e00000000, 0x1be2f6c500000000, 0xe014e58200000000, 0xed0fd14b00000000, 0x16f9c20c00000000, 0xb63fc80200000000, 0x4dc9db4500000000, 0x40d2ef8c00000000, 0xbb24fccb00000000, 0x005ffa9000000000, 0xfba9e9d700000000, 0xf6b2dd1e00000000, 0x0d44ce5900000000, 0xad82c45700000000, 0x5674d71000000000, 0x5b6fe3d900000000, 0xa099f09e00000000, 0x2d98ef6f00000000, 0xd66efc2800000000, 0xdb75c8e100000000, 0x2083dba600000000, 0x8045d1a800000000, 0x7bb3c2ef00000000, 0x76a8f62600000000, 0x8d5ee56100000000, 0x3625e33a00000000, 0xcdd3f07d00000000, 0xc0c8c4b400000000, 0x3b3ed7f300000000, 0x9bf8ddfd00000000, 0x600eceba00000000, 0x6d15fa7300000000, 0x96e3e93400000000, 0x3610b54a00000000, 0xcde6a60d00000000, 0xc0fd92c400000000, 0x3b0b818300000000, 0x9bcd8b8d00000000, 0x603b98ca00000000, 0x6d20ac0300000000, 0x96d6bf4400000000, 0x2dadb91f00000000, 0xd65baa5800000000, 0xdb409e9100000000, 0x20b68dd600000000, 0x807087d800000000, 0x7b86949f00000000, 0x769da05600000000, 0x8d6bb31100000000, 0x006aace000000000, 0xfb9cbfa700000000, 0xf6878b6e00000000, 0x0d71982900000000, 0xadb7922700000000, 0x5641816000000000, 0x5b5ab5a900000000, 0xa0aca6ee00000000, 0x1bd7a0b500000000, 0xe021b3f200000000, 0xed3a873b00000000, 0x16cc947c00000000, 0xb60a9e7200000000, 0x4dfc8d3500000000, 0x40e7b9fc00000000, 0xbb11aabb00000000, 0x77c29c5000000000, 0x8c348f1700000000, 0x812fbbde00000000, 0x7ad9a89900000000, 0xda1fa29700000000, 0x21e9b1d000000000, 0x2cf2851900000000, 0xd704965e00000000, 0x6c7f900500000000, 0x9789834200000000, 0x9a92b78b00000000, 0x6164a4cc00000000, 0xc1a2aec200000000, 0x3a54bd8500000000, 0x374f894c00000000, 0xccb99a0b00000000, 0x41b885fa00000000, 0xba4e96bd00000000, 0xb755a27400000000, 0x4ca3b13300000000, 0xec65bb3d00000000, 0x1793a87a00000000, 0x1a889cb300000000, 0xe17e8ff400000000, 0x5a0589af00000000, 0xa1f39ae800000000, 0xace8ae2100000000, 0x571ebd6600000000, 0xf7d8b76800000000, 0x0c2ea42f00000000, 0x013590e600000000, 0xfac383a100000000, 0x5a30dfdf00000000, 0xa1c6cc9800000000, 0xacddf85100000000, 0x572beb1600000000, 0xf7ede11800000000, 0x0c1bf25f00000000, 0x0100c69600000000, 0xfaf6d5d100000000, 0x418dd38a00000000, 0xba7bc0cd00000000, 0xb760f40400000000, 0x4c96e74300000000, 0xec50ed4d00000000, 0x17a6fe0a00000000, 0x1abdcac300000000, 0xe14bd98400000000, 0x6c4ac67500000000, 0x97bcd53200000000, 0x9aa7e1fb00000000, 0x6151f2bc00000000, 0xc197f8b200000000, 0x3a61ebf500000000, 0x377adf3c00000000, 0xcc8ccc7b00000000, 0x77f7ca2000000000, 0x8c01d96700000000, 0x811aedae00000000, 0x7aecfee900000000, 0xda2af4e700000000, 0x21dce7a000000000, 0x2cc7d36900000000, 0xd731c02e00000000, 0x6c206a9500000000, 0x97d679d200000000, 0x9acd4d1b00000000, 0x613b5e5c00000000, 0xc1fd545200000000, 0x3a0b471500000000, 0x371073dc00000000, 0xcce6609b00000000, 0x779d66c000000000, 0x8c6b758700000000, 0x8170414e00000000, 0x7a86520900000000, 0xda40580700000000, 0x21b64b4000000000, 0x2cad7f8900000000, 0xd75b6cce00000000, 0x5a5a733f00000000, 0xa1ac607800000000, 0xacb754b100000000, 0x574147f600000000, 0xf7874df800000000, 0x0c715ebf00000000, 0x016a6a7600000000, 0xfa9c793100000000, 0x41e77f6a00000000, 0xba116c2d00000000, 0xb70a58e400000000, 0x4cfc4ba300000000, 0xec3a41ad00000000, 0x17cc52ea00000000, 0x1ad7662300000000, 0xe121756400000000, 0x41d2291a00000000, 0xba243a5d00000000, 0xb73f0e9400000000, 0x4cc91dd300000000, 0xec0f17dd00000000, 0x17f9049a00000000, 0x1ae2305300000000, 0xe114231400000000, 0x5a6f254f00000000, 0xa199360800000000, 0xac8202c100000000, 0x5774118600000000, 0xf7b21b8800000000, 0x0c4408cf00000000, 0x015f3c0600000000, 0xfaa92f4100000000, 0x77a830b000000000, 0x8c5e23f700000000, 0x8145173e00000000, 0x7ab3047900000000, 0xda750e7700000000, 0x21831d3000000000, 0x2c9829f900000000, 0xd76e3abe00000000, 0x6c153ce500000000, 0x97e32fa200000000, 0x9af81b6b00000000, 0x610e082c00000000, 0xc1c8022200000000, 0x3a3e116500000000, 0x372525ac00000000, 0xccd336eb00000000}, {0x0000000000000000, 0x6238282a00000000, 0xc470505400000000, 0xa648787e00000000, 0x88e1a0a800000000, 0xead9888200000000, 0x4c91f0fc00000000, 0x2ea9d8d600000000, 0x51c5308a00000000, 0x33fd18a000000000, 0x95b560de00000000, 0xf78d48f400000000, 0xd924902200000000, 0xbb1cb80800000000, 0x1d54c07600000000, 0x7f6ce85c00000000, 0xe38c10cf00000000, 0x81b438e500000000, 0x27fc409b00000000, 0x45c468b100000000, 0x6b6db06700000000, 0x0955984d00000000, 0xaf1de03300000000, 0xcd25c81900000000, 0xb249204500000000, 0xd071086f00000000, 0x7639701100000000, 0x1401583b00000000, 0x3aa880ed00000000, 0x5890a8c700000000, 0xfed8d0b900000000, 0x9ce0f89300000000, 0x871f504500000000, 0xe527786f00000000, 0x436f001100000000, 0x2157283b00000000, 0x0ffef0ed00000000, 0x6dc6d8c700000000, 0xcb8ea0b900000000, 0xa9b6889300000000, 0xd6da60cf00000000, 0xb4e248e500000000, 0x12aa309b00000000, 0x709218b100000000, 0x5e3bc06700000000, 0x3c03e84d00000000, 0x9a4b903300000000, 0xf873b81900000000, 0x6493408a00000000, 0x06ab68a000000000, 0xa0e310de00000000, 0xc2db38f400000000, 0xec72e02200000000, 0x8e4ac80800000000, 0x2802b07600000000, 0x4a3a985c00000000, 0x3556700000000000, 0x576e582a00000000, 0xf126205400000000, 0x931e087e00000000, 0xbdb7d0a800000000, 0xdf8ff88200000000, 0x79c780fc00000000, 0x1bffa8d600000000, 0x0e3fa08a00000000, 0x6c0788a000000000, 0xca4ff0de00000000, 0xa877d8f400000000, 0x86de002200000000, 0xe4e6280800000000, 0x42ae507600000000, 0x2096785c00000000, 0x5ffa900000000000, 0x3dc2b82a00000000, 0x9b8ac05400000000, 0xf9b2e87e00000000, 0xd71b30a800000000, 0xb523188200000000, 0x136b60fc00000000, 0x715348d600000000, 0xedb3b04500000000, 0x8f8b986f00000000, 0x29c3e01100000000, 0x4bfbc83b00000000, 0x655210ed00000000, 0x076a38c700000000, 0xa12240b900000000, 0xc31a689300000000, 0xbc7680cf00000000, 0xde4ea8e500000000, 0x7806d09b00000000, 0x1a3ef8b100000000, 0x3497206700000000, 0x56af084d00000000, 0xf0e7703300000000, 0x92df581900000000, 0x8920f0cf00000000, 0xeb18d8e500000000, 0x4d50a09b00000000, 0x2f6888b100000000, 0x01c1506700000000, 0x63f9784d00000000, 0xc5b1003300000000, 0xa789281900000000, 0xd8e5c04500000000, 0xbadde86f00000000, 0x1c95901100000000, 0x7eadb83b00000000, 0x500460ed00000000, 0x323c48c700000000, 0x947430b900000000, 0xf64c189300000000, 0x6aace00000000000, 0x0894c82a00000000, 0xaedcb05400000000, 0xcce4987e00000000, 0xe24d40a800000000, 0x8075688200000000, 0x263d10fc00000000, 0x440538d600000000, 0x3b69d08a00000000, 0x5951f8a000000000, 0xff1980de00000000, 0x9d21a8f400000000, 0xb388702200000000, 0xd1b0580800000000, 0x77f8207600000000, 0x15c0085c00000000, 0x5d7831ce00000000, 0x3f4019e400000000, 0x9908619a00000000, 0xfb3049b000000000, 0xd599916600000000, 0xb7a1b94c00000000, 0x11e9c13200000000, 0x73d1e91800000000, 0x0cbd014400000000, 0x6e85296e00000000, 0xc8cd511000000000, 0xaaf5793a00000000, 0x845ca1ec00000000, 0xe66489c600000000, 0x402cf1b800000000, 0x2214d99200000000, 0xbef4210100000000, 0xdccc092b00000000, 0x7a84715500000000, 0x18bc597f00000000, 0x361581a900000000, 0x542da98300000000, 0xf265d1fd00000000, 0x905df9d700000000, 0xef31118b00000000, 0x8d0939a100000000, 0x2b4141df00000000, 0x497969f500000000, 0x67d0b12300000000, 0x05e8990900000000, 0xa3a0e17700000000, 0xc198c95d00000000, 0xda67618b00000000, 0xb85f49a100000000, 0x1e1731df00000000, 0x7c2f19f500000000, 0x5286c12300000000, 0x30bee90900000000, 0x96f6917700000000, 0xf4ceb95d00000000, 0x8ba2510100000000, 0xe99a792b00000000, 0x4fd2015500000000, 0x2dea297f00000000, 0x0343f1a900000000, 0x617bd98300000000, 0xc733a1fd00000000, 0xa50b89d700000000, 0x39eb714400000000, 0x5bd3596e00000000, 0xfd9b211000000000, 0x9fa3093a00000000, 0xb10ad1ec00000000, 0xd332f9c600000000, 0x757a81b800000000, 0x1742a99200000000, 0x682e41ce00000000, 0x0a1669e400000000, 0xac5e119a00000000, 0xce6639b000000000, 0xe0cfe16600000000, 0x82f7c94c00000000, 0x24bfb13200000000, 0x4687991800000000, 0x5347914400000000, 0x317fb96e00000000, 0x9737c11000000000, 0xf50fe93a00000000, 0xdba631ec00000000, 0xb99e19c600000000, 0x1fd661b800000000, 0x7dee499200000000, 0x0282a1ce00000000, 0x60ba89e400000000, 0xc6f2f19a00000000, 0xa4cad9b000000000, 0x8a63016600000000, 0xe85b294c00000000, 0x4e13513200000000, 0x2c2b791800000000, 0xb0cb818b00000000, 0xd2f3a9a100000000, 0x74bbd1df00000000, 0x1683f9f500000000, 0x382a212300000000, 0x5a12090900000000, 0xfc5a717700000000, 0x9e62595d00000000, 0xe10eb10100000000, 0x8336992b00000000, 0x257ee15500000000, 0x4746c97f00000000, 0x69ef11a900000000, 0x0bd7398300000000, 0xad9f41fd00000000, 0xcfa769d700000000, 0xd458c10100000000, 0xb660e92b00000000, 0x1028915500000000, 0x7210b97f00000000, 0x5cb961a900000000, 0x3e81498300000000, 0x98c931fd00000000, 0xfaf119d700000000, 0x859df18b00000000, 0xe7a5d9a100000000, 0x41eda1df00000000, 0x23d589f500000000, 0x0d7c512300000000, 0x6f44790900000000, 0xc90c017700000000, 0xab34295d00000000, 0x37d4d1ce00000000, 0x55ecf9e400000000, 0xf3a4819a00000000, 0x919ca9b000000000, 0xbf35716600000000, 0xdd0d594c00000000, 0x7b45213200000000, 0x197d091800000000, 0x6611e14400000000, 0x0429c96e00000000, 0xa261b11000000000, 0xc059993a00000000, 0xeef041ec00000000, 0x8cc869c600000000, 0x2a8011b800000000, 0x48b8399200000000}, {0x0000000000000000, 0x4c2896a300000000, 0xd9565d9c00000000, 0x957ecb3f00000000, 0xf3abcbe300000000, 0xbf835d4000000000, 0x2afd967f00000000, 0x66d500dc00000000, 0xa751e61c00000000, 0xeb7970bf00000000, 0x7e07bb8000000000, 0x322f2d2300000000, 0x54fa2dff00000000, 0x18d2bb5c00000000, 0x8dac706300000000, 0xc184e6c000000000, 0x4ea3cc3900000000, 0x028b5a9a00000000, 0x97f591a500000000, 0xdbdd070600000000, 0xbd0807da00000000, 0xf120917900000000, 0x645e5a4600000000, 0x2876cce500000000, 0xe9f22a2500000000, 0xa5dabc8600000000, 0x30a477b900000000, 0x7c8ce11a00000000, 0x1a59e1c600000000, 0x5671776500000000, 0xc30fbc5a00000000, 0x8f272af900000000, 0x9c46997300000000, 0xd06e0fd000000000, 0x4510c4ef00000000, 0x0938524c00000000, 0x6fed529000000000, 0x23c5c43300000000, 0xb6bb0f0c00000000, 0xfa9399af00000000, 0x3b177f6f00000000, 0x773fe9cc00000000, 0xe24122f300000000, 0xae69b45000000000, 0xc8bcb48c00000000, 0x8494222f00000000, 0x11eae91000000000, 0x5dc27fb300000000, 0xd2e5554a00000000, 0x9ecdc3e900000000, 0x0bb308d600000000, 0x479b9e7500000000, 0x214e9ea900000000, 0x6d66080a00000000, 0xf818c33500000000, 0xb430559600000000, 0x75b4b35600000000, 0x399c25f500000000, 0xace2eeca00000000, 0xe0ca786900000000, 0x861f78b500000000, 0xca37ee1600000000, 0x5f49252900000000, 0x1361b38a00000000, 0x388d32e700000000, 0x74a5a44400000000, 0xe1db6f7b00000000, 0xadf3f9d800000000, 0xcb26f90400000000, 0x870e6fa700000000, 0x1270a49800000000, 0x5e58323b00000000, 0x9fdcd4fb00000000, 0xd3f4425800000000, 0x468a896700000000, 0x0aa21fc400000000, 0x6c771f1800000000, 0x205f89bb00000000, 0xb521428400000000, 0xf909d42700000000, 0x762efede00000000, 0x3a06687d00000000, 0xaf78a34200000000, 0xe35035e100000000, 0x8585353d00000000, 0xc9ada39e00000000, 0x5cd368a100000000, 0x10fbfe0200000000, 0xd17f18c200000000, 0x9d578e6100000000, 0x0829455e00000000, 0x4401d3fd00000000, 0x22d4d32100000000, 0x6efc458200000000, 0xfb828ebd00000000, 0xb7aa181e00000000, 0xa4cbab9400000000, 0xe8e33d3700000000, 0x7d9df60800000000, 0x31b560ab00000000, 0x5760607700000000, 0x1b48f6d400000000, 0x8e363deb00000000, 0xc21eab4800000000, 0x039a4d8800000000, 0x4fb2db2b00000000, 0xdacc101400000000, 0x96e486b700000000, 0xf031866b00000000, 0xbc1910c800000000, 0x2967dbf700000000, 0x654f4d5400000000, 0xea6867ad00000000, 0xa640f10e00000000, 0x333e3a3100000000, 0x7f16ac9200000000, 0x19c3ac4e00000000, 0x55eb3aed00000000, 0xc095f1d200000000, 0x8cbd677100000000, 0x4d3981b100000000, 0x0111171200000000, 0x946fdc2d00000000, 0xd8474a8e00000000, 0xbe924a5200000000, 0xf2badcf100000000, 0x67c417ce00000000, 0x2bec816d00000000, 0x311c141500000000, 0x7d3482b600000000, 0xe84a498900000000, 0xa462df2a00000000, 0xc2b7dff600000000, 0x8e9f495500000000, 0x1be1826a00000000, 0x57c914c900000000, 0x964df20900000000, 0xda6564aa00000000, 0x4f1baf9500000000, 0x0333393600000000, 0x65e639ea00000000, 0x29ceaf4900000000, 0xbcb0647600000000, 0xf098f2d500000000, 0x7fbfd82c00000000, 0x33974e8f00000000, 0xa6e985b000000000, 0xeac1131300000000, 0x8c1413cf00000000, 0xc03c856c00000000, 0x55424e5300000000, 0x196ad8f000000000, 0xd8ee3e3000000000, 0x94c6a89300000000, 0x01b863ac00000000, 0x4d90f50f00000000, 0x2b45f5d300000000, 0x676d637000000000, 0xf213a84f00000000, 0xbe3b3eec00000000, 0xad5a8d6600000000, 0xe1721bc500000000, 0x740cd0fa00000000, 0x3824465900000000, 0x5ef1468500000000, 0x12d9d02600000000, 0x87a71b1900000000, 0xcb8f8dba00000000, 0x0a0b6b7a00000000, 0x4623fdd900000000, 0xd35d36e600000000, 0x9f75a04500000000, 0xf9a0a09900000000, 0xb588363a00000000, 0x20f6fd0500000000, 0x6cde6ba600000000, 0xe3f9415f00000000, 0xafd1d7fc00000000, 0x3aaf1cc300000000, 0x76878a6000000000, 0x10528abc00000000, 0x5c7a1c1f00000000, 0xc904d72000000000, 0x852c418300000000, 0x44a8a74300000000, 0x088031e000000000, 0x9dfefadf00000000, 0xd1d66c7c00000000, 0xb7036ca000000000, 0xfb2bfa0300000000, 0x6e55313c00000000, 0x227da79f00000000, 0x099126f200000000, 0x45b9b05100000000, 0xd0c77b6e00000000, 0x9cefedcd00000000, 0xfa3aed1100000000, 0xb6127bb200000000, 0x236cb08d00000000, 0x6f44262e00000000, 0xaec0c0ee00000000, 0xe2e8564d00000000, 0x77969d7200000000, 0x3bbe0bd100000000, 0x5d6b0b0d00000000, 0x11439dae00000000, 0x843d569100000000, 0xc815c03200000000, 0x4732eacb00000000, 0x0b1a7c6800000000, 0x9e64b75700000000, 0xd24c21f400000000, 0xb499212800000000, 0xf8b1b78b00000000, 0x6dcf7cb400000000, 0x21e7ea1700000000, 0xe0630cd700000000, 0xac4b9a7400000000, 0x3935514b00000000, 0x751dc7e800000000, 0x13c8c73400000000, 0x5fe0519700000000, 0xca9e9aa800000000, 0x86b60c0b00000000, 0x95d7bf8100000000, 0xd9ff292200000000, 0x4c81e21d00000000, 0x00a974be00000000, 0x667c746200000000, 0x2a54e2c100000000, 0xbf2a29fe00000000, 0xf302bf5d00000000, 0x3286599d00000000, 0x7eaecf3e00000000, 0xebd0040100000000, 0xa7f892a200000000, 0xc12d927e00000000, 0x8d0504dd00000000, 0x187bcfe200000000, 0x5453594100000000, 0xdb7473b800000000, 0x975ce51b00000000, 0x02222e2400000000, 0x4e0ab88700000000, 0x28dfb85b00000000, 0x64f72ef800000000, 0xf189e5c700000000, 0xbda1736400000000, 0x7c2595a400000000, 0x300d030700000000, 0xa573c83800000000, 0xe95b5e9b00000000, 0x8f8e5e4700000000, 0xc3a6c8e400000000, 0x56d803db00000000, 0x1af0957800000000}, {0x0000000000000000, 0x939bc97f00000000, 0x263793ff00000000, 0xb5ac5a8000000000, 0x0d68572400000000, 0x9ef39e5b00000000, 0x2b5fc4db00000000, 0xb8c40da400000000, 0x1ad0ae4800000000, 0x894b673700000000, 0x3ce73db700000000, 0xaf7cf4c800000000, 0x17b8f96c00000000, 0x8423301300000000, 0x318f6a9300000000, 0xa214a3ec00000000, 0x34a05d9100000000, 0xa73b94ee00000000, 0x1297ce6e00000000, 0x810c071100000000, 0x39c80ab500000000, 0xaa53c3ca00000000, 0x1fff994a00000000, 0x8c64503500000000, 0x2e70f3d900000000, 0xbdeb3aa600000000, 0x0847602600000000, 0x9bdca95900000000, 0x2318a4fd00000000, 0xb0836d8200000000, 0x052f370200000000, 0x96b4fe7d00000000, 0x2946caf900000000, 0xbadd038600000000, 0x0f71590600000000, 0x9cea907900000000, 0x242e9ddd00000000, 0xb7b554a200000000, 0x02190e2200000000, 0x9182c75d00000000, 0x339664b100000000, 0xa00dadce00000000, 0x15a1f74e00000000, 0x863a3e3100000000, 0x3efe339500000000, 0xad65faea00000000, 0x18c9a06a00000000, 0x8b52691500000000, 0x1de6976800000000, 0x8e7d5e1700000000, 0x3bd1049700000000, 0xa84acde800000000, 0x108ec04c00000000, 0x8315093300000000, 0x36b953b300000000, 0xa5229acc00000000, 0x0736392000000000, 0x94adf05f00000000, 0x2101aadf00000000, 0xb29a63a000000000, 0x0a5e6e0400000000, 0x99c5a77b00000000, 0x2c69fdfb00000000, 0xbff2348400000000, 0x138ae52800000000, 0x80112c5700000000, 0x35bd76d700000000, 0xa626bfa800000000, 0x1ee2b20c00000000, 0x8d797b7300000000, 0x38d521f300000000, 0xab4ee88c00000000, 0x095a4b6000000000, 0x9ac1821f00000000, 0x2f6dd89f00000000, 0xbcf611e000000000, 0x04321c4400000000, 0x97a9d53b00000000, 0x22058fbb00000000, 0xb19e46c400000000, 0x272ab8b900000000, 0xb4b171c600000000, 0x011d2b4600000000, 0x9286e23900000000, 0x2a42ef9d00000000, 0xb9d926e200000000, 0x0c757c6200000000, 0x9feeb51d00000000, 0x3dfa16f100000000, 0xae61df8e00000000, 0x1bcd850e00000000, 0x88564c7100000000, 0x309241d500000000, 0xa30988aa00000000, 0x16a5d22a00000000, 0x853e1b5500000000, 0x3acc2fd100000000, 0xa957e6ae00000000, 0x1cfbbc2e00000000, 0x8f60755100000000, 0x37a478f500000000, 0xa43fb18a00000000, 0x1193eb0a00000000, 0x8208227500000000, 0x201c819900000000, 0xb38748e600000000, 0x062b126600000000, 0x95b0db1900000000, 0x2d74d6bd00000000, 0xbeef1fc200000000, 0x0b43454200000000, 0x98d88c3d00000000, 0x0e6c724000000000, 0x9df7bb3f00000000, 0x285be1bf00000000, 0xbbc028c000000000, 0x0304256400000000, 0x909fec1b00000000, 0x2533b69b00000000, 0xb6a87fe400000000, 0x14bcdc0800000000, 0x8727157700000000, 0x328b4ff700000000, 0xa110868800000000, 0x19d48b2c00000000, 0x8a4f425300000000, 0x3fe318d300000000, 0xac78d1ac00000000, 0x2614cb5100000000, 0xb58f022e00000000, 0x002358ae00000000, 0x93b891d100000000, 0x2b7c9c7500000000, 0xb8e7550a00000000, 0x0d4b0f8a00000000, 0x9ed0c6f500000000, 0x3cc4651900000000, 0xaf5fac6600000000, 0x1af3f6e600000000, 0x89683f9900000000, 0x31ac323d00000000, 0xa237fb4200000000, 0x179ba1c200000000, 0x840068bd00000000, 0x12b496c000000000, 0x812f5fbf00000000, 0x3483053f00000000, 0xa718cc4000000000, 0x1fdcc1e400000000, 0x8c47089b00000000, 0x39eb521b00000000, 0xaa709b6400000000, 0x0864388800000000, 0x9bfff1f700000000, 0x2e53ab7700000000, 0xbdc8620800000000, 0x050c6fac00000000, 0x9697a6d300000000, 0x233bfc5300000000, 0xb0a0352c00000000, 0x0f5201a800000000, 0x9cc9c8d700000000, 0x2965925700000000, 0xbafe5b2800000000, 0x023a568c00000000, 0x91a19ff300000000, 0x240dc57300000000, 0xb7960c0c00000000, 0x1582afe000000000, 0x8619669f00000000, 0x33b53c1f00000000, 0xa02ef56000000000, 0x18eaf8c400000000, 0x8b7131bb00000000, 0x3edd6b3b00000000, 0xad46a24400000000, 0x3bf25c3900000000, 0xa869954600000000, 0x1dc5cfc600000000, 0x8e5e06b900000000, 0x369a0b1d00000000, 0xa501c26200000000, 0x10ad98e200000000, 0x8336519d00000000, 0x2122f27100000000, 0xb2b93b0e00000000, 0x0715618e00000000, 0x948ea8f100000000, 0x2c4aa55500000000, 0xbfd16c2a00000000, 0x0a7d36aa00000000, 0x99e6ffd500000000, 0x359e2e7900000000, 0xa605e70600000000, 0x13a9bd8600000000, 0x803274f900000000, 0x38f6795d00000000, 0xab6db02200000000, 0x1ec1eaa200000000, 0x8d5a23dd00000000, 0x2f4e803100000000, 0xbcd5494e00000000, 0x097913ce00000000, 0x9ae2dab100000000, 0x2226d71500000000, 0xb1bd1e6a00000000, 0x041144ea00000000, 0x978a8d9500000000, 0x013e73e800000000, 0x92a5ba9700000000, 0x2709e01700000000, 0xb492296800000000, 0x0c5624cc00000000, 0x9fcdedb300000000, 0x2a61b73300000000, 0xb9fa7e4c00000000, 0x1beedda000000000, 0x887514df00000000, 0x3dd94e5f00000000, 0xae42872000000000, 0x16868a8400000000, 0x851d43fb00000000, 0x30b1197b00000000, 0xa32ad00400000000, 0x1cd8e48000000000, 0x8f432dff00000000, 0x3aef777f00000000, 0xa974be0000000000, 0x11b0b3a400000000, 0x822b7adb00000000, 0x3787205b00000000, 0xa41ce92400000000, 0x06084ac800000000, 0x959383b700000000, 0x203fd93700000000, 0xb3a4104800000000, 0x0b601dec00000000, 0x98fbd49300000000, 0x2d578e1300000000, 0xbecc476c00000000, 0x2878b91100000000, 0xbbe3706e00000000, 0x0e4f2aee00000000, 0x9dd4e39100000000, 0x2510ee3500000000, 0xb68b274a00000000, 0x03277dca00000000, 0x90bcb4b500000000, 0x32a8175900000000, 0xa133de2600000000, 0x149f84a600000000, 0x87044dd900000000, 0x3fc0407d00000000, 0xac5b890200000000, 0x19f7d38200000000, 0x8a6c1afd00000000}, {0x0000000000000000, 0x650b796900000000, 0xca16f2d200000000, 0xaf1d8bbb00000000, 0xd52b957e00000000, 0xb020ec1700000000, 0x1f3d67ac00000000, 0x7a361ec500000000, 0xaa572afd00000000, 0xcf5c539400000000, 0x6041d82f00000000, 0x054aa14600000000, 0x7f7cbf8300000000, 0x1a77c6ea00000000, 0xb56a4d5100000000, 0xd061343800000000, 0x15a9252100000000, 0x70a25c4800000000, 0xdfbfd7f300000000, 0xbab4ae9a00000000, 0xc082b05f00000000, 0xa589c93600000000, 0x0a94428d00000000, 0x6f9f3be400000000, 0xbffe0fdc00000000, 0xdaf576b500000000, 0x75e8fd0e00000000, 0x10e3846700000000, 0x6ad59aa200000000, 0x0fdee3cb00000000, 0xa0c3687000000000, 0xc5c8111900000000, 0x2a524b4200000000, 0x4f59322b00000000, 0xe044b99000000000, 0x854fc0f900000000, 0xff79de3c00000000, 0x9a72a75500000000, 0x356f2cee00000000, 0x5064558700000000, 0x800561bf00000000, 0xe50e18d600000000, 0x4a13936d00000000, 0x2f18ea0400000000, 0x552ef4c100000000, 0x30258da800000000, 0x9f38061300000000, 0xfa337f7a00000000, 0x3ffb6e6300000000, 0x5af0170a00000000, 0xf5ed9cb100000000, 0x90e6e5d800000000, 0xead0fb1d00000000, 0x8fdb827400000000, 0x20c609cf00000000, 0x45cd70a600000000, 0x95ac449e00000000, 0xf0a73df700000000, 0x5fbab64c00000000, 0x3ab1cf2500000000, 0x4087d1e000000000, 0x258ca88900000000, 0x8a91233200000000, 0xef9a5a5b00000000, 0x54a4968400000000, 0x31afefed00000000, 0x9eb2645600000000, 0xfbb91d3f00000000, 0x818f03fa00000000, 0xe4847a9300000000, 0x4b99f12800000000, 0x2e92884100000000, 0xfef3bc7900000000, 0x9bf8c51000000000, 0x34e54eab00000000, 0x51ee37c200000000, 0x2bd8290700000000, 0x4ed3506e00000000, 0xe1cedbd500000000, 0x84c5a2bc00000000, 0x410db3a500000000, 0x2406cacc00000000, 0x8b1b417700000000, 0xee10381e00000000, 0x942626db00000000, 0xf12d5fb200000000, 0x5e30d40900000000, 0x3b3bad6000000000, 0xeb5a995800000000, 0x8e51e03100000000, 0x214c6b8a00000000, 0x444712e300000000, 0x3e710c2600000000, 0x5b7a754f00000000, 0xf467fef400000000, 0x916c879d00000000, 0x7ef6ddc600000000, 0x1bfda4af00000000, 0xb4e02f1400000000, 0xd1eb567d00000000, 0xabdd48b800000000, 0xced631d100000000, 0x61cbba6a00000000, 0x04c0c30300000000, 0xd4a1f73b00000000, 0xb1aa8e5200000000, 0x1eb705e900000000, 0x7bbc7c8000000000, 0x018a624500000000, 0x64811b2c00000000, 0xcb9c909700000000, 0xae97e9fe00000000, 0x6b5ff8e700000000, 0x0e54818e00000000, 0xa1490a3500000000, 0xc442735c00000000, 0xbe746d9900000000, 0xdb7f14f000000000, 0x74629f4b00000000, 0x1169e62200000000, 0xc108d21a00000000, 0xa403ab7300000000, 0x0b1e20c800000000, 0x6e1559a100000000, 0x1423476400000000, 0x71283e0d00000000, 0xde35b5b600000000, 0xbb3eccdf00000000, 0xe94e5cd200000000, 0x8c4525bb00000000, 0x2358ae0000000000, 0x4653d76900000000, 0x3c65c9ac00000000, 0x596eb0c500000000, 0xf6733b7e00000000, 0x9378421700000000, 0x4319762f00000000, 0x26120f4600000000, 0x890f84fd00000000, 0xec04fd9400000000, 0x9632e35100000000, 0xf3399a3800000000, 0x5c24118300000000, 0x392f68ea00000000, 0xfce779f300000000, 0x99ec009a00000000, 0x36f18b2100000000, 0x53faf24800000000, 0x29ccec8d00000000, 0x4cc795e400000000, 0xe3da1e5f00000000, 0x86d1673600000000, 0x56b0530e00000000, 0x33bb2a6700000000, 0x9ca6a1dc00000000, 0xf9add8b500000000, 0x839bc67000000000, 0xe690bf1900000000, 0x498d34a200000000, 0x2c864dcb00000000, 0xc31c179000000000, 0xa6176ef900000000, 0x090ae54200000000, 0x6c019c2b00000000, 0x163782ee00000000, 0x733cfb8700000000, 0xdc21703c00000000, 0xb92a095500000000, 0x694b3d6d00000000, 0x0c40440400000000, 0xa35dcfbf00000000, 0xc656b6d600000000, 0xbc60a81300000000, 0xd96bd17a00000000, 0x76765ac100000000, 0x137d23a800000000, 0xd6b532b100000000, 0xb3be4bd800000000, 0x1ca3c06300000000, 0x79a8b90a00000000, 0x039ea7cf00000000, 0x6695dea600000000, 0xc988551d00000000, 0xac832c7400000000, 0x7ce2184c00000000, 0x19e9612500000000, 0xb6f4ea9e00000000, 0xd3ff93f700000000, 0xa9c98d3200000000, 0xccc2f45b00000000, 0x63df7fe000000000, 0x06d4068900000000, 0xbdeaca5600000000, 0xd8e1b33f00000000, 0x77fc388400000000, 0x12f741ed00000000, 0x68c15f2800000000, 0x0dca264100000000, 0xa2d7adfa00000000, 0xc7dcd49300000000, 0x17bde0ab00000000, 0x72b699c200000000, 0xddab127900000000, 0xb8a06b1000000000, 0xc29675d500000000, 0xa79d0cbc00000000, 0x0880870700000000, 0x6d8bfe6e00000000, 0xa843ef7700000000, 0xcd48961e00000000, 0x62551da500000000, 0x075e64cc00000000, 0x7d687a0900000000, 0x1863036000000000, 0xb77e88db00000000, 0xd275f1b200000000, 0x0214c58a00000000, 0x671fbce300000000, 0xc802375800000000, 0xad094e3100000000, 0xd73f50f400000000, 0xb234299d00000000, 0x1d29a22600000000, 0x7822db4f00000000, 0x97b8811400000000, 0xf2b3f87d00000000, 0x5dae73c600000000, 0x38a50aaf00000000, 0x4293146a00000000, 0x27986d0300000000, 0x8885e6b800000000, 0xed8e9fd100000000, 0x3defabe900000000, 0x58e4d28000000000, 0xf7f9593b00000000, 0x92f2205200000000, 0xe8c43e9700000000, 0x8dcf47fe00000000, 0x22d2cc4500000000, 0x47d9b52c00000000, 0x8211a43500000000, 0xe71add5c00000000, 0x480756e700000000, 0x2d0c2f8e00000000, 0x573a314b00000000, 0x3231482200000000, 0x9d2cc39900000000, 0xf827baf000000000, 0x28468ec800000000, 0x4d4df7a100000000, 0xe2507c1a00000000, 0x875b057300000000, 0xfd6d1bb600000000, 0x986662df00000000, 0x377be96400000000, 0x5270900d00000000}, {0x0000000000000000, 0xdcecb13d00000000, 0xb8d9637b00000000, 0x6435d24600000000, 0x70b3c7f600000000, 0xac5f76cb00000000, 0xc86aa48d00000000, 0x148615b000000000, 0xa160fe3600000000, 0x7d8c4f0b00000000, 0x19b99d4d00000000, 0xc5552c7000000000, 0xd1d339c000000000, 0x0d3f88fd00000000, 0x690a5abb00000000, 0xb5e6eb8600000000, 0x42c1fc6d00000000, 0x9e2d4d5000000000, 0xfa189f1600000000, 0x26f42e2b00000000, 0x32723b9b00000000, 0xee9e8aa600000000, 0x8aab58e000000000, 0x5647e9dd00000000, 0xe3a1025b00000000, 0x3f4db36600000000, 0x5b78612000000000, 0x8794d01d00000000, 0x9312c5ad00000000, 0x4ffe749000000000, 0x2bcba6d600000000, 0xf72717eb00000000, 0x8482f9db00000000, 0x586e48e600000000, 0x3c5b9aa000000000, 0xe0b72b9d00000000, 0xf4313e2d00000000, 0x28dd8f1000000000, 0x4ce85d5600000000, 0x9004ec6b00000000, 0x25e207ed00000000, 0xf90eb6d000000000, 0x9d3b649600000000, 0x41d7d5ab00000000, 0x5551c01b00000000, 0x89bd712600000000, 0xed88a36000000000, 0x3164125d00000000, 0xc64305b600000000, 0x1aafb48b00000000, 0x7e9a66cd00000000, 0xa276d7f000000000, 0xb6f0c24000000000, 0x6a1c737d00000000, 0x0e29a13b00000000, 0xd2c5100600000000, 0x6723fb8000000000, 0xbbcf4abd00000000, 0xdffa98fb00000000, 0x031629c600000000, 0x17903c7600000000, 0xcb7c8d4b00000000, 0xaf495f0d00000000, 0x73a5ee3000000000, 0x4903826c00000000, 0x95ef335100000000, 0xf1dae11700000000, 0x2d36502a00000000, 0x39b0459a00000000, 0xe55cf4a700000000, 0x816926e100000000, 0x5d8597dc00000000, 0xe8637c5a00000000, 0x348fcd6700000000, 0x50ba1f2100000000, 0x8c56ae1c00000000, 0x98d0bbac00000000, 0x443c0a9100000000, 0x2009d8d700000000, 0xfce569ea00000000, 0x0bc27e0100000000, 0xd72ecf3c00000000, 0xb31b1d7a00000000, 0x6ff7ac4700000000, 0x7b71b9f700000000, 0xa79d08ca00000000, 0xc3a8da8c00000000, 0x1f446bb100000000, 0xaaa2803700000000, 0x764e310a00000000, 0x127be34c00000000, 0xce97527100000000, 0xda1147c100000000, 0x06fdf6fc00000000, 0x62c824ba00000000, 0xbe24958700000000, 0xcd817bb700000000, 0x116dca8a00000000, 0x755818cc00000000, 0xa9b4a9f100000000, 0xbd32bc4100000000, 0x61de0d7c00000000, 0x05ebdf3a00000000, 0xd9076e0700000000, 0x6ce1858100000000, 0xb00d34bc00000000, 0xd438e6fa00000000, 0x08d457c700000000, 0x1c52427700000000, 0xc0bef34a00000000, 0xa48b210c00000000, 0x7867903100000000, 0x8f4087da00000000, 0x53ac36e700000000, 0x3799e4a100000000, 0xeb75559c00000000, 0xfff3402c00000000, 0x231ff11100000000, 0x472a235700000000, 0x9bc6926a00000000, 0x2e2079ec00000000, 0xf2ccc8d100000000, 0x96f91a9700000000, 0x4a15abaa00000000, 0x5e93be1a00000000, 0x827f0f2700000000, 0xe64add6100000000, 0x3aa66c5c00000000, 0x920604d900000000, 0x4eeab5e400000000, 0x2adf67a200000000, 0xf633d69f00000000, 0xe2b5c32f00000000, 0x3e59721200000000, 0x5a6ca05400000000, 0x8680116900000000, 0x3366faef00000000, 0xef8a4bd200000000, 0x8bbf999400000000, 0x575328a900000000, 0x43d53d1900000000, 0x9f398c2400000000, 0xfb0c5e6200000000, 0x27e0ef5f00000000, 0xd0c7f8b400000000, 0x0c2b498900000000, 0x681e9bcf00000000, 0xb4f22af200000000, 0xa0743f4200000000, 0x7c988e7f00000000, 0x18ad5c3900000000, 0xc441ed0400000000, 0x71a7068200000000, 0xad4bb7bf00000000, 0xc97e65f900000000, 0x1592d4c400000000, 0x0114c17400000000, 0xddf8704900000000, 0xb9cda20f00000000, 0x6521133200000000, 0x1684fd0200000000, 0xca684c3f00000000, 0xae5d9e7900000000, 0x72b12f4400000000, 0x66373af400000000, 0xbadb8bc900000000, 0xdeee598f00000000, 0x0202e8b200000000, 0xb7e4033400000000, 0x6b08b20900000000, 0x0f3d604f00000000, 0xd3d1d17200000000, 0xc757c4c200000000, 0x1bbb75ff00000000, 0x7f8ea7b900000000, 0xa362168400000000, 0x5445016f00000000, 0x88a9b05200000000, 0xec9c621400000000, 0x3070d32900000000, 0x24f6c69900000000, 0xf81a77a400000000, 0x9c2fa5e200000000, 0x40c314df00000000, 0xf525ff5900000000, 0x29c94e6400000000, 0x4dfc9c2200000000, 0x91102d1f00000000, 0x859638af00000000, 0x597a899200000000, 0x3d4f5bd400000000, 0xe1a3eae900000000, 0xdb0586b500000000, 0x07e9378800000000, 0x63dce5ce00000000, 0xbf3054f300000000, 0xabb6414300000000, 0x775af07e00000000, 0x136f223800000000, 0xcf83930500000000, 0x7a65788300000000, 0xa689c9be00000000, 0xc2bc1bf800000000, 0x1e50aac500000000, 0x0ad6bf7500000000, 0xd63a0e4800000000, 0xb20fdc0e00000000, 0x6ee36d3300000000, 0x99c47ad800000000, 0x4528cbe500000000, 0x211d19a300000000, 0xfdf1a89e00000000, 0xe977bd2e00000000, 0x359b0c1300000000, 0x51aede5500000000, 0x8d426f6800000000, 0x38a484ee00000000, 0xe44835d300000000, 0x807de79500000000, 0x5c9156a800000000, 0x4817431800000000, 0x94fbf22500000000, 0xf0ce206300000000, 0x2c22915e00000000, 0x5f877f6e00000000, 0x836bce5300000000, 0xe75e1c1500000000, 0x3bb2ad2800000000, 0x2f34b89800000000, 0xf3d809a500000000, 0x97eddbe300000000, 0x4b016ade00000000, 0xfee7815800000000, 0x220b306500000000, 0x463ee22300000000, 0x9ad2531e00000000, 0x8e5446ae00000000, 0x52b8f79300000000, 0x368d25d500000000, 0xea6194e800000000, 0x1d46830300000000, 0xc1aa323e00000000, 0xa59fe07800000000, 0x7973514500000000, 0x6df544f500000000, 0xb119f5c800000000, 0xd52c278e00000000, 0x09c096b300000000, 0xbc267d3500000000, 0x60cacc0800000000, 0x04ff1e4e00000000, 0xd813af7300000000, 0xcc95bac300000000, 0x10790bfe00000000, 0x744cd9b800000000, 0xa8a0688500000000}}; #else /* W == 4 */ local const z_crc_t FAR crc_braid_table[][256] = { {0x00000000, 0x81256527, 0xd93bcc0f, 0x581ea928, 0x69069e5f, 0xe823fb78, 0xb03d5250, 0x31183777, 0xd20d3cbe, 0x53285999, 0x0b36f0b1, 0x8a139596, 0xbb0ba2e1, 0x3a2ec7c6, 0x62306eee, 0xe3150bc9, 0x7f6b7f3d, 0xfe4e1a1a, 0xa650b332, 0x2775d615, 0x166de162, 0x97488445, 0xcf562d6d, 0x4e73484a, 0xad664383, 0x2c4326a4, 0x745d8f8c, 0xf578eaab, 0xc460dddc, 0x4545b8fb, 0x1d5b11d3, 0x9c7e74f4, 0xfed6fe7a, 0x7ff39b5d, 0x27ed3275, 0xa6c85752, 0x97d06025, 0x16f50502, 0x4eebac2a, 0xcfcec90d, 0x2cdbc2c4, 0xadfea7e3, 0xf5e00ecb, 0x74c56bec, 0x45dd5c9b, 0xc4f839bc, 0x9ce69094, 0x1dc3f5b3, 0x81bd8147, 0x0098e460, 0x58864d48, 0xd9a3286f, 0xe8bb1f18, 0x699e7a3f, 0x3180d317, 0xb0a5b630, 0x53b0bdf9, 0xd295d8de, 0x8a8b71f6, 0x0bae14d1, 0x3ab623a6, 0xbb934681, 0xe38defa9, 0x62a88a8e, 0x26dcfab5, 0xa7f99f92, 0xffe736ba, 0x7ec2539d, 0x4fda64ea, 0xceff01cd, 0x96e1a8e5, 0x17c4cdc2, 0xf4d1c60b, 0x75f4a32c, 0x2dea0a04, 0xaccf6f23, 0x9dd75854, 0x1cf23d73, 0x44ec945b, 0xc5c9f17c, 0x59b78588, 0xd892e0af, 0x808c4987, 0x01a92ca0, 0x30b11bd7, 0xb1947ef0, 0xe98ad7d8, 0x68afb2ff, 0x8bbab936, 0x0a9fdc11, 0x52817539, 0xd3a4101e, 0xe2bc2769, 0x6399424e, 0x3b87eb66, 0xbaa28e41, 0xd80a04cf, 0x592f61e8, 0x0131c8c0, 0x8014ade7, 0xb10c9a90, 0x3029ffb7, 0x6837569f, 0xe91233b8, 0x0a073871, 0x8b225d56, 0xd33cf47e, 0x52199159, 0x6301a62e, 0xe224c309, 0xba3a6a21, 0x3b1f0f06, 0xa7617bf2, 0x26441ed5, 0x7e5ab7fd, 0xff7fd2da, 0xce67e5ad, 0x4f42808a, 0x175c29a2, 0x96794c85, 0x756c474c, 0xf449226b, 0xac578b43, 0x2d72ee64, 0x1c6ad913, 0x9d4fbc34, 0xc551151c, 0x4474703b, 0x4db9f56a, 0xcc9c904d, 0x94823965, 0x15a75c42, 0x24bf6b35, 0xa59a0e12, 0xfd84a73a, 0x7ca1c21d, 0x9fb4c9d4, 0x1e91acf3, 0x468f05db, 0xc7aa60fc, 0xf6b2578b, 0x779732ac, 0x2f899b84, 0xaeacfea3, 0x32d28a57, 0xb3f7ef70, 0xebe94658, 0x6acc237f, 0x5bd41408, 0xdaf1712f, 0x82efd807, 0x03cabd20, 0xe0dfb6e9, 0x61fad3ce, 0x39e47ae6, 0xb8c11fc1, 0x89d928b6, 0x08fc4d91, 0x50e2e4b9, 0xd1c7819e, 0xb36f0b10, 0x324a6e37, 0x6a54c71f, 0xeb71a238, 0xda69954f, 0x5b4cf068, 0x03525940, 0x82773c67, 0x616237ae, 0xe0475289, 0xb859fba1, 0x397c9e86, 0x0864a9f1, 0x8941ccd6, 0xd15f65fe, 0x507a00d9, 0xcc04742d, 0x4d21110a, 0x153fb822, 0x941add05, 0xa502ea72, 0x24278f55, 0x7c39267d, 0xfd1c435a, 0x1e094893, 0x9f2c2db4, 0xc732849c, 0x4617e1bb, 0x770fd6cc, 0xf62ab3eb, 0xae341ac3, 0x2f117fe4, 0x6b650fdf, 0xea406af8, 0xb25ec3d0, 0x337ba6f7, 0x02639180, 0x8346f4a7, 0xdb585d8f, 0x5a7d38a8, 0xb9683361, 0x384d5646, 0x6053ff6e, 0xe1769a49, 0xd06ead3e, 0x514bc819, 0x09556131, 0x88700416, 0x140e70e2, 0x952b15c5, 0xcd35bced, 0x4c10d9ca, 0x7d08eebd, 0xfc2d8b9a, 0xa43322b2, 0x25164795, 0xc6034c5c, 0x4726297b, 0x1f388053, 0x9e1de574, 0xaf05d203, 0x2e20b724, 0x763e1e0c, 0xf71b7b2b, 0x95b3f1a5, 0x14969482, 0x4c883daa, 0xcdad588d, 0xfcb56ffa, 0x7d900add, 0x258ea3f5, 0xa4abc6d2, 0x47becd1b, 0xc69ba83c, 0x9e850114, 0x1fa06433, 0x2eb85344, 0xaf9d3663, 0xf7839f4b, 0x76a6fa6c, 0xead88e98, 0x6bfdebbf, 0x33e34297, 0xb2c627b0, 0x83de10c7, 0x02fb75e0, 0x5ae5dcc8, 0xdbc0b9ef, 0x38d5b226, 0xb9f0d701, 0xe1ee7e29, 0x60cb1b0e, 0x51d32c79, 0xd0f6495e, 0x88e8e076, 0x09cd8551}, {0x00000000, 0x9b73ead4, 0xed96d3e9, 0x76e5393d, 0x005ca193, 0x9b2f4b47, 0xedca727a, 0x76b998ae, 0x00b94326, 0x9bcaa9f2, 0xed2f90cf, 0x765c7a1b, 0x00e5e2b5, 0x9b960861, 0xed73315c, 0x7600db88, 0x0172864c, 0x9a016c98, 0xece455a5, 0x7797bf71, 0x012e27df, 0x9a5dcd0b, 0xecb8f436, 0x77cb1ee2, 0x01cbc56a, 0x9ab82fbe, 0xec5d1683, 0x772efc57, 0x019764f9, 0x9ae48e2d, 0xec01b710, 0x77725dc4, 0x02e50c98, 0x9996e64c, 0xef73df71, 0x740035a5, 0x02b9ad0b, 0x99ca47df, 0xef2f7ee2, 0x745c9436, 0x025c4fbe, 0x992fa56a, 0xefca9c57, 0x74b97683, 0x0200ee2d, 0x997304f9, 0xef963dc4, 0x74e5d710, 0x03978ad4, 0x98e46000, 0xee01593d, 0x7572b3e9, 0x03cb2b47, 0x98b8c193, 0xee5df8ae, 0x752e127a, 0x032ec9f2, 0x985d2326, 0xeeb81a1b, 0x75cbf0cf, 0x03726861, 0x980182b5, 0xeee4bb88, 0x7597515c, 0x05ca1930, 0x9eb9f3e4, 0xe85ccad9, 0x732f200d, 0x0596b8a3, 0x9ee55277, 0xe8006b4a, 0x7373819e, 0x05735a16, 0x9e00b0c2, 0xe8e589ff, 0x7396632b, 0x052ffb85, 0x9e5c1151, 0xe8b9286c, 0x73cac2b8, 0x04b89f7c, 0x9fcb75a8, 0xe92e4c95, 0x725da641, 0x04e43eef, 0x9f97d43b, 0xe972ed06, 0x720107d2, 0x0401dc5a, 0x9f72368e, 0xe9970fb3, 0x72e4e567, 0x045d7dc9, 0x9f2e971d, 0xe9cbae20, 0x72b844f4, 0x072f15a8, 0x9c5cff7c, 0xeab9c641, 0x71ca2c95, 0x0773b43b, 0x9c005eef, 0xeae567d2, 0x71968d06, 0x0796568e, 0x9ce5bc5a, 0xea008567, 0x71736fb3, 0x07caf71d, 0x9cb91dc9, 0xea5c24f4, 0x712fce20, 0x065d93e4, 0x9d2e7930, 0xebcb400d, 0x70b8aad9, 0x06013277, 0x9d72d8a3, 0xeb97e19e, 0x70e40b4a, 0x06e4d0c2, 0x9d973a16, 0xeb72032b, 0x7001e9ff, 0x06b87151, 0x9dcb9b85, 0xeb2ea2b8, 0x705d486c, 0x0b943260, 0x90e7d8b4, 0xe602e189, 0x7d710b5d, 0x0bc893f3, 0x90bb7927, 0xe65e401a, 0x7d2daace, 0x0b2d7146, 0x905e9b92, 0xe6bba2af, 0x7dc8487b, 0x0b71d0d5, 0x90023a01, 0xe6e7033c, 0x7d94e9e8, 0x0ae6b42c, 0x91955ef8, 0xe77067c5, 0x7c038d11, 0x0aba15bf, 0x91c9ff6b, 0xe72cc656, 0x7c5f2c82, 0x0a5ff70a, 0x912c1dde, 0xe7c924e3, 0x7cbace37, 0x0a035699, 0x9170bc4d, 0xe7958570, 0x7ce66fa4, 0x09713ef8, 0x9202d42c, 0xe4e7ed11, 0x7f9407c5, 0x092d9f6b, 0x925e75bf, 0xe4bb4c82, 0x7fc8a656, 0x09c87dde, 0x92bb970a, 0xe45eae37, 0x7f2d44e3, 0x0994dc4d, 0x92e73699, 0xe4020fa4, 0x7f71e570, 0x0803b8b4, 0x93705260, 0xe5956b5d, 0x7ee68189, 0x085f1927, 0x932cf3f3, 0xe5c9cace, 0x7eba201a, 0x08bafb92, 0x93c91146, 0xe52c287b, 0x7e5fc2af, 0x08e65a01, 0x9395b0d5, 0xe57089e8, 0x7e03633c, 0x0e5e2b50, 0x952dc184, 0xe3c8f8b9, 0x78bb126d, 0x0e028ac3, 0x95716017, 0xe394592a, 0x78e7b3fe, 0x0ee76876, 0x959482a2, 0xe371bb9f, 0x7802514b, 0x0ebbc9e5, 0x95c82331, 0xe32d1a0c, 0x785ef0d8, 0x0f2cad1c, 0x945f47c8, 0xe2ba7ef5, 0x79c99421, 0x0f700c8f, 0x9403e65b, 0xe2e6df66, 0x799535b2, 0x0f95ee3a, 0x94e604ee, 0xe2033dd3, 0x7970d707, 0x0fc94fa9, 0x94baa57d, 0xe25f9c40, 0x792c7694, 0x0cbb27c8, 0x97c8cd1c, 0xe12df421, 0x7a5e1ef5, 0x0ce7865b, 0x97946c8f, 0xe17155b2, 0x7a02bf66, 0x0c0264ee, 0x97718e3a, 0xe194b707, 0x7ae75dd3, 0x0c5ec57d, 0x972d2fa9, 0xe1c81694, 0x7abbfc40, 0x0dc9a184, 0x96ba4b50, 0xe05f726d, 0x7b2c98b9, 0x0d950017, 0x96e6eac3, 0xe003d3fe, 0x7b70392a, 0x0d70e2a2, 0x96030876, 0xe0e6314b, 0x7b95db9f, 0x0d2c4331, 0x965fa9e5, 0xe0ba90d8, 0x7bc97a0c}, {0x00000000, 0x172864c0, 0x2e50c980, 0x3978ad40, 0x5ca19300, 0x4b89f7c0, 0x72f15a80, 0x65d93e40, 0xb9432600, 0xae6b42c0, 0x9713ef80, 0x803b8b40, 0xe5e2b500, 0xf2cad1c0, 0xcbb27c80, 0xdc9a1840, 0xa9f74a41, 0xbedf2e81, 0x87a783c1, 0x908fe701, 0xf556d941, 0xe27ebd81, 0xdb0610c1, 0xcc2e7401, 0x10b46c41, 0x079c0881, 0x3ee4a5c1, 0x29ccc101, 0x4c15ff41, 0x5b3d9b81, 0x624536c1, 0x756d5201, 0x889f92c3, 0x9fb7f603, 0xa6cf5b43, 0xb1e73f83, 0xd43e01c3, 0xc3166503, 0xfa6ec843, 0xed46ac83, 0x31dcb4c3, 0x26f4d003, 0x1f8c7d43, 0x08a41983, 0x6d7d27c3, 0x7a554303, 0x432dee43, 0x54058a83, 0x2168d882, 0x3640bc42, 0x0f381102, 0x181075c2, 0x7dc94b82, 0x6ae12f42, 0x53998202, 0x44b1e6c2, 0x982bfe82, 0x8f039a42, 0xb67b3702, 0xa15353c2, 0xc48a6d82, 0xd3a20942, 0xeadaa402, 0xfdf2c0c2, 0xca4e23c7, 0xdd664707, 0xe41eea47, 0xf3368e87, 0x96efb0c7, 0x81c7d407, 0xb8bf7947, 0xaf971d87, 0x730d05c7, 0x64256107, 0x5d5dcc47, 0x4a75a887, 0x2fac96c7, 0x3884f207, 0x01fc5f47, 0x16d43b87, 0x63b96986, 0x74910d46, 0x4de9a006, 0x5ac1c4c6, 0x3f18fa86, 0x28309e46, 0x11483306, 0x066057c6, 0xdafa4f86, 0xcdd22b46, 0xf4aa8606, 0xe382e2c6, 0x865bdc86, 0x9173b846, 0xa80b1506, 0xbf2371c6, 0x42d1b104, 0x55f9d5c4, 0x6c817884, 0x7ba91c44, 0x1e702204, 0x095846c4, 0x3020eb84, 0x27088f44, 0xfb929704, 0xecbaf3c4, 0xd5c25e84, 0xc2ea3a44, 0xa7330404, 0xb01b60c4, 0x8963cd84, 0x9e4ba944, 0xeb26fb45, 0xfc0e9f85, 0xc57632c5, 0xd25e5605, 0xb7876845, 0xa0af0c85, 0x99d7a1c5, 0x8effc505, 0x5265dd45, 0x454db985, 0x7c3514c5, 0x6b1d7005, 0x0ec44e45, 0x19ec2a85, 0x209487c5, 0x37bce305, 0x4fed41cf, 0x58c5250f, 0x61bd884f, 0x7695ec8f, 0x134cd2cf, 0x0464b60f, 0x3d1c1b4f, 0x2a347f8f, 0xf6ae67cf, 0xe186030f, 0xd8feae4f, 0xcfd6ca8f, 0xaa0ff4cf, 0xbd27900f, 0x845f3d4f, 0x9377598f, 0xe61a0b8e, 0xf1326f4e, 0xc84ac20e, 0xdf62a6ce, 0xbabb988e, 0xad93fc4e, 0x94eb510e, 0x83c335ce, 0x5f592d8e, 0x4871494e, 0x7109e40e, 0x662180ce, 0x03f8be8e, 0x14d0da4e, 0x2da8770e, 0x3a8013ce, 0xc772d30c, 0xd05ab7cc, 0xe9221a8c, 0xfe0a7e4c, 0x9bd3400c, 0x8cfb24cc, 0xb583898c, 0xa2abed4c, 0x7e31f50c, 0x691991cc, 0x50613c8c, 0x4749584c, 0x2290660c, 0x35b802cc, 0x0cc0af8c, 0x1be8cb4c, 0x6e85994d, 0x79adfd8d, 0x40d550cd, 0x57fd340d, 0x32240a4d, 0x250c6e8d, 0x1c74c3cd, 0x0b5ca70d, 0xd7c6bf4d, 0xc0eedb8d, 0xf99676cd, 0xeebe120d, 0x8b672c4d, 0x9c4f488d, 0xa537e5cd, 0xb21f810d, 0x85a36208, 0x928b06c8, 0xabf3ab88, 0xbcdbcf48, 0xd902f108, 0xce2a95c8, 0xf7523888, 0xe07a5c48, 0x3ce04408, 0x2bc820c8, 0x12b08d88, 0x0598e948, 0x6041d708, 0x7769b3c8, 0x4e111e88, 0x59397a48, 0x2c542849, 0x3b7c4c89, 0x0204e1c9, 0x152c8509, 0x70f5bb49, 0x67dddf89, 0x5ea572c9, 0x498d1609, 0x95170e49, 0x823f6a89, 0xbb47c7c9, 0xac6fa309, 0xc9b69d49, 0xde9ef989, 0xe7e654c9, 0xf0ce3009, 0x0d3cf0cb, 0x1a14940b, 0x236c394b, 0x34445d8b, 0x519d63cb, 0x46b5070b, 0x7fcdaa4b, 0x68e5ce8b, 0xb47fd6cb, 0xa357b20b, 0x9a2f1f4b, 0x8d077b8b, 0xe8de45cb, 0xfff6210b, 0xc68e8c4b, 0xd1a6e88b, 0xa4cbba8a, 0xb3e3de4a, 0x8a9b730a, 0x9db317ca, 0xf86a298a, 0xef424d4a, 0xd63ae00a, 0xc11284ca, 0x1d889c8a, 0x0aa0f84a, 0x33d8550a, 0x24f031ca, 0x41290f8a, 0x56016b4a, 0x6f79c60a, 0x7851a2ca}, {0x00000000, 0x9fda839e, 0xe4c4017d, 0x7b1e82e3, 0x12f904bb, 0x8d238725, 0xf63d05c6, 0x69e78658, 0x25f20976, 0xba288ae8, 0xc136080b, 0x5eec8b95, 0x370b0dcd, 0xa8d18e53, 0xd3cf0cb0, 0x4c158f2e, 0x4be412ec, 0xd43e9172, 0xaf201391, 0x30fa900f, 0x591d1657, 0xc6c795c9, 0xbdd9172a, 0x220394b4, 0x6e161b9a, 0xf1cc9804, 0x8ad21ae7, 0x15089979, 0x7cef1f21, 0xe3359cbf, 0x982b1e5c, 0x07f19dc2, 0x97c825d8, 0x0812a646, 0x730c24a5, 0xecd6a73b, 0x85312163, 0x1aeba2fd, 0x61f5201e, 0xfe2fa380, 0xb23a2cae, 0x2de0af30, 0x56fe2dd3, 0xc924ae4d, 0xa0c32815, 0x3f19ab8b, 0x44072968, 0xdbddaaf6, 0xdc2c3734, 0x43f6b4aa, 0x38e83649, 0xa732b5d7, 0xced5338f, 0x510fb011, 0x2a1132f2, 0xb5cbb16c, 0xf9de3e42, 0x6604bddc, 0x1d1a3f3f, 0x82c0bca1, 0xeb273af9, 0x74fdb967, 0x0fe33b84, 0x9039b81a, 0xf4e14df1, 0x6b3bce6f, 0x10254c8c, 0x8fffcf12, 0xe618494a, 0x79c2cad4, 0x02dc4837, 0x9d06cba9, 0xd1134487, 0x4ec9c719, 0x35d745fa, 0xaa0dc664, 0xc3ea403c, 0x5c30c3a2, 0x272e4141, 0xb8f4c2df, 0xbf055f1d, 0x20dfdc83, 0x5bc15e60, 0xc41bddfe, 0xadfc5ba6, 0x3226d838, 0x49385adb, 0xd6e2d945, 0x9af7566b, 0x052dd5f5, 0x7e335716, 0xe1e9d488, 0x880e52d0, 0x17d4d14e, 0x6cca53ad, 0xf310d033, 0x63296829, 0xfcf3ebb7, 0x87ed6954, 0x1837eaca, 0x71d06c92, 0xee0aef0c, 0x95146def, 0x0aceee71, 0x46db615f, 0xd901e2c1, 0xa21f6022, 0x3dc5e3bc, 0x542265e4, 0xcbf8e67a, 0xb0e66499, 0x2f3ce707, 0x28cd7ac5, 0xb717f95b, 0xcc097bb8, 0x53d3f826, 0x3a347e7e, 0xa5eefde0, 0xdef07f03, 0x412afc9d, 0x0d3f73b3, 0x92e5f02d, 0xe9fb72ce, 0x7621f150, 0x1fc67708, 0x801cf496, 0xfb027675, 0x64d8f5eb, 0x32b39da3, 0xad691e3d, 0xd6779cde, 0x49ad1f40, 0x204a9918, 0xbf901a86, 0xc48e9865, 0x5b541bfb, 0x174194d5, 0x889b174b, 0xf38595a8, 0x6c5f1636, 0x05b8906e, 0x9a6213f0, 0xe17c9113, 0x7ea6128d, 0x79578f4f, 0xe68d0cd1, 0x9d938e32, 0x02490dac, 0x6bae8bf4, 0xf474086a, 0x8f6a8a89, 0x10b00917, 0x5ca58639, 0xc37f05a7, 0xb8618744, 0x27bb04da, 0x4e5c8282, 0xd186011c, 0xaa9883ff, 0x35420061, 0xa57bb87b, 0x3aa13be5, 0x41bfb906, 0xde653a98, 0xb782bcc0, 0x28583f5e, 0x5346bdbd, 0xcc9c3e23, 0x8089b10d, 0x1f533293, 0x644db070, 0xfb9733ee, 0x9270b5b6, 0x0daa3628, 0x76b4b4cb, 0xe96e3755, 0xee9faa97, 0x71452909, 0x0a5babea, 0x95812874, 0xfc66ae2c, 0x63bc2db2, 0x18a2af51, 0x87782ccf, 0xcb6da3e1, 0x54b7207f, 0x2fa9a29c, 0xb0732102, 0xd994a75a, 0x464e24c4, 0x3d50a627, 0xa28a25b9, 0xc652d052, 0x598853cc, 0x2296d12f, 0xbd4c52b1, 0xd4abd4e9, 0x4b715777, 0x306fd594, 0xafb5560a, 0xe3a0d924, 0x7c7a5aba, 0x0764d859, 0x98be5bc7, 0xf159dd9f, 0x6e835e01, 0x159ddce2, 0x8a475f7c, 0x8db6c2be, 0x126c4120, 0x6972c3c3, 0xf6a8405d, 0x9f4fc605, 0x0095459b, 0x7b8bc778, 0xe45144e6, 0xa844cbc8, 0x379e4856, 0x4c80cab5, 0xd35a492b, 0xbabdcf73, 0x25674ced, 0x5e79ce0e, 0xc1a34d90, 0x519af58a, 0xce407614, 0xb55ef4f7, 0x2a847769, 0x4363f131, 0xdcb972af, 0xa7a7f04c, 0x387d73d2, 0x7468fcfc, 0xebb27f62, 0x90acfd81, 0x0f767e1f, 0x6691f847, 0xf94b7bd9, 0x8255f93a, 0x1d8f7aa4, 0x1a7ee766, 0x85a464f8, 0xfebae61b, 0x61606585, 0x0887e3dd, 0x975d6043, 0xec43e2a0, 0x7399613e, 0x3f8cee10, 0xa0566d8e, 0xdb48ef6d, 0x44926cf3, 0x2d75eaab, 0xb2af6935, 0xc9b1ebd6, 0x566b6848}}; local const z_word_t FAR crc_braid_big_table[][256] = { {0x00000000, 0x9e83da9f, 0x7d01c4e4, 0xe3821e7b, 0xbb04f912, 0x2587238d, 0xc6053df6, 0x5886e769, 0x7609f225, 0xe88a28ba, 0x0b0836c1, 0x958bec5e, 0xcd0d0b37, 0x538ed1a8, 0xb00ccfd3, 0x2e8f154c, 0xec12e44b, 0x72913ed4, 0x911320af, 0x0f90fa30, 0x57161d59, 0xc995c7c6, 0x2a17d9bd, 0xb4940322, 0x9a1b166e, 0x0498ccf1, 0xe71ad28a, 0x79990815, 0x211fef7c, 0xbf9c35e3, 0x5c1e2b98, 0xc29df107, 0xd825c897, 0x46a61208, 0xa5240c73, 0x3ba7d6ec, 0x63213185, 0xfda2eb1a, 0x1e20f561, 0x80a32ffe, 0xae2c3ab2, 0x30afe02d, 0xd32dfe56, 0x4dae24c9, 0x1528c3a0, 0x8bab193f, 0x68290744, 0xf6aadddb, 0x34372cdc, 0xaab4f643, 0x4936e838, 0xd7b532a7, 0x8f33d5ce, 0x11b00f51, 0xf232112a, 0x6cb1cbb5, 0x423edef9, 0xdcbd0466, 0x3f3f1a1d, 0xa1bcc082, 0xf93a27eb, 0x67b9fd74, 0x843be30f, 0x1ab83990, 0xf14de1f4, 0x6fce3b6b, 0x8c4c2510, 0x12cfff8f, 0x4a4918e6, 0xd4cac279, 0x3748dc02, 0xa9cb069d, 0x874413d1, 0x19c7c94e, 0xfa45d735, 0x64c60daa, 0x3c40eac3, 0xa2c3305c, 0x41412e27, 0xdfc2f4b8, 0x1d5f05bf, 0x83dcdf20, 0x605ec15b, 0xfedd1bc4, 0xa65bfcad, 0x38d82632, 0xdb5a3849, 0x45d9e2d6, 0x6b56f79a, 0xf5d52d05, 0x1657337e, 0x88d4e9e1, 0xd0520e88, 0x4ed1d417, 0xad53ca6c, 0x33d010f3, 0x29682963, 0xb7ebf3fc, 0x5469ed87, 0xcaea3718, 0x926cd071, 0x0cef0aee, 0xef6d1495, 0x71eece0a, 0x5f61db46, 0xc1e201d9, 0x22601fa2, 0xbce3c53d, 0xe4652254, 0x7ae6f8cb, 0x9964e6b0, 0x07e73c2f, 0xc57acd28, 0x5bf917b7, 0xb87b09cc, 0x26f8d353, 0x7e7e343a, 0xe0fdeea5, 0x037ff0de, 0x9dfc2a41, 0xb3733f0d, 0x2df0e592, 0xce72fbe9, 0x50f12176, 0x0877c61f, 0x96f41c80, 0x757602fb, 0xebf5d864, 0xa39db332, 0x3d1e69ad, 0xde9c77d6, 0x401fad49, 0x18994a20, 0x861a90bf, 0x65988ec4, 0xfb1b545b, 0xd5944117, 0x4b179b88, 0xa89585f3, 0x36165f6c, 0x6e90b805, 0xf013629a, 0x13917ce1, 0x8d12a67e, 0x4f8f5779, 0xd10c8de6, 0x328e939d, 0xac0d4902, 0xf48bae6b, 0x6a0874f4, 0x898a6a8f, 0x1709b010, 0x3986a55c, 0xa7057fc3, 0x448761b8, 0xda04bb27, 0x82825c4e, 0x1c0186d1, 0xff8398aa, 0x61004235, 0x7bb87ba5, 0xe53ba13a, 0x06b9bf41, 0x983a65de, 0xc0bc82b7, 0x5e3f5828, 0xbdbd4653, 0x233e9ccc, 0x0db18980, 0x9332531f, 0x70b04d64, 0xee3397fb, 0xb6b57092, 0x2836aa0d, 0xcbb4b476, 0x55376ee9, 0x97aa9fee, 0x09294571, 0xeaab5b0a, 0x74288195, 0x2cae66fc, 0xb22dbc63, 0x51afa218, 0xcf2c7887, 0xe1a36dcb, 0x7f20b754, 0x9ca2a92f, 0x022173b0, 0x5aa794d9, 0xc4244e46, 0x27a6503d, 0xb9258aa2, 0x52d052c6, 0xcc538859, 0x2fd19622, 0xb1524cbd, 0xe9d4abd4, 0x7757714b, 0x94d56f30, 0x0a56b5af, 0x24d9a0e3, 0xba5a7a7c, 0x59d86407, 0xc75bbe98, 0x9fdd59f1, 0x015e836e, 0xe2dc9d15, 0x7c5f478a, 0xbec2b68d, 0x20416c12, 0xc3c37269, 0x5d40a8f6, 0x05c64f9f, 0x9b459500, 0x78c78b7b, 0xe64451e4, 0xc8cb44a8, 0x56489e37, 0xb5ca804c, 0x2b495ad3, 0x73cfbdba, 0xed4c6725, 0x0ece795e, 0x904da3c1, 0x8af59a51, 0x147640ce, 0xf7f45eb5, 0x6977842a, 0x31f16343, 0xaf72b9dc, 0x4cf0a7a7, 0xd2737d38, 0xfcfc6874, 0x627fb2eb, 0x81fdac90, 0x1f7e760f, 0x47f89166, 0xd97b4bf9, 0x3af95582, 0xa47a8f1d, 0x66e77e1a, 0xf864a485, 0x1be6bafe, 0x85656061, 0xdde38708, 0x43605d97, 0xa0e243ec, 0x3e619973, 0x10ee8c3f, 0x8e6d56a0, 0x6def48db, 0xf36c9244, 0xabea752d, 0x3569afb2, 0xd6ebb1c9, 0x48686b56}, {0x00000000, 0xc0642817, 0x80c9502e, 0x40ad7839, 0x0093a15c, 0xc0f7894b, 0x805af172, 0x403ed965, 0x002643b9, 0xc0426bae, 0x80ef1397, 0x408b3b80, 0x00b5e2e5, 0xc0d1caf2, 0x807cb2cb, 0x40189adc, 0x414af7a9, 0x812edfbe, 0xc183a787, 0x01e78f90, 0x41d956f5, 0x81bd7ee2, 0xc11006db, 0x01742ecc, 0x416cb410, 0x81089c07, 0xc1a5e43e, 0x01c1cc29, 0x41ff154c, 0x819b3d5b, 0xc1364562, 0x01526d75, 0xc3929f88, 0x03f6b79f, 0x435bcfa6, 0x833fe7b1, 0xc3013ed4, 0x036516c3, 0x43c86efa, 0x83ac46ed, 0xc3b4dc31, 0x03d0f426, 0x437d8c1f, 0x8319a408, 0xc3277d6d, 0x0343557a, 0x43ee2d43, 0x838a0554, 0x82d86821, 0x42bc4036, 0x0211380f, 0xc2751018, 0x824bc97d, 0x422fe16a, 0x02829953, 0xc2e6b144, 0x82fe2b98, 0x429a038f, 0x02377bb6, 0xc25353a1, 0x826d8ac4, 0x4209a2d3, 0x02a4daea, 0xc2c0f2fd, 0xc7234eca, 0x074766dd, 0x47ea1ee4, 0x878e36f3, 0xc7b0ef96, 0x07d4c781, 0x4779bfb8, 0x871d97af, 0xc7050d73, 0x07612564, 0x47cc5d5d, 0x87a8754a, 0xc796ac2f, 0x07f28438, 0x475ffc01, 0x873bd416, 0x8669b963, 0x460d9174, 0x06a0e94d, 0xc6c4c15a, 0x86fa183f, 0x469e3028, 0x06334811, 0xc6576006, 0x864ffada, 0x462bd2cd, 0x0686aaf4, 0xc6e282e3, 0x86dc5b86, 0x46b87391, 0x06150ba8, 0xc67123bf, 0x04b1d142, 0xc4d5f955, 0x8478816c, 0x441ca97b, 0x0422701e, 0xc4465809, 0x84eb2030, 0x448f0827, 0x049792fb, 0xc4f3baec, 0x845ec2d5, 0x443aeac2, 0x040433a7, 0xc4601bb0, 0x84cd6389, 0x44a94b9e, 0x45fb26eb, 0x859f0efc, 0xc53276c5, 0x05565ed2, 0x456887b7, 0x850cafa0, 0xc5a1d799, 0x05c5ff8e, 0x45dd6552, 0x85b94d45, 0xc514357c, 0x05701d6b, 0x454ec40e, 0x852aec19, 0xc5879420, 0x05e3bc37, 0xcf41ed4f, 0x0f25c558, 0x4f88bd61, 0x8fec9576, 0xcfd24c13, 0x0fb66404, 0x4f1b1c3d, 0x8f7f342a, 0xcf67aef6, 0x0f0386e1, 0x4faefed8, 0x8fcad6cf, 0xcff40faa, 0x0f9027bd, 0x4f3d5f84, 0x8f597793, 0x8e0b1ae6, 0x4e6f32f1, 0x0ec24ac8, 0xcea662df, 0x8e98bbba, 0x4efc93ad, 0x0e51eb94, 0xce35c383, 0x8e2d595f, 0x4e497148, 0x0ee40971, 0xce802166, 0x8ebef803, 0x4edad014, 0x0e77a82d, 0xce13803a, 0x0cd372c7, 0xccb75ad0, 0x8c1a22e9, 0x4c7e0afe, 0x0c40d39b, 0xcc24fb8c, 0x8c8983b5, 0x4cedaba2, 0x0cf5317e, 0xcc911969, 0x8c3c6150, 0x4c584947, 0x0c669022, 0xcc02b835, 0x8cafc00c, 0x4ccbe81b, 0x4d99856e, 0x8dfdad79, 0xcd50d540, 0x0d34fd57, 0x4d0a2432, 0x8d6e0c25, 0xcdc3741c, 0x0da75c0b, 0x4dbfc6d7, 0x8ddbeec0, 0xcd7696f9, 0x0d12beee, 0x4d2c678b, 0x8d484f9c, 0xcde537a5, 0x0d811fb2, 0x0862a385, 0xc8068b92, 0x88abf3ab, 0x48cfdbbc, 0x08f102d9, 0xc8952ace, 0x883852f7, 0x485c7ae0, 0x0844e03c, 0xc820c82b, 0x888db012, 0x48e99805, 0x08d74160, 0xc8b36977, 0x881e114e, 0x487a3959, 0x4928542c, 0x894c7c3b, 0xc9e10402, 0x09852c15, 0x49bbf570, 0x89dfdd67, 0xc972a55e, 0x09168d49, 0x490e1795, 0x896a3f82, 0xc9c747bb, 0x09a36fac, 0x499db6c9, 0x89f99ede, 0xc954e6e7, 0x0930cef0, 0xcbf03c0d, 0x0b94141a, 0x4b396c23, 0x8b5d4434, 0xcb639d51, 0x0b07b546, 0x4baacd7f, 0x8bcee568, 0xcbd67fb4, 0x0bb257a3, 0x4b1f2f9a, 0x8b7b078d, 0xcb45dee8, 0x0b21f6ff, 0x4b8c8ec6, 0x8be8a6d1, 0x8abacba4, 0x4adee3b3, 0x0a739b8a, 0xca17b39d, 0x8a296af8, 0x4a4d42ef, 0x0ae03ad6, 0xca8412c1, 0x8a9c881d, 0x4af8a00a, 0x0a55d833, 0xca31f024, 0x8a0f2941, 0x4a6b0156, 0x0ac6796f, 0xcaa25178}, {0x00000000, 0xd4ea739b, 0xe9d396ed, 0x3d39e576, 0x93a15c00, 0x474b2f9b, 0x7a72caed, 0xae98b976, 0x2643b900, 0xf2a9ca9b, 0xcf902fed, 0x1b7a5c76, 0xb5e2e500, 0x6108969b, 0x5c3173ed, 0x88db0076, 0x4c867201, 0x986c019a, 0xa555e4ec, 0x71bf9777, 0xdf272e01, 0x0bcd5d9a, 0x36f4b8ec, 0xe21ecb77, 0x6ac5cb01, 0xbe2fb89a, 0x83165dec, 0x57fc2e77, 0xf9649701, 0x2d8ee49a, 0x10b701ec, 0xc45d7277, 0x980ce502, 0x4ce69699, 0x71df73ef, 0xa5350074, 0x0badb902, 0xdf47ca99, 0xe27e2fef, 0x36945c74, 0xbe4f5c02, 0x6aa52f99, 0x579ccaef, 0x8376b974, 0x2dee0002, 0xf9047399, 0xc43d96ef, 0x10d7e574, 0xd48a9703, 0x0060e498, 0x3d5901ee, 0xe9b37275, 0x472bcb03, 0x93c1b898, 0xaef85dee, 0x7a122e75, 0xf2c92e03, 0x26235d98, 0x1b1ab8ee, 0xcff0cb75, 0x61687203, 0xb5820198, 0x88bbe4ee, 0x5c519775, 0x3019ca05, 0xe4f3b99e, 0xd9ca5ce8, 0x0d202f73, 0xa3b89605, 0x7752e59e, 0x4a6b00e8, 0x9e817373, 0x165a7305, 0xc2b0009e, 0xff89e5e8, 0x2b639673, 0x85fb2f05, 0x51115c9e, 0x6c28b9e8, 0xb8c2ca73, 0x7c9fb804, 0xa875cb9f, 0x954c2ee9, 0x41a65d72, 0xef3ee404, 0x3bd4979f, 0x06ed72e9, 0xd2070172, 0x5adc0104, 0x8e36729f, 0xb30f97e9, 0x67e5e472, 0xc97d5d04, 0x1d972e9f, 0x20aecbe9, 0xf444b872, 0xa8152f07, 0x7cff5c9c, 0x41c6b9ea, 0x952cca71, 0x3bb47307, 0xef5e009c, 0xd267e5ea, 0x068d9671, 0x8e569607, 0x5abce59c, 0x678500ea, 0xb36f7371, 0x1df7ca07, 0xc91db99c, 0xf4245cea, 0x20ce2f71, 0xe4935d06, 0x30792e9d, 0x0d40cbeb, 0xd9aab870, 0x77320106, 0xa3d8729d, 0x9ee197eb, 0x4a0be470, 0xc2d0e406, 0x163a979d, 0x2b0372eb, 0xffe90170, 0x5171b806, 0x859bcb9d, 0xb8a22eeb, 0x6c485d70, 0x6032940b, 0xb4d8e790, 0x89e102e6, 0x5d0b717d, 0xf393c80b, 0x2779bb90, 0x1a405ee6, 0xceaa2d7d, 0x46712d0b, 0x929b5e90, 0xafa2bbe6, 0x7b48c87d, 0xd5d0710b, 0x013a0290, 0x3c03e7e6, 0xe8e9947d, 0x2cb4e60a, 0xf85e9591, 0xc56770e7, 0x118d037c, 0xbf15ba0a, 0x6bffc991, 0x56c62ce7, 0x822c5f7c, 0x0af75f0a, 0xde1d2c91, 0xe324c9e7, 0x37ceba7c, 0x9956030a, 0x4dbc7091, 0x708595e7, 0xa46fe67c, 0xf83e7109, 0x2cd40292, 0x11ede7e4, 0xc507947f, 0x6b9f2d09, 0xbf755e92, 0x824cbbe4, 0x56a6c87f, 0xde7dc809, 0x0a97bb92, 0x37ae5ee4, 0xe3442d7f, 0x4ddc9409, 0x9936e792, 0xa40f02e4, 0x70e5717f, 0xb4b80308, 0x60527093, 0x5d6b95e5, 0x8981e67e, 0x27195f08, 0xf3f32c93, 0xcecac9e5, 0x1a20ba7e, 0x92fbba08, 0x4611c993, 0x7b282ce5, 0xafc25f7e, 0x015ae608, 0xd5b09593, 0xe88970e5, 0x3c63037e, 0x502b5e0e, 0x84c12d95, 0xb9f8c8e3, 0x6d12bb78, 0xc38a020e, 0x17607195, 0x2a5994e3, 0xfeb3e778, 0x7668e70e, 0xa2829495, 0x9fbb71e3, 0x4b510278, 0xe5c9bb0e, 0x3123c895, 0x0c1a2de3, 0xd8f05e78, 0x1cad2c0f, 0xc8475f94, 0xf57ebae2, 0x2194c979, 0x8f0c700f, 0x5be60394, 0x66dfe6e2, 0xb2359579, 0x3aee950f, 0xee04e694, 0xd33d03e2, 0x07d77079, 0xa94fc90f, 0x7da5ba94, 0x409c5fe2, 0x94762c79, 0xc827bb0c, 0x1ccdc897, 0x21f42de1, 0xf51e5e7a, 0x5b86e70c, 0x8f6c9497, 0xb25571e1, 0x66bf027a, 0xee64020c, 0x3a8e7197, 0x07b794e1, 0xd35de77a, 0x7dc55e0c, 0xa92f2d97, 0x9416c8e1, 0x40fcbb7a, 0x84a1c90d, 0x504bba96, 0x6d725fe0, 0xb9982c7b, 0x1700950d, 0xc3eae696, 0xfed303e0, 0x2a39707b, 0xa2e2700d, 0x76080396, 0x4b31e6e0, 0x9fdb957b, 0x31432c0d, 0xe5a95f96, 0xd890bae0, 0x0c7ac97b}, {0x00000000, 0x27652581, 0x0fcc3bd9, 0x28a91e58, 0x5f9e0669, 0x78fb23e8, 0x50523db0, 0x77371831, 0xbe3c0dd2, 0x99592853, 0xb1f0360b, 0x9695138a, 0xe1a20bbb, 0xc6c72e3a, 0xee6e3062, 0xc90b15e3, 0x3d7f6b7f, 0x1a1a4efe, 0x32b350a6, 0x15d67527, 0x62e16d16, 0x45844897, 0x6d2d56cf, 0x4a48734e, 0x834366ad, 0xa426432c, 0x8c8f5d74, 0xabea78f5, 0xdcdd60c4, 0xfbb84545, 0xd3115b1d, 0xf4747e9c, 0x7afed6fe, 0x5d9bf37f, 0x7532ed27, 0x5257c8a6, 0x2560d097, 0x0205f516, 0x2aaceb4e, 0x0dc9cecf, 0xc4c2db2c, 0xe3a7fead, 0xcb0ee0f5, 0xec6bc574, 0x9b5cdd45, 0xbc39f8c4, 0x9490e69c, 0xb3f5c31d, 0x4781bd81, 0x60e49800, 0x484d8658, 0x6f28a3d9, 0x181fbbe8, 0x3f7a9e69, 0x17d38031, 0x30b6a5b0, 0xf9bdb053, 0xded895d2, 0xf6718b8a, 0xd114ae0b, 0xa623b63a, 0x814693bb, 0xa9ef8de3, 0x8e8aa862, 0xb5fadc26, 0x929ff9a7, 0xba36e7ff, 0x9d53c27e, 0xea64da4f, 0xcd01ffce, 0xe5a8e196, 0xc2cdc417, 0x0bc6d1f4, 0x2ca3f475, 0x040aea2d, 0x236fcfac, 0x5458d79d, 0x733df21c, 0x5b94ec44, 0x7cf1c9c5, 0x8885b759, 0xafe092d8, 0x87498c80, 0xa02ca901, 0xd71bb130, 0xf07e94b1, 0xd8d78ae9, 0xffb2af68, 0x36b9ba8b, 0x11dc9f0a, 0x39758152, 0x1e10a4d3, 0x6927bce2, 0x4e429963, 0x66eb873b, 0x418ea2ba, 0xcf040ad8, 0xe8612f59, 0xc0c83101, 0xe7ad1480, 0x909a0cb1, 0xb7ff2930, 0x9f563768, 0xb83312e9, 0x7138070a, 0x565d228b, 0x7ef43cd3, 0x59911952, 0x2ea60163, 0x09c324e2, 0x216a3aba, 0x060f1f3b, 0xf27b61a7, 0xd51e4426, 0xfdb75a7e, 0xdad27fff, 0xade567ce, 0x8a80424f, 0xa2295c17, 0x854c7996, 0x4c476c75, 0x6b2249f4, 0x438b57ac, 0x64ee722d, 0x13d96a1c, 0x34bc4f9d, 0x1c1551c5, 0x3b707444, 0x6af5b94d, 0x4d909ccc, 0x65398294, 0x425ca715, 0x356bbf24, 0x120e9aa5, 0x3aa784fd, 0x1dc2a17c, 0xd4c9b49f, 0xf3ac911e, 0xdb058f46, 0xfc60aac7, 0x8b57b2f6, 0xac329777, 0x849b892f, 0xa3feacae, 0x578ad232, 0x70eff7b3, 0x5846e9eb, 0x7f23cc6a, 0x0814d45b, 0x2f71f1da, 0x07d8ef82, 0x20bdca03, 0xe9b6dfe0, 0xced3fa61, 0xe67ae439, 0xc11fc1b8, 0xb628d989, 0x914dfc08, 0xb9e4e250, 0x9e81c7d1, 0x100b6fb3, 0x376e4a32, 0x1fc7546a, 0x38a271eb, 0x4f9569da, 0x68f04c5b, 0x40595203, 0x673c7782, 0xae376261, 0x895247e0, 0xa1fb59b8, 0x869e7c39, 0xf1a96408, 0xd6cc4189, 0xfe655fd1, 0xd9007a50, 0x2d7404cc, 0x0a11214d, 0x22b83f15, 0x05dd1a94, 0x72ea02a5, 0x558f2724, 0x7d26397c, 0x5a431cfd, 0x9348091e, 0xb42d2c9f, 0x9c8432c7, 0xbbe11746, 0xccd60f77, 0xebb32af6, 0xc31a34ae, 0xe47f112f, 0xdf0f656b, 0xf86a40ea, 0xd0c35eb2, 0xf7a67b33, 0x80916302, 0xa7f44683, 0x8f5d58db, 0xa8387d5a, 0x613368b9, 0x46564d38, 0x6eff5360, 0x499a76e1, 0x3ead6ed0, 0x19c84b51, 0x31615509, 0x16047088, 0xe2700e14, 0xc5152b95, 0xedbc35cd, 0xcad9104c, 0xbdee087d, 0x9a8b2dfc, 0xb22233a4, 0x95471625, 0x5c4c03c6, 0x7b292647, 0x5380381f, 0x74e51d9e, 0x03d205af, 0x24b7202e, 0x0c1e3e76, 0x2b7b1bf7, 0xa5f1b395, 0x82949614, 0xaa3d884c, 0x8d58adcd, 0xfa6fb5fc, 0xdd0a907d, 0xf5a38e25, 0xd2c6aba4, 0x1bcdbe47, 0x3ca89bc6, 0x1401859e, 0x3364a01f, 0x4453b82e, 0x63369daf, 0x4b9f83f7, 0x6cfaa676, 0x988ed8ea, 0xbfebfd6b, 0x9742e333, 0xb027c6b2, 0xc710de83, 0xe075fb02, 0xc8dce55a, 0xefb9c0db, 0x26b2d538, 0x01d7f0b9, 0x297eeee1, 0x0e1bcb60, 0x792cd351, 0x5e49f6d0, 0x76e0e888, 0x5185cd09}}; #endif #endif #endif local const z_crc_t FAR x2n_table[] = { 0x40000000, 0x20000000, 0x08000000, 0x00800000, 0x00008000, 0xedb88320, 0xb1e6b092, 0xa06a2517, 0xed627dae, 0x88d14467, 0xd7bbfe6a, 0xec447f11, 0x8e7ea170, 0x6427800e, 0x4d47bae0, 0x09fe548f, 0x83852d0f, 0x30362f1a, 0x7b5a9cc3, 0x31fec169, 0x9fec022a, 0x6c8dedc4, 0x15d6874d, 0x5fde7a4e, 0xbad90e37, 0x2e4e5eef, 0x4eaba214, 0xa8a472c0, 0x429a969e, 0x148d302a, 0xc40ba6d0, 0xc4e22c3c}; chibicc-1.0.24/test/crc32b.c000066400000000000000000000014421517770275000153770ustar00rootroot00000000000000#include "test.h" #include #include typedef struct { int64_t a; char b; // Padding likely here due to alignment int32_t c; } MyStruct; uint32_t simple_crc32c(const void *data, size_t len) { const unsigned char *p = data; uint32_t crc = 0; for (size_t i = 0; i < len; i++) crc += p[i]; // simple accumulation to mimic CRC return crc; } int main(void) { MyStruct arr[2]; for (int i = 0; i < 2; i++) { arr[i].a = i + 1; arr[i].b = i + 2; // leave c uninitialized to mimic padding issue } for (int i = 0; i < 2; i++) { uint32_t crc = simple_crc32c(&arr[i], sizeof(MyStruct)); printf("Struct %d CRC: %u\n", i, crc); } return 0; } chibicc-1.0.24/test/crc32c.c000066400000000000000000000021031517770275000153730ustar00rootroot00000000000000#include #include #include // SSE4.2 intrinsics typedef uint32_t crc32_t; // SSE4.2 CRC function __attribute__((target("sse4.2"))) crc32_t crc64_buffer(crc32_t crc, const void *data, size_t len) { const uint64_t *p = (const uint64_t *)data; const uint64_t *pend = p + len / 8; crc32_t r = crc; while (p < pend) { // <-- pointer dereference triggers segfault if lowering is incorrect r = (crc32_t)_mm_crc32_u64(r, *p); p++; } // remaining bytes (optional) const uint8_t *q = (const uint8_t *)p; size_t rem = len % 8; for (size_t i = 0; i < rem; i++) { r = _mm_crc32_u8(r, q[i]); } return r; } int main(void) { uint64_t buf[2] = {0x1122334455667788ULL, 0x99aabbccddeeff00ULL}; crc32_t (*fptr)(crc32_t, const void*, size_t); // indirect call simulates PostgreSQL runtime dispatch fptr = crc64_buffer; // This can crash in chibicc if _mm_crc32_u64 is mis-lowered crc32_t crc = fptr(0, buf, sizeof(buf)); printf("CRC = %u\n", crc); return 0; } chibicc-1.0.24/test/crc32c_init_repro.c000066400000000000000000000131271517770275000176350ustar00rootroot00000000000000#include "test.h" #include #include #include #include #include typedef uint32_t (*crc_func_t)(uint32_t crc, const void *buf, size_t len); static crc_func_t crc32c_fn; #define POLY 0x82f63b78u #define LONG 8192 #define LONGx1 "8192" #define LONGx2 "16384" #define SHORT 256 #define SHORTx1 "256" #define SHORTx2 "512" static volatile sig_atomic_t timed_out; static void on_alarm(int signo) { (void)signo; timed_out = 1; } static uint32_t crc32c_sw(uint32_t crc, const void *buf, size_t len) { const uint8_t *p = (const uint8_t *)buf; crc = ~crc; while (len--) { crc ^= *p++; for (int i = 0; i < 8; i++) crc = (crc >> 1) ^ (POLY & (-(int32_t)(crc & 1))); } return ~crc; } static inline uint32_t gf2_matrix_times(uint32_t *mat, uint32_t vec) { uint32_t sum = 0; while (vec) { if (vec & 1) sum ^= *mat; vec >>= 1; mat++; } return sum; } static inline void gf2_matrix_square(uint32_t *square, uint32_t *mat) { for (unsigned n = 0; n < 32; n++) square[n] = gf2_matrix_times(mat, mat[n]); } static void crc32c_zeros_op(uint32_t *even, size_t len) { uint32_t odd[32]; odd[0] = POLY; uint32_t row = 1; for (unsigned n = 1; n < 32; n++) { odd[n] = row; row <<= 1; } gf2_matrix_square(even, odd); gf2_matrix_square(odd, even); do { gf2_matrix_square(even, odd); len >>= 1; if (len == 0) return; gf2_matrix_square(odd, even); len >>= 1; } while (len); for (unsigned n = 0; n < 32; n++) even[n] = odd[n]; } static void crc32c_zeros(uint32_t zeros[][256], size_t len) { uint32_t op[32]; crc32c_zeros_op(op, len); for (unsigned n = 0; n < 256; n++) { zeros[0][n] = gf2_matrix_times(op, n); zeros[1][n] = gf2_matrix_times(op, n << 8); zeros[2][n] = gf2_matrix_times(op, n << 16); zeros[3][n] = gf2_matrix_times(op, n << 24); } } static inline uint32_t crc32c_shift(uint32_t zeros[][256], uint32_t crc) { return zeros[0][crc & 0xff] ^ zeros[1][(crc >> 8) & 0xff] ^ zeros[2][(crc >> 16) & 0xff] ^ zeros[3][crc >> 24]; } static pthread_once_t crc32c_once_hw = PTHREAD_ONCE_INIT; static uint32_t crc32c_long[4][256]; static uint32_t crc32c_short[4][256]; static void crc32c_init_hw(void) { crc32c_zeros(crc32c_long, LONG); crc32c_zeros(crc32c_short, SHORT); } static uint32_t crc32c_hw(uint32_t crc, const void *buf, size_t len) { pthread_once(&crc32c_once_hw, crc32c_init_hw); crc = ~crc; uint64_t crc0 = crc; const unsigned char *next = (const unsigned char *)buf; while (len && ((uintptr_t)next & 7) != 0) { __asm__("crc32b\t" "(%1), %0" : "+r"(crc0) : "r"(next), "m"(*next)); next++; len--; } while (len >= LONG * 3) { uint64_t crc1 = 0; uint64_t crc2 = 0; const unsigned char *end = next + LONG; do { __asm__("crc32q\t" "(%3), %0\n\t" "crc32q\t" LONGx1 "(%3), %1\n\t" "crc32q\t" LONGx2 "(%3), %2" : "+r"(crc0), "+r"(crc1), "+r"(crc2) : "r"(next), "m"(*next)); next += 8; } while (next < end); crc0 = crc32c_shift(crc32c_long, crc0) ^ crc1; crc0 = crc32c_shift(crc32c_long, crc0) ^ crc2; next += LONG * 2; len -= LONG * 3; } while (len >= SHORT * 3) { uint64_t crc1 = 0; uint64_t crc2 = 0; const unsigned char *end = next + SHORT; do { __asm__("crc32q\t" "(%3), %0\n\t" "crc32q\t" SHORTx1 "(%3), %1\n\t" "crc32q\t" SHORTx2 "(%3), %2" : "+r"(crc0), "+r"(crc1), "+r"(crc2) : "r"(next), "m"(*next)); next += 8; } while (next < end); crc0 = crc32c_shift(crc32c_short, crc0) ^ crc1; crc0 = crc32c_shift(crc32c_short, crc0) ^ crc2; next += SHORT * 2; len -= SHORT * 3; } { const unsigned char *end = next + (len - (len & 7)); while (next < end) { __asm__("crc32q\t" "(%1), %0" : "+r"(crc0) : "r"(next), "m"(*next)); next += 8; } len &= 7; } while (len) { __asm__("crc32b\t" "(%1), %0" : "+r"(crc0) : "r"(next), "m"(*next)); next++; len--; } return ~crc0; } #define SSE42(have) \ do { \ uint32_t eax, ecx; \ eax = 1; \ __asm__("cpuid" : "=c"(ecx) : "a"(eax) : "%ebx", "%edx"); \ (have) = (ecx >> 20) & 1; \ } while (0) static void crc32c_init(void) { int sse42; SSE42(sse42); if (sse42) { crc32c_fn = crc32c_hw; } else { crc32c_fn = crc32c_sw; } } static void *worker(void *arg) { uint8_t *buf = (uint8_t *)arg; for (int i = 0; i < 3000; i++) { if (timed_out) return (void *)1; size_t len = 20000 + (i & 31); uint32_t got = crc32c_fn(0, buf, len); uint32_t exp = crc32c_sw(0, buf, len); if (got != exp) return (void *)2; } return 0; } int main(void) { signal(SIGALRM, on_alarm); alarm(50); crc32c_init(); RASSERT(crc32c_fn != 0); uint8_t *buf = malloc(20512); RASSERT(buf != 0); for (int i = 0; i < 20512; i++) buf[i] = (uint8_t)((i * 131u + 17u) & 0xff); pthread_t th[4]; for (int i = 0; i < 4; i++) { int rc = pthread_create(&th[i], 0, worker, buf); ASSERT(0, rc); } for (int i = 0; i < 4; i++) { void *ret = 0; int rc = pthread_join(th[i], &ret); ASSERT(0, rc); ASSERT(0, (int)(uintptr_t)ret); } ASSERT(0, timed_out); free(buf); return 0; } chibicc-1.0.24/test/crc32d.c000066400000000000000000000035321517770275000154030ustar00rootroot00000000000000#include #include #include "test.h" //typedef unsigned int __v4su __attribute__ ((__vector_size__ (16))); typedef uint32_t crc32_t; /* Define the default attributes for the functions in this file. */ // #define __DEFAULT_FN_ATTRS \ // __attribute__((__always_inline__, __nodebug__, \ // __target__("ssse3,no-evex512"), __min_vector_width__(64))) // #define __DEFAULT_FN_ATTRS_MMX \ // __attribute__((__always_inline__, __nodebug__, \ // __target__("mmx,ssse3,no-evex512"), \ // __min_vector_width__(64))) // #define __DEFAULT_FN_ATTRS \ // __attribute__((__always_inline__, __nodebug__, __target__("crc32"))) // static __inline__ unsigned long long __DEFAULT_FN_ATTRS // _mm_crc32_u64(unsigned long long __C, unsigned long long __D) // { // return __builtin_ia32_crc32di(__C, __D); // } // Function marked with target attribute __attribute__((target("sse4.2"))) crc32_t my_crc(crc32_t crc, const void *data, size_t len) { const uint64_t *p = (const uint64_t *)data; const uint64_t *end = p + len / 8; crc32_t r = crc; while (p < end) { r = (crc32_t)_mm_crc32_u64(r, *p); // SSE4.2 intrinsic p++; } return r; } int main(void) { crc32_t (*crc_func)(crc32_t, const void*, size_t); // Call via function pointer (indirect call) crc_func = my_crc; uint64_t buf[2] = {0x1122334455667788ULL, 0x99aabbccddeeff00ULL}; // This may crash in chibicc if attribute is ignored crc32_t crc = crc_func(0, buf, sizeof(buf)); printf("CRC = %u\n", crc); ASSERT(1848164294, crc); return 0; } chibicc-1.0.24/test/csmith_102.c000066400000000000000000005235541517770275000162070ustar00rootroot00000000000000/* * This is a RANDOMLY GENERATED PROGRAM. * * Generator: csmith 2.4.0 * Git version: 0cdc710 * Options: --seed 4391 * Seed: 4391 */ #include "csmith.h" static long __undefined; /* --- Struct/Union Declarations --- */ struct S0 { unsigned f0 : 18; const unsigned f1 : 1; signed : 0; signed f2 : 11; signed f3 : 16; }; #pragma pack(push) #pragma pack(1) struct S1 { const unsigned f0 : 13; volatile unsigned f1 : 19; struct S0 f2; signed f3 : 24; signed f4 : 5; signed f5 : 13; unsigned f6 : 14; }; #pragma pack(pop) /* --- GLOBAL VARIABLES --- */ static volatile int64_t g_19[2] = {0x5CD3860A421E0BECLL,0x5CD3860A421E0BECLL}; static int32_t g_21[10] = {1L,1L,1L,1L,1L,1L,1L,1L,1L,1L}; static int32_t *g_20 = &g_21[7]; static int32_t g_96 = (-10L); static uint16_t g_98 = 65535UL; static uint32_t g_105 = 0x558FEE06L; static int32_t g_134 = 0x2AD6262BL; static int16_t g_135 = 0xA376L; static int16_t g_138 = 0x0AA8L; static uint32_t g_139 = 0xFC398B08L; static int64_t g_152 = 0x87AF7B95B8FDA41CLL; static int64_t g_164 = 0xCC82D11AB7CBE333LL; static int64_t *g_166 = &g_164; static uint32_t g_174[2] = {18446744073709551615UL,18446744073709551615UL}; static int32_t g_200 = 0xEEA4509CL; static uint64_t g_203 = 0xB455545A2E4B3AABLL; static int64_t * const *g_207 = &g_166; static int64_t * const **g_206 = &g_207; static const int16_t g_275 = 0x13AEL; static int32_t *g_281 = &g_96; static const uint64_t g_301 = 0x1E2D72D98116C57BLL; static int8_t g_303[8][8][2] = {{{1L,(-1L)},{1L,0xBFL},{0x6BL,0xABL},{(-1L),(-1L)},{0xBFL,1L},{0x78L,0xC0L},{0x56L,0xA8L},{0L,0x56L}},{{0x85L,1L},{0x85L,0x56L},{0L,0xA8L},{0x56L,0xC0L},{0x78L,1L},{0xBFL,(-1L)},{(-1L),0xABL},{0x6BL,0xBFL}},{{0xA8L,1L},{0x6BL,1L},{0xA8L,0xABL},{0x78L,1L},{0x85L,0x85L},{0xABL,0x6BL},{1L,(-1L)},{4L,(-1L)}},{{0x56L,4L},{1L,0xA8L},{1L,4L},{0x56L,(-1L)},{4L,(-1L)},{1L,0x6BL},{0xABL,0x85L},{0x85L,1L}},{{0x78L,0xABL},{0xA8L,1L},{0x6BL,1L},{0xA8L,0xABL},{0x78L,1L},{0x85L,0x85L},{0xABL,0x6BL},{1L,(-1L)}},{{4L,(-1L)},{0x56L,4L},{1L,0xA8L},{1L,4L},{0x56L,(-1L)},{4L,(-1L)},{1L,0x6BL},{0xABL,0x85L}},{{0x85L,1L},{0x78L,0xABL},{0xA8L,1L},{0x6BL,1L},{0xA8L,0xABL},{0x78L,1L},{0x85L,0x85L},{0xABL,0x6BL}},{{1L,(-1L)},{4L,(-1L)},{0x56L,4L},{1L,0xA8L},{1L,4L},{0x56L,(-1L)},{4L,(-1L)},{1L,0x6BL}}}; static volatile struct S1 *g_308[3] = {(void*)0,(void*)0,(void*)0}; static uint16_t g_328 = 1UL; static uint8_t g_364 = 0UL; static struct S1 g_366 = {17,91,{60,0,23,-116},555,-0,30,53};/* VOLATILE GLOBAL g_366 */ static int8_t g_449 = (-3L); static uint16_t g_460 = 0x302DL; static int8_t g_494 = 0x87L; static struct S1 g_517 = {57,453,{485,0,-4,-180},-296,-0,67,101};/* VOLATILE GLOBAL g_517 */ static int32_t g_538 = 0L; static uint16_t g_539 = 0x5455L; static volatile int16_t g_554 = 1L;/* VOLATILE GLOBAL g_554 */ static volatile int16_t * const g_553 = &g_554; static volatile int16_t * const volatile *g_552 = &g_553; static int16_t *g_567 = &g_135; static int16_t **g_566[4][2] = {{&g_567,&g_567},{&g_567,&g_567},{&g_567,&g_567},{&g_567,&g_567}}; static const int64_t **g_675 = (void*)0; static const int64_t ***g_674 = &g_675; static struct S1 g_687 = {61,338,{295,0,15,-109},-2325,3,-59,0};/* VOLATILE GLOBAL g_687 */ static struct S1 *g_686 = &g_687; static struct S1 **g_685 = &g_686; static struct S1 ***g_684[8][8] = {{&g_685,&g_685,(void*)0,&g_685,&g_685,(void*)0,&g_685,&g_685},{&g_685,&g_685,(void*)0,(void*)0,&g_685,&g_685,&g_685,(void*)0},{&g_685,&g_685,&g_685,&g_685,(void*)0,&g_685,(void*)0,(void*)0},{(void*)0,&g_685,&g_685,&g_685,&g_685,(void*)0,(void*)0,&g_685},{(void*)0,&g_685,&g_685,&g_685,(void*)0,&g_685,&g_685,&g_685},{&g_685,&g_685,&g_685,&g_685,&g_685,&g_685,&g_685,&g_685},{&g_685,&g_685,&g_685,&g_685,&g_685,&g_685,&g_685,(void*)0},{&g_685,&g_685,&g_685,&g_685,&g_685,&g_685,&g_685,(void*)0}}; static volatile uint16_t g_695 = 4UL;/* VOLATILE GLOBAL g_695 */ static volatile uint16_t *g_694 = &g_695; static volatile uint16_t * volatile *g_693[1] = {&g_694}; static int16_t g_722 = 1L; static int32_t g_730 = 0L; static int64_t *g_733 = (void*)0; static struct S1 g_760 = {78,180,{421,0,-32,69},-434,-2,-70,110};/* VOLATILE GLOBAL g_760 */ static uint64_t *g_773 = (void*)0; static const struct S1 g_956 = {66,697,{353,0,-28,-166},-3521,-1,26,78};/* VOLATILE GLOBAL g_956 */ static const struct S1 g_957 = {56,611,{496,0,8,79},28,-1,19,102};/* VOLATILE GLOBAL g_957 */ static const int8_t *g_992 = &g_303[3][3][0]; static const int8_t **g_991 = &g_992; static int64_t g_1013 = 0x016E3718CA66D780LL; static struct S1 ** const **g_1080 = (void*)0; static struct S1 ** const ***g_1079 = &g_1080; static int64_t **g_1108 = &g_166; static struct S1 g_1118 = {80,494,{38,0,29,-225},1899,4,31,19};/* VOLATILE GLOBAL g_1118 */ static struct S1 g_1120[8] = {{30,93,{26,0,-24,-63},-3594,3,79,5},{30,93,{26,0,-24,-63},-3594,3,79,5},{30,93,{26,0,-24,-63},-3594,3,79,5},{30,93,{26,0,-24,-63},-3594,3,79,5},{30,93,{26,0,-24,-63},-3594,3,79,5},{30,93,{26,0,-24,-63},-3594,3,79,5},{30,93,{26,0,-24,-63},-3594,3,79,5},{30,93,{26,0,-24,-63},-3594,3,79,5}}; static struct S1 g_1184 = {20,286,{211,0,-34,246},3270,-0,-0,40};/* VOLATILE GLOBAL g_1184 */ static struct S1 g_1185[7][8] = {{{68,41,{82,0,16,-255},2307,-0,-20,34},{47,133,{217,0,-35,194},98,-3,-11,93},{53,362,{335,0,-23,171},1449,1,24,29},{47,133,{217,0,-35,194},98,-3,-11,93},{68,41,{82,0,16,-255},2307,-0,-20,34},{68,41,{82,0,16,-255},2307,-0,-20,34},{47,133,{217,0,-35,194},98,-3,-11,93},{53,362,{335,0,-23,171},1449,1,24,29}},{{68,41,{82,0,16,-255},2307,-0,-20,34},{68,41,{82,0,16,-255},2307,-0,-20,34},{47,133,{217,0,-35,194},98,-3,-11,93},{37,626,{451,0,-27,223},-2453,1,84,47},{73,140,{28,0,-12,32},-231,-1,33,90},{47,133,{217,0,-35,194},98,-3,-11,93},{47,133,{217,0,-35,194},98,-3,-11,93},{73,140,{28,0,-12,32},-231,-1,33,90}},{{53,362,{335,0,-23,171},1449,1,24,29},{73,140,{28,0,-12,32},-231,-1,33,90},{73,140,{28,0,-12,32},-231,-1,33,90},{53,362,{335,0,-23,171},1449,1,24,29},{68,41,{82,0,16,-255},2307,-0,-20,34},{53,362,{335,0,-23,171},1449,1,24,29},{73,140,{28,0,-12,32},-231,-1,33,90},{73,140,{28,0,-12,32},-231,-1,33,90}},{{73,140,{28,0,-12,32},-231,-1,33,90},{68,41,{82,0,16,-255},2307,-0,-20,34},{37,626,{451,0,-27,223},-2453,1,84,47},{37,626,{451,0,-27,223},-2453,1,84,47},{68,41,{82,0,16,-255},2307,-0,-20,34},{73,140,{28,0,-12,32},-231,-1,33,90},{68,41,{82,0,16,-255},2307,-0,-20,34},{37,626,{451,0,-27,223},-2453,1,84,47}},{{53,362,{335,0,-23,171},1449,1,24,29},{68,41,{82,0,16,-255},2307,-0,-20,34},{53,362,{335,0,-23,171},1449,1,24,29},{73,140,{28,0,-12,32},-231,-1,33,90},{73,140,{28,0,-12,32},-231,-1,33,90},{53,362,{335,0,-23,171},1449,1,24,29},{68,41,{82,0,16,-255},2307,-0,-20,34},{53,362,{335,0,-23,171},1449,1,24,29}},{{47,133,{217,0,-35,194},98,-3,-11,93},{73,140,{28,0,-12,32},-231,-1,33,90},{37,626,{451,0,-27,223},-2453,1,84,47},{73,140,{28,0,-12,32},-231,-1,33,90},{47,133,{217,0,-35,194},98,-3,-11,93},{47,133,{217,0,-35,194},98,-3,-11,93},{73,140,{28,0,-12,32},-231,-1,33,90},{37,626,{451,0,-27,223},-2453,1,84,47}},{{47,133,{217,0,-35,194},98,-3,-11,93},{47,133,{217,0,-35,194},98,-3,-11,93},{73,140,{28,0,-12,32},-231,-1,33,90},{37,626,{451,0,-27,223},-2453,1,84,47},{73,140,{28,0,-12,32},-231,-1,33,90},{47,133,{217,0,-35,194},98,-3,-11,93},{47,133,{217,0,-35,194},98,-3,-11,93},{73,140,{28,0,-12,32},-231,-1,33,90}}}; static struct S1 g_1186 = {27,450,{22,0,-12,245},-1075,0,31,65};/* VOLATILE GLOBAL g_1186 */ static uint64_t * const *g_1261 = &g_773; static uint64_t * const **g_1260[10] = {&g_1261,&g_1261,&g_1261,&g_1261,&g_1261,&g_1261,&g_1261,&g_1261,&g_1261,&g_1261}; static uint64_t * const ***g_1259[7][7][1] = {{{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]}},{{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0}},{{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]}},{{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0}},{{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]}},{{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0}},{{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]},{(void*)0},{&g_1260[2]}}}; static int64_t g_1356 = 0xA1C4619E653EBBF5LL; static struct S0 g_1365[3][4][6] = {{{{55,0,5,197},{247,0,44,-142},{247,0,44,-142},{55,0,5,197},{155,0,6,-91},{222,0,-5,233}},{{36,0,28,208},{507,0,-10,-89},{501,0,-40,-35},{222,0,-5,233},{500,0,-43,192},{32,0,-16,-90}},{{500,0,-43,192},{155,0,6,-91},{277,0,-20,130},{155,0,6,-91},{500,0,-43,192},{24,0,3,-143}},{{32,0,-16,-90},{507,0,-10,-89},{341,0,-26,-26},{374,0,-27,48},{155,0,6,-91},{501,0,-40,-35}}},{{{501,0,-40,-35},{247,0,44,-142},{507,0,-10,-89},{507,0,-10,-89},{247,0,44,-142},{501,0,-40,-35}},{{374,0,-27,48},{222,0,-5,233},{341,0,-26,-26},{500,0,-43,192},{501,0,-40,-35},{24,0,3,-143}},{{247,0,44,-142},{32,0,-16,-90},{277,0,-20,130},{501,0,-40,-35},{277,0,-20,130},{32,0,-16,-90}},{{247,0,44,-142},{24,0,3,-143},{501,0,-40,-35},{500,0,-43,192},{341,0,-26,-26},{222,0,-5,233}}},{{{374,0,-27,48},{501,0,-40,-35},{247,0,44,-142},{507,0,-10,-89},{507,0,-10,-89},{247,0,44,-142}},{{501,0,-40,-35},{501,0,-40,-35},{155,0,6,-91},{374,0,-27,48},{341,0,-26,-26},{507,0,-10,-89}},{{32,0,-16,-90},{24,0,3,-143},{500,0,-43,192},{155,0,6,-91},{277,0,-20,130},{155,0,6,-91}},{{500,0,-43,192},{32,0,-16,-90},{500,0,-43,192},{222,0,-5,233},{501,0,-40,-35},{507,0,-10,-89}}}}; static struct S0 *g_1364 = &g_1365[0][3][1]; static struct S1 g_1407 = {84,694,{13,0,1,117},678,-4,20,25};/* VOLATILE GLOBAL g_1407 */ static int16_t g_1494 = 0x1BFCL; static int8_t *g_1556 = &g_449; static struct S1 g_1600[3] = {{89,536,{85,0,-2,-237},3153,-1,-31,43},{89,536,{85,0,-2,-237},3153,-1,-31,43},{89,536,{85,0,-2,-237},3153,-1,-31,43}}; static int64_t g_1603 = 3L; static uint16_t g_1621 = 65531UL; static uint32_t * volatile *g_1655 = (void*)0; static uint16_t g_1676 = 0xC8DFL; static volatile uint16_t * volatile **g_1709 = &g_693[0]; static const int16_t *g_1744 = &g_722; static const int16_t **g_1743 = &g_1744; static const int32_t *g_1750 = (void*)0; static const int32_t * volatile *g_1749 = &g_1750; static const int32_t * volatile **g_1748 = &g_1749; static uint64_t **g_1769[5] = {&g_773,&g_773,&g_773,&g_773,&g_773}; static uint64_t ***g_1768 = &g_1769[0]; static struct S1 g_1781 = {38,586,{419,0,-32,47},-3241,0,17,45};/* VOLATILE GLOBAL g_1781 */ static uint16_t *g_1789 = (void*)0; static uint16_t **g_1788 = &g_1789; static uint16_t ***g_1787 = &g_1788; static uint16_t ***g_1792[3][3] = {{(void*)0,(void*)0,(void*)0},{&g_1788,&g_1788,&g_1788},{(void*)0,(void*)0,(void*)0}}; static uint32_t g_1854 = 0x15C55A83L; static struct S1 g_1896 = {40,16,{81,0,27,178},-2799,-2,-77,126};/* VOLATILE GLOBAL g_1896 */ static int64_t g_1919 = (-1L); static int8_t g_1944[7] = {(-1L),(-1L),0L,(-1L),(-1L),0L,(-1L)}; static struct S0 * const **g_1948 = (void*)0; static int16_t ***g_1995 = &g_566[1][0]; static int16_t *** const *g_1994 = &g_1995; static int32_t * const volatile g_2121 = &g_200;/* VOLATILE GLOBAL g_2121 */ static volatile struct S1 g_2138 = {41,41,{317,0,-6,186},1969,3,-23,71};/* VOLATILE GLOBAL g_2138 */ static uint8_t g_2141[10][2][4] = {{{0x9DL,248UL,6UL,0x9DL},{0x45L,0x8AL,0x45L,6UL}},{{0x99L,0x8AL,0UL,0x9DL},{0x8AL,248UL,248UL,0x8AL}},{{0x45L,0x9DL,248UL,6UL},{0x8AL,0x99L,0UL,0x99L}},{{0x99L,248UL,0x45L,0x99L},{0x45L,0x99L,6UL,6UL}},{{0x9DL,0x9DL,0UL,0x8AL},{0x9DL,248UL,6UL,0x9DL}},{{0x45L,0x8AL,0x45L,6UL},{0x99L,0x8AL,0UL,0x9DL}},{{0x8AL,248UL,248UL,0x8AL},{0x45L,0x9DL,248UL,6UL}},{{0x8AL,0x99L,0UL,0x99L},{0x99L,248UL,0x45L,0x99L}},{{0x45L,0x99L,6UL,6UL},{0x9DL,0x9DL,0UL,0x8AL}},{{0x9DL,248UL,6UL,0x9DL},{0x45L,0x8AL,0x45L,6UL}}}; static uint64_t *g_2166 = &g_203; static uint64_t ** const g_2165[8] = {&g_2166,&g_2166,&g_2166,&g_2166,&g_2166,&g_2166,&g_2166,&g_2166}; static uint64_t ** const * const g_2164[2] = {&g_2165[7],&g_2165[7]}; static uint64_t ** const * const *g_2163 = &g_2164[1]; static uint64_t ** const * const **g_2162 = &g_2163; static struct S1 g_2201 = {12,712,{294,0,33,-146},3492,0,45,11};/* VOLATILE GLOBAL g_2201 */ static uint32_t g_2211 = 0x70ADE216L; static const int32_t ** volatile g_2280 = (void*)0;/* VOLATILE GLOBAL g_2280 */ static struct S0 *****g_2352 = (void*)0; static struct S1 g_2428 = {42,469,{70,0,-14,-75},3384,4,3,97};/* VOLATILE GLOBAL g_2428 */ static volatile int64_t **** volatile * volatile g_2508 = (void*)0;/* VOLATILE GLOBAL g_2508 */ static volatile uint8_t ** const volatile g_2668 = (void*)0;/* VOLATILE GLOBAL g_2668 */ static uint16_t ****g_2678 = &g_1792[2][1]; static volatile int8_t g_2790[10] = {(-9L),(-9L),(-9L),(-9L),(-9L),(-9L),(-9L),(-9L),(-9L),(-9L)}; static int16_t g_2794 = 0L; static struct S1 g_2817[7][10] = {{{29,539,{348,0,35,170},-1144,-4,-8,118},{2,636,{36,0,27,-174},1359,1,16,69},{52,222,{358,0,-28,195},4043,-1,-83,67},{7,113,{97,0,5,-215},-1590,3,2,73},{38,624,{134,0,-9,-208},1736,3,59,58},{7,113,{97,0,5,-215},-1590,3,2,73},{52,222,{358,0,-28,195},4043,-1,-83,67},{2,636,{36,0,27,-174},1359,1,16,69},{29,539,{348,0,35,170},-1144,-4,-8,118},{13,649,{330,0,-44,206},604,3,84,113}},{{86,226,{37,0,-7,221},-236,-0,11,119},{34,452,{397,0,28,219},1061,2,-77,11},{5,201,{196,0,-8,-71},-2385,4,-16,50},{38,624,{134,0,-9,-208},1736,3,59,58},{2,636,{36,0,27,-174},1359,1,16,69},{68,589,{511,0,-24,31},-4025,-4,-34,49},{38,624,{134,0,-9,-208},1736,3,59,58},{52,14,{90,0,-35,-51},-368,1,46,38},{51,121,{57,0,27,38},-1547,-3,49,33},{86,226,{37,0,-7,221},-236,-0,11,119}},{{34,452,{397,0,28,219},1061,2,-77,11},{7,113,{97,0,5,-215},-1590,3,2,73},{29,539,{348,0,35,170},-1144,-4,-8,118},{38,624,{134,0,-9,-208},1736,3,59,58},{29,455,{12,0,22,-9},3167,-0,51,33},{18,489,{26,0,0,-130},-1042,-0,-14,81},{63,472,{305,0,36,102},-2933,-2,3,88},{80,627,{456,0,-28,-23},3893,-4,-45,71},{29,539,{348,0,35,170},-1144,-4,-8,118},{38,693,{37,0,7,160},-894,-1,-84,98}},{{13,649,{330,0,-44,206},604,3,84,113},{52,14,{90,0,-35,-51},-368,1,46,38},{18,489,{26,0,0,-130},-1042,-0,-14,81},{7,113,{97,0,5,-215},-1590,3,2,73},{63,472,{305,0,36,102},-2933,-2,3,88},{71,698,{392,0,-8,248},2969,2,85,47},{71,698,{392,0,-8,248},2969,2,85,47},{63,472,{305,0,36,102},-2933,-2,3,88},{7,113,{97,0,5,-215},-1590,3,2,73},{18,489,{26,0,0,-130},-1042,-0,-14,81}},{{63,472,{305,0,36,102},-2933,-2,3,88},{63,472,{305,0,36,102},-2933,-2,3,88},{51,121,{57,0,27,38},-1547,-3,49,33},{60,344,{9,0,22,-225},-3105,1,-12,96},{2,636,{36,0,27,-174},1359,1,16,69},{37,111,{487,0,-12,2},2835,3,-10,67},{17,198,{389,0,-2,255},3565,3,51,74},{33,310,{159,0,-9,-15},-1884,2,-21,62},{68,589,{511,0,-24,31},-4025,-4,-34,49},{60,344,{9,0,22,-225},-3105,1,-12,96}},{{60,344,{9,0,22,-225},-3105,1,-12,96},{65,476,{54,0,44,-175},2091,-1,-4,46},{13,649,{330,0,-44,206},604,3,84,113},{33,310,{159,0,-9,-15},-1884,2,-21,62},{80,627,{456,0,-28,-23},3893,-4,-45,71},{18,489,{26,0,0,-130},-1042,-0,-14,81},{17,198,{389,0,-2,255},3565,3,51,74},{29,539,{348,0,35,170},-1144,-4,-8,118},{18,489,{26,0,0,-130},-1042,-0,-14,81},{38,624,{134,0,-9,-208},1736,3,59,58}},{{19,107,{297,0,-3,88},773,0,-44,69},{63,472,{305,0,36,102},-2933,-2,3,88},{29,455,{12,0,22,-9},3167,-0,51,33},{19,107,{297,0,-3,88},773,0,-44,69},{60,344,{9,0,22,-225},-3105,1,-12,96},{22,87,{220,0,-5,23},-1309,0,-70,111},{71,698,{392,0,-8,248},2969,2,85,47},{17,198,{389,0,-2,255},3565,3,51,74},{71,698,{392,0,-8,248},2969,2,85,47},{22,87,{220,0,-5,23},-1309,0,-70,111}}}; static uint16_t g_2868 = 0xA071L; static uint32_t ***g_2879 = (void*)0; static uint32_t **** volatile g_2878 = &g_2879;/* VOLATILE GLOBAL g_2878 */ static int32_t g_2885 = 8L; static int32_t *g_2884 = &g_2885; static const uint64_t *g_2892 = &g_203; static const uint64_t **g_2891 = &g_2892; static const uint64_t *** volatile g_2890 = &g_2891;/* VOLATILE GLOBAL g_2890 */ /* --- FORWARD DECLARATIONS --- */ static int32_t func_1(void); static int32_t * func_2(uint32_t p_3, int32_t * p_4, int32_t * p_5, uint16_t p_6, uint32_t p_7); static int32_t * func_9(int32_t * p_10, int64_t p_11, uint8_t p_12, int32_t * p_13); static int32_t * func_14(uint16_t p_15); static int32_t * func_23(int64_t p_24); static int64_t func_25(int32_t * p_26); static int32_t * func_27(int32_t * p_28, int32_t * const p_29); static int32_t * const func_30(int32_t * p_31); static int64_t func_39(struct S0 p_40, const struct S0 p_41, uint16_t p_42); static int32_t func_48(int8_t p_49, int16_t p_50, int32_t * p_51, int64_t p_52, int8_t p_53); /* --- FUNCTIONS --- */ /* ------------------------------------------ */ /* * reads : g_19 g_20 g_21 g_105 g_96 g_98 g_134 g_135 g_138 g_139 g_174 g_200 g_364 g_517.f2.f3 g_517.f2.f2 g_275 g_281 g_460 g_166 g_164 g_449 g_956.f4 g_517.f5 g_366.f4 g_567 g_760.f2.f1 g_957.f4 g_366.f5 g_991 g_992 g_303 g_203 g_687.f4 g_1013 g_760.f6 g_494 g_687.f5 g_957.f2.f2 g_957.f5 g_1079 g_685 g_686 g_1120.f3 g_366.f2 g_1781.f2.f1 g_687.f3 g_1919 g_539 g_1364 g_1365 g_1948 g_1356 g_1080 g_1768 g_538 g_1743 g_1744 g_722 g_1676 g_956.f2.f1 g_1556 g_2121 g_730 g_1185.f1 g_2138 g_2141 g_517.f6 g_1944 g_957.f2.f0 g_1709 g_693 g_694 g_695 g_1749 g_1750 g_552 g_553 g_554 g_2201 g_2166 g_1748 g_1186.f1 g_1185.f4 g_2163 g_2164 g_2165 g_674 g_760.f5 g_1118.f1 g_1407.f2.f0 g_152 g_2428 g_1600.f2 g_1118.f2 g_1854 g_517.f2.f1 g_2508 g_957.f0 g_1621 g_2668 g_1186.f6 g_1185.f2.f0 g_1494 g_2790 g_2817 g_1896.f2.f0 g_1120.f4 g_2868 g_2878 g_2884 g_1600.f4 g_2890 g_760.f4 * writes: g_96 g_98 g_105 g_138 g_139 g_152 g_166 g_134 g_174 g_200 g_364 g_21 g_281 g_460 g_449 g_135 g_517.f5 g_203 g_687.f4 g_538 g_164 g_991 g_303 g_730 g_1108 g_1013 g_1356 g_686 g_366.f2.f3 g_539 g_1948 g_1769 g_494 g_1259 g_1676 g_1994 g_1781.f5 g_1603 g_1919 g_2141 g_2162 g_2211 g_1750 g_1792 g_2352 g_675 g_1854 g_1364 g_1621 g_1556 g_328 g_722 g_2678 g_1944 g_1494 g_2794 g_20 g_2868 g_2879 g_2891 */ static int32_t func_1(void) { /* block id: 0 */ int32_t l_8[2]; int16_t l_22 = (-10L); uint64_t l_2886 = 0xDF2FF8DBC543A167LL; int32_t *l_2893 = &g_538; int i; for (i = 0; i < 2; i++) l_8[i] = 0L; l_2893 = func_2(l_8[0], func_9(func_14((!((safe_lshift_func_uint16_t_u_s(0xBC04L, g_19[1])) & (g_20 == (l_22 , func_23(func_25(func_27(&g_21[6], func_30(&g_21[7]))))))))), l_22, g_760.f5, g_20), g_2884, l_2886, g_1600[2].f4); return g_760.f4; } /* ------------------------------------------ */ /* * reads : g_1748 g_1749 g_2890 * writes: g_1750 g_2891 */ static int32_t * func_2(uint32_t p_3, int32_t * p_4, int32_t * p_5, uint16_t p_6, uint32_t p_7) { /* block id: 1302 */ uint8_t l_2887 = 255UL; int32_t *l_2888[6][9][4] = {{{&g_2885,&g_21[7],&g_21[1],&g_21[7]},{&g_21[1],&g_21[7],&g_2885,&g_21[7]},{&g_21[7],&g_134,&g_2885,&g_21[7]},{&g_96,&g_96,&g_96,&g_96},{&g_96,(void*)0,&g_21[1],&g_134},{&g_538,&g_96,&g_2885,&g_21[7]},{&g_21[7],&g_200,&g_21[7],&g_21[7]},{&g_2885,&g_96,&g_538,&g_134},{&g_21[1],(void*)0,&g_96,&g_96}},{{&g_96,&g_96,&g_96,&g_21[7]},{&g_21[1],&g_2885,&g_538,(void*)0},{&g_2885,&g_538,&g_21[7],&g_538},{&g_21[7],&g_538,&g_2885,(void*)0},{&g_538,&g_2885,&g_21[1],&g_21[7]},{&g_96,&g_96,&g_96,&g_96},{&g_96,(void*)0,&g_21[1],&g_134},{&g_538,&g_96,&g_2885,&g_21[7]},{&g_21[7],&g_200,&g_21[7],&g_21[7]}},{{&g_2885,&g_96,&g_538,&g_134},{&g_21[1],(void*)0,&g_96,&g_96},{&g_96,&g_96,&g_96,&g_21[7]},{&g_21[1],&g_2885,&g_538,(void*)0},{&g_2885,&g_538,&g_21[7],&g_538},{&g_21[7],&g_538,&g_2885,(void*)0},{&g_538,&g_2885,&g_21[1],&g_21[7]},{&g_96,&g_96,&g_96,&g_96},{&g_96,(void*)0,&g_21[1],&g_134}},{{&g_538,&g_96,&g_2885,&g_21[7]},{&g_21[7],&g_200,&g_21[7],&g_21[7]},{&g_2885,&g_96,&g_538,&g_134},{&g_21[1],(void*)0,&g_96,&g_96},{&g_96,&g_96,&g_96,&g_21[7]},{&g_21[1],&g_2885,&g_538,(void*)0},{&g_2885,&g_538,&g_21[7],&g_538},{&g_21[7],&g_538,&g_2885,(void*)0},{&g_538,&g_2885,&g_21[1],&g_21[7]}},{{&g_96,&g_96,&g_96,&g_96},{&g_96,(void*)0,&g_21[1],&g_134},{&g_538,&g_96,&g_2885,&g_21[7]},{&g_21[7],&g_200,&g_21[7],&g_21[7]},{&g_2885,&g_96,&g_538,&g_134},{&g_21[1],(void*)0,&g_96,&g_96},{&g_96,&g_96,&g_96,&g_21[7]},{&g_21[1],&g_2885,&g_538,(void*)0},{&g_2885,&g_538,&g_21[7],&g_538}},{{&g_21[7],&g_538,&g_2885,(void*)0},{&g_538,&g_2885,&g_21[1],&g_21[7]},{&g_96,&g_96,&g_96,&g_96},{&g_96,(void*)0,&g_21[1],&g_134},{&g_538,&g_96,&g_2885,&g_21[7]},{&g_21[7],&g_200,(void*)0,&g_538},{&g_21[1],&g_96,&g_200,&g_2885},{&g_21[7],&g_96,&g_96,&g_96},{&g_21[7],&g_21[7],&g_96,(void*)0}}}; const uint64_t **l_2889 = (void*)0; int i, j, k; (**g_1748) = l_2888[5][7][0]; (*g_2890) = l_2889; return l_2888[1][8][1]; } /* ------------------------------------------ */ /* * reads : g_449 g_1118.f1 g_992 g_303 g_1748 g_1749 g_139 g_2121 g_200 g_1407.f2.f0 g_152 g_96 g_538 g_134 g_2428 g_1750 g_1364 g_1600.f2 g_1118.f2 g_1365 g_21 g_567 g_687.f3 g_20 g_135 g_991 g_203 g_19 g_1854 g_517.f2.f1 g_2508 g_552 g_553 g_554 g_98 g_1743 g_1744 g_722 g_366.f2 g_1556 g_494 g_957.f0 g_1621 g_2163 g_2164 g_2165 g_2166 g_460 g_2668 g_1186.f6 g_2201.f4 g_1709 g_693 g_694 g_695 g_1185.f2.f0 g_1494 g_2790 g_539 g_2817 g_1896.f2.f0 g_1120.f4 g_164 g_2868 g_2878 * writes: g_449 g_328 g_1854 g_21 g_96 g_538 g_134 g_200 g_1750 g_135 g_1603 g_1364 g_722 g_203 g_1356 g_139 g_138 g_2141 g_303 g_98 g_281 g_1013 g_1556 g_105 g_2678 g_1944 g_1494 g_2794 g_539 g_174 g_1621 g_20 g_2868 g_2879 */ static int32_t * func_9(int32_t * p_10, int64_t p_11, uint8_t p_12, int32_t * p_13) { /* block id: 1058 */ int32_t l_2400 = (-7L); struct S1 **l_2494 = &g_686; uint64_t ** const ***l_2503 = (void*)0; int8_t **l_2523[7][1][3] = {{{&g_1556,&g_1556,&g_1556}},{{&g_1556,&g_1556,&g_1556}},{{&g_1556,&g_1556,&g_1556}},{{&g_1556,&g_1556,&g_1556}},{{&g_1556,&g_1556,&g_1556}},{{&g_1556,&g_1556,&g_1556}},{{&g_1556,&g_1556,&g_1556}}}; int32_t l_2546 = 0x81BDBA11L; struct S0 ***l_2556 = (void*)0; int32_t l_2570[4] = {1L,1L,1L,1L}; int32_t l_2670 = 5L; int8_t l_2682 = 0x23L; int32_t l_2689 = 0L; struct S1 ****l_2708 = &g_684[3][0]; struct S1 *****l_2707[5] = {&l_2708,&l_2708,&l_2708,&l_2708,&l_2708}; int32_t l_2731 = 0x7947BA05L; uint16_t l_2757[3]; uint8_t *l_2802 = &g_2141[4][1][3]; uint8_t **l_2801[1][6][10] = {{{&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802},{&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802},{&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802},{&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802},{&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802},{&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802,&l_2802}}}; int64_t **l_2865 = &g_166; int32_t *l_2880[8] = {&g_134,&g_134,&g_134,&g_134,&g_134,&g_134,&g_134,&g_134}; uint8_t l_2881 = 0x44L; int i, j, k; for (i = 0; i < 3; i++) l_2757[i] = 0UL; for (p_11 = (-8); (p_11 == (-2)); p_11 = safe_add_func_uint16_t_u_u(p_11, 3)) { /* block id: 1061 */ int32_t l_2407[10][10][2] = {{{0x116458D0L,0xC47F2C3CL},{8L,0xAF598EF8L},{0x9A6343D9L,(-9L)},{(-1L),0L},{(-1L),(-1L)},{0x52D07611L,0xA26975CEL},{0x97B3AE03L,0x4AC12D3BL},{0x9EB8E465L,0xB75E65BEL},{(-6L),(-1L)},{(-5L),(-1L)}},{{(-1L),(-1L)},{(-5L),(-1L)},{(-6L),0xB75E65BEL},{0x9EB8E465L,0x4AC12D3BL},{0x97B3AE03L,0xA26975CEL},{0x52D07611L,(-1L)},{(-1L),0L},{(-1L),(-9L)},{0x9A6343D9L,0xAF598EF8L},{8L,0xC47F2C3CL}},{{0x116458D0L,0x9EB8E465L},{(-1L),0x956860F1L},{0xF2358411L,0L},{0xDAD9700FL,8L},{0x71430AAFL,(-4L)},{0L,8L},{(-1L),0x116458D0L},{0x65715371L,0x80F06ED0L},{0x70C8BC80L,(-1L)},{0L,0xD3FE6184L}},{{0x935E2444L,7L},{7L,0L},{0x6AC92402L,(-1L)},{0L,0x52D07611L},{0xFDF00378L,0xF2358411L},{(-1L),1L},{0L,2L},{0x67FCE753L,0x97B3AE03L},{1L,(-5L)},{0xC47F2C3CL,0L}},{{(-1L),(-1L)},{(-6L),0x67FCE753L},{8L,0L},{(-6L),0x19608C04L},{(-1L),(-6L)},{0L,1L},{0L,(-6L)},{(-1L),0x19608C04L},{(-6L),0L},{8L,0x67FCE753L}},{{(-6L),(-1L)},{(-1L),0L},{0x70C8BC80L,1L},{0x71430AAFL,0xC2600E6AL},{0x81A918C5L,1L},{(-1L),0L},{0L,0x4AC12D3BL},{0x3CD41806L,0x65715371L},{0L,1L},{(-4L),(-1L)}},{{0xD3FE6184L,7L},{0x52D07611L,0L},{(-1L),0xFDF00378L},{0x0DC0335DL,(-1L)},{1L,0x9EB8E465L},{0x33D1B2EEL,0xD9498994L},{0x80F06ED0L,(-6L)},{1L,0xA26975CEL},{0x19608C04L,7L},{0x4AC12D3BL,6L}},{{1L,0xC47F2C3CL},{0x9EB8E465L,0x70C8BC80L},{0xA26975CEL,0xD79ECDA7L},{7L,0L},{0x116458D0L,0x80F06ED0L},{0x97B3AE03L,0x8051A5AFL},{0x65715371L,(-1L)},{0xC2600E6AL,2L},{0xC47F2C3CL,0xDAD9700FL},{0L,0x33D1B2EEL}},{{1L,(-9L)},{0x8051A5AFL,(-9L)},{1L,0x33D1B2EEL},{0L,0xDAD9700FL},{0xC47F2C3CL,2L},{0xC2600E6AL,(-1L)},{0x65715371L,0x8051A5AFL},{0x97B3AE03L,0x80F06ED0L},{0x116458D0L,0L},{7L,0xD79ECDA7L}},{{0xA26975CEL,0x70C8BC80L},{0x9EB8E465L,0xC47F2C3CL},{1L,6L},{0x4AC12D3BL,7L},{0x19608C04L,0xA26975CEL},{1L,(-6L)},{0x80F06ED0L,0xD9498994L},{0x33D1B2EEL,0x9EB8E465L},{1L,(-1L)},{0x0DC0335DL,0xFDF00378L}}}; int32_t l_2409[2][7][6] = {{{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L},{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L},{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L},{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L},{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L},{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L},{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L}},{{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L},{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L},{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L},{0x0762BF70L,1L,1L,0x0762BF70L,1L,1L},{0x0762BF70L,1L,1L,1L,8L,8L},{1L,8L,8L,1L,8L,8L},{1L,8L,8L,1L,8L,8L}}}; struct S0 * const l_2469 = &g_1600[2].f2; int32_t *l_2499 = &l_2409[1][4][2]; int64_t l_2568 = 0xF4E6486305D6EF3ALL; uint32_t l_2574 = 18446744073709551615UL; const uint32_t *l_2579 = &g_1854; const uint32_t **l_2578[4]; int32_t l_2619[5] = {0x9E4DCF41L,0x9E4DCF41L,0x9E4DCF41L,0x9E4DCF41L,0x9E4DCF41L}; int32_t l_2621 = 0xE9ED2F00L; const int64_t *l_2636 = &g_1013; const int64_t **l_2635 = &l_2636; int64_t **l_2638 = &g_733; int32_t **l_2703 = &g_20; int32_t ***l_2702 = &l_2703; uint32_t l_2706 = 0x49283E6DL; uint8_t *l_2713 = (void*)0; uint8_t *l_2714 = &g_2141[5][1][2]; int32_t *l_2726 = &l_2619[2]; uint64_t ***l_2789 = (void*)0; const uint16_t l_2805 = 0xF8CDL; uint16_t l_2812 = 0UL; int8_t l_2828 = 1L; const int64_t **l_2864 = &l_2636; uint32_t *l_2876 = (void*)0; uint32_t **l_2875 = &l_2876; uint32_t ***l_2874 = &l_2875; int i, j, k; for (i = 0; i < 4; i++) l_2578[i] = &l_2579; for (g_449 = 0; (g_449 > (-24)); g_449 = safe_sub_func_uint16_t_u_u(g_449, 4)) { /* block id: 1064 */ uint64_t l_2408 = 2UL; uint16_t ****l_2440 = (void*)0; int32_t l_2446 = 0x2C0CE9BEL; uint8_t l_2450 = 248UL; struct S1 **l_2492 = (void*)0; int32_t *l_2498[1]; uint64_t ** const *l_2502 = &g_1769[0]; uint64_t ** const **l_2501[8][6][5] = {{{(void*)0,&l_2502,&l_2502,(void*)0,(void*)0},{&l_2502,&l_2502,&l_2502,(void*)0,&l_2502},{&l_2502,&l_2502,&l_2502,(void*)0,&l_2502},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,(void*)0,&l_2502,&l_2502,&l_2502},{(void*)0,&l_2502,&l_2502,&l_2502,&l_2502}},{{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{(void*)0,(void*)0,&l_2502,&l_2502,&l_2502},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,&l_2502,&l_2502,(void*)0,&l_2502},{(void*)0,&l_2502,&l_2502,(void*)0,&l_2502},{&l_2502,(void*)0,&l_2502,&l_2502,(void*)0}},{{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{(void*)0,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,(void*)0,&l_2502,(void*)0,&l_2502},{&l_2502,&l_2502,(void*)0,(void*)0,&l_2502},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502}},{{(void*)0,(void*)0,&l_2502,&l_2502,(void*)0},{&l_2502,&l_2502,&l_2502,&l_2502,(void*)0},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{(void*)0,&l_2502,&l_2502,(void*)0,(void*)0},{&l_2502,&l_2502,&l_2502,(void*)0,(void*)0},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502}},{{(void*)0,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,(void*)0,&l_2502,&l_2502,(void*)0},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{(void*)0,&l_2502,&l_2502,&l_2502,(void*)0},{&l_2502,(void*)0,&l_2502,(void*)0,&l_2502}},{{&l_2502,(void*)0,&l_2502,(void*)0,&l_2502},{&l_2502,&l_2502,&l_2502,(void*)0,&l_2502},{(void*)0,(void*)0,&l_2502,&l_2502,(void*)0},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,&l_2502,(void*)0,&l_2502,&l_2502},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502}},{{(void*)0,&l_2502,(void*)0,&l_2502,&l_2502},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,(void*)0,&l_2502,(void*)0,&l_2502},{(void*)0,&l_2502,(void*)0,&l_2502,&l_2502}},{{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{(void*)0,&l_2502,(void*)0,&l_2502,&l_2502},{(void*)0,&l_2502,&l_2502,&l_2502,&l_2502},{&l_2502,(void*)0,&l_2502,&l_2502,&l_2502},{&l_2502,&l_2502,&l_2502,&l_2502,&l_2502},{(void*)0,&l_2502,(void*)0,(void*)0,(void*)0}}}; uint64_t ** const ***l_2500 = &l_2501[2][1][0]; int64_t **l_2506 = &g_166; int8_t **l_2526 = &g_1556; int i, j, k; for (i = 0; i < 1; i++) l_2498[i] = &l_2446; for (g_328 = 0; (g_328 != 27); g_328 = safe_add_func_int64_t_s_s(g_328, 3)) { /* block id: 1067 */ int16_t l_2405 = (-8L); int32_t l_2410 = (-3L); uint32_t *l_2411 = &g_1854; uint32_t l_2412 = 7UL; uint16_t *****l_2441 = &l_2440; struct S0 **l_2470 = &g_1364; if (((safe_sub_func_uint32_t_u_u(((safe_div_func_uint8_t_u_u(g_1118.f1, (*g_992))) > (((void*)0 != (*g_1748)) > (safe_div_func_uint16_t_u_u((safe_unary_minus_func_int64_t_s(((((safe_sub_func_int8_t_s_s((*g_992), ((l_2400 && ((*l_2411) = ((l_2410 |= ((safe_lshift_func_int8_t_s_u(((safe_div_func_int64_t_s_s(p_12, (((l_2400 = (l_2407[6][8][1] = (l_2405 < ((((~(p_11 != l_2407[9][2][0])) | 0x5F79L) , l_2408) && l_2400)))) < l_2409[1][4][2]) || l_2400))) ^ 0xBE857C816288D38BLL), p_12)) , p_12)) & 0x994AL))) || p_11))) <= (-6L)) > l_2412) ^ l_2412))), (-1L))))), g_139)) , (*g_2121))) { /* block id: 1072 */ uint64_t l_2427 = 1UL; l_2407[9][2][0] = (p_11 | (((*p_13) = 0x05F2F72AL) == ((safe_div_func_uint8_t_u_u(6UL, 252UL)) >= (((safe_div_func_uint64_t_u_u((safe_add_func_int32_t_s_s((safe_mod_func_int8_t_s_s((g_1407.f2.f0 && (safe_mod_func_int16_t_s_s((safe_mod_func_int8_t_s_s((safe_add_func_int64_t_s_s(l_2427, (((0xBB7B0CE8L || (l_2400 > ((p_11 > l_2400) | p_11))) && l_2408) ^ 0x99FC5A76L))), p_12)), l_2407[9][2][0]))), g_152)), l_2400)), p_11)) && l_2408) <= (*p_10))))); } else { /* block id: 1075 */ int32_t *l_2431[6] = {&l_2409[1][4][2],&l_2409[1][4][2],&l_2409[1][4][2],&l_2409[1][4][2],&l_2409[1][4][2],&l_2409[1][4][2]}; int i; (*p_10) ^= (g_2428 , 0xC52C26C8L); for (g_1854 = 0; (g_1854 >= 18); ++g_1854) { /* block id: 1079 */ (**g_1748) = (*g_1749); return &g_200; } return &g_96; } if (((((*g_567) = (safe_mod_func_int64_t_s_s(p_12, (safe_mod_func_int8_t_s_s(l_2407[9][2][0], (safe_lshift_func_int64_t_s_s(((safe_mul_func_int64_t_s_s(((p_12 , (*g_1364)) , l_2408), ((((*l_2441) = l_2440) != (((*p_10) |= (*p_13)) , &g_1709)) , ((safe_div_func_int64_t_s_s((safe_mul_func_int64_t_s_s(l_2400, p_11)), l_2405)) < 0x37L)))) < l_2400), 52))))))) & l_2400) , l_2408)) { /* block id: 1088 */ int8_t l_2449 = 0x71L; int16_t *l_2465[6] = {&l_2405,&l_2405,&l_2405,&l_2405,&l_2405,&l_2405}; int32_t l_2466 = 0x7F862143L; int i; (**g_1748) = &l_2400; (*g_20) = ((g_687.f3 && 1UL) >= (0x06L || (((0x4FFCF75B379C0B1ALL >= ((l_2446 == ((safe_mod_func_uint32_t_u_u(l_2449, (-1L))) , (0x9DL | (((void*)0 != &l_2405) != l_2450)))) < p_11)) == p_11) > 0xE2BCL))); if (l_2400) continue; (*g_20) ^= ((safe_div_func_int16_t_s_s((l_2466 = ((p_11 , 0x6BL) > (safe_rshift_func_int16_t_s_s(((*g_567) ^= ((&g_1788 != (void*)0) == l_2449)), (((safe_add_func_int8_t_s_s(((**g_991) , ((safe_add_func_int64_t_s_s(l_2409[1][4][2], (safe_add_func_uint8_t_u_u((safe_mod_func_uint64_t_u_u((l_2400 >= (l_2407[2][4][1] = (safe_mul_func_int32_t_s_s(0x5FDFF8A2L, g_1407.f2.f0)))), (-1L))), 0UL)))) , (**g_991))), 0xCBL)) | (*g_1750)) >= p_12))))), p_11)) ^ 2UL); } else { /* block id: 1096 */ for (g_1603 = (-20); (g_1603 <= 24); g_1603 = safe_add_func_int16_t_s_s(g_1603, 4)) { /* block id: 1099 */ if ((*p_10)) break; return &g_21[7]; } } (*l_2470) = l_2469; for (g_722 = (-19); (g_722 == 6); g_722++) { /* block id: 1107 */ for (g_203 = 0; (g_203 <= 1); g_203 += 1) { /* block id: 1110 */ struct S1 ***l_2493 = &l_2492; int32_t l_2497 = (-1L); int i; (*g_20) = ((safe_mul_func_uint8_t_u_u(g_19[g_203], (+(safe_mul_func_uint8_t_u_u((((safe_add_func_uint16_t_u_u((!(safe_div_func_int32_t_s_s((-1L), ((*l_2411)--)))), (~(((0x3F47ECD37ABAD2AFLL || (((safe_add_func_uint64_t_u_u(0UL, (safe_sub_func_uint32_t_u_u(l_2400, (((safe_div_func_uint64_t_u_u((((*l_2493) = l_2492) != l_2494), (((safe_add_func_int32_t_s_s(((((0x064C719AA14C0BA9LL == (&g_1788 == &g_1788)) && 0xB557B021DC31B4A2LL) || 4294967295UL) | l_2497), g_2428.f2.f0)) & l_2497) , l_2409[1][0][1]))) > l_2450) != 65535UL))))) , p_10) != l_2498[0])) != l_2407[4][5][0]) <= 0L)))) != 0xC6L) , 255UL), g_517.f2.f1))))) >= l_2400); return &g_134; } l_2503 = l_2500; } } for (g_1356 = 0; (g_1356 <= (-27)); g_1356--) { /* block id: 1121 */ int64_t **l_2507 = &g_166; int16_t l_2531 = 2L; struct S0 l_2534 = {453,0,7,58}; uint8_t *l_2537 = (void*)0; uint8_t *l_2538[4][1]; int i, j; for (i = 0; i < 4; i++) { for (j = 0; j < 1; j++) l_2538[i][j] = &l_2450; } (*g_20) &= (l_2506 == (l_2400 , l_2507)); for (g_134 = 0; (g_134 <= 2); g_134 += 1) { /* block id: 1125 */ uint32_t l_2514 = 0x4482857DL; int8_t **l_2524 = &g_1556; int8_t ***l_2525[7][7][5] = {{{&l_2523[6][0][2],&l_2523[6][0][2],&l_2524,&l_2523[6][0][2],&l_2523[0][0][0]},{&l_2523[4][0][1],&l_2524,&l_2524,&l_2523[4][0][1],&l_2524},{&l_2523[6][0][2],&l_2523[2][0][1],&l_2523[6][0][2],(void*)0,&l_2523[6][0][0]},{&l_2524,&l_2523[6][0][2],&l_2523[3][0][0],&l_2523[5][0][0],&l_2523[5][0][0]},{&l_2523[6][0][2],&l_2523[6][0][0],&l_2523[6][0][2],(void*)0,(void*)0},{&l_2523[6][0][2],(void*)0,&l_2524,&l_2523[4][0][1],&l_2523[1][0][0]},{&l_2524,&l_2523[0][0][2],&l_2523[4][0][0],&l_2523[6][0][2],(void*)0}},{{&l_2524,&l_2523[5][0][0],(void*)0,(void*)0,&l_2523[3][0][0]},{&l_2524,(void*)0,&l_2523[0][0][0],&l_2524,&l_2523[3][0][0]},{(void*)0,&l_2523[6][0][2],(void*)0,&l_2523[6][0][2],(void*)0},{&l_2523[3][0][2],&l_2523[6][0][2],(void*)0,&l_2523[6][0][2],&l_2523[6][0][2]},{&l_2524,&l_2523[1][0][2],&l_2523[6][0][2],&l_2523[6][0][2],&l_2523[6][0][2]},{&l_2523[6][0][0],&l_2524,(void*)0,&l_2523[6][0][2],&l_2523[6][0][2]},{(void*)0,&l_2523[6][0][2],&l_2523[6][0][2],&l_2524,(void*)0}},{{&l_2523[6][0][2],&l_2523[6][0][0],&l_2523[4][0][0],&l_2523[6][0][2],&l_2523[3][0][0]},{(void*)0,(void*)0,(void*)0,&l_2523[6][0][2],&l_2523[3][0][0]},{&l_2523[1][0][1],&l_2524,&l_2523[3][0][2],&l_2523[6][0][0],(void*)0},{&l_2523[6][0][2],&l_2523[1][0][0],&l_2523[6][0][2],&l_2523[6][0][2],&l_2523[1][0][0]},{(void*)0,&l_2523[1][0][2],&l_2523[0][0][2],&l_2523[1][0][2],(void*)0},{&l_2523[6][0][2],&l_2523[2][0][1],&l_2523[1][0][0],(void*)0,&l_2523[5][0][0]},{&l_2524,&l_2524,&l_2523[6][0][2],&l_2523[6][0][2],&l_2523[6][0][0]}},{{&l_2523[6][0][2],&l_2524,&l_2524,(void*)0,&l_2524},{&l_2524,&l_2523[6][0][2],&l_2523[6][0][2],&l_2523[6][0][2],(void*)0},{(void*)0,&l_2524,&l_2524,&l_2523[5][0][0],(void*)0},{&l_2523[4][0][0],&l_2524,&l_2523[3][0][2],&l_2523[6][0][2],&l_2523[1][0][2]},{&l_2523[6][0][2],&l_2523[3][0][0],&l_2523[6][0][2],&l_2523[2][0][1],&l_2523[6][0][2]},{&l_2523[0][0][1],&l_2523[0][0][1],&l_2524,&l_2524,&l_2523[0][0][2]},{(void*)0,&l_2524,(void*)0,&l_2523[2][0][0],&l_2523[1][0][0]}},{{&l_2523[0][0][0],&l_2524,&l_2523[4][0][0],&l_2523[1][0][2],(void*)0},{&l_2523[6][0][2],&l_2524,&l_2524,(void*)0,&l_2523[2][0][0]},{&l_2523[6][0][2],&l_2523[0][0][1],&l_2523[0][0][0],(void*)0,&l_2523[6][0][2]},{(void*)0,&l_2523[3][0][0],&l_2523[5][0][0],&l_2524,&l_2523[6][0][2]},{&l_2523[6][0][2],&l_2524,&l_2524,(void*)0,&l_2524},{&l_2523[4][0][1],&l_2524,&l_2524,(void*)0,(void*)0},{&l_2524,&l_2523[6][0][2],&l_2524,&l_2523[1][0][1],&l_2524}},{{&l_2523[1][0][0],&l_2523[6][0][2],(void*)0,&l_2523[6][0][2],&l_2524},{&l_2523[4][0][0],&l_2523[0][0][2],&l_2523[6][0][2],&l_2524,&l_2524},{&l_2524,&l_2523[2][0][0],(void*)0,&l_2524,&l_2523[6][0][2]},{(void*)0,(void*)0,&l_2524,&l_2523[6][0][0],&l_2523[6][0][2]},{&l_2524,&l_2524,&l_2524,&l_2524,&l_2523[6][0][2]},{&l_2524,(void*)0,&l_2524,&l_2524,&l_2523[2][0][0]},{&l_2523[2][0][0],&l_2524,&l_2523[5][0][0],&l_2524,&l_2524}},{{(void*)0,&l_2523[0][0][0],&l_2523[0][0][0],(void*)0,(void*)0},{&l_2524,&l_2524,&l_2524,&l_2524,&l_2524},{&l_2524,&l_2523[2][0][1],&l_2523[4][0][0],&l_2524,&l_2523[6][0][2]},{&l_2523[6][0][2],&l_2524,(void*)0,&l_2524,&l_2524},{(void*)0,&l_2523[6][0][2],&l_2524,(void*)0,&l_2524},{&l_2523[6][0][2],&l_2523[1][0][2],&l_2523[6][0][2],&l_2524,&l_2523[5][0][0]},{&l_2524,&l_2524,&l_2523[3][0][2],&l_2524,&l_2523[4][0][0]}}}; uint32_t *l_2532 = &g_139; int16_t *l_2533 = &g_138; int i, j, k; for (p_12 = 0; (p_12 <= 2); p_12 += 1) { /* block id: 1128 */ volatile int64_t *l_2513 = &g_19[1]; volatile int64_t **l_2512 = &l_2513; volatile int64_t ***l_2511 = &l_2512; volatile int64_t ****l_2510[6][6] = {{&l_2511,&l_2511,&l_2511,&l_2511,&l_2511,&l_2511},{&l_2511,&l_2511,&l_2511,&l_2511,&l_2511,&l_2511},{&l_2511,(void*)0,&l_2511,&l_2511,(void*)0,&l_2511},{&l_2511,&l_2511,&l_2511,&l_2511,&l_2511,&l_2511},{&l_2511,&l_2511,&l_2511,&l_2511,&l_2511,&l_2511},{&l_2511,(void*)0,&l_2511,&l_2511,(void*)0,&l_2511}}; volatile int64_t **** volatile * volatile l_2509 = &l_2510[2][4];/* VOLATILE GLOBAL l_2509 */ int i, j; l_2509 = g_2508; if (l_2514) continue; if ((*p_13)) continue; } l_2407[9][2][0] &= (((l_2514 || (safe_add_func_int32_t_s_s((*p_13), (safe_add_func_int64_t_s_s((safe_div_func_int64_t_s_s(((((((((void*)0 != &g_1792[g_134][g_134]) && ((0x74DAA309246CAE3DLL || (safe_sub_func_uint16_t_u_u((l_2523[6][0][2] == (l_2526 = l_2524)), ((*l_2533) = ((*g_567) = (safe_add_func_int16_t_s_s((0xD4B49C6FL ^ ((*l_2532) = (safe_lshift_func_int64_t_s_s(l_2531, p_12)))), (*l_2499)))))))) , (**g_552))) <= p_11) < l_2531) , p_11) , l_2534) , p_12), 0x329AF886292D70AFLL)), p_11))))) == 0x9DA0L) || p_11); } (*p_10) ^= ((((p_11 != (safe_add_func_uint64_t_u_u((((0x5A31E5B9472AD232LL && ((g_2141[5][1][2] = p_11) > (p_12 = (safe_rshift_func_uint16_t_u_s(((g_303[0][7][0] ^= (l_2531 ^ ((1L & ((((*l_2499) &= 0x403C21F83F742DBELL) , (safe_add_func_uint32_t_u_u((!(safe_rshift_func_uint64_t_u_s(1UL, (p_11 > (l_2546 | l_2534.f1))))), (*g_20)))) >= (-1L))) , l_2546))) != l_2407[6][0][0]), 8))))) & p_11) , p_11), p_11))) , (*g_991)) == (*g_991)) != p_11); } if ((*p_10)) break; } if ((*p_10)) { /* block id: 1147 */ uint8_t l_2555 = 0UL; int32_t l_2564 = 0L; int32_t l_2566 = 0x8B90AEB0L; int32_t l_2567 = 0x7DA52E9FL; int32_t l_2571[6][9][4] = {{{0x6551CF85L,(-1L),1L,(-1L)},{0xEA165C4EL,1L,1L,1L},{1L,1L,0x801EF4C1L,0x0281E537L},{(-1L),(-8L),1L,(-1L)},{1L,0x1BB09EF1L,1L,(-1L)},{0x1359E93BL,0xBDCDDFC5L,0xED1A079EL,(-1L)},{(-5L),0x12F90AC3L,(-1L),0x1BB09EF1L},{0xBF1A73D9L,0xACC89318L,0xC1680EE6L,0L},{1L,0L,0x4A5BC5E5L,0x0281E537L}},{{0xC1680EE6L,(-5L),0x1EED2948L,0x423A454DL},{0x801EF4C1L,(-1L),0x079E0FF0L,0x079E0FF0L},{0x6455C84DL,0x6455C84DL,0xC7AD3C1EL,(-1L)},{0x2FE9CAD1L,1L,(-7L),1L},{0L,0x1EED2948L,0xA67771A9L,(-7L)},{8L,0x1EED2948L,0xC1680EE6L,1L},{0x1EED2948L,1L,(-1L),(-1L)},{0xACC89318L,0x6455C84DL,6L,0x079E0FF0L},{(-1L),(-1L),(-1L),0x423A454DL}},{{0xF34442F3L,(-5L),0xA2875343L,0x0281E537L},{(-1L),0L,0L,0L},{0L,0xACC89318L,8L,0x1BB09EF1L},{0x801EF4C1L,0x12F90AC3L,0xACC89318L,(-1L)},{6L,0xBDCDDFC5L,(-5L),(-1L)},{0x9316ED79L,4L,0x1EED2948L,0L},{0xEA165C4EL,0x28703EC1L,0xA67771A9L,8L},{0x4A5BC5E5L,0xF34442F3L,0xA2875343L,(-1L)},{0x28703EC1L,1L,0x259E94AAL,8L}},{{(-5L),6L,0xCBDFCB6BL,0xC7AD3C1EL},{(-1L),0x12F90AC3L,0x9316ED79L,0L},{0x1EED2948L,(-1L),0L,0x0281E537L},{1L,0x15AACC03L,1L,0L},{0xEA165C4EL,0x1359E93BL,8L,0x423A454DL},{(-1L),1L,0xC7AD3C1EL,0x1359E93BL},{0L,0xBDCDDFC5L,0xC7AD3C1EL,8L},{(-1L),(-4L),8L,0x751C904AL},{0xEA165C4EL,0x1EED2948L,1L,0xBF1A73D9L}},{{1L,0xBF1A73D9L,0L,(-1L)},{0x1EED2948L,4L,0x9316ED79L,0xA67771A9L},{(-1L),0L,0xCBDFCB6BL,0x079E0FF0L},{(-5L),1L,0x259E94AAL,0xA4F0EC56L},{0x28703EC1L,(-1L),0xA2875343L,0L},{0x4A5BC5E5L,0xFC0F2815L,0xA67771A9L,1L},{0xEA165C4EL,0xACC89318L,0x1EED2948L,0L},{0x9316ED79L,1L,(-5L),0x1359E93BL},{6L,0x6455C84DL,0xACC89318L,0xA67771A9L}},{{0x801EF4C1L,1L,8L,0L},{0L,0xF34442F3L,0L,0x28703EC1L},{(-1L),0xBF1A73D9L,0xA2875343L,1L},{0xF34442F3L,(-4L),(-1L),0L},{(-1L),6L,6L,(-1L)},{0xACC89318L,1L,(-1L),0xA4F0EC56L},{0x1EED2948L,(-5L),0xC1680EE6L,0L},{8L,0L,0x751C904AL,(-7L)},{(-1L),(-1L),0x15AACC03L,0xA2AF9B53L}}}; int8_t l_2572[5][10][1] = {{{(-2L)},{0x0FL},{(-2L)},{0x8CL},{0xFEL},{0x31L},{0x41L},{0x31L},{0xFEL},{0x8CL}},{{(-2L)},{0x0FL},{(-2L)},{0x8CL},{0xFEL},{0x31L},{0x41L},{0x31L},{0xFEL},{0x8CL}},{{(-2L)},{0x0FL},{(-2L)},{0x8CL},{0xFEL},{0x31L},{0x41L},{0x31L},{0xFEL},{0x8CL}},{{(-2L)},{0x0FL},{(-2L)},{0x8CL},{0xFEL},{0x31L},{0x41L},{0x31L},{0xFEL},{0x8CL}},{{(-2L)},{0x0FL},{(-2L)},{0x8CL},{0xFEL},{0x31L},{0x41L},{0x31L},{0xFEL},{0x8CL}}}; uint16_t l_2597 = 6UL; uint64_t *l_2631[3][9] = {{&g_203,&g_203,(void*)0,&g_203,&g_203,&g_203,&g_203,&g_203,&g_203},{&g_203,&g_203,&g_203,&g_203,&g_203,&g_203,&g_203,&g_203,(void*)0},{&g_203,&g_203,&g_203,&g_203,&g_203,&g_203,&g_203,&g_203,&g_203}}; int64_t ***l_2637[8][5][4] = {{{(void*)0,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,(void*)0},{&g_1108,&g_1108,&g_1108,&g_1108}},{{&g_1108,(void*)0,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,(void*)0},{(void*)0,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108}},{{&g_1108,&g_1108,&g_1108,(void*)0},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,(void*)0,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,(void*)0},{(void*)0,&g_1108,&g_1108,&g_1108}},{{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,(void*)0},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,(void*)0,&g_1108,&g_1108}},{{&g_1108,&g_1108,&g_1108,(void*)0},{(void*)0,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,(void*)0}},{{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,(void*)0,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,(void*)0,&g_1108,&g_1108}},{{&g_1108,(void*)0,(void*)0,&g_1108},{(void*)0,&g_1108,&g_1108,&g_1108},{(void*)0,&g_1108,(void*)0,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,&g_1108,&g_1108,&g_1108}},{{&g_1108,&g_1108,&g_1108,&g_1108},{&g_1108,(void*)0,&g_1108,&g_1108},{&g_1108,(void*)0,(void*)0,&g_1108},{(void*)0,&g_1108,&g_1108,&g_1108},{(void*)0,&g_1108,(void*)0,&g_1108}}}; int8_t *l_2644 = (void*)0; struct S0 l_2649 = {270,0,-32,209}; uint32_t *l_2671 = &g_139; int i, j, k; for (l_2546 = 0; (l_2546 != (-2)); --l_2546) { /* block id: 1150 */ struct S0 * const *l_2558 = &g_1364; struct S0 * const * const *l_2557 = &l_2558; int32_t l_2569 = 3L; int32_t l_2573 = 0x84436AAFL; uint32_t *l_2581 = &g_139; uint32_t * const *l_2580 = &l_2581; uint64_t *l_2582 = &g_203; uint8_t l_2583 = 0xCCL; int32_t l_2618 = 0x8FBCA8D5L; int32_t l_2620 = 0xA885A27DL; int32_t l_2622 = 4L; int32_t l_2623[8]; int32_t l_2624 = (-1L); int32_t l_2625 = 1L; int i; for (i = 0; i < 8; i++) l_2623[i] = 0xC9036A03L; for (g_98 = 19; (g_98 > 28); g_98++) { /* block id: 1153 */ uint32_t *l_2563[9] = {&g_1854,&g_1854,&g_1854,&g_1854,&g_1854,&g_1854,&g_1854,&g_1854,&g_1854}; int32_t l_2565 = 3L; int i; (*p_13) &= ((safe_div_func_int16_t_s_s((safe_div_func_uint64_t_u_u((0x1D736AF4L != (l_2555 ^ ((l_2556 != l_2557) & ((**g_1743) > ((p_12 || (((((safe_div_func_uint16_t_u_u((safe_lshift_func_uint32_t_u_u((l_2574++), (+(l_2578[3] == (((*g_567) = 0x3EB5L) , l_2580))))), l_2565)) , l_2573) , l_2582) == l_2582) , l_2583)) | p_11))))), l_2570[0])), l_2555)) == (*p_10)); } if ((*p_13)) { /* block id: 1158 */ if ((*p_10)) { /* block id: 1159 */ int32_t **l_2584 = &g_281; (*g_1749) = func_27(func_27(p_13, func_27(((*l_2584) = (p_12 , &g_21[7])), &l_2570[2])), p_10); } else { /* block id: 1162 */ const int32_t l_2586 = (-9L); (*p_10) |= (safe_unary_minus_func_uint32_t_u(((((l_2586 < p_12) >= (safe_lshift_func_uint64_t_u_s(((safe_mul_func_int16_t_s_s(((((-1L) ^ (safe_mul_func_int8_t_s_s((*g_1556), p_11))) == ((safe_rshift_func_int16_t_s_s(((((0xC0L == ((((safe_mod_func_int32_t_s_s((-7L), (*p_13))) , p_12) <= p_11) < 18446744073709551607UL)) , (*l_2499)) , 1UL) && p_12), 3)) >= l_2586)) != 3L), l_2597)) != (*l_2499)), 54))) && l_2555) || 0UL))); } } else { /* block id: 1165 */ int32_t *l_2598 = &l_2571[5][7][2]; int32_t *l_2599 = (void*)0; int32_t *l_2600 = &l_2570[1]; int32_t *l_2601 = &l_2407[5][0][0]; int32_t *l_2602 = &l_2570[2]; int32_t *l_2603 = (void*)0; int32_t *l_2604 = (void*)0; int32_t *l_2605 = &l_2409[1][4][2]; int32_t *l_2606 = &l_2409[1][4][2]; int32_t *l_2607 = &l_2571[4][3][2]; int32_t *l_2608 = &l_2571[4][3][2]; int32_t *l_2609 = &l_2573; int32_t *l_2610 = &g_134; int32_t *l_2611 = &g_21[6]; int32_t *l_2612 = &g_200; int32_t *l_2613 = &g_21[5]; int32_t *l_2614 = &l_2571[5][1][0]; int32_t *l_2615 = &l_2570[0]; int32_t *l_2616 = &l_2569; int32_t *l_2617[2]; uint16_t l_2626 = 0UL; const uint64_t * const l_2632 = (void*)0; int i; for (i = 0; i < 2; i++) l_2617[i] = &l_2400; --l_2626; (*l_2499) = (safe_mul_func_uint8_t_u_u(255UL, p_12)); (*l_2598) |= ((l_2631[1][4] == l_2632) | p_11); } } (*p_13) = (safe_mul_func_int16_t_s_s((*g_1744), (((l_2635 != (l_2638 = &g_166)) ^ (*l_2499)) , (l_2570[3] = (safe_div_func_int32_t_s_s((safe_mul_func_uint64_t_u_u(((****g_2163) |= ((!(((g_1556 = l_2644) == (void*)0) == (safe_lshift_func_uint16_t_u_u(((l_2619[4] ^= (g_303[2][5][1] = ((((l_2564 |= (safe_add_func_int32_t_s_s((p_12 != (l_2649 , (safe_mod_func_int32_t_s_s((*g_20), g_957.f0)))), (*p_10)))) == l_2400) & (*l_2499)) >= l_2597))) || g_1621), 4)))) , (*l_2499))), (*l_2499))), (*p_13))))))); for (g_105 = 0; g_105 < 4; g_105 += 1) { l_2570[g_105] = 0x2A0172E6L; } (*g_20) |= (safe_div_func_uint16_t_u_u(((*l_2469) , (safe_mod_func_uint32_t_u_u(((*l_2671) = (safe_sub_func_int8_t_s_s((~(p_11 >= (((safe_unary_minus_func_int32_t_s((safe_lshift_func_uint8_t_u_s(g_460, (0x84C8L == (safe_mul_func_uint64_t_u_u((safe_rshift_func_uint64_t_u_s((safe_add_func_uint64_t_u_u((l_2564 , 5UL), ((*l_2499) = ((void*)0 == g_2668)))), (!0x61L))), l_2564))))))) != l_2670) > 0x58E6B423L))), (*g_992)))), 1UL))), l_2546)); } else { /* block id: 1183 */ uint16_t ****l_2676[7]; uint16_t *****l_2677 = &l_2676[1]; uint8_t *l_2685 = (void*)0; uint8_t *l_2686 = (void*)0; int i; for (i = 0; i < 7; i++) l_2676[i] = &g_1792[1][2]; for (l_2621 = (-6); (l_2621 < (-27)); l_2621--) { /* block id: 1186 */ return &g_538; } (*g_1749) = p_10; l_2619[2] &= ((((safe_lshift_func_uint64_t_u_u((((*l_2677) = l_2676[1]) != (g_2678 = &g_1792[2][1])), (l_2689 |= (l_2570[0] = ((safe_unary_minus_func_int16_t_s((safe_div_func_int8_t_s_s(((((((((l_2682 >= (*l_2499)) < (safe_add_func_uint8_t_u_u((p_12 = p_11), l_2400))) ^ 0xAA0C2593L) <= (((safe_lshift_func_uint8_t_u_u(255UL, 6)) > l_2670) == p_11)) != 0xA0F4L) >= p_11) , p_11) ^ 0UL), l_2570[0])))) ^ 0x38248036C46F4F24LL))))) > l_2682) > l_2682) == 0x2B226853BB1EF1FFLL); for (g_134 = 0; (g_134 <= 0); g_134 += 1) { /* block id: 1198 */ if ((*g_2121)) break; (**g_1748) = p_13; } } if ((((safe_lshift_func_int8_t_s_s((safe_mod_func_int16_t_s_s(((safe_sub_func_uint64_t_u_u(((safe_sub_func_int16_t_s_s(((**l_2703) = ((((safe_mod_func_uint8_t_u_u(p_11, (safe_lshift_func_uint64_t_u_u((l_2702 == &l_2703), ((-1L) != (p_12 == ((safe_rshift_func_uint32_t_u_u((l_2706 != ((*l_2714) = (((((l_2707[2] == (void*)0) <= ((*g_567) ^= (safe_rshift_func_uint16_t_u_s((safe_mul_func_int8_t_s_s(p_11, p_11)), p_12)))) <= (**l_2703)) && (***l_2702)) > p_11))), g_1186.f6)) <= p_11))))))) , p_12) , p_12) , 1L)), (-2L))) , (*l_2499)), p_12)) != p_12), l_2670)), p_11)) , 0x5B1CA977L) , (*p_10))) { /* block id: 1206 */ (*l_2499) = ((p_12 == (l_2400 , g_2201.f4)) <= (safe_add_func_int32_t_s_s(((safe_div_func_uint16_t_u_u((***g_1709), (safe_rshift_func_int8_t_s_s(l_2570[0], 7)))) <= p_11), (safe_mul_func_int16_t_s_s(((1L <= ((safe_rshift_func_uint32_t_u_u((((+0xC5L) , l_2469) == (void*)0), (***l_2702))) <= l_2682)) > (*l_2499)), 0UL))))); return &g_538; } else { /* block id: 1209 */ uint8_t l_2734 = 1UL; int32_t *l_2747[5][3] = {{&l_2570[0],(void*)0,&l_2570[0]},{&l_2570[0],(void*)0,&l_2570[0]},{&l_2570[0],(void*)0,&l_2570[0]},{&l_2570[0],(void*)0,&l_2570[0]},{&l_2570[0],(void*)0,&l_2570[0]}}; const uint16_t l_2758[1][1] = {{0xFB52L}}; uint8_t **l_2762 = (void*)0; uint64_t ** const *l_2779 = &g_1769[4]; int32_t *l_2873[10] = {&l_2407[3][5][0],&l_2407[3][5][0],&l_2407[3][5][0],&l_2407[3][5][0],&l_2407[3][5][0],&l_2407[3][5][0],&l_2407[3][5][0],&l_2407[3][5][0],&l_2407[3][5][0],&l_2407[3][5][0]}; uint32_t ****l_2877 = &l_2874; int i, j; if ((***l_2702)) { /* block id: 1210 */ int32_t *l_2732 = &g_200; int32_t *l_2733[2]; int i; for (i = 0; i < 2; i++) l_2733[i] = &g_21[0]; for (l_2400 = 0; (l_2400 <= (-30)); l_2400 = safe_sub_func_int64_t_s_s(l_2400, 8)) { /* block id: 1213 */ for (g_96 = 0; (g_96 <= 2); g_96 += 1) { /* block id: 1216 */ (*g_1749) = &l_2570[0]; if ((*p_10)) continue; } for (g_722 = 0; (g_722 >= (-1)); g_722 = safe_sub_func_int16_t_s_s(g_722, 4)) { /* block id: 1222 */ return p_13; } } l_2734++; (*g_20) = ((**l_2703) > ((p_11 != 0xCCA552D5L) ^ ((*l_2469) , (((*g_567) = l_2734) & (g_1185[3][3].f2.f0 , (safe_div_func_int8_t_s_s(((safe_sub_func_uint64_t_u_u(((****g_2163) = ((safe_sub_func_int8_t_s_s(0x71L, (g_1944[0] = ((*l_2499) = ((safe_sub_func_int16_t_s_s(((((safe_sub_func_uint8_t_u_u(0x54L, 0UL)) , (**g_991)) , (**g_552)) == 1L), l_2570[0])) > 255UL))))) > 0UL)), (*l_2732))) <= p_11), (*g_992)))))))); l_2747[4][2] = (**l_2702); } else { /* block id: 1233 */ int32_t l_2759 = 1L; uint64_t ***l_2778 = &g_1769[0]; int32_t l_2823 = (-1L); int32_t l_2825 = (-10L); int8_t * const *l_2827[10]; int32_t l_2861 = 0xA05175F2L; int i; for (i = 0; i < 10; i++) l_2827[i] = (void*)0; for (g_1854 = (-22); (g_1854 != 44); g_1854 = safe_add_func_int32_t_s_s(g_1854, 6)) { /* block id: 1236 */ (*p_10) ^= 1L; (*p_10) |= (-1L); } if ((+(safe_sub_func_uint32_t_u_u(((((l_2570[1] , ((*g_20) & (safe_add_func_uint32_t_u_u(g_517.f2.f1, (0UL < 6UL))))) >= (l_2570[0] <= 4294967288UL)) , ((g_366.f2.f2 >= ((safe_div_func_uint8_t_u_u(l_2757[2], 0xACL)) == l_2758[0][0])) == l_2759)) > (***l_2702)), (***l_2702))))) { /* block id: 1240 */ uint8_t **l_2764[7][5] = {{(void*)0,&l_2713,(void*)0,&l_2713,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,&l_2713,(void*)0,&l_2713,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,&l_2713,(void*)0,&l_2713,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,&l_2713,(void*)0,&l_2713,(void*)0}}; int32_t l_2791 = 0xD095653DL; uint16_t *l_2795 = &g_539; uint8_t **l_2800[2][7] = {{&l_2714,&l_2714,&l_2714,&l_2714,&l_2714,&l_2714,&l_2714},{(void*)0,&l_2714,(void*)0,&l_2714,(void*)0,&l_2714,(void*)0}}; uint32_t *l_2813[1][5] = {{&g_105,&g_105,&g_105,&g_105,&g_105}}; int8_t **l_2826[2]; int i, j; for (i = 0; i < 2; i++) l_2826[i] = &g_1556; for (g_1494 = (-18); (g_1494 >= 8); g_1494 = safe_add_func_uint8_t_u_u(g_1494, 1)) { /* block id: 1243 */ uint8_t ***l_2763[2][6] = {{&l_2762,&l_2762,&l_2762,&l_2762,&l_2762,&l_2762},{&l_2762,&l_2762,&l_2762,&l_2762,&l_2762,&l_2762}}; int32_t l_2775 = (-1L); int32_t l_2776 = 4L; uint32_t *l_2792 = (void*)0; uint32_t *l_2793[4][9] = {{(void*)0,&g_139,&g_139,(void*)0,&g_139,(void*)0,&g_139,&g_139,(void*)0},{&g_139,(void*)0,&g_1854,(void*)0,&g_139,&g_139,(void*)0,&g_1854,(void*)0},{&g_139,&g_139,&g_1854,&g_1854,&g_139,&g_139,&g_139,&g_1854,&g_1854},{&g_139,&g_139,(void*)0,&g_1854,(void*)0,&g_139,&g_139,(void*)0,&g_1854}}; int i, j; (*g_1749) = p_13; l_2762 = (l_2764[1][1] = l_2762); (*p_10) = (1L >= ((safe_sub_func_uint64_t_u_u((safe_mul_func_uint8_t_u_u(((*l_2714) = ((((safe_div_func_uint32_t_u_u(0xB918475EL, (safe_div_func_int64_t_s_s((safe_sub_func_int64_t_s_s(l_2775, (0x7E1CL == ((**l_2703) &= (l_2776 ^= p_12))))), ((safe_unary_minus_func_int8_t_s(((l_2778 == l_2779) == (g_2794 = (safe_mod_func_int32_t_s_s(((*l_2499) = (safe_mul_func_uint32_t_u_u(((g_2428.f2.f2 | (safe_lshift_func_uint8_t_u_u((safe_mod_func_int8_t_s_s((((+((*g_2163) != l_2789)) , g_2790[8]) || (*g_992)), 0x0BL)), l_2757[2]))) && (*p_10)), l_2791))), p_12)))))) || 0x38674DA1L))))) == 0x8DF074E7L) ^ 0xE00EL) < (*g_1744))), l_2791)), 0xBB9650C116BFF4D9LL)) >= 0L)); return p_13; } if (((*g_20) = ((((p_12 & (l_2689 = ((*l_2795)++))) , (((safe_add_func_int64_t_s_s(((((*l_2499) = (l_2800[0][0] != l_2801[0][1][2])) || (((safe_div_func_uint16_t_u_u(l_2805, p_12)) | (safe_div_func_uint8_t_u_u(((p_11 & (l_2791 || ((g_174[0] = (g_105 = (safe_sub_func_int32_t_s_s((((safe_rshift_func_int64_t_s_u((-1L), 34)) , (l_2791 == 9L)) ^ l_2812), l_2570[0])))) , (*p_13)))) || 0x05A1L), 0xE4L))) < p_12)) || 0xC62396DCL), p_11)) , p_12) < 0x3259L)) > p_12) == l_2759))) { /* block id: 1261 */ (*l_2499) ^= ((**l_2703) |= l_2791); return &g_96; } else { /* block id: 1265 */ int32_t l_2822[3][7][2] = {{{(-1L),0x1766FFF1L},{8L,8L},{0x1766FFF1L,8L},{8L,0x1766FFF1L},{8L,8L},{0x1766FFF1L,8L},{8L,0x1766FFF1L}},{{8L,8L},{0x1766FFF1L,8L},{8L,0x1766FFF1L},{8L,8L},{0x1766FFF1L,8L},{8L,0x1766FFF1L},{8L,8L}},{{0x1766FFF1L,8L},{8L,0x1766FFF1L},{8L,8L},{0x1766FFF1L,8L},{8L,0x1766FFF1L},{8L,8L},{0x1766FFF1L,8L}}}; uint32_t *l_2824 = &g_1854; int i, j, k; l_2825 &= (~(((safe_sub_func_int8_t_s_s((l_2759 & ((l_2791 || (g_2817[6][6] , (g_1896.f2.f0 && ((safe_rshift_func_uint16_t_u_s(((safe_add_func_uint32_t_u_u(0UL, l_2822[1][6][1])) && ((*l_2824) = (l_2757[2] && (((l_2823 = l_2822[1][3][1]) , ((l_2823 = l_2759) & 18446744073709551610UL)) > g_1365[0][3][1].f2)))), (*g_553))) & (**g_991))))) || l_2822[0][4][1])), 0xC4L)) | p_11) != p_12)); } for (g_1621 = 0; (g_1621 <= 1); g_1621 += 1) { /* block id: 1273 */ (*l_2726) = ((l_2826[0] != l_2827[3]) > (g_2668 != (void*)0)); (*l_2499) = (*p_13); (**l_2702) = p_13; } l_2731 ^= (*g_20); } else { /* block id: 1279 */ const int64_t l_2863 = 7L; int32_t l_2866 = 0x9E9AB33BL; int32_t l_2867[8] = {0xA90E7017L,0xA90E7017L,0xA90E7017L,0xA90E7017L,0xA90E7017L,0xA90E7017L,0xA90E7017L,0xA90E7017L}; int i; if ((*p_10)) { /* block id: 1280 */ if (l_2828) break; } else { /* block id: 1282 */ int8_t *l_2852 = &g_303[7][0][1]; int32_t l_2860 = (-9L); uint16_t *l_2862 = &l_2812; (*p_10) |= (safe_mul_func_uint32_t_u_u((safe_div_func_int8_t_s_s(((safe_rshift_func_uint64_t_u_u((safe_mul_func_uint16_t_u_u(((safe_mul_func_uint32_t_u_u((safe_rshift_func_int16_t_s_u((safe_sub_func_int32_t_s_s(l_2825, g_1120[6].f4)), ((((((p_11 != ((safe_mul_func_uint16_t_u_u((safe_unary_minus_func_uint32_t_u((safe_rshift_func_uint8_t_u_u((safe_mul_func_uint64_t_u_u((safe_sub_func_uint64_t_u_u((l_2852 == (void*)0), ((((safe_div_func_int32_t_s_s(((safe_add_func_int16_t_s_s(((safe_div_func_int16_t_s_s((4294967295UL | (~((l_2860 , ((*l_2862) = l_2861)) | p_11))), 0x687EL)) != p_11), p_12)) <= g_164), 4294967288UL)) >= p_12) | l_2860) == 0L))), 1UL)), 0)))), l_2860)) <= (*p_13))) > l_2863) | p_11) , l_2864) == l_2865) & 9UL))), p_12)) | l_2863), 3L)), 8)) || p_11), p_11)), 0UL)); } --g_2868; for (g_1621 = 0; (g_1621 <= 25); g_1621++) { /* block id: 1289 */ if ((*p_10)) break; return &g_96; } } } (*g_2878) = ((*l_2877) = l_2874); return (**l_2702); } } l_2881++; return &g_200; } /* ------------------------------------------ */ /* * reads : g_956.f2.f1 g_20 g_21 g_366.f2.f0 g_1676 g_1556 g_494 g_449 g_2121 g_200 g_1185.f1 g_2138 g_364 g_2141 g_517.f6 g_1944 g_957.f2.f0 g_991 g_992 g_303 g_105 g_1743 g_1744 g_722 g_1709 g_693 g_694 g_695 g_1749 g_1750 g_552 g_553 g_554 g_2201 g_685 g_567 g_139 g_98 g_2166 g_203 g_460 g_1748 g_1186.f1 g_164 g_1185.f4 g_2163 g_2164 g_2165 g_366.f2 g_674 g_730 * writes: g_21 g_164 g_200 g_730 g_539 g_364 g_2141 g_2162 g_203 g_2211 g_686 g_135 g_449 g_98 g_139 g_1750 g_1356 g_494 g_303 g_1792 g_1013 g_2352 g_105 g_675 g_1854 g_1364 g_1621 g_1556 g_1919 */ static int32_t * func_14(uint16_t p_15) { /* block id: 867 */ int16_t l_2096 = 2L; uint16_t *l_2103 = &g_539; int8_t **l_2111 = &g_1556; int8_t ***l_2110[8] = {&l_2111,&l_2111,&l_2111,&l_2111,&l_2111,&l_2111,&l_2111,&l_2111}; int8_t ****l_2109 = &l_2110[2]; int64_t *l_2116 = &g_164; int32_t l_2117[3]; int16_t l_2118 = 1L; uint64_t l_2119 = 0xC64CE3F9EF728329LL; uint32_t l_2120 = 1UL; uint64_t ** const *l_2161 = &g_1769[4]; uint64_t ** const * const *l_2160 = &l_2161; uint64_t ** const * const **l_2159 = &l_2160; struct S1 *l_2203 = &g_1407; int16_t l_2224 = 0x4C2EL; const int32_t *l_2281 = &g_200; struct S0 *l_2358[8]; int32_t l_2381 = 3L; int i; for (i = 0; i < 3; i++) l_2117[i] = 0L; for (i = 0; i < 8; i++) l_2358[i] = &g_1118.f2; lbl_2212: (*g_2121) ^= (((((((l_2096 || (safe_add_func_int32_t_s_s((l_2118 = (safe_add_func_uint32_t_u_u(((((safe_mod_func_int32_t_s_s(((void*)0 != l_2103), g_956.f2.f1)) & ((*g_20) &= p_15)) > ((((l_2117[0] = ((*l_2116) = (safe_div_func_uint32_t_u_u(((+(safe_mul_func_int8_t_s_s((l_2109 != (void*)0), (safe_mul_func_int32_t_s_s(0x2763338AL, ((safe_mul_func_int8_t_s_s((p_15 <= l_2096), l_2096)) >= 0x098A1095L)))))) < p_15), p_15)))) , 0UL) || g_366.f2.f0) > p_15)) || (-6L)), g_1676))), 0xAC4775E9L))) != (*g_1556)) >= 0x8EL) && l_2119) > l_2120) > 0x37B94673L) & p_15); for (g_730 = 0; (g_730 < 7); g_730++) { /* block id: 875 */ int32_t l_2137 = (-4L); int32_t l_2207[10] = {0x1C690DEDL,0x9606D76EL,0L,0x9606D76EL,0x1C690DEDL,0x1C690DEDL,0x9606D76EL,0L,0x9606D76EL,0x1C690DEDL}; int32_t l_2209 = 0x0477862FL; int32_t l_2225 = 0x1929B4DBL; struct S0 **l_2247 = &g_1364; struct S0 ***l_2246[2][10][3] = {{{&l_2247,&l_2247,&l_2247},{&l_2247,&l_2247,&l_2247},{&l_2247,&l_2247,(void*)0},{&l_2247,&l_2247,&l_2247},{(void*)0,&l_2247,&l_2247},{(void*)0,&l_2247,&l_2247},{&l_2247,&l_2247,&l_2247},{&l_2247,(void*)0,&l_2247},{&l_2247,&l_2247,&l_2247},{&l_2247,&l_2247,&l_2247}},{{&l_2247,(void*)0,(void*)0},{&l_2247,&l_2247,&l_2247},{&l_2247,&l_2247,&l_2247},{&l_2247,&l_2247,&l_2247},{&l_2247,&l_2247,&l_2247},{&l_2247,&l_2247,(void*)0},{&l_2247,&l_2247,&l_2247},{(void*)0,&l_2247,&l_2247},{(void*)0,&l_2247,&l_2247},{&l_2247,&l_2247,&l_2247}}}; struct S0 ****l_2245 = &l_2246[1][8][2]; struct S1 *l_2252 = &g_1184; uint8_t l_2347 = 0x66L; int8_t *l_2359[5] = {&g_449,&g_449,&g_449,&g_449,&g_449}; int i, j, k; if ((*g_20)) { /* block id: 876 */ uint32_t l_2128 = 0xCC707C1BL; int32_t l_2146 = (-1L); int32_t l_2210 = 0x0F57A7C2L; uint32_t *l_2214[3][5] = {{&l_2128,&g_1854,&l_2128,&l_2128,&g_1854},{&g_1854,&g_1854,&g_1854,&g_1854,&g_1854},{&g_1854,&g_1854,&l_2128,&g_1854,&g_1854}}; uint32_t **l_2213[1][1]; int32_t l_2222 = (-1L); int32_t l_2223[9]; uint8_t *l_2241 = &g_2141[5][1][2]; struct S0 l_2244 = {30,0,-3,-223}; struct S0 ****l_2248 = &l_2246[1][8][2]; int i, j; for (i = 0; i < 1; i++) { for (j = 0; j < 1; j++) l_2213[i][j] = &l_2214[0][3]; } for (i = 0; i < 9; i++) l_2223[i] = 1L; for (g_539 = (-19); (g_539 != 14); ++g_539) { /* block id: 879 */ int8_t l_2134[3]; uint8_t *l_2139 = &g_364; uint8_t *l_2140[6] = {&g_2141[5][1][2],&g_2141[5][1][2],&g_2141[5][1][2],&g_2141[5][1][2],&g_2141[5][1][2],&g_2141[5][1][2]}; int64_t *l_2167[7][5][7] = {{{(void*)0,&g_1356,&g_1603,(void*)0,&g_1603,(void*)0,&g_1603},{&g_1603,(void*)0,&g_152,(void*)0,&g_152,&g_1603,(void*)0},{&g_164,(void*)0,&g_1603,&g_1603,&g_164,(void*)0,&g_1013},{&g_1013,(void*)0,&g_1603,&g_1919,&g_152,&g_1603,&g_1603},{&g_1603,&g_1013,(void*)0,&g_1013,&g_1603,&g_1356,&g_152}},{{&g_1013,&g_1013,&g_164,&g_1603,&g_152,&g_1603,&g_1603},{&g_164,(void*)0,&g_1603,&g_1356,&g_1603,(void*)0,&g_164},{&g_1356,&g_1603,&g_1919,&g_1919,&g_1013,&g_164,&g_164},{(void*)0,(void*)0,&g_1013,&g_164,&g_1603,&g_1919,&g_1603},{&g_1356,&g_1013,(void*)0,(void*)0,&g_1356,&g_1603,&g_1356}},{{&g_1603,&g_1013,&g_164,&g_164,&g_164,&g_1013,&g_164},{&g_1919,(void*)0,(void*)0,&g_1919,&g_152,(void*)0,(void*)0},{&g_1603,(void*)0,(void*)0,&g_1356,(void*)0,(void*)0,(void*)0},{&g_1356,&g_1013,(void*)0,&g_1603,&g_1013,&g_152,(void*)0},{&g_164,&g_1919,&g_1603,&g_1013,&g_1603,&g_1919,&g_164}},{{&g_1603,&g_1603,&g_152,&g_152,&g_1919,&g_152,&g_1356},{(void*)0,&g_164,&g_1356,(void*)0,(void*)0,&g_1603,&g_1603},{&g_1919,&g_1356,&g_152,&g_164,&g_1603,&g_1603,&g_164},{&g_1603,(void*)0,&g_1603,(void*)0,&g_164,&g_1356,&g_164},{&g_1013,&g_164,(void*)0,&g_1919,&g_1356,&g_1919,&g_1603}},{{(void*)0,(void*)0,(void*)0,&g_1013,&g_1603,&g_1356,&g_1919},{&g_152,&g_1013,(void*)0,&g_1356,&g_1919,&g_1603,(void*)0},{&g_164,(void*)0,&g_164,(void*)0,&g_1603,&g_1603,&g_164},{&g_1356,&g_1356,(void*)0,&g_1919,&g_1356,&g_152,&g_164},{&g_1603,(void*)0,&g_1013,&g_1919,(void*)0,&g_1919,&g_1013}},{{&g_1013,&g_1013,&g_1919,&g_164,&g_1356,&g_152,&g_1603},{&g_1603,(void*)0,&g_1603,&g_164,&g_164,(void*)0,&g_164},{&g_152,&g_164,(void*)0,&g_152,&g_1356,(void*)0,&g_152},{(void*)0,(void*)0,&g_152,(void*)0,(void*)0,&g_1013,&g_1919},{&g_1356,&g_1356,&g_1356,&g_1603,&g_1356,&g_1603,(void*)0}},{{&g_164,&g_164,&g_1603,(void*)0,&g_1603,&g_1919,&g_164},{&g_1356,&g_1603,&g_164,&g_1919,&g_1919,&g_164,&g_1603},{(void*)0,&g_1919,&g_1013,(void*)0,&g_1603,&g_1603,&g_1013},{&g_1603,&g_1356,&g_164,(void*)0,&g_1603,&g_152,(void*)0},{&g_1603,&g_1356,&g_1603,(void*)0,&g_164,(void*)0,&g_164}}}; int32_t *l_2177 = (void*)0; int8_t l_2190 = 0x54L; struct S1 *l_2202 = &g_517; uint32_t *l_2204 = (void*)0; uint32_t *l_2205 = (void*)0; uint32_t *l_2206 = &l_2128; int32_t *l_2208[1]; int32_t *l_2215 = (void*)0; int32_t *l_2216 = &g_21[7]; int32_t *l_2217 = (void*)0; int32_t l_2218 = (-1L); int32_t *l_2219 = &g_538; int32_t *l_2220 = (void*)0; int32_t *l_2221[4]; uint16_t l_2226 = 0x8564L; int i, j, k; for (i = 0; i < 3; i++) l_2134[i] = (-2L); for (i = 0; i < 1; i++) l_2208[i] = &l_2137; for (i = 0; i < 4; i++) l_2221[i] = &g_21[0]; if ((1UL || (safe_mul_func_int32_t_s_s(l_2128, (safe_unary_minus_func_uint64_t_u((safe_add_func_int8_t_s_s((0x94L || (safe_sub_func_uint32_t_u_u(p_15, (l_2134[1] , (((g_1185[3][3].f1 , (safe_add_func_uint64_t_u_u(((((g_2141[5][1][2] |= ((*l_2139) |= (l_2137 ^ (((l_2117[0] = (l_2096 | ((((g_2138 , 0xC1765836L) < 0x76FD9807L) >= p_15) ^ p_15))) | p_15) < p_15)))) != 0x6AL) == p_15) <= 0xB9L), p_15))) & p_15) , g_517.f6))))), p_15)))))))) { /* block id: 883 */ uint16_t l_2168 = 0x68F6L; int32_t *l_2169 = &l_2146; l_2146 = (p_15 , (safe_add_func_uint64_t_u_u(0x6EF434AD81600ED6LL, (safe_rshift_func_uint64_t_u_s(l_2137, ((*l_2116) = p_15)))))); for (l_2146 = 0; (l_2146 <= 0); l_2146 += 1) { /* block id: 888 */ int32_t *l_2149 = &g_200; int i; (*g_20) = (safe_rshift_func_int64_t_s_u(g_1944[(l_2146 + 6)], 55)); return l_2149; } (*g_20) = 1L; (*l_2169) &= ((((((safe_sub_func_int32_t_s_s(((safe_sub_func_int8_t_s_s((p_15 == (safe_add_func_int32_t_s_s((((~(safe_div_func_uint8_t_u_u(l_2137, g_957.f2.f0))) < p_15) == ((*g_20) = ((g_2162 = l_2159) == &l_2160))), (l_2167[3][0][4] != (void*)0)))), (**g_991))) || (*g_992)), g_105)) ^ l_2168) ^ (**g_1743)) >= l_2168) && 1UL) > l_2128); } else { /* block id: 896 */ uint16_t l_2174[1]; struct S0 **l_2187[6] = {&g_1364,&g_1364,&g_1364,&g_1364,&g_1364,&g_1364}; const int32_t * volatile l_2193 = &g_134;/* VOLATILE GLOBAL l_2193 */ int i; for (i = 0; i < 1; i++) l_2174[i] = 0xEC38L; l_2174[0] |= (l_2117[0] = (l_2146 = (safe_lshift_func_int8_t_s_u((0x9D32EBA156E058B2LL <= (((*g_20) = 0L) & 0x84F0DDFEL)), 5)))); (*g_20) ^= (1L <= (safe_div_func_uint64_t_u_u(((p_15 , (((((l_2177 != ((safe_mod_func_int16_t_s_s((safe_mul_func_int16_t_s_s(((~((***g_1709) | (l_2096 | (safe_rshift_func_int16_t_s_s((safe_sub_func_int32_t_s_s(((((l_2187[2] != &g_1364) != (((safe_div_func_uint64_t_u_u(((void*)0 != (*g_1743)), l_2117[0])) > 0x7381F6FBL) > l_2174[0])) , 0x1B1871ACL) , p_15), l_2119)), l_2137))))) , l_2137), l_2118)), p_15)) , (*g_1749))) && (**g_552)) && 1L) == g_956.f2.f1) || 0xA903116FL)) < 0x1ED8L), l_2190))); (*g_20) = 0x14722022L; for (g_203 = 9; (g_203 != 21); g_203 = safe_add_func_uint64_t_u_u(g_203, 6)) { /* block id: 905 */ int32_t *l_2194 = &g_134; l_2193 = (*g_1749); return l_2194; } } if ((p_15 < ((l_2146 < (safe_rshift_func_int32_t_s_s(((g_2211 = (l_2210 ^= (l_2209 = (l_2207[2] = (safe_sub_func_uint32_t_u_u(1UL, ((*l_2206) |= (safe_div_func_int16_t_s_s((((18446744073709551606UL > 1L) > (g_2201 , (l_2202 != l_2203))) | 255UL), p_15))))))))) , p_15), p_15))) <= (-10L)))) { /* block id: 915 */ l_2117[0] = (*g_2121); } else { /* block id: 917 */ (*g_685) = l_2202; if (g_105) goto lbl_2212; } (*g_20) &= (l_2137 || (l_2213[0][0] != &l_2214[0][3])); l_2226--; } (*g_2121) = ((4294967295UL & (safe_mod_func_uint64_t_u_u(l_2224, (~(safe_add_func_int64_t_s_s((l_2146 = l_2146), (l_2223[8] = (p_15 || (safe_mod_func_int32_t_s_s(((!(safe_lshift_func_int32_t_s_s((((safe_mul_func_uint32_t_u_u(l_2223[6], ((*g_20) ^= (((*l_2241) = l_2207[3]) > (safe_sub_func_int64_t_s_s(((l_2244 , ((((((*g_567) = l_2224) >= l_2224) , p_15) , 1UL) , l_2245)) == l_2248), (-3L))))))) > 0x5D92L) || l_2225), p_15))) < p_15), l_2118)))))))))) <= (-1L)); } else { /* block id: 930 */ for (g_449 = 7; (g_449 < 18); ++g_449) { /* block id: 933 */ (*g_20) = (~0x0FF22B7714DF77CBLL); } if (p_15) break; if (l_2207[2]) break; } for (g_98 = 0; (g_98 <= 2); g_98 += 1) { /* block id: 941 */ const int64_t l_2253[1][10] = {{0x6206065F2B768FFDLL,0x6206065F2B768FFDLL,0x6206065F2B768FFDLL,0x6206065F2B768FFDLL,0x6206065F2B768FFDLL,0x6206065F2B768FFDLL,0x6206065F2B768FFDLL,0x6206065F2B768FFDLL,0x6206065F2B768FFDLL,0x6206065F2B768FFDLL}}; int32_t l_2255 = 0L; int32_t l_2278 = 0xD93F2D2CL; int i, j; (*g_685) = l_2252; l_2207[0] ^= l_2253[0][1]; for (g_139 = 0; (g_139 <= 2); g_139 += 1) { /* block id: 946 */ uint8_t l_2258 = 255UL; int32_t l_2268[5][2][8] = {{{0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL},{0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL}},{{0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL},{0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL}},{{0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL},{0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL}},{{0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL},{0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL}},{{0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL},{0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL,0x9AD1E1EAL}}}; int i, j, k; (*g_1749) = (*g_1749); for (g_164 = 7; (g_164 >= 0); g_164 -= 1) { /* block id: 950 */ struct S0 ****l_2275 = &l_2246[1][8][2]; int32_t l_2276 = 1L; for (g_1356 = 0; (g_1356 <= 9); g_1356 += 1) { /* block id: 953 */ int32_t *l_2254 = &g_21[7]; int32_t *l_2256 = (void*)0; int32_t *l_2257[7] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; uint32_t *l_2267[2]; int32_t l_2277 = 0x7F9DB91BL; int i; for (i = 0; i < 2; i++) l_2267[i] = (void*)0; --l_2258; l_2278 ^= (safe_sub_func_uint32_t_u_u(((g_303[5][6][0] |= ((safe_lshift_func_int64_t_s_u(l_2117[g_139], 59)) | ((0L & ((**l_2111) = ((l_2268[3][0][2] = (safe_rshift_func_uint8_t_u_u(l_2117[g_98], 1))) | l_2258))) & (*g_2166)))) < (safe_div_func_int16_t_s_s((l_2255 = l_2258), p_15))), (((safe_lshift_func_int16_t_s_s((safe_add_func_uint8_t_u_u((((&g_1948 != l_2275) >= l_2253[0][0]) == l_2276), 0x8AL)), l_2277)) > g_460) > p_15))); } for (g_135 = 7; (g_135 >= 0); g_135 -= 1) { /* block id: 963 */ const int32_t **l_2279 = &g_1750; int i; (**g_1748) = &l_2117[g_139]; l_2281 = ((*l_2279) = &g_538); return &g_538; } } } } for (g_139 = (-22); (g_139 <= 49); g_139 = safe_add_func_uint64_t_u_u(g_139, 6)) { /* block id: 974 */ int32_t l_2290 = 0x8D885D17L; int32_t l_2299 = 2L; uint16_t ***l_2302 = &g_1788; int32_t l_2313 = 3L; struct S0 *****l_2351 = &l_2245; if (g_517.f6) goto lbl_2212; if ((((p_15 < (g_1186.f1 <= l_2207[1])) > (*l_2281)) <= ((l_2225 = ((l_2117[0] = (*g_992)) & (((safe_add_func_uint16_t_u_u(((safe_add_func_int16_t_s_s(p_15, l_2290)) || (safe_div_func_uint16_t_u_u((((safe_mul_func_uint8_t_u_u(((((safe_lshift_func_uint8_t_u_u((safe_sub_func_uint16_t_u_u((((0xA0DBL <= p_15) < (-5L)) < 4L), 65529UL)), g_1944[4])) >= 0xDCL) && 0x9FDAC8820D8B5B86LL) >= (*g_1556)), 0x5AL)) || l_2299) == p_15), p_15))), p_15)) > p_15) || 0x35A46787L))) || (*g_2166)))) { /* block id: 978 */ uint16_t ****l_2303 = &g_1792[2][1]; (*g_20) ^= ((l_2299 ^= ((*l_2116) ^= p_15)) && (p_15 < (&g_693[0] != ((*l_2303) = l_2302)))); } else { /* block id: 983 */ uint8_t l_2320[5]; int32_t l_2321 = 0x59826958L; int32_t l_2344 = 0xFE38C59DL; int32_t l_2345 = 0x07AD302FL; int32_t l_2346 = 1L; struct S0 *l_2353 = &g_517.f2; int i; for (i = 0; i < 5; i++) l_2320[i] = 5UL; if (((((****g_2163) = (safe_mul_func_uint64_t_u_u((l_2313 = (l_2320[0] = (safe_unary_minus_func_int8_t_s(((safe_div_func_uint16_t_u_u(p_15, ((*l_2103) = (safe_add_func_uint16_t_u_u((*g_694), (((safe_mod_func_int32_t_s_s(l_2313, (safe_lshift_func_uint32_t_u_u((p_15 , l_2137), 21)))) == (g_1185[3][3].f4 < (p_15 && ((safe_sub_func_uint64_t_u_u(l_2313, (((((p_15 && 0xFAE0A69A7D35642DLL) <= p_15) , p_15) > 0x8323L) && p_15))) < 0xF58305FEL)))) & 4UL)))))) ^ 0x15L))))), p_15))) <= p_15) ^ 1UL)) { /* block id: 988 */ uint16_t l_2322 = 1UL; int32_t *l_2327 = (void*)0; int32_t *l_2328 = (void*)0; ++l_2322; l_2313 &= ((*g_2121) = ((*g_20) = (safe_unary_minus_func_uint64_t_u(((!p_15) && l_2322))))); } else { /* block id: 993 */ uint64_t l_2340 = 0x6404DC0F1C83726DLL; int32_t l_2343 = (-10L); for (l_2290 = (-19); (l_2290 > (-7)); l_2290 = safe_add_func_int32_t_s_s(l_2290, 8)) { /* block id: 996 */ int32_t *l_2331 = &l_2117[0]; int32_t *l_2332 = &g_21[7]; int32_t *l_2333 = &l_2117[0]; int32_t *l_2334 = &l_2225; int32_t *l_2335 = &l_2225; int32_t *l_2336 = (void*)0; int32_t l_2337 = 0x36953446L; int32_t *l_2338 = &g_96; int32_t *l_2339[1][1]; int i, j; for (i = 0; i < 1; i++) { for (j = 0; j < 1; j++) l_2339[i][j] = &g_538; } ++l_2340; ++l_2347; return &g_134; } (*g_1749) = &l_2321; (**g_1748) = func_27(&l_2117[0], func_27(&l_2209, &l_2343)); } if (p_15) { /* block id: 1004 */ const int32_t l_2350 = 0L; uint32_t *l_2354 = (void*)0; uint32_t *l_2355 = &g_105; if ((((1L == 0L) && ((*g_1556) = 0x6DL)) , 0x52AAD3B0L)) { /* block id: 1006 */ (*g_20) = ((void*)0 != (*g_1748)); } else { /* block id: 1008 */ (*g_20) = l_2350; } g_2352 = l_2351; (*g_20) = l_2313; (*g_674) = (((*l_2355) = ((void*)0 == l_2353)) , (void*)0); } else { /* block id: 1015 */ (*g_20) ^= (-1L); } for (g_1854 = (-1); (g_1854 >= 36); ++g_1854) { /* block id: 1020 */ if ((*g_20)) break; } if (l_2313) continue; } } for (l_2120 = 0; (l_2120 <= 1); l_2120 += 1) { /* block id: 1028 */ const int32_t l_2362 = 1L; int32_t l_2375 = 0xE2DBC656L; int32_t *l_2378 = &l_2209; int32_t *l_2379 = &l_2207[2]; int32_t *l_2380[3]; uint32_t l_2382 = 4294967294UL; int i; for (i = 0; i < 3; i++) l_2380[i] = (void*)0; for (p_15 = 0; (p_15 <= 1); p_15 += 1) { /* block id: 1031 */ (*l_2247) = l_2358[4]; } for (g_1621 = 0; (g_1621 <= 1); g_1621 += 1) { /* block id: 1036 */ uint16_t l_2367 = 0UL; uint8_t *l_2374 = &g_2141[7][1][2]; int32_t l_2376 = 0xFABD6D18L; if (((*g_2121) = (((l_2376 &= (l_2359[4] != ((*l_2111) = ((safe_sub_func_int32_t_s_s(l_2362, (safe_unary_minus_func_int16_t_s((safe_sub_func_int64_t_s_s(5L, (~(5L >= ((l_2367 && (l_2207[2] = ((safe_mod_func_uint64_t_u_u(((l_2375 = ((l_2362 ^ (safe_lshift_func_int64_t_s_s((((*l_2374) = ((safe_lshift_func_int8_t_s_u(((p_15 ^ p_15) , (((l_2137 >= (*g_1556)) , p_15) & 0xEAL)), l_2367)) | 255UL)) ^ (*g_1556)), 42))) == (*l_2281))) < l_2367), 0xA2915EF4D6A38756LL)) & 65526UL))) && 0xEBB8L))))))))) , &g_494)))) && p_15) >= g_2201.f2.f3))) { /* block id: 1043 */ (*g_20) = p_15; } else { /* block id: 1045 */ for (g_1919 = 0; (g_1919 <= 1); g_1919 += 1) { /* block id: 1048 */ int32_t *l_2377[6][3] = {{&l_2117[0],&g_96,&l_2117[0]},{&l_2117[0],&g_96,&l_2117[0]},{&l_2117[0],&g_96,&l_2117[0]},{&l_2117[0],&g_96,&l_2117[0]},{&l_2117[0],&g_96,&l_2117[0]},{&l_2117[0],&g_96,&l_2117[0]}}; int i, j; (*g_20) = ((void*)0 == &g_206); return &g_96; } } } l_2382++; } } return &g_200; } /* ------------------------------------------ */ /* * reads : g_539 g_1364 g_1365 g_20 g_200 g_135 g_303 g_1948 g_1356 g_21 g_203 g_1079 g_1080 g_1768 g_281 g_538 g_1743 g_1744 g_722 g_1676 g_991 g_992 g_1919 * writes: g_539 g_139 g_21 g_200 g_135 g_1948 g_1356 g_203 g_1769 g_538 g_449 g_494 g_1259 g_1676 g_1994 g_281 g_1781.f5 g_1603 g_1919 */ static int32_t * func_23(int64_t p_24) { /* block id: 785 */ int8_t l_1926 = 0x2EL; int32_t l_1943 = (-2L); uint16_t l_1945 = 0xAE2EL; struct S0 l_1955 = {387,0,-7,-22}; uint32_t l_1970 = 0x8A0EBD56L; int32_t l_2003 = 0x557D8B63L; int32_t l_2005 = 0x3C5C83B9L; int32_t l_2006 = 1L; int32_t l_2007 = 0xB72269BBL; int32_t l_2008 = (-9L); uint32_t l_2009 = 18446744073709551606UL; int32_t l_2030[4]; int32_t l_2032 = 0x2D3DE648L; uint64_t *l_2053 = &g_203; uint64_t ***l_2059 = &g_1769[0]; int16_t l_2063 = 4L; int64_t *l_2090 = &g_1603; uint16_t l_2091 = 5UL; struct S1 *l_2095 = (void*)0; int i; for (i = 0; i < 4; i++) l_2030[i] = (-7L); if (l_1926) { /* block id: 786 */ uint16_t l_1932 = 0UL; int16_t l_1937 = 0x6CF5L; int32_t l_1941[7][4][7] = {{{0xE7ABF922L,0x3954C8BAL,0xE7ABF922L,(-1L),(-1L),(-3L),0L},{1L,0xC1B24E77L,0x3ACBEFA1L,(-1L),0xC1B24E77L,(-1L),0xC1B24E77L},{0L,(-1L),0x88A62DC1L,(-7L),0L,(-3L),(-1L)},{1L,1L,0xC34F1FB6L,0L,1L,1L,1L}},{{6L,0xC206E95BL,0x7ED52EFBL,0xC206E95BL,6L,(-1L),(-1L)},{0L,(-1L),0xCC2A5114L,1L,0xC34F1FB6L,0xCC2A5114L,0xC1B24E77L},{0x88A62DC1L,0x3954C8BAL,0x0321EFB8L,1L,0L,(-1L),0L},{0L,1L,(-1L),0L,0xC1B24E77L,(-1L),0xCC2A5114L}},{{0x88A62DC1L,0x98B7D7B3L,0xF9C74530L,0x87734E16L,0xF9C74530L,0x98B7D7B3L,0x88A62DC1L},{(-1L),0xCC2A5114L,0x31FAB31BL,0x41C984B5L,0xC34F1FB6L,(-1L),0x41C984B5L},{0x0321EFB8L,0xB2FC1FB8L,(-1L),(-3L),0xE7ABF922L,0x2AFA89D4L,(-1L)},{0xCC2A5114L,8L,0x31FAB31BL,(-1L),8L,0x41C984B5L,1L}},{{0x7ED52EFBL,(-3L),0xF9C74530L,0xFE0740E8L,(-1L),0xFE0740E8L,0xF9C74530L},{0xC34F1FB6L,0xC34F1FB6L,0L,(-1L),0xCC2A5114L,1L,0xC34F1FB6L},{0x88A62DC1L,0x7D0BFBA0L,0L,(-3L),0xFD379369L,0x98B7D7B3L,0xE7ABF922L},{0x3ACBEFA1L,1L,0x3ACBEFA1L,0x41C984B5L,0xCC2A5114L,0x3ACBEFA1L,8L}},{{0xE7ABF922L,0xB2FC1FB8L,0L,0x87734E16L,(-1L),(-7L),(-1L)},{0L,0x41C984B5L,0x41C984B5L,0L,8L,0x3ACBEFA1L,0xCC2A5114L},{0xFD379369L,(-1L),0xF9C74530L,0x8888DFB7L,0xE7ABF922L,0x98B7D7B3L,0xFD379369L},{0xC34F1FB6L,0xCC2A5114L,0xC1B24E77L,0xCC2A5114L,0xC34F1FB6L,1L,0xCC2A5114L}},{{0x0321EFB8L,(-1L),0x7ED52EFBL,(-3L),0xF9C74530L,0xFE0740E8L,(-1L)},{0x41C984B5L,1L,0x31FAB31BL,0x31FAB31BL,1L,0x41C984B5L,8L},{0x0321EFB8L,(-3L),0L,1L,(-1L),0x2AFA89D4L,0xE7ABF922L},{0xC34F1FB6L,(-1L),0x41C984B5L,(-1L),0x41C984B5L,(-1L),0xC34F1FB6L}},{{0xFD379369L,(-3L),0L,0x7D0BFBA0L,0x88A62DC1L,0x98B7D7B3L,0xF9C74530L},{0L,1L,(-1L),0xCC2A5114L,0xCC2A5114L,(-1L),1L},{0xE7ABF922L,(-1L),0L,0x87734E16L,0L,0x7D0BFBA0L,(-1L)},{0x3ACBEFA1L,0xCC2A5114L,0x41C984B5L,0x3ACBEFA1L,1L,0x3ACBEFA1L,0x41C984B5L}}}; int16_t l_1990 = 0xBD4EL; uint32_t *l_1996 = &g_174[0]; int8_t l_2031 = (-1L); int i, j, k; for (g_539 = 0; (g_539 <= 9); g_539 += 1) { /* block id: 789 */ uint64_t l_1927 = 0x8CEE2D3BCB355FC9LL; int32_t *l_1930 = &g_200; int32_t *l_1931[10][9][2] = {{{&g_21[4],&g_96},{&g_96,&g_96},{&g_21[4],&g_21[5]},{&g_21[5],&g_134},{&g_21[3],&g_21[7]},{&g_21[3],&g_134},{&g_21[5],&g_21[5]},{&g_21[4],&g_96},{&g_96,&g_96}},{{&g_21[4],&g_21[5]},{&g_21[5],&g_134},{&g_21[3],&g_21[7]},{&g_21[3],&g_134},{&g_21[5],&g_21[5]},{&g_21[4],&g_96},{&g_96,&g_96},{&g_21[4],&g_21[5]},{&g_21[5],&g_134}},{{&g_21[3],&g_21[7]},{&g_21[3],&g_134},{&g_21[5],&g_21[5]},{&g_21[4],&g_96},{&g_96,&g_96},{&g_21[4],&g_21[5]},{&g_21[6],&g_21[7]},{&g_21[4],&g_200},{&g_21[4],&g_21[7]}},{{&g_21[6],&g_21[7]},{&g_96,&g_134},{&g_21[6],&g_134},{&g_96,&g_21[7]},{&g_21[6],&g_21[7]},{&g_21[4],&g_200},{&g_21[4],&g_21[7]},{&g_21[6],&g_21[7]},{&g_96,&g_134}},{{&g_21[6],&g_134},{&g_96,&g_21[7]},{&g_21[6],&g_21[7]},{&g_21[4],&g_200},{&g_21[4],&g_21[7]},{&g_21[6],&g_21[7]},{&g_96,&g_134},{&g_21[6],&g_134},{&g_96,&g_21[7]}},{{&g_21[6],&g_21[7]},{&g_21[4],&g_200},{&g_21[4],&g_21[7]},{&g_21[6],&g_21[7]},{&g_96,&g_134},{&g_21[6],&g_134},{&g_96,&g_21[7]},{&g_21[6],&g_21[7]},{&g_21[4],&g_200}},{{&g_21[4],&g_21[7]},{&g_21[6],&g_21[7]},{&g_96,&g_134},{&g_21[6],&g_134},{&g_96,&g_21[7]},{&g_21[6],&g_21[7]},{&g_21[4],&g_200},{&g_21[4],&g_21[7]},{&g_21[6],&g_21[7]}},{{&g_96,&g_134},{&g_21[6],&g_134},{&g_96,&g_21[7]},{&g_21[6],&g_21[7]},{&g_21[4],&g_200},{&g_21[4],&g_21[7]},{&g_21[6],&g_21[7]},{&g_96,&g_134},{&g_21[6],&g_134}},{{&g_96,&g_21[7]},{&g_21[6],&g_21[7]},{&g_21[4],&g_200},{&g_21[4],&g_21[7]},{&g_21[6],&g_21[7]},{&g_96,&g_134},{&g_21[6],&g_134},{&g_96,&g_21[7]},{&g_21[6],&g_21[7]}},{{&g_21[4],&g_200},{&g_21[4],&g_21[7]},{&g_21[6],&g_21[7]},{&g_96,&g_134},{&g_21[6],&g_134},{&g_96,&g_21[7]},{&g_21[6],&g_21[7]},{&g_21[4],&g_200},{&g_21[4],&g_21[7]}}}; uint32_t *l_1938 = &g_139; int8_t **l_1940 = &g_1556; int8_t ***l_1939[3][7][2] = {{{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940}},{{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,(void*)0},{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940}},{{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940},{&l_1940,&l_1940}}}; int32_t l_1942 = 1L; int64_t *l_1954[6] = {&g_152,&g_152,&g_152,&g_152,&g_152,&g_152}; uint64_t **l_1988 = &g_773; int i, j, k; l_1927--; l_1932--; (*l_1930) ^= ((*g_20) = ((((((*l_1938) = ((l_1926 <= (safe_rshift_func_int64_t_s_u(l_1937, 52))) & 0x20L)) && l_1926) , ((*g_1364) , (((l_1939[0][4][0] == &l_1940) > (((l_1932 ^ (p_24 <= p_24)) ^ 1UL) , p_24)) & p_24))) & 0xC05CE56DL) ^ 0xD23AC967L)); ++l_1945; for (l_1927 = 0; (l_1927 <= 1); l_1927 += 1) { /* block id: 798 */ uint64_t **l_1989 = &g_773; int32_t l_2001 = 0L; int32_t l_2002[4][9][7] = {{{(-5L),(-5L),0x4441789CL,0x8F02C0D6L,1L,1L,0x505535D3L},{0x2561360CL,0L,0L,(-1L),0xBD5F1B58L,0L,0L},{6L,0L,0x2528CA07L,0x57ED0A35L,(-3L),(-9L),0xCC76B423L},{0x1497C967L,4L,1L,0x1497C967L,(-10L),0x2561360CL,1L},{(-10L),0x2528CA07L,0x33AAC8CDL,0x602A113AL,0x81100D3BL,0L,0xFB9F3925L},{(-1L),(-1L),0xCC76B423L,(-1L),0x3390CA45L,0x2528CA07L,(-5L)},{0xFB9F3925L,0L,1L,0x3390CA45L,0L,(-5L),(-3L)},{0xFB9F3925L,(-1L),0L,(-1L),0x4DA716A8L,0xAB4DE4C0L,0L},{(-1L),1L,0x4441789CL,0xBD5F1B58L,(-10L),0L,0x4DA716A8L}},{{(-10L),3L,7L,(-10L),(-10L),7L,3L},{0x1497C967L,0x321C3DBDL,(-1L),0x3E4C3ED3L,0xBD894AF5L,1L,(-7L)},{6L,(-1L),0x4441789CL,0x2528CA07L,0xFF1A8414L,0x33AAC8CDL,0xBD5F1B58L},{(-10L),(-3L),0x0C888A4FL,0x3E4C3ED3L,0L,4L,0x3E4C3ED3L},{0x3390CA45L,0xBD5F1B58L,0xF2BC9CC8L,(-10L),0x4441789CL,0x57ED0A35L,0x1497C967L},{0L,0L,0xCC76B423L,0xBD5F1B58L,0xFF1A8414L,0x321C3DBDL,0xAB4DE4C0L},{4L,(-3L),1L,(-1L),6L,(-1L),(-10L)},{(-10L),0xF2BC9CC8L,0xBD5F1B58L,0x3390CA45L,1L,0x4441789CL,(-10L)},{0L,(-7L),0x2528CA07L,(-1L),(-10L),0x33AAC8CDL,0xAB4DE4C0L}},{{(-3L),0L,1L,0x602A113AL,0x235882DCL,7L,0x1497C967L},{0x3E4C3ED3L,(-1L),0x321C3DBDL,0x1497C967L,0x321C3DBDL,(-1L),0x3E4C3ED3L},{1L,(-10L),(-1L),0x57ED0A35L,0x3390CA45L,0L,0xBD5F1B58L},{4L,0L,(-1L),3L,0x1497C967L,1L,(-7L)},{(-1L),0L,(-1L),0xFB9F3925L,(-1L),(-1L),3L},{0xF2BC9CC8L,0x3390CA45L,0x321C3DBDL,(-1L),(-3L),0x2528CA07L,0x4DA716A8L},{(-10L),(-3L),1L,3L,4L,0x0C888A4FL,0L},{0x602A113AL,0x33AAC8CDL,0x2528CA07L,(-10L),0xCC76B423L,(-9L),(-3L)},{0x81100D3BL,4L,0xBD5F1B58L,0x81100D3BL,(-10L),(-9L),(-5L)}},{{(-10L),(-3L),1L,0x602A113AL,0x1497C967L,0x0C888A4FL,0xFB9F3925L},{3L,0L,0xCC76B423L,(-10L),0xF2BC9CC8L,0x2528CA07L,6L},{1L,(-5L),9L,9L,(-5L),1L,(-5L)},{0xF2BC9CC8L,1L,0L,0x57ED0A35L,0x81100D3BL,(-3L),0x321C3DBDL},{1L,0x505535D3L,0x76A7ED07L,0xD24343A5L,0x6B3FF209L,1L,0x81100D3BL},{0x6B3FF209L,1L,1L,0x9BB132EAL,0x2528CA07L,1L,7L},{0xAB4DE4C0L,(-5L),4L,0x33AAC8CDL,(-9L),(-3L),0x4441789CL},{0x4DA716A8L,(-1L),0x76A7ED07L,0L,7L,1L,0xD24343A5L},{1L,0L,4L,1L,0x321C3DBDL,0x76A7ED07L,1L}}}; int64_t l_2004[3]; int i, j, k; for (i = 0; i < 3; i++) l_2004[i] = 1L; l_1943 |= 0xF7D054A1L; for (g_135 = 4; (g_135 >= 0); g_135 -= 1) { /* block id: 802 */ struct S0 * const ***l_1949 = (void*)0; int i, j, k; if (g_303[(g_135 + 3)][(l_1927 + 4)][l_1927]) break; g_1948 = g_1948; } for (g_1356 = 0; (g_1356 <= 1); g_1356 += 1) { /* block id: 808 */ uint64_t *l_1968 = &g_203; int32_t l_1969 = (-9L); struct S1 * const ***l_1978 = (void*)0; int i, j, k; (*g_20) = ((safe_mul_func_uint16_t_u_u((g_303[(l_1927 + 5)][(l_1927 + 6)][g_1356] & ((l_1969 = (safe_sub_func_int32_t_s_s(((l_1954[4] != ((l_1955 , (safe_lshift_func_uint64_t_u_u(p_24, ((*l_1968) &= (l_1941[5][2][5] = (l_1955.f2 = (safe_mul_func_int32_t_s_s((*g_20), (safe_sub_func_int16_t_s_s(0L, (0x8C7DL != (safe_add_func_uint64_t_u_u(p_24, (l_1943 = ((safe_add_func_int32_t_s_s((safe_div_func_int64_t_s_s(((0x1A42L || l_1955.f3) || p_24), (*l_1930))), p_24)) && 0UL))))))))))))))) , (void*)0)) <= (*l_1930)), 0L))) | l_1970)), l_1937)) & l_1932); (*l_1930) = (((*g_281) = (safe_div_func_int8_t_s_s((safe_sub_func_uint64_t_u_u(l_1969, ((void*)0 != &g_303[(l_1927 + 5)][(l_1927 + 6)][g_1356]))), (safe_mod_func_uint64_t_u_u((!(((l_1955.f0 , (*g_1079)) != l_1978) & l_1969)), ((safe_sub_func_int8_t_s_s((~((((safe_div_func_uint16_t_u_u(((((p_24 ^ (safe_div_func_uint32_t_u_u((((safe_div_func_int16_t_s_s((((*g_1768) = l_1988) != l_1989), p_24)) > p_24) , 0x1083D65BL), (*g_281)))) , p_24) || p_24) && p_24), (**g_1743))) , p_24) == p_24) == l_1990)), 0UL)) || 0x2A365356L)))))) & p_24); for (g_449 = 0; g_449 < 7; g_449 += 1) { for (g_494 = 0; g_494 < 7; g_494 += 1) { for (l_1945 = 0; l_1945 < 1; l_1945 += 1) { g_1259[g_449][g_494][l_1945] = &g_1260[g_539]; } } } if (p_24) continue; } for (g_1676 = 0; (g_1676 <= 1); g_1676 += 1) { /* block id: 823 */ int16_t *** const l_1992 = &g_566[3][1]; int16_t *** const *l_1991 = &l_1992; int32_t *l_1997 = &g_21[7]; int32_t l_1998 = 1L; int32_t l_2000[6] = {(-7L),(-7L),(-7L),(-7L),(-7L),(-7L)}; int32_t **l_2012 = &g_281; int i; for (l_1970 = 0; (l_1970 <= 1); l_1970 += 1) { /* block id: 826 */ int16_t *** const **l_1993[8][10][3] = {{{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,(void*)0},{&l_1991,(void*)0,(void*)0},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{(void*)0,(void*)0,&l_1991}},{{(void*)0,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,(void*)0},{&l_1991,(void*)0,(void*)0},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991}},{{(void*)0,(void*)0,&l_1991},{(void*)0,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,(void*)0},{&l_1991,(void*)0,(void*)0},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991}},{{&l_1991,&l_1991,&l_1991},{(void*)0,(void*)0,&l_1991},{(void*)0,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,(void*)0},{&l_1991,(void*)0,(void*)0},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991}},{{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{(void*)0,(void*)0,&l_1991},{(void*)0,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{(void*)0,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{(void*)0,&l_1991,&l_1991}},{{&l_1991,&l_1991,(void*)0},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,(void*)0},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{(void*)0,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991}},{{(void*)0,&l_1991,&l_1991},{&l_1991,&l_1991,(void*)0},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,(void*)0},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{(void*)0,&l_1991,&l_1991}},{{&l_1991,&l_1991,&l_1991},{(void*)0,&l_1991,&l_1991},{&l_1991,&l_1991,(void*)0},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,(void*)0},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991},{&l_1991,&l_1991,&l_1991}}}; int32_t l_1999[1][6] = {{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}}; int i, j, k; g_1994 = l_1991; (*g_281) = (((l_1941[1][3][5] = g_303[(l_1970 + 6)][(l_1970 + 6)][g_1676]) >= (1L < (l_1996 == &l_1970))) && g_303[(l_1970 + 6)][(l_1970 + 6)][g_1676]); l_1997 = &g_538; ++l_2009; } (*l_2012) = &l_1943; for (g_1356 = 0; (g_1356 <= 1); g_1356 += 1) { /* block id: 836 */ (*l_2012) = &g_538; if (l_1926) break; } } } } for (l_2003 = 0; (l_2003 > 23); l_2003 = safe_add_func_int16_t_s_s(l_2003, 2)) { /* block id: 845 */ int32_t *l_2015 = &g_21[0]; int32_t *l_2016 = &g_21[7]; int32_t *l_2017 = &g_538; int32_t *l_2018 = (void*)0; int32_t *l_2019 = (void*)0; int32_t l_2020 = 0x3AE8987DL; int32_t *l_2021 = &g_96; int32_t *l_2022 = &l_1943; int32_t *l_2023 = (void*)0; int32_t *l_2024 = &g_200; int32_t *l_2025 = &l_1943; int32_t *l_2026 = &g_200; int32_t *l_2027 = &l_2005; int32_t *l_2028[3]; int64_t l_2029 = 0L; uint32_t l_2033 = 0xEA355575L; int i; for (i = 0; i < 3; i++) l_2028[i] = &l_2008; --l_2033; } } else { /* block id: 848 */ int32_t l_2040 = 0xA72EADD6L; uint8_t l_2041 = 0x31L; uint64_t *l_2054[7] = {&g_203,&g_203,(void*)0,&g_203,&g_203,(void*)0,&g_203}; uint64_t ***l_2058 = &g_1769[0]; int16_t l_2060[2]; int64_t ***l_2062 = &g_1108; int64_t *** const *l_2061[9][8] = {{&l_2062,&l_2062,&l_2062,&l_2062,(void*)0,&l_2062,&l_2062,&l_2062},{(void*)0,(void*)0,&l_2062,&l_2062,&l_2062,&l_2062,(void*)0,&l_2062},{(void*)0,&l_2062,(void*)0,&l_2062,(void*)0,&l_2062,&l_2062,(void*)0},{&l_2062,&l_2062,&l_2062,&l_2062,&l_2062,&l_2062,(void*)0,&l_2062},{&l_2062,&l_2062,&l_2062,&l_2062,&l_2062,&l_2062,&l_2062,&l_2062},{&l_2062,&l_2062,&l_2062,(void*)0,&l_2062,&l_2062,&l_2062,&l_2062},{&l_2062,&l_2062,(void*)0,&l_2062,&l_2062,&l_2062,&l_2062,(void*)0},{&l_2062,&l_2062,(void*)0,&l_2062,&l_2062,&l_2062,&l_2062,&l_2062},{(void*)0,(void*)0,(void*)0,&l_2062,&l_2062,&l_2062,&l_2062,&l_2062}}; int32_t *l_2064[9] = {&g_96,&g_96,&g_96,&g_96,&g_96,&g_96,&g_96,&g_96,&g_96}; int i, j; for (i = 0; i < 2; i++) l_2060[i] = (-1L); g_1781.f5 = (p_24 >= ((((((safe_rshift_func_uint64_t_u_u(((safe_rshift_func_uint64_t_u_s(((((l_2041 = l_2040) == (~(safe_div_func_int8_t_s_s(((safe_sub_func_int8_t_s_s(((((safe_rshift_func_uint8_t_u_u(((safe_mul_func_int64_t_s_s((safe_sub_func_uint16_t_u_u((l_2053 == (l_2054[2] = l_2054[1])), ((safe_mod_func_int16_t_s_s((p_24 && (((*g_281) = (!2L)) , (((l_2058 == l_2059) ^ (l_1926 , l_2040)) , l_2040))), p_24)) < l_2060[1]))), l_2009)) <= l_2003), 1)) != p_24) , (void*)0) == l_2061[1][5]), p_24)) , (**g_991)), p_24)))) > l_2063) >= l_2060[1]), p_24)) > l_2060[0]), 11)) == 0xAEL) | p_24) | l_2060[1]) > p_24) > 0UL)); } (*g_20) &= (safe_div_func_uint8_t_u_u((safe_add_func_uint64_t_u_u((safe_mod_func_int64_t_s_s(l_1955.f0, (p_24 = (l_1955.f2 |= ((((*l_2053) = p_24) & (l_2008 = ((safe_lshift_func_uint64_t_u_s((+p_24), (safe_mul_func_int64_t_s_s(0x5FC58E1BED1E3A7FLL, (-1L))))) < ((l_2030[3] = (((safe_mul_func_uint32_t_u_u((safe_mul_func_uint32_t_u_u((((safe_lshift_func_int32_t_s_u(((((safe_add_func_int64_t_s_s((((((*g_1364) , l_2030[2]) <= (safe_rshift_func_uint64_t_u_u((safe_div_func_int64_t_s_s(((*l_2090) = l_1955.f1), l_2009)), 44))) , 0x4217A906A7F4A854LL) != 0UL), l_2063)) >= 0xB348BF20BDB24332LL) <= (**g_991)) > p_24), 12)) == 0x35F7L) >= l_2032), l_1955.f3)), 0L)) < l_2091) || l_2005)) < 0L)))) , l_2007))))), l_2007)), l_2091)); for (g_1919 = 0; (g_1919 < 25); g_1919 = safe_add_func_int64_t_s_s(g_1919, 6)) { /* block id: 863 */ struct S1 *l_2094[4]; int i; for (i = 0; i < 4; i++) l_2094[i] = (void*)0; l_2095 = l_2094[1]; } return &g_134; } /* ------------------------------------------ */ /* * reads : g_1781.f2.f1 g_20 g_21 g_685 g_687.f3 g_281 g_134 g_96 g_366.f2.f3 g_1919 * writes: g_1356 g_21 g_686 g_366.f2.f3 g_281 */ static int64_t func_25(int32_t * p_26) { /* block id: 770 */ int64_t l_1865 = 1L; int32_t l_1866 = 1L; uint64_t l_1867[9][8][3] = {{{0x73F36F50AE225262LL,0x8D454C8D61D0855DLL,0xA4C7E20FAD392330LL},{0xDBECED15C6F820CBLL,0x04B129B1E6EAF3C4LL,1UL},{0x8A72661B2C8C062ALL,0xAB699EB669A370CDLL,0xD259CD31C89F12F3LL},{0UL,18446744073709551606UL,0x1BF9E18366448013LL},{1UL,0xE07F84E3F6E441E9LL,0x28C7555098E36DAELL},{0xA032703472CF00C8LL,0x22BAAF5AC0BECF72LL,18446744073709551610UL},{0x71145E1D5DC90F93LL,0x22BAAF5AC0BECF72LL,18446744073709551615UL},{0xF59488DDE5627DFALL,0xE07F84E3F6E441E9LL,0x092343AE582C109BLL}},{{0xAB699EB669A370CDLL,18446744073709551606UL,0x03FDF0B839391498LL},{18446744073709551606UL,0xAB699EB669A370CDLL,0x9039AD773484D04ALL},{18446744073709551606UL,0x04B129B1E6EAF3C4LL,0x2D60FCEEFEDA1C50LL},{18446744073709551615UL,0x8D454C8D61D0855DLL,6UL},{18446744073709551614UL,0xD259CD31C89F12F3LL,0xF505E147D2F44198LL},{0xA4C7E20FAD392330LL,0x2ED670F285195926LL,18446744073709551615UL},{0x962D17A2D12F3B42LL,0x4781E964536FEC0CLL,0xFDFABECB02AC2879LL},{18446744073709551610UL,0xDBECED15C6F820CBLL,0x462025D617676F15LL}},{{4UL,0xFDFABECB02AC2879LL,0xDBECED15C6F820CBLL},{0x3471EDD0036848C7LL,0x3471EDD0036848C7LL,1UL},{0x1BF9E18366448013LL,0xA4132E0B657A75C0LL,1UL},{0xCE59A838ABF3F742LL,0xE88889FA132D3871LL,18446744073709551614UL},{0x8D454C8D61D0855DLL,18446744073709551610UL,0x962D17A2D12F3B42LL},{0x22BAAF5AC0BECF72LL,0xCE59A838ABF3F742LL,18446744073709551614UL},{0UL,2UL,1UL},{18446744073709551614UL,6UL,1UL}},{{0UL,18446744073709551614UL,0xDBECED15C6F820CBLL},{1UL,0x12C047010330229ELL,0x462025D617676F15LL},{0xEA5A54507F281625LL,18446744073709551615UL,0xFDFABECB02AC2879LL},{0x03FDF0B839391498LL,0x9039AD773484D04ALL,18446744073709551615UL},{0x12C047010330229ELL,0UL,0xF505E147D2F44198LL},{0x462025D617676F15LL,0x6692CBCE4E0E87BELL,6UL},{0x6CEA072C040E2F3BLL,6UL,0x2D60FCEEFEDA1C50LL},{0xAC4C48C13DEC3132LL,0x31EA52610672F775LL,0x9039AD773484D04ALL}},{{0xE34FBF30DA2C2676LL,1UL,0x03FDF0B839391498LL},{0x28C7555098E36DAELL,1UL,0x092343AE582C109BLL},{1UL,0UL,18446744073709551615UL},{0x3D4D28C8F0E33225LL,0xE34FBF30DA2C2676LL,18446744073709551610UL},{0x3D4D28C8F0E33225LL,0x03FDF0B839391498LL,0x28C7555098E36DAELL},{1UL,1UL,0x1BF9E18366448013LL},{0x28C7555098E36DAELL,0xAC4C48C13DEC3132LL,0xD259CD31C89F12F3LL},{0xE34FBF30DA2C2676LL,18446744073709551615UL,1UL}},{{0xAC4C48C13DEC3132LL,0x9F242D6D72F851FBLL,0xA4C7E20FAD392330LL},{0x6CEA072C040E2F3BLL,0xDE14C990E37B60FALL,1UL},{0x462025D617676F15LL,0x9B84CE8519DC6789LL,0x12C047010330229ELL},{0x12C047010330229ELL,0x73F36F50AE225262LL,0xE34FBF30DA2C2676LL},{0x03FDF0B839391498LL,0xEA5A54507F281625LL,0x31EA52610672F775LL},{0xEA5A54507F281625LL,18446744073709551606UL,18446744073709551609UL},{1UL,0UL,0UL},{0UL,18446744073709551615UL,0xE07F84E3F6E441E9LL}},{{18446744073709551614UL,2UL,0x3D4D28C8F0E33225LL},{0UL,0xDF2B41C1EF152838LL,7UL},{0x22BAAF5AC0BECF72LL,0x8A72661B2C8C062ALL,18446744073709551606UL},{0x8D454C8D61D0855DLL,0xDF2B41C1EF152838LL,0x2ED670F285195926LL},{0xCE59A838ABF3F742LL,2UL,0x8D454C8D61D0855DLL},{0x1BF9E18366448013LL,18446744073709551615UL,18446744073709551606UL},{0x3471EDD0036848C7LL,0UL,0xBF6BAC8C5C18DCCBLL},{4UL,18446744073709551606UL,18446744073709551610UL}},{{18446744073709551610UL,0xEA5A54507F281625LL,18446744073709551614UL},{0x962D17A2D12F3B42LL,0x73F36F50AE225262LL,0xE01836190FE2CC8DLL},{0xA4C7E20FAD392330LL,0x9B84CE8519DC6789LL,2UL},{18446744073709551614UL,0xDE14C990E37B60FALL,0x35410CC2B5833F5ALL},{18446744073709551615UL,0x9F242D6D72F851FBLL,0xA4132E0B657A75C0LL},{1UL,0xF505E147D2F44198LL,1UL},{0xD259CD31C89F12F3LL,0x4781E964536FEC0CLL,18446744073709551610UL},{0x1BF9E18366448013LL,0xA032703472CF00C8LL,0xF505E147D2F44198LL}},{{0x28C7555098E36DAELL,18446744073709551614UL,18446744073709551606UL},{18446744073709551610UL,18446744073709551615UL,18446744073709551606UL},{18446744073709551615UL,18446744073709551606UL,0xF505E147D2F44198LL},{0x092343AE582C109BLL,6UL,18446744073709551610UL},{0x03FDF0B839391498LL,0x962D17A2D12F3B42LL,1UL},{0x9039AD773484D04ALL,0x8A72661B2C8C062ALL,0xA4132E0B657A75C0LL},{0x2D60FCEEFEDA1C50LL,0UL,0xAC4C48C13DEC3132LL},{6UL,1UL,0x22BAAF5AC0BECF72LL}}}; uint16_t *l_1888[7] = {&g_98,&g_98,&g_98,&g_98,&g_98,&g_98,&g_98}; int32_t l_1891 = 0L; int64_t *l_1892 = &g_1356; uint8_t *l_1893[6][4] = {{&g_364,&g_364,&g_364,(void*)0},{&g_364,&g_364,&g_364,(void*)0},{&g_364,&g_364,&g_364,&g_364},{&g_364,&g_364,&g_364,&g_364},{&g_364,&g_364,&g_364,&g_364},{&g_364,&g_364,&g_364,&g_364}}; int32_t l_1894 = (-9L); struct S1 *l_1895 = &g_1896; uint32_t *l_1899 = &g_139; uint32_t **l_1898 = &l_1899; uint32_t ***l_1897 = &l_1898; int32_t l_1916 = 0xB0270099L; uint32_t l_1917 = 0x158CB624L; int16_t l_1918 = 0x47E4L; uint16_t l_1920 = 0x80D5L; int32_t **l_1921 = (void*)0; int32_t **l_1922 = (void*)0; int32_t **l_1923 = &g_281; int32_t *l_1925 = &g_538; int32_t **l_1924 = &l_1925; int i, j, k; (*g_20) ^= (safe_rshift_func_int16_t_s_s(((l_1894 = (safe_sub_func_int16_t_s_s((-9L), (safe_rshift_func_int16_t_s_s(0xEE57L, (safe_div_func_uint8_t_u_u((l_1865 > (--l_1867[8][2][0])), (g_1781.f2.f1 || (safe_mul_func_uint64_t_u_u(((safe_rshift_func_int16_t_s_u((safe_mul_func_int32_t_s_s((safe_add_func_int64_t_s_s(((*l_1892) = (l_1891 |= (safe_mod_func_uint8_t_u_u((safe_mod_func_uint64_t_u_u((safe_mul_func_uint64_t_u_u((safe_lshift_func_int8_t_s_u((safe_mul_func_uint16_t_u_u(l_1865, (l_1866 ^= 1UL))), 5)), (l_1865 ^ (safe_mul_func_int64_t_s_s(0L, 9L))))), 0x7146AFBCC20BA14FLL)), l_1865)))), 0x23F32D37AE17EDABLL)), 0xAC0195FAL)), l_1865)) == 0x2FL), l_1865)))))))))) && 0x66L), 3)); (*g_685) = l_1895; (*g_20) = (g_366.f2.f3 ^= (g_687.f3 && ((*g_281) != (l_1897 != &l_1898)))); (*l_1924) = (p_26 = ((*l_1923) = ((safe_lshift_func_int64_t_s_u((safe_sub_func_uint64_t_u_u((l_1894 , l_1866), l_1865)), (safe_div_func_uint32_t_u_u(l_1891, (safe_sub_func_int8_t_s_s(0L, (~((((-1L) | (safe_rshift_func_int64_t_s_s((safe_add_func_uint8_t_u_u(((l_1891 < (((safe_add_func_int32_t_s_s((-7L), (((((((safe_unary_minus_func_int64_t_s((((l_1916 ^= l_1894) & l_1867[8][3][2]) == l_1867[8][5][1]))) && 0x0D2CB80B0378C67ALL) | l_1866) == l_1917) & l_1891) && l_1866) >= l_1918))) > 0UL) >= l_1866)) && g_1919), 0xDEL)), l_1917))) & l_1920) && l_1916)))))))) , p_26))); return (**l_1923); } /* ------------------------------------------ */ /* * reads : g_449 g_366.f2 g_134 g_21 g_96 g_538 g_200 * writes: g_1013 g_200 */ static int32_t * func_27(int32_t * p_28, int32_t * const p_29) { /* block id: 456 */ int64_t *l_1135 = (void*)0; int32_t l_1138[2][5][4] = {{{0x20EB2803L,0x9043160EL,0x9043160EL,0x20EB2803L},{4L,1L,0x20EB2803L,(-10L)},{0x2500715FL,0x1DD4B1C4L,0x4A3B9788L,(-9L)},{5L,0x264A7BA1L,0x0EBE10C5L,(-9L)},{1L,0x1DD4B1C4L,0xEA3855B2L,(-10L)}},{{(-8L),1L,(-8L),0x20EB2803L},{0x0EBE10C5L,0x9043160EL,4L,0x1DD4B1C4L},{(-9L),(-8L),(-10L),0x9043160EL},{0L,0x6B410342L,(-10L),0x264A7BA1L},{(-9L),(-1L),4L,4L}}}; uint64_t l_1141 = 1UL; uint8_t l_1142 = 255UL; uint32_t *l_1225[3]; int8_t *l_1243 = (void*)0; struct S1 ****l_1251[1]; struct S1 *** const l_1308 = (void*)0; int32_t l_1343 = 0L; struct S0 *l_1362 = &g_1185[3][3].f2; uint32_t l_1429[5][9] = {{1UL,7UL,1UL,18446744073709551615UL,0xD90CAC61L,18446744073709551615UL,1UL,7UL,1UL},{0x354072C9L,18446744073709551615UL,18446744073709551611UL,0x62C15377L,0x3453975AL,8UL,0x3453975AL,0x62C15377L,18446744073709551611UL},{18446744073709551608UL,18446744073709551608UL,0xA84B2D61L,18446744073709551615UL,7UL,0x0C29BA2AL,1UL,0x0C29BA2AL,7UL},{0x354072C9L,0x3453975AL,0x3453975AL,0x354072C9L,0xE7CDE88FL,0x90520717L,18446744073709551609UL,18446744073709551611UL,18446744073709551609UL},{1UL,18446744073709551615UL,0xA84B2D61L,0xA84B2D61L,18446744073709551615UL,1UL,0xD90CAC61L,18446744073709551608UL,0x2610EA6FL}}; int8_t **l_1435[4]; uint64_t l_1508 = 18446744073709551615UL; uint64_t l_1568[6] = {0x937BAD578C081377LL,0x937BAD578C081377LL,0x937BAD578C081377LL,0x937BAD578C081377LL,0x937BAD578C081377LL,0x937BAD578C081377LL}; uint32_t *l_1719[3][5] = {{(void*)0,&g_139,(void*)0,&g_139,(void*)0},{&g_139,&g_139,&g_139,&g_139,&g_139},{(void*)0,&g_139,(void*)0,&g_139,(void*)0}}; uint16_t l_1727 = 0UL; int32_t *l_1782 = &l_1138[1][3][3]; uint8_t l_1806 = 255UL; int32_t l_1811 = 0x9155477AL; uint32_t l_1819[9][6] = {{0xF9E2751FL,0xF9E2751FL,0x461F67F9L,0xF9E2751FL,0xF9E2751FL,0x461F67F9L},{0xF9E2751FL,0xF9E2751FL,0x461F67F9L,0xF9E2751FL,0xF9E2751FL,0x461F67F9L},{0xF9E2751FL,0xF9E2751FL,0x461F67F9L,0xF9E2751FL,0xF9E2751FL,0x461F67F9L},{0xF9E2751FL,0UL,0xF9E2751FL,0UL,0UL,0xF9E2751FL},{0UL,0UL,0xF9E2751FL,0UL,0UL,0xF9E2751FL},{0UL,0UL,0xF9E2751FL,0UL,0UL,0xF9E2751FL},{0UL,0UL,0xF9E2751FL,0UL,0UL,0xF9E2751FL},{0UL,0UL,0xF9E2751FL,0UL,0UL,0xF9E2751FL},{0UL,0UL,0xF9E2751FL,0UL,0UL,0xF9E2751FL}}; int32_t l_1847[5][5][7] = {{{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L}},{{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L}},{{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L}},{{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L}},{{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,0xB93BE071L,1L,0xF4E08F60L,0x6C0328D3L,0x6C0328D3L},{0xF4E08F60L,1L,7L,9L,0x6C0328D3L,0xB93BE071L,0xB93BE071L},{0x6C0328D3L,9L,7L,9L,0x6C0328D3L,0xB93BE071L,0xB93BE071L},{0x6C0328D3L,9L,7L,9L,0x6C0328D3L,0xB93BE071L,0xB93BE071L}}}; uint16_t *l_1853[2]; struct S1 ***l_1855 = &g_685; const int16_t l_1856 = 0x5015L; int i, j, k; for (i = 0; i < 3; i++) l_1225[i] = (void*)0; for (i = 0; i < 1; i++) l_1251[i] = &g_684[1][6]; for (i = 0; i < 4; i++) l_1435[i] = (void*)0; for (i = 0; i < 2; i++) l_1853[i] = &l_1727; for (g_1013 = 15; (g_1013 >= 8); --g_1013) { /* block id: 459 */ uint8_t l_1143 = 0UL; int32_t l_1148 = 0xF00C92E1L; int32_t l_1150 = 6L; int32_t l_1151 = 0L; struct S1 *l_1183[6] = {&g_1184,&g_1186,&g_1186,&g_1184,&g_1186,&g_1186}; int32_t l_1226[5][10][5] = {{{1L,1L,0xB10CA7ABL,0x74077E26L,5L},{2L,0x4C154573L,0L,0xE16E2394L,(-1L)},{0x3B0D68E1L,0x01DEA385L,7L,1L,(-7L)},{(-7L),0x62895556L,0xA448AFCAL,0x47C8F4C9L,5L},{0x4C154573L,0x47C8F4C9L,0xE50FD11BL,0xD53EAA54L,0x01DEA385L},{4L,2L,0x380AA6B2L,5L,1L},{1L,7L,0L,1L,0L},{1L,0xD53EAA54L,0L,0x241BCD65L,8L},{4L,0x4C154573L,1L,0L,0xE16E2394L},{0x4C154573L,(-1L),0x3B0D68E1L,0x74077E26L,0L}},{{(-7L),1L,0xC5FE2610L,1L,(-7L)},{0x3B0D68E1L,1L,(-1L),5L,0x01DEA385L},{2L,(-1L),0xA448AFCAL,(-7L),7L},{1L,0L,(-7L),1L,0x01DEA385L},{0xFB5853AFL,(-7L),0xB10CA7ABL,1L,(-7L)},{0x01DEA385L,7L,1L,(-7L),0L},{0xBF078C0BL,0x01DEA385L,(-7L),0x241BCD65L,0xE16E2394L},{1L,1L,0L,(-4L),8L},{0x4C154573L,0x62895556L,4L,8L,0L},{2L,0x0BC5371BL,0xC5FE2610L,8L,1L}},{{0xFB5853AFL,0xBF078C0BL,7L,(-4L),0x01DEA385L},{0x47C8F4C9L,1L,0xD362B99DL,0x241BCD65L,5L},{0x0BC5371BL,0L,0L,(-7L),(-7L)},{0x3B0D68E1L,2L,0x3B0D68E1L,1L,(-1L)},{0xD53EAA54L,0x62895556L,0L,1L,5L},{0xBF078C0BL,1L,0xE50FD11BL,(-7L),0x0BC5371BL},{4L,0x0BC5371BL,0L,5L,0L},{1L,7L,0x3B0D68E1L,1L,0L},{0x47C8F4C9L,8L,0L,0x74077E26L,(-7L)},{4L,0xBF078C0BL,0xD362B99DL,0L,(-7L)}},{{0L,(-1L),7L,0x241BCD65L,0L},{8L,0x47C8F4C9L,0xC5FE2610L,1L,0xD53EAA54L},{0x3B0D68E1L,0x47C8F4C9L,4L,5L,2L},{0x01DEA385L,(-8L),(-1L),0xB10CA7ABL,0L},{0x3B0D68E1L,1L,0xD53EAA54L,7L,7L},{0x8E67BF24L,1L,(-9L),(-9L),1L},{7L,0xFF0161FDL,(-5L),0L,(-1L)},{1L,7L,0xD53EAA54L,0L,(-1L)},{0x3D6C3245L,0x3B0D68E1L,0xE50FD11BL,(-3L),0xB10CA7ABL},{1L,(-7L),(-8L),0xD362B99DL,3L}},{{7L,0x56B23101L,0x01DEA385L,0xB10CA7ABL,0xFB5853AFL},{0x8E67BF24L,1L,1L,(-3L),0x56B23101L},{0x3B0D68E1L,0L,(-9L),0x380AA6B2L,0x7F997BC9L},{0x0ECA4A9DL,1L,(-7L),(-1L),0L},{1L,7L,9L,(-9L),0L},{1L,(-7L),0x9BF4FCF6L,0L,0x7F997BC9L},{1L,0L,0x903F3796L,1L,0x56B23101L},{0x691008CBL,0x0ECA4A9DL,0xE50FD11BL,0x7F997BC9L,0xFB5853AFL},{7L,0xFF0161FDL,0xFF0161FDL,7L,3L},{0L,0xD362B99DL,(-7L),0x380AA6B2L,0xB10CA7ABL}}}; int8_t l_1227 = 0x6DL; uint16_t l_1284 = 65532UL; int i, j, k; if (((g_449 <= (safe_mul_func_int64_t_s_s((((g_366.f2 , 0x63L) >= (safe_sub_func_uint16_t_u_u((((void*)0 != l_1135) | ((void*)0 != p_29)), ((((safe_lshift_func_uint32_t_u_s(l_1138[1][3][3], (safe_mod_func_int16_t_s_s((0x82ACL == 0xA84FL), l_1141)))) , (*p_29)) && l_1142) <= l_1142)))) >= 0x1D4603D9L), l_1143))) > 0xDCL)) { /* block id: 460 */ int32_t **l_1144[3][2][8] = {{{(void*)0,&g_281,&g_281,(void*)0,&g_281,(void*)0,&g_281,&g_281},{&g_281,&g_281,&g_20,&g_20,&g_281,&g_281,&g_281,&g_20}},{{(void*)0,&g_281,(void*)0,&g_281,&g_281,(void*)0,&g_281,(void*)0},{&g_20,&g_281,&g_20,&g_281,&g_20,&g_20,&g_281,&g_20}},{{&g_20,&g_20,&g_281,&g_20,&g_281,&g_20,&g_20,&g_281},{(void*)0,&g_281,&g_281,(void*)0,&g_281,(void*)0,&g_281,&g_281}}}; int i, j, k; p_28 = &l_1138[1][3][3]; } else { /* block id: 462 */ const uint32_t l_1145 = 0xA9D7D345L; int32_t l_1149 = 1L; int32_t l_1152 = 0x92CDE73FL; struct S0 l_1160 = {41,0,14,-207}; int32_t l_1174 = 2L; int8_t ***l_1228 = (void*)0; struct S1 **l_1278 = &g_686; if (l_1145) { /* block id: 463 */ int32_t *l_1146 = &g_134; int32_t *l_1147[8][4][8] = {{{&g_21[2],&l_1138[0][1][3],(void*)0,(void*)0,&l_1138[0][1][3],&g_21[2],&l_1138[0][1][3],(void*)0},{(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0},{&l_1138[1][2][3],&g_21[2],(void*)0,&g_21[2],&l_1138[1][2][3],&l_1138[1][2][3],&g_21[2],(void*)0},{&l_1138[1][2][3],&l_1138[1][2][3],&g_21[2],(void*)0,&g_21[2],&l_1138[1][2][3],&l_1138[1][2][3],&g_21[2]}},{{(void*)0,&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2]},{&g_21[2],&l_1138[0][1][3],(void*)0,(void*)0,&l_1138[0][1][3],&g_21[2],&l_1138[0][1][3],(void*)0},{(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0},{&l_1138[1][2][3],&g_21[2],&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3]}},{{&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,&l_1138[1][2][3],(void*)0,(void*)0,(void*)0},{(void*)0,&l_1138[1][2][3],&l_1138[0][1][3],&l_1138[0][1][3],&l_1138[1][2][3],(void*)0,&l_1138[1][2][3],&l_1138[0][1][3]},{(void*)0,&l_1138[1][2][3],(void*)0,(void*)0,(void*)0,(void*)0,&l_1138[1][2][3],(void*)0}},{{&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3]},{&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,&l_1138[1][2][3],(void*)0,(void*)0,(void*)0},{(void*)0,&l_1138[1][2][3],&l_1138[0][1][3],&l_1138[0][1][3],&l_1138[1][2][3],(void*)0,&l_1138[1][2][3],&l_1138[0][1][3]}},{{(void*)0,&l_1138[1][2][3],(void*)0,(void*)0,(void*)0,(void*)0,&l_1138[1][2][3],(void*)0},{&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3]},{&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,&l_1138[1][2][3],(void*)0,(void*)0,(void*)0}},{{(void*)0,&l_1138[1][2][3],&l_1138[0][1][3],&l_1138[0][1][3],&l_1138[1][2][3],(void*)0,&l_1138[1][2][3],&l_1138[0][1][3]},{(void*)0,&l_1138[1][2][3],(void*)0,(void*)0,(void*)0,(void*)0,&l_1138[1][2][3],(void*)0},{&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3]},{&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0}},{{(void*)0,(void*)0,(void*)0,(void*)0,&l_1138[1][2][3],(void*)0,(void*)0,(void*)0},{(void*)0,&l_1138[1][2][3],&l_1138[0][1][3],&l_1138[0][1][3],&l_1138[1][2][3],(void*)0,&l_1138[1][2][3],&l_1138[0][1][3]},{(void*)0,&l_1138[1][2][3],(void*)0,(void*)0,(void*)0,(void*)0,&l_1138[1][2][3],(void*)0},{&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3]}},{{&g_21[2],&g_21[2],(void*)0,&l_1138[0][1][3],(void*)0,&g_21[2],&g_21[2],(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,&l_1138[1][2][3],(void*)0,(void*)0,(void*)0},{(void*)0,&l_1138[1][2][3],&l_1138[0][1][3],&l_1138[0][1][3],&l_1138[1][2][3],(void*)0,&l_1138[1][2][3],&l_1138[0][1][3]},{(void*)0,&g_21[2],&l_1138[0][1][3],(void*)0,(void*)0,&l_1138[0][1][3],&g_21[2],&l_1138[0][1][3]}}}; uint8_t l_1153 = 6UL; int i, j, k; ++l_1153; } else { /* block id: 465 */ uint32_t l_1172 = 0xBE3979B1L; const int16_t l_1176[1] = {0L}; int32_t l_1197 = 0L; int32_t l_1199 = 0L; int32_t l_1274 = (-9L); int i; for (g_200 = 0; (g_200 == (-19)); g_200--) { /* block id: 468 */ uint32_t l_1161 = 1UL; uint16_t *l_1175[3][6][8] = {{{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98}},{{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98}},{{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98},{&g_98,&g_460,&g_460,&g_98,&g_98,&g_460,&g_460,&g_98}}}; int16_t *l_1177 = &g_138; uint8_t *l_1191[9][5][1] = {{{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{&l_1142},{(void*)0},{(void*)0},{&l_1142},{(void*)0}}}; uint64_t *l_1196 = &l_1141; int32_t *l_1198[6][1][1] = {{{&l_1138[1][3][3]}},{{(void*)0}},{{&l_1138[1][3][3]}},{{(void*)0}},{{&l_1138[1][3][3]}},{{(void*)0}}}; int32_t *l_1272 = (void*)0; int i, j, k; } } } } return &g_21[7]; } /* ------------------------------------------ */ /* * reads : g_21 g_20 g_105 g_96 g_98 g_134 g_135 g_138 g_139 g_174 g_200 g_364 g_517.f2.f3 g_517.f2.f2 g_275 g_281 g_460 g_166 g_164 g_449 g_956.f4 g_517.f5 g_366.f4 g_567 g_760.f2.f1 g_957.f4 g_366.f5 g_991 g_992 g_303 g_203 g_687.f4 g_1013 g_760.f6 g_494 g_687.f5 g_957.f2.f2 g_957.f5 g_1079 g_685 g_686 g_1120.f3 * writes: g_96 g_98 g_105 g_138 g_139 g_152 g_166 g_134 g_174 g_200 g_364 g_21 g_281 g_460 g_449 g_135 g_517.f5 g_203 g_687.f4 g_538 g_164 g_991 g_303 g_730 g_1108 */ static int32_t * const func_30(int32_t * p_31) { /* block id: 1 */ uint8_t l_34 = 249UL; const struct S0 l_44 = {66,0,-12,-36}; int64_t l_201 = (-8L); int32_t l_236 = 0x86FCF0ECL; int32_t l_248 = 0xDB2FD4F2L; int32_t l_249[10] = {0xF0E5CD17L,(-9L),(-9L),0xF0E5CD17L,4L,0xF0E5CD17L,(-9L),(-9L),0xF0E5CD17L,4L}; const int16_t *l_272[9][5] = {{&g_138,&g_138,&g_138,&g_138,&g_138},{&g_138,&g_138,&g_138,&g_138,&g_138},{&g_138,&g_138,&g_135,&g_135,&g_138},{&g_138,&g_138,&g_135,&g_138,&g_138},{&g_138,&g_138,&g_138,&g_135,&g_138},{&g_138,&g_138,&g_138,&g_138,&g_138},{&g_138,&g_138,&g_138,&g_138,&g_138},{&g_138,&g_138,&g_138,&g_138,&g_138},{&g_138,&g_138,&g_138,&g_138,&g_138}}; struct S0 l_402[3] = {{502,0,-37,4},{502,0,-37,4},{502,0,-37,4}}; int32_t *l_463[8][3][4] = {{{&l_248,&g_21[1],&l_248,&g_200},{&g_21[7],&g_21[1],&g_96,&g_21[1]},{&g_21[7],&g_200,&l_248,&g_21[1]}},{{&l_248,&g_21[1],&l_248,&g_200},{&g_21[7],&g_21[1],&g_96,&g_21[1]},{&g_21[7],&g_200,&l_248,&g_21[1]}},{{&l_248,&g_21[1],&l_248,&g_200},{&g_21[7],&g_21[1],&g_96,&g_21[1]},{&g_21[7],&g_200,&l_248,&g_21[1]}},{{&l_248,&g_21[1],&l_248,&g_200},{&g_21[7],&g_21[1],&g_96,&g_21[1]},{&g_21[7],&g_200,&l_248,&g_21[1]}},{{&l_248,&g_21[1],&l_248,&g_200},{&g_21[7],&g_21[1],&g_96,&g_21[1]},{&g_21[7],&g_200,&l_248,&g_21[1]}},{{&l_248,&g_21[1],&l_248,&g_200},{&g_21[7],&g_21[1],&g_96,&g_21[1]},{&g_21[7],&g_200,&l_248,&g_21[1]}},{{&l_248,&g_21[1],&l_248,&g_200},{&g_21[7],&g_21[1],&g_96,&g_21[1]},{&g_21[7],&g_200,&l_248,&g_21[1]}},{{&l_248,&g_21[1],&l_248,&g_200},{&g_21[7],&g_21[1],&g_96,&g_21[1]},{&g_21[7],&g_200,&l_248,&g_21[1]}}}; uint16_t *l_468 = &g_460; int16_t l_476[10] = {2L,(-1L),2L,(-1L),2L,(-1L),2L,(-1L),2L,(-1L)}; int32_t l_546 = (-1L); int8_t * const l_612 = &g_449; int64_t **l_734 = &g_166; struct S1 *l_759 = &g_760; int32_t l_761[9] = {(-1L),0x5B66DCDEL,(-1L),0x5B66DCDEL,(-1L),0x5B66DCDEL,(-1L),0x5B66DCDEL,(-1L)}; uint64_t *l_770 = &g_203; uint64_t l_836 = 18446744073709551615UL; struct S1 *****l_849 = (void*)0; uint64_t l_877[1]; uint64_t l_939 = 18446744073709551609UL; int16_t ***l_949 = &g_566[2][1]; int16_t l_1014 = 0xADF3L; uint64_t l_1024 = 0x645CEE31A4C06244LL; int32_t **l_1126[8][5] = {{&g_20,&g_281,&g_281,&g_20,&g_281},{(void*)0,&g_281,(void*)0,&g_20,(void*)0},{&g_20,&g_20,&g_281,&g_281,&g_281},{&g_281,&g_20,(void*)0,&g_20,&g_281},{&g_281,&g_281,&g_281,&g_20,&g_20},{(void*)0,&g_20,(void*)0,&g_281,(void*)0},{&g_281,&g_20,&g_281,&g_281,&g_20},{&g_281,&g_281,(void*)0,&g_281,&g_281}}; int i, j, k; for (i = 0; i < 1; i++) l_877[i] = 0UL; if ((g_21[7] , (p_31 == p_31))) { /* block id: 2 */ struct S0 l_43 = {295,0,-2,-142}; int32_t *l_199 = &g_200; uint64_t *l_202 = &g_203; int32_t l_255 = 6L; uint64_t l_342 = 0xDC8CDFEB08D7DA2CLL; uint8_t l_424 = 1UL; uint16_t l_436[9] = {65528UL,65534UL,65534UL,65528UL,65534UL,65534UL,65528UL,65534UL,65534UL}; int32_t l_458 = 0xF79BC652L; int32_t l_459 = 0L; int8_t l_481 = (-2L); struct S1 *l_516 = &g_517; const int16_t l_531 = 7L; int32_t l_545 = 4L; int32_t l_547[10][2][7] = {{{0x8D301ACBL,(-2L),0x675AE70FL,0xF48704D2L,0xB708AAB3L,0x46FE1F28L,0x8D301ACBL},{0x9ADA0AB1L,0x9F9CC467L,0x9ADA0AB1L,0xF9F88C1CL,0x9F9CC467L,0xB37BD30FL,0xB37BD30FL}},{{(-7L),0xF48704D2L,0xC9BB50C8L,0xF48704D2L,(-7L),(-1L),0x7D8E60FEL},{0x803AF270L,0xB37BD30FL,0xF9F88C1CL,0x803AF270L,0xF9F88C1CL,0xB37BD30FL,0x803AF270L}},{{0x675AE70FL,0x84446A3DL,0x009216C6L,0x46FE1F28L,0x7D8E60FEL,0x46FE1F28L,0x009216C6L},{0x803AF270L,0x803AF270L,0L,0x9F9CC467L,0xDEB0C346L,0L,0xDEB0C346L}},{{(-7L),(-2L),0x009216C6L,0L,0xB708AAB3L,0xF654D7C9L,(-7L)},{0x9ADA0AB1L,0xDEB0C346L,0xF9F88C1CL,0xF9F88C1CL,0xDEB0C346L,0x9ADA0AB1L,0xB37BD30FL}},{{0x8D301ACBL,0L,0xC9BB50C8L,0x84446A3DL,0x7D8E60FEL,(-1L),(-7L)},{0xDEB0C346L,0xB37BD30FL,0x9ADA0AB1L,0xDEB0C346L,0xF9F88C1CL,0xF9F88C1CL,0xDEB0C346L}},{{0x675AE70FL,0L,0x675AE70FL,0x46FE1F28L,(-7L),(-2L),0x009216C6L},{0x9F9CC467L,0xDEB0C346L,0L,0xDEB0C346L,0x9F9CC467L,0L,0x803AF270L}},{{0x7D8E60FEL,(-2L),0xB708AAB3L,0x84446A3DL,0xB708AAB3L,(-2L),0x7D8E60FEL},{0x9ADA0AB1L,0x803AF270L,0xB37BD30FL,0xF9F88C1CL,0x803AF270L,0xF9F88C1CL,0xB37BD30FL}},{{0x7D8E60FEL,0x84446A3DL,0xC9BB50C8L,0L,0x8D301ACBL,(-1L),0x8D301ACBL},{0x9F9CC467L,0xB37BD30FL,0xB37BD30FL,0x9F9CC467L,0xF9F88C1CL,0x9ADA0AB1L,0x9F9CC467L}},{{0x675AE70FL,0xF48704D2L,0xB708AAB3L,0x46FE1F28L,0x8D301ACBL,0xF654D7C9L,0x009216C6L},{0xDEB0C346L,0x9F9CC467L,0L,0x803AF270L,0x803AF270L,0L,0x9F9CC467L}},{{0x8D301ACBL,(-2L),0x675AE70FL,0xF48704D2L,0xB708AAB3L,0x46FE1F28L,0x8D301ACBL},{0x9ADA0AB1L,0x9F9CC467L,0x9ADA0AB1L,0xF9F88C1CL,0x9F9CC467L,0xB37BD30FL,0xB37BD30FL}}}; const int16_t *l_568 = &l_531; int32_t l_589 = 8L; int16_t l_617 = 6L; struct S1 **l_683 = &l_516; struct S1 ***l_682 = &l_683; int32_t * const l_716[9] = {&l_459,&l_545,&l_459,&l_545,&l_459,&l_545,&l_459,&l_545,&l_459}; struct S0 l_739 = {30,0,38,5}; int16_t * const *l_882 = (void*)0; int16_t * const *l_883[7]; int32_t **l_884 = &l_199; int i, j, k; for (i = 0; i < 7; i++) l_883[i] = &g_567; (*l_199) |= ((g_21[7] , (safe_lshift_func_uint64_t_u_s((l_34 | (safe_mod_func_int32_t_s_s((*p_31), 4294967292UL))), (safe_mod_func_uint16_t_u_u(g_21[1], g_21[7]))))) < func_39(l_43, l_44, (((!(safe_mod_func_uint64_t_u_u(((func_48(l_43.f1, l_44.f2, &g_21[1], g_21[4], g_21[6]) && (*p_31)) && 0x2BA53D92L), l_43.f2))) , (-5L)) , l_43.f0))); } else { /* block id: 324 */ uint8_t l_885[5][5] = {{0xBBL,1UL,252UL,252UL,1UL},{0xBEL,0x42L,0xFDL,1UL,253UL},{0x42L,252UL,0xFDL,255UL,0xFDL},{253UL,253UL,252UL,0xBEL,0x1DL},{0x42L,0x1DL,0xBBL,0xBEL,0xBEL}}; int16_t **l_897[2]; uint8_t l_899 = 8UL; int32_t l_914 = 0L; const int32_t l_915 = 0xDD005465L; int32_t l_925 = 0x84DF4719L; int32_t l_927 = 0x8334861AL; int32_t l_929 = 0L; int32_t l_933 = 1L; int32_t l_936 = 0x2E83A184L; struct S1 ****l_959[8] = {&g_684[1][3],&g_684[5][3],&g_684[5][3],&g_684[1][3],&g_684[5][3],&g_684[5][3],&g_684[1][3],&g_684[5][3]}; struct S1 *****l_958 = &l_959[0]; int i, j; for (i = 0; i < 2; i++) l_897[i] = &g_567; l_885[4][1]--; for (g_364 = 13; (g_364 < 1); --g_364) { /* block id: 328 */ struct S0 l_896 = {2,0,36,15}; int16_t **l_898 = &g_567; (*p_31) &= (safe_mul_func_int64_t_s_s(((&g_206 == &g_206) >= g_98), (safe_mod_func_uint8_t_u_u(((safe_lshift_func_int8_t_s_s(((((l_896 , (0x5476L || l_885[4][1])) , ((l_885[4][1] , &g_553) == (l_898 = l_897[0]))) <= l_899) > g_517.f2.f3), 1)) == l_896.f3), 5UL)))); } for (g_139 = 0; (g_139 < 2); g_139 = safe_add_func_uint16_t_u_u(g_139, 3)) { /* block id: 334 */ int16_t *l_902 = &l_476[5]; int32_t l_906 = 1L; uint16_t **l_907 = &l_468; int32_t l_916 = (-4L); int32_t l_926 = 0x8D65E980L; int32_t l_930 = 0x0D95CA39L; int32_t l_931 = (-2L); int32_t l_934 = 1L; int32_t l_937[1][8][3]; int i, j, k; for (i = 0; i < 1; i++) { for (j = 0; j < 8; j++) { for (k = 0; k < 3; k++) l_937[i][j][k] = (-1L); } } l_916 |= ((*g_281) = ((l_902 != l_902) , ((*p_31) = ((&l_468 == ((+(safe_sub_func_int64_t_s_s(l_899, l_906))) , l_907)) < (((((1UL >= (l_914 |= (safe_add_func_int8_t_s_s(g_517.f2.f2, (safe_div_func_uint32_t_u_u((safe_div_func_int64_t_s_s((0x5D7F78ECL | 4294967295UL), l_885[2][2])), g_275)))))) & l_915) ^ l_899) == l_885[4][1]) < l_906))))); if ((*g_20)) break; for (g_138 = 3; (g_138 >= 17); ++g_138) { /* block id: 342 */ uint8_t *l_921 = (void*)0; uint8_t *l_922 = &g_364; int32_t l_928 = 0L; int32_t l_932 = 0xDA9EE492L; int32_t l_935 = 0x52B53DF6L; int32_t l_938 = 0x485386B8L; (*g_281) = (safe_mul_func_uint8_t_u_u(0x51L, ((*l_922)--))); --l_939; } } for (g_200 = 0; (g_200 > (-25)); g_200 = safe_sub_func_int32_t_s_s(g_200, 9)) { /* block id: 350 */ int32_t **l_944 = &g_281; uint8_t *l_950[8] = {(void*)0,&l_899,(void*)0,&l_899,(void*)0,&l_899,(void*)0,&l_899}; const struct S1 *l_955[6] = {&g_957,&g_957,&g_957,&g_957,&g_957,&g_957}; const struct S1 **l_954 = &l_955[0]; const struct S1 ***l_953[2]; const struct S1 ****l_952 = &l_953[0]; const struct S1 *****l_951 = &l_952; int i; for (i = 0; i < 2; i++) l_953[i] = &l_954; (*l_944) = &g_134; (**l_944) = (safe_sub_func_int32_t_s_s((((((**l_944) < (**l_944)) , ((safe_rshift_func_int64_t_s_u(l_927, 46)) > ((((*l_468) |= l_927) , ((((0x49L < (g_364 = (&g_566[2][1] == l_949))) || 0x3252435E8AFB3307LL) >= (l_929 = (l_951 != l_958))) | l_915)) < l_885[4][1]))) < (*g_166)) , 0xB3F91D68L), 4UL)); } } for (g_449 = 0; (g_449 <= 1); g_449 += 1) { /* block id: 360 */ uint64_t l_971 = 0xE3C78AC1677034D5LL; if ((*p_31)) break; for (l_546 = 0; (l_546 <= 4); l_546 += 1) { /* block id: 364 */ int32_t l_964 = 0L; uint32_t *l_966[2]; int32_t l_967 = (-9L); int32_t l_968[2][9] = {{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}}; struct S0 l_972 = {221,0,-5,214}; int i, j; for (i = 0; i < 2; i++) l_966[i] = &g_139; (*g_281) = ((((safe_mul_func_uint32_t_u_u(((safe_add_func_int32_t_s_s((l_964 < ((*g_567) = ((-1L) > (+((l_968[1][7] = (l_967 = 4294967293UL)) && ((safe_add_func_int32_t_s_s(((((l_968[1][3] , l_971) > l_971) <= (l_972 , g_956.f4)) == ((l_967 = ((g_517.f5 > l_972.f0) , g_366.f4)) & g_517.f2.f2)), 0xCA10E27BL)) || l_971)))))), (*g_20))) != g_517.f5), 1L)) > 1L) && 253UL) || l_971); } } for (g_96 = 1; (g_96 >= 0); g_96 -= 1) { /* block id: 374 */ int32_t l_990 = (-1L); int32_t l_1017[9][8][3] = {{{0xFD091596L,0x794B6210L,1L},{0x5CD47464L,0x9CF98D4EL,0x23C876A5L},{7L,(-4L),1L},{5L,0x34733611L,0x2CD1A046L},{1L,0xB0176D9FL,(-4L)},{(-2L),1L,0x53A0F781L},{0x651BB736L,0x651BB736L,0x5820ADD7L},{(-4L),0x53A0F781L,1L}},{{1L,(-9L),1L},{0x26F504BCL,0xC9BE6822L,0x6FBBBF91L},{1L,1L,1L},{0L,5L,1L},{0x2E9A9947L,0L,0x5820ADD7L},{0xB0176D9FL,0xCB430AD9L,0x53A0F781L},{(-5L),0x82922823L,(-4L)},{1L,0xFD091596L,0x2CD1A046L}},{{0x5820ADD7L,0x9DC937C6L,1L},{(-1L),(-2L),0x23C876A5L},{(-7L),(-4L),1L},{1L,(-1L),2L},{1L,0x7389DDB3L,(-1L)},{(-7L),0x5820ADD7L,0x7389DDB3L},{(-1L),0x2E9A9947L,0x65EBB9E3L},{0x5820ADD7L,6L,0x794B6210L}},{{1L,0xC5CC23B2L,0x26F504BCL},{(-5L),(-1L),(-1L)},{0xB0176D9FL,(-1L),0x2E9A9947L},{0x2E9A9947L,7L,0xC5CC23B2L},{0L,0x23C876A5L,(-4L)},{1L,1L,0x31229CD0L},{0x26F504BCL,0x23C876A5L,1L},{1L,7L,0x8C12D2E6L}},{{(-4L),(-1L),0L},{0x651BB736L,(-1L),(-1L)},{(-2L),0xC5CC23B2L,(-4L)},{1L,6L,(-5L)},{5L,0x2E9A9947L,0x9CF98D4EL},{7L,0x5820ADD7L,1L},{0x5CD47464L,0x7389DDB3L,0L},{0xFD091596L,(-1L),0L}},{{1L,(-4L),1L},{1L,0x5CD47464L,(-4L)},{(-1L),0L,2L},{(-9L),0x164FC6BBL,1L},{0x9CF98D4EL,(-4L),0x6FBBBF91L},{0x8C12D2E6L,(-1L),0x8C12D2E6L},{0x23C876A5L,0x8C12D2E6L,0x7389DDB3L},{0x6FBBBF91L,0x48EF61C6L,(-3L)}},{{1L,(-4L),1L},{0x9DC937C6L,0x23C876A5L,0x9CF98D4EL},{1L,0x31229CD0L,1L},{0x6FBBBF91L,(-2L),7L},{0x23C876A5L,0x53A0F781L,(-1L)},{0x8C12D2E6L,1L,(-1L)},{0x9CF98D4EL,0x2E9A9947L,5L},{(-9L),(-1L),(-1L)}},{{(-1L),0xB0176D9FL,6L},{1L,(-4L),1L},{4L,5L,0x9DC937C6L},{0x164FC6BBL,5L,0x2CD1A046L},{(-7L),(-4L),0x794B6210L},{1L,0xB0176D9FL,1L},{0x48EF61C6L,(-1L),0xC9BE6822L},{0L,0x2E9A9947L,0xB0176D9FL}},{{0x5CD47464L,1L,(-2L)},{0x53A0F781L,0x53A0F781L,0xFD091596L},{1L,(-2L),4L},{(-4L),0x31229CD0L,0L},{(-1L),0x23C876A5L,0x4E9DCA39L},{(-3L),(-4L),0L},{0xCB430AD9L,0x48EF61C6L,4L},{7L,0x8C12D2E6L,0xFD091596L}}}; uint32_t l_1056[10] = {0x15B8E826L,0x15B8E826L,0x0F1E4E8EL,4294967290UL,0x0F1E4E8EL,0x15B8E826L,0x15B8E826L,0x0F1E4E8EL,4294967290UL,0x0F1E4E8EL}; struct S1 **l_1075 = (void*)0; struct S1 *l_1119 = &g_1120[6]; int i, j, k; for (l_236 = 8; (l_236 >= 0); l_236 -= 1) { /* block id: 377 */ int32_t ** const l_977[4] = {(void*)0,(void*)0,(void*)0,(void*)0}; int32_t l_987 = 0x492FB7ADL; uint64_t *l_1004 = (void*)0; uint64_t *l_1005 = &l_836; int64_t l_1008 = 0x4C4E9AC21205D7A5LL; int8_t *l_1016 = (void*)0; int8_t ** const l_1015 = &l_1016; int i, j; g_200 = (safe_mul_func_uint16_t_u_u((g_460 = (safe_lshift_func_uint32_t_u_u(((void*)0 == l_977[0]), 18))), ((safe_mul_func_uint64_t_u_u((safe_add_func_uint8_t_u_u(0xA2L, ((safe_rshift_func_uint64_t_u_s((safe_rshift_func_uint32_t_u_u(((g_517.f5 = ((*g_20) = l_476[l_236])) < g_760.f2.f1), (!(g_957.f4 | (l_987 > (safe_lshift_func_uint16_t_u_s(l_990, 9))))))), l_990)) , 3UL))), g_366.f5)) || 0xDBL))); l_1017[2][2][0] |= ((g_991 == ((((1L < ((safe_div_func_int32_t_s_s((safe_lshift_func_uint16_t_u_u(65535UL, 2)), (safe_mod_func_uint8_t_u_u(3UL, (*g_992))))) || (((((*p_31) = (~(safe_div_func_uint64_t_u_u(((*l_1005) = ((*g_281) , ((*l_770)++))), l_990)))) > (safe_sub_func_uint16_t_u_u((l_1008 != (((((g_687.f4 &= (safe_rshift_func_int64_t_s_u((safe_div_func_uint64_t_u_u(l_990, l_990)), 63))) , l_990) , g_1013) , 7L) & 0xF8L)), l_990))) , l_990) > l_990))) < l_1014) != 0UL) , l_1015)) > 0UL); for (g_134 = 0; (g_134 <= 1); g_134 += 1) { /* block id: 389 */ int16_t l_1019 = (-1L); int32_t l_1020 = 0xBE2D1482L; int32_t l_1022 = 0L; for (g_538 = 0; (g_538 <= 0); g_538 += 1) { /* block id: 392 */ int32_t l_1018 = 0x7074944FL; int32_t l_1021 = 0xE0F90AF2L; int32_t l_1023 = (-5L); ++l_1024; } for (l_1019 = 1; (l_1019 >= 0); l_1019 -= 1) { /* block id: 397 */ uint64_t **l_1028 = &g_773; uint64_t ***l_1027 = &l_1028; uint64_t ****l_1029 = &l_1027; int i, j, k; if (g_303[(g_96 + 5)][(g_134 + 2)][g_96]) break; (*l_1029) = l_1027; } if ((*g_281)) { /* block id: 401 */ int8_t l_1050 = (-8L); uint16_t l_1051 = 0x5F45L; int32_t l_1061[2][4][6] = {{{0x65F20725L,0x35D4CC42L,0x35D4CC42L,0x65F20725L,0L,0xFB0D0C1AL},{0xFB0D0C1AL,0x65F20725L,2L,0x65F20725L,0xFB0D0C1AL,0x453E6D2BL},{0x65F20725L,0xFB0D0C1AL,0x453E6D2BL,0x453E6D2BL,0xFB0D0C1AL,0x65F20725L},{0x35D4CC42L,0x65F20725L,0L,0xFB0D0C1AL,0L,0x65F20725L}},{{0L,0x35D4CC42L,0x453E6D2BL,2L,2L,0x453E6D2BL},{0L,0L,2L,0xFB0D0C1AL,0L,0xFB0D0C1AL},{0x35D4CC42L,0L,0x35D4CC42L,0x453E6D2BL,2L,2L},{0x65F20725L,0x35D4CC42L,0x35D4CC42L,0x65F20725L,0L,0xFB0D0C1AL}}}; int64_t *l_1071 = &g_152; struct S1 ** const ***l_1081 = &g_1080; int i, j, k; for (l_1024 = 0; (l_1024 <= 0); l_1024 += 1) { /* block id: 404 */ return &g_134; } for (g_105 = 0; (g_105 <= 1); g_105 += 1) { /* block id: 409 */ (*g_20) ^= (safe_rshift_func_int64_t_s_s(((safe_mod_func_uint16_t_u_u((safe_mul_func_uint16_t_u_u(((safe_mod_func_int64_t_s_s((safe_sub_func_uint32_t_u_u(g_956.f4, ((safe_mul_func_uint16_t_u_u(0x1A87L, (safe_div_func_uint8_t_u_u((1UL && 255UL), 3UL)))) ^ (((safe_add_func_int16_t_s_s(l_1020, l_1020)) & (((*g_992) > (safe_lshift_func_uint8_t_u_u((g_760.f6 , g_494), 4))) | l_1020)) >= (**g_991))))), (-3L))) | 0L), l_1050)), g_687.f5)) <= l_1022), l_1051)); } for (g_164 = 1; (g_164 >= 0); g_164 -= 1) { /* block id: 414 */ int32_t *l_1052 = (void*)0; int32_t *l_1053 = (void*)0; int32_t *l_1054 = (void*)0; int32_t *l_1055[9][10][2] = {{{&g_730,&l_990},{(void*)0,&g_730},{(void*)0,(void*)0},{&l_987,&l_987},{&l_987,(void*)0},{(void*)0,(void*)0},{&g_730,&l_990},{&l_990,&g_730},{&g_730,&g_730},{&g_730,&g_730}},{{&l_990,&l_990},{&g_730,(void*)0},{(void*)0,(void*)0},{&l_987,&l_987},{&l_987,(void*)0},{(void*)0,&g_730},{(void*)0,&l_990},{&g_730,&g_730},{&l_987,&g_730},{&l_987,&l_761[6]}},{{&l_987,&l_761[6]},{&l_987,&l_987},{&l_761[2],(void*)0},{&l_990,&l_987},{(void*)0,&l_761[0]},{&l_761[0],&l_761[6]},{&g_730,&l_761[6]},{&l_987,&g_730},{&l_987,&l_761[5]},{&l_761[5],&g_730}},{{&l_761[0],&l_990},{(void*)0,&l_987},{&g_730,&l_987},{&l_990,&l_990},{&l_987,&l_761[6]},{&l_990,&l_990},{&g_730,&g_730},{&l_990,&l_987},{(void*)0,&l_990},{&l_761[6],&l_761[6]}},{{(void*)0,&g_730},{&l_987,&l_987},{&l_990,&l_987},{&l_987,&g_730},{(void*)0,&l_761[6]},{&l_761[6],&l_990},{(void*)0,&l_987},{&l_990,&g_730},{&g_730,&l_990},{&l_990,&l_761[6]}},{{&l_987,&l_990},{&l_990,&l_987},{&g_730,&l_987},{(void*)0,&l_990},{&l_761[0],&g_730},{&l_761[5],&l_761[5]},{&l_987,&g_730},{&l_987,&l_761[6]},{&g_730,&l_761[6]},{&l_761[0],&l_761[0]}},{{(void*)0,&l_987},{&l_990,(void*)0},{&l_761[2],&l_987},{&l_987,&l_761[6]},{&l_987,&l_761[6]},{&l_987,&g_730},{&l_987,&g_730},{&l_987,&l_761[1]},{&g_730,(void*)0},{&l_987,&l_761[2]}},{{&g_730,&g_730},{&l_990,&l_761[6]},{&g_730,(void*)0},{&l_987,&l_990},{&l_761[1],&l_987},{(void*)0,&l_987},{(void*)0,&l_987},{&l_761[1],&l_990},{&l_987,(void*)0},{&g_730,&l_761[6]}},{{&l_990,&g_730},{&g_730,&l_761[2]},{&l_987,(void*)0},{&g_730,&l_761[1]},{&l_987,&g_730},{&l_987,&g_730},{&l_987,&l_761[6]},{&l_987,&l_761[6]},{&l_987,&l_987},{&l_761[2],(void*)0}}}; uint32_t *l_1064 = (void*)0; uint32_t *l_1065 = &g_139; uint32_t *l_1066 = &l_1056[2]; int64_t *l_1067 = &l_1008; int32_t l_1068 = 0x82ED8F6FL; uint32_t *l_1072 = &g_174[0]; const int8_t ***l_1073 = &g_991; struct S1 **l_1074[5] = {&l_759,&l_759,&l_759,&l_759,&l_759}; int i, j, k; l_1061[0][1][4] = ((l_1056[2] = (-8L)) , ((safe_rshift_func_int16_t_s_s(((*g_567) = (safe_lshift_func_uint8_t_u_s(g_957.f2.f2, 5))), 8)) ^ g_164)); if ((*g_20)) break; (*l_1073) = (((*l_1072) = (((l_1017[3][6][0] &= ((safe_mul_func_uint32_t_u_u(((*l_1066) |= ((*l_1065) = g_957.f5)), 0xAECDD725L)) > ((((*l_1067) |= (&g_20 == (void*)0)) <= l_1068) | ((safe_mul_func_uint16_t_u_u(0UL, 0x2CD1L)) | ((((0xD2L >= ((void*)0 != l_1071)) != (*g_20)) ^ (*g_992)) == l_1061[0][1][4]))))) , (*p_31)) >= (*g_20))) , &g_992); l_1017[3][2][2] |= ((((g_303[(g_134 + 6)][(g_96 + 4)][g_134] = l_1056[0]) , l_1074[0]) == l_1075) && (((*l_1066) = l_1068) | (safe_unary_minus_func_int32_t_s((0x6520L | ((1L >= 0x43493BCB1BFC5C4ALL) >= ((safe_lshift_func_int32_t_s_u(((l_1081 = g_1079) == (((*l_468) = (p_31 == (void*)0)) , &g_1080)), g_21[8])) >= 3UL))))))); } } else { /* block id: 431 */ int64_t ***l_1089[7][6] = {{&l_734,&l_734,&l_734,&l_734,(void*)0,&l_734},{(void*)0,&l_734,&l_734,&l_734,(void*)0,(void*)0},{&l_734,&l_734,&l_734,&l_734,&l_734,&l_734},{&l_734,&l_734,&l_734,&l_734,&l_734,&l_734},{&l_734,&l_734,&l_734,(void*)0,&l_734,(void*)0},{&l_734,&l_734,&l_734,&l_734,&l_734,&l_734},{&l_734,(void*)0,&l_734,(void*)0,&l_734,&l_734}}; int i, j, k; (*p_31) &= (safe_div_func_int16_t_s_s(((+(g_303[g_134][(g_96 + 6)][g_96] = 0L)) <= (safe_rshift_func_int8_t_s_u(((safe_div_func_int16_t_s_s(((l_1089[6][5] = l_1089[4][4]) != (void*)0), l_1056[2])) , 1L), 2))), l_1017[7][2][0])); } } } for (g_730 = 1; (g_730 >= 0); g_730 -= 1) { /* block id: 440 */ int32_t l_1098 = 0xD245DA19L; int64_t **l_1105 = (void*)0; int64_t ***l_1106 = (void*)0; int64_t ***l_1107[9][6] = {{&l_734,&l_1105,&l_1105,&l_1105,&l_1105,&l_1105},{&l_1105,&l_734,&l_734,&l_1105,&l_1105,(void*)0},{&l_1105,(void*)0,(void*)0,(void*)0,(void*)0,&l_1105},{(void*)0,&l_1105,&l_1105,&l_734,&l_734,&l_1105},{&l_1105,&l_1105,&l_1105,&l_1105,&l_1105,&l_734},{&l_1105,&l_1105,&l_1105,&l_734,&l_1105,&l_734},{(void*)0,&l_734,&l_1105,(void*)0,&l_1105,&l_734},{&l_1105,&l_734,(void*)0,&l_1105,&l_1105,&l_1105},{&l_1105,&l_734,&l_734,&l_1105,&l_734,&l_734}}; struct S1 *l_1117 = &g_1118; uint64_t *l_1121 = &l_877[0]; uint16_t l_1122 = 0xE87AL; int32_t l_1123[7] = {0L,0L,0L,0L,0L,0L,0L}; int8_t l_1124 = (-5L); const int8_t ***l_1125 = (void*)0; int i, j; l_1098 = (safe_add_func_uint16_t_u_u((safe_lshift_func_uint64_t_u_s(((safe_lshift_func_uint16_t_u_s(((*l_468)++), l_1098)) <= (safe_mul_func_int8_t_s_s((safe_sub_func_int64_t_s_s(((safe_sub_func_int32_t_s_s(((g_1108 = l_1105) != ((l_1123[5] = ((g_517.f5 ^ ((*g_992) >= (**g_991))) != ((safe_mul_func_int8_t_s_s((safe_mul_func_int64_t_s_s((safe_mul_func_int8_t_s_s(((((*l_1121) = ((*l_770) ^= ((safe_lshift_func_uint8_t_u_s(((l_759 = (*g_685)) != (l_1119 = (l_1117 = (*g_685)))), 0)) , (((1L > (l_1098 | l_1098)) > 0xB5L) > 0x5CC73C1100079363LL)))) ^ 1UL) > l_1122), (*g_992))), l_1098)), 8UL)) , g_1120[6].f3))) , (void*)0)), (*p_31))) | (*p_31)), 3L)), l_990))), 59)), l_1124)); l_1125 = &g_991; } } g_281 = (p_31 = p_31); return p_31; } /* ------------------------------------------ */ /* * reads : g_105 g_96 g_20 g_21 g_139 * writes: g_105 g_96 */ static int64_t func_39(struct S0 p_40, const struct S0 p_41, uint16_t p_42) { /* block id: 38 */ int8_t l_190 = 0L; for (g_105 = 0; (g_105 <= 1); g_105 += 1) { /* block id: 41 */ int32_t l_179[5][3][8] = {{{2L,(-1L),0x0BB55475L,2L,1L,1L,0xEB29961DL,0L},{2L,0L,0x552D6EEAL,0x0BEA9BBDL,0xEB29961DL,(-8L),(-3L),(-3L)},{0L,5L,0L,0L,5L,0L,0x0BB55475L,0x0BEA9BBDL}},{{0xAC1E00D0L,(-1L),1L,1L,0L,0x0BB55475L,0xAC1E00D0L,3L},{5L,0xEB29961DL,0x552D6EEAL,1L,(-3L),0x552D6EEAL,2L,0x0BEA9BBDL},{3L,(-3L),(-1L),0L,0xAC1E00D0L,0L,(-1L),(-3L)}},{{0L,0x0BB55475L,3L,0x0BEA9BBDL,0L,1L,0x0BEA9BBDL,0L},{1L,0xAC1E00D0L,(-8L),2L,0L,0x552D6EEAL,0x0BEA9BBDL,0xEB29961DL},{0L,2L,3L,1L,0x73B43E12L,(-1L),(-1L),0x73B43E12L}},{{0x73B43E12L,(-1L),(-1L),0x73B43E12L,1L,3L,2L,0L},{0xEB29961DL,0x0BEA9BBDL,0x552D6EEAL,0L,2L,(-8L),0xAC1E00D0L,1L},{0L,0x0BEA9BBDL,1L,0L,0x0BEA9BBDL,3L,0x0BB55475L,0L}},{{(-3L),(-1L),0L,0xAC1E00D0L,0L,(-1L),(-3L),3L},{0x0BEA9BBDL,2L,0x552D6EEAL,(-3L),1L,0x552D6EEAL,0xEB29961DL,5L},{3L,0xAC1E00D0L,0x0BB55475L,0L,1L,1L,(-1L),0xAC1E00D0L}}}; int32_t *l_180[2]; int64_t **l_197 = &g_166; int64_t ***l_198 = &l_197; int i, j, k; for (i = 0; i < 2; i++) l_180[i] = &g_134; g_96 &= (safe_mul_func_int8_t_s_s(p_40.f3, l_179[4][2][2])); p_40.f3 = ((safe_mod_func_int32_t_s_s((safe_lshift_func_int32_t_s_s((safe_mod_func_uint16_t_u_u(((((*g_20) < (~((-9L) == ((safe_mod_func_int8_t_s_s((l_190 || (safe_mod_func_int32_t_s_s((g_96 != (g_139 , 0x36L)), (p_41.f3 && (safe_add_func_int16_t_s_s((safe_mod_func_uint64_t_u_u((&g_166 != ((*l_198) = l_197)), 0xED9F99F95BD74990LL)), l_190)))))), 0xA7L)) | p_41.f2)))) <= p_40.f3) | p_40.f3), 0xDFD4L)), p_41.f3)), p_40.f1)) >= l_190); p_40.f2 &= 1L; } return l_190; } /* ------------------------------------------ */ /* * reads : g_21 g_20 g_105 g_96 g_98 g_134 g_135 g_138 g_139 g_174 * writes: g_96 g_98 g_105 g_138 g_139 g_152 g_166 g_134 g_174 */ static int32_t func_48(int8_t p_49, int16_t p_50, int32_t * p_51, int64_t p_52, int8_t p_53) { /* block id: 3 */ struct S0 l_91 = {275,0,39,179}; uint64_t l_93 = 0xA5DE23EDE1F3C6E3LL; int32_t l_103 = 9L; int32_t l_104 = 0x27E8BA16L; uint64_t l_169 = 0x597347B2A022FCF3LL; int64_t l_173 = 0L; if ((*p_51)) { /* block id: 4 */ return (*g_20); } else { /* block id: 6 */ int16_t l_66[7][6][2] = {{{0x90F9L,0xDF50L},{(-1L),0xF50EL},{0x036BL,0x68D3L},{9L,0xEBAAL},{0L,0L},{9L,9L}},{{0xF3E8L,0x036BL},{0x114AL,(-1L)},{0x0E0EL,0x90F9L},{5L,0x0E0EL},{0x657AL,9L},{0x657AL,0x0E0EL}},{{5L,0x90F9L},{0x0E0EL,(-1L)},{0x114AL,0x036BL},{0xF3E8L,9L},{9L,0L},{8L,0xDF50L}},{{0x0E0EL,1L},{0xA42DL,1L},{0x8492L,9L},{0xF50EL,0x19E5L},{0xCEC3L,0xC22AL},{0x0E0EL,0xC22AL}},{{0xCEC3L,0x19E5L},{0xF50EL,9L},{0x8492L,1L},{0xA42DL,1L},{0x0E0EL,0xDF50L},{8L,0L}},{{9L,9L},{0xF3E8L,0x036BL},{0x114AL,(-1L)},{0x0E0EL,0x90F9L},{5L,0x0E0EL},{0x657AL,9L}},{{0x657AL,0x0E0EL},{5L,0x90F9L},{0x0E0EL,(-1L)},{0x114AL,0x036BL},{0xF3E8L,9L},{9L,0L}}}; int8_t l_92 = (-1L); int32_t l_94 = 0L; int32_t *l_95 = &g_96; uint16_t *l_97 = &g_98; int32_t *l_99 = (void*)0; int32_t *l_100 = (void*)0; int32_t *l_101[3]; int64_t l_102 = 0x3F66FFE49794E548LL; int i, j, k; for (i = 0; i < 3; i++) l_101[i] = &g_96; l_91.f2 = (((safe_mul_func_uint32_t_u_u((((g_21[7] , ((((safe_rshift_func_int8_t_s_s(((safe_div_func_uint16_t_u_u(((*l_97) = (((safe_mod_func_uint32_t_u_u((((safe_div_func_int32_t_s_s(((*l_95) = ((safe_mul_func_int64_t_s_s(p_53, (l_66[6][5][1] <= (0xAA9D242EL & (((safe_mod_func_int16_t_s_s((((((safe_div_func_uint8_t_u_u(((safe_unary_minus_func_int32_t_s(((safe_add_func_int32_t_s_s(((l_94 = ((safe_div_func_int16_t_s_s(0x408CL, (safe_mul_func_int32_t_s_s(((safe_add_func_uint8_t_u_u(p_49, (((p_51 != (void*)0) != (safe_mul_func_uint64_t_u_u(((((!(safe_mul_func_uint64_t_u_u((((safe_sub_func_int32_t_s_s((safe_mod_func_uint64_t_u_u(((((safe_mul_func_uint32_t_u_u(((((l_91 , 0x4589AA37L) >= p_53) <= 0x897E00C1L) > 0xEDL), l_66[6][5][1])) , g_21[1]) > 5UL) < 0x6827L), l_66[3][0][0])), l_92)) | 0xCF88EA9DL) > p_49), l_91.f1))) <= l_93) ^ 0xD368L) , 8UL), l_91.f0))) ^ 0xAC67L))) != 1UL), 0x38F51712L)))) & 0xEB8AB48F0B38F1CELL)) ^ 0x6BL), 0x71A37F4EL)) , l_93))) < p_50), p_50)) != p_52) >= 1UL) > 0x8B8E4845943CDA06LL) != p_50), 2L)) , p_51) != (void*)0))))) > l_93)), 0x895B12CAL)) ^ g_21[7]) && p_53), g_21[7])) | 0xCEL) , 0xDB6AL)), p_53)) || (-9L)), g_21[2])) <= 1UL) || 0xBF0D081C3794E43DLL) | 0xF33C05717136C1A4LL)) != 0x0FL) != l_91.f1), (-1L))) , 0x4B84AAFBL) , (*p_51)); g_105++; } for (p_49 = 2; (p_49 >= 24); p_49 = safe_add_func_uint64_t_u_u(p_49, 4)) { /* block id: 15 */ uint16_t *l_128 = &g_98; struct S0 l_129 = {278,0,23,-16}; int64_t l_132 = 4L; uint16_t l_133[2][2]; int64_t *l_136 = &l_132; int32_t *l_137 = &l_103; int32_t *l_172[1][3]; int i, j; for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) l_133[i][j] = 65534UL; } for (i = 0; i < 1; i++) { for (j = 0; j < 3; j++) l_172[i][j] = &l_104; } g_139 |= (!(safe_sub_func_int16_t_s_s((g_138 ^= (g_96 , (~((((safe_mul_func_int16_t_s_s((-1L), (((*l_137) = (safe_sub_func_int32_t_s_s(((safe_mul_func_int64_t_s_s(((*l_136) = ((safe_div_func_uint32_t_u_u((safe_sub_func_int64_t_s_s(((((g_96 != ((((safe_lshift_func_uint16_t_u_s(g_21[6], ((safe_mod_func_int8_t_s_s((((&g_21[3] != (void*)0) , (((*l_128) = p_53) , l_129)) , (safe_div_func_int8_t_s_s(((((p_53 & l_129.f2) <= l_132) ^ 3UL) <= 0xCDF6L), g_98))), g_21[6])) && 0x38L))) <= 0xAF0FL) || l_129.f2) ^ 255UL)) & p_53) && l_133[0][0]) <= g_134), p_49)), g_135)) ^ g_135)), l_133[0][0])) | p_52), p_52))) == l_104))) == 8UL) && 18446744073709551615UL) | p_52)))), 0x67FBL))); for (l_103 = 21; (l_103 > (-28)); --l_103) { /* block id: 23 */ int64_t *l_151 = &g_152; uint64_t *l_155 = &l_93; int64_t *l_163 = &g_164; int64_t **l_162 = &l_163; int64_t **l_165 = (void*)0; int32_t l_168 = 0x16EC97F7L; int32_t *l_170 = &g_134; int32_t *l_171 = &g_96; (*l_171) = ((((*l_136) = 0x108F3773156C3613LL) >= (safe_sub_func_int32_t_s_s((safe_lshift_func_uint16_t_u_s(((!(*l_137)) & (safe_sub_func_uint32_t_u_u((g_139 = (safe_lshift_func_int64_t_s_s(((*l_151) = g_138), 3))), (safe_mul_func_uint64_t_u_u(((*l_155) = 0x4F454AEDB1328F77LL), ((p_52 > ((*l_170) |= (((((safe_lshift_func_int64_t_s_s((safe_add_func_uint16_t_u_u(((safe_mul_func_uint32_t_u_u((l_91.f3 = (((*l_162) = &p_52) != (g_166 = &p_52))), ((+l_104) , l_91.f2))) >= l_91.f1), (-10L))), p_53)) & l_168) > l_169) , p_49) ^ g_138))) | p_53)))))), p_52)), 0x50DC5A68L))) && 65535UL); return (*g_20); } --g_174[0]; } return (*p_51); } /* ---------------------------------------- */ int main (int argc, char* argv[]) { int i, j, k; int print_hash_value = 0; if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1; platform_main_begin(); crc32_gentab(); func_1(); for (i = 0; i < 2; i++) { transparent_crc(g_19[i], "g_19[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } for (i = 0; i < 10; i++) { transparent_crc(g_21[i], "g_21[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_96, "g_96", print_hash_value); transparent_crc(g_98, "g_98", print_hash_value); transparent_crc(g_105, "g_105", print_hash_value); transparent_crc(g_134, "g_134", print_hash_value); transparent_crc(g_135, "g_135", print_hash_value); transparent_crc(g_138, "g_138", print_hash_value); transparent_crc(g_139, "g_139", print_hash_value); transparent_crc(g_152, "g_152", print_hash_value); transparent_crc(g_164, "g_164", print_hash_value); for (i = 0; i < 2; i++) { transparent_crc(g_174[i], "g_174[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_200, "g_200", print_hash_value); transparent_crc(g_203, "g_203", print_hash_value); transparent_crc(g_275, "g_275", print_hash_value); transparent_crc(g_301, "g_301", print_hash_value); for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { for (k = 0; k < 2; k++) { transparent_crc(g_303[i][j][k], "g_303[i][j][k]", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_328, "g_328", print_hash_value); transparent_crc(g_364, "g_364", print_hash_value); transparent_crc(g_366.f0, "g_366.f0", print_hash_value); transparent_crc(g_366.f1, "g_366.f1", print_hash_value); transparent_crc(g_366.f2.f0, "g_366.f2.f0", print_hash_value); transparent_crc(g_366.f2.f1, "g_366.f2.f1", print_hash_value); transparent_crc(g_366.f2.f2, "g_366.f2.f2", print_hash_value); transparent_crc(g_366.f2.f3, "g_366.f2.f3", print_hash_value); transparent_crc(g_366.f3, "g_366.f3", print_hash_value); transparent_crc(g_366.f4, "g_366.f4", print_hash_value); transparent_crc(g_366.f5, "g_366.f5", print_hash_value); transparent_crc(g_366.f6, "g_366.f6", print_hash_value); transparent_crc(g_449, "g_449", print_hash_value); transparent_crc(g_460, "g_460", print_hash_value); transparent_crc(g_494, "g_494", print_hash_value); transparent_crc(g_517.f0, "g_517.f0", print_hash_value); transparent_crc(g_517.f1, "g_517.f1", print_hash_value); transparent_crc(g_517.f2.f0, "g_517.f2.f0", print_hash_value); transparent_crc(g_517.f2.f1, "g_517.f2.f1", print_hash_value); transparent_crc(g_517.f2.f2, "g_517.f2.f2", print_hash_value); transparent_crc(g_517.f2.f3, "g_517.f2.f3", print_hash_value); transparent_crc(g_517.f3, "g_517.f3", print_hash_value); transparent_crc(g_517.f4, "g_517.f4", print_hash_value); transparent_crc(g_517.f5, "g_517.f5", print_hash_value); transparent_crc(g_517.f6, "g_517.f6", print_hash_value); transparent_crc(g_538, "g_538", print_hash_value); transparent_crc(g_539, "g_539", print_hash_value); transparent_crc(g_554, "g_554", print_hash_value); transparent_crc(g_687.f0, "g_687.f0", print_hash_value); transparent_crc(g_687.f1, "g_687.f1", print_hash_value); transparent_crc(g_687.f2.f0, "g_687.f2.f0", print_hash_value); transparent_crc(g_687.f2.f1, "g_687.f2.f1", print_hash_value); transparent_crc(g_687.f2.f2, "g_687.f2.f2", print_hash_value); transparent_crc(g_687.f2.f3, "g_687.f2.f3", print_hash_value); transparent_crc(g_687.f3, "g_687.f3", print_hash_value); transparent_crc(g_687.f4, "g_687.f4", print_hash_value); transparent_crc(g_687.f5, "g_687.f5", print_hash_value); transparent_crc(g_687.f6, "g_687.f6", print_hash_value); transparent_crc(g_695, "g_695", print_hash_value); transparent_crc(g_722, "g_722", print_hash_value); transparent_crc(g_730, "g_730", print_hash_value); transparent_crc(g_760.f0, "g_760.f0", print_hash_value); transparent_crc(g_760.f1, "g_760.f1", print_hash_value); transparent_crc(g_760.f2.f0, "g_760.f2.f0", print_hash_value); transparent_crc(g_760.f2.f1, "g_760.f2.f1", print_hash_value); transparent_crc(g_760.f2.f2, "g_760.f2.f2", print_hash_value); transparent_crc(g_760.f2.f3, "g_760.f2.f3", print_hash_value); transparent_crc(g_760.f3, "g_760.f3", print_hash_value); transparent_crc(g_760.f4, "g_760.f4", print_hash_value); transparent_crc(g_760.f5, "g_760.f5", print_hash_value); transparent_crc(g_760.f6, "g_760.f6", print_hash_value); transparent_crc(g_956.f0, "g_956.f0", print_hash_value); transparent_crc(g_956.f1, "g_956.f1", print_hash_value); transparent_crc(g_956.f2.f0, "g_956.f2.f0", print_hash_value); transparent_crc(g_956.f2.f1, "g_956.f2.f1", print_hash_value); transparent_crc(g_956.f2.f2, "g_956.f2.f2", print_hash_value); transparent_crc(g_956.f2.f3, "g_956.f2.f3", print_hash_value); transparent_crc(g_956.f3, "g_956.f3", print_hash_value); transparent_crc(g_956.f4, "g_956.f4", print_hash_value); transparent_crc(g_956.f5, "g_956.f5", print_hash_value); transparent_crc(g_956.f6, "g_956.f6", print_hash_value); transparent_crc(g_957.f0, "g_957.f0", print_hash_value); transparent_crc(g_957.f1, "g_957.f1", print_hash_value); transparent_crc(g_957.f2.f0, "g_957.f2.f0", print_hash_value); transparent_crc(g_957.f2.f1, "g_957.f2.f1", print_hash_value); transparent_crc(g_957.f2.f2, "g_957.f2.f2", print_hash_value); transparent_crc(g_957.f2.f3, "g_957.f2.f3", print_hash_value); transparent_crc(g_957.f3, "g_957.f3", print_hash_value); transparent_crc(g_957.f4, "g_957.f4", print_hash_value); transparent_crc(g_957.f5, "g_957.f5", print_hash_value); transparent_crc(g_957.f6, "g_957.f6", print_hash_value); transparent_crc(g_1013, "g_1013", print_hash_value); transparent_crc(g_1118.f0, "g_1118.f0", print_hash_value); transparent_crc(g_1118.f1, "g_1118.f1", print_hash_value); transparent_crc(g_1118.f2.f0, "g_1118.f2.f0", print_hash_value); transparent_crc(g_1118.f2.f1, "g_1118.f2.f1", print_hash_value); transparent_crc(g_1118.f2.f2, "g_1118.f2.f2", print_hash_value); transparent_crc(g_1118.f2.f3, "g_1118.f2.f3", print_hash_value); transparent_crc(g_1118.f3, "g_1118.f3", print_hash_value); transparent_crc(g_1118.f4, "g_1118.f4", print_hash_value); transparent_crc(g_1118.f5, "g_1118.f5", print_hash_value); transparent_crc(g_1118.f6, "g_1118.f6", print_hash_value); for (i = 0; i < 8; i++) { transparent_crc(g_1120[i].f0, "g_1120[i].f0", print_hash_value); transparent_crc(g_1120[i].f1, "g_1120[i].f1", print_hash_value); transparent_crc(g_1120[i].f2.f0, "g_1120[i].f2.f0", print_hash_value); transparent_crc(g_1120[i].f2.f1, "g_1120[i].f2.f1", print_hash_value); transparent_crc(g_1120[i].f2.f2, "g_1120[i].f2.f2", print_hash_value); transparent_crc(g_1120[i].f2.f3, "g_1120[i].f2.f3", print_hash_value); transparent_crc(g_1120[i].f3, "g_1120[i].f3", print_hash_value); transparent_crc(g_1120[i].f4, "g_1120[i].f4", print_hash_value); transparent_crc(g_1120[i].f5, "g_1120[i].f5", print_hash_value); transparent_crc(g_1120[i].f6, "g_1120[i].f6", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_1184.f0, "g_1184.f0", print_hash_value); transparent_crc(g_1184.f1, "g_1184.f1", print_hash_value); transparent_crc(g_1184.f2.f0, "g_1184.f2.f0", print_hash_value); transparent_crc(g_1184.f2.f1, "g_1184.f2.f1", print_hash_value); transparent_crc(g_1184.f2.f2, "g_1184.f2.f2", print_hash_value); transparent_crc(g_1184.f2.f3, "g_1184.f2.f3", print_hash_value); transparent_crc(g_1184.f3, "g_1184.f3", print_hash_value); transparent_crc(g_1184.f4, "g_1184.f4", print_hash_value); transparent_crc(g_1184.f5, "g_1184.f5", print_hash_value); transparent_crc(g_1184.f6, "g_1184.f6", print_hash_value); for (i = 0; i < 7; i++) { for (j = 0; j < 8; j++) { transparent_crc(g_1185[i][j].f0, "g_1185[i][j].f0", print_hash_value); transparent_crc(g_1185[i][j].f1, "g_1185[i][j].f1", print_hash_value); transparent_crc(g_1185[i][j].f2.f0, "g_1185[i][j].f2.f0", print_hash_value); transparent_crc(g_1185[i][j].f2.f1, "g_1185[i][j].f2.f1", print_hash_value); transparent_crc(g_1185[i][j].f2.f2, "g_1185[i][j].f2.f2", print_hash_value); transparent_crc(g_1185[i][j].f2.f3, "g_1185[i][j].f2.f3", print_hash_value); transparent_crc(g_1185[i][j].f3, "g_1185[i][j].f3", print_hash_value); transparent_crc(g_1185[i][j].f4, "g_1185[i][j].f4", print_hash_value); transparent_crc(g_1185[i][j].f5, "g_1185[i][j].f5", print_hash_value); transparent_crc(g_1185[i][j].f6, "g_1185[i][j].f6", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_1186.f0, "g_1186.f0", print_hash_value); transparent_crc(g_1186.f1, "g_1186.f1", print_hash_value); transparent_crc(g_1186.f2.f0, "g_1186.f2.f0", print_hash_value); transparent_crc(g_1186.f2.f1, "g_1186.f2.f1", print_hash_value); transparent_crc(g_1186.f2.f2, "g_1186.f2.f2", print_hash_value); transparent_crc(g_1186.f2.f3, "g_1186.f2.f3", print_hash_value); transparent_crc(g_1186.f3, "g_1186.f3", print_hash_value); transparent_crc(g_1186.f4, "g_1186.f4", print_hash_value); transparent_crc(g_1186.f5, "g_1186.f5", print_hash_value); transparent_crc(g_1186.f6, "g_1186.f6", print_hash_value); transparent_crc(g_1356, "g_1356", print_hash_value); for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) { for (k = 0; k < 6; k++) { transparent_crc(g_1365[i][j][k].f0, "g_1365[i][j][k].f0", print_hash_value); transparent_crc(g_1365[i][j][k].f1, "g_1365[i][j][k].f1", print_hash_value); transparent_crc(g_1365[i][j][k].f2, "g_1365[i][j][k].f2", print_hash_value); transparent_crc(g_1365[i][j][k].f3, "g_1365[i][j][k].f3", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_1407.f0, "g_1407.f0", print_hash_value); transparent_crc(g_1407.f1, "g_1407.f1", print_hash_value); transparent_crc(g_1407.f2.f0, "g_1407.f2.f0", print_hash_value); transparent_crc(g_1407.f2.f1, "g_1407.f2.f1", print_hash_value); transparent_crc(g_1407.f2.f2, "g_1407.f2.f2", print_hash_value); transparent_crc(g_1407.f2.f3, "g_1407.f2.f3", print_hash_value); transparent_crc(g_1407.f3, "g_1407.f3", print_hash_value); transparent_crc(g_1407.f4, "g_1407.f4", print_hash_value); transparent_crc(g_1407.f5, "g_1407.f5", print_hash_value); transparent_crc(g_1407.f6, "g_1407.f6", print_hash_value); transparent_crc(g_1494, "g_1494", print_hash_value); for (i = 0; i < 3; i++) { transparent_crc(g_1600[i].f0, "g_1600[i].f0", print_hash_value); transparent_crc(g_1600[i].f1, "g_1600[i].f1", print_hash_value); transparent_crc(g_1600[i].f2.f0, "g_1600[i].f2.f0", print_hash_value); transparent_crc(g_1600[i].f2.f1, "g_1600[i].f2.f1", print_hash_value); transparent_crc(g_1600[i].f2.f2, "g_1600[i].f2.f2", print_hash_value); transparent_crc(g_1600[i].f2.f3, "g_1600[i].f2.f3", print_hash_value); transparent_crc(g_1600[i].f3, "g_1600[i].f3", print_hash_value); transparent_crc(g_1600[i].f4, "g_1600[i].f4", print_hash_value); transparent_crc(g_1600[i].f5, "g_1600[i].f5", print_hash_value); transparent_crc(g_1600[i].f6, "g_1600[i].f6", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_1603, "g_1603", print_hash_value); transparent_crc(g_1621, "g_1621", print_hash_value); transparent_crc(g_1676, "g_1676", print_hash_value); transparent_crc(g_1781.f0, "g_1781.f0", print_hash_value); transparent_crc(g_1781.f1, "g_1781.f1", print_hash_value); transparent_crc(g_1781.f2.f0, "g_1781.f2.f0", print_hash_value); transparent_crc(g_1781.f2.f1, "g_1781.f2.f1", print_hash_value); transparent_crc(g_1781.f2.f2, "g_1781.f2.f2", print_hash_value); transparent_crc(g_1781.f2.f3, "g_1781.f2.f3", print_hash_value); transparent_crc(g_1781.f3, "g_1781.f3", print_hash_value); transparent_crc(g_1781.f4, "g_1781.f4", print_hash_value); transparent_crc(g_1781.f5, "g_1781.f5", print_hash_value); transparent_crc(g_1781.f6, "g_1781.f6", print_hash_value); transparent_crc(g_1854, "g_1854", print_hash_value); transparent_crc(g_1896.f0, "g_1896.f0", print_hash_value); transparent_crc(g_1896.f1, "g_1896.f1", print_hash_value); transparent_crc(g_1896.f2.f0, "g_1896.f2.f0", print_hash_value); transparent_crc(g_1896.f2.f1, "g_1896.f2.f1", print_hash_value); transparent_crc(g_1896.f2.f2, "g_1896.f2.f2", print_hash_value); transparent_crc(g_1896.f2.f3, "g_1896.f2.f3", print_hash_value); transparent_crc(g_1896.f3, "g_1896.f3", print_hash_value); transparent_crc(g_1896.f4, "g_1896.f4", print_hash_value); transparent_crc(g_1896.f5, "g_1896.f5", print_hash_value); transparent_crc(g_1896.f6, "g_1896.f6", print_hash_value); transparent_crc(g_1919, "g_1919", print_hash_value); for (i = 0; i < 7; i++) { transparent_crc(g_1944[i], "g_1944[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2138.f0, "g_2138.f0", print_hash_value); transparent_crc(g_2138.f1, "g_2138.f1", print_hash_value); transparent_crc(g_2138.f2.f0, "g_2138.f2.f0", print_hash_value); transparent_crc(g_2138.f2.f1, "g_2138.f2.f1", print_hash_value); transparent_crc(g_2138.f2.f2, "g_2138.f2.f2", print_hash_value); transparent_crc(g_2138.f2.f3, "g_2138.f2.f3", print_hash_value); transparent_crc(g_2138.f3, "g_2138.f3", print_hash_value); transparent_crc(g_2138.f4, "g_2138.f4", print_hash_value); transparent_crc(g_2138.f5, "g_2138.f5", print_hash_value); transparent_crc(g_2138.f6, "g_2138.f6", print_hash_value); for (i = 0; i < 10; i++) { for (j = 0; j < 2; j++) { for (k = 0; k < 4; k++) { transparent_crc(g_2141[i][j][k], "g_2141[i][j][k]", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_2201.f0, "g_2201.f0", print_hash_value); transparent_crc(g_2201.f1, "g_2201.f1", print_hash_value); transparent_crc(g_2201.f2.f0, "g_2201.f2.f0", print_hash_value); transparent_crc(g_2201.f2.f1, "g_2201.f2.f1", print_hash_value); transparent_crc(g_2201.f2.f2, "g_2201.f2.f2", print_hash_value); transparent_crc(g_2201.f2.f3, "g_2201.f2.f3", print_hash_value); transparent_crc(g_2201.f3, "g_2201.f3", print_hash_value); transparent_crc(g_2201.f4, "g_2201.f4", print_hash_value); transparent_crc(g_2201.f5, "g_2201.f5", print_hash_value); transparent_crc(g_2201.f6, "g_2201.f6", print_hash_value); transparent_crc(g_2211, "g_2211", print_hash_value); transparent_crc(g_2428.f0, "g_2428.f0", print_hash_value); transparent_crc(g_2428.f1, "g_2428.f1", print_hash_value); transparent_crc(g_2428.f2.f0, "g_2428.f2.f0", print_hash_value); transparent_crc(g_2428.f2.f1, "g_2428.f2.f1", print_hash_value); transparent_crc(g_2428.f2.f2, "g_2428.f2.f2", print_hash_value); transparent_crc(g_2428.f2.f3, "g_2428.f2.f3", print_hash_value); transparent_crc(g_2428.f3, "g_2428.f3", print_hash_value); transparent_crc(g_2428.f4, "g_2428.f4", print_hash_value); transparent_crc(g_2428.f5, "g_2428.f5", print_hash_value); transparent_crc(g_2428.f6, "g_2428.f6", print_hash_value); for (i = 0; i < 10; i++) { transparent_crc(g_2790[i], "g_2790[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2794, "g_2794", print_hash_value); for (i = 0; i < 7; i++) { for (j = 0; j < 10; j++) { transparent_crc(g_2817[i][j].f0, "g_2817[i][j].f0", print_hash_value); transparent_crc(g_2817[i][j].f1, "g_2817[i][j].f1", print_hash_value); transparent_crc(g_2817[i][j].f2.f0, "g_2817[i][j].f2.f0", print_hash_value); transparent_crc(g_2817[i][j].f2.f1, "g_2817[i][j].f2.f1", print_hash_value); transparent_crc(g_2817[i][j].f2.f2, "g_2817[i][j].f2.f2", print_hash_value); transparent_crc(g_2817[i][j].f2.f3, "g_2817[i][j].f2.f3", print_hash_value); transparent_crc(g_2817[i][j].f3, "g_2817[i][j].f3", print_hash_value); transparent_crc(g_2817[i][j].f4, "g_2817[i][j].f4", print_hash_value); transparent_crc(g_2817[i][j].f5, "g_2817[i][j].f5", print_hash_value); transparent_crc(g_2817[i][j].f6, "g_2817[i][j].f6", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_2868, "g_2868", print_hash_value); transparent_crc(g_2885, "g_2885", print_hash_value); platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); return 0; } /************************ statistics ************************* XXX max struct depth: 2 breakdown: depth: 0, occurrence: 673 depth: 1, occurrence: 19 depth: 2, occurrence: 4 XXX total union variables: 0 XXX non-zero bitfields defined in structs: 11 XXX zero bitfields defined in structs: 1 XXX const bitfields defined in structs: 2 XXX volatile bitfields defined in structs: 1 XXX structs with bitfields in the program: 85 breakdown: indirect level: 0, occurrence: 23 indirect level: 1, occurrence: 23 indirect level: 2, occurrence: 9 indirect level: 3, occurrence: 10 indirect level: 4, occurrence: 7 indirect level: 5, occurrence: 13 XXX full-bitfields structs in the program: 19 breakdown: indirect level: 0, occurrence: 19 XXX times a bitfields struct's address is taken: 43 XXX times a bitfields struct on LHS: 0 XXX times a bitfields struct on RHS: 36 XXX times a single bitfield on LHS: 18 XXX times a single bitfield on RHS: 181 XXX max expression depth: 63 breakdown: depth: 1, occurrence: 271 depth: 2, occurrence: 78 depth: 3, occurrence: 5 depth: 4, occurrence: 3 depth: 5, occurrence: 4 depth: 6, occurrence: 1 depth: 7, occurrence: 3 depth: 9, occurrence: 2 depth: 14, occurrence: 2 depth: 15, occurrence: 2 depth: 17, occurrence: 4 depth: 18, occurrence: 3 depth: 19, occurrence: 4 depth: 20, occurrence: 4 depth: 21, occurrence: 5 depth: 22, occurrence: 2 depth: 24, occurrence: 1 depth: 25, occurrence: 8 depth: 26, occurrence: 4 depth: 28, occurrence: 2 depth: 29, occurrence: 3 depth: 30, occurrence: 5 depth: 33, occurrence: 1 depth: 34, occurrence: 1 depth: 35, occurrence: 2 depth: 37, occurrence: 1 depth: 63, occurrence: 1 XXX total number of pointers: 687 XXX times a variable address is taken: 1804 XXX times a pointer is dereferenced on RHS: 292 breakdown: depth: 1, occurrence: 259 depth: 2, occurrence: 26 depth: 3, occurrence: 7 XXX times a pointer is dereferenced on LHS: 345 breakdown: depth: 1, occurrence: 328 depth: 2, occurrence: 12 depth: 3, occurrence: 1 depth: 4, occurrence: 4 XXX times a pointer is compared with null: 42 XXX times a pointer is compared with address of another variable: 16 XXX times a pointer is compared with another pointer: 23 XXX times a pointer is qualified to be dereferenced: 9828 XXX max dereference level: 5 breakdown: level: 0, occurrence: 0 level: 1, occurrence: 1611 level: 2, occurrence: 169 level: 3, occurrence: 112 level: 4, occurrence: 21 level: 5, occurrence: 5 XXX number of pointers point to pointers: 276 XXX number of pointers point to scalars: 385 XXX number of pointers point to structs: 26 XXX percent of pointers has null in alias set: 27.9 XXX average alias set size: 1.52 XXX times a non-volatile is read: 2121 XXX times a non-volatile is write: 1101 XXX times a volatile is read: 29 XXX times read thru a pointer: 16 XXX times a volatile is write: 20 XXX times written thru a pointer: 12 XXX times a volatile is available for access: 2e+03 XXX percentage of non-volatile access: 98.5 XXX forward jumps: 1 XXX backward jumps: 10 XXX stmts: 283 XXX max block depth: 5 breakdown: depth: 0, occurrence: 32 depth: 1, occurrence: 30 depth: 2, occurrence: 51 depth: 3, occurrence: 43 depth: 4, occurrence: 71 depth: 5, occurrence: 56 XXX percentage a fresh-made variable is used: 17.1 XXX percentage an existing variable is used: 82.9 FYI: the random generator makes assumptions about the integer size. See platform.info for more details. XXX total OOB instances added: 0 ********************* end of statistics **********************/ chibicc-1.0.24/test/csmith_275.c000066400000000000000000010555261517770275000162220ustar00rootroot00000000000000/* * This is a RANDOMLY GENERATED PROGRAM. * * Generator: csmith 2.4.0 * Git version: 0cdc710 * Options: --seed 27522 * Seed: 27522 */ #include "csmith.h" static long __undefined; /* --- Struct/Union Declarations --- */ #pragma pack(push) #pragma pack(1) struct S0 { const int32_t f0; uint16_t f1; uint32_t f2; int16_t f3; volatile uint8_t f4; int8_t f5; }; #pragma pack(pop) struct S1 { struct S0 f0; const int32_t f1; volatile signed f2 : 31; const volatile uint8_t f3; int64_t f4; const int32_t f5; uint32_t f6; unsigned : 0; uint32_t f7; const int16_t f8; }; union U2 { const int64_t f0; const volatile int16_t f1; uint16_t f2; const volatile struct S0 f3; struct S0 f4; }; /* --- GLOBAL VARIABLES --- */ static uint32_t g_26 = 4294967295UL; static uint32_t g_37 = 3UL; static uint32_t *g_36 = &g_37; static int32_t g_42 = 0xE7C0CE69L; static struct S0 g_43[5] = {{0x7092FF82L,0x44F8L,1UL,0x5555L,0x5DL,0x5BL},{0x7092FF82L,0x44F8L,1UL,0x5555L,0x5DL,0x5BL},{0x7092FF82L,0x44F8L,1UL,0x5555L,0x5DL,0x5BL},{0x7092FF82L,0x44F8L,1UL,0x5555L,0x5DL,0x5BL},{0x7092FF82L,0x44F8L,1UL,0x5555L,0x5DL,0x5BL}}; static struct S1 g_72 = {{0x6BEC1606L,0x8021L,0x3632CBEBL,-6L,0x58L,0x19L},1L,17750,0x53L,0xDCE3FF50EDC67586LL,1L,18446744073709551615UL,0x358D0DD0L,0x1FB7L};/* VOLATILE GLOBAL g_72 */ static uint8_t g_94[7] = {1UL,1UL,1UL,1UL,1UL,1UL,1UL}; static uint32_t g_96 = 0UL; static const int32_t *g_114 = (void*)0; static const int32_t **g_113 = &g_114; static uint32_t g_130 = 0x78AB42ECL; static volatile uint32_t g_131 = 0x772E7DE2L;/* VOLATILE GLOBAL g_131 */ static volatile union U2 g_146 = {0xA65F88FA86218FE4LL};/* VOLATILE GLOBAL g_146 */ static int32_t * volatile g_154 = (void*)0;/* VOLATILE GLOBAL g_154 */ static int64_t g_182[2] = {0x721F5EDDB6F6008FLL,0x721F5EDDB6F6008FLL}; static int32_t g_193 = 0xA9511BF2L; static volatile uint32_t g_195[8][4][3] = {{{4UL,0x4867E0CCL,0UL},{0x9D964FF4L,0x7D72C648L,0UL},{5UL,0x4867E0CCL,0x5D3BFB39L},{0UL,0x7D72C648L,3UL}},{{4UL,0x4867E0CCL,0x4867E0CCL},{0x70A894EAL,0x7D72C648L,0xD3AA45CEL},{4UL,0x4867E0CCL,0UL},{0x9D964FF4L,0x7D72C648L,0UL}},{{5UL,0x4867E0CCL,0x5D3BFB39L},{0UL,0x7D72C648L,3UL},{4UL,0x4867E0CCL,0UL},{3UL,18446744073709551612UL,0xE0D2957CL}},{{0x5D3BFB39L,0UL,0x2FEEB18FL},{0UL,18446744073709551612UL,0x0FAE57F4L},{0UL,0UL,3UL},{0xD3AA45CEL,18446744073709551612UL,0x7FBC6E32L}},{{0x4867E0CCL,0UL,0UL},{3UL,18446744073709551612UL,0xE0D2957CL},{0x5D3BFB39L,0UL,0x2FEEB18FL},{0UL,18446744073709551612UL,0x0FAE57F4L}},{{0UL,0UL,3UL},{0xD3AA45CEL,18446744073709551612UL,0x7FBC6E32L},{0x4867E0CCL,0UL,0UL},{3UL,18446744073709551612UL,0xE0D2957CL}},{{0x5D3BFB39L,0UL,0x2FEEB18FL},{0UL,18446744073709551612UL,0x0FAE57F4L},{0UL,0UL,3UL},{0xD3AA45CEL,18446744073709551612UL,0x7FBC6E32L}},{{0x4867E0CCL,0UL,0UL},{3UL,18446744073709551612UL,0xE0D2957CL},{0x5D3BFB39L,0UL,0x2FEEB18FL},{0UL,18446744073709551612UL,0x0FAE57F4L}}}; static const volatile struct S0 g_198 = {6L,0x4FCCL,18446744073709551614UL,-4L,0x81L,-3L};/* VOLATILE GLOBAL g_198 */ static volatile union U2 g_207 = {1L};/* VOLATILE GLOBAL g_207 */ static struct S0 g_212[7][5][2] = {{{{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}},{{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL},{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L}},{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL}},{{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}},{{-1L,65535UL,1UL,-1L,0UL,0x01L},{-1L,65535UL,1UL,-1L,0UL,0x01L}}},{{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{-1L,65535UL,1UL,-1L,0UL,0x01L}},{{-1L,65535UL,1UL,-1L,0UL,0x01L},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}},{{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L},{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL}},{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L}},{{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}}},{{{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL},{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L}},{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL}},{{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}},{{-1L,65535UL,1UL,-1L,0UL,0x01L},{-1L,65535UL,1UL,-1L,0UL,0x01L}},{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{-1L,65535UL,1UL,-1L,0UL,0x01L}}},{{{-1L,65535UL,1UL,-1L,0UL,0x01L},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}},{{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L},{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL}},{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L}},{{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}},{{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL},{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L}}},{{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL}},{{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}},{{-1L,65535UL,1UL,-1L,0UL,0x01L},{-1L,65535UL,1UL,-1L,0UL,0x01L}},{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{-1L,65535UL,1UL,-1L,0UL,0x01L}},{{-1L,65535UL,1UL,-1L,0UL,0x01L},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}}},{{{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L},{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL}},{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L}},{{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}},{{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL},{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L}},{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL}}},{{{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}},{{-1L,65535UL,1UL,-1L,0UL,0x01L},{-1L,65535UL,1UL,-1L,0UL,0x01L}},{{0x65AAC15AL,0xFE8DL,1UL,0L,0UL,0x80L},{-1L,65535UL,1UL,-1L,0UL,0x01L}},{{-1L,65535UL,1UL,-1L,0UL,0x01L},{0xD60E2042L,0xDFF6L,8UL,-7L,0x77L,3L}},{{0x266F9F2EL,65535UL,0x79F91161L,0xCA19L,0x07L,-8L},{0L,0x408CL,1UL,0x7165L,0x53L,0x0FL}}}}; static volatile uint32_t g_218 = 4294967295UL;/* VOLATILE GLOBAL g_218 */ static volatile int64_t g_238 = 0L;/* VOLATILE GLOBAL g_238 */ static volatile int64_t *g_237 = &g_238; static volatile int64_t * volatile * const g_236 = &g_237; static uint64_t g_263 = 0x5E86CD116E7FB2DBLL; static union U2 g_265 = {0xA0112709D279E949LL};/* VOLATILE GLOBAL g_265 */ static int32_t * volatile g_268 = (void*)0;/* VOLATILE GLOBAL g_268 */ static int32_t * volatile g_269 = &g_193;/* VOLATILE GLOBAL g_269 */ static int32_t g_273 = 0xDCAA2655L; static int32_t g_315 = (-1L); static volatile int16_t g_317[8] = {0xE3A1L,0xE3A1L,0xE3A1L,0xE3A1L,0xE3A1L,0xE3A1L,0xE3A1L,0xE3A1L}; static volatile uint8_t g_320 = 0x4FL;/* VOLATILE GLOBAL g_320 */ static struct S0 *g_328 = &g_72.f0; static struct S0 ** volatile g_327 = &g_328;/* VOLATILE GLOBAL g_327 */ static int32_t * volatile g_362[9][9] = {{&g_273,&g_193,&g_273,&g_193,&g_273,&g_42,&g_42,&g_273,&g_193},{&g_273,&g_273,&g_273,(void*)0,&g_42,&g_42,(void*)0,&g_273,&g_273},{&g_193,&g_315,&g_42,&g_273,&g_273,&g_42,&g_315,&g_193,&g_315},{&g_42,&g_42,(void*)0,(void*)0,&g_42,&g_42,&g_42,&g_42,&g_42},{&g_193,&g_315,&g_315,&g_193,&g_193,&g_273,&g_193,&g_193,&g_315},{&g_273,&g_273,&g_42,&g_42,&g_42,(void*)0,&g_273,&g_193,&g_193},{&g_273,&g_315,&g_193,&g_42,&g_193,&g_315,&g_273,&g_273,&g_315},{(void*)0,&g_273,&g_273,&g_273,(void*)0,&g_42,&g_42,(void*)0,&g_273},{&g_273,&g_193,&g_273,&g_273,&g_193,&g_193,&g_273,&g_273,&g_193}}; static int32_t * volatile g_363 = (void*)0;/* VOLATILE GLOBAL g_363 */ static union U2 g_380 = {0x363E014B91443F57LL};/* VOLATILE GLOBAL g_380 */ static int16_t *g_396 = (void*)0; static int16_t *g_397[3][6][9] = {{{&g_212[1][4][1].f3,&g_43[4].f3,&g_212[1][4][1].f3,(void*)0,&g_72.f0.f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_212[1][4][1].f3,(void*)0},{&g_212[1][4][1].f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_43[4].f3,&g_43[4].f3,&g_43[4].f3,&g_43[4].f3,&g_43[4].f3},{&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,(void*)0,&g_72.f0.f3,&g_43[4].f3,&g_72.f0.f3,&g_43[4].f3},{&g_72.f0.f3,&g_43[4].f3,&g_43[4].f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_72.f0.f3,&g_43[4].f3,&g_212[1][4][1].f3},{&g_72.f0.f3,&g_212[1][4][1].f3,&g_43[4].f3,(void*)0,(void*)0,&g_72.f0.f3,(void*)0,(void*)0,&g_43[4].f3},{&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_72.f0.f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_72.f0.f3}},{{&g_72.f0.f3,&g_72.f0.f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_72.f0.f3,&g_212[1][4][1].f3,&g_72.f0.f3,&g_72.f0.f3,&g_212[1][4][1].f3},{&g_72.f0.f3,&g_72.f0.f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_72.f0.f3,&g_72.f0.f3},{&g_43[4].f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_43[4].f3,&g_43[4].f3,(void*)0,&g_212[1][4][1].f3,&g_43[4].f3,&g_72.f0.f3},{&g_43[4].f3,&g_43[4].f3,&g_43[4].f3,(void*)0,&g_43[4].f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_72.f0.f3,&g_72.f0.f3},{&g_43[4].f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_72.f0.f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_72.f0.f3},{&g_72.f0.f3,&g_72.f0.f3,&g_212[1][4][1].f3,&g_72.f0.f3,&g_43[4].f3,&g_43[4].f3,&g_72.f0.f3,&g_43[4].f3,&g_43[4].f3}},{{&g_72.f0.f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_43[4].f3},{&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_72.f0.f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_72.f0.f3,&g_72.f0.f3},{&g_72.f0.f3,&g_43[4].f3,(void*)0,(void*)0,&g_72.f0.f3,&g_72.f0.f3,&g_212[1][4][1].f3,&g_43[4].f3,(void*)0},{&g_72.f0.f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_43[4].f3,&g_72.f0.f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,&g_72.f0.f3,&g_43[4].f3},{&g_212[1][4][1].f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_72.f0.f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_43[4].f3,&g_72.f0.f3,&g_212[1][4][1].f3},{&g_212[1][4][1].f3,&g_43[4].f3,&g_43[4].f3,&g_212[1][4][1].f3,&g_43[4].f3,&g_72.f0.f3,&g_212[1][4][1].f3,&g_212[1][4][1].f3,(void*)0}}}; static volatile int8_t g_409[5][5] = {{0x66L,0x66L,0x66L,0x66L,0x66L},{0x88L,0x88L,0x88L,0x88L,0x88L},{0x66L,0x66L,0x66L,0x66L,0x66L},{0x88L,0x88L,0x88L,0x88L,0x88L},{0x66L,0x66L,0x66L,0x66L,0x66L}}; static volatile int8_t * volatile g_408[4] = {&g_409[4][0],&g_409[4][0],&g_409[4][0],&g_409[4][0]}; static struct S1 g_425 = {{5L,0xAD7CL,0x3711B4DEL,-1L,0x8BL,0x53L},0x400E5A47L,16039,255UL,0L,-1L,18446744073709551606UL,0xE34D3533L,0xD40BL};/* VOLATILE GLOBAL g_425 */ static int32_t *g_446[6] = {&g_315,&g_315,&g_315,&g_315,&g_315,&g_315}; static int32_t **g_445 = &g_446[4]; static int32_t ***g_444[6] = {&g_445,&g_445,&g_445,&g_445,&g_445,&g_445}; static const struct S1 *g_448[7] = {&g_72,&g_72,&g_425,&g_72,&g_72,&g_425,&g_72}; static const struct S1 ** volatile g_449 = (void*)0;/* VOLATILE GLOBAL g_449 */ static const struct S1 ** volatile g_450 = (void*)0;/* VOLATILE GLOBAL g_450 */ static union U2 g_506 = {1L};/* VOLATILE GLOBAL g_506 */ static uint8_t g_521 = 0x46L; static int16_t **g_533 = &g_397[1][5][5]; static int64_t *g_569[9][1] = {{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}}; static int64_t **g_568[6][8][5] = {{{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[3][0],&g_569[3][0],&g_569[3][0],&g_569[3][0]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[2][0],&g_569[2][0],&g_569[3][0],&g_569[2][0]},{(void*)0,(void*)0,&g_569[3][0],(void*)0,(void*)0},{&g_569[2][0],&g_569[3][0],&g_569[2][0],&g_569[2][0],&g_569[3][0]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[3][0],&g_569[3][0],&g_569[3][0],&g_569[3][0]}},{{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[2][0],&g_569[2][0],&g_569[3][0],&g_569[2][0]},{(void*)0,(void*)0,&g_569[3][0],(void*)0,(void*)0},{&g_569[2][0],&g_569[3][0],&g_569[2][0],&g_569[2][0],&g_569[3][0]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[3][0],&g_569[3][0],&g_569[3][0],&g_569[3][0]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[2][0],&g_569[2][0],&g_569[3][0],&g_569[2][0]}},{{(void*)0,(void*)0,&g_569[3][0],(void*)0,(void*)0},{&g_569[2][0],&g_569[3][0],&g_569[2][0],&g_569[2][0],&g_569[3][0]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[3][0],&g_569[3][0],&g_569[3][0],&g_569[3][0]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[2][0],&g_569[2][0],&g_569[3][0],&g_569[2][0]},{(void*)0,(void*)0,&g_569[3][0],(void*)0,(void*)0},{&g_569[2][0],&g_569[3][0],&g_569[2][0],&g_569[2][0],&g_569[3][0]}},{{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[3][0],&g_569[3][0],&g_569[3][0],&g_569[3][0]},{&g_569[3][0],(void*)0,&g_569[3][0],&g_569[3][0],(void*)0},{&g_569[2][0],&g_569[3][0],&g_569[3][0],&g_569[2][0],&g_569[3][0]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[2][0],&g_569[3][0],&g_569[3][0],&g_569[2][0]},{(void*)0,&g_569[3][0],&g_569[3][0],(void*)0,&g_569[3][0]},{&g_569[2][0],&g_569[2][0],&g_569[3][0],&g_569[2][0],&g_569[2][0]}},{{&g_569[3][0],(void*)0,&g_569[3][0],&g_569[3][0],(void*)0},{&g_569[2][0],&g_569[3][0],&g_569[3][0],&g_569[2][0],&g_569[3][0]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[2][0],&g_569[3][0],&g_569[3][0],&g_569[2][0]},{(void*)0,&g_569[3][0],&g_569[3][0],(void*)0,&g_569[3][0]},{&g_569[2][0],&g_569[2][0],&g_569[3][0],&g_569[2][0],&g_569[2][0]},{&g_569[3][0],(void*)0,&g_569[3][0],&g_569[3][0],(void*)0},{&g_569[2][0],&g_569[3][0],&g_569[3][0],&g_569[2][0],&g_569[3][0]}},{{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[2][0],&g_569[3][0],&g_569[3][0],&g_569[2][0]},{(void*)0,&g_569[3][0],&g_569[3][0],(void*)0,&g_569[3][0]},{&g_569[2][0],&g_569[2][0],&g_569[3][0],&g_569[2][0],&g_569[2][0]},{&g_569[3][0],(void*)0,&g_569[3][0],&g_569[3][0],(void*)0},{&g_569[2][0],&g_569[3][0],&g_569[3][0],&g_569[2][0],&g_569[3][0]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_569[3][0],&g_569[2][0],&g_569[3][0],&g_569[3][0],&g_569[2][0]}}}; static int64_t ***g_567[2][4][2] = {{{&g_568[5][0][4],&g_568[5][0][4]},{&g_568[5][0][4],&g_568[5][0][4]},{&g_568[5][0][4],&g_568[5][0][4]},{&g_568[5][0][4],&g_568[5][0][4]}},{{&g_568[5][0][4],&g_568[5][0][4]},{&g_568[5][0][4],&g_568[5][0][4]},{&g_568[5][0][4],&g_568[5][0][4]},{&g_568[5][0][4],&g_568[5][0][4]}}}; static int64_t ****g_566 = &g_567[0][0][1]; static int64_t ***** volatile g_565[5] = {&g_566,&g_566,&g_566,&g_566,&g_566}; static int64_t ***** volatile g_572[9][6][4] = {{{&g_566,&g_566,&g_566,&g_566},{&g_566,&g_566,(void*)0,&g_566},{(void*)0,&g_566,(void*)0,&g_566},{&g_566,(void*)0,&g_566,&g_566},{&g_566,(void*)0,&g_566,(void*)0},{&g_566,(void*)0,&g_566,(void*)0}},{{(void*)0,(void*)0,&g_566,&g_566},{&g_566,(void*)0,&g_566,&g_566},{&g_566,&g_566,&g_566,&g_566},{&g_566,&g_566,&g_566,&g_566},{&g_566,&g_566,&g_566,(void*)0},{(void*)0,&g_566,&g_566,&g_566}},{{&g_566,&g_566,&g_566,(void*)0},{&g_566,&g_566,&g_566,&g_566},{&g_566,&g_566,(void*)0,&g_566},{&g_566,&g_566,(void*)0,&g_566},{&g_566,(void*)0,&g_566,&g_566},{&g_566,&g_566,&g_566,&g_566}},{{&g_566,&g_566,&g_566,&g_566},{(void*)0,&g_566,&g_566,&g_566},{&g_566,(void*)0,&g_566,&g_566},{&g_566,&g_566,(void*)0,&g_566},{&g_566,(void*)0,&g_566,(void*)0},{&g_566,&g_566,&g_566,(void*)0}},{{(void*)0,&g_566,&g_566,(void*)0},{&g_566,&g_566,&g_566,(void*)0},{&g_566,&g_566,&g_566,(void*)0},{&g_566,(void*)0,(void*)0,&g_566},{&g_566,&g_566,(void*)0,&g_566},{&g_566,(void*)0,&g_566,&g_566}},{{&g_566,&g_566,&g_566,&g_566},{&g_566,&g_566,&g_566,&g_566},{(void*)0,&g_566,&g_566,&g_566},{&g_566,(void*)0,&g_566,&g_566},{&g_566,&g_566,(void*)0,&g_566},{&g_566,(void*)0,&g_566,(void*)0}},{{&g_566,&g_566,&g_566,(void*)0},{(void*)0,&g_566,&g_566,(void*)0},{&g_566,&g_566,&g_566,(void*)0},{&g_566,&g_566,&g_566,(void*)0},{&g_566,(void*)0,(void*)0,&g_566},{&g_566,&g_566,(void*)0,&g_566}},{{&g_566,(void*)0,&g_566,&g_566},{&g_566,&g_566,&g_566,&g_566},{&g_566,&g_566,&g_566,&g_566},{(void*)0,&g_566,&g_566,&g_566},{&g_566,(void*)0,&g_566,&g_566},{&g_566,&g_566,(void*)0,&g_566}},{{&g_566,(void*)0,&g_566,(void*)0},{&g_566,&g_566,&g_566,(void*)0},{(void*)0,&g_566,&g_566,(void*)0},{&g_566,&g_566,&g_566,(void*)0},{&g_566,&g_566,&g_566,(void*)0},{&g_566,(void*)0,(void*)0,&g_566}}}; static volatile union U2 g_602 = {0x74C835DAAD4D601ALL};/* VOLATILE GLOBAL g_602 */ static int64_t *****g_616 = &g_566; static volatile union U2 g_617 = {0xD88D85A2944CECB1LL};/* VOLATILE GLOBAL g_617 */ static uint32_t g_669 = 1UL; static volatile uint64_t g_705 = 0UL;/* VOLATILE GLOBAL g_705 */ static union U2 *g_709 = (void*)0; static union U2 ** volatile g_708[3][10][8] = {{{&g_709,&g_709,&g_709,&g_709,(void*)0,&g_709,&g_709,&g_709},{(void*)0,&g_709,(void*)0,(void*)0,(void*)0,&g_709,&g_709,&g_709},{(void*)0,&g_709,&g_709,&g_709,&g_709,(void*)0,&g_709,&g_709},{&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709},{&g_709,&g_709,(void*)0,&g_709,(void*)0,&g_709,&g_709,&g_709},{&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709},{&g_709,&g_709,(void*)0,(void*)0,&g_709,&g_709,&g_709,(void*)0},{&g_709,&g_709,&g_709,(void*)0,&g_709,&g_709,&g_709,&g_709},{&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,(void*)0,&g_709},{&g_709,&g_709,&g_709,&g_709,(void*)0,(void*)0,&g_709,&g_709}},{{&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709},{(void*)0,(void*)0,&g_709,(void*)0,(void*)0,(void*)0,&g_709,&g_709},{&g_709,&g_709,(void*)0,&g_709,&g_709,&g_709,(void*)0,&g_709},{&g_709,&g_709,&g_709,(void*)0,&g_709,&g_709,&g_709,&g_709},{&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709},{(void*)0,(void*)0,(void*)0,&g_709,&g_709,&g_709,&g_709,&g_709},{&g_709,(void*)0,&g_709,&g_709,&g_709,(void*)0,&g_709,&g_709},{&g_709,&g_709,&g_709,(void*)0,&g_709,(void*)0,&g_709,(void*)0},{&g_709,&g_709,(void*)0,(void*)0,&g_709,&g_709,&g_709,&g_709},{&g_709,(void*)0,&g_709,&g_709,&g_709,&g_709,(void*)0,&g_709}},{{&g_709,&g_709,(void*)0,&g_709,(void*)0,&g_709,&g_709,(void*)0},{&g_709,(void*)0,&g_709,&g_709,&g_709,&g_709,(void*)0,(void*)0},{&g_709,&g_709,&g_709,&g_709,&g_709,(void*)0,&g_709,&g_709},{&g_709,(void*)0,&g_709,(void*)0,&g_709,&g_709,&g_709,(void*)0},{&g_709,&g_709,(void*)0,&g_709,&g_709,(void*)0,&g_709,&g_709},{&g_709,(void*)0,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709},{&g_709,&g_709,(void*)0,&g_709,&g_709,&g_709,&g_709,&g_709},{&g_709,&g_709,(void*)0,&g_709,&g_709,(void*)0,&g_709,(void*)0},{&g_709,&g_709,(void*)0,&g_709,&g_709,&g_709,&g_709,&g_709},{&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709,&g_709}}}; static union U2 g_712 = {0x90E81EAC1E7A9947LL};/* VOLATILE GLOBAL g_712 */ static int32_t ****g_744 = &g_444[1]; static struct S0 g_746 = {0x38753949L,1UL,1UL,0x92CAL,8UL,-1L};/* VOLATILE GLOBAL g_746 */ static int8_t * volatile g_783 = &g_43[4].f5;/* VOLATILE GLOBAL g_783 */ static uint8_t * const g_792[10][7] = {{&g_94[6],(void*)0,(void*)0,&g_94[6],&g_521,&g_521,&g_94[6]},{&g_521,&g_94[1],&g_521,&g_521,&g_94[1],&g_521,(void*)0},{&g_94[1],&g_94[6],&g_94[2],&g_94[1],&g_94[1],&g_94[2],&g_94[6]},{&g_94[1],(void*)0,&g_521,&g_94[1],&g_521,&g_521,&g_94[1]},{&g_521,&g_94[6],&g_521,&g_521,&g_94[6],(void*)0,(void*)0},{&g_94[6],&g_94[1],&g_94[2],&g_94[1],&g_94[6],&g_94[2],&g_94[1]},{&g_94[1],(void*)0,&g_521,&g_94[1],&g_521,(void*)0,&g_94[1]},{&g_521,&g_94[1],(void*)0,&g_521,&g_94[1],&g_521,(void*)0},{&g_94[1],&g_94[1],&g_94[2],&g_94[6],&g_94[1],&g_94[2],&g_94[1]},{&g_94[6],(void*)0,(void*)0,&g_94[6],&g_521,&g_521,&g_94[6]}}; static uint8_t * const *g_791 = &g_792[6][0]; static struct S1 g_794[4][5] = {{{{1L,1UL,7UL,1L,0x48L,0xEAL},1L,-5164,3UL,4L,0xE856541CL,0xAEDB2F52L,18446744073709551615UL,0x3232L},{{-6L,1UL,0UL,4L,0x9CL,0x52L},0x4F626866L,30271,0UL,5L,0xFCAF7D47L,0x638F9A5BL,0xE4A3A347L,0x8874L},{{1L,1UL,7UL,1L,0x48L,0xEAL},1L,-5164,3UL,4L,0xE856541CL,0xAEDB2F52L,18446744073709551615UL,0x3232L},{{-3L,0x1319L,7UL,6L,0x70L,0xC9L},0L,30181,0x02L,0x394CD61FEE91AA35LL,0x008A9D81L,5UL,0x40A14D4CL,1L},{{0x7EDFFB88L,0x5C86L,0UL,-4L,247UL,0x8CL},-6L,-16232,0xEDL,0xA62828CC1D01A443LL,0x4DB3D39BL,0UL,0UL,0x1154L}},{{{0xB71435C5L,65535UL,0UL,0xCE0CL,0xACL,0xFAL},0xECC050B5L,-12479,0x0BL,0L,0L,0x6DD69F7AL,1UL,0xD2BEL},{{0xCE2CD280L,65530UL,0x4B73BB9EL,0L,0x12L,-1L},9L,24896,255UL,0xCAEEE7A8C3F23F24LL,0L,18446744073709551606UL,0xB5E5A144L,-1L},{{0x7EDFFB88L,0x5C86L,0UL,-4L,247UL,0x8CL},-6L,-16232,0xEDL,0xA62828CC1D01A443LL,0x4DB3D39BL,0UL,0UL,0x1154L},{{0xCE2CD280L,65530UL,0x4B73BB9EL,0L,0x12L,-1L},9L,24896,255UL,0xCAEEE7A8C3F23F24LL,0L,18446744073709551606UL,0xB5E5A144L,-1L},{{0xB71435C5L,65535UL,0UL,0xCE0CL,0xACL,0xFAL},0xECC050B5L,-12479,0x0BL,0L,0L,0x6DD69F7AL,1UL,0xD2BEL}},{{{1L,1UL,7UL,1L,0x48L,0xEAL},1L,-5164,3UL,4L,0xE856541CL,0xAEDB2F52L,18446744073709551615UL,0x3232L},{{0xCE2CD280L,65530UL,0x4B73BB9EL,0L,0x12L,-1L},9L,24896,255UL,0xCAEEE7A8C3F23F24LL,0L,18446744073709551606UL,0xB5E5A144L,-1L},{{-6L,1UL,0UL,4L,0x9CL,0x52L},0x4F626866L,30271,0UL,5L,0xFCAF7D47L,0x638F9A5BL,0xE4A3A347L,0x8874L},{{0xB71435C5L,65535UL,0UL,0xCE0CL,0xACL,0xFAL},0xECC050B5L,-12479,0x0BL,0L,0L,0x6DD69F7AL,1UL,0xD2BEL},{{-6L,1UL,0UL,4L,0x9CL,0x52L},0x4F626866L,30271,0UL,5L,0xFCAF7D47L,0x638F9A5BL,0xE4A3A347L,0x8874L}},{{{-6L,1UL,0UL,4L,0x9CL,0x52L},0x4F626866L,30271,0UL,5L,0xFCAF7D47L,0x638F9A5BL,0xE4A3A347L,0x8874L},{{-6L,1UL,0UL,4L,0x9CL,0x52L},0x4F626866L,30271,0UL,5L,0xFCAF7D47L,0x638F9A5BL,0xE4A3A347L,0x8874L},{{0x7EDFFB88L,0x5C86L,0UL,-4L,247UL,0x8CL},-6L,-16232,0xEDL,0xA62828CC1D01A443LL,0x4DB3D39BL,0UL,0UL,0x1154L},{{0xB71435C5L,65535UL,0UL,0xCE0CL,0xACL,0xFAL},0xECC050B5L,-12479,0x0BL,0L,0L,0x6DD69F7AL,1UL,0xD2BEL},{{0x9C5699EEL,0xFACAL,0UL,-1L,0UL,0L},0x3CB75095L,-19921,0x29L,1L,-2L,1UL,0xD0E80825L,0L}}}; static const int32_t *g_797 = (void*)0; static const int32_t ** volatile g_796 = &g_797;/* VOLATILE GLOBAL g_796 */ static union U2 g_808[3][5] = {{{-9L},{-9L},{-9L},{-9L},{-9L}},{{-9L},{-9L},{-9L},{-9L},{-9L}},{{-9L},{-9L},{-9L},{-9L},{-9L}}}; static volatile struct S1 g_827 = {{1L,0x7FFAL,0xF42FCB1BL,-1L,0x84L,-7L},0x1F7106ECL,-43435,0UL,0xB4D7EB94B093A9E6LL,0x32A2FED6L,0xCE5760FAL,0xA446E86FL,1L};/* VOLATILE GLOBAL g_827 */ static volatile struct S0 g_836 = {0xCBAFA7C8L,65535UL,0xE2F77D46L,0x6C88L,4UL,0L};/* VOLATILE GLOBAL g_836 */ static int8_t *g_846 = &g_712.f4.f5; static struct S0 g_857 = {-1L,0x5E67L,0UL,-10L,251UL,0xDFL};/* VOLATILE GLOBAL g_857 */ static int32_t * volatile g_876 = &g_193;/* VOLATILE GLOBAL g_876 */ static volatile union U2 g_877 = {0xC5481233A2CB4337LL};/* VOLATILE GLOBAL g_877 */ static uint16_t g_963 = 65529UL; static volatile struct S0 g_969 = {1L,65526UL,18446744073709551615UL,0xBF08L,0xACL,0xF0L};/* VOLATILE GLOBAL g_969 */ static const int32_t ** volatile g_977 = (void*)0;/* VOLATILE GLOBAL g_977 */ static volatile int8_t g_994 = 1L;/* VOLATILE GLOBAL g_994 */ static volatile uint8_t g_1029[5] = {247UL,247UL,247UL,247UL,247UL}; static union U2 g_1055 = {0x1B57FCB2553E1D3ELL};/* VOLATILE GLOBAL g_1055 */ static int32_t * volatile g_1109 = &g_193;/* VOLATILE GLOBAL g_1109 */ static int16_t g_1138 = 0xB7D9L; static volatile struct S1 g_1140 = {{-3L,0x20CCL,1UL,9L,0x68L,0x96L},0L,16840,0x1EL,-2L,0xDD0619A2L,0UL,5UL,0x3E02L};/* VOLATILE GLOBAL g_1140 */ static struct S0 g_1153[1][3] = {{{0x6CA1F65BL,0x5B58L,0xCD44DEE4L,0xBFFFL,0xEBL,5L},{0x6CA1F65BL,0x5B58L,0xCD44DEE4L,0xBFFFL,0xEBL,5L},{0x6CA1F65BL,0x5B58L,0xCD44DEE4L,0xBFFFL,0xEBL,5L}}}; static volatile int64_t g_1165[4][8] = {{(-10L),(-10L),0x3B10161B871D4E8BLL,0L,0x098E233AED533885LL,0x098E233AED533885LL,0L,0x3B10161B871D4E8BLL},{(-10L),(-10L),0x3B10161B871D4E8BLL,0L,0x098E233AED533885LL,0x098E233AED533885LL,0L,0x3B10161B871D4E8BLL},{(-10L),(-10L),0x3B10161B871D4E8BLL,0L,0x098E233AED533885LL,0x098E233AED533885LL,0L,0x3B10161B871D4E8BLL},{(-10L),(-10L),0x3B10161B871D4E8BLL,0L,0x098E233AED533885LL,0x098E233AED533885LL,0L,0x3B10161B871D4E8BLL}}; static int8_t g_1170 = 0xB6L; static int64_t g_1212 = 1L; static int64_t g_1229 = (-1L); static uint8_t *g_1234 = &g_94[2]; static uint8_t **g_1233 = &g_1234; static uint64_t g_1258 = 0x505EEF36B74C42D7LL; static struct S0 g_1285 = {6L,9UL,18446744073709551612UL,0xFB88L,249UL,0xD9L};/* VOLATILE GLOBAL g_1285 */ static volatile uint32_t g_1317[7] = {4294967295UL,0x914F620DL,4294967295UL,4294967295UL,0x914F620DL,4294967295UL,4294967295UL}; static uint32_t g_1320 = 1UL; static struct S1 *g_1336 = &g_794[1][2]; static struct S1 ** volatile g_1335 = &g_1336;/* VOLATILE GLOBAL g_1335 */ static volatile int64_t ** volatile g_1343 = (void*)0;/* VOLATILE GLOBAL g_1343 */ static volatile int64_t ** volatile * volatile g_1342 = &g_1343;/* VOLATILE GLOBAL g_1342 */ static struct S0 g_1365 = {0xA695E666L,5UL,1UL,0x2EE3L,0UL,1L};/* VOLATILE GLOBAL g_1365 */ static volatile uint32_t g_1368[5] = {0x5D10F38EL,0x5D10F38EL,0x5D10F38EL,0x5D10F38EL,0x5D10F38EL}; static uint8_t *g_1381 = &g_521; static int32_t * volatile g_1411[1][6] = {{(void*)0,&g_193,(void*)0,(void*)0,&g_193,(void*)0}}; static int32_t * volatile g_1412[2] = {(void*)0,(void*)0}; static struct S0 g_1455[7] = {{0x637B163DL,5UL,0xF0DE70FFL,-1L,0x05L,0x9EL},{0x637B163DL,5UL,0xF0DE70FFL,-1L,0x05L,0x9EL},{0x637B163DL,5UL,0xF0DE70FFL,-1L,0x05L,0x9EL},{0x637B163DL,5UL,0xF0DE70FFL,-1L,0x05L,0x9EL},{0x637B163DL,5UL,0xF0DE70FFL,-1L,0x05L,0x9EL},{0x637B163DL,5UL,0xF0DE70FFL,-1L,0x05L,0x9EL},{0x637B163DL,5UL,0xF0DE70FFL,-1L,0x05L,0x9EL}}; static volatile union U2 g_1490 = {-1L};/* VOLATILE GLOBAL g_1490 */ static volatile struct S0 g_1506[3][4][8] = {{{{0x5E7DB9E0L,0x6A70L,0x2E717071L,0xB9EFL,247UL,0xA6L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L}},{{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L}},{{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L}},{{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L}}},{{{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x5E7DB9E0L,0x6A70L,0x2E717071L,0xB9EFL,247UL,0xA6L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L}},{{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L}},{{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L}},{{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L}}},{{{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L}},{{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{0x1737DA91L,65535UL,0x6AEE4C96L,0L,0UL,0L}},{{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0x6637FB1BL,0x4585L,0x5BA3CA36L,0x6F73L,0x79L,-6L},{1L,65527UL,0xE0554452L,0x938DL,1UL,9L}},{{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0x5E7DB9E0L,0x6A70L,0x2E717071L,0xB9EFL,247UL,0xA6L},{0x8EF5E6C3L,0x0558L,18446744073709551611UL,0x488CL,255UL,0L},{0xAAB2543DL,65535UL,0x325AF783L,0x966BL,0xA0L,-1L},{-6L,0xFE00L,1UL,0x8412L,9UL,0x49L}}}}; static struct S1 g_1550 = {{-1L,9UL,0x3A9133E3L,1L,0x0FL,-9L},-5L,-40542,249UL,0xE47FCF15EB627403LL,0xFACA0355L,0x1E93200BL,0UL,-1L};/* VOLATILE GLOBAL g_1550 */ static struct S0 g_1554 = {0L,0x2B31L,7UL,-3L,0UL,6L};/* VOLATILE GLOBAL g_1554 */ static const volatile int64_t g_1557 = (-1L);/* VOLATILE GLOBAL g_1557 */ static int32_t g_1598 = 0xB0BC2428L; static struct S0 g_1607 = {7L,0x199EL,0xD7DF5D56L,0xEDB6L,8UL,0L};/* VOLATILE GLOBAL g_1607 */ static volatile uint32_t g_1655 = 0xFAA41934L;/* VOLATILE GLOBAL g_1655 */ static union U2 g_1667 = {0xFD7C9E31DDD7F2ECLL};/* VOLATILE GLOBAL g_1667 */ static volatile struct S0 g_1668[7][2] = {{{0x7581F7E2L,0xF4D5L,18446744073709551612UL,0x58BDL,0xE3L,1L},{-5L,0UL,0UL,0x1A44L,250UL,0x49L}},{{-5L,0UL,0UL,0x1A44L,250UL,0x49L},{0x7581F7E2L,0xF4D5L,18446744073709551612UL,0x58BDL,0xE3L,1L}},{{-5L,0UL,0UL,0x1A44L,250UL,0x49L},{-5L,0UL,0UL,0x1A44L,250UL,0x49L}},{{0x7581F7E2L,0xF4D5L,18446744073709551612UL,0x58BDL,0xE3L,1L},{-5L,0UL,0UL,0x1A44L,250UL,0x49L}},{{-5L,0UL,0UL,0x1A44L,250UL,0x49L},{0x7581F7E2L,0xF4D5L,18446744073709551612UL,0x58BDL,0xE3L,1L}},{{-5L,0UL,0UL,0x1A44L,250UL,0x49L},{-5L,0UL,0UL,0x1A44L,250UL,0x49L}},{{0x7581F7E2L,0xF4D5L,18446744073709551612UL,0x58BDL,0xE3L,1L},{-5L,0UL,0UL,0x1A44L,250UL,0x49L}}}; static volatile union U2 g_1685 = {0xD6E65E49722F43F3LL};/* VOLATILE GLOBAL g_1685 */ static int8_t * const *g_1698 = &g_846; static int8_t * const **g_1697 = &g_1698; static volatile union U2 g_1734[7][1] = {{{0x54BB2FAF9C9609CFLL}},{{0x54BB2FAF9C9609CFLL}},{{0x54BB2FAF9C9609CFLL}},{{0x54BB2FAF9C9609CFLL}},{{0x54BB2FAF9C9609CFLL}},{{0x54BB2FAF9C9609CFLL}},{{0x54BB2FAF9C9609CFLL}}}; static int32_t g_1746 = 0x207E6BC4L; static struct S0 g_1753 = {5L,0x488FL,0x9CF5DCBBL,0xF3B9L,0xC8L,0x94L};/* VOLATILE GLOBAL g_1753 */ static int16_t g_1767 = 5L; static struct S0 g_1830 = {1L,0xCF23L,0x049637C9L,0x088AL,5UL,-1L};/* VOLATILE GLOBAL g_1830 */ static volatile uint32_t g_1871 = 1UL;/* VOLATILE GLOBAL g_1871 */ static uint16_t *g_1882 = &g_1285.f1; static uint64_t * volatile g_1926 = &g_1258;/* VOLATILE GLOBAL g_1926 */ static struct S1 g_1931[3][9] = {{{{4L,0x8044L,0x7C0BE189L,9L,0UL,-5L},-1L,-39902,0xABL,0x651B67E1E3CF61D1LL,8L,0xF2580599L,2UL,0x6231L},{{1L,0x97B1L,0x3F428324L,0x6B56L,0xE9L,0x30L},0xFEB53D6AL,-26542,0xE7L,-4L,0x4ECB8D32L,0x591FA5B5L,0UL,1L},{{-1L,0x6A04L,18446744073709551615UL,0L,0UL,0x9BL},9L,-21922,0x1DL,0xDD8E69DF9DF0182CLL,-4L,0xC4ECB68FL,3UL,3L},{{4L,0xD96EL,1UL,0x517EL,0x8BL,0x31L},0xF8C5965EL,-21902,253UL,4L,0xB89ABFF8L,0xF42F63A8L,18446744073709551615UL,-4L},{{4L,0xD96EL,1UL,0x517EL,0x8BL,0x31L},0xF8C5965EL,-21902,253UL,4L,0xB89ABFF8L,0xF42F63A8L,18446744073709551615UL,-4L},{{-1L,0x6A04L,18446744073709551615UL,0L,0UL,0x9BL},9L,-21922,0x1DL,0xDD8E69DF9DF0182CLL,-4L,0xC4ECB68FL,3UL,3L},{{1L,0x97B1L,0x3F428324L,0x6B56L,0xE9L,0x30L},0xFEB53D6AL,-26542,0xE7L,-4L,0x4ECB8D32L,0x591FA5B5L,0UL,1L},{{4L,0x8044L,0x7C0BE189L,9L,0UL,-5L},-1L,-39902,0xABL,0x651B67E1E3CF61D1LL,8L,0xF2580599L,2UL,0x6231L},{{1L,0x97B1L,0x3F428324L,0x6B56L,0xE9L,0x30L},0xFEB53D6AL,-26542,0xE7L,-4L,0x4ECB8D32L,0x591FA5B5L,0UL,1L}},{{{3L,0UL,0x851C2DBBL,0x5AB0L,0xDCL,0x4AL},-6L,11456,0xA9L,0x5F8FBBFEAD387593LL,0x71C4E238L,0x0767AAACL,0x04D2A8D4L,-2L},{{0xAA94B37EL,0x1B4EL,0x4462B6FAL,0xE278L,0xFDL,-9L},0x89EB360EL,-10633,0x74L,-9L,0x5B0057ABL,1UL,0x1AE70C56L,0x4C2CL},{{-1L,0x6A04L,18446744073709551615UL,0L,0UL,0x9BL},9L,-21922,0x1DL,0xDD8E69DF9DF0182CLL,-4L,0xC4ECB68FL,3UL,3L},{{-1L,0x6A04L,18446744073709551615UL,0L,0UL,0x9BL},9L,-21922,0x1DL,0xDD8E69DF9DF0182CLL,-4L,0xC4ECB68FL,3UL,3L},{{0xAA94B37EL,0x1B4EL,0x4462B6FAL,0xE278L,0xFDL,-9L},0x89EB360EL,-10633,0x74L,-9L,0x5B0057ABL,1UL,0x1AE70C56L,0x4C2CL},{{3L,0UL,0x851C2DBBL,0x5AB0L,0xDCL,0x4AL},-6L,11456,0xA9L,0x5F8FBBFEAD387593LL,0x71C4E238L,0x0767AAACL,0x04D2A8D4L,-2L},{{4L,0xD96EL,1UL,0x517EL,0x8BL,0x31L},0xF8C5965EL,-21902,253UL,4L,0xB89ABFF8L,0xF42F63A8L,18446744073709551615UL,-4L},{{3L,0UL,0x851C2DBBL,0x5AB0L,0xDCL,0x4AL},-6L,11456,0xA9L,0x5F8FBBFEAD387593LL,0x71C4E238L,0x0767AAACL,0x04D2A8D4L,-2L},{{0xAA94B37EL,0x1B4EL,0x4462B6FAL,0xE278L,0xFDL,-9L},0x89EB360EL,-10633,0x74L,-9L,0x5B0057ABL,1UL,0x1AE70C56L,0x4C2CL}},{{{3L,0UL,0x851C2DBBL,0x5AB0L,0xDCL,0x4AL},-6L,11456,0xA9L,0x5F8FBBFEAD387593LL,0x71C4E238L,0x0767AAACL,0x04D2A8D4L,-2L},{{1L,0x97B1L,0x3F428324L,0x6B56L,0xE9L,0x30L},0xFEB53D6AL,-26542,0xE7L,-4L,0x4ECB8D32L,0x591FA5B5L,0UL,1L},{{1L,0x97B1L,0x3F428324L,0x6B56L,0xE9L,0x30L},0xFEB53D6AL,-26542,0xE7L,-4L,0x4ECB8D32L,0x591FA5B5L,0UL,1L},{{3L,0UL,0x851C2DBBL,0x5AB0L,0xDCL,0x4AL},-6L,11456,0xA9L,0x5F8FBBFEAD387593LL,0x71C4E238L,0x0767AAACL,0x04D2A8D4L,-2L},{{4L,0x8044L,0x7C0BE189L,9L,0UL,-5L},-1L,-39902,0xABL,0x651B67E1E3CF61D1LL,8L,0xF2580599L,2UL,0x6231L},{{0xAA94B37EL,0x1B4EL,0x4462B6FAL,0xE278L,0xFDL,-9L},0x89EB360EL,-10633,0x74L,-9L,0x5B0057ABL,1UL,0x1AE70C56L,0x4C2CL},{{4L,0x8044L,0x7C0BE189L,9L,0UL,-5L},-1L,-39902,0xABL,0x651B67E1E3CF61D1LL,8L,0xF2580599L,2UL,0x6231L},{{3L,0UL,0x851C2DBBL,0x5AB0L,0xDCL,0x4AL},-6L,11456,0xA9L,0x5F8FBBFEAD387593LL,0x71C4E238L,0x0767AAACL,0x04D2A8D4L,-2L},{{1L,0x97B1L,0x3F428324L,0x6B56L,0xE9L,0x30L},0xFEB53D6AL,-26542,0xE7L,-4L,0x4ECB8D32L,0x591FA5B5L,0UL,1L}}}; static volatile struct S0 g_1974 = {0x34B91658L,0xB104L,0x6706B129L,0x76D1L,0xB8L,0x83L};/* VOLATILE GLOBAL g_1974 */ static volatile struct S0 g_1978 = {0L,0xB57CL,0xA929A88BL,0x89C3L,251UL,0x68L};/* VOLATILE GLOBAL g_1978 */ static volatile int8_t g_1981 = 0x11L;/* VOLATILE GLOBAL g_1981 */ static int32_t * volatile g_2078[9][6][4] = {{{&g_273,&g_1746,&g_42,&g_1746},{&g_1746,&g_1746,&g_42,&g_42},{&g_273,&g_273,&g_1746,&g_42},{&g_315,&g_1746,&g_315,&g_1746},{&g_315,&g_1746,&g_1746,&g_315},{&g_273,&g_1746,&g_42,&g_1746}},{{&g_1746,&g_1746,&g_42,&g_42},{&g_273,&g_273,&g_1746,&g_42},{&g_315,&g_1746,&g_315,&g_1746},{&g_315,&g_1746,&g_1746,&g_315},{&g_273,&g_1746,&g_42,&g_1746},{&g_1746,&g_1746,&g_42,&g_42}},{{&g_273,&g_273,&g_1746,&g_1746},{&g_42,&g_273,&g_42,&g_315},{&g_42,&g_315,&g_315,&g_42},{&g_1746,&g_315,&g_1746,&g_315},{&g_315,&g_273,&g_1746,&g_1746},{&g_1746,&g_1746,&g_315,&g_1746}},{{&g_42,&g_273,&g_42,&g_315},{&g_42,&g_315,&g_315,&g_42},{&g_1746,&g_315,&g_1746,&g_315},{&g_315,&g_273,&g_1746,&g_1746},{&g_1746,&g_1746,&g_315,&g_1746},{&g_42,&g_273,&g_42,&g_315}},{{&g_42,&g_315,&g_315,&g_42},{&g_1746,&g_315,&g_1746,&g_315},{&g_315,&g_273,&g_1746,&g_1746},{&g_1746,&g_1746,&g_315,&g_1746},{&g_42,&g_273,&g_42,&g_315},{&g_42,&g_315,&g_315,&g_42}},{{&g_1746,&g_315,&g_1746,&g_315},{&g_315,&g_273,&g_1746,&g_1746},{&g_1746,&g_1746,&g_315,&g_1746},{&g_42,&g_273,&g_42,&g_315},{&g_42,&g_315,&g_315,&g_42},{&g_1746,&g_315,&g_1746,&g_315}},{{&g_315,&g_273,&g_1746,&g_1746},{&g_1746,&g_1746,&g_315,&g_1746},{&g_42,&g_273,&g_42,&g_315},{&g_42,&g_315,&g_315,&g_42},{&g_1746,&g_315,&g_1746,&g_315},{&g_315,&g_273,&g_1746,&g_1746}},{{&g_1746,&g_1746,&g_315,&g_1746},{&g_42,&g_273,&g_42,&g_315},{&g_42,&g_315,&g_315,&g_42},{&g_1746,&g_315,&g_1746,&g_315},{&g_315,&g_273,&g_1746,&g_1746},{&g_1746,&g_1746,&g_315,&g_1746}},{{&g_42,&g_273,&g_42,&g_315},{&g_42,&g_315,&g_315,&g_42},{&g_1746,&g_315,&g_1746,&g_315},{&g_315,&g_273,&g_1746,&g_1746},{&g_1746,&g_1746,&g_315,&g_1746},{&g_42,&g_273,&g_42,&g_315}}}; static int32_t * const volatile g_2079 = &g_273;/* VOLATILE GLOBAL g_2079 */ static const int32_t *g_2095 = &g_1753.f0; static volatile uint32_t g_2109 = 0xC6D5D01FL;/* VOLATILE GLOBAL g_2109 */ static int32_t * volatile g_2114 = &g_193;/* VOLATILE GLOBAL g_2114 */ static volatile struct S1 g_2117 = {{0x8164B069L,65532UL,1UL,0x2246L,9UL,0x68L},-4L,-42564,250UL,0x7F6EF400C8B1868ALL,0xE45E32CAL,0x70DC16A4L,18446744073709551615UL,-1L};/* VOLATILE GLOBAL g_2117 */ static union U2 g_2137 = {-2L};/* VOLATILE GLOBAL g_2137 */ static struct S1 g_2151 = {{0x8F27142BL,0x22B6L,18446744073709551606UL,-1L,0x68L,0x10L},0x32DE9E5AL,-31697,0x0DL,3L,0x7B400765L,0x4BC795C3L,1UL,0x888AL};/* VOLATILE GLOBAL g_2151 */ static int16_t ***g_2169[1] = {&g_533}; static int16_t *** const *g_2168 = &g_2169[0]; static struct S0 g_2271 = {0xE7EEA750L,4UL,0x46AC7B5DL,0x19B2L,255UL,0xC9L};/* VOLATILE GLOBAL g_2271 */ static volatile struct S1 g_2283 = {{-2L,65534UL,0xF9844645L,1L,250UL,-7L},-1L,9285,1UL,0xE31B9A4E51DA70CFLL,-10L,0x55A1425BL,18446744073709551611UL,0xD93EL};/* VOLATILE GLOBAL g_2283 */ static uint32_t g_2286 = 0xE658F83AL; static uint32_t *g_2304 = &g_1550.f7; static int32_t * const volatile g_2368 = &g_315;/* VOLATILE GLOBAL g_2368 */ static struct S1 g_2411 = {{0x198404EDL,1UL,0xE1581984L,0x467EL,0x22L,0xCAL},-10L,16785,0xA6L,0xEDCBB172DE8AE65ELL,1L,0x8027E449L,0UL,0L};/* VOLATILE GLOBAL g_2411 */ static volatile struct S0 g_2434 = {0x579E23F6L,0xD2F2L,1UL,1L,0x2AL,0L};/* VOLATILE GLOBAL g_2434 */ static uint8_t g_2454 = 0x0CL; static union U2 * volatile *g_2468[5][2] = {{&g_709,&g_709},{&g_709,&g_709},{&g_709,&g_709},{&g_709,&g_709},{&g_709,&g_709}}; static union U2 * volatile **g_2467 = &g_2468[1][1]; static union U2 * volatile ***g_2466 = &g_2467; static volatile uint8_t g_2480 = 0x6AL;/* VOLATILE GLOBAL g_2480 */ static struct S0 ** volatile g_2537 = &g_328;/* VOLATILE GLOBAL g_2537 */ static volatile struct S0 g_2555 = {0xBE214CC4L,65535UL,0x5FB4C9C3L,0xC6F2L,246UL,0xA3L};/* VOLATILE GLOBAL g_2555 */ static uint64_t *g_2563 = &g_263; static uint64_t **g_2562 = &g_2563; static struct S0 **g_2684 = &g_328; static volatile int8_t ****g_2721 = (void*)0; static volatile int8_t ***** volatile g_2720[10] = {&g_2721,&g_2721,&g_2721,&g_2721,&g_2721,&g_2721,&g_2721,&g_2721,&g_2721,&g_2721}; static struct S0 g_2748 = {9L,0xA2ABL,0x54AA21ADL,-1L,248UL,0x92L};/* VOLATILE GLOBAL g_2748 */ static int64_t ****g_2779 = &g_567[0][0][1]; static volatile struct S1 g_2794 = {{1L,65535UL,0xCAE4A35CL,0x4B62L,3UL,1L},0x92604A99L,9364,9UL,0x139EBCBA342A98F4LL,-1L,18446744073709551615UL,0x48AD9E41L,0L};/* VOLATILE GLOBAL g_2794 */ static const volatile union U2 g_2805 = {0xD5CE184BF27DE188LL};/* VOLATILE GLOBAL g_2805 */ static volatile struct S1 g_2822[4][7] = {{{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL}},{{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL}},{{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL}},{{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL},{{0xCDF97813L,0xEE5AL,0x81F976FFL,0L,246UL,0x71L},0L,36451,0xDAL,1L,0L,1UL,18446744073709551615UL,0x389EL}}}; static volatile union U2 g_2825[10] = {{-1L},{0x14CFEF8055694596LL},{0xF25EF3CEE797FF57LL},{0x14CFEF8055694596LL},{-1L},{-1L},{0x14CFEF8055694596LL},{0xF25EF3CEE797FF57LL},{0x14CFEF8055694596LL},{-1L}}; static volatile struct S0 g_2839 = {1L,65528UL,0x4F82A1B7L,0xF302L,5UL,0x13L};/* VOLATILE GLOBAL g_2839 */ static volatile union U2 g_2884 = {0L};/* VOLATILE GLOBAL g_2884 */ static union U2 g_2957 = {0L};/* VOLATILE GLOBAL g_2957 */ static struct S1 g_2978 = {{-5L,65535UL,0x8555323DL,0xFA7DL,7UL,-10L},-1L,19829,0xC3L,0L,1L,0x942FDD4AL,0UL,0x0AC2L};/* VOLATILE GLOBAL g_2978 */ static int8_t **g_2988[5] = {&g_846,&g_846,&g_846,&g_846,&g_846}; static int8_t *** volatile g_2987 = &g_2988[4];/* VOLATILE GLOBAL g_2987 */ static struct S1 *g_3022 = &g_1931[1][7]; static uint32_t * volatile *g_3032[4][2][2] = {{{&g_36,&g_36},{&g_36,&g_36}},{{&g_36,&g_36},{&g_36,&g_36}},{{&g_36,&g_36},{&g_36,&g_36}},{{&g_36,&g_36},{&g_36,&g_36}}}; static uint32_t * volatile **g_3031 = &g_3032[1][1][1]; static int8_t ***g_3036 = &g_2988[4]; static int8_t ****g_3035[2] = {&g_3036,&g_3036}; static int8_t *****g_3034[10][10] = {{(void*)0,&g_3035[1],&g_3035[0],(void*)0,(void*)0,&g_3035[1],&g_3035[0],(void*)0,(void*)0,&g_3035[0]},{&g_3035[0],&g_3035[1],(void*)0,&g_3035[1],&g_3035[1],&g_3035[1],&g_3035[1],&g_3035[0],&g_3035[1],&g_3035[1]},{&g_3035[0],&g_3035[1],&g_3035[1],&g_3035[0],(void*)0,&g_3035[0],&g_3035[1],&g_3035[1],(void*)0,&g_3035[1]},{(void*)0,&g_3035[0],&g_3035[0],&g_3035[1],(void*)0,&g_3035[1],&g_3035[1],&g_3035[1],&g_3035[1],(void*)0},{&g_3035[0],&g_3035[1],&g_3035[1],&g_3035[0],(void*)0,&g_3035[1],&g_3035[1],&g_3035[1],&g_3035[1],&g_3035[1]},{&g_3035[1],(void*)0,&g_3035[1],&g_3035[1],(void*)0,&g_3035[0],&g_3035[1],&g_3035[1],&g_3035[1],&g_3035[0]},{(void*)0,&g_3035[1],(void*)0,&g_3035[0],&g_3035[0],(void*)0,&g_3035[1],&g_3035[1],&g_3035[1],&g_3035[1]},{&g_3035[1],&g_3035[0],&g_3035[0],&g_3035[1],&g_3035[1],&g_3035[1],(void*)0,&g_3035[0],(void*)0,(void*)0},{&g_3035[1],(void*)0,&g_3035[1],&g_3035[0],&g_3035[1],&g_3035[1],&g_3035[1],&g_3035[0],&g_3035[1],(void*)0},{(void*)0,&g_3035[0],&g_3035[1],&g_3035[1],&g_3035[1],&g_3035[1],(void*)0,&g_3035[1],(void*)0,(void*)0}}; static struct S0 g_3040[6] = {{-1L,0x1CB3L,0x385E2C46L,-1L,0xDBL,0xF1L},{-1L,0x1CB3L,0x385E2C46L,-1L,0xDBL,0xF1L},{-1L,0x1CB3L,0x385E2C46L,-1L,0xDBL,0xF1L},{-1L,0x1CB3L,0x385E2C46L,-1L,0xDBL,0xF1L},{-1L,0x1CB3L,0x385E2C46L,-1L,0xDBL,0xF1L},{-1L,0x1CB3L,0x385E2C46L,-1L,0xDBL,0xF1L}}; static struct S0 ** const *g_3057 = (void*)0; static volatile struct S1 g_3062[7][8][4] = {{{{{0x53757E5DL,0x61B8L,0UL,9L,254UL,0xD4L},8L,28728,246UL,0x4EF332D16590EC12LL,0x0A3DF785L,0x51772D17L,0xDE391008L,0xC521L},{{0xFF498AECL,65535UL,0xFE977848L,0x2BD6L,0x82L,0xF0L},0L,9936,0x0FL,-8L,1L,8UL,18446744073709551615UL,0x7307L},{{0x4A3BD0B4L,0xF156L,0x2102F0D7L,8L,0xEBL,0L},0x3E010817L,-36101,8UL,0x61C598F3B943E04BLL,0xDCDF0253L,18446744073709551612UL,4UL,-1L},{{0x97233B83L,65535UL,0x3E7803E3L,0xE0F8L,0x73L,0xDBL},0x939CE830L,-18918,0x02L,1L,-4L,18446744073709551615UL,18446744073709551615UL,-1L}},{{{-4L,0UL,0UL,0xE157L,0x03L,0x26L},0L,7730,8UL,0x28B95A61F5457EA2LL,0xECCC277EL,1UL,0xE0E4B966L,7L},{{-1L,0x350CL,0x2FA6C570L,-1L,0UL,1L},0x16B513EAL,-35125,0UL,0L,0x92687B96L,1UL,0xFAF22FE0L,0x4FFFL},{{0x90AF9399L,0x9888L,0x67591474L,4L,0x89L,0xA9L},9L,-392,0x67L,0xA17EB532B6527392LL,-1L,0UL,1UL,0xF4E3L},{{0xF2E07198L,1UL,18446744073709551606UL,0xBCBBL,5UL,2L},0x8C7AC5C5L,27453,0x54L,7L,5L,18446744073709551615UL,0x854D8A9BL,0L}},{{{-1L,7UL,0x9F3C047DL,-1L,9UL,1L},0x52E1B6B8L,-2390,0xB8L,-1L,0xB11A1C0FL,0xB8A9CEF3L,18446744073709551607UL,1L},{{0x27B45DA3L,0x6FA7L,0xE24956D8L,0x9A91L,0xB1L,0x81L},0L,13600,8UL,-1L,0xFF518FD1L,1UL,4UL,1L},{{-4L,0UL,0UL,0xE157L,0x03L,0x26L},0L,7730,8UL,0x28B95A61F5457EA2LL,0xECCC277EL,1UL,0xE0E4B966L,7L},{{0xBAA3AB5BL,1UL,0UL,0xE166L,0x9AL,0xA2L},0x881A695FL,-28901,246UL,-1L,0L,1UL,0x39DC7586L,0L}},{{{0L,0xBFF5L,18446744073709551615UL,0L,0x09L,0x56L},-10L,-5060,3UL,0x8691E71D05F848BBLL,0xA452A0FAL,0x4A32C417L,0xAA6482A2L,0x6E57L},{{0L,0x81C8L,0x72E01065L,1L,0x67L,0L},0xAE200E57L,-42849,0UL,0L,0L,0x14491227L,0xF849239CL,-9L},{{0xC803399CL,0xD470L,0UL,7L,255UL,0x8AL},0x039B2562L,1937,0UL,-2L,0L,0x8A0338FCL,0UL,0L},{{0xC803399CL,0xD470L,0UL,7L,255UL,0x8AL},0x039B2562L,1937,0UL,-2L,0L,0x8A0338FCL,0UL,0L}},{{{0x5D30A338L,65535UL,0xAC93AB42L,0xEA58L,0x1DL,0xF8L},0xAF79144FL,-31823,0x23L,0x4F5D0F15E8E2F0C9LL,0xFDE2FAF4L,0x6AD1FC8DL,6UL,0x4042L},{{0x5D30A338L,65535UL,0xAC93AB42L,0xEA58L,0x1DL,0xF8L},0xAF79144FL,-31823,0x23L,0x4F5D0F15E8E2F0C9LL,0xFDE2FAF4L,0x6AD1FC8DL,6UL,0x4042L},{{1L,4UL,18446744073709551607UL,0x9896L,0x7FL,-1L},0x981FE550L,10448,0x2CL,0x24F4CB8E73E41FA2LL,0x139F6487L,0xC3A72692L,0UL,-3L},{{0L,1UL,0x312FCAB7L,6L,0x83L,0L},-7L,-35775,0x64L,0x5A403C840E4E32AELL,1L,0UL,0x40CCF17EL,5L}},{{{-6L,4UL,0x03B2DC68L,1L,0UL,0xF0L},0L,12035,255UL,0xEC445D95834BC082LL,0x7F9FBF20L,8UL,18446744073709551615UL,0L},{{0x97233B83L,65535UL,0x3E7803E3L,0xE0F8L,0x73L,0xDBL},0x939CE830L,-18918,0x02L,1L,-4L,18446744073709551615UL,18446744073709551615UL,-1L},{{0L,0x977CL,1UL,0xEBA3L,0x60L,0L},0x7A3D25F9L,-45682,0xE9L,0xFF965A7EDEBA7A77LL,1L,0xC8FED1E3L,0x2F0EFFFCL,-1L},{{-10L,0x1D8AL,18446744073709551610UL,1L,255UL,0L},0xA5E92B88L,35608,253UL,-3L,0x7130BBABL,18446744073709551614UL,0x80FCA831L,0x32BEL}},{{{9L,65527UL,1UL,0xFC33L,0x99L,0xD5L},0xE5C6AC5EL,31014,0x3AL,0xA5F808A7D8651DD8LL,0L,0x5FE83E69L,18446744073709551615UL,0x8CBFL},{{-1L,0xD146L,0xBC5FE914L,4L,0xFAL,0x39L},0x5CC12873L,43622,0x1BL,0xC7ADF7EC5E964938LL,0L,18446744073709551614UL,0x3D2DBDF6L,-10L},{{0x3DFCB99FL,0xB9CDL,18446744073709551615UL,0x1A51L,1UL,0x22L},0x11CA3486L,34034,0xDBL,1L,9L,0xB9C491AFL,0xFE4A5913L,9L},{{0L,0x977CL,1UL,0xEBA3L,0x60L,0L},0x7A3D25F9L,-45682,0xE9L,0xFF965A7EDEBA7A77LL,1L,0xC8FED1E3L,0x2F0EFFFCL,-1L}},{{{0xFF498AECL,65535UL,0xFE977848L,0x2BD6L,0x82L,0xF0L},0L,9936,0x0FL,-8L,1L,8UL,18446744073709551615UL,0x7307L},{{0L,1UL,0x312FCAB7L,6L,0x83L,0L},-7L,-35775,0x64L,0x5A403C840E4E32AELL,1L,0UL,0x40CCF17EL,5L},{{1L,0UL,0x5D1307DFL,0x3F76L,8UL,0x14L},0x3F3D7814L,-41767,248UL,0x5B7D0D28520A3355LL,-4L,6UL,1UL,1L},{{-1L,0xAA42L,0x04EA57FDL,0x005CL,255UL,0x2BL},-5L,-12094,0x7EL,0xEB5AC7EE24B7040ELL,1L,0UL,0xD8D8AFEBL,0x0735L}}},{{{{0L,1UL,0x312FCAB7L,6L,0x83L,0L},-7L,-35775,0x64L,0x5A403C840E4E32AELL,1L,0UL,0x40CCF17EL,5L},{{-1L,7UL,0x9F3C047DL,-1L,9UL,1L},0x52E1B6B8L,-2390,0xB8L,-1L,0xB11A1C0FL,0xB8A9CEF3L,18446744073709551607UL,1L},{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{0x3DFCB99FL,0xB9CDL,18446744073709551615UL,0x1A51L,1UL,0x22L},0x11CA3486L,34034,0xDBL,1L,9L,0xB9C491AFL,0xFE4A5913L,9L}},{{{0xD7DD30F7L,0x2F90L,0x1F401894L,0x3524L,0xF6L,0x52L},0L,37593,0xA4L,0L,2L,0xC2DEB84EL,5UL,0L},{{7L,0xF4A3L,0x8EF844FAL,0x78DCL,249UL,0L},0xC79B3F9DL,44719,0xFDL,0x340C1869DBDB6D5FLL,0x273433E8L,18446744073709551615UL,18446744073709551613UL,0L},{{0xF2E07198L,1UL,18446744073709551606UL,0xBCBBL,5UL,2L},0x8C7AC5C5L,27453,0x54L,7L,5L,18446744073709551615UL,0x854D8A9BL,0L},{{1L,4UL,18446744073709551607UL,0x9896L,0x7FL,-1L},0x981FE550L,10448,0x2CL,0x24F4CB8E73E41FA2LL,0x139F6487L,0xC3A72692L,0UL,-3L}},{{{0x4A3BD0B4L,0xF156L,0x2102F0D7L,8L,0xEBL,0L},0x3E010817L,-36101,8UL,0x61C598F3B943E04BLL,0xDCDF0253L,18446744073709551612UL,4UL,-1L},{{0xBAA3AB5BL,1UL,0UL,0xE166L,0x9AL,0xA2L},0x881A695FL,-28901,246UL,-1L,0L,1UL,0x39DC7586L,0L},{{0x01E31F96L,9UL,2UL,0x629FL,0xE4L,0L},0x9866150CL,-45874,0x18L,6L,4L,0UL,0xDE2014F4L,0xEA36L},{{3L,8UL,0xD89F6CE2L,0L,0x2AL,7L},1L,-8424,0x13L,-4L,0x97DA0DE0L,0x9E86EC98L,0UL,-2L}},{{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{3L,0x6930L,0xEDA59252L,0x4134L,251UL,-1L},-10L,24247,0x76L,3L,0xDF87A587L,0x6421EC14L,0UL,-1L},{{0x5D30A338L,65535UL,0xAC93AB42L,0xEA58L,0x1DL,0xF8L},0xAF79144FL,-31823,0x23L,0x4F5D0F15E8E2F0C9LL,0xFDE2FAF4L,0x6AD1FC8DL,6UL,0x4042L},{{0L,0x97AAL,18446744073709551615UL,0xF61AL,0UL,-1L},0x6AB6AC12L,10488,255UL,0xE7C18F3DE01FE945LL,0L,18446744073709551615UL,18446744073709551615UL,0x7A06L}},{{{0L,0xB30AL,1UL,-1L,0xBDL,0x0EL},7L,-2720,255UL,-6L,-1L,9UL,0xFA83B1BCL,2L},{{-1L,0xD146L,0xBC5FE914L,4L,0xFAL,0x39L},0x5CC12873L,43622,0x1BL,0xC7ADF7EC5E964938LL,0L,18446744073709551614UL,0x3D2DBDF6L,-10L},{{0x90AF9399L,0x9888L,0x67591474L,4L,0x89L,0xA9L},9L,-392,0x67L,0xA17EB532B6527392LL,-1L,0UL,1UL,0xF4E3L},{{-1L,7UL,0x9F3C047DL,-1L,9UL,1L},0x52E1B6B8L,-2390,0xB8L,-1L,0xB11A1C0FL,0xB8A9CEF3L,18446744073709551607UL,1L}},{{{-7L,0UL,0UL,0x04E7L,0x11L,0L},0x3D92FAE0L,-6597,0xB9L,0x1C1C2EC7A5AB885FLL,0xD7DF0733L,0xB7851531L,0UL,0x9E82L},{{0L,0x81C8L,0x72E01065L,1L,0x67L,0L},0xAE200E57L,-42849,0UL,0L,0L,0x14491227L,0xF849239CL,-9L},{{0x2AED33A0L,65527UL,18446744073709551615UL,-1L,0x30L,3L},-1L,14979,0xECL,-1L,0xCB7D24A8L,0xBD798498L,0UL,-7L},{{0xB22A76E3L,0x81E4L,0x85FBC1E0L,-1L,249UL,0x52L},0xC59F3AB1L,-14741,0UL,-1L,0x7ECF2437L,0xF965A948L,0x4B83E489L,-1L}},{{{-1L,7UL,0x9F3C047DL,-1L,9UL,1L},0x52E1B6B8L,-2390,0xB8L,-1L,0xB11A1C0FL,0xB8A9CEF3L,18446744073709551607UL,1L},{{-6L,4UL,0x03B2DC68L,1L,0UL,0xF0L},0L,12035,255UL,0xEC445D95834BC082LL,0x7F9FBF20L,8UL,18446744073709551615UL,0L},{{0L,1UL,0x312FCAB7L,6L,0x83L,0L},-7L,-35775,0x64L,0x5A403C840E4E32AELL,1L,0UL,0x40CCF17EL,5L},{{-1L,0xD146L,0xBC5FE914L,4L,0xFAL,0x39L},0x5CC12873L,43622,0x1BL,0xC7ADF7EC5E964938LL,0L,18446744073709551614UL,0x3D2DBDF6L,-10L}},{{{0L,0x81C8L,0x72E01065L,1L,0x67L,0L},0xAE200E57L,-42849,0UL,0L,0L,0x14491227L,0xF849239CL,-9L},{{0xFF498AECL,65535UL,0xFE977848L,0x2BD6L,0x82L,0xF0L},0L,9936,0x0FL,-8L,1L,8UL,18446744073709551615UL,0x7307L},{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{-1L,65527UL,9UL,-6L,255UL,0x54L},-10L,-8588,246UL,0x12366F3207EC12A4LL,-2L,0xC5C4181FL,0x85053C60L,0x7890L}}},{{{{0x29F0D75CL,0UL,0x228F2791L,0xA001L,0xD7L,0x77L},0xA4509BA8L,20369,0xBDL,5L,-4L,18446744073709551615UL,18446744073709551615UL,0L},{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{0x29F0D75CL,0UL,0x228F2791L,0xA001L,0xD7L,0x77L},0xA4509BA8L,20369,0xBDL,5L,-4L,18446744073709551615UL,18446744073709551615UL,0L},{{0L,0x3B86L,0x0EEE8C32L,-10L,9UL,0L},0x41C6E51FL,5739,0xE0L,-1L,0xF2E05BD6L,0x37E4F118L,8UL,0x1569L}},{{{-1L,0xD146L,0xBC5FE914L,4L,0xFAL,0x39L},0x5CC12873L,43622,0x1BL,0xC7ADF7EC5E964938LL,0L,18446744073709551614UL,0x3D2DBDF6L,-10L},{{0xBAA3AB5BL,1UL,0UL,0xE166L,0x9AL,0xA2L},0x881A695FL,-28901,246UL,-1L,0L,1UL,0x39DC7586L,0L},{{3L,8UL,0xD89F6CE2L,0L,0x2AL,7L},1L,-8424,0x13L,-4L,0x97DA0DE0L,0x9E86EC98L,0UL,-2L},{{0xBBE32AD1L,0xF7E6L,0xD7949695L,0L,3UL,0x16L},6L,16141,0UL,0xE896791A20FEECE5LL,0xB2344A4DL,0x49D5F010L,0xE4FEC490L,1L}},{{{-6L,65532UL,0x9410B6A4L,0x5E4BL,1UL,0xECL},1L,-33302,249UL,-1L,-5L,0x58D7EF22L,7UL,-7L},{{-1L,0xB5EBL,8UL,0x996BL,0UL,9L},-7L,23451,246UL,0xC591AD0D95521C6ALL,0x63BD856FL,18446744073709551607UL,0xECEF2815L,-8L},{{9L,65527UL,1UL,0xFC33L,0x99L,0xD5L},0xE5C6AC5EL,31014,0x3AL,0xA5F808A7D8651DD8LL,0L,0x5FE83E69L,18446744073709551615UL,0x8CBFL},{{0xBAA3AB5BL,1UL,0UL,0xE166L,0x9AL,0xA2L},0x881A695FL,-28901,246UL,-1L,0L,1UL,0x39DC7586L,0L}},{{{0L,0xB30AL,1UL,-1L,0xBDL,0x0EL},7L,-2720,255UL,-6L,-1L,9UL,0xFA83B1BCL,2L},{{0x4A3BD0B4L,0xF156L,0x2102F0D7L,8L,0xEBL,0L},0x3E010817L,-36101,8UL,0x61C598F3B943E04BLL,0xDCDF0253L,18446744073709551612UL,4UL,-1L},{{9L,65527UL,1UL,0xFC33L,0x99L,0xD5L},0xE5C6AC5EL,31014,0x3AL,0xA5F808A7D8651DD8LL,0L,0x5FE83E69L,18446744073709551615UL,0x8CBFL},{{-4L,0UL,0UL,0xE157L,0x03L,0x26L},0L,7730,8UL,0x28B95A61F5457EA2LL,0xECCC277EL,1UL,0xE0E4B966L,7L}},{{{-6L,65532UL,0x9410B6A4L,0x5E4BL,1UL,0xECL},1L,-33302,249UL,-1L,-5L,0x58D7EF22L,7UL,-7L},{{0x29F0D75CL,0UL,0x228F2791L,0xA001L,0xD7L,0x77L},0xA4509BA8L,20369,0xBDL,5L,-4L,18446744073709551615UL,18446744073709551615UL,0L},{{3L,8UL,0xD89F6CE2L,0L,0x2AL,7L},1L,-8424,0x13L,-4L,0x97DA0DE0L,0x9E86EC98L,0UL,-2L},{{0xB22A76E3L,0x81E4L,0x85FBC1E0L,-1L,249UL,0x52L},0xC59F3AB1L,-14741,0UL,-1L,0x7ECF2437L,0xF965A948L,0x4B83E489L,-1L}},{{{-1L,0xD146L,0xBC5FE914L,4L,0xFAL,0x39L},0x5CC12873L,43622,0x1BL,0xC7ADF7EC5E964938LL,0L,18446744073709551614UL,0x3D2DBDF6L,-10L},{{1L,0UL,0x5D1307DFL,0x3F76L,8UL,0x14L},0x3F3D7814L,-41767,248UL,0x5B7D0D28520A3355LL,-4L,6UL,1UL,1L},{{0x29F0D75CL,0UL,0x228F2791L,0xA001L,0xD7L,0x77L},0xA4509BA8L,20369,0xBDL,5L,-4L,18446744073709551615UL,18446744073709551615UL,0L},{{0x4017B539L,0xEA5AL,0UL,3L,0xAFL,0x21L},0xBC074D5BL,-13557,255UL,0L,0x4072A161L,0x44BED382L,0xDD2DA635L,0x0BAAL}},{{{0x29F0D75CL,0UL,0x228F2791L,0xA001L,0xD7L,0x77L},0xA4509BA8L,20369,0xBDL,5L,-4L,18446744073709551615UL,18446744073709551615UL,0L},{{0x4017B539L,0xEA5AL,0UL,3L,0xAFL,0x21L},0xBC074D5BL,-13557,255UL,0L,0x4072A161L,0x44BED382L,0xDD2DA635L,0x0BAAL},{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{0L,0xB30AL,1UL,-1L,0xBDL,0x0EL},7L,-2720,255UL,-6L,-1L,9UL,0xFA83B1BCL,2L}},{{{0L,0x81C8L,0x72E01065L,1L,0x67L,0L},0xAE200E57L,-42849,0UL,0L,0L,0x14491227L,0xF849239CL,-9L},{{-6L,65532UL,0x9410B6A4L,0x5E4BL,1UL,0xECL},1L,-33302,249UL,-1L,-5L,0x58D7EF22L,7UL,-7L},{{0L,1UL,0x312FCAB7L,6L,0x83L,0L},-7L,-35775,0x64L,0x5A403C840E4E32AELL,1L,0UL,0x40CCF17EL,5L},{{0x2AED33A0L,65527UL,18446744073709551615UL,-1L,0x30L,3L},-1L,14979,0xECL,-1L,0xCB7D24A8L,0xBD798498L,0UL,-7L}}},{{{{-1L,7UL,0x9F3C047DL,-1L,9UL,1L},0x52E1B6B8L,-2390,0xB8L,-1L,0xB11A1C0FL,0xB8A9CEF3L,18446744073709551607UL,1L},{{0xBAA3AB5BL,1UL,0UL,0xE166L,0x9AL,0xA2L},0x881A695FL,-28901,246UL,-1L,0L,1UL,0x39DC7586L,0L},{{0x2AED33A0L,65527UL,18446744073709551615UL,-1L,0x30L,3L},-1L,14979,0xECL,-1L,0xCB7D24A8L,0xBD798498L,0UL,-7L},{{0L,0x977CL,1UL,0xEBA3L,0x60L,0L},0x7A3D25F9L,-45682,0xE9L,0xFF965A7EDEBA7A77LL,1L,0xC8FED1E3L,0x2F0EFFFCL,-1L}},{{{-7L,0UL,0UL,0x04E7L,0x11L,0L},0x3D92FAE0L,-6597,0xB9L,0x1C1C2EC7A5AB885FLL,0xD7DF0733L,0xB7851531L,0UL,0x9E82L},{{8L,65527UL,0x455FC390L,1L,7UL,-1L},0x082F665CL,15876,0UL,-8L,0x1315EBA2L,0xA0125BEEL,0x2536ED13L,1L},{{0x90AF9399L,0x9888L,0x67591474L,4L,0x89L,0xA9L},9L,-392,0x67L,0xA17EB532B6527392LL,-1L,0UL,1UL,0xF4E3L},{{1L,65534UL,5UL,8L,0x83L,-8L},-1L,37508,248UL,0L,0xB89234CFL,18446744073709551615UL,0UL,-1L}},{{{0L,0xB30AL,1UL,-1L,0xBDL,0x0EL},7L,-2720,255UL,-6L,-1L,9UL,0xFA83B1BCL,2L},{{-4L,0UL,0UL,0xE157L,0x03L,0x26L},0L,7730,8UL,0x28B95A61F5457EA2LL,0xECCC277EL,1UL,0xE0E4B966L,7L},{{0x5D30A338L,65535UL,0xAC93AB42L,0xEA58L,0x1DL,0xF8L},0xAF79144FL,-31823,0x23L,0x4F5D0F15E8E2F0C9LL,0xFDE2FAF4L,0x6AD1FC8DL,6UL,0x4042L},{{0xFF498AECL,65535UL,0xFE977848L,0x2BD6L,0x82L,0xF0L},0L,9936,0x0FL,-8L,1L,8UL,18446744073709551615UL,0x7307L}},{{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{0xD7DD30F7L,0x2F90L,0x1F401894L,0x3524L,0xF6L,0x52L},0L,37593,0xA4L,0L,2L,0xC2DEB84EL,5UL,0L},{{0x01E31F96L,9UL,2UL,0x629FL,0xE4L,0L},0x9866150CL,-45874,0x18L,6L,4L,0UL,0xDE2014F4L,0xEA36L},{{0xB22A76E3L,0x81E4L,0x85FBC1E0L,-1L,249UL,0x52L},0xC59F3AB1L,-14741,0UL,-1L,0x7ECF2437L,0xF965A948L,0x4B83E489L,-1L}},{{{0x4A3BD0B4L,0xF156L,0x2102F0D7L,8L,0xEBL,0L},0x3E010817L,-36101,8UL,0x61C598F3B943E04BLL,0xDCDF0253L,18446744073709551612UL,4UL,-1L},{{0xF2E07198L,1UL,18446744073709551606UL,0xBCBBL,5UL,2L},0x8C7AC5C5L,27453,0x54L,7L,5L,18446744073709551615UL,0x854D8A9BL,0L},{{0xF2E07198L,1UL,18446744073709551606UL,0xBCBBL,5UL,2L},0x8C7AC5C5L,27453,0x54L,7L,5L,18446744073709551615UL,0x854D8A9BL,0L},{{0x4A3BD0B4L,0xF156L,0x2102F0D7L,8L,0xEBL,0L},0x3E010817L,-36101,8UL,0x61C598F3B943E04BLL,0xDCDF0253L,18446744073709551612UL,4UL,-1L}},{{{0xD7DD30F7L,0x2F90L,0x1F401894L,0x3524L,0xF6L,0x52L},0L,37593,0xA4L,0L,2L,0xC2DEB84EL,5UL,0L},{{-1L,0xAA42L,0x04EA57FDL,0x005CL,255UL,0x2BL},-5L,-12094,0x7EL,0xEB5AC7EE24B7040ELL,1L,0UL,0xD8D8AFEBL,0x0735L},{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{0xC803399CL,0xD470L,0UL,7L,255UL,0x8AL},0x039B2562L,1937,0UL,-2L,0L,0x8A0338FCL,0UL,0L}},{{{0L,1UL,0x312FCAB7L,6L,0x83L,0L},-7L,-35775,0x64L,0x5A403C840E4E32AELL,1L,0UL,0x40CCF17EL,5L},{{-7L,0UL,0UL,0x04E7L,0x11L,0L},0x3D92FAE0L,-6597,0xB9L,0x1C1C2EC7A5AB885FLL,0xD7DF0733L,0xB7851531L,0UL,0x9E82L},{{1L,0UL,0x5D1307DFL,0x3F76L,8UL,0x14L},0x3F3D7814L,-41767,248UL,0x5B7D0D28520A3355LL,-4L,6UL,1UL,1L},{{0x01E31F96L,9UL,2UL,0x629FL,0xE4L,0L},0x9866150CL,-45874,0x18L,6L,4L,0UL,0xDE2014F4L,0xEA36L}},{{{0xFF498AECL,65535UL,0xFE977848L,0x2BD6L,0x82L,0xF0L},0L,9936,0x0FL,-8L,1L,8UL,18446744073709551615UL,0x7307L},{{0xBAA3AB5BL,1UL,0UL,0xE166L,0x9AL,0xA2L},0x881A695FL,-28901,246UL,-1L,0L,1UL,0x39DC7586L,0L},{{0xBBE32AD1L,0xF7E6L,0xD7949695L,0L,3UL,0x16L},6L,16141,0UL,0xE896791A20FEECE5LL,0xB2344A4DL,0x49D5F010L,0xE4FEC490L,1L},{{0x01E31F96L,9UL,2UL,0x629FL,0xE4L,0L},0x9866150CL,-45874,0x18L,6L,4L,0UL,0xDE2014F4L,0xEA36L}}},{{{{8L,65527UL,0x455FC390L,1L,7UL,-1L},0x082F665CL,15876,0UL,-8L,0x1315EBA2L,0xA0125BEEL,0x2536ED13L,1L},{{-7L,0UL,0UL,0x04E7L,0x11L,0L},0x3D92FAE0L,-6597,0xB9L,0x1C1C2EC7A5AB885FLL,0xD7DF0733L,0xB7851531L,0UL,0x9E82L},{{0xB22A76E3L,0x81E4L,0x85FBC1E0L,-1L,249UL,0x52L},0xC59F3AB1L,-14741,0UL,-1L,0x7ECF2437L,0xF965A948L,0x4B83E489L,-1L},{{0xC803399CL,0xD470L,0UL,7L,255UL,0x8AL},0x039B2562L,1937,0UL,-2L,0L,0x8A0338FCL,0UL,0L}},{{{0L,0xB30AL,1UL,-1L,0xBDL,0x0EL},7L,-2720,255UL,-6L,-1L,9UL,0xFA83B1BCL,2L},{{-1L,0xAA42L,0x04EA57FDL,0x005CL,255UL,0x2BL},-5L,-12094,0x7EL,0xEB5AC7EE24B7040ELL,1L,0UL,0xD8D8AFEBL,0x0735L},{{4L,0xB2E9L,0UL,0x1325L,255UL,0xFEL},0L,-16205,0x72L,0xF7FB2F70B296FEE1LL,0L,0xFC3490DDL,0x5D16A1C7L,0L},{{0x4A3BD0B4L,0xF156L,0x2102F0D7L,8L,0xEBL,0L},0x3E010817L,-36101,8UL,0x61C598F3B943E04BLL,0xDCDF0253L,18446744073709551612UL,4UL,-1L}},{{{7L,0xF4A3L,0x8EF844FAL,0x78DCL,249UL,0L},0xC79B3F9DL,44719,0xFDL,0x340C1869DBDB6D5FLL,0x273433E8L,18446744073709551615UL,18446744073709551613UL,0L},{{0xF2E07198L,1UL,18446744073709551606UL,0xBCBBL,5UL,2L},0x8C7AC5C5L,27453,0x54L,7L,5L,18446744073709551615UL,0x854D8A9BL,0L},{{1L,4UL,18446744073709551607UL,0x9896L,0x7FL,-1L},0x981FE550L,10448,0x2CL,0x24F4CB8E73E41FA2LL,0x139F6487L,0xC3A72692L,0UL,-3L},{{0xB22A76E3L,0x81E4L,0x85FBC1E0L,-1L,249UL,0x52L},0xC59F3AB1L,-14741,0UL,-1L,0x7ECF2437L,0xF965A948L,0x4B83E489L,-1L}},{{{-4L,0UL,0UL,0xE157L,0x03L,0x26L},0L,7730,8UL,0x28B95A61F5457EA2LL,0xECCC277EL,1UL,0xE0E4B966L,7L},{{0xD7DD30F7L,0x2F90L,0x1F401894L,0x3524L,0xF6L,0x52L},0L,37593,0xA4L,0L,2L,0xC2DEB84EL,5UL,0L},{{-6L,4UL,0x03B2DC68L,1L,0UL,0xF0L},0L,12035,255UL,0xEC445D95834BC082LL,0x7F9FBF20L,8UL,18446744073709551615UL,0L},{{0xFF498AECL,65535UL,0xFE977848L,0x2BD6L,0x82L,0xF0L},0L,9936,0x0FL,-8L,1L,8UL,18446744073709551615UL,0x7307L}},{{{0xF2E07198L,1UL,18446744073709551606UL,0xBCBBL,5UL,2L},0x8C7AC5C5L,27453,0x54L,7L,5L,18446744073709551615UL,0x854D8A9BL,0L},{{-4L,0UL,0UL,0xE157L,0x03L,0x26L},0L,7730,8UL,0x28B95A61F5457EA2LL,0xECCC277EL,1UL,0xE0E4B966L,7L},{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{1L,65534UL,5UL,8L,0x83L,-8L},-1L,37508,248UL,0L,0xB89234CFL,18446744073709551615UL,0UL,-1L}},{{{-6L,4UL,0x03B2DC68L,1L,0UL,0xF0L},0L,12035,255UL,0xEC445D95834BC082LL,0x7F9FBF20L,8UL,18446744073709551615UL,0L},{{8L,65527UL,0x455FC390L,1L,7UL,-1L},0x082F665CL,15876,0UL,-8L,0x1315EBA2L,0xA0125BEEL,0x2536ED13L,1L},{{0xD7DD30F7L,0x2F90L,0x1F401894L,0x3524L,0xF6L,0x52L},0L,37593,0xA4L,0L,2L,0xC2DEB84EL,5UL,0L},{{0L,0x977CL,1UL,0xEBA3L,0x60L,0L},0x7A3D25F9L,-45682,0xE9L,0xFF965A7EDEBA7A77LL,1L,0xC8FED1E3L,0x2F0EFFFCL,-1L}},{{{0x4017B539L,0xEA5AL,0UL,3L,0xAFL,0x21L},0xBC074D5BL,-13557,255UL,0L,0x4072A161L,0x44BED382L,0xDD2DA635L,0x0BAAL},{{0xBAA3AB5BL,1UL,0UL,0xE166L,0x9AL,0xA2L},0x881A695FL,-28901,246UL,-1L,0L,1UL,0x39DC7586L,0L},{{0L,0x3B86L,0x0EEE8C32L,-10L,9UL,0L},0x41C6E51FL,5739,0xE0L,-1L,0xF2E05BD6L,0x37E4F118L,8UL,0x1569L},{{0x2AED33A0L,65527UL,18446744073709551615UL,-1L,0x30L,3L},-1L,14979,0xECL,-1L,0xCB7D24A8L,0xBD798498L,0UL,-7L}},{{{-1L,0xB5EBL,8UL,0x996BL,0UL,9L},-7L,23451,246UL,0xC591AD0D95521C6ALL,0x63BD856FL,18446744073709551607UL,0xECEF2815L,-8L},{{-6L,65532UL,0x9410B6A4L,0x5E4BL,1UL,0xECL},1L,-33302,249UL,-1L,-5L,0x58D7EF22L,7UL,-7L},{{-1L,0UL,18446744073709551615UL,0L,0xF8L,0xAFL},0L,-6575,0x64L,1L,-8L,1UL,0xCACEC665L,0x6482L},{{0L,0xB30AL,1UL,-1L,0xBDL,0x0EL},7L,-2720,255UL,-6L,-1L,9UL,0xFA83B1BCL,2L}}},{{{{0L,0xB30AL,1UL,-1L,0xBDL,0x0EL},7L,-2720,255UL,-6L,-1L,9UL,0xFA83B1BCL,2L},{{0x4017B539L,0xEA5AL,0UL,3L,0xAFL,0x21L},0xBC074D5BL,-13557,255UL,0L,0x4072A161L,0x44BED382L,0xDD2DA635L,0x0BAAL},{{0x27B45DA3L,0x6FA7L,0xE24956D8L,0x9A91L,0xB1L,0x81L},0L,13600,8UL,-1L,0xFF518FD1L,1UL,4UL,1L},{{0x4017B539L,0xEA5AL,0UL,3L,0xAFL,0x21L},0xBC074D5BL,-13557,255UL,0L,0x4072A161L,0x44BED382L,0xDD2DA635L,0x0BAAL}},{{{3L,0x6930L,0xEDA59252L,0x4134L,251UL,-1L},-10L,24247,0x76L,3L,0xDF87A587L,0x6421EC14L,0UL,-1L},{{1L,0UL,0x5D1307DFL,0x3F76L,8UL,0x14L},0x3F3D7814L,-41767,248UL,0x5B7D0D28520A3355LL,-4L,6UL,1UL,1L},{{0L,0x977CL,1UL,0xEBA3L,0x60L,0L},0x7A3D25F9L,-45682,0xE9L,0xFF965A7EDEBA7A77LL,1L,0xC8FED1E3L,0x2F0EFFFCL,-1L},{{0xB22A76E3L,0x81E4L,0x85FBC1E0L,-1L,249UL,0x52L},0xC59F3AB1L,-14741,0UL,-1L,0x7ECF2437L,0xF965A948L,0x4B83E489L,-1L}},{{{-1L,0xAA42L,0x04EA57FDL,0x005CL,255UL,0x2BL},-5L,-12094,0x7EL,0xEB5AC7EE24B7040ELL,1L,0UL,0xD8D8AFEBL,0x0735L},{{0x29F0D75CL,0UL,0x228F2791L,0xA001L,0xD7L,0x77L},0xA4509BA8L,20369,0xBDL,5L,-4L,18446744073709551615UL,18446744073709551615UL,0L},{{0L,0x81C8L,0x72E01065L,1L,0x67L,0L},0xAE200E57L,-42849,0UL,0L,0L,0x14491227L,0xF849239CL,-9L},{{-4L,0UL,0UL,0xE157L,0x03L,0x26L},0L,7730,8UL,0x28B95A61F5457EA2LL,0xECCC277EL,1UL,0xE0E4B966L,7L}},{{{1L,0UL,0x5D1307DFL,0x3F76L,8UL,0x14L},0x3F3D7814L,-41767,248UL,0x5B7D0D28520A3355LL,-4L,6UL,1UL,1L},{{0x4A3BD0B4L,0xF156L,0x2102F0D7L,8L,0xEBL,0L},0x3E010817L,-36101,8UL,0x61C598F3B943E04BLL,0xDCDF0253L,18446744073709551612UL,4UL,-1L},{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{0xBAA3AB5BL,1UL,0UL,0xE166L,0x9AL,0xA2L},0x881A695FL,-28901,246UL,-1L,0L,1UL,0x39DC7586L,0L}},{{{1L,0UL,0x5D1307DFL,0x3F76L,8UL,0x14L},0x3F3D7814L,-41767,248UL,0x5B7D0D28520A3355LL,-4L,6UL,1UL,1L},{{-1L,0xB5EBL,8UL,0x996BL,0UL,9L},-7L,23451,246UL,0xC591AD0D95521C6ALL,0x63BD856FL,18446744073709551607UL,0xECEF2815L,-8L},{{0L,0x81C8L,0x72E01065L,1L,0x67L,0L},0xAE200E57L,-42849,0UL,0L,0L,0x14491227L,0xF849239CL,-9L},{{0xBBE32AD1L,0xF7E6L,0xD7949695L,0L,3UL,0x16L},6L,16141,0UL,0xE896791A20FEECE5LL,0xB2344A4DL,0x49D5F010L,0xE4FEC490L,1L}},{{{-1L,0xAA42L,0x04EA57FDL,0x005CL,255UL,0x2BL},-5L,-12094,0x7EL,0xEB5AC7EE24B7040ELL,1L,0UL,0xD8D8AFEBL,0x0735L},{{0xBAA3AB5BL,1UL,0UL,0xE166L,0x9AL,0xA2L},0x881A695FL,-28901,246UL,-1L,0L,1UL,0x39DC7586L,0L},{{0L,0x977CL,1UL,0xEBA3L,0x60L,0L},0x7A3D25F9L,-45682,0xE9L,0xFF965A7EDEBA7A77LL,1L,0xC8FED1E3L,0x2F0EFFFCL,-1L},{{0L,0x3B86L,0x0EEE8C32L,-10L,9UL,0L},0x41C6E51FL,5739,0xE0L,-1L,0xF2E05BD6L,0x37E4F118L,8UL,0x1569L}},{{{3L,0x6930L,0xEDA59252L,0x4134L,251UL,-1L},-10L,24247,0x76L,3L,0xDF87A587L,0x6421EC14L,0UL,-1L},{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{0x27B45DA3L,0x6FA7L,0xE24956D8L,0x9A91L,0xB1L,0x81L},0L,13600,8UL,-1L,0xFF518FD1L,1UL,4UL,1L},{{-1L,65527UL,9UL,-6L,255UL,0x54L},-10L,-8588,246UL,0x12366F3207EC12A4LL,-2L,0xC5C4181FL,0x85053C60L,0x7890L}},{{{0L,0xB30AL,1UL,-1L,0xBDL,0x0EL},7L,-2720,255UL,-6L,-1L,9UL,0xFA83B1BCL,2L},{{0xFF498AECL,65535UL,0xFE977848L,0x2BD6L,0x82L,0xF0L},0L,9936,0x0FL,-8L,1L,8UL,18446744073709551615UL,0x7307L},{{-1L,0UL,18446744073709551615UL,0L,0xF8L,0xAFL},0L,-6575,0x64L,1L,-8L,1UL,0xCACEC665L,0x6482L},{{-1L,0xD146L,0xBC5FE914L,4L,0xFAL,0x39L},0x5CC12873L,43622,0x1BL,0xC7ADF7EC5E964938LL,0L,18446744073709551614UL,0x3D2DBDF6L,-10L}}},{{{{-1L,0xB5EBL,8UL,0x996BL,0UL,9L},-7L,23451,246UL,0xC591AD0D95521C6ALL,0x63BD856FL,18446744073709551607UL,0xECEF2815L,-8L},{{-6L,4UL,0x03B2DC68L,1L,0UL,0xF0L},0L,12035,255UL,0xEC445D95834BC082LL,0x7F9FBF20L,8UL,18446744073709551615UL,0L},{{0L,0x3B86L,0x0EEE8C32L,-10L,9UL,0L},0x41C6E51FL,5739,0xE0L,-1L,0xF2E05BD6L,0x37E4F118L,8UL,0x1569L},{{0xB22A76E3L,0x81E4L,0x85FBC1E0L,-1L,249UL,0x52L},0xC59F3AB1L,-14741,0UL,-1L,0x7ECF2437L,0xF965A948L,0x4B83E489L,-1L}},{{{0x4017B539L,0xEA5AL,0UL,3L,0xAFL,0x21L},0xBC074D5BL,-13557,255UL,0L,0x4072A161L,0x44BED382L,0xDD2DA635L,0x0BAAL},{{0L,0x81C8L,0x72E01065L,1L,0x67L,0L},0xAE200E57L,-42849,0UL,0L,0L,0x14491227L,0xF849239CL,-9L},{{0xD7DD30F7L,0x2F90L,0x1F401894L,0x3524L,0xF6L,0x52L},0L,37593,0xA4L,0L,2L,0xC2DEB84EL,5UL,0L},{{-1L,7UL,0x9F3C047DL,-1L,9UL,1L},0x52E1B6B8L,-2390,0xB8L,-1L,0xB11A1C0FL,0xB8A9CEF3L,18446744073709551607UL,1L}},{{{-6L,4UL,0x03B2DC68L,1L,0UL,0xF0L},0L,12035,255UL,0xEC445D95834BC082LL,0x7F9FBF20L,8UL,18446744073709551615UL,0L},{{-1L,0xD146L,0xBC5FE914L,4L,0xFAL,0x39L},0x5CC12873L,43622,0x1BL,0xC7ADF7EC5E964938LL,0L,18446744073709551614UL,0x3D2DBDF6L,-10L},{{-3L,0xE6AFL,5UL,-1L,0xE3L,-1L},0x8694BF53L,2901,0xBDL,-1L,0x20A76EACL,18446744073709551615UL,18446744073709551615UL,5L},{{0L,0x97AAL,18446744073709551615UL,0xF61AL,0UL,-1L},0x6AB6AC12L,10488,255UL,0xE7C18F3DE01FE945LL,0L,18446744073709551615UL,18446744073709551615UL,0x7A06L}},{{{0xF2E07198L,1UL,18446744073709551606UL,0xBCBBL,5UL,2L},0x8C7AC5C5L,27453,0x54L,7L,5L,18446744073709551615UL,0x854D8A9BL,0L},{{3L,0x6930L,0xEDA59252L,0x4134L,251UL,-1L},-10L,24247,0x76L,3L,0xDF87A587L,0x6421EC14L,0UL,-1L},{{-6L,4UL,0x03B2DC68L,1L,0UL,0xF0L},0L,12035,255UL,0xEC445D95834BC082LL,0x7F9FBF20L,8UL,18446744073709551615UL,0L},{{3L,8UL,0xD89F6CE2L,0L,0x2AL,7L},1L,-8424,0x13L,-4L,0x97DA0DE0L,0x9E86EC98L,0UL,-2L}},{{{-4L,0UL,0UL,0xE157L,0x03L,0x26L},0L,7730,8UL,0x28B95A61F5457EA2LL,0xECCC277EL,1UL,0xE0E4B966L,7L},{{0xBAA3AB5BL,1UL,0UL,0xE166L,0x9AL,0xA2L},0x881A695FL,-28901,246UL,-1L,0L,1UL,0x39DC7586L,0L},{{1L,4UL,18446744073709551607UL,0x9896L,0x7FL,-1L},0x981FE550L,10448,0x2CL,0x24F4CB8E73E41FA2LL,0x139F6487L,0xC3A72692L,0UL,-3L},{{1L,4UL,18446744073709551607UL,0x9896L,0x7FL,-1L},0x981FE550L,10448,0x2CL,0x24F4CB8E73E41FA2LL,0x139F6487L,0xC3A72692L,0UL,-3L}},{{{7L,0xF4A3L,0x8EF844FAL,0x78DCL,249UL,0L},0xC79B3F9DL,44719,0xFDL,0x340C1869DBDB6D5FLL,0x273433E8L,18446744073709551615UL,18446744073709551613UL,0L},{{7L,0xF4A3L,0x8EF844FAL,0x78DCL,249UL,0L},0xC79B3F9DL,44719,0xFDL,0x340C1869DBDB6D5FLL,0x273433E8L,18446744073709551615UL,18446744073709551613UL,0L},{{4L,0xB2E9L,0UL,0x1325L,255UL,0xFEL},0L,-16205,0x72L,0xF7FB2F70B296FEE1LL,0L,0xFC3490DDL,0x5D16A1C7L,0L},{{0x3DFCB99FL,0xB9CDL,18446744073709551615UL,0x1A51L,1UL,0x22L},0x11CA3486L,34034,0xDBL,1L,9L,0xB9C491AFL,0xFE4A5913L,9L}},{{{0L,0xB30AL,1UL,-1L,0xBDL,0x0EL},7L,-2720,255UL,-6L,-1L,9UL,0xFA83B1BCL,2L},{{-1L,7UL,0x9F3C047DL,-1L,9UL,1L},0x52E1B6B8L,-2390,0xB8L,-1L,0xB11A1C0FL,0xB8A9CEF3L,18446744073709551607UL,1L},{{0xB22A76E3L,0x81E4L,0x85FBC1E0L,-1L,249UL,0x52L},0xC59F3AB1L,-14741,0UL,-1L,0x7ECF2437L,0xF965A948L,0x4B83E489L,-1L},{{0x29F0D75CL,0UL,0x228F2791L,0xA001L,0xD7L,0x77L},0xA4509BA8L,20369,0xBDL,5L,-4L,18446744073709551615UL,18446744073709551615UL,0L}},{{{0L,0xBFF5L,18446744073709551615UL,0L,0x09L,0x56L},-10L,-5060,3UL,0x8691E71D05F848BBLL,0xA452A0FAL,0x4A32C417L,0xAA6482A2L,0x6E57L},{{0x3DFCB99FL,0xB9CDL,18446744073709551615UL,0x1A51L,1UL,0x22L},0x11CA3486L,34034,0xDBL,1L,9L,0xB9C491AFL,0xFE4A5913L,9L},{{-1L,0UL,18446744073709551615UL,0L,0xF8L,0xAFL},0L,-6575,0x64L,1L,-8L,1UL,0xCACEC665L,0x6482L},{{-1L,0xB5EBL,8UL,0x996BL,0UL,9L},-7L,23451,246UL,0xC591AD0D95521C6ALL,0x63BD856FL,18446744073709551607UL,0xECEF2815L,-8L}}}}; static volatile int32_t g_3095 = 0x84A9C299L;/* VOLATILE GLOBAL g_3095 */ static uint16_t g_3097[8] = {0xF07AL,0x2D1CL,0xF07AL,0x2D1CL,0xF07AL,0x2D1CL,0xF07AL,0x2D1CL}; static int32_t g_3130 = 1L; static union U2 g_3134 = {0xAAFA655B94B63088LL};/* VOLATILE GLOBAL g_3134 */ static volatile union U2 g_3152 = {-6L};/* VOLATILE GLOBAL g_3152 */ static union U2 g_3174 = {-1L};/* VOLATILE GLOBAL g_3174 */ static int32_t ** volatile g_3194 = (void*)0;/* VOLATILE GLOBAL g_3194 */ static int32_t ** volatile g_3195 = &g_446[5];/* VOLATILE GLOBAL g_3195 */ static uint64_t * const *g_3212 = &g_2563; static uint64_t * const **g_3211 = &g_3212; static const volatile struct S1 g_3216 = {{-9L,1UL,0x0B833E97L,1L,0x59L,0x92L},-9L,7454,0xEBL,-9L,0x54A7F3E9L,18446744073709551609UL,0x60C7901AL,0xD3D6L};/* VOLATILE GLOBAL g_3216 */ static union U2 * const *g_3291 = &g_709; static union U2 * const **g_3290 = &g_3291; static volatile struct S0 g_3348 = {0x2ACA8666L,0x795BL,0x6DA73CC2L,0x52F2L,0x6DL,0x69L};/* VOLATILE GLOBAL g_3348 */ static struct S1 g_3352 = {{-2L,0x66D9L,0UL,1L,0x1DL,0x6DL},0x4CEFBC08L,19131,1UL,-1L,0xB11AE788L,0xE2C8D500L,0xE9703D3BL,0x0D1EL};/* VOLATILE GLOBAL g_3352 */ static union U2 g_3430 = {0xC8C782B939A318C1LL};/* VOLATILE GLOBAL g_3430 */ static int16_t **g_3462[6] = {&g_396,&g_396,&g_396,&g_396,&g_396,&g_396}; static int16_t *** const g_3461 = &g_3462[2]; static int16_t *** const *g_3460[8] = {&g_3461,&g_3461,&g_3461,&g_3461,&g_3461,&g_3461,&g_3461,&g_3461}; static uint8_t ***g_3482 = (void*)0; static volatile int64_t g_3533 = 0x60982FC79B7B90F1LL;/* VOLATILE GLOBAL g_3533 */ static int32_t ** volatile g_3541 = (void*)0;/* VOLATILE GLOBAL g_3541 */ static struct S1 g_3543 = {{0x5B7004E4L,4UL,18446744073709551615UL,2L,9UL,0L},0L,4363,0UL,0x19B56FC3AA0ED88DLL,0x238FD830L,3UL,18446744073709551606UL,9L};/* VOLATILE GLOBAL g_3543 */ static struct S1 g_3544 = {{0x6BF042BDL,0x953BL,4UL,0x9F18L,8UL,1L},0x2EAF2B0AL,-13238,255UL,0x2CA3A0F6D58B8DF8LL,-1L,0x623DF90EL,0UL,-1L};/* VOLATILE GLOBAL g_3544 */ static struct S0 ** const **g_3551 = &g_3057; static struct S0 g_3696[5] = {{-7L,0xE48CL,0x1B61F19CL,-1L,0UL,-1L},{-7L,0xE48CL,0x1B61F19CL,-1L,0UL,-1L},{-7L,0xE48CL,0x1B61F19CL,-1L,0UL,-1L},{-7L,0xE48CL,0x1B61F19CL,-1L,0UL,-1L},{-7L,0xE48CL,0x1B61F19CL,-1L,0UL,-1L}}; static struct S0 ****g_3699 = (void*)0; static union U2 g_3763 = {0x59CDDB63A871C638LL};/* VOLATILE GLOBAL g_3763 */ static uint16_t * volatile g_3766 = &g_1550.f0.f1;/* VOLATILE GLOBAL g_3766 */ static uint32_t **g_3790 = &g_36; static uint32_t ***g_3789 = &g_3790; /* --- FORWARD DECLARATIONS --- */ static uint8_t func_1(void); static int16_t func_6(uint32_t p_7, int32_t p_8); static uint8_t func_9(int16_t p_10, int8_t p_11); static uint8_t func_12(int32_t p_13, int32_t p_14, uint64_t p_15, uint64_t p_16); static int16_t func_17(uint32_t p_18, int64_t p_19, uint32_t p_20, int16_t p_21); static struct S0 func_22(int32_t p_23, int64_t p_24); static struct S0 func_30(uint32_t p_31); static uint32_t * func_44(uint32_t * p_45, uint32_t p_46, const uint32_t * p_47, uint32_t * p_48, uint64_t p_49); static uint8_t func_58(int16_t p_59, int16_t p_60, int64_t p_61, uint32_t * p_62); static uint32_t func_68(uint32_t * p_69, int64_t p_70); /* --- FUNCTIONS --- */ /* ------------------------------------------ */ /* * reads : g_26 g_36 g_37 g_446 g_273 g_315 g_445 g_857.f5 g_746.f1 g_506.f4.f3 g_744 g_444 g_380.f4.f5 g_783 g_43.f5 g_1234 g_94 g_1365.f1 g_1455 g_1233 g_96 g_994 g_1490 g_113 g_1381 g_521 g_794 g_198 g_1598 g_1550.f0.f2 g_1607 g_1506 g_846 g_1655 g_1667 g_1668 g_1753 g_1554.f2 g_1767 g_327 g_328 g_1554.f3 g_42 g_1697 g_1698 g_1830 g_425.f0.f5 g_1320 g_1931.f0 g_857 g_1926 g_1258 g_566 g_567 g_1882 g_1285.f1 g_1554.f1 g_791 g_792 g_2079 g_2095 g_237 g_238 g_2109 g_2114 g_2117 g_1550.f1 g_1109 g_2151 g_876 g_193 g_1140.f0 g_2283 g_269 g_2286 g_1734 g_1365 g_2368 g_1554.f0 g_72.f0.f0 g_265.f4.f5 g_796 g_797 g_1554.f5 g_2466 g_317 g_2480 g_236 g_2537 g_2555 g_2562 g_1746 g_2563 g_263 g_877 g_265.f4.f2 g_1170 g_2720 g_2748 g_1667.f4.f1 g_2137.f4.f5 g_72 g_616 g_2779 g_2794 g_2805 g_2684 g_2822 g_2825 g_2839 g_602 g_712.f4.f5 g_2411.f0.f3 g_2884 g_1055.f4.f2 g_380.f4.f1 g_2957 g_2978 g_2411 g_2987 g_425.f6 g_3022 g_425.f0.f2 g_3031 g_1153 g_2169 g_533 g_425.f0.f3 g_1029 g_1550.f6 g_3097 g_1974 g_3130 g_380.f2 g_3134 g_3152 g_3174 g_3032 g_836 g_3195 g_3211 g_1931 g_3216 g_2467 g_2468 g_2271.f1 g_397 g_3290 g_3036 g_2988 * writes: g_26 g_37 g_273 g_315 g_857.f5 g_746.f1 g_506.f4.f3 g_446 g_380.f4.f5 g_1285.f2 g_1365.f1 g_1336 g_96 g_669 g_1055.f4.f1 g_114 g_1550.f0.f5 g_1055.f4.f2 g_1138 g_263 g_380.f2 g_1055.f4.f5 g_94 g_712.f4.f5 g_1455.f1 g_1655 g_265.f4.f1 g_1554.f3 g_42 g_744 g_1550.f4 g_182 g_425.f0.f5 g_1320 g_1554.f1 g_265.f4.f5 g_1607.f5 g_1365.f2 g_193 g_2168 g_72.f0.f3 g_521 g_1285.f1 g_425.f4 g_506.f4.f1 g_1234 g_2304 g_212.f3 g_746.f3 g_1153.f3 g_1753.f3 g_1550.f0.f3 g_1455.f3 g_1365.f3 g_1258 g_791 g_1554.f5 g_857.f3 g_2480 g_328 g_2562 g_1746 g_265.f4.f2 g_2684 g_1170 g_1667.f4.f1 g_2137.f4.f5 g_566 g_2411.f6 g_2151.f0.f3 g_2411.f0.f3 g_380.f4.f1 g_2151.f0.f2 g_1698 g_2988 g_425.f6 g_425.f0.f2 g_448 g_3034 g_72.f4 g_2978.f0.f5 g_3057 g_72.f0.f5 g_425.f0.f3 g_2078 g_1550.f6 g_3097 g_2957.f4.f3 g_1055.f4.f3 g_2978.f4 g_36 g_1607.f1 g_265.f2 g_2271.f1 g_2169 g_3290 g_2411.f0.f2 g_1767 g_1233 */ static uint8_t func_1(void) { /* block id: 0 */ uint32_t *l_25 = &g_26; int32_t l_29 = 0xC6A3F154L; uint8_t l_38 = 0x19L; uint8_t l_1754 = 0x5EL; int32_t l_2022 = 0x5E665F9FL; uint32_t l_2749 = 4294967295UL; uint32_t l_3055 = 0UL; uint32_t *l_3073 = &g_1550.f6; int32_t l_3316 = 0xF811A07EL; int32_t *l_3341 = &l_2022; const int8_t *l_3357 = &g_1830.f5; union U2 **l_3366 = &g_709; union U2 ** const *l_3365 = &l_3366; uint8_t l_3373 = 0x2EL; uint64_t *l_3387 = &g_1258; struct S0 *** const l_3396 = (void*)0; int16_t * const *l_3402 = (void*)0; int8_t ****l_3440 = &g_3036; int32_t l_3510 = 5L; int32_t l_3511 = 1L; int32_t l_3513 = 0x2BE8D789L; int32_t l_3515[2][3]; uint32_t **l_3550 = (void*)0; const uint16_t *l_3765 = &g_1830.f1; uint16_t l_3809 = 0xF5B5L; uint16_t l_3816 = 65535UL; uint8_t **l_3828 = (void*)0; uint8_t ***l_3829 = (void*)0; uint8_t ***l_3830 = &g_1233; int i, j; for (i = 0; i < 2; i++) { for (j = 0; j < 3; j++) l_3515[i][j] = 0x43BCFDF3L; } if ((safe_add_func_uint16_t_u_u(((l_3316 |= (safe_lshift_func_int16_t_s_s(func_6(((*l_3073) ^= (func_9((func_12((l_2022 = (func_17(((func_22(((++(*l_25)) || 1L), ((l_29 , l_29) , (func_30((safe_div_func_uint64_t_u_u(((safe_mul_func_uint64_t_u_u(0x8D2321210CBEDFA9LL, (1L | l_29))) <= ((void*)0 != g_36)), l_38))) , l_1754))) , l_2022) != l_38), l_2022, l_29, l_1754) , l_38)), l_29, l_38, l_2749) <= l_38), l_3055) | 0xB3L)), l_1754), 10))) && 1L), 65535UL))) { /* block id: 1521 */ uint8_t l_3321 = 250UL; uint64_t l_3324 = 6UL; int32_t *l_3336 = (void*)0; int32_t *l_3337 = &g_1746; l_2022 |= ((*l_3337) ^= (safe_lshift_func_uint16_t_u_u((g_1667 , ((((safe_rshift_func_uint32_t_u_s((((0x554ACB998E851533LL < ((*g_1882) > l_3321)) && (safe_div_func_uint64_t_u_u(l_3324, (safe_mod_func_int64_t_s_s((-8L), (safe_add_func_uint8_t_u_u((((safe_unary_minus_func_uint64_t_u(0xCA8CA0B77B0BFBAALL)) , (safe_lshift_func_uint32_t_u_u(l_3321, 11))) >= ((*l_25)--)), ((safe_mod_func_uint8_t_u_u((*g_1234), l_3321)) , l_3321)))))))) && l_3316), 7)) | l_29) > 18446744073709551606UL) <= 0L)), l_38))); } else { /* block id: 1525 */ int32_t *l_3340 = &g_1746; for (g_2411.f0.f2 = 0; (g_2411.f0.f2 != 42); ++g_2411.f0.f2) { /* block id: 1528 */ l_3341 = l_3340; } } for (g_1767 = 0; (g_1767 <= 1); g_1767 += 1) { /* block id: 1534 */ uint8_t l_3359 = 0xE8L; int8_t * const l_3360 = (void*)0; int32_t l_3362 = 0x0CF4AF62L; int32_t *l_3379 = &l_29; uint64_t *l_3386[5]; int32_t l_3388 = 0x9B174CEEL; uint32_t l_3389 = 0x14D75E83L; int64_t *l_3401 = &g_2978.f4; int64_t *l_3403 = (void*)0; int64_t *l_3404 = (void*)0; int64_t *l_3405 = &g_1229; uint32_t l_3406 = 1UL; uint64_t l_3439 = 0UL; int32_t l_3512 = 6L; int32_t l_3514[4] = {(-1L),(-1L),(-1L),(-1L)}; int16_t l_3526 = 0xFB43L; const int32_t l_3570 = (-1L); uint32_t *l_3694[8]; uint16_t l_3727 = 65535UL; const int16_t ***l_3735 = (void*)0; const int16_t ****l_3734 = &l_3735; const int16_t *****l_3733 = &l_3734; uint64_t l_3748[5] = {0x14DAF9C632E80E00LL,0x14DAF9C632E80E00LL,0x14DAF9C632E80E00LL,0x14DAF9C632E80E00LL,0x14DAF9C632E80E00LL}; struct S0 ** const l_3760[10][9] = {{&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328},{&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328},{&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328},{&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328},{&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328},{&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328},{&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328},{&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328},{&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328},{&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328,&g_328}}; int32_t l_3815[9][10][1] = {{{1L},{3L},{(-8L)},{3L},{1L},{0x0AD256A2L},{1L},{3L},{(-8L)},{3L}},{{1L},{0x0AD256A2L},{1L},{3L},{(-8L)},{3L},{1L},{0x0AD256A2L},{1L},{3L}},{{(-8L)},{3L},{1L},{0x0AD256A2L},{1L},{3L},{(-8L)},{3L},{1L},{0x0AD256A2L}},{{1L},{3L},{(-8L)},{3L},{1L},{0x0AD256A2L},{1L},{3L},{(-8L)},{3L}},{{1L},{0x0AD256A2L},{1L},{3L},{(-8L)},{3L},{1L},{0x0AD256A2L},{1L},{3L}},{{(-8L)},{3L},{1L},{0x0AD256A2L},{1L},{3L},{(-8L)},{3L},{1L},{7L}},{{(-8L)},{0x0AD256A2L},{0x3865DF72L},{0x0AD256A2L},{(-8L)},{7L},{(-8L)},{0x0AD256A2L},{0x3865DF72L},{0x0AD256A2L}},{{(-8L)},{7L},{(-8L)},{0x0AD256A2L},{0x3865DF72L},{0x0AD256A2L},{(-8L)},{7L},{(-8L)},{0x0AD256A2L}},{{0x3865DF72L},{0x0AD256A2L},{(-8L)},{7L},{(-8L)},{0x0AD256A2L},{0x3865DF72L},{0x0AD256A2L},{(-8L)},{7L}}}; uint8_t l_3824[9][1] = {{0xC7L},{255UL},{0xC7L},{255UL},{0xC7L},{255UL},{0xC7L},{255UL},{0xC7L}}; int i, j, k; for (i = 0; i < 5; i++) l_3386[i] = (void*)0; for (i = 0; i < 8; i++) l_3694[i] = &g_96; } (*g_269) = ((((*l_3830) = l_3828) != (void*)0) != (*l_3341)); return (*g_1234); } /* ------------------------------------------ */ /* * reads : g_1882 g_1285.f1 g_1233 g_1234 g_94 g_876 g_193 g_744 g_444 g_445 g_3097 g_616 g_566 g_567 g_2978.f0.f5 g_1974 g_2563 g_263 g_1554.f2 g_1767 g_36 g_794.f6 g_37 g_327 g_328 g_1554.f3 g_42 g_1697 g_1698 g_783 g_43.f5 g_1830 g_1931.f0 g_3130 g_269 g_846 g_380.f2 g_3134 g_1607.f1 g_3152 g_1926 g_1109 g_3174 g_3031 g_3032 g_836 g_2562 g_3195 g_113 g_1258 g_3211 g_1381 g_1931 g_3216 g_796 g_797 g_521 g_2095 g_1753.f0 g_2467 g_2468 g_2114 g_2079 g_2271.f1 g_2169 g_533 g_397 g_3290 g_3036 g_2988 * writes: g_1285.f1 g_3097 g_2957.f4.f3 g_1055.f4.f3 g_380.f2 g_2978.f0.f5 g_263 g_506.f4.f3 g_1554.f3 g_42 g_744 g_1550.f4 g_182 g_425.f0.f5 g_1320 g_193 g_2978.f4 g_36 g_712.f4.f5 g_1607.f1 g_265.f2 g_1258 g_446 g_114 g_521 g_273 g_2271.f1 g_2169 g_3290 */ static int16_t func_6(uint32_t p_7, int32_t p_8) { /* block id: 1412 */ uint32_t *l_3078 = &g_794[3][0].f6; int32_t l_3079 = 1L; int32_t ***l_3086[8] = {&g_445,&g_445,&g_445,&g_445,&g_445,&g_445,&g_445,&g_445}; const int16_t ***l_3087 = (void*)0; uint8_t l_3088 = 254UL; int32_t l_3093 = 1L; int64_t l_3096 = 0L; int16_t l_3149 = 0x3BC4L; uint64_t * const **l_3214 = &g_3212; int32_t l_3248 = 0x693AED02L; union U2 * const **l_3295 = &g_3291; uint32_t l_3313 = 0x8F0F691AL; uint8_t l_3314 = 0UL; int i; l_3088 &= ((*g_1882) > (safe_div_func_int8_t_s_s((safe_sub_func_int64_t_s_s((((void*)0 == l_3078) == l_3079), ((((**g_1233) , ((safe_lshift_func_int32_t_s_s(((((safe_rshift_func_int32_t_s_s(((safe_mod_func_uint32_t_u_u((((l_3086[6] == l_3086[0]) , 7L) | ((void*)0 != l_3087)), (-1L))) != 0x93L), 8)) & (*g_876)) > (-1L)) , (*g_876)), 1)) , (**g_744))) != (**g_744)) < 7L))), 1UL))); for (g_1285.f1 = (-24); (g_1285.f1 <= 21); g_1285.f1++) { /* block id: 1416 */ int32_t l_3091 = 0L; int32_t l_3092[10] = {0xDE7F97E7L,0xDE7F97E7L,0xDE7F97E7L,0xDE7F97E7L,0xDE7F97E7L,0xDE7F97E7L,0xDE7F97E7L,0xDE7F97E7L,0xDE7F97E7L,0xDE7F97E7L}; int8_t l_3094[9] = {(-10L),(-10L),(-10L),(-10L),(-10L),(-10L),(-10L),(-10L),(-10L)}; int64_t **l_3127 = &g_569[3][0]; struct S0 ***l_3156 = &g_2684; int32_t l_3253 = (-1L); int32_t l_3254 = 3L; int8_t **l_3272 = &g_846; int32_t **l_3279 = &g_446[3]; uint32_t l_3280 = 3UL; int i; ++g_3097[3]; for (g_2957.f4.f3 = 7; (g_2957.f4.f3 >= 0); g_2957.f4.f3 -= 1) { /* block id: 1420 */ int64_t **l_3106 = &g_569[3][0]; int32_t l_3129 = (-1L); uint32_t l_3145 = 18446744073709551613UL; int16_t l_3153 = 8L; int8_t l_3172 = 0xA2L; uint32_t **l_3180[2][7]; int32_t * const l_3193[7][6] = {{&l_3092[9],&l_3092[9],&l_3092[9],&l_3092[9],(void*)0,&g_193},{&g_273,&g_193,&g_1746,&g_1746,(void*)0,&g_1746},{(void*)0,&l_3079,(void*)0,&g_273,(void*)0,&g_315},{&g_1746,&g_193,&g_273,(void*)0,(void*)0,&g_273},{&l_3092[9],&l_3092[9],&l_3092[9],(void*)0,&g_193,&g_273},{&g_1746,&l_3092[9],&g_315,&g_273,&g_315,&l_3092[9]},{(void*)0,&g_1746,&g_315,&g_1746,&l_3092[9],&g_273}}; union U2 **l_3257 = &g_709; int32_t **l_3277 = &g_446[4]; int i, j; for (i = 0; i < 2; i++) { for (j = 0; j < 7; j++) l_3180[i][j] = &g_36; } for (g_1055.f4.f3 = 5; (g_1055.f4.f3 >= 0); g_1055.f4.f3 -= 1) { /* block id: 1423 */ uint32_t l_3111[7] = {1UL,1UL,4294967292UL,1UL,1UL,4294967292UL,1UL}; int32_t l_3131 = 0x1683B71AL; int16_t ****l_3191[3][9][9] = {{{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]}},{{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]}},{{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]},{&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0],&g_2169[0],(void*)0,&g_2169[0]},{&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0],&g_2169[0]}}}; int32_t l_3192 = 0x4E6149E7L; int32_t ****l_3210 = (void*)0; int32_t l_3223 = 1L; int32_t l_3224 = 0x7A7B6939L; uint32_t l_3225 = 4294967286UL; int i, j, k; for (g_380.f2 = 1; (g_380.f2 <= 8); g_380.f2 += 1) { /* block id: 1426 */ uint32_t l_3126 = 1UL; uint16_t *l_3163[10][1] = {{&g_1455[1].f1},{&g_1667.f2},{&g_1455[1].f1},{&g_1667.f2},{&g_1455[1].f1},{&g_1667.f2},{&g_1455[1].f1},{&g_1667.f2},{&g_1455[1].f1},{&g_1667.f2}}; uint64_t *l_3173 = (void*)0; int32_t l_3175 = 0x18DD4445L; int i, j; for (g_2978.f0.f5 = 0; (g_2978.f0.f5 <= 8); g_2978.f0.f5 += 1) { /* block id: 1429 */ int32_t l_3112[4]; int32_t l_3128 = 0L; int i; for (i = 0; i < 4; i++) l_3112[i] = (-10L); l_3131 = (((*g_269) = ((((((safe_lshift_func_uint8_t_u_s((((void*)0 != (**g_616)) && (safe_rshift_func_int16_t_s_s((safe_rshift_func_uint64_t_u_s((func_22(((l_3128 &= (l_3106 != ((safe_rshift_func_int64_t_s_u(l_3092[g_2978.f0.f5], ((*g_2563) = ((((safe_rshift_func_int32_t_s_s((((l_3112[0] = (l_3111[1] , p_8)) , (safe_sub_func_int32_t_s_s((safe_div_func_uint16_t_u_u(((safe_mul_func_int64_t_s_s((safe_mul_func_uint64_t_u_u(((g_1974 , (((safe_add_func_uint32_t_u_u((((safe_mod_func_uint8_t_u_u(((!(p_7 ^ p_7)) ^ 0x0AA2L), p_7)) >= 0xAC6AD2CEL) <= l_3112[0]), l_3126)) > 0x2857F35CL) != 0xFDL)) >= p_8), l_3112[0])), (*g_2563))) != p_8), l_3094[5])), p_7))) ^ 0xE0L), p_8)) , p_8) , (void*)0) == &g_2467)))) , l_3127))) == l_3092[g_2978.f0.f5]), l_3129) , 0UL), 17)), 9))), g_3130)) > (-1L)) || p_8) != (*g_1882)) == l_3094[1]) != p_8)) > 4294967295UL); } l_3092[6] = 0x93000967L; for (g_2978.f4 = 0; (g_2978.f4 <= 9); g_2978.f4 += 1) { /* block id: 1439 */ uint32_t *l_3132[3][10][8] = {{{&g_26,&g_96,&l_3111[1],&g_26,(void*)0,&g_37,&l_3111[0],&g_26},{&g_26,&g_26,&g_26,(void*)0,&l_3111[5],(void*)0,(void*)0,&g_37},{(void*)0,(void*)0,&g_26,&g_96,&g_669,(void*)0,(void*)0,&l_3111[5]},{&g_669,&l_3111[1],&g_669,&g_26,&g_669,&g_37,&g_26,(void*)0},{&l_3111[2],&l_3111[1],&l_3111[4],&g_96,&l_3111[5],(void*)0,&g_26,&l_3111[5]},{&g_37,&g_26,&g_26,(void*)0,&l_3111[6],&l_3111[1],&g_669,(void*)0},{&g_669,&g_26,&g_669,&g_26,&l_3111[1],&g_669,(void*)0,&l_3111[1]},{&g_669,&l_3111[1],&g_37,&l_3111[4],&g_26,&g_26,&l_3111[1],&l_3111[1]},{&g_96,&g_37,&l_3111[2],&l_3111[1],(void*)0,&l_3111[1],&g_26,&g_37},{&g_37,(void*)0,&g_26,&g_37,&g_37,&g_96,&g_669,&g_26}},{{&g_26,&l_3111[1],&l_3111[1],&g_669,&g_37,&g_669,&g_37,&g_669},{&g_669,&g_37,&g_669,&g_669,(void*)0,&g_37,&g_669,&g_37},{&l_3111[1],&g_37,&g_26,&g_96,&g_37,&l_3111[5],(void*)0,&g_26},{&l_3111[1],&l_3111[1],(void*)0,&g_669,(void*)0,&g_96,&g_37,&g_37},{&g_669,&g_669,(void*)0,(void*)0,&g_37,&g_26,&g_37,&l_3111[1]},{&g_26,(void*)0,&l_3111[4],&g_669,&g_37,(void*)0,&g_669,(void*)0},{&g_37,(void*)0,&l_3111[1],&g_37,(void*)0,&g_669,(void*)0,&l_3111[2]},{&g_96,(void*)0,(void*)0,&g_26,&g_26,&g_96,(void*)0,(void*)0},{&g_669,&l_3111[4],&l_3111[6],&g_37,&l_3111[1],(void*)0,&l_3111[1],&l_3111[1]},{&g_669,&g_26,&l_3111[1],&g_26,&l_3111[6],&l_3111[3],&g_37,(void*)0}},{{&g_37,&l_3111[6],(void*)0,&g_26,&l_3111[5],&g_96,&l_3111[2],(void*)0},{&l_3111[2],&l_3111[1],&l_3111[6],&g_669,&g_669,&l_3111[6],&l_3111[1],(void*)0},{&g_669,(void*)0,&g_669,&l_3111[6],&g_669,&g_37,(void*)0,&l_3111[1]},{(void*)0,(void*)0,&l_3111[3],&g_26,&g_669,&g_26,&l_3111[4],&l_3111[4]},{&g_669,&l_3111[1],(void*)0,(void*)0,&l_3111[1],&g_669,&l_3111[2],&g_26},{&l_3111[1],&l_3111[3],&g_37,&g_669,&g_669,&l_3111[4],&g_26,(void*)0},{&g_26,&g_96,(void*)0,&g_96,&g_26,(void*)0,&g_37,&g_669},{&g_37,&g_26,&g_669,(void*)0,&l_3111[6],&g_26,&g_37,&g_26},{&l_3111[1],&l_3111[1],(void*)0,&g_96,(void*)0,&g_37,&g_96,&g_96},{&l_3111[1],(void*)0,&l_3111[1],&g_26,&g_37,&l_3111[0],&l_3111[2],&g_96}}}; uint32_t **l_3133 = &g_36; const int16_t *l_3137 = &g_2271.f3; uint16_t *l_3138 = &g_1607.f1; int i, j, k; l_3131 = ((((((***g_1697) = (l_3132[2][9][4] == ((*l_3133) = l_3078))) != (((((l_3094[g_380.f2] | ((g_3134 , ((*l_3138) ^= (safe_lshift_func_int32_t_s_u(((void*)0 != l_3137), 22)))) <= (safe_div_func_int64_t_s_s((-2L), (safe_sub_func_uint16_t_u_u((safe_div_func_uint32_t_u_u(l_3145, (safe_div_func_int32_t_s_s(((safe_unary_minus_func_uint64_t_u(p_7)) ^ p_8), p_8)))), (-1L))))))) < l_3129) || 0x18486A5DL) == l_3094[g_380.f2]) | 0xA0AFB218L)) || 0L) , l_3094[7]) & l_3149); l_3131 ^= (safe_sub_func_uint16_t_u_u(((g_3152 , l_3153) != (safe_div_func_int64_t_s_s((l_3092[2] &= l_3129), l_3111[0]))), 0L)); } l_3175 |= ((l_3156 != &g_327) >= ((safe_add_func_int64_t_s_s(l_3111[1], (safe_mul_func_int8_t_s_s((safe_div_func_uint8_t_u_u((((g_265.f2 = (*g_1882)) | (l_3094[3] ^ ((p_7 < (safe_div_func_uint8_t_u_u(((safe_mul_func_uint64_t_u_u((safe_mod_func_int8_t_s_s((safe_div_func_uint64_t_u_u((((((((((l_3126 , l_3092[2]) != ((*g_1926) = ((*g_2563) ^= (l_3153 , l_3172)))) || l_3111[1]) < p_7) , l_3092[2]) || (*g_1109)) , g_3174) , 1UL) < (-1L)), l_3094[7])), 1UL)), p_8)) & (***g_3031)), l_3094[0]))) <= (*g_1882)))) , 249UL), l_3153)), 247UL)))) , (*g_1882))); } if (l_3111[1]) break; if (((((((l_3131 = (l_3129 ^= 0x62L)) > (safe_div_func_uint32_t_u_u(((((**g_1698) = (((g_836 , (((l_3192 = (safe_add_func_uint32_t_u_u((p_8 ^ (l_3180[1][1] == (void*)0)), ((safe_mul_func_uint64_t_u_u(((((((*g_876) = (p_8 != ((safe_mul_func_int16_t_s_s((safe_mod_func_uint16_t_u_u((*g_1882), (safe_sub_func_int8_t_s_s(0xFCL, (((safe_rshift_func_int16_t_s_u((l_3191[2][3][5] == (void*)0), 8)) & l_3091) && l_3111[1]))))), 9L)) == p_8))) ^ 0x5255446EL) ^ 255UL) ^ p_8) && (**g_2562)), l_3145)) > p_8)))) , p_8) && 65532UL)) <= 4294967293UL) != p_7)) <= 0x88L) >= 7UL), (*g_36)))) && l_3129) & 0x3EDE2D8FDB697E55LL) > 1UL) != 1UL)) { /* block id: 1458 */ int32_t *l_3196 = &l_3129; (*g_3195) = l_3193[1][0]; (*g_113) = l_3196; } else { /* block id: 1461 */ int32_t *****l_3209 = &g_744; uint64_t * const ***l_3213[10][4][5] = {{{&g_3211,&g_3211,&g_3211,(void*)0,(void*)0},{&g_3211,&g_3211,&g_3211,(void*)0,&g_3211},{(void*)0,&g_3211,(void*)0,&g_3211,(void*)0},{&g_3211,&g_3211,&g_3211,&g_3211,&g_3211}},{{&g_3211,&g_3211,(void*)0,(void*)0,&g_3211},{&g_3211,&g_3211,&g_3211,&g_3211,&g_3211},{&g_3211,(void*)0,&g_3211,&g_3211,(void*)0},{&g_3211,&g_3211,(void*)0,&g_3211,&g_3211}},{{&g_3211,&g_3211,&g_3211,&g_3211,(void*)0},{&g_3211,&g_3211,&g_3211,&g_3211,&g_3211},{&g_3211,&g_3211,&g_3211,(void*)0,&g_3211},{&g_3211,&g_3211,&g_3211,&g_3211,(void*)0}},{{&g_3211,&g_3211,&g_3211,&g_3211,&g_3211},{&g_3211,&g_3211,(void*)0,(void*)0,&g_3211},{&g_3211,&g_3211,&g_3211,(void*)0,(void*)0},{&g_3211,&g_3211,&g_3211,(void*)0,&g_3211}},{{(void*)0,&g_3211,(void*)0,&g_3211,(void*)0},{&g_3211,&g_3211,&g_3211,&g_3211,&g_3211},{&g_3211,&g_3211,(void*)0,(void*)0,&g_3211},{&g_3211,&g_3211,&g_3211,&g_3211,&g_3211}},{{&g_3211,(void*)0,&g_3211,&g_3211,(void*)0},{&g_3211,&g_3211,(void*)0,&g_3211,&g_3211},{&g_3211,&g_3211,&g_3211,&g_3211,(void*)0},{&g_3211,&g_3211,&g_3211,&g_3211,&g_3211}},{{&g_3211,&g_3211,&g_3211,(void*)0,&g_3211},{&g_3211,&g_3211,&g_3211,&g_3211,(void*)0},{&g_3211,&g_3211,&g_3211,&g_3211,&g_3211},{&g_3211,&g_3211,(void*)0,(void*)0,&g_3211}},{{&g_3211,&g_3211,&g_3211,(void*)0,(void*)0},{&g_3211,&g_3211,&g_3211,(void*)0,&g_3211},{(void*)0,&g_3211,(void*)0,&g_3211,&g_3211},{&g_3211,&g_3211,(void*)0,(void*)0,(void*)0}},{{&g_3211,&g_3211,&g_3211,&g_3211,&g_3211},{&g_3211,&g_3211,&g_3211,&g_3211,(void*)0},{&g_3211,&g_3211,(void*)0,(void*)0,&g_3211},{(void*)0,&g_3211,&g_3211,&g_3211,&g_3211}},{{(void*)0,&g_3211,(void*)0,(void*)0,&g_3211},{(void*)0,&g_3211,&g_3211,&g_3211,(void*)0},{(void*)0,&g_3211,&g_3211,&g_3211,&g_3211},{(void*)0,(void*)0,&g_3211,(void*)0,&g_3211}}}; int64_t *l_3215[5][5] = {{&g_1931[1][7].f4,(void*)0,&g_182[1],&l_3096,&g_1550.f4},{&g_1931[1][7].f4,&g_182[1],(void*)0,&g_182[1],&g_1931[1][7].f4},{(void*)0,(void*)0,&g_2411.f4,&l_3096,&g_425.f4},{&g_2411.f4,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,&g_182[1],&g_1931[1][7].f4,(void*)0,&g_425.f4}}; int32_t l_3220 = 0x1194636CL; int32_t l_3221 = 0xCC2A0DF4L; int32_t l_3222 = (-6L); uint8_t l_3251 = 0x08L; uint16_t l_3258 = 0x39BBL; uint32_t l_3259 = 0x71E4C567L; int i, j, k; if ((safe_sub_func_uint8_t_u_u((~(***g_3031)), ((*g_1381) = (l_3092[4] >= (safe_rshift_func_uint32_t_u_s(l_3092[2], (((p_7 , p_7) == (*g_1926)) <= ((((!(((safe_div_func_uint64_t_u_u((((0x54L || ((safe_rshift_func_int32_t_s_s(((l_3214 = ((((*l_3209) = (((void*)0 != (*g_566)) , (void*)0)) != l_3210) , g_3211)) != &g_2562), p_8)) == 0xD3F0L)) , &g_2169[0]) != &g_2169[0]), p_8)) , l_3215[4][1]) == (void*)0)) <= p_7) != l_3094[4]) != 0x54E9L))))))))) { /* block id: 1465 */ int8_t l_3217 = 1L; int32_t l_3218 = 0x97F99D08L; int32_t l_3219 = (-1L); l_3092[2] ^= (g_1931[1][7] , (g_3216 , (p_8 | ((void*)0 != &g_1598)))); ++l_3225; if (p_7) break; (*g_113) = (*g_796); } else { /* block id: 1470 */ uint16_t l_3236 = 0xE5EBL; int32_t l_3252 = 0x94C8ABB1L; l_3254 = ((0xEEEC4321L >= ((safe_lshift_func_uint8_t_u_s((((safe_add_func_int32_t_s_s(((safe_mod_func_uint8_t_u_u((*g_1234), (l_3092[2] ^= (p_7 < (safe_add_func_uint16_t_u_u(0x8034L, l_3236)))))) & (~(l_3253 &= ((safe_mod_func_uint8_t_u_u((safe_mod_func_int8_t_s_s(((((l_3252 &= (safe_lshift_func_int8_t_s_s(((safe_div_func_int32_t_s_s(p_7, ((((*g_876) <= ((((safe_div_func_int32_t_s_s((l_3248 , (safe_lshift_func_uint8_t_u_u((*g_1381), p_8))), 4294967295UL)) > p_7) & p_7) >= p_8)) == 0x4223FFACC9E373DALL) , (*g_2095)))) < l_3251), 1))) & (**g_2562)) > 0x80L) || p_8), p_7)), 0x56L)) ^ p_8)))), l_3094[4])) ^ p_7) & p_8), p_7)) < (-10L))) <= 0x7A4EDBB4348B009FLL); l_3252 = (safe_lshift_func_int32_t_s_u((l_3092[5] = ((l_3257 != (*g_2467)) | (l_3258 = (*g_783)))), 30)); } if (l_3259) break; } } (*g_2114) = (l_3092[4] = p_8); if (((((-5L) & 65527UL) || ((safe_add_func_int32_t_s_s(((void*)0 != &g_533), (p_8 >= 1L))) > ((((p_8 == (((1UL <= p_8) , 0UL) > 251UL)) != (*g_1882)) < l_3094[3]) == (*g_1882)))) != l_3253)) { /* block id: 1484 */ (*g_2079) = 0x149A0FD7L; } else { /* block id: 1486 */ int32_t l_3262[9] = {(-4L),(-4L),(-4L),(-4L),(-4L),(-4L),(-4L),(-4L),(-4L)}; const int16_t l_3281 = 1L; int32_t *****l_3282 = &g_744; int i; for (g_2271.f1 = 0; (g_2271.f1 <= 6); g_2271.f1 += 1) { /* block id: 1489 */ uint32_t l_3276 = 1UL; l_3262[7] = ((*g_876) = 0L); for (l_3149 = 3; (l_3149 >= 0); l_3149 -= 1) { /* block id: 1494 */ int16_t ****l_3275 = &g_2169[0]; int32_t **l_3278 = &g_446[2]; int i; l_3092[2] &= (safe_lshift_func_uint8_t_u_u((safe_div_func_uint64_t_u_u(g_94[g_2271.f1], (0xA7D1L ^ 65535UL))), ((*g_1381) = (safe_mul_func_int16_t_s_s((func_22((safe_mod_func_int64_t_s_s((safe_unary_minus_func_uint16_t_u((((void*)0 == l_3272) != 0L))), ((safe_add_func_uint64_t_u_u(g_94[(l_3149 + 2)], (((*l_3275) = &g_533) != (void*)0))) | g_94[g_2271.f1]))), g_94[g_2271.f1]) , l_3276), p_8))))); l_3279 = (l_3278 = (((***l_3275) != (void*)0) , l_3277)); } return p_8; } if (l_3280) break; if (l_3281) continue; (*l_3282) = &g_444[1]; } } } for (p_8 = 10; (p_8 > (-2)); p_8--) { /* block id: 1511 */ const int16_t l_3287 = 0xD3A8L; union U2 * const ***l_3292 = &g_3290; union U2 * const **l_3294 = &g_3291; union U2 * const ***l_3293[8][5] = {{(void*)0,&l_3294,(void*)0,(void*)0,&l_3294},{&l_3294,(void*)0,(void*)0,&l_3294,(void*)0},{&l_3294,&l_3294,&l_3294,&l_3294,&l_3294},{(void*)0,&l_3294,(void*)0,(void*)0,&l_3294},{&l_3294,(void*)0,(void*)0,&l_3294,(void*)0},{&l_3294,&l_3294,&l_3294,&l_3294,&l_3294},{(void*)0,&l_3294,(void*)0,(void*)0,&l_3294},{&l_3294,(void*)0,(void*)0,&l_3294,(void*)0}}; int32_t **l_3312 = &g_446[4]; int32_t l_3315 = 0xE112FA28L; int i, j; l_3315 = (((safe_add_func_int32_t_s_s(l_3287, ((safe_rshift_func_uint8_t_u_u(1UL, (p_7 , (((l_3295 = ((*l_3292) = g_3290)) == (void*)0) & (l_3314 = ((((***g_3036) = p_7) & (safe_mul_func_int32_t_s_s(((safe_div_func_int8_t_s_s((safe_sub_func_int8_t_s_s((safe_unary_minus_func_uint16_t_u((++(*g_1882)))), ((((safe_add_func_uint8_t_u_u((!p_8), l_3287)) | ((safe_div_func_uint64_t_u_u((safe_add_func_uint32_t_u_u((((void*)0 != l_3312) <= l_3313), 0UL)), (**g_2562))) || p_8)) , 0x5AL) ^ 0xFFL))), (*g_1234))) && p_8), 0x0C921FA3L))) < p_7)))))) <= p_8))) || p_7) && 0UL); } return p_8; } /* ------------------------------------------ */ /* * reads : g_2978.f0.f5 g_72.f0.f5 g_425.f0.f3 g_445 g_1029 * writes: g_2978.f0.f5 g_3057 g_72.f0.f5 g_425.f0.f3 g_446 g_2078 */ static uint8_t func_9(int16_t p_10, int8_t p_11) { /* block id: 1387 */ uint32_t *l_3059[2][5] = {{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_669,&g_669,&g_669,&g_669,&g_669}}; int32_t l_3060 = (-1L); const int32_t l_3061 = 0xCC93D204L; int32_t l_3063 = 0xBD7C6280L; int32_t *l_3064 = &g_315; int32_t *l_3065 = &g_1746; int32_t *l_3066 = (void*)0; int32_t *l_3067 = &g_315; int32_t *l_3068[5]; int16_t l_3069 = 0x8524L; uint8_t l_3070 = 0x73L; int i, j; for (i = 0; i < 5; i++) l_3068[i] = &l_3060; for (g_2978.f0.f5 = 0; (g_2978.f0.f5 <= 4); g_2978.f0.f5 += 1) { /* block id: 1390 */ struct S0 ** const *l_3056 = &g_2684; g_3057 = l_3056; for (g_72.f0.f5 = 0; (g_72.f0.f5 >= 0); g_72.f0.f5 -= 1) { /* block id: 1394 */ int i; for (g_425.f0.f3 = 3; (g_425.f0.f3 >= 1); g_425.f0.f3 -= 1) { /* block id: 1397 */ int32_t *l_3058 = &g_1746; int i, j, k; g_2078[g_2978.f0.f5][g_2978.f0.f5][(g_72.f0.f5 + 3)] = ((*g_445) = l_3058); return g_1029[(g_425.f0.f3 + 1)]; } if (g_1029[g_2978.f0.f5]) break; } } (*g_445) = &l_3063; l_3070++; return p_11; } /* ------------------------------------------ */ /* * reads : g_1490 g_876 g_193 g_1697 g_1698 g_36 g_1233 g_1234 g_94 g_1882 g_1285.f1 g_783 g_43.f5 g_113 g_72 g_616 g_2779 g_2079 g_273 g_1926 g_1258 g_2562 g_2563 g_42 g_2794 g_1931.f0 g_37 g_2095 g_1753.f0 g_1746 g_2805 g_2684 g_2822 g_2825 g_1381 g_521 g_263 g_2839 g_2151.f6 g_602 g_796 g_797 g_2884 g_2114 g_2957 g_2978 g_2411 g_2987 g_1554.f2 g_1767 g_327 g_328 g_1554.f3 g_1830 g_269 g_3022 g_425.f0.f2 g_3031 g_1153 g_2169 g_533 g_1667.f4.f1 g_2137.f4.f5 g_712.f4.f5 g_2151.f0.f3 g_1055.f4.f2 g_380.f4.f1 g_2151.f0.f2 g_425.f6 * writes: g_1667.f4.f1 g_37 g_2137.f4.f5 g_114 g_712.f4.f5 g_566 g_2411.f6 g_263 g_1746 g_328 g_2151.f0.f3 g_2411.f0.f3 g_94 g_1554.f5 g_1055.f4.f2 g_521 g_193 g_380.f4.f1 g_2151.f0.f2 g_1698 g_1234 g_2988 g_446 g_425.f6 g_265.f4.f1 g_265.f4.f2 g_1285.f1 g_425.f0.f2 g_506.f4.f3 g_1554.f3 g_42 g_744 g_1550.f4 g_182 g_425.f0.f5 g_1320 g_448 g_3034 g_1258 g_72.f4 */ static uint8_t func_12(int32_t p_13, int32_t p_14, uint64_t p_15, uint64_t p_16) { /* block id: 1210 */ uint32_t *l_2756 = &g_794[3][0].f6; const int32_t l_2762 = 0x74C9AA7BL; int32_t l_2763[7] = {0xE979B40BL,0xE979B40BL,0xE979B40BL,0xE979B40BL,0xE979B40BL,0xE979B40BL,0xE979B40BL}; uint32_t *l_2768 = (void*)0; int16_t * const *l_2850[7][1][4] = {{{&g_396,&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5]}},{{&g_397[0][0][5],&g_397[0][0][5],&g_396,&g_396}},{{&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],(void*)0}},{{&g_396,&g_396,&g_397[0][0][5],&g_397[0][0][5]}},{{&g_397[0][0][5],&g_396,&g_397[1][0][4],&g_397[0][0][5]}},{{&g_396,&g_396,&g_396,&g_397[0][0][5]}},{{&g_396,&g_396,&g_396,(void*)0}}}; int16_t * const **l_2849 = &l_2850[6][0][1]; uint32_t l_2885 = 0x639EA6E1L; int32_t **l_2887 = &g_446[4]; uint64_t **l_2898 = &g_2563; uint64_t **l_2900 = &g_2563; uint32_t l_2916[9] = {18446744073709551609UL,18446744073709551609UL,18446744073709551615UL,18446744073709551609UL,18446744073709551609UL,18446744073709551615UL,18446744073709551609UL,18446744073709551609UL,18446744073709551615UL}; uint64_t l_2953 = 0xF0A436E510F2F9ABLL; int8_t **l_2960 = (void*)0; union U2 *l_2991 = &g_2137; int8_t * const ***l_3028 = &g_1697; int8_t * const ****l_3027 = &l_3028; int8_t *****l_3033 = (void*)0; int i, j, k; lbl_2868: for (g_1667.f4.f1 = 0; (g_1667.f4.f1 > 25); ++g_1667.f4.f1) { /* block id: 1213 */ int32_t l_2757 = (-8L); l_2757 &= ((safe_rshift_func_int8_t_s_u((((((p_15 , (safe_rshift_func_int64_t_s_u(0x1CF53B271D75B935LL, 36))) , g_1490) , ((*g_876) == ((*g_36) = (p_15 & ((void*)0 != (*g_1697)))))) | (l_2756 != (void*)0)) == p_16), (**g_1233))) || (*g_1882)); } for (g_2137.f4.f5 = 1; (g_2137.f4.f5 >= 0); g_2137.f4.f5 -= 1) { /* block id: 1219 */ int64_t l_2769 = 0x4B7032429FE933A0LL; uint32_t *l_2770 = &g_37; uint16_t l_2771 = 0x96CCL; int64_t ****l_2780 = &g_567[0][0][1]; int32_t l_2803 = 0x8086330AL; int16_t l_2852 = 0x02A1L; uint16_t l_2869 = 0xAC3AL; int32_t **l_2886 = &g_446[4]; int32_t *l_2888 = &l_2763[6]; int32_t *l_2889[1][3]; uint32_t l_2890 = 4294967288UL; int16_t **l_2931 = &g_397[2][2][0]; int16_t ****l_2958 = &g_2169[0]; uint32_t **l_2992[1]; int8_t *l_3001 = &g_1365.f5; uint32_t **l_3030 = &l_2768; uint32_t ***l_3029 = &l_3030; uint32_t l_3041[10][8] = {{4294967295UL,4294967295UL,4294967293UL,4294967295UL,4294967295UL,0xA5358DF0L,0xB52AE55DL,0x3AC46661L},{4294967295UL,0xA5358DF0L,0xB52AE55DL,0x3AC46661L,0xB52AE55DL,0xA5358DF0L,4294967295UL,4294967295UL},{4294967294UL,0xA9AA0C93L,4294967294UL,0x3AC46661L,4294967295UL,0x3AC46661L,4294967294UL,0xA9AA0C93L},{4294967294UL,0xA5358DF0L,0x4EE6C286L,4294967291UL,4294967295UL,0xA9AA0C93L,4294967295UL,4294967291UL},{4294967293UL,0xA5358DF0L,4294967293UL,0xA9AA0C93L,4294967294UL,0x3AC46661L,4294967295UL,0x3AC46661L},{0xB52AE55DL,0xA9AA0C93L,0x4EE6C286L,0xA9AA0C93L,0xB52AE55DL,4294967295UL,4294967294UL,4294967291UL},{0xB52AE55DL,4294967295UL,4294967294UL,4294967291UL,4294967294UL,4294967295UL,0xB52AE55DL,0xA9AA0C93L},{4294967293UL,0xA9AA0C93L,4294967294UL,0x3AC46661L,4294967295UL,0x3AC46661L,4294967294UL,0xA9AA0C93L},{4294967294UL,0xA5358DF0L,0x4EE6C286L,4294967291UL,4294967295UL,0xA9AA0C93L,4294967295UL,4294967291UL},{4294967293UL,0xA5358DF0L,4294967293UL,0xA9AA0C93L,4294967294UL,0x3AC46661L,4294967295UL,0x3AC46661L}}; uint32_t l_3052 = 1UL; int i, j; for (i = 0; i < 1; i++) { for (j = 0; j < 3; j++) l_2889[i][j] = &g_315; } for (i = 0; i < 1; i++) l_2992[i] = &l_2756; if ((l_2763[6] = (safe_rshift_func_uint64_t_u_s((safe_mul_func_uint64_t_u_u(1UL, l_2762)), ((*g_783) ^ p_15))))) { /* block id: 1221 */ return l_2763[3]; } else { /* block id: 1223 */ uint32_t *l_2764 = (void*)0; uint32_t **l_2765 = (void*)0; uint32_t **l_2766 = (void*)0; uint32_t **l_2767[3]; int32_t l_2772 = 0x9BC14385L; int64_t **l_2801[3][9] = {{&g_569[5][0],&g_569[8][0],&g_569[5][0],&g_569[3][0],&g_569[4][0],&g_569[3][0],&g_569[4][0],&g_569[3][0],&g_569[5][0]},{&g_569[4][0],&g_569[4][0],&g_569[5][0],&g_569[8][0],&g_569[8][0],&g_569[3][0],&g_569[5][0],&g_569[3][0],&g_569[8][0]},{&g_569[5][0],&g_569[4][0],&g_569[4][0],&g_569[5][0],&g_569[8][0],&g_569[8][0],&g_569[3][0],&g_569[5][0],&g_569[3][0]}}; int64_t l_2802 = 0x6B9EE78528639312LL; int8_t l_2815 = 0x98L; int i, j; for (i = 0; i < 3; i++) l_2767[i] = (void*)0; p_14 = p_16; (*g_113) = &p_13; for (g_712.f4.f5 = 0; (g_712.f4.f5 <= 0); g_712.f4.f5 += 1) { /* block id: 1229 */ uint32_t l_2773 = 0x6D115CC9L; int64_t ****l_2778 = &g_567[1][2][0]; int32_t *l_2781 = &l_2763[6]; int32_t l_2807 = 3L; uint32_t l_2830 = 4294967292UL; int i, j; (*l_2781) = (l_2773 , (((g_72 , (((safe_rshift_func_uint64_t_u_u((p_15 != (safe_sub_func_uint32_t_u_u(l_2763[6], l_2771))), (((*g_616) = l_2778) == (l_2780 = g_2779)))) > (-5L)) && p_15)) && l_2773) , l_2771)); for (g_2411.f6 = 0; (g_2411.f6 <= 2); g_2411.f6 += 1) { /* block id: 1235 */ int16_t l_2782[6]; int32_t *l_2804 = &g_1746; int i; for (i = 0; i < 6; i++) l_2782[i] = 0x3D19L; (*l_2781) = (*g_2079); l_2782[4] = (*l_2781); (*l_2804) |= ((l_2772 = (safe_mul_func_uint8_t_u_u(((safe_mul_func_uint16_t_u_u((l_2803 |= (safe_mul_func_uint8_t_u_u((safe_add_func_uint16_t_u_u((((((!l_2762) , (safe_div_func_uint64_t_u_u(0UL, ((**g_2562) = (*g_1926))))) , ((g_42 , g_2794) , (l_2802 = (safe_lshift_func_uint8_t_u_u((safe_div_func_int32_t_s_s((g_1931[1][7].f0 , (safe_sub_func_uint16_t_u_u((*g_1882), ((((l_2801[2][5] != l_2801[1][6]) != 0xCED2043CL) , 4294967294UL) | (*g_36))))), (*g_2095))), 6))))) == (*g_36)) < 1L), l_2772)), l_2782[4]))), p_14)) & p_15), (*l_2781)))) , (*g_876)); (*g_2684) = (((*g_1882) , g_2805) , (((l_2772 = 9L) <= (p_14 <= 0xCAL)) , (void*)0)); } if (p_14) continue; for (g_2151.f0.f3 = 0; (g_2151.f0.f3 <= 2); g_2151.f0.f3 += 1) { /* block id: 1249 */ uint32_t l_2808 = 1UL; int32_t l_2831[1][8] = {{0xAE16D071L,0xAE16D071L,0xAE16D071L,0xAE16D071L,0xAE16D071L,0xAE16D071L,0xAE16D071L,0xAE16D071L}}; int i, j; for (g_2411.f0.f3 = 2; (g_2411.f0.f3 >= 0); g_2411.f0.f3 -= 1) { /* block id: 1252 */ int32_t *l_2806[7][1][10] = {{{&l_2803,&l_2803,&g_42,&l_2803,&l_2803,&l_2803,&l_2803,&g_42,&l_2803,&l_2803}},{{&g_42,&l_2803,&l_2803,&l_2803,&l_2803,&l_2803,&l_2803,&l_2803,&g_42,&g_42}},{{&l_2803,&g_42,&g_1746,&l_2803,&l_2803,&g_1746,&g_42,&l_2803,&g_1746,&l_2803}},{{&l_2803,&l_2803,&l_2803,&l_2803,&l_2803,&l_2803,&l_2803,&g_42,&g_42,&l_2803}},{{&g_42,&l_2803,&l_2803,&l_2803,&l_2803,&g_42,&l_2803,&l_2803,&l_2803,&g_42}},{{&g_42,&l_2803,&g_1746,&l_2803,&g_42,&g_1746,&l_2803,&l_2803,&g_1746,&g_42}},{{&g_42,&l_2803,&l_2803,&g_42,&l_2803,&g_42,&g_42,&g_42,&l_2803,&g_42}}}; int i, j, k; l_2808--; if ((*g_876)) continue; p_14 |= ((*l_2781) = (*g_876)); p_13 = (safe_mul_func_int8_t_s_s((((255UL && ((p_13 <= (0xF4L & (((safe_unary_minus_func_int64_t_s(((*l_2781) = l_2802))) ^ p_13) & (-7L)))) , 0xA7L)) & (p_14 = (!l_2815))) <= (((safe_mod_func_uint64_t_u_u((p_16 < (-9L)), (*g_1926))) >= 4294967292UL) <= l_2762)), l_2808)); } if (((safe_lshift_func_int32_t_s_u(((((((safe_mod_func_int16_t_s_s((p_13 & p_14), (g_2822[2][5] , ((safe_lshift_func_int8_t_s_s((l_2772 = l_2772), 2)) | 7L)))) , (0L & (l_2831[0][7] |= ((g_2825[2] , (((safe_div_func_uint16_t_u_u((((**g_2562) = (((((**g_1233) ^= (*g_1381)) ^ ((l_2830 || p_16) == 0L)) && 0x01L) || p_14)) == p_16), p_15)) == (*g_1882)) && l_2771)) || l_2763[6])))) , 0UL) , (*l_2781)) | p_15) ^ 7L), 30)) > p_14)) { /* block id: 1265 */ int32_t *l_2832 = (void*)0; int8_t **l_2842 = &g_846; int8_t ***l_2841 = &l_2842; int8_t ****l_2840 = &l_2841; const int16_t ****l_2843 = (void*)0; const int16_t ****l_2844 = (void*)0; const int16_t *l_2848 = &g_2411.f8; const int16_t **l_2847 = &l_2848; const int16_t ***l_2846 = &l_2847; const int16_t ****l_2845 = &l_2846; int8_t *l_2851 = &g_1554.f5; l_2832 = &p_14; l_2852 = ((safe_mod_func_uint32_t_u_u((safe_div_func_uint64_t_u_u((((*g_36) = p_14) != (safe_div_func_uint16_t_u_u((((((*g_2563) = (**g_2562)) < 8UL) < (((((*l_2851) = (l_2763[6] = ((g_2839 , l_2840) == (((0x7018L && p_16) ^ (((((*l_2845) = (void*)0) != (g_2151.f6 , l_2849)) > (*l_2781)) != l_2808)) , (void*)0)))) , l_2815) || 0x15C6003EL) , l_2803)) ^ p_16), p_15))), 18446744073709551615UL)), 0xD0CA8D28L)) && p_13); } else { /* block id: 1273 */ int32_t *l_2866 = (void*)0; int32_t *l_2867 = &l_2831[0][3]; (*l_2867) &= (((((safe_lshift_func_int16_t_s_u((*l_2781), (*g_1882))) || (safe_sub_func_int8_t_s_s((safe_add_func_int16_t_s_s((-1L), ((safe_div_func_int16_t_s_s((safe_sub_func_int8_t_s_s((((((l_2772 | ((*g_36) &= p_13)) || ((safe_add_func_int64_t_s_s(1L, 0x62F4D8BA44002587LL)) , 255UL)) | (~p_14)) , (*g_1926)) | 0L), p_16)), (*g_1882))) <= (*l_2781)))), l_2763[6]))) , g_602) , p_15) ^ 0UL); return p_13; } if (g_521) goto lbl_2868; if (l_2771) { /* block id: 1279 */ (*g_113) = (*g_796); return l_2803; } else { /* block id: 1282 */ return (*g_1234); } } } --l_2869; } p_14 = ((safe_rshift_func_uint64_t_u_u(((safe_lshift_func_int32_t_s_u(p_14, 2)) , (safe_sub_func_int64_t_s_s((l_2803 = (+(safe_rshift_func_int8_t_s_u(((safe_mul_func_uint8_t_u_u(0xF5L, (~(g_2884 , (0xAAL > (l_2885 != (p_13 = (((l_2886 != l_2887) || (*g_1882)) | 0x2226L)))))))) || 7UL), 7)))), p_16))), (*g_2563))) <= p_16); --l_2890; for (g_1055.f4.f2 = 0; (g_1055.f4.f2 <= 2); g_1055.f4.f2 += 1) { /* block id: 1295 */ uint64_t l_2893 = 0x292AD0FAE288CA32LL; uint64_t **l_2896[5] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; uint64_t ***l_2897[7][4][7] = {{{&g_2562,&g_2562,&l_2896[4],&l_2896[4],&l_2896[0],(void*)0,&l_2896[2]},{(void*)0,&g_2562,&g_2562,&g_2562,&g_2562,&g_2562,&g_2562},{&g_2562,&g_2562,(void*)0,&l_2896[2],&g_2562,&g_2562,&l_2896[0]},{&l_2896[4],&g_2562,&l_2896[0],&g_2562,&l_2896[4],(void*)0,&l_2896[0]}},{{&l_2896[4],(void*)0,(void*)0,&l_2896[4],&g_2562,(void*)0,(void*)0},{(void*)0,&g_2562,&l_2896[4],&l_2896[4],&l_2896[2],&l_2896[2],&g_2562},{&g_2562,&g_2562,&l_2896[4],(void*)0,&l_2896[0],&l_2896[4],&g_2562},{&g_2562,&l_2896[4],&g_2562,&l_2896[0],&l_2896[2],&l_2896[4],&g_2562}},{{&l_2896[0],(void*)0,&l_2896[4],&l_2896[2],&l_2896[4],&l_2896[0],&l_2896[2]},{&l_2896[0],&l_2896[2],&g_2562,(void*)0,&l_2896[2],&l_2896[4],(void*)0},{&g_2562,(void*)0,&l_2896[2],(void*)0,&l_2896[4],(void*)0,&l_2896[4]},{&g_2562,&l_2896[0],&l_2896[4],&l_2896[2],&l_2896[2],(void*)0,&l_2896[4]}},{{&l_2896[4],&l_2896[4],&l_2896[4],&l_2896[0],&l_2896[4],&l_2896[4],&l_2896[0]},{&l_2896[4],&l_2896[4],&l_2896[1],(void*)0,&l_2896[2],(void*)0,&l_2896[2]},{&g_2562,&l_2896[2],&g_2562,&l_2896[4],&g_2562,&l_2896[2],&g_2562},{(void*)0,&l_2896[4],(void*)0,&l_2896[4],&l_2896[0],(void*)0,&l_2896[4]}},{{(void*)0,&g_2562,(void*)0,&g_2562,(void*)0,(void*)0,&l_2896[2]},{&l_2896[2],&l_2896[4],(void*)0,(void*)0,&g_2562,&g_2562,&l_2896[4]},{&l_2896[4],&l_2896[2],&g_2562,&l_2896[4],&l_2896[4],&l_2896[4],&l_2896[2]},{&l_2896[4],&l_2896[4],&l_2896[1],&g_2562,&l_2896[4],&g_2562,(void*)0}},{{&g_2562,&l_2896[4],&l_2896[4],&l_2896[0],&l_2896[4],(void*)0,&l_2896[4]},{(void*)0,&l_2896[0],&l_2896[4],&g_2562,&g_2562,&g_2562,&l_2896[4]},{&l_2896[4],(void*)0,&l_2896[2],&l_2896[4],&l_2896[0],&l_2896[4],&g_2562},{&g_2562,(void*)0,&g_2562,&g_2562,&l_2896[4],&g_2562,&l_2896[2]}},{{&l_2896[2],&l_2896[0],&l_2896[4],&l_2896[2],&g_2562,&g_2562,(void*)0},{&g_2562,&l_2896[4],&g_2562,&l_2896[0],&l_2896[4],&g_2562,&l_2896[4]},{&l_2896[4],&l_2896[4],&l_2896[4],(void*)0,&l_2896[2],&l_2896[2],&l_2896[2]},{(void*)0,&l_2896[2],&l_2896[4],&l_2896[2],(void*)0,&l_2896[2],&g_2562}}}; uint64_t **l_2899 = &g_2563; int32_t l_2939 = (-1L); int32_t l_2942 = 0xC589B4AAL; int32_t l_2945 = 0x0D994A3CL; int32_t l_2946 = 0x4161A5C1L; int32_t l_2950[9][3] = {{0x37EC6D66L,(-1L),(-1L)},{(-1L),(-1L),0L},{0x37EC6D66L,(-1L),0x37EC6D66L},{8L,(-1L),0L},{(-1L),(-1L),0x37EC6D66L},{0L,0x37EC6D66L,0x37EC6D66L},{0x37EC6D66L,8L,(-1L)},{0L,8L,0L},{(-1L),0x37EC6D66L,(-1L)}}; int8_t **l_2956 = &g_846; int16_t * const *** const l_2959[7][1] = {{&l_2849},{&l_2849},{&l_2849},{&l_2849},{&l_2849},{&l_2849},{&l_2849}}; uint8_t *l_2964[5] = {&g_521,&g_521,&g_521,&g_521,&g_521}; struct S0 *l_3039 = &g_3040[5]; int i, j, k; l_2893--; (*g_2114) = (((((l_2898 = l_2896[4]) != (l_2900 = l_2899)) >= p_13) , ((safe_mul_func_int64_t_s_s((+0x85L), (safe_add_func_uint8_t_u_u(0x3EL, ((safe_lshift_func_int32_t_s_s((((*g_1381) ^= ((safe_lshift_func_int32_t_s_s((safe_sub_func_uint8_t_u_u(((safe_div_func_uint8_t_u_u(((((**g_2562) = l_2893) || 2L) == p_15), (safe_rshift_func_int16_t_s_s((&l_2768 != &g_36), p_13)))) > p_14), 1UL)), l_2893)) | (*g_36))) >= 1L), (*g_876))) != l_2916[1]))))) , p_14)) & l_2893); for (g_380.f4.f1 = 0; (g_380.f4.f1 <= 2); g_380.f4.f1 += 1) { /* block id: 1304 */ int16_t **l_2932 = &g_396; int32_t l_2938 = (-1L); int32_t l_2944 = 0x1183375EL; int32_t l_2947 = (-1L); int32_t l_2948 = (-1L); int32_t l_2951 = 0L; int32_t l_2952[6][1][7] = {{{0L,0x2DDC93DDL,6L,(-1L),(-1L),6L,0x2DDC93DDL}},{{(-1L),(-1L),(-2L),(-1L),(-1L),(-1L),(-2L)}},{{(-1L),(-1L),6L,0x2DDC93DDL,0L,0L,0x2DDC93DDL}},{{0x9949E7DCL,0x0588D88EL,0x9949E7DCL,(-1L),0x9949E7DCL,0x0588D88EL,0x9949E7DCL}},{{(-1L),0x2DDC93DDL,0x2DDC93DDL,(-1L),0L,6L,6L}},{{(-1L),0x0588D88EL,(-2L),0x0588D88EL,(-1L),0x0588D88EL,(-2L)}}}; int32_t l_3005 = 0L; uint8_t l_3020[1]; struct S0 *l_3037 = &g_2411.f0; int i, j, k; for (i = 0; i < 1; i++) l_3020[i] = 0x67L; for (g_2151.f0.f2 = 0; (g_2151.f0.f2 <= 2); g_2151.f0.f2 += 1) { /* block id: 1307 */ int32_t l_2917 = 3L; uint64_t **l_2933 = (void*)0; int32_t l_2934[5][1]; int8_t l_2937[9] = {6L,6L,6L,6L,6L,6L,6L,6L,6L}; int8_t l_2949 = 0x04L; int32_t *l_2990 = (void*)0; int i, j, k; for (i = 0; i < 5; i++) { for (j = 0; j < 1; j++) l_2934[i][j] = 0xF2F93DEFL; } if ((l_2917 = p_13)) { /* block id: 1309 */ int32_t l_2920 = 0x672C6303L; int i, j, k; if ((*g_876)) break; if (l_2917) break; l_2934[4][0] &= ((*l_2888) |= ((((safe_sub_func_int16_t_s_s(p_16, l_2920)) & p_13) <= (safe_lshift_func_uint64_t_u_u((**g_2562), (&g_1926 == ((safe_add_func_uint8_t_u_u(((l_2893 & (safe_add_func_int8_t_s_s(((1UL < ((safe_mod_func_uint8_t_u_u(((**g_1233) |= l_2920), ((l_2931 != l_2932) | p_15))) < l_2917)) , p_14), l_2920))) >= l_2917), l_2917)) , l_2933))))) <= (**g_2562))); l_2938 = ((*l_2888) = (safe_mul_func_uint8_t_u_u(249UL, l_2937[1]))); } else { /* block id: 1317 */ int32_t l_2940 = 0xD245631DL; int32_t l_2941 = 0x3C935987L; int32_t l_2943[6][1] = {{0xA334BB71L},{0x7120C2C5L},{0x7120C2C5L},{0xA334BB71L},{0x7120C2C5L},{0x7120C2C5L}}; int i, j; if (p_13) break; l_2938 = ((*l_2888) = 1L); ++l_2953; (*g_1697) = l_2956; } p_13 = (((*g_1234) = ((l_2950[7][0] = ((g_2957 , l_2958) != l_2959[0][0])) < (l_2960 != (void*)0))) , ((+(safe_sub_func_uint16_t_u_u(((l_2964[3] = (void*)0) == ((*g_1233) = (*g_1233))), (safe_add_func_uint32_t_u_u((~(-1L)), 4294967288UL))))) && p_15)); if (l_2951) { /* block id: 1329 */ uint16_t l_2983 = 0x8A6FL; int8_t ** const l_2986 = &g_846; (*l_2888) = (g_2822[1][5] , (safe_mul_func_int64_t_s_s((0xC7F8L || (safe_div_func_int64_t_s_s((l_2947 | 0x822B0D41L), p_15))), (safe_div_func_uint16_t_u_u((*g_1882), (safe_sub_func_int64_t_s_s((safe_mul_func_int32_t_s_s(((g_2978 , (g_2411 , (safe_mul_func_uint8_t_u_u((safe_sub_func_int16_t_s_s(l_2947, p_15)), (*g_783))))) ^ l_2948), (*g_36))), p_15))))))); l_2983++; (*g_2987) = l_2986; } else { /* block id: 1333 */ int32_t *l_2989 = &g_1746; l_2990 = ((*l_2887) = l_2989); } } for (g_425.f6 = 0; (g_425.f6 <= 6); g_425.f6 += 1) { /* block id: 1340 */ int8_t l_3021 = 0xD3L; struct S0 **l_3038[6][6] = {{&l_3037,&l_3037,&l_3037,&l_3037,&l_3037,&l_3037},{&l_3037,(void*)0,&l_3037,&l_3037,&l_3037,&l_3037},{&l_3037,&l_3037,(void*)0,(void*)0,&l_3037,&l_3037},{&l_3037,&l_3037,&l_3037,(void*)0,(void*)0,&l_3037},{&l_3037,&l_3037,(void*)0,&l_3037,(void*)0,&l_3037},{&l_3037,&l_3037,&l_3037,&l_3037,&l_3037,(void*)0}}; int i, j; for (g_265.f4.f1 = 0; (g_265.f4.f1 <= 2); g_265.f4.f1 += 1) { /* block id: 1343 */ int i, j; return l_2951; } for (g_265.f4.f2 = 0; (g_265.f4.f2 <= 2); g_265.f4.f2 += 1) { /* block id: 1348 */ uint32_t **l_2994 = &g_2304; uint32_t ***l_2993 = &l_2994; int32_t l_3004 = 0x85364C08L; l_2991 = l_2991; (*l_2887) = &p_14; (*l_2993) = (l_2992[0] = (void*)0); l_2951 |= ((safe_lshift_func_int8_t_s_s((safe_sub_func_uint32_t_u_u((*g_36), (((*g_1882) = 0xAC32L) && (((safe_lshift_func_int32_t_s_s(((*g_876) = (l_3001 != (void*)0)), 30)) & (safe_sub_func_uint32_t_u_u(((l_3005 = l_3004) < 0xAD63L), ((((safe_rshift_func_uint64_t_u_s((safe_sub_func_uint8_t_u_u((safe_sub_func_uint8_t_u_u(((-7L) == (safe_sub_func_uint8_t_u_u((safe_div_func_int64_t_s_s((safe_div_func_uint8_t_u_u((safe_div_func_int32_t_s_s((((-4L) == ((((0L || (*g_1882)) >= p_13) , 0x52E6L) != l_2939)) > l_3020[0]), 0x403BFE7FL)), p_15)), p_15)), (*g_1234)))), 9L)), 0UL)), l_3004)) , 0xFE5D1C05L) != l_3004) < p_16)))) , p_14)))), l_3021)) >= 251UL); } for (g_425.f0.f2 = 0; (g_425.f0.f2 <= 2); g_425.f0.f2 += 1) { /* block id: 1360 */ int i; p_13 = (func_22(p_14, p_13) , (*g_269)); g_448[g_425.f0.f2] = g_3022; } if (((**g_2562) | ((*g_1926) = ((safe_mod_func_uint32_t_u_u((*l_2888), p_13)) < (((*g_2684) = (void*)0) != (l_3039 = (((((l_2948 != 0x46L) | (safe_lshift_func_int32_t_s_s(((*g_2114) = (-7L)), 26))) , l_3027) == (g_3034[0][7] = ((l_3029 == g_3031) , l_3033))) , l_3037))))))) { /* block id: 1369 */ int64_t *l_3044 = (void*)0; int64_t *l_3045 = &g_72.f4; int32_t l_3050 = (-1L); uint32_t l_3051 = 4UL; l_3041[0][5] = p_14; if (g_2411.f7) goto lbl_2868; p_13 = ((((safe_add_func_uint64_t_u_u(((((*l_3045) = p_16) >= (g_1153[0][0] , ((*g_2563) &= ((**l_2958) != (void*)0)))) || (safe_rshift_func_uint16_t_u_s(((l_2950[4][1] = ((((0L >= ((safe_div_func_uint32_t_u_u(p_15, l_3050)) , 0xEE16AE8193EA2656LL)) == l_3051) >= l_3051) , p_16)) , p_14), p_15))), 0xC4866BCF75475618LL)) || l_3021) , 0x35FFF766L) , 0x33C346B6L); } else { /* block id: 1376 */ (*l_2887) = &p_13; if ((*g_876)) break; l_3052++; } } (*l_2887) = &p_13; } } } return p_13; } /* ------------------------------------------ */ /* * reads : g_857 g_1926 g_1258 g_1234 g_94 g_566 g_567 g_36 g_37 g_1882 g_1285.f1 g_791 g_792 g_2079 g_746.f1 g_2095 g_237 g_238 g_2109 g_1753.f0 g_783 g_43.f5 g_2114 g_2117 g_42 g_1233 g_1550.f1 g_1109 g_2151 g_1381 g_794.f8 g_876 g_193 g_1140.f0 g_2283 g_269 g_2286 g_521 g_445 g_113 g_273 g_1734 g_1365 g_2368 g_744 g_444 g_1554.f0 g_72.f0.f0 g_265.f4.f5 g_796 g_797 g_315 g_1554.f5 g_1697 g_1698 g_846 g_2466 g_317 g_2480 g_236 g_794.f4 g_2537 g_2555 g_2562 g_1746 g_2563 g_263 g_877 g_265.f4.f2 g_1170 g_2720 g_2748 g_1554.f1 * writes: g_1554.f1 g_265.f4.f5 g_1607.f5 g_273 g_1365.f2 g_746.f1 g_37 g_42 g_193 g_94 g_2168 g_72.f0.f3 g_521 g_1285.f1 g_425.f4 g_506.f4.f1 g_1234 g_2304 g_212.f3 g_746.f3 g_1554.f3 g_1153.f3 g_1753.f3 g_1550.f0.f3 g_1455.f3 g_446 g_114 g_1365.f3 g_315 g_1258 g_1365.f1 g_791 g_1554.f5 g_712.f4.f5 g_857.f3 g_2480 g_328 g_2562 g_1746 g_265.f4.f2 g_2684 g_1170 */ static int16_t func_17(uint32_t p_18, int64_t p_19, uint32_t p_20, int16_t p_21) { /* block id: 924 */ uint64_t *l_2027[10] = {(void*)0,&g_1258,(void*)0,(void*)0,&g_1258,(void*)0,(void*)0,&g_1258,(void*)0,(void*)0}; int32_t l_2028 = (-7L); int32_t l_2037 = 8L; int32_t ****l_2046 = (void*)0; int32_t *****l_2047 = &l_2046; int16_t *l_2048[7][6] = {{&g_212[1][4][1].f3,&g_1554.f3,&g_1153[0][0].f3,&g_1153[0][0].f3,&g_1554.f3,&g_212[1][4][1].f3},{&g_746.f3,&g_212[1][4][1].f3,&g_1550.f0.f3,&g_1554.f3,&g_1550.f0.f3,&g_212[1][4][1].f3},{&g_1550.f0.f3,&g_746.f3,&g_1153[0][0].f3,&g_1753.f3,&g_1753.f3,&g_1153[0][0].f3},{&g_1550.f0.f3,&g_1550.f0.f3,&g_1753.f3,&g_1554.f3,&g_1455[1].f3,&g_1554.f3},{&g_746.f3,&g_1550.f0.f3,&g_746.f3,&g_1153[0][0].f3,&g_1753.f3,&g_1753.f3},{&g_212[1][4][1].f3,&g_746.f3,&g_746.f3,&g_212[1][4][1].f3,&g_1550.f0.f3,&g_1554.f3},{&g_1554.f3,&g_212[1][4][1].f3,&g_1753.f3,&g_212[1][4][1].f3,&g_1554.f3,&g_1153[0][0].f3}}; int32_t l_2049[5] = {0x374D9C8AL,0x374D9C8AL,0x374D9C8AL,0x374D9C8AL,0x374D9C8AL}; int32_t l_2050 = 9L; int64_t ***l_2051[9] = {&g_568[5][0][4],&g_568[5][0][4],&g_568[5][0][4],&g_568[5][0][4],&g_568[5][0][4],&g_568[5][0][4],&g_568[5][0][4],&g_568[5][0][4],&g_568[5][0][4]}; uint32_t l_2052 = 0xDDB0655AL; uint32_t l_2053 = 0UL; uint32_t l_2054 = 18446744073709551607UL; union U2 *l_2133 = &g_712; uint8_t **l_2254[8][2] = {{(void*)0,&g_1381},{&g_1381,(void*)0},{&g_1381,(void*)0},{(void*)0,(void*)0},{(void*)0,(void*)0},{(void*)0,(void*)0},{(void*)0,(void*)0},{(void*)0,(void*)0}}; int16_t l_2350[10] = {0x1263L,3L,0x1263L,3L,0x1263L,3L,0x1263L,3L,0x1263L,3L}; uint32_t *l_2431 = &g_37; uint32_t l_2437 = 0xFC25AA35L; uint64_t l_2457 = 8UL; int8_t l_2493 = 0x94L; const int32_t l_2572 = (-8L); int64_t l_2588 = 1L; int16_t ****l_2623 = &g_2169[0]; int8_t **l_2631 = (void*)0; int8_t ** const *l_2630 = &l_2631; int8_t ** const **l_2629 = &l_2630; int8_t ** const ***l_2628 = &l_2629; uint16_t l_2648 = 0x370EL; int8_t l_2678 = (-1L); uint64_t l_2695 = 0x57DAC92115041E7FLL; int i, j; if (((-1L) > (safe_add_func_uint16_t_u_u((((safe_lshift_func_uint64_t_u_s((g_857 , (l_2028 ^= (*g_1926))), 9)) != (safe_add_func_int64_t_s_s(((safe_rshift_func_uint16_t_u_s(((safe_mul_func_uint64_t_u_u(((((0xC200L | ((((safe_lshift_func_uint32_t_u_s((l_2037 == p_21), 10)) <= ((((0x1615L || ((safe_div_func_int32_t_s_s((p_21 > (safe_mul_func_int8_t_s_s(((safe_lshift_func_int16_t_s_u((l_2050 = (l_2049[0] = (safe_lshift_func_uint16_t_u_u((((*l_2047) = l_2046) != (void*)0), 10)))), 3)) && (*g_1234)), l_2037))), 7UL)) && p_18)) , l_2051[8]) == (*g_566)) & 2L)) != l_2052) || p_21)) | (*g_36)) != (*g_1882)) >= p_21), l_2053)) || p_18), 3)) | p_19), p_18))) && (*g_1882)), 0xDC09L)))) { /* block id: 929 */ uint64_t l_2062 = 0xB9E25CC19E8A8557LL; int32_t l_2122 = (-1L); struct S1 *l_2131[8][8] = {{&g_72,&g_72,&g_72,&g_1550,(void*)0,&g_72,(void*)0,&g_1931[1][7]},{&g_1931[1][7],&g_794[3][0],&g_425,&g_72,&g_1550,&g_72,&g_425,&g_794[3][0]},{&g_425,&g_72,&g_1931[1][7],&g_425,&g_72,&g_794[3][0],(void*)0,&g_425},{&g_794[3][0],&g_72,&g_1931[2][4],(void*)0,&g_425,&g_425,(void*)0,&g_1931[2][4]},{(void*)0,(void*)0,&g_1931[1][7],&g_794[3][0],&g_794[3][0],&g_72,&g_425,&g_1931[1][7]},{&g_794[3][0],&g_72,&g_425,&g_1931[1][7],(void*)0,&g_1931[2][4],(void*)0,&g_1931[1][7]},{&g_72,&g_1931[1][7],&g_72,&g_794[3][0],&g_425,&g_794[3][0],&g_72,&g_1931[2][4]},{&g_425,&g_72,&g_794[3][0],(void*)0,&g_425,&g_425,&g_425,&g_425}}; union U2 **l_2164 = (void*)0; union U2 ***l_2163 = &l_2164; union U2 ****l_2162 = &l_2163; uint8_t l_2178[2]; int32_t l_2237 = (-5L); int32_t l_2239[5][3] = {{0x67575CCDL,0x886A51E3L,(-5L)},{0x886A51E3L,0x67575CCDL,0x67575CCDL},{(-5L),0x67575CCDL,(-1L)},{0xA6810593L,0x886A51E3L,(-1L)},{(-5L),(-5L),(-1L)}}; int16_t l_2366 = 3L; int32_t *l_2371 = &l_2237; int i, j; for (i = 0; i < 2; i++) l_2178[i] = 0x68L; lbl_2249: l_2054 |= p_18; for (g_1554.f1 = 0; (g_1554.f1 == 40); ++g_1554.f1) { /* block id: 933 */ union U2 *l_2076 = &g_380; int32_t l_2080 = (-1L); int32_t l_2132[3][7][5] = {{{0x79763266L,0L,0x2A221E89L,0L,0x47A42097L},{(-6L),6L,1L,1L,0xBC48ACFCL},{0x5ECF5640L,(-10L),0xEE996224L,1L,1L},{(-1L),0x06F8FA6FL,(-1L),0L,0x5ED247A6L},{(-1L),0xBC48ACFCL,0x79763266L,1L,1L},{0L,(-6L),(-3L),0L,1L},{0x2A221E89L,0L,0x79763266L,1L,(-10L)}},{{0x47A42097L,0x79763266L,(-1L),0x5ECF5640L,0x2A221E89L},{0L,1L,0xEE996224L,0x5ED247A6L,(-6L)},{0x3334F6F2L,1L,1L,1L,1L},{1L,0x79763266L,0x2A221E89L,1L,6L},{0x5ECF5640L,0L,0xF99FF606L,0x6CA75F09L,0x47A42097L},{6L,(-6L),1L,(-1L),(-10L)},{0x5ECF5640L,0xBC48ACFCL,0x3334F6F2L,1L,(-1L)}},{{1L,0x06F8FA6FL,0L,0x6CA75F09L,0x5ED247A6L},{0x3334F6F2L,(-10L),0x79763266L,(-1L),0x5ED247A6L},{0L,6L,6L,0L,(-1L)},{0x47A42097L,0L,(-1L),0x5ED247A6L,(-10L)},{0x2A221E89L,(-2L),(-1L),0x0E5D8AE0L,0x3334F6F2L},{6L,2L,0L,0xBC48ACFCL,7L},{(-1L),1L,(-6L),6L,1L}}}; int32_t * const *l_2146 = (void*)0; int16_t l_2175 = 0x49D2L; int8_t **l_2186[8][6][3] = {{{&g_846,(void*)0,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,(void*)0,&g_846},{&g_846,&g_846,&g_846}},{{&g_846,(void*)0,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,(void*)0,&g_846},{&g_846,&g_846,&g_846}},{{&g_846,&g_846,(void*)0},{(void*)0,(void*)0,(void*)0},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846}},{{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,(void*)0,&g_846}},{{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{(void*)0,&g_846,&g_846}},{{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,(void*)0},{&g_846,(void*)0,(void*)0},{&g_846,&g_846,&g_846}},{{&g_846,&g_846,(void*)0},{&g_846,&g_846,&g_846},{&g_846,&g_846,(void*)0},{&g_846,&g_846,(void*)0},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846}},{{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,(void*)0,&g_846},{&g_846,&g_846,&g_846},{&g_846,&g_846,&g_846},{&g_846,(void*)0,&g_846}}}; int8_t ***l_2185 = &l_2186[7][1][0]; uint32_t l_2269 = 9UL; int16_t l_2272 = 0x5FCDL; int16_t **l_2285 = &l_2048[6][1]; int16_t l_2333[3][3] = {{1L,1L,1L},{1L,1L,1L},{1L,1L,1L}}; int64_t ***l_2342[9] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; int i, j, k; for (g_265.f4.f5 = 3; (g_265.f4.f5 >= 0); g_265.f4.f5 -= 1) { /* block id: 936 */ uint32_t l_2059 = 5UL; union U2 *l_2136 = &g_2137; union U2 **l_2161 = (void*)0; union U2 ** const *l_2160[7][5] = {{&l_2161,&l_2161,&l_2161,&l_2161,&l_2161},{&l_2161,(void*)0,&l_2161,&l_2161,(void*)0},{&l_2161,(void*)0,&l_2161,(void*)0,&l_2161},{&l_2161,(void*)0,&l_2161,&l_2161,&l_2161},{(void*)0,&l_2161,(void*)0,&l_2161,&l_2161},{&l_2161,&l_2161,&l_2161,(void*)0,&l_2161},{(void*)0,&l_2161,(void*)0,(void*)0,(void*)0}}; union U2 ** const **l_2159[1]; int32_t l_2165 = 0x4E37A2E3L; int32_t l_2176 = 0xC022AD61L; int32_t l_2177 = 0x7F696D9CL; int i, j; for (i = 0; i < 1; i++) l_2159[i] = &l_2160[5][1]; for (g_1607.f5 = 0; (g_1607.f5 <= 9); g_1607.f5 += 1) { /* block id: 939 */ uint8_t *l_2075 = &g_94[2]; int32_t l_2077 = (-4L); union U2 **l_2134 = (void*)0; union U2 **l_2135[1][8] = {{&l_2076,&l_2076,&l_2076,&l_2076,&l_2076,&l_2076,&l_2076,&l_2076}}; int i, j; l_2059 = (safe_lshift_func_uint8_t_u_u(p_20, (*g_1234))); (*g_2079) = (safe_mod_func_int16_t_s_s(p_21, (l_2059 && (((6UL && ((++l_2062) > ((safe_div_func_int64_t_s_s((~2UL), p_19)) < (safe_sub_func_uint16_t_u_u(((safe_add_func_int64_t_s_s((((safe_rshift_func_int32_t_s_u((-8L), 12)) , (safe_unary_minus_func_uint64_t_u((l_2075 == (*g_791))))) & (((void*)0 != l_2076) & 4L)), (*g_1926))) & 0x0E0529BFL), 0x730FL))))) ^ p_21) | l_2077)))); for (g_1365.f2 = 1; (g_1365.f2 <= 8); g_1365.f2 += 1) { /* block id: 945 */ uint16_t *l_2091 = &g_746.f1; int32_t l_2100 = (-5L); int16_t l_2110[6] = {0L,0L,0L,0L,0L,0L}; int32_t *l_2111 = &l_2049[0]; int32_t *l_2112 = (void*)0; int32_t *l_2113 = &g_42; int i, j; (*g_2114) = ((*l_2113) = (l_2080 | ((*l_2111) = (safe_mul_func_int64_t_s_s((safe_mul_func_uint16_t_u_u(((safe_mod_func_int16_t_s_s((l_2059 == (safe_div_func_uint32_t_u_u((safe_sub_func_uint64_t_u_u((((*l_2091) ^= (*g_1882)) , ((safe_sub_func_int8_t_s_s((((safe_unary_minus_func_uint8_t_u(((g_2095 == ((*g_237) , (((p_19 | (safe_add_func_int64_t_s_s((((safe_mod_func_int16_t_s_s((((l_2100 , ((safe_mul_func_int64_t_s_s((l_2100 = (((*g_36) = (safe_lshift_func_uint32_t_u_u(((safe_div_func_uint8_t_u_u((safe_add_func_uint8_t_u_u(255UL, p_18)), p_18)) <= (*g_1882)), 16))) >= g_2109)), p_19)) != 0x0026L)) <= 65527UL) | p_21), 0x7C29L)) < l_2110[2]) & p_18), 0L))) && 0xBD28F57538C95E93LL) , &l_2100))) < 254UL))) & (*g_2095)) & 0x1C0AL), l_2080)) && p_21)), 8UL)), 0x0ED4E532L))), (*g_1882))) || (*g_783)), 9L)), l_2059))))); l_2132[1][3][4] &= ((safe_mul_func_uint64_t_u_u((((g_2117 , 0xA5D8E08AL) , ((safe_div_func_int16_t_s_s((safe_add_func_uint64_t_u_u((l_2122 = 1UL), ((~l_2080) , (+(safe_rshift_func_int64_t_s_s(((safe_lshift_func_uint8_t_u_u((safe_mul_func_int64_t_s_s((((0x7BL ^ 9L) < ((((void*)0 != l_2131[5][2]) < ((((**g_1233) ^= (*l_2113)) >= 248UL) < l_2062)) | (*g_36))) != l_2062), l_2077)), 1)) > (*g_1926)), p_18)))))), 65530UL)) & p_21)) | l_2062), g_1550.f1)) == 3UL); } l_2136 = (l_2133 = l_2133); } if (l_2059) continue; (*g_1109) = (safe_add_func_uint32_t_u_u(0x015AA961L, ((safe_rshift_func_int16_t_s_u((safe_mod_func_uint16_t_u_u((safe_rshift_func_int64_t_s_u((((l_2122 < ((void*)0 != l_2146)) && (*g_1926)) && (safe_mod_func_int8_t_s_s((0xE0D1B71362395E2DLL != (0x16L >= (safe_mul_func_int64_t_s_s((&p_18 == (p_19 , &g_1368[0])), p_19)))), 0x02L))), p_18)), (*g_1882))), 15)) < l_2122))); if ((g_2151 , l_2122)) { /* block id: 961 */ uint16_t l_2158 = 0UL; int16_t ***l_2167[4][1][1]; int16_t *** const *l_2166 = &l_2167[0][0][0]; int32_t l_2170[7]; int i, j, k; for (i = 0; i < 4; i++) { for (j = 0; j < 1; j++) { for (k = 0; k < 1; k++) l_2167[i][j][k] = &g_533; } } for (i = 0; i < 7; i++) l_2170[i] = 5L; l_2165 = ((safe_mod_func_uint32_t_u_u(l_2122, p_19)) , (p_18 || (safe_mul_func_int32_t_s_s(((safe_add_func_uint8_t_u_u(l_2158, (((*g_36) = l_2062) != l_2158))) >= ((l_2159[0] == l_2162) | (p_18 > (*g_1926)))), l_2059)))); if (l_2158) continue; g_2168 = l_2166; for (g_72.f0.f3 = 0; (g_72.f0.f3 <= 3); g_72.f0.f3 += 1) { /* block id: 968 */ int32_t *l_2171 = &l_2170[2]; int32_t *l_2172 = (void*)0; int32_t *l_2173 = &g_273; int32_t *l_2174[4][7][7] = {{{&l_2132[1][1][3],&g_315,&l_2122,&l_2170[3],&g_42,&l_2028,&g_315},{&l_2170[2],&l_2165,&l_2028,&l_2028,&l_2165,&l_2170[2],&l_2165},{&g_315,&l_2122,&g_42,&g_42,(void*)0,(void*)0,&l_2132[1][3][4]},{(void*)0,&l_2170[2],&l_2050,&l_2037,&l_2037,&l_2037,&l_2050},{&l_2122,&l_2122,&l_2028,&l_2080,&g_42,&l_2132[1][1][3],&l_2122},{&l_2165,&l_2165,(void*)0,(void*)0,&l_2050,&l_2049[0],&l_2049[0]},{&g_42,&g_315,&l_2049[0],&g_315,&g_42,&l_2122,&l_2170[4]}},{{&g_273,&g_1746,(void*)0,(void*)0,&l_2037,&l_2122,&l_2170[2]},{(void*)0,&l_2170[3],&l_2080,(void*)0,(void*)0,&l_2080,&l_2170[3]},{&g_273,(void*)0,&g_1746,&l_2165,&l_2165,(void*)0,(void*)0},{&g_42,&l_2132[1][1][3],&l_2122,&l_2049[0],&g_42,(void*)0,&g_42},{&l_2165,&g_193,&g_193,&l_2165,&l_2049[0],(void*)0,(void*)0},{&l_2122,&g_42,&g_42,(void*)0,(void*)0,&l_2132[1][3][4],&g_315},{(void*)0,&l_2170[5],(void*)0,(void*)0,(void*)0,&l_2170[5],(void*)0}},{{&g_315,(void*)0,&l_2132[1][1][3],&g_315,&l_2122,&l_2170[3],&g_42},{&l_2170[2],&l_2037,&l_2122,(void*)0,&g_273,&g_273,(void*)0},{&l_2132[1][1][3],&l_2028,&l_2132[1][1][3],&l_2080,&l_2132[1][3][4],&g_315,&l_2170[3]},{&l_2170[5],&l_2037,(void*)0,&l_2037,&g_193,&g_1746,&l_2170[2]},{&g_315,&g_315,&g_42,&g_42,&g_315,&g_315,&l_2170[4]},{&l_2165,(void*)0,&g_193,&l_2028,&l_2122,&g_273,&l_2049[0]},{&l_2049[0],&g_315,&l_2122,&l_2170[3],&g_315,&l_2170[3],&l_2122}},{{(void*)0,(void*)0,&g_1746,(void*)0,&l_2028,&l_2170[5],&l_2050},{&l_2170[4],&g_315,&g_315,&l_2049[0],(void*)0,&l_2028,&l_2028},{&l_2170[5],(void*)0,(void*)0,(void*)0,&l_2170[5],(void*)0,&g_273},{&l_2080,&l_2170[3],(void*)0,&l_2170[4],&l_2122,&g_42,&g_315},{&l_2165,&l_2170[2],&l_2165,&l_2028,&l_2028,&l_2165,&l_2170[2]},{&l_2080,&l_2170[4],&l_2170[3],(void*)0,&g_42,&g_315,&l_2049[0]},{&l_2170[5],&l_2049[0],&l_2122,(void*)0,&l_2050,&l_2028,&l_2050}}}; int i, j, k; l_2170[2] &= l_2158; l_2178[1]--; } } else { /* block id: 972 */ if (p_21) break; } } if (((((p_18 ^ (safe_rshift_func_uint8_t_u_s((safe_mul_func_uint8_t_u_u(((*g_1381) = p_18), ((void*)0 == l_2185))), (safe_mul_func_int64_t_s_s(((+p_20) != (*g_36)), ((safe_sub_func_int16_t_s_s((l_2122 ^= p_21), (-7L))) > (safe_lshift_func_int8_t_s_s((safe_sub_func_uint32_t_u_u((safe_lshift_func_uint32_t_u_u((safe_rshift_func_uint64_t_u_s(((((void*)0 == l_2027[0]) , (*g_36)) && p_18), p_19)), p_18)), p_20)), 6)))))))) || l_2122) , l_2178[1]) , 0L)) { /* block id: 978 */ int32_t l_2206[10] = {0x24D65734L,0x24D65734L,0x24D65734L,0x24D65734L,0x24D65734L,0x24D65734L,0x24D65734L,0x24D65734L,0x24D65734L,0x24D65734L}; uint64_t *l_2213 = (void*)0; int32_t l_2225 = 0x57317A47L; int32_t l_2229 = 0xC583338DL; int32_t l_2230 = 0xBACE15F6L; int32_t l_2231 = 0x4F8910C7L; int32_t l_2232 = 0x05D4E925L; int32_t l_2233[5] = {0xC30123A9L,0xC30123A9L,0xC30123A9L,0xC30123A9L,0xC30123A9L}; int8_t ***l_2266 = (void*)0; uint8_t *l_2277 = &g_94[4]; uint8_t l_2310 = 0xACL; int64_t ****l_2349[8][2] = {{&l_2051[8],(void*)0},{&l_2051[8],&l_2051[8]},{(void*)0,&l_2051[8]},{&l_2051[8],(void*)0},{&l_2051[8],&l_2051[8]},{(void*)0,&l_2051[8]},{&l_2051[8],(void*)0},{&l_2051[8],&l_2051[8]}}; int i, j; if (p_21) break; if (((safe_mul_func_uint64_t_u_u(((((safe_rshift_func_int32_t_s_u((((((*g_1882)--) & 0x3347L) && l_2206[7]) || (((*g_237) , 255UL) <= (g_794[3][0].f8 , (safe_rshift_func_int16_t_s_u(((p_21 ^ (p_21 | (((65535UL == ((*g_1882) = (safe_mod_func_uint8_t_u_u((p_18 & p_18), 2L)))) > l_2062) == 0x9865A27E8BC2989FLL))) <= 4294967288UL), 5))))), 21)) > 0x373E2314L) && l_2206[7]) > 0xDAF8L), p_19)) == 252UL)) { /* block id: 982 */ int32_t l_2211[1]; uint64_t *l_2214 = &g_1258; int32_t l_2224 = 0x83702682L; int32_t l_2226 = 0x970772F8L; int32_t l_2227 = 0x70A8B0A8L; int32_t l_2228 = (-1L); int32_t l_2234 = 0xDF66EBC3L; int32_t l_2235 = 0x59907170L; int32_t l_2236 = 0L; int32_t l_2238[2][1]; uint8_t l_2240 = 0xBCL; int i, j; for (i = 0; i < 1; i++) l_2211[i] = 0xBD337155L; for (i = 0; i < 2; i++) { for (j = 0; j < 1; j++) l_2238[i][j] = 1L; } if (l_2211[0]) { /* block id: 983 */ int32_t *l_2212 = &l_2080; uint64_t **l_2215 = &l_2027[6]; (*l_2212) &= (-1L); (*l_2212) ^= p_18; l_2122 = (((((((*l_2212) , l_2213) != ((*l_2215) = l_2214)) != (l_2206[2] || ((safe_div_func_int16_t_s_s(p_21, (safe_rshift_func_int64_t_s_u(((safe_sub_func_uint32_t_u_u(((((!p_19) <= p_18) < ((p_21 & ((*g_783) , 18446744073709551615UL)) < (-4L))) | (*g_1882)), 1L)) , p_21), (*l_2212))))) && p_18))) > p_18) ^ l_2211[0]) || p_21); } else { /* block id: 988 */ int32_t *l_2223[8][7][2] = {{{&l_2122,&l_2122},{&l_2132[1][3][4],(void*)0},{(void*)0,&l_2132[2][4][0]},{(void*)0,(void*)0},{&l_2049[0],(void*)0},{&g_273,&g_273},{&g_273,(void*)0}},{{&l_2049[0],(void*)0},{(void*)0,&l_2132[2][4][0]},{(void*)0,(void*)0},{&l_2132[1][3][4],&l_2122},{&l_2122,&g_273},{(void*)0,&g_273},{&l_2037,(void*)0}},{{&l_2080,&l_2049[3]},{(void*)0,(void*)0},{(void*)0,&l_2080},{(void*)0,&g_193},{&l_2132[1][3][4],&l_2132[1][3][4]},{&l_2028,(void*)0},{&g_273,&g_1746}},{{&l_2122,&l_2037},{&g_193,&g_1746},{&l_2080,(void*)0},{&l_2132[2][4][0],&g_193},{&g_273,&g_273},{&l_2132[1][3][4],&g_273},{&g_273,&g_193}},{{&l_2132[2][4][0],(void*)0},{&l_2080,&g_1746},{&g_193,&l_2037},{&l_2122,&g_1746},{&g_273,(void*)0},{&l_2028,&l_2132[1][3][4]},{&l_2132[1][3][4],&g_193}},{{(void*)0,&l_2080},{(void*)0,(void*)0},{(void*)0,&l_2049[3]},{&l_2080,(void*)0},{&l_2037,&g_273},{(void*)0,&g_273},{&l_2122,&l_2122}},{{&l_2132[1][3][4],(void*)0},{(void*)0,&l_2132[2][4][0]},{(void*)0,(void*)0},{&l_2049[0],(void*)0},{&g_273,&g_273},{&g_273,(void*)0},{&l_2049[0],(void*)0}},{{(void*)0,&l_2132[2][4][0]},{(void*)0,(void*)0},{&l_2132[1][3][4],&l_2122},{&l_2122,&g_273},{(void*)0,&g_273},{&l_2037,(void*)0},{&l_2080,&l_2049[3]}}}; uint64_t * const l_2248 = &l_2062; int i, j, k; l_2240++; l_2122 = (safe_div_func_int16_t_s_s((!(*g_36)), (safe_mod_func_int64_t_s_s(((void*)0 == l_2248), p_20)))); if (g_2151.f6) goto lbl_2249; } for (g_425.f4 = 0; (g_425.f4 >= (-9)); g_425.f4--) { /* block id: 995 */ l_2237 &= (0x10L <= 0xA7L); } (*g_876) ^= p_19; } else { /* block id: 999 */ struct S0 **l_2252 = &g_328; int32_t l_2253 = 0x9B5D67E5L; int8_t l_2259 = 0x97L; int8_t ****l_2267 = &l_2266; int8_t ****l_2268 = &l_2185; struct S0 * const l_2270 = &g_2271; l_2272 &= ((g_1140.f0 , 0L) <= (-3L)); } for (g_506.f4.f1 = 0; (g_506.f4.f1 > 51); ++g_506.f4.f1) { /* block id: 1009 */ int16_t **l_2284 = &g_397[2][5][8]; int32_t l_2309 = 0xF7E791C8L; uint64_t l_2332 = 0x2A31CB770F6266CFLL; uint32_t l_2346 = 0x1789B01DL; (*g_2114) = p_21; if ((safe_add_func_uint32_t_u_u(6UL, (p_21 , ((((*g_1233) = (*g_1233)) == (l_2277 = l_2277)) | ((((safe_mul_func_uint32_t_u_u(0x6EABFEF3L, ((~((safe_sub_func_int64_t_s_s((l_2178[1] && (p_21 &= ((0x99F3L != ((((g_2283 , l_2284) == l_2285) && (*g_269)) && p_19)) , g_2286))), p_18)) <= (-1L))) > (*g_36)))) , 0xA8L) ^ (*g_1381)) , 0x2F575D5C810E6917LL)))))) { /* block id: 1014 */ uint32_t *l_2303 = &g_2286; uint32_t **l_2302[8] = {&l_2303,(void*)0,&l_2303,(void*)0,&l_2303,(void*)0,&l_2303,(void*)0}; int32_t l_2308 = (-2L); int32_t *l_2311 = &l_2233[1]; int32_t *l_2334 = &l_2231; int32_t *l_2335 = (void*)0; int32_t *l_2336 = &l_2132[1][3][4]; int32_t *l_2337 = &l_2229; int32_t *l_2338[7] = {&g_273,&g_273,&g_273,&g_273,&g_273,&g_273,&g_273}; uint64_t l_2339 = 18446744073709551611UL; int i; (*l_2311) &= (safe_div_func_uint8_t_u_u((safe_mul_func_int64_t_s_s(((**g_1233) >= ((!(((p_21 , 0x4E01FF16L) >= (-5L)) != (safe_sub_func_int16_t_s_s((safe_sub_func_int16_t_s_s(((**l_2285) = (safe_mul_func_uint16_t_u_u(((((safe_mul_func_int32_t_s_s((1UL || (safe_div_func_uint8_t_u_u(((g_2304 = &p_20) != ((safe_mul_func_int64_t_s_s(p_19, (l_2231 = (~(((l_2308 |= 1L) >= (-1L)) && l_2309))))) , (void*)0)), 0xB1L))), (*g_36))) <= p_18) > p_20) ^ l_2310), 0x57E9L))), 0x0701L)), l_2178[1])))) , 0x0CL)), (*g_1926))), l_2310)); (*g_445) = &l_2309; l_2339++; } else { /* block id: 1023 */ int64_t l_2343 = 0x220B9DF3AFA4CD26LL; l_2343 = (l_2342[4] != (void*)0); (*g_113) = &l_2237; l_2233[1] = (l_2232 , (*g_2079)); } if (p_18) break; l_2049[2] = (safe_mul_func_uint64_t_u_u((l_2346 , ((safe_lshift_func_uint32_t_u_s((((*g_1882) , p_20) >= (g_1734[0][0] , ((void*)0 != l_2349[5][0]))), (p_19 , 0xE07E7022L))) ^ g_94[4])), l_2350[1])); } } else { /* block id: 1031 */ for (g_1365.f3 = 0; (g_1365.f3 <= 2); g_1365.f3 += 1) { /* block id: 1034 */ int16_t l_2351 = 7L; return l_2351; } return p_18; } } if (p_18) { /* block id: 1040 */ int64_t l_2361 = 0xAC3F41FE9E011144LL; int32_t *l_2365[9][4] = {{(void*)0,&g_1598,&g_1598,&g_1598},{&g_1598,&g_1598,(void*)0,&g_1598},{&g_1598,&g_1598,&g_1598,(void*)0},{&g_1598,(void*)0,(void*)0,&g_1598},{&g_1598,(void*)0,&g_1598,(void*)0},{(void*)0,&g_1598,&g_1598,&g_1598},{&g_1598,&g_1598,(void*)0,&g_1598},{&g_1598,&g_1598,&g_1598,(void*)0},{&g_1598,(void*)0,(void*)0,&g_1598}}; int32_t l_2367 = 1L; const int32_t *l_2369 = (void*)0; int i, j; (*g_2368) = ((safe_div_func_uint32_t_u_u(((+(g_1365 , 248UL)) ^ p_19), p_20)) || 18446744073709551615UL); l_2369 = (p_19 , ((*g_113) = (void*)0)); } else { /* block id: 1048 */ struct S0 *l_2370 = &g_1365; l_2370 = l_2370; } l_2371 = ((***g_744) = &l_2122); } else { /* block id: 1053 */ uint64_t l_2372 = 1UL; uint16_t *l_2385 = &g_380.f4.f1; uint16_t *l_2386 = (void*)0; uint16_t *l_2387 = &g_712.f2; uint16_t *l_2388[10][6][3] = {{{&g_212[1][4][1].f1,&g_43[4].f1,&g_212[1][4][1].f1},{&g_1607.f1,&g_1753.f1,(void*)0},{(void*)0,&g_857.f1,(void*)0},{&g_425.f0.f1,(void*)0,&g_1753.f1},{&g_1153[0][0].f1,&g_1607.f1,&g_212[1][4][1].f1},{&g_1753.f1,&g_1830.f1,&g_425.f0.f1}},{{&g_1554.f1,&g_746.f1,&g_1607.f1},{(void*)0,&g_794[3][0].f0.f1,&g_2151.f0.f1},{(void*)0,&g_1931[1][7].f0.f1,&g_857.f1},{&g_1554.f1,(void*)0,&g_1455[1].f1},{&g_212[1][4][1].f1,&g_1753.f1,(void*)0},{&g_2151.f0.f1,&g_1753.f1,(void*)0}},{{&g_1153[0][0].f1,(void*)0,(void*)0},{&g_1455[1].f1,&g_1931[1][7].f0.f1,&g_746.f1},{&g_1753.f1,&g_794[3][0].f0.f1,&g_1455[1].f1},{&g_1455[1].f1,&g_746.f1,(void*)0},{&g_857.f1,&g_1830.f1,&g_1753.f1},{(void*)0,&g_1607.f1,(void*)0}},{{&g_1285.f1,(void*)0,&g_1285.f1},{&g_794[3][0].f0.f1,&g_857.f1,&g_1554.f1},{&g_857.f1,&g_1753.f1,&g_1153[0][0].f1},{&g_1830.f1,&g_43[4].f1,&g_1753.f1},{(void*)0,(void*)0,(void*)0},{&g_1830.f1,&g_1455[1].f1,(void*)0}},{{&g_857.f1,(void*)0,&g_212[1][4][1].f1},{&g_794[3][0].f0.f1,&g_1753.f1,&g_212[1][4][1].f1},{&g_1285.f1,&g_857.f1,&g_1455[1].f1},{(void*)0,&g_1830.f1,&g_1554.f1},{&g_857.f1,&g_1554.f1,&g_1830.f1},{&g_1455[1].f1,&g_857.f1,&g_1455[1].f1}},{{&g_1753.f1,&g_1607.f1,(void*)0},{&g_1455[1].f1,&g_212[1][4][1].f1,&g_794[3][0].f0.f1},{&g_1153[0][0].f1,&g_1153[0][0].f1,&g_1753.f1},{&g_2151.f0.f1,(void*)0,&g_1753.f1},{&g_212[1][4][1].f1,(void*)0,&g_794[3][0].f0.f1},{&g_1554.f1,(void*)0,(void*)0}},{{(void*)0,(void*)0,&g_1455[1].f1},{(void*)0,&g_1153[0][0].f1,&g_1830.f1},{&g_1554.f1,&g_1285.f1,&g_1554.f1},{&g_1753.f1,&g_1753.f1,&g_1455[1].f1},{&g_1153[0][0].f1,&g_212[1][4][1].f1,&g_212[1][4][1].f1},{&g_425.f0.f1,&g_1153[0][0].f1,&g_212[1][4][1].f1}},{{(void*)0,&g_857.f1,(void*)0},{&g_1607.f1,&g_746.f1,(void*)0},{&g_212[1][4][1].f1,&g_43[4].f1,&g_1753.f1},{&g_2271.f1,&g_746.f1,&g_1153[0][0].f1},{&g_43[4].f1,&g_857.f1,&g_1554.f1},{&g_1607.f1,&g_1153[0][0].f1,&g_1285.f1}},{{&g_1753.f1,&g_212[1][4][1].f1,(void*)0},{&g_1153[0][0].f1,(void*)0,&g_746.f1},{&g_1753.f1,&g_1153[0][0].f1,&g_1455[1].f1},{&g_1753.f1,&g_1931[1][7].f0.f1,&g_1554.f1},{&g_1931[1][7].f0.f1,&g_2151.f0.f1,&g_425.f0.f1},{&g_1753.f1,&g_1554.f1,(void*)0}},{{&g_2271.f1,&g_2151.f0.f1,(void*)0},{&g_212[1][4][1].f1,&g_425.f0.f1,&g_2151.f0.f1},{&g_212[1][4][1].f1,&g_2151.f0.f1,&g_1753.f1},{&g_2271.f1,&g_1153[0][0].f1,(void*)0},{&g_1753.f1,&g_1285.f1,&g_963},{&g_1931[1][7].f0.f1,(void*)0,(void*)0}}}; int32_t l_2389 = 1L; int32_t *l_2390 = &g_315; union U2 *l_2396 = (void*)0; union U2 *l_2413 = (void*)0; const int32_t *l_2414 = (void*)0; int8_t l_2426 = 4L; int16_t * const * const *l_2428[4]; int16_t * const * const ** const l_2427 = &l_2428[3]; int64_t ***l_2473 = &g_568[5][0][4]; struct S1 *l_2477 = &g_72; int32_t l_2532 = 0L; uint64_t **l_2565 = (void*)0; int32_t l_2587 = 0xFC8217C6L; int32_t l_2589 = 0x4212A1A1L; int32_t l_2590[1]; int8_t l_2591 = 0xCAL; int32_t l_2606 = (-10L); int8_t ** const l_2627 = &g_846; int8_t ** const *l_2626 = &l_2627; int8_t ** const **l_2625 = &l_2626; int8_t ** const ***l_2624 = &l_2625; int8_t l_2641 = (-4L); const uint32_t *l_2664 = &g_669; struct S0 **l_2683 = &g_328; int i, j, k; for (i = 0; i < 4; i++) l_2428[i] = (void*)0; for (i = 0; i < 1; i++) l_2590[i] = 0x42B5E562L; l_2372 = p_18; if (((*l_2390) = ((((p_19 || ((*g_1926) = (safe_unary_minus_func_uint64_t_u((*g_1926))))) || ((-10L) > (*g_1926))) < ((l_2389 &= (safe_sub_func_uint16_t_u_u((g_1365.f1 |= (((safe_div_func_uint64_t_u_u(((+(safe_lshift_func_int32_t_s_u((((0x0C1C66AD1BEC3329LL <= g_1554.f0) < (((((*g_1381) == (safe_mod_func_uint32_t_u_u(l_2372, (safe_div_func_int32_t_s_s(p_21, l_2372))))) && 0UL) <= g_72.f0.f0) , l_2372)) <= l_2372), p_21))) > (*g_36)), g_857.f3)) | (*g_1882)) < p_21)), p_18))) | l_2372)) == l_2372))) { /* block id: 1059 */ uint8_t l_2401 = 0xB9L; int32_t l_2402[5] = {(-1L),(-1L),(-1L),(-1L),(-1L)}; int32_t l_2408[3][6][5] = {{{(-1L),7L,0xC4096554L,7L,(-1L)},{0x03CDB2C2L,0x6E37D749L,0x8B27960DL,(-1L),0x21EA01F2L},{0x03CDB2C2L,0x21EA01F2L,2L,(-1L),(-1L)},{(-1L),(-7L),(-1L),0x6E37D749L,0x21EA01F2L},{(-9L),(-1L),0x21EA01F2L,0x6E37D749L,(-1L)},{0x21EA01F2L,2L,(-1L),(-1L),2L}},{{2L,0xF8CDDB0FL,0x21EA01F2L,(-1L),0x8B27960DL},{(-7L),0xF8CDDB0FL,(-1L),7L,0xC4096554L},{0xE0054F94L,2L,2L,0xE0054F94L,7L},{(-7L),(-1L),0x8B27960DL,0x03CDB2C2L,7L},{2L,(-7L),0xC4096554L,0x21EA01F2L,0xC4096554L},{0x21EA01F2L,0x21EA01F2L,7L,0x03CDB2C2L,0x8B27960DL}},{{(-9L),0x6E37D749L,7L,0xE0054F94L,2L},{(-1L),7L,0xC4096554L,7L,(-1L)},{0x03CDB2C2L,0x6E37D749L,0x8B27960DL,(-1L),0x21EA01F2L},{0x03CDB2C2L,0x21EA01F2L,2L,(-1L),(-1L)},{(-1L),(-7L),(-1L),0x6E37D749L,0x21EA01F2L},{(-9L),(-1L),0x21EA01F2L,0x6E37D749L,(-1L)}}}; const uint32_t *l_2433[9][9][1] = {{{&l_2052},{&g_37},{&l_2052},{&g_37},{&l_2052},{&g_37},{&l_2052},{(void*)0},{&g_37}},{{&g_669},{(void*)0},{&g_37},{&g_37},{&g_26},{&l_2052},{&g_37},{&l_2052},{&g_26}},{{&g_96},{&g_669},{&g_669},{&g_669},{&g_96},{&g_26},{&l_2052},{&g_37},{&l_2052}},{{&g_26},{&g_37},{&g_37},{(void*)0},{&g_669},{&g_37},{(void*)0},{&l_2052},{&g_37}},{{&l_2052},{&g_37},{&l_2052},{&g_37},{&l_2052},{(void*)0},{&g_37},{&g_669},{(void*)0}},{{&g_37},{&g_37},{&g_26},{&l_2052},{&g_37},{&l_2052},{&g_26},{&g_96},{&g_669}},{{&g_669},{&g_669},{&g_96},{&g_26},{&l_2052},{&g_37},{&l_2052},{&g_26},{&g_37}},{{&g_96},{(void*)0},{&g_669},{(void*)0},{&g_26},{&g_37},{&g_37},{&g_669},{(void*)0}},{{&g_669},{&g_37},{&g_37},{&g_26},{(void*)0},{&g_669},{(void*)0},{&g_96},{&g_26}}}; uint32_t *l_2445 = (void*)0; union U2 *l_2459 = &g_808[1][0]; int8_t *****l_2585[2]; int32_t l_2586[8][9][3] = {{{0x5CFA80C3L,0x0A0AF8E3L,0x0A0AF8E3L},{(-7L),(-1L),6L},{0x5CFA80C3L,0x771846B4L,0x5CFA80C3L},{0x523AB2DBL,(-7L),6L},{0xE4AB30B9L,0xE4AB30B9L,0x0A0AF8E3L},{(-1L),(-7L),(-7L)},{0x0A0AF8E3L,0x771846B4L,5L},{(-1L),(-1L),(-1L)},{0xE4AB30B9L,0x0A0AF8E3L,5L}},{{0x523AB2DBL,0x523AB2DBL,(-7L)},{0x5CFA80C3L,0x0A0AF8E3L,0x0A0AF8E3L},{(-7L),(-1L),6L},{0x5CFA80C3L,0x771846B4L,0x5CFA80C3L},{0x523AB2DBL,(-7L),6L},{0xE4AB30B9L,0xE4AB30B9L,0x0A0AF8E3L},{(-1L),(-7L),(-7L)},{0x0A0AF8E3L,0x771846B4L,5L},{(-1L),(-1L),(-1L)}},{{0xE4AB30B9L,0x0A0AF8E3L,5L},{0x523AB2DBL,0x523AB2DBL,(-7L)},{0x5CFA80C3L,0x0A0AF8E3L,0x0A0AF8E3L},{(-7L),(-1L),6L},{0x5CFA80C3L,0x771846B4L,0x5CFA80C3L},{0x523AB2DBL,(-7L),6L},{0xE4AB30B9L,0xE4AB30B9L,0x0A0AF8E3L},{(-1L),(-7L),(-7L)},{0x0A0AF8E3L,0x771846B4L,5L}},{{(-1L),(-1L),(-1L)},{0xE4AB30B9L,0x0A0AF8E3L,5L},{0x523AB2DBL,0x523AB2DBL,(-7L)},{0x5CFA80C3L,0x0A0AF8E3L,0x0A0AF8E3L},{(-7L),(-1L),6L},{0x5CFA80C3L,0x771846B4L,0x5CFA80C3L},{0x523AB2DBL,(-7L),6L},{0xE4AB30B9L,0xE4AB30B9L,0x0A0AF8E3L},{(-1L),(-7L),(-7L)}},{{0x0A0AF8E3L,0x771846B4L,5L},{(-1L),(-1L),(-1L)},{0xE4AB30B9L,0x0A0AF8E3L,5L},{0x523AB2DBL,0x523AB2DBL,(-7L)},{0x5CFA80C3L,0x0A0AF8E3L,0x0A0AF8E3L},{(-7L),(-1L),6L},{0x5CFA80C3L,0x771846B4L,0x5CFA80C3L},{0x523AB2DBL,(-7L),6L},{0xE4AB30B9L,0xE4AB30B9L,0x0A0AF8E3L}},{{(-1L),(-7L),(-7L)},{0x0A0AF8E3L,0x771846B4L,5L},{(-1L),(-1L),(-1L)},{0xE4AB30B9L,0x0A0AF8E3L,5L},{0x523AB2DBL,0x523AB2DBL,(-7L)},{0x5CFA80C3L,0x0A0AF8E3L,0x0A0AF8E3L},{(-7L),(-1L),6L},{0x5CFA80C3L,0x771846B4L,0x5CFA80C3L},{0x523AB2DBL,(-7L),6L}},{{0xE4AB30B9L,0xE4AB30B9L,0x0A0AF8E3L},{(-1L),(-7L),(-7L)},{0x0A0AF8E3L,0x771846B4L,5L},{(-1L),0x523AB2DBL,6L},{0x0A0AF8E3L,0x5CFA80C3L,0x771846B4L},{(-7L),(-7L),(-1L)},{5L,0x5CFA80C3L,0x5CFA80C3L},{(-1L),0x523AB2DBL,(-1L)},{5L,0xE4AB30B9L,5L}},{{(-7L),(-1L),(-1L)},{0x0A0AF8E3L,0x0A0AF8E3L,0x5CFA80C3L},{6L,(-1L),(-1L)},{0x5CFA80C3L,0xE4AB30B9L,0x771846B4L},{6L,0x523AB2DBL,6L},{0x0A0AF8E3L,0x5CFA80C3L,0x771846B4L},{(-7L),(-7L),(-1L)},{5L,0x5CFA80C3L,0x5CFA80C3L},{(-1L),0x523AB2DBL,(-1L)}}}; int8_t l_2604 = 6L; int32_t l_2647[1]; int64_t **l_2652 = &g_569[3][0]; const int8_t *l_2726 = &g_2151.f0.f5; const int8_t **l_2725 = &l_2726; const int8_t ***l_2724[2][2] = {{&l_2725,&l_2725},{&l_2725,&l_2725}}; const int8_t ****l_2723 = &l_2724[0][0]; const int8_t *****l_2722[5][6][5] = {{{&l_2723,&l_2723,(void*)0,&l_2723,(void*)0},{&l_2723,(void*)0,&l_2723,&l_2723,&l_2723},{&l_2723,&l_2723,&l_2723,&l_2723,&l_2723},{(void*)0,&l_2723,(void*)0,(void*)0,(void*)0},{&l_2723,&l_2723,&l_2723,&l_2723,&l_2723},{(void*)0,&l_2723,&l_2723,&l_2723,(void*)0}},{{(void*)0,&l_2723,&l_2723,&l_2723,&l_2723},{(void*)0,&l_2723,(void*)0,(void*)0,&l_2723},{&l_2723,&l_2723,&l_2723,&l_2723,(void*)0},{&l_2723,&l_2723,&l_2723,(void*)0,(void*)0},{&l_2723,&l_2723,&l_2723,(void*)0,&l_2723},{(void*)0,&l_2723,(void*)0,(void*)0,&l_2723}},{{&l_2723,(void*)0,&l_2723,&l_2723,&l_2723},{&l_2723,&l_2723,&l_2723,&l_2723,&l_2723},{&l_2723,(void*)0,&l_2723,&l_2723,&l_2723},{&l_2723,&l_2723,(void*)0,(void*)0,&l_2723},{&l_2723,&l_2723,&l_2723,&l_2723,&l_2723},{(void*)0,(void*)0,&l_2723,&l_2723,&l_2723}},{{&l_2723,&l_2723,(void*)0,&l_2723,(void*)0},{&l_2723,&l_2723,&l_2723,&l_2723,&l_2723},{&l_2723,&l_2723,(void*)0,&l_2723,(void*)0},{(void*)0,(void*)0,&l_2723,(void*)0,&l_2723},{(void*)0,&l_2723,&l_2723,&l_2723,&l_2723},{(void*)0,&l_2723,&l_2723,&l_2723,(void*)0}},{{&l_2723,&l_2723,&l_2723,&l_2723,(void*)0},{(void*)0,(void*)0,&l_2723,(void*)0,(void*)0},{&l_2723,&l_2723,&l_2723,(void*)0,&l_2723},{&l_2723,&l_2723,&l_2723,(void*)0,&l_2723},{&l_2723,&l_2723,&l_2723,&l_2723,&l_2723},{(void*)0,(void*)0,&l_2723,(void*)0,(void*)0}}}; int32_t *l_2732 = &g_315; int32_t *l_2733 = &l_2028; int32_t *l_2734 = (void*)0; int32_t *l_2735 = &l_2049[0]; int32_t *l_2736 = &l_2389; int32_t *l_2737 = (void*)0; int32_t *l_2738 = &l_2590[0]; int32_t *l_2739 = &l_2408[1][1][0]; int32_t *l_2740 = &g_273; uint32_t l_2741 = 0x2D49A1DCL; int i, j, k; for (i = 0; i < 2; i++) l_2585[i] = (void*)0; for (i = 0; i < 1; i++) l_2647[i] = 0x837B264CL; if ((*g_269)) { /* block id: 1060 */ uint32_t l_2409 = 0x1486A72EL; int8_t l_2410 = 0L; const int16_t *l_2425 = &g_2151.f8; const int16_t **l_2424 = &l_2425; const int16_t ***l_2423 = &l_2424; const int16_t *** const *l_2422 = &l_2423; uint8_t * const l_2453 = &g_2454; uint8_t * const *l_2452[2]; int32_t *l_2476 = (void*)0; int i; for (i = 0; i < 2; i++) l_2452[i] = &l_2453; for (g_265.f4.f5 = (-22); (g_265.f4.f5 <= 18); g_265.f4.f5 = safe_add_func_uint64_t_u_u(g_265.f4.f5, 2)) { /* block id: 1063 */ uint32_t *l_2393 = (void*)0; union U2 *l_2394 = &g_2137; union U2 **l_2395[5]; int32_t *l_2412[4][3][3] = {{{(void*)0,(void*)0,&g_1598},{&g_1598,&g_1598,&g_1598},{(void*)0,(void*)0,(void*)0}},{{&g_1598,&g_1598,&g_1598},{&g_1598,(void*)0,(void*)0},{&g_1598,&g_1598,&g_1598}},{{&g_1598,&g_1598,&g_1598},{&g_1598,&g_1598,&g_1598},{&g_1598,&g_1598,&g_1598}},{{&g_1598,&g_1598,&g_1598},{(void*)0,&g_1598,(void*)0},{&g_1598,&g_1598,&g_1598}}}; int i, j, k; for (i = 0; i < 5; i++) l_2395[i] = &l_2133; l_2414 = (*g_796); for (l_2052 = 0; (l_2052 <= 2); l_2052 += 1) { /* block id: 1071 */ (*l_2390) |= (p_18 || p_18); } } if (((((*l_2390) = (((safe_mod_func_int8_t_s_s(((safe_lshift_func_uint64_t_u_s((((*g_1926) = p_20) < (((*g_36) , ((safe_sub_func_int64_t_s_s(p_19, (!l_2408[0][5][4]))) & l_2402[1])) || (l_2422 == (l_2426 , l_2427)))), p_19)) | (*g_36)), p_19)) ^ (*l_2390)) , l_2402[3])) <= 1L) || p_19)) { /* block id: 1077 */ int32_t l_2444 = 0x9ADAF30EL; const uint8_t *l_2451 = &g_94[2]; const uint8_t ** const l_2450 = &l_2451; uint8_t * const **l_2455 = (void*)0; uint8_t * const **l_2456 = &g_791; union U2 **l_2460 = &l_2133; for (l_2054 = (-30); (l_2054 >= 59); ++l_2054) { /* block id: 1080 */ uint32_t **l_2432 = &l_2431; int32_t l_2443[3][10]; int i, j; for (i = 0; i < 3; i++) { for (j = 0; j < 10; j++) l_2443[i][j] = 0xBBD886A2L; } (*g_113) = &l_2389; return p_21; } (*l_2460) = (((((l_2457 = (safe_add_func_int8_t_s_s(((*l_2390) &= (l_2450 != ((*l_2456) = (l_2452[1] = (void*)0)))), 7UL))) <= ((*g_1882) = (!p_20))) && (l_2444 = 0xCCEC6ADBEB126C3FLL)) , (*g_1926)) , l_2459); l_2444 &= (+0x785CL); for (g_1554.f5 = 8; (g_1554.f5 >= 2); g_1554.f5 -= 1) { /* block id: 1100 */ int32_t l_2462 = (-3L); return l_2462; } } else { /* block id: 1103 */ uint64_t l_2465 = 0x02340B85E3ECC459LL; int32_t *l_2479[2]; int i; for (i = 0; i < 2; i++) l_2479[i] = &l_2028; if (((safe_lshift_func_int8_t_s_s((((***g_1697) = 0x24L) | 0x6FL), (l_2465 > ((((g_2466 != (void*)0) != ((safe_mul_func_uint16_t_u_u((safe_add_func_uint64_t_u_u((p_20 , 0x91A7CB9D5FF2771DLL), p_20)), ((l_2051[8] == l_2473) ^ 0x69L))) >= 0L)) >= (-10L)) != 0xCCFB3AB0L)))) , p_19)) { /* block id: 1105 */ uint32_t l_2474 = 6UL; return l_2474; } else { /* block id: 1107 */ int32_t *l_2475 = &l_2402[3]; struct S1 **l_2478 = &l_2477; l_2476 = l_2475; (*l_2478) = l_2477; (*l_2478) = (*l_2478); } for (g_857.f3 = 2; (g_857.f3 >= 0); g_857.f3 -= 1) { /* block id: 1114 */ int i; return g_317[(g_857.f3 + 5)]; } ++g_2480; } } else { /* block id: 1119 */ uint64_t l_2494 = 0x550721B290422DB0LL; struct S0 *l_2536 = &g_1285; int32_t l_2571[6] = {0x36AE211DL,0x36AE211DL,(-9L),0x36AE211DL,0x36AE211DL,(-9L)}; int32_t l_2573[7] = {(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}; int32_t l_2579[10] = {0x8A9AAFEFL,1L,0x8A9AAFEFL,1L,0x8A9AAFEFL,1L,0x8A9AAFEFL,1L,0x8A9AAFEFL,1L}; int64_t l_2605[7][6][1] = {{{5L},{0x900ECE2BE9A49DB4LL},{0xC4DBBE6C3B9D6DBELL},{0x18B7A7007CAD6048LL},{(-9L)},{0x18B7A7007CAD6048LL}},{{0xC4DBBE6C3B9D6DBELL},{0x900ECE2BE9A49DB4LL},{5L},{0x5174BCEE404419A4LL},{5L},{0x900ECE2BE9A49DB4LL}},{{0xC4DBBE6C3B9D6DBELL},{0x18B7A7007CAD6048LL},{(-9L)},{0x18B7A7007CAD6048LL},{0xC4DBBE6C3B9D6DBELL},{0x900ECE2BE9A49DB4LL}},{{5L},{0x5174BCEE404419A4LL},{5L},{0x900ECE2BE9A49DB4LL},{0xC4DBBE6C3B9D6DBELL},{0x18B7A7007CAD6048LL}},{{(-9L)},{0x18B7A7007CAD6048LL},{0xC4DBBE6C3B9D6DBELL},{0x900ECE2BE9A49DB4LL},{5L},{0x5174BCEE404419A4LL}},{{5L},{0x900ECE2BE9A49DB4LL},{0xC4DBBE6C3B9D6DBELL},{0x18B7A7007CAD6048LL},{(-9L)},{0x18B7A7007CAD6048LL}},{{0xC4DBBE6C3B9D6DBELL},{0x900ECE2BE9A49DB4LL},{5L},{0x5174BCEE404419A4LL},{5L},{0x900ECE2BE9A49DB4LL}}}; uint16_t *l_2622[3][2][8] = {{{&g_1753.f1,(void*)0,&g_2151.f0.f1,&g_2151.f0.f1,(void*)0,&g_1753.f1,&g_1153[0][0].f1,&g_1753.f1},{(void*)0,&g_1753.f1,&g_1153[0][0].f1,&g_1753.f1,(void*)0,&g_2151.f0.f1,&g_2151.f0.f1,(void*)0}},{{&g_1753.f1,(void*)0,(void*)0,&g_1753.f1,&g_1931[1][7].f0.f1,(void*)0,&g_1931[1][7].f0.f1,&g_1753.f1},{(void*)0,&g_1931[1][7].f0.f1,(void*)0,&g_2151.f0.f1,&g_1153[0][0].f1,&g_1153[0][0].f1,&g_2151.f0.f1,(void*)0}},{{&g_1931[1][7].f0.f1,&g_1931[1][7].f0.f1,&g_1153[0][0].f1,(void*)0,&g_43[4].f1,(void*)0,&g_1153[0][0].f1,&g_1931[1][7].f0.f1},{&g_1931[1][7].f0.f1,(void*)0,&g_2151.f0.f1,&g_1153[0][0].f1,&g_1153[0][0].f1,&g_2151.f0.f1,(void*)0,&g_1931[1][7].f0.f1}}}; int16_t ****l_2632[10]; int64_t ***l_2633 = (void*)0; int32_t l_2692[10] = {5L,0xA11CA5EEL,5L,5L,0xA11CA5EEL,5L,5L,0xA11CA5EEL,5L,5L}; uint64_t * const *l_2728 = (void*)0; uint64_t * const **l_2727 = &l_2728; int i, j, k; for (i = 0; i < 10; i++) l_2632[i] = &g_2169[0]; l_2389 |= (p_18 != ((!(*g_1882)) , (safe_rshift_func_uint32_t_u_u(((((safe_sub_func_int8_t_s_s((((((safe_unary_minus_func_uint8_t_u((safe_add_func_uint8_t_u_u((0xD061CD04L == ((0x90E643A5L | (safe_mul_func_int64_t_s_s(p_19, (((((&l_2408[1][1][0] != (void*)0) <= 0xC9C9L) , 2UL) <= l_2402[3]) >= 1UL)))) , p_19)), l_2493)))) || (-1L)) , p_19) , 4294967295UL) > 0x1715D47CL), 1UL)) , p_18) && l_2494) > (*l_2390)), (*l_2390))))); if ((safe_mod_func_uint32_t_u_u(((safe_div_func_int32_t_s_s((65535UL ^ ((~(p_20 && 0x0EBBCA0D99AD987ELL)) == ((((safe_rshift_func_uint8_t_u_u((--(**g_1233)), ((safe_rshift_func_int8_t_s_u((((safe_mod_func_uint64_t_u_u((safe_sub_func_uint32_t_u_u(((p_18 && (--(*l_2431))) < l_2494), ((!(((safe_div_func_int64_t_s_s(((((safe_div_func_int64_t_s_s(((l_2408[2][0][1] < ((safe_div_func_uint32_t_u_u(p_18, (8UL | (safe_mod_func_uint8_t_u_u(((safe_sub_func_int64_t_s_s(((safe_mul_func_int16_t_s_s((p_21 &= (safe_mod_func_int64_t_s_s((**g_236), 18446744073709551615UL))), (-1L))) || (*g_1926)), l_2402[4])) || p_19), l_2494))))) || l_2494)) == 0xF739BA8CL), p_19)) <= l_2494) | l_2494) == l_2402[3]), 1UL)) | g_794[3][0].f4) > (*g_1882))) || l_2402[4]))), p_18)) | 0L) == l_2408[2][4][3]), 6)) , 9UL))) || p_20) & l_2408[1][1][0]) , p_19))), p_19)) , (*g_36)), l_2401))) { /* block id: 1124 */ int8_t l_2531 = 0x3AL; uint64_t ***l_2564[2]; int32_t *l_2574 = &g_1746; int32_t l_2575 = 0x9850DE46L; uint32_t *l_2576 = (void*)0; uint32_t *l_2577 = &l_2437; int32_t *l_2578[4] = {&l_2402[3],&l_2402[3],&l_2402[3],&l_2402[3]}; int32_t l_2580 = 0x9016D3C7L; uint8_t l_2592 = 3UL; int8_t l_2603 = 0xE3L; int i; for (i = 0; i < 2; i++) l_2564[i] = (void*)0; if ((0xA3L < 0x30L)) { /* block id: 1125 */ int32_t *l_2527 = &l_2049[3]; int32_t *l_2528 = (void*)0; int32_t *l_2529 = &l_2049[0]; int32_t *l_2530[5]; uint8_t l_2533 = 0x69L; uint8_t l_2538 = 0UL; int i; for (i = 0; i < 5; i++) l_2530[i] = &l_2402[2]; l_2533--; (*l_2527) |= p_20; (*g_2537) = l_2536; l_2538 = (*g_2079); } else { /* block id: 1130 */ return l_2408[2][2][3]; } if ((safe_add_func_int64_t_s_s((safe_mod_func_uint16_t_u_u(((l_2579[5] = ((*g_876) = ((safe_mod_func_int16_t_s_s((((*l_2577) ^= (safe_rshift_func_uint64_t_u_s(((safe_rshift_func_int32_t_s_s(((*l_2390) = p_18), (l_2575 = (safe_rshift_func_int8_t_s_s((safe_add_func_uint16_t_u_u((safe_mul_func_int16_t_s_s(p_18, ((g_2555 , ((*l_2574) ^= ((l_2573[6] ^= (0x64A66D13L <= ((safe_add_func_uint32_t_u_u(((safe_mod_func_int8_t_s_s((l_2571[0] |= ((safe_sub_func_uint32_t_u_u(((l_2408[1][1][0] = ((g_2562 = g_2562) == (l_2565 = l_2565))) <= (safe_div_func_int8_t_s_s((((l_2402[0] ^ (((safe_mod_func_uint16_t_u_u((*g_1882), (+l_2531))) , 9UL) , p_18)) < 0xCFFDFA22L) , l_2402[3]), 1UL))), (*g_876))) > p_21)), (-7L))) && p_20), l_2402[3])) < l_2572))) > l_2402[3]))) <= (*g_36)))), 0x0259L)), 4))))) , (*g_1926)), 63))) && 1L), l_2402[2])) == p_20))) ^ 0x4809C91CL), l_2580)), 6L))) { /* block id: 1144 */ int8_t **l_2584 = &g_846; int8_t ***l_2583 = &l_2584; int8_t ****l_2582 = &l_2583; int8_t *****l_2581 = &l_2582; l_2585[1] = l_2581; (*g_113) = &l_2575; } else { /* block id: 1147 */ (*l_2390) ^= (p_21 >= p_20); (*l_2574) &= (*g_876); (*g_445) = &l_2573[3]; } --l_2592; for (l_2401 = 1; (l_2401 <= 6); l_2401 += 1) { /* block id: 1155 */ int32_t l_2595 = 1L; int32_t l_2596 = 2L; int32_t l_2597[10] = {0xFF08695BL,1L,0xCC00D16EL,0xCC00D16EL,1L,0xFF08695BL,1L,0xCC00D16EL,0xCC00D16EL,1L}; int32_t l_2598 = 0x0E4DF707L; int32_t l_2599 = (-9L); int32_t l_2600[8][4] = {{0L,(-3L),(-3L),0L},{(-3L),0L,(-1L),0L},{(-3L),(-1L),(-3L),0xAB5E679FL},{(-3L),0x8B4C4550L,0xAB5E679FL,0xAB5E679FL},{0xBC03D87CL,0xBC03D87CL,(-1L),0x8B4C4550L},{0x8B4C4550L,(-3L),(-1L),(-3L)},{0xBC03D87CL,0L,0xAB5E679FL,(-1L)},{(-3L),0L,0L,(-3L)}}; int32_t l_2601 = (-2L); int32_t l_2602[9][3][7] = {{{(-1L),0x85E51865L,0xF800C843L,1L,0xAAE6D7B4L,1L,0xAAE6D7B4L},{0x78A2D533L,0xCD9D3686L,0xCD9D3686L,0x78A2D533L,0L,(-3L),0xA7D7A1CEL},{0xD3241674L,0x5762FDE9L,0x0D9C5E9DL,0x11495A25L,0xD3241674L,0x85E51865L,0xDADE7248L}},{{(-1L),0xAF1C5E20L,0x3A63BE95L,0xD9D272E1L,0xEF8F8A67L,0xBC451370L,0xA7D7A1CEL},{7L,1L,(-1L),0x85E51865L,0xF800C843L,1L,0xAAE6D7B4L},{0xBC451370L,0xD9D272E1L,0xA7D7A1CEL,1L,1L,0xA7D7A1CEL,0xD9D272E1L}},{{0xD3241674L,1L,(-2L),0x3922A172L,0x82E2BABFL,(-1L),(-2L)},{1L,0xAF1C5E20L,8L,2L,0xBC451370L,(-1L),0xCD9D3686L},{(-1L),0x5762FDE9L,(-1L),0x3922A172L,0xAAE6D7B4L,0x11495A25L,7L}},{{0xEF8F8A67L,0xCD9D3686L,0xD9D272E1L,1L,(-1L),(-3L),(-3L)},{0x82E2BABFL,0x85E51865L,0x0D9C5E9DL,0x85E51865L,0x82E2BABFL,0x11495A25L,0xDADE7248L},{0L,0xEF8F8A67L,2L,0xD9D272E1L,0x78A2D533L,(-1L),0xC5816AE1L}},{{7L,(-1L),0xF800C843L,0x11495A25L,0xF800C843L,(-1L),7L},{0L,0xD9D272E1L,(-3L),0x78A2D533L,0xAF1C5E20L,0xA7D7A1CEL,2L},{0x82E2BABFL,0x3922A172L,(-2L),1L,0xD3241674L,1L,(-2L)}},{{0xEF8F8A67L,0xEF8F8A67L,(-3L),2L,0L,0xBC451370L,0x3A63BE95L},{(-1L),1L,0xF800C843L,0xB1E9B238L,0xAAE6D7B4L,0x85E51865L,0xAAE6D7B4L},{1L,0xCD9D3686L,2L,0x78A2D533L,0L,(-3L),8L}},{{0xD3241674L,0x11495A25L,0x0D9C5E9DL,0x5762FDE9L,0xD3241674L,1L,0xDADE7248L},{0xBC451370L,0xAF1C5E20L,0xD9D272E1L,0xD9D272E1L,0xAF1C5E20L,0xBC451370L,8L},{7L,0xB1E9B238L,(-1L),1L,0xF800C843L,0xB1E9B238L,0xAAE6D7B4L}},{{(-1L),0xD9D272E1L,8L,1L,0x78A2D533L,0xA7D7A1CEL,0x3A63BE95L},{0xD3241674L,0xB1E9B238L,(-2L),(-1L),0x82E2BABFL,0x3922A172L,(-2L)},{0x78A2D533L,0xAF1C5E20L,0xA7D7A1CEL,2L,(-1L),(-1L),2L}},{{(-1L),0x11495A25L,(-1L),(-1L),0xAAE6D7B4L,0x5762FDE9L,7L},{0xAF1C5E20L,0xCD9D3686L,0x3A63BE95L,1L,0xBC451370L,(-3L),0xC5816AE1L},{0x82E2BABFL,1L,0x0D9C5E9DL,1L,0x82E2BABFL,0x5762FDE9L,0xDADE7248L}}}; uint8_t l_2607 = 7UL; int i, j, k; if (g_317[l_2401]) break; (*l_2574) &= p_19; if (l_2401) continue; ++l_2607; } } else { /* block id: 1161 */ l_2049[2] = ((safe_rshift_func_uint8_t_u_u((((*g_36) , ((safe_mod_func_int16_t_s_s((*l_2390), ((safe_lshift_func_int8_t_s_u(((safe_div_func_int16_t_s_s((!(safe_add_func_uint32_t_u_u(0xA760EFFDL, ((l_2571[0] = (p_21 = l_2579[5])) < (((+3L) , l_2622[0][1][6]) == (void*)0))))), (0xAFCD8451DC9B1BE8LL || ((0x3C79360EC4DE86CBLL > (*l_2390)) <= 8UL)))) != (**g_2562)), 0)) && 0xE2707CBBL))) > p_19)) & 0xDCF5L), 5)) > 0xBDL); } (*g_1109) = (l_2623 == (((g_877 , l_2624) == l_2628) , l_2632[9])); for (g_265.f4.f2 = 0; (g_265.f4.f2 <= 3); g_265.f4.f2 += 1) { /* block id: 1169 */ int32_t l_2640 = 0x9F04988DL; int32_t l_2642 = (-1L); int32_t l_2643 = 0L; int32_t l_2644 = 0x4B56F42CL; int32_t l_2645 = 0xB3935C91L; int32_t l_2646[8][6][5] = {{{(-1L),(-6L),0x18AB31EEL,0x18AB31EEL,(-6L)},{0xD05197C9L,0x1EA95203L,0L,0L,0x9FF7A1FAL},{0x02EB36CBL,(-1L),0x7338B092L,0x65B59264L,1L},{0xC5F484DAL,0xC67C2201L,0xD05197C9L,0xBB8367E0L,(-1L)},{0x02EB36CBL,0x18AB31EEL,0x21C8E332L,0x0A5F227AL,0x65B59264L},{0xD05197C9L,(-7L),0xE5B9AEA9L,0x21F9677BL,0xE5B9AEA9L}},{{(-1L),(-1L),0x65B59264L,0x0A5F227AL,0x21C8E332L},{7L,(-1L),(-1L),0xBB8367E0L,0xD05197C9L},{0x7338B092L,0x65B59264L,1L,0x65B59264L,0x7338B092L},{0xA3412122L,(-1L),0x9FF7A1FAL,0L,0L},{0x0A5F227AL,(-1L),(-6L),0x18AB31EEL,0x18AB31EEL},{(-7L),(-7L),(-7L),(-1L),0L}},{{0x1A43E8C0L,0x18AB31EEL,(-1L),0xC4A3058AL,0x7338B092L},{0L,0xC67C2201L,0x373ED51EL,0x43965843L,0xD05197C9L},{(-6L),(-1L),(-1L),0x7338B092L,0x21C8E332L},{0xDC27EC83L,0x1EA95203L,(-7L),7L,0xE5B9AEA9L},{0x01239C5FL,(-6L),(-6L),0x01239C5FL,0x65B59264L},{0xDC27EC83L,0x43965843L,0x9FF7A1FAL,0x757ADAEFL,(-1L)}},{{(-6L),0x02EB36CBL,1L,(-1L),1L},{0L,0x21F9677BL,(-1L),0x757ADAEFL,0x9FF7A1FAL},{0x1A43E8C0L,0xC4A3058AL,0x65B59264L,0x01239C5FL,(-6L)},{(-7L),7L,0xE5B9AEA9L,7L,(-7L)},{0x0A5F227AL,0xC4A3058AL,0x21C8E332L,0x7338B092L,(-1L)},{0xA3412122L,0x21F9677BL,0xD05197C9L,0x43965843L,0x373ED51EL}},{{0x7338B092L,0x02EB36CBL,0x7338B092L,0xC4A3058AL,(-1L)},{7L,0x43965843L,0L,(-1L),(-7L)},{(-1L),(-6L),0x18AB31EEL,0x18AB31EEL,(-6L)},{0xD05197C9L,0x1EA95203L,0L,0L,0x9FF7A1FAL},{0x02EB36CBL,(-1L),0x7338B092L,0x65B59264L,1L},{0xC5F484DAL,0xC67C2201L,0xD05197C9L,0xBB8367E0L,(-1L)}},{{0x02EB36CBL,0x18AB31EEL,0x21C8E332L,0x0A5F227AL,0x65B59264L},{0xD05197C9L,(-7L),0xE5B9AEA9L,0x21F9677BL,0xE5B9AEA9L},{(-1L),(-1L),0x65B59264L,0x0A5F227AL,0x21C8E332L},{7L,(-1L),(-1L),0xBB8367E0L,0xD05197C9L},{0x7338B092L,0x02EB36CBL,0x1A43E8C0L,0x02EB36CBL,0x18AB31EEL},{0L,0x1EA95203L,0xE5B9AEA9L,0x43965843L,(-1L)}},{{0xC4A3058AL,0x65B59264L,0x01239C5FL,(-6L),(-6L)},{0x373ED51EL,0x757ADAEFL,0x373ED51EL,0x1EA95203L,(-1L)},{0x7338B092L,(-6L),0x65B59264L,(-1L),0x18AB31EEL},{(-1L),0xBB8367E0L,0xD05197C9L,0xC67C2201L,0xC5F484DAL},{0x01239C5FL,0x21C8E332L,0x65B59264L,0x18AB31EEL,1L},{0xA3412122L,0L,0x373ED51EL,(-7L),7L}},{{(-1L),0x01239C5FL,0x01239C5FL,(-1L),0x02EB36CBL},{0xA3412122L,0xC67C2201L,0xE5B9AEA9L,(-1L),0xDC27EC83L},{0x01239C5FL,0x0A5F227AL,0x1A43E8C0L,0x65B59264L,0x1A43E8C0L},{(-1L),7L,0xDC27EC83L,(-1L),0xE5B9AEA9L},{0x7338B092L,(-1L),0x02EB36CBL,(-1L),0x01239C5FL},{0x373ED51EL,(-7L),7L,(-7L),0x373ED51EL}}}; uint32_t *l_2665[4] = {&l_2437,&l_2437,&l_2437,&l_2437}; int i, j, k; if (((*l_2390) = (l_2051[2] != l_2633))) { /* block id: 1171 */ union U2 **l_2634 = &g_709; union U2 **l_2636 = &g_709; union U2 ***l_2635 = &l_2636; int32_t *l_2637 = &l_2389; int32_t *l_2638 = &g_315; int32_t *l_2639[3][5] = {{&l_2049[3],(void*)0,&l_2049[3],&l_2049[3],(void*)0},{&l_2049[0],&l_2590[0],&l_2590[0],&l_2049[0],&l_2590[0]},{(void*)0,(void*)0,&l_2402[3],(void*)0,(void*)0}}; int64_t **l_2651 = &g_569[7][0]; uint32_t *l_2663 = &g_96; int i, j; (*l_2390) = (l_2634 == ((*l_2635) = &l_2396)); ++l_2648; (*g_113) = (*g_796); l_2642 |= (safe_unary_minus_func_int32_t_s((safe_lshift_func_uint16_t_u_s(((*g_783) | ((l_2573[6] = (l_2571[0] , 0x7CL)) ^ (l_2586[4][7][0] , (~(((((safe_add_func_uint32_t_u_u(((++(*g_1882)) || (safe_rshift_func_uint8_t_u_s(((safe_div_func_int8_t_s_s(((&l_2633 == (void*)0) < l_2408[1][1][0]), (-1L))) , ((l_2646[3][2][0] && 0xC092L) < 0L)), p_21))), l_2678)) && (**g_2562)) ^ 0x37B6L) <= 0L) , (*g_36)))))), p_19)))); } else { /* block id: 1180 */ (*g_445) = (void*)0; } if (((*l_2390) = ((0xAE59L >= p_21) && (safe_mod_func_int8_t_s_s((((((safe_add_func_int16_t_s_s(0L, ((g_2684 = l_2683) != &g_328))) <= ((safe_lshift_func_uint64_t_u_s(((((~(--(*g_36))) ^ (safe_lshift_func_uint8_t_u_u(1UL, 4))) ^ l_2692[6]) >= p_20), ((safe_mod_func_uint64_t_u_u((p_21 , p_20), p_20)) , l_2695))) && (*g_783))) != p_21) | 0L) == p_20), (-4L)))))) { /* block id: 1186 */ (*l_2390) &= (safe_add_func_uint8_t_u_u((safe_sub_func_uint64_t_u_u(18446744073709551615UL, 0xB1E633DD917D1760LL)), (g_1170 &= (safe_add_func_int64_t_s_s((l_2573[4] = ((safe_unary_minus_func_int16_t_s((p_21 &= (((safe_mul_func_int16_t_s_s((safe_mod_func_uint8_t_u_u((!((*g_1926) ^ (safe_rshift_func_uint8_t_u_u((0xBDADB6A460D03FAFLL <= (((safe_lshift_func_uint64_t_u_u((p_18 <= (p_20 | (safe_rshift_func_int8_t_s_s((safe_mul_func_uint64_t_u_u(((*g_1882) <= 0x4CB1L), ((*g_1882) & (*g_1882)))), l_2647[0])))), 52)) <= (-1L)) == (*g_1381))), 3)))), p_18)), (*g_1882))) && 0x4C5FA0D14EFD866DLL) && (-1L))))) ^ 9L)), (*g_2563)))))); if ((*l_2390)) continue; } else { /* block id: 1192 */ return p_18; } (*l_2390) |= (safe_mul_func_int16_t_s_s((((*g_1234) = (safe_lshift_func_int8_t_s_u(((&l_2413 != &l_2396) == ((g_2720[4] != (l_2722[2][5][2] = l_2722[2][5][2])) || ((&g_2562 == l_2727) != (l_2402[3] = 1L)))), 6))) && (18446744073709551614UL == (((void*)0 != l_2473) >= 0UL))), p_21)); } } (*l_2390) &= (p_19 > (safe_mod_func_int8_t_s_s(p_21, (0x32L ^ (+(0UL & (*g_1882))))))); ++l_2741; } else { /* block id: 1203 */ int32_t l_2744 = 0L; return l_2744; } (*g_113) = (((+(safe_div_func_uint32_t_u_u(p_20, (*g_36)))) , g_2748) , (*g_796)); } return p_18; } /* ------------------------------------------ */ /* * reads : g_1554.f2 g_1767 g_36 g_37 g_327 g_328 g_1554.f3 g_42 g_1697 g_1698 g_783 g_43.f5 g_1830 g_425.f0.f5 g_1320 g_1931.f0 g_794.f6 * writes: g_506.f4.f3 g_1554.f3 g_42 g_744 g_1550.f4 g_182 g_425.f0.f5 g_1320 */ static struct S0 func_22(int32_t p_23, int64_t p_24) { /* block id: 804 */ int64_t l_1759[10][7][1] = {{{1L},{1L},{0xC0974AFCAD8DE402LL},{2L},{3L},{0x978DA6B5381A46B5LL},{0xDD44A60E56BE4220LL}},{{3L},{1L},{4L},{1L},{3L},{0xDD44A60E56BE4220LL},{0x978DA6B5381A46B5LL}},{{3L},{2L},{0xC0974AFCAD8DE402LL},{1L},{1L},{0x978DA6B5381A46B5LL},{0x978DA6B5381A46B5LL}},{{1L},{1L},{0xC0974AFCAD8DE402LL},{2L},{3L},{0x978DA6B5381A46B5LL},{0xDD44A60E56BE4220LL}},{{3L},{1L},{4L},{1L},{3L},{0xDD44A60E56BE4220LL},{0x978DA6B5381A46B5LL}},{{3L},{2L},{0xC0974AFCAD8DE402LL},{1L},{1L},{0x978DA6B5381A46B5LL},{0x978DA6B5381A46B5LL}},{{1L},{1L},{0xC0974AFCAD8DE402LL},{2L},{3L},{0x978DA6B5381A46B5LL},{0xDD44A60E56BE4220LL}},{{3L},{1L},{4L},{1L},{3L},{0xDD44A60E56BE4220LL},{0x978DA6B5381A46B5LL}},{{3L},{2L},{0xC0974AFCAD8DE402LL},{1L},{1L},{0x978DA6B5381A46B5LL},{0x978DA6B5381A46B5LL}},{{1L},{1L},{0xC0974AFCAD8DE402LL},{2L},{3L},{0x978DA6B5381A46B5LL},{0xDD44A60E56BE4220LL}}}; int8_t **l_1763 = (void*)0; int32_t l_1773 = 0x806E5788L; int32_t l_1774 = (-1L); int32_t l_1775 = (-7L); int32_t l_1776 = 4L; int32_t l_1778 = 0xE0BDC1A0L; int32_t l_1780 = 0x1B30F5BFL; int32_t l_1781 = 1L; int32_t l_1783 = (-1L); int32_t l_1785 = 1L; int32_t l_1786 = 0x41A087ADL; int32_t l_1787 = 1L; int32_t l_1788 = 0xBB748B3DL; int32_t l_1789 = 1L; int32_t l_1791 = 0x2BC7A395L; int32_t l_1792 = 2L; int32_t l_1793 = (-1L); int32_t l_1794 = 1L; int32_t l_1796 = 1L; int32_t l_1797[7][6]; uint16_t l_1799 = 65528UL; union U2 **l_1826 = &g_709; union U2 ***l_1825 = &l_1826; uint32_t l_1835 = 0xEF05DCADL; struct S1 **l_1839 = (void*)0; int8_t l_1915 = (-9L); const int8_t l_1942[9] = {(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}; int16_t ***l_1944[2]; uint32_t l_1979 = 0xD6B0B692L; int16_t l_1982[1][6][7] = {{{0x18C4L,0x18C4L,0xC8E4L,0x1D63L,0xC8E4L,0x18C4L,0x18C4L},{0x18C4L,0xC8E4L,0x1D63L,0xC8E4L,0x18C4L,0x18C4L,0xC8E4L},{4L,1L,4L,0xC8E4L,0xC8E4L,4L,1L},{0xC8E4L,1L,0x1D63L,1L,0x18C4L,4L,0x18C4L},{0x1D63L,4L,4L,0x1D63L,0x18C4L,0x1D63L,4L},{0xC8E4L,0xC8E4L,4L,1L,4L,0xC8E4L,0xC8E4L}}}; int i, j, k; for (i = 0; i < 7; i++) { for (j = 0; j < 6; j++) l_1797[i][j] = 0x1ED92024L; } for (i = 0; i < 2; i++) l_1944[i] = (void*)0; if ((0xBD420CB417237DC5LL | 0x22BFAC158F20F786LL)) { /* block id: 805 */ const int8_t *l_1762 = (void*)0; const int8_t **l_1761[2]; const int8_t ***l_1760 = &l_1761[1]; int32_t l_1764 = 0L; int32_t *l_1765[5]; int32_t l_1766 = (-4L); int16_t *l_1768 = &g_506.f4.f3; int16_t *l_1769 = &g_1554.f3; int32_t *l_1770 = (void*)0; int32_t *l_1771 = &g_42; int16_t l_1777[3][1][3] = {{{1L,1L,1L}},{{0xB50EL,0xA4CFL,0xB50EL}},{{1L,1L,1L}}}; int32_t l_1779 = 0x32998540L; int32_t l_1782 = 0x2227B660L; int32_t l_1784[4] = {9L,9L,9L,9L}; int32_t l_1795[10] = {0x0FD54890L,0L,0x0FD54890L,0L,0x0FD54890L,0L,0x0FD54890L,0L,0x0FD54890L,0L}; int8_t l_1798[6] = {0x11L,0x11L,0x11L,0x11L,0x11L,0x11L}; uint8_t l_1828 = 1UL; int i, j, k; for (i = 0; i < 2; i++) l_1761[i] = &l_1762; for (i = 0; i < 5; i++) l_1765[i] = &g_1598; if (((*l_1771) = (safe_mod_func_int32_t_s_s(((p_24 <= ((((((*l_1760) = (l_1759[4][6][0] , (void*)0)) == l_1763) || l_1759[4][6][0]) , l_1764) == (((l_1766 = l_1759[4][6][0]) , g_1554.f2) != ((*l_1769) = ((*l_1768) = (l_1759[0][2][0] > g_1767)))))) , l_1759[4][6][0]), (*g_36))))) { /* block id: 811 */ int32_t *l_1772[2]; int8_t l_1790[2][7] = {{0xAEL,0xAEL,0xAEL,0xAEL,0xAEL,0xAEL,0xAEL},{0x04L,0x04L,0x04L,0x04L,0x04L,0x04L,0x04L}}; int32_t *****l_1817 = &g_744; int64_t *l_1820 = &g_1550.f4; int64_t *l_1821 = &g_182[1]; int64_t *l_1822 = &l_1759[2][0][0]; union U2 ****l_1827 = &l_1825; int32_t l_1829 = 1L; int i, j; for (i = 0; i < 2; i++) l_1772[i] = &g_42; l_1799--; l_1775 ^= (((safe_mul_func_int32_t_s_s(0xA4AD06DAL, ((p_24 = ((*l_1822) = (9L > (safe_mul_func_uint8_t_u_u((safe_div_func_uint8_t_u_u(((-4L) && (0xF3F6L != (safe_sub_func_int64_t_s_s(((*l_1821) = (safe_rshift_func_uint16_t_u_u((((safe_unary_minus_func_int64_t_s(((*l_1820) = (((safe_mul_func_int8_t_s_s((l_1791 &= (-1L)), (safe_add_func_int32_t_s_s(((p_23 < ((*l_1769) &= ((&g_444[2] != ((*l_1817) = &g_444[5])) ^ (safe_add_func_int8_t_s_s((((void*)0 == (*g_327)) == l_1783), p_24))))) || l_1783), p_23)))) & p_23) >= (*l_1771))))) || (*g_36)) < 0xAC71C980L), 10))), 1UL)))), 0x4DL)), 1UL))))) > l_1793))) <= l_1783) > p_23); l_1829 = ((*g_36) , (l_1782 = (l_1784[3] = ((*l_1771) = (((((void*)0 != (*g_1697)) < ((((safe_div_func_uint32_t_u_u((((0x5C5E8A91L | ((*g_783) < p_24)) | ((((((*l_1827) = l_1825) != (void*)0) == p_24) <= 0x59BB521CB1B74B9ALL) , 0L)) == 7L), (*g_36))) , p_24) == p_23) > 0x91L)) , l_1828) != p_23))))); } else { /* block id: 826 */ return g_1830; } } else { /* block id: 829 */ struct S1 **l_1836[8]; uint8_t l_1842[5] = {0UL,0UL,0UL,0UL,0UL}; int32_t l_1869[7] = {0L,0L,0x22A15B04L,0L,0L,0x22A15B04L,0L}; int32_t l_2021 = 0x2C3CB107L; int i; for (i = 0; i < 8; i++) l_1836[i] = &g_1336; for (g_425.f0.f5 = (-9); (g_425.f0.f5 <= (-1)); g_425.f0.f5 = safe_add_func_uint16_t_u_u(g_425.f0.f5, 4)) { /* block id: 832 */ int32_t l_1843[3][3] = {{0xFDFBF4F5L,0xFDFBF4F5L,0xFDFBF4F5L},{0xC472DC23L,0xC472DC23L,0xC472DC23L},{0xFDFBF4F5L,0xFDFBF4F5L,0xFDFBF4F5L}}; int32_t l_1893 = (-4L); int32_t l_1899 = 0x4E0F7D36L; const int16_t l_1910 = 1L; int8_t *l_1923 = &g_746.f5; uint32_t *l_1928[1][2]; int16_t *** const l_1943 = &g_533; uint16_t l_1959[7][5][3] = {{{1UL,65535UL,65535UL},{0xC5B9L,65535UL,4UL},{65535UL,1UL,0x390FL},{0xC5B9L,0xC5B9L,0x390FL},{1UL,65535UL,4UL}},{{65535UL,0xC5B9L,65535UL},{65535UL,1UL,0xC5B9L},{1UL,65535UL,65535UL},{0xC5B9L,65535UL,4UL},{65535UL,1UL,0x390FL}},{{0xC5B9L,0xC5B9L,0x390FL},{1UL,65535UL,4UL},{65535UL,0xC5B9L,65535UL},{65535UL,1UL,0xC5B9L},{1UL,65535UL,65535UL}},{{0xC5B9L,65535UL,4UL},{65535UL,1UL,0x390FL},{0xC5B9L,0xC5B9L,0x390FL},{1UL,65535UL,4UL},{65535UL,0xC5B9L,65535UL}},{{65535UL,1UL,0xC5B9L},{1UL,65535UL,65535UL},{0xC5B9L,65535UL,4UL},{65535UL,1UL,0x390FL},{0xC5B9L,0xC5B9L,0x390FL}},{{1UL,65535UL,4UL},{65535UL,0xC5B9L,65535UL},{65535UL,1UL,0xC5B9L},{1UL,65535UL,65535UL},{0xC5B9L,65535UL,4UL}},{{65535UL,1UL,0x390FL},{0xC5B9L,0xC5B9L,0x390FL},{1UL,65535UL,4UL},{65535UL,0xC5B9L,65535UL},{65535UL,1UL,0xC5B9L}}}; uint64_t l_1991[9][3][1] = {{{0x68620445D1243E9BLL},{0xBB96339768D12279LL},{0x68620445D1243E9BLL}},{{0xBB96339768D12279LL},{0xC9C66E72063857ABLL},{0xBB96339768D12279LL}},{{0x0DA69023EA9AE878LL},{0xF9B671A1FBB3229ELL},{0x0DA69023EA9AE878LL}},{{0xBB96339768D12279LL},{0xC9C66E72063857ABLL},{0xBB96339768D12279LL}},{{0x0DA69023EA9AE878LL},{0xF9B671A1FBB3229ELL},{0x0DA69023EA9AE878LL}},{{0xBB96339768D12279LL},{0xC9C66E72063857ABLL},{0xBB96339768D12279LL}},{{0x0DA69023EA9AE878LL},{0xF9B671A1FBB3229ELL},{0x0DA69023EA9AE878LL}},{{0xBB96339768D12279LL},{0xC9C66E72063857ABLL},{0xBB96339768D12279LL}},{{0x0DA69023EA9AE878LL},{0xF9B671A1FBB3229ELL},{0x0DA69023EA9AE878LL}}}; int i, j, k; for (i = 0; i < 1; i++) { for (j = 0; j < 2; j++) l_1928[i][j] = &g_26; } for (g_1320 = (-16); (g_1320 > 60); g_1320++) { /* block id: 835 */ struct S1 **l_1837 = &g_1336; struct S1 ***l_1838[5]; int32_t l_1870 = 0L; int32_t *l_1896 = &g_1598; int32_t l_1898[3][4][7] = {{{0x6FC34E7FL,0xA209BE62L,0x6FC34E7FL,0xD16D1A16L,(-2L),0x101635EAL,1L},{0x9FA2F57FL,7L,0x101635EAL,0xD16D1A16L,0x101635EAL,7L,0x9FA2F57FL},{7L,5L,1L,(-2L),(-1L),0x101635EAL,(-1L)},{7L,(-1L),(-1L),7L,0x6FC34E7FL,0xC8EF57D5L,0xD16D1A16L}},{{0x9FA2F57FL,0xC8EF57D5L,1L,0x6FC34E7FL,0x6FC34E7FL,1L,0xC8EF57D5L},{0x6FC34E7FL,0x9FA2F57FL,0x101635EAL,5L,(-1L),0xD16D1A16L,0xD16D1A16L},{0x101635EAL,0x9FA2F57FL,0x6FC34E7FL,0x9FA2F57FL,0x101635EAL,5L,(-1L)},{1L,0xC8EF57D5L,0x9FA2F57FL,5L,(-2L),5L,0x9FA2F57FL}},{{(-1L),(-1L),7L,0x6FC34E7FL,0xC8EF57D5L,0xD16D1A16L,1L},{1L,5L,7L,7L,5L,1L,(-2L)},{0x101635EAL,7L,0x9FA2F57FL,(-2L),0xC8EF57D5L,0xC8EF57D5L,(-2L)},{0x6FC34E7FL,0xA209BE62L,0x6FC34E7FL,0xD16D1A16L,(-2L),0x101635EAL,1L}}}; int64_t *****l_1904 = &g_566; int32_t ***l_1976 = &g_445; union U2 *l_1987 = &g_506; int i, j, k; for (i = 0; i < 5; i++) l_1838[i] = (void*)0; if (p_24) break; } } } return g_1931[1][7].f0; } /* ------------------------------------------ */ /* * reads : g_446 g_273 g_315 g_445 g_744 g_444 g_783 g_43.f5 g_1234 g_94 g_1365.f1 g_1455 g_36 g_37 g_1233 g_96 g_994 g_1490 g_113 g_1381 g_521 g_794 g_198 g_1598 g_1550.f0.f2 g_1607 g_1506 g_846 g_1655 g_1667 g_1668 g_1753 g_857.f5 g_746.f1 g_506.f4.f3 g_380.f4.f5 * writes: g_37 g_273 g_315 g_857.f5 g_746.f1 g_506.f4.f3 g_446 g_380.f4.f5 g_1285.f2 g_1365.f1 g_1336 g_96 g_669 g_1055.f4.f1 g_114 g_1550.f0.f5 g_1055.f4.f2 g_1138 g_263 g_380.f2 g_1055.f4.f5 g_94 g_712.f4.f5 g_1455.f1 g_1655 g_265.f4.f1 */ static struct S0 func_30(uint32_t p_31) { /* block id: 2 */ int32_t l_1041 = 0xB196FBD8L; uint32_t *l_1042 = &g_96; int32_t l_1168 = 0xF4316C1CL; int32_t l_1169[4][1][2] = {{{0x60226775L,0x60226775L}},{{0x60226775L,0x60226775L}},{{0x60226775L,0x60226775L}},{{0x60226775L,0x60226775L}}}; int64_t **** const l_1182[9][4] = {{&g_567[1][2][1],&g_567[1][2][1],&g_567[0][0][0],&g_567[0][0][1]},{&g_567[0][3][1],&g_567[0][1][1],&g_567[0][3][1],&g_567[0][0][0]},{&g_567[0][3][1],&g_567[0][0][0],&g_567[0][0][0],&g_567[0][3][1]},{&g_567[1][2][1],&g_567[0][0][0],&g_567[0][0][1],&g_567[0][0][0]},{&g_567[0][0][0],&g_567[0][1][1],&g_567[0][0][1],&g_567[0][0][1]},{&g_567[1][2][1],&g_567[1][2][1],&g_567[0][0][0],&g_567[0][0][1]},{&g_567[0][3][1],&g_567[0][1][1],&g_567[0][3][1],&g_567[0][0][0]},{&g_567[0][3][1],&g_567[0][0][0],&g_567[0][0][0],&g_567[0][3][1]},{&g_567[1][2][1],&g_567[0][0][0],&g_567[0][0][1],&g_567[0][0][0]}}; uint32_t l_1273 = 0x7BC15E44L; int32_t **l_1286 = &g_446[4]; uint32_t l_1363 = 0UL; uint8_t *l_1380[3]; uint8_t *l_1392[6] = {&g_94[2],&g_94[2],&g_94[2],&g_94[2],&g_94[2],&g_94[2]}; int32_t l_1415[7]; uint64_t l_1416 = 0xD70C43F840D217B8LL; uint32_t l_1428 = 0x15F93A37L; int8_t **l_1561 = &g_846; uint64_t l_1569 = 0xB169A2514AEBD064LL; union U2 **l_1609 = &g_709; union U2 ***l_1608 = &l_1609; int i, j, k; for (i = 0; i < 3; i++) l_1380[i] = &g_94[0]; for (i = 0; i < 7; i++) l_1415[i] = 9L; lbl_1454: for (g_37 = (-6); (g_37 == 33); g_37++) { /* block id: 5 */ uint64_t l_41[6][2] = {{0xC49A7E1289ED5B60LL,0xC49A7E1289ED5B60LL},{1UL,0xC49A7E1289ED5B60LL},{0xC49A7E1289ED5B60LL,1UL},{0xC49A7E1289ED5B60LL,0xC49A7E1289ED5B60LL},{1UL,0xC49A7E1289ED5B60LL},{0xC49A7E1289ED5B60LL,1UL}}; int32_t l_878 = (-1L); int32_t l_1119 = 0x9617E2D4L; uint32_t *l_1177[6]; uint32_t l_1213 = 0x49AF8935L; int8_t *l_1228 = &g_794[3][0].f0.f5; int16_t **l_1269[2][7][5] = {{{&g_396,&g_397[0][0][5],&g_397[0][0][5],&g_396,&g_396},{&g_397[0][0][5],&g_397[2][4][3],&g_397[0][0][5],&g_397[0][0][5],&g_396},{&g_396,&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5]},{&g_397[0][3][3],&g_397[2][4][3],(void*)0,&g_397[2][4][3],&g_397[0][3][3]},{&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5]},{&g_397[0][0][5],(void*)0,&g_397[2][0][3],&g_397[0][0][5],&g_397[2][0][3]},{&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5]}},{{(void*)0,&g_397[0][0][5],(void*)0,(void*)0,&g_397[0][3][3]},{&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5]},{&g_397[0][0][5],&g_397[0][0][5],&g_396,&g_397[0][0][5],&g_397[0][0][5]},{&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5]},{&g_397[0][3][3],(void*)0,(void*)0,&g_397[0][0][5],(void*)0},{&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5],&g_397[0][0][5]},{&g_397[2][0][3],&g_397[0][0][5],&g_397[2][0][3],(void*)0,&g_397[0][0][5]}}}; int16_t ***l_1268[6][6][5] = {{{&l_1269[0][0][3],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][0][3],&l_1269[1][1][0]},{&l_1269[0][4][1],&l_1269[0][5][2],(void*)0,&l_1269[0][4][1],&l_1269[0][4][1]},{(void*)0,&l_1269[0][4][1],(void*)0,&l_1269[1][1][0],&l_1269[0][5][2]},{&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[1][1][1]},{(void*)0,&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][0][3],(void*)0},{(void*)0,(void*)0,&l_1269[1][1][1],&l_1269[1][1][1],(void*)0}},{{&l_1269[0][1][0],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[1][1][1]},{&l_1269[0][4][1],&l_1269[0][4][1],(void*)0,&l_1269[0][1][0],&l_1269[0][5][2]},{&l_1269[0][4][1],(void*)0,&l_1269[0][4][1],&l_1269[1][1][1],&l_1269[0][4][1]},{&l_1269[0][4][1],&l_1269[0][4][1],(void*)0,&l_1269[0][4][1],&l_1269[1][1][0]},{&l_1269[0][1][0],&l_1269[0][0][3],(void*)0,(void*)0,(void*)0},{(void*)0,&l_1269[0][0][3],(void*)0,&l_1269[1][1][0],&l_1269[0][4][1]}},{{(void*)0,&l_1269[0][4][1],&l_1269[1][1][0],&l_1269[0][4][1],&l_1269[1][1][1]},{&l_1269[0][4][1],(void*)0,&l_1269[0][4][1],&l_1269[0][5][2],&l_1269[0][1][0]},{(void*)0,&l_1269[0][4][1],&l_1269[1][1][0],&l_1269[1][1][1],&l_1269[0][4][1]},{&l_1269[0][4][1],&l_1269[0][4][1],(void*)0,(void*)0,&l_1269[1][1][1]},{&l_1269[0][0][3],(void*)0,(void*)0,(void*)0,&l_1269[0][0][3]},{&l_1269[0][4][1],&l_1269[0][4][1],(void*)0,&l_1269[1][1][1],&l_1269[0][4][1]}},{{&l_1269[0][5][2],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][5][2],&l_1269[1][1][0]},{(void*)0,&l_1269[0][4][1],(void*)0,&l_1269[0][4][1],&l_1269[0][4][1]},{(void*)0,&l_1269[0][5][2],&l_1269[0][4][1],&l_1269[1][1][0],&l_1269[0][0][3]},{&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[1][1][1],(void*)0,&l_1269[1][1][1]},{&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][4][1]},{(void*)0,&l_1269[0][1][0],&l_1269[0][4][1],&l_1269[1][1][1],&l_1269[0][1][0]}},{{(void*)0,&l_1269[0][4][1],(void*)0,&l_1269[0][1][0],&l_1269[1][1][1]},{&l_1269[0][5][2],&l_1269[0][1][0],(void*)0,&l_1269[0][4][1],&l_1269[0][4][1]},{&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[1][1][1],(void*)0},{&l_1269[0][0][3],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][0][3],&l_1269[1][1][0]},{&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[0][4][1],(void*)0,(void*)0},{&l_1269[1][0][3],&l_1269[0][4][1],&l_1269[0][4][1],&l_1269[1][3][1],&l_1269[0][4][1]}},{{(void*)0,(void*)0,(void*)0,(void*)0,&l_1269[0][5][3]},{&l_1269[0][4][1],(void*)0,(void*)0,(void*)0,&l_1269[0][4][1]},{&l_1269[1][0][3],&l_1269[0][4][1],&l_1269[0][5][3],&l_1269[0][5][3],&l_1269[0][4][1]},{&l_1269[1][1][1],(void*)0,&l_1269[0][4][1],&l_1269[1][1][0],&l_1269[0][5][3]},{&l_1269[0][4][1],&l_1269[1][1][0],&l_1269[0][4][1],&l_1269[1][1][1],&l_1269[0][4][1]},{&l_1269[0][4][1],&l_1269[0][4][1],(void*)0,&l_1269[0][5][3],(void*)0}}}; int32_t l_1328 = 0L; int32_t l_1329 = 0xBDC16BF1L; int32_t l_1330 = (-1L); int32_t ***l_1341 = &l_1286; int32_t *** const *l_1379 = (void*)0; int32_t *** const **l_1378 = &l_1379; int32_t *l_1414[4]; int i, j, k; for (i = 0; i < 6; i++) l_1177[i] = &g_96; for (i = 0; i < 4; i++) l_1414[i] = &l_878; for (p_31 = 0; (p_31 <= 1); p_31 += 1) { /* block id: 8 */ uint8_t l_53 = 0xDAL; uint32_t *l_71 = &g_37; int32_t l_1117 = 0x84FEEEEDL; int32_t l_1118[2]; uint16_t l_1120[6][2][4] = {{{7UL,0x760BL,0UL,0x9A8DL},{0x8B3FL,3UL,65530UL,0x9A8DL}},{{65533UL,0x760BL,0x8B3FL,0x760BL},{0x951CL,5UL,0x436BL,0xC0D7L}},{{0UL,0x698FL,65533UL,65535UL},{3UL,0x9A8DL,65535UL,0UL}},{{3UL,1UL,65533UL,65533UL},{0UL,0UL,0x436BL,1UL}},{{0x951CL,0x436BL,0x8B3FL,5UL},{65533UL,7UL,65530UL,0x8B3FL}},{{0x8B3FL,7UL,0UL,5UL},{7UL,0x436BL,7UL,1UL}}}; uint16_t l_1137 = 0UL; int16_t l_1230 = 0x9897L; uint8_t *l_1232 = &g_94[1]; uint8_t **l_1231[7][8][4] = {{{&l_1232,(void*)0,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,(void*)0,&l_1232},{(void*)0,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232}},{{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,(void*)0},{&l_1232,&l_1232,&l_1232,&l_1232},{(void*)0,(void*)0,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232}},{{&l_1232,&l_1232,(void*)0,&l_1232},{&l_1232,(void*)0,&l_1232,&l_1232},{(void*)0,&l_1232,&l_1232,(void*)0},{&l_1232,&l_1232,(void*)0,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,(void*)0,&l_1232},{&l_1232,&l_1232,(void*)0,&l_1232},{&l_1232,&l_1232,(void*)0,&l_1232}},{{&l_1232,&l_1232,&l_1232,&l_1232},{(void*)0,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,(void*)0},{&l_1232,&l_1232,(void*)0,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{(void*)0,&l_1232,&l_1232,(void*)0},{&l_1232,&l_1232,&l_1232,&l_1232}},{{&l_1232,(void*)0,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,(void*)0,(void*)0},{&l_1232,&l_1232,&l_1232,&l_1232},{(void*)0,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,(void*)0,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232}},{{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,(void*)0,&l_1232,&l_1232},{(void*)0,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,(void*)0,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{(void*)0,&l_1232,&l_1232,&l_1232}},{{(void*)0,&l_1232,&l_1232,&l_1232},{&l_1232,&l_1232,&l_1232,&l_1232},{(void*)0,&l_1232,(void*)0,&l_1232},{&l_1232,&l_1232,(void*)0,&l_1232},{&l_1232,&l_1232,&l_1232,(void*)0},{&l_1232,&l_1232,&l_1232,&l_1232},{&l_1232,(void*)0,(void*)0,&l_1232},{&l_1232,(void*)0,(void*)0,&l_1232}}}; int32_t **l_1287 = &g_446[4]; uint64_t *l_1298 = &l_41[0][0]; const int32_t l_1308[2][6] = {{0L,0L,0x2DBAFD1EL,0L,0L,0x2DBAFD1EL},{0L,0L,0x2DBAFD1EL,0L,0L,0x2DBAFD1EL}}; uint16_t l_1331[8][7] = {{0x31E2L,0x5796L,0x5796L,0x31E2L,0x20D9L,0x0CD8L,0x20D9L},{1UL,5UL,0UL,0xA770L,65535UL,0UL,65535UL},{0x31E2L,0x5796L,0x5796L,0x31E2L,0x20D9L,0x0CD8L,0x20D9L},{1UL,5UL,0UL,0xA770L,65535UL,0UL,65535UL},{0x31E2L,0x5796L,0x5796L,0x31E2L,0x20D9L,0x0CD8L,0x20D9L},{1UL,5UL,0UL,0xA770L,65535UL,0UL,65535UL},{0x31E2L,0x5796L,0x5796L,0x31E2L,0x20D9L,0x0CD8L,0x20D9L},{1UL,5UL,0UL,0xA770L,65535UL,0UL,65535UL}}; struct S1 *l_1334 = &g_425; int32_t ***l_1383 = &g_445; int32_t *l_1413 = &l_1118[0]; int i, j, k; for (i = 0; i < 2; i++) l_1118[i] = 0L; } l_1416--; (**g_445) = ((**l_1286) > 1L); } for (g_857.f5 = (-7); (g_857.f5 != (-6)); g_857.f5++) { /* block id: 652 */ int32_t l_1423 = 2L; int32_t l_1434 = 3L; int64_t ***l_1538 = &g_568[5][0][4]; int32_t l_1605 = 0xF31C97FEL; int32_t *l_1618 = (void*)0; int32_t *l_1619 = (void*)0; int32_t *l_1620 = &l_1169[1][0][0]; for (g_746.f1 = 0; (g_746.f1 <= 3); g_746.f1 += 1) { /* block id: 655 */ uint32_t l_1422 = 0x1817F0EDL; int32_t l_1487 = 0x7278C6AAL; const uint32_t l_1491[3] = {18446744073709551615UL,18446744073709551615UL,18446744073709551615UL}; int64_t ** const l_1497[8][2] = {{&g_569[5][0],&g_569[5][0]},{&g_569[5][0],&g_569[5][0]},{&g_569[5][0],&g_569[5][0]},{&g_569[5][0],&g_569[5][0]},{&g_569[5][0],&g_569[5][0]},{&g_569[5][0],&g_569[5][0]},{&g_569[5][0],&g_569[5][0]},{&g_569[5][0],&g_569[5][0]}}; uint32_t *l_1560 = &g_96; int32_t l_1604[8][7][4] = {{{4L,2L,0x91B32227L,2L},{(-1L),0xFEA141D9L,1L,(-1L)},{0x48C82592L,(-1L),5L,0xFB1E8055L},{5L,0x03A65A77L,0x17E9C3BBL,1L},{5L,0xA610883CL,5L,0L},{0x48C82592L,1L,1L,0xF6BFD02AL},{(-1L),4L,0x91B32227L,0x03A65A77L}},{{4L,0xA610883CL,0xA610883CL,4L},{1L,5L,0xF9D8BD41L,0xFB1E8055L},{0xA241A41AL,(-1L),0x91B32227L,(-1L)},{2L,0xFEA141D9L,0x5B9574B0L,(-1L)},{0x48C82592L,(-1L),0xF6BFD02AL,0xFB1E8055L},{0x03A65A77L,5L,0x17E9C3BBL,4L},{0L,0xA610883CL,0xFB1E8055L,0x03A65A77L}},{{0x48C82592L,4L,0x48C82592L,0xF6BFD02AL},{(-1L),1L,0x91B32227L,0L},{1L,0xA610883CL,0xFEA141D9L,1L},{1L,0x03A65A77L,0xFEA141D9L,0xFB1E8055L},{1L,(-1L),0x91B32227L,(-1L)},{(-1L),0xFEA141D9L,0x48C82592L,2L},{0x48C82592L,2L,0xFB1E8055L,0xFB1E8055L}},{{0L,0L,0x17E9C3BBL,0xA241A41AL},{0x03A65A77L,0xA610883CL,0xF6BFD02AL,5L},{0x48C82592L,0xA241A41AL,0x5B9574B0L,0xF6BFD02AL},{2L,0xA241A41AL,0x91B32227L,5L},{0xA241A41AL,0xA610883CL,0xF9D8BD41L,0xA241A41AL},{1L,0L,0xA610883CL,0xFB1E8055L},{4L,2L,0x91B32227L,2L}},{{(-1L),0xFEA141D9L,1L,(-1L)},{0x48C82592L,(-1L),5L,0xFB1E8055L},{5L,0x03A65A77L,0x17E9C3BBL,1L},{5L,0xA610883CL,5L,0L},{0x48C82592L,1L,1L,0xF6BFD02AL},{(-1L),4L,0x91B32227L,0x03A65A77L},{4L,0xA610883CL,0xA610883CL,4L}},{{1L,5L,0xF9D8BD41L,0xFB1E8055L},{0xA241A41AL,(-1L),0x91B32227L,(-1L)},{2L,0xFEA141D9L,0x5B9574B0L,(-1L)},{0x48C82592L,(-1L),0xF6BFD02AL,0xFB1E8055L},{0x03A65A77L,5L,0x17E9C3BBL,4L},{0L,0xA610883CL,0xFB1E8055L,0x03A65A77L},{0x48C82592L,4L,0x48C82592L,0xF6BFD02AL}},{{(-1L),1L,0x91B32227L,0L},{1L,0xA610883CL,0x91B32227L,0xFEA141D9L},{0L,1L,0x91B32227L,0xB93FA099L},{0xFEA141D9L,0xFB1E8055L,5L,0xF6BFD02AL},{0xF6BFD02AL,0x91B32227L,0xAFD37D7FL,5L},{0xAFD37D7FL,5L,0xB93FA099L,0xB93FA099L},{0x5B9574B0L,0x5B9574B0L,0x03A65A77L,0xA610883CL}},{{1L,(-1L),0L,0x48C82592L},{0xAFD37D7FL,0xA610883CL,0x7E119A73L,0L},{5L,0xA610883CL,5L,0x48C82592L},{0xA610883CL,(-1L),0x17E9C3BBL,0xA610883CL},{0L,0x5B9574B0L,(-1L),0xB93FA099L},{0xF9D8BD41L,5L,5L,5L},{0xFB1E8055L,0x91B32227L,0L,0xF6BFD02AL}}}; int i, j, k; (**g_445) = (~(l_1422 , ((l_1423 <= (((safe_sub_func_int64_t_s_s((((safe_div_func_int32_t_s_s(l_1428, (-2L))) >= l_1422) != p_31), l_1422)) < (-10L)) > ((safe_rshift_func_int32_t_s_s((safe_lshift_func_uint32_t_u_s(0x31F79ED0L, l_1423)), 28)) , l_1423))) , p_31))); for (g_506.f4.f3 = 0; (g_506.f4.f3 <= 3); g_506.f4.f3 += 1) { /* block id: 659 */ (***g_744) = (*g_445); } for (g_380.f4.f5 = 0; (g_380.f4.f5 <= 3); g_380.f4.f5 += 1) { /* block id: 664 */ int32_t l_1477[4] = {0L,0L,0L,0L}; int32_t l_1486[7][2] = {{0xC886EEF9L,0x8B186399L},{6L,0xC886EEF9L},{0xF9B64CB2L,0xF9B64CB2L},{0xF9B64CB2L,0xC886EEF9L},{6L,0x8B186399L},{0xC886EEF9L,0x8B186399L},{6L,0xC886EEF9L}}; int64_t *l_1488 = &g_72.f4; int64_t ***l_1501[8]; uint8_t **l_1528 = &g_1234; const uint32_t *l_1553 = &g_669; int i, j; for (i = 0; i < 8; i++) l_1501[i] = &g_568[3][5][1]; for (g_1285.f2 = 0; (g_1285.f2 <= 3); g_1285.f2 += 1) { /* block id: 667 */ int32_t l_1433 = 1L; uint16_t *l_1451 = &g_265.f4.f1; uint16_t *l_1452 = &g_1365.f1; int64_t l_1485 = 3L; const uint32_t l_1492 = 0xFED6AEF8L; int i, j; l_1434 = l_1433; if ((((*g_783) | p_31) & (safe_mul_func_int32_t_s_s((0xE51B8CAFL < 1UL), (safe_rshift_func_int32_t_s_s((+(safe_sub_func_uint32_t_u_u((p_31 > ((((l_1433 , ((safe_sub_func_int64_t_s_s((safe_add_func_uint64_t_u_u((((-1L) | (((safe_rshift_func_int16_t_s_u(p_31, ((*l_1452) &= (!(p_31 && (*g_1234)))))) | (**l_1286)) == 1L)) < l_1433), (**l_1286))), l_1433)) ^ p_31)) <= 0L) < 1L) < 0UL)), p_31))), 26)))))) { /* block id: 670 */ struct S1 **l_1453 = &g_1336; (*l_1453) = (void*)0; if (l_1423) goto lbl_1454; return g_1455[1]; } else { /* block id: 674 */ const int16_t l_1470[10][6][1] = {{{0x63E0L},{(-8L)},{0x162AL},{0xDBA1L},{0x0150L},{3L}},{{(-1L)},{0xC7DBL},{0xC7DBL},{(-1L)},{3L},{0x0150L}},{{0xDBA1L},{0x162AL},{(-8L)},{0x63E0L},{(-5L)},{0x63E0L}},{{(-8L)},{0x162AL},{0xDBA1L},{0x0150L},{3L},{(-1L)}},{{0xC7DBL},{0xC7DBL},{(-1L)},{3L},{0x0150L},{0xDBA1L}},{{0x162AL},{(-8L)},{0x63E0L},{(-5L)},{0x63E0L},{(-8L)}},{{0x162AL},{0xDBA1L},{0x0150L},{3L},{(-1L)},{0xC7DBL}},{{0xC7DBL},{(-1L)},{3L},{0x0150L},{0xDBA1L},{0x162AL}},{{(-8L)},{0x63E0L},{(-5L)},{0x63E0L},{(-8L)},{0x162AL}},{{0xDBA1L},{0x0150L},{3L},{(-1L)},{0xC7DBL},{0xC7DBL}}}; uint64_t *l_1471 = &l_1416; uint32_t *l_1484[5][5][6] = {{{(void*)0,(void*)0,(void*)0,&g_669,&g_669,&l_1273},{&g_37,&l_1273,&l_1273,&l_1273,&g_37,(void*)0},{&g_669,&g_669,&l_1273,(void*)0,(void*)0,&l_1273},{&l_1273,(void*)0,(void*)0,(void*)0,(void*)0,&l_1273},{(void*)0,(void*)0,&l_1273,&l_1273,(void*)0,&l_1273}},{{&l_1273,&g_669,&g_669,&g_37,&g_37,(void*)0},{&l_1273,&l_1273,&g_37,&l_1273,&g_669,&g_669},{(void*)0,(void*)0,(void*)0,(void*)0,&g_37,&g_669},{&l_1273,&g_669,&g_37,(void*)0,&l_1273,(void*)0},{&g_669,&l_1273,&g_669,&l_1273,&l_1273,&l_1273}},{{&g_37,&g_669,&l_1273,&l_1273,(void*)0,&g_37},{&l_1273,&l_1273,&g_669,&l_1273,&l_1273,&g_37},{&g_37,(void*)0,&l_1273,&g_37,&l_1273,&g_669},{&l_1273,&g_669,&l_1273,(void*)0,&l_1273,&g_37},{&g_37,(void*)0,&g_669,&g_669,(void*)0,&g_37}},{{&g_669,(void*)0,&g_37,&l_1273,&l_1273,&l_1273},{&l_1273,&g_669,&l_1273,&g_37,&l_1273,(void*)0},{&l_1273,(void*)0,&g_37,&l_1273,&l_1273,&g_37},{&g_669,&l_1273,&l_1273,&g_669,(void*)0,&g_37},{&g_37,&l_1273,&g_37,(void*)0,&g_669,(void*)0}},{{&l_1273,&l_1273,&l_1273,&g_37,&g_669,&l_1273},{&g_37,&l_1273,&g_37,&l_1273,(void*)0,&g_37},{&l_1273,&l_1273,&g_669,&l_1273,&l_1273,&g_37},{&g_37,(void*)0,&l_1273,&g_37,&l_1273,&g_669},{&l_1273,&g_669,&l_1273,(void*)0,&l_1273,&g_37}}}; int64_t *l_1489 = &g_1229; int i, j, k; l_1487 ^= (((safe_lshift_func_int32_t_s_s((safe_add_func_uint8_t_u_u(((*g_36) <= ((safe_sub_func_int64_t_s_s(((safe_lshift_func_uint64_t_u_s((safe_mul_func_uint32_t_u_u((safe_mul_func_uint8_t_u_u((safe_rshift_func_uint64_t_u_u(l_1470[1][5][0], ((*l_1471) = (8L <= (-1L))))), 0L)), (safe_lshift_func_int8_t_s_u(0x10L, 1)))), ((safe_unary_minus_func_int8_t_s((safe_rshift_func_int16_t_s_u((l_1477[1] = (**l_1286)), 2)))) || (safe_sub_func_uint16_t_u_u((((g_669 = ((*l_1042) ^= ((safe_sub_func_uint8_t_u_u((safe_mul_func_int64_t_s_s((0x58880C51L | (*g_36)), p_31)), (**g_1233))) < 4UL))) ^ l_1485) , p_31), 0x1DB2L))))) ^ p_31), l_1470[5][2][0])) , p_31)), l_1486[6][0])), 16)) | p_31) >= g_994); if (p_31) continue; (**l_1286) = ((l_1489 = l_1488) == (g_1490 , &l_1485)); } l_1434 = ((l_1491[0] != 2L) || l_1492); } (****g_744) |= 3L; for (g_1055.f4.f1 = 0; (g_1055.f4.f1 <= 3); g_1055.f4.f1 += 1) { /* block id: 689 */ int32_t *l_1493[9][2] = {{(void*)0,&g_273},{&g_273,(void*)0},{&g_273,&g_273},{(void*)0,&g_273},{&g_273,(void*)0},{&g_273,&g_273},{(void*)0,&g_273},{&g_273,(void*)0},{&g_273,&g_273}}; int16_t *l_1507 = &g_1138; struct S1 *l_1549 = &g_1550; uint32_t l_1552 = 0xE25C7F26L; int i, j; (*g_113) = l_1493[0][1]; (*g_113) = l_1493[0][0]; } for (g_1550.f0.f5 = 0; (g_1550.f0.f5 >= (-23)); g_1550.f0.f5 = safe_sub_func_uint32_t_u_u(g_1550.f0.f5, 3)) { /* block id: 716 */ int8_t ***l_1562 = &l_1561; uint32_t *l_1570 = (void*)0; int64_t *l_1589[7][5][5] = {{{&g_794[3][0].f4,&g_182[0],&g_794[3][0].f4,&g_1550.f4,&g_182[0]},{&g_182[1],&g_182[0],(void*)0,&g_1212,(void*)0},{&g_1212,&g_1212,&g_1550.f4,&g_182[0],&g_1229},{&g_182[1],&g_794[3][0].f4,&g_72.f4,&g_1550.f4,&g_182[1]},{&g_1212,&g_182[1],&g_1212,&g_425.f4,&g_425.f4}},{{(void*)0,&g_794[3][0].f4,&g_72.f4,&g_182[0],&g_182[1]},{(void*)0,&g_1212,&g_1229,&g_1229,&g_425.f4},{&g_182[0],&g_182[0],&g_1212,&g_182[0],&g_425.f4},{&g_794[3][0].f4,&g_182[0],&g_72.f4,&g_1212,&g_1212},{&g_1212,(void*)0,&g_794[3][0].f4,&g_425.f4,(void*)0}},{{&g_1229,&g_1229,&g_72.f4,&g_1229,(void*)0},{&g_1229,&g_1212,&g_72.f4,(void*)0,&g_182[1]},{&g_1212,&g_794[3][0].f4,&g_1229,&g_1550.f4,&g_182[0]},{&g_794[3][0].f4,&g_182[1],(void*)0,&g_425.f4,&g_1550.f4},{&g_182[0],&g_1212,&g_1550.f4,&g_1212,&g_182[0]}},{{(void*)0,&g_1229,&g_182[1],&g_425.f4,&g_1212},{(void*)0,&g_182[1],&g_1212,&g_182[0],&g_1212},{&g_1212,&g_182[1],&g_1212,(void*)0,&g_1212},{&g_425.f4,(void*)0,&g_425.f4,&g_182[0],(void*)0},{&g_1212,&g_182[1],&g_182[0],&g_1212,(void*)0}},{{&g_794[3][0].f4,&g_1212,&g_1212,&g_1212,(void*)0},{&g_72.f4,&g_72.f4,(void*)0,&g_182[1],&g_1229},{&g_425.f4,&g_425.f4,&g_182[1],&g_1229,&g_1212},{&g_1229,&g_1212,&g_1212,&g_1229,&g_182[0]},{&g_425.f4,&g_794[3][0].f4,&g_182[1],&g_182[1],&g_1212}},{{&g_1229,&g_72.f4,&g_1550.f4,&g_1212,&g_1550.f4},{&g_1212,&g_182[1],&g_425.f4,&g_1212,&g_1212},{(void*)0,&g_1229,(void*)0,&g_182[0],&g_182[1]},{&g_1212,&g_425.f4,(void*)0,(void*)0,&g_1550.f4},{&g_794[3][0].f4,(void*)0,(void*)0,(void*)0,&g_1212}},{{&g_182[1],&g_1212,(void*)0,&g_1550.f4,&g_1550.f4},{&g_72.f4,&g_182[1],(void*)0,&g_72.f4,&g_1212},{&g_1229,&g_1229,&g_425.f4,&g_1550.f4,(void*)0},{&g_182[1],&g_794[3][0].f4,&g_1550.f4,(void*)0,&g_1212},{&g_182[1],&g_182[1],&g_182[1],&g_1212,(void*)0}}}; int32_t l_1591 = 0L; int32_t l_1599 = 0L; uint8_t l_1601 = 0xCDL; int32_t l_1606[1]; int i, j, k; for (i = 0; i < 1; i++) l_1606[i] = 0xB0F9737EL; (*g_445) = &l_1487; for (g_1055.f4.f2 = 0; (g_1055.f4.f2 != 40); g_1055.f4.f2 = safe_add_func_uint16_t_u_u(g_1055.f4.f2, 5)) { /* block id: 723 */ int64_t *l_1590 = (void*)0; int16_t *l_1600 = &g_1138; uint64_t *l_1602 = &g_263; int32_t l_1603 = (-9L); if (p_31) break; l_1606[0] &= (l_1423 >= (safe_add_func_uint8_t_u_u((safe_mod_func_int64_t_s_s((l_1169[1][0][0] |= (((*g_1381) < (l_1604[5][4][3] ^= (l_1603 |= ((((safe_lshift_func_uint16_t_u_u((((safe_mul_func_uint64_t_u_u(((*l_1602) = (((****g_744) = (g_794[1][3] , (((safe_mul_func_int64_t_s_s((safe_rshift_func_uint64_t_u_s(l_1422, 28)), (((*l_1600) = (l_1599 &= (safe_sub_func_uint32_t_u_u((((safe_mod_func_uint8_t_u_u((g_198 , ((l_1591 = (l_1589[6][3][0] != l_1590)) && (safe_add_func_int8_t_s_s(((((safe_sub_func_uint64_t_u_u((safe_div_func_int8_t_s_s((*g_783), 255UL)), 6L)) >= 0xD455L) , g_1598) | 0xB4L), 0xFAL)))), p_31)) >= p_31) > p_31), 0L)))) || p_31))) , l_1601) , p_31))) , (**l_1286))), p_31)) ^ 8UL) >= 0xFE6930FCL), g_1550.f0.f2)) == (**g_1233)) && 0xBB24BAF2L) || l_1477[2])))) & (*g_1381))), (-1L))), l_1605))); } (****g_744) ^= p_31; return g_1607; } } } (*l_1620) &= (l_1608 == ((0x0C67C877DAE2025BLL & (((l_1434 = (**l_1286)) || ((****g_744) >= l_1423)) < ((safe_lshift_func_int16_t_s_u(p_31, l_1605)) , (((safe_rshift_func_uint8_t_u_s((((((safe_mod_func_int8_t_s_s(((g_1506[1][1][6] , &g_744) != &g_744), 0x89L)) <= (**l_1286)) , 3L) & p_31) , (**l_1286)), 7)) , p_31) != 7UL)))) , &l_1609)); } for (l_1041 = 0; (l_1041 == (-23)); l_1041 = safe_sub_func_int32_t_s_s(l_1041, 5)) { /* block id: 745 */ uint16_t l_1633 = 0xAA8BL; int32_t l_1650 = 0xA81F529DL; int32_t l_1653[9]; int64_t l_1669[5]; int i; for (i = 0; i < 9; i++) l_1653[i] = 0x74E618C1L; for (i = 0; i < 5; i++) l_1669[i] = (-4L); for (g_380.f2 = 0; (g_380.f2 <= 0); g_380.f2 += 1) { /* block id: 748 */ uint32_t l_1634 = 7UL; int32_t l_1649 = (-6L); int32_t l_1651[3][4] = {{0x25DB5B1BL,0x25DB5B1BL,0x0673BA11L,0x25DB5B1BL},{0x25DB5B1BL,7L,7L,0x25DB5B1BL},{7L,0x25DB5B1BL,7L,7L}}; int i, j; (**l_1286) |= 0x5747740BL; for (g_1055.f4.f5 = 0; (g_1055.f4.f5 <= 0); g_1055.f4.f5 += 1) { /* block id: 752 */ uint32_t **l_1636 = &l_1042; uint32_t ***l_1635[3]; uint64_t l_1643 = 18446744073709551615UL; uint16_t *l_1645[1][4] = {{&g_72.f0.f1,&g_72.f0.f1,&g_72.f0.f1,&g_72.f0.f1}}; int32_t l_1648 = 0x6EC63E79L; int32_t l_1654[3][1]; int i, j; for (i = 0; i < 3; i++) l_1635[i] = &l_1636; for (i = 0; i < 3; i++) { for (j = 0; j < 1; j++) l_1654[i][j] = (-2L); } (**g_445) = ((--(*g_1234)) & (*g_783)); if (p_31) break; if (((safe_sub_func_int8_t_s_s((safe_lshift_func_uint16_t_u_s(((((*g_846) = p_31) < (safe_add_func_uint16_t_u_u(((safe_mod_func_int8_t_s_s((l_1633 , l_1634), p_31)) , (l_1635[1] == (void*)0)), (safe_rshift_func_int32_t_s_u((safe_mod_func_int8_t_s_s((safe_mod_func_uint8_t_u_u((0xD4A85B4A9EA708B8LL ^ l_1643), ((safe_unary_minus_func_uint16_t_u((g_1455[1].f1 = p_31))) || (-9L)))), p_31)), 20))))) <= 0xE2C6A7F3F655F34ELL), p_31)), p_31)) != 18446744073709551609UL)) { /* block id: 758 */ int32_t *l_1646 = &g_193; int32_t *l_1647[5][7] = {{&g_42,(void*)0,&l_1169[1][0][0],&l_1169[1][0][0],(void*)0,&g_42,(void*)0},{&g_273,&l_1169[1][0][0],&g_315,(void*)0,&l_1168,&l_1168,(void*)0},{(void*)0,(void*)0,(void*)0,&l_1168,(void*)0,&g_273,&g_42},{&g_315,&l_1169[1][0][0],&g_273,&l_1168,&g_273,&l_1169[1][0][0],&g_315},{&l_1169[1][0][0],(void*)0,&g_42,(void*)0,(void*)0,&g_273,(void*)0}}; int32_t l_1652[10] = {0x4BE2B784L,0x6E26C082L,0x4BE2B784L,0x6E26C082L,0x4BE2B784L,0x6E26C082L,0x4BE2B784L,0x6E26C082L,0x4BE2B784L,0x6E26C082L}; int i, j; --g_1655; (**l_1286) |= 0xF53438EFL; } else { /* block id: 761 */ (****g_744) = (((((safe_add_func_uint8_t_u_u((+((0x95E0L && ((((safe_add_func_int8_t_s_s(7L, (*g_1381))) && (safe_mod_func_uint16_t_u_u(((safe_mod_func_uint8_t_u_u(((g_1667 , g_1668[4][0]) , l_1633), l_1648)) | l_1649), l_1653[3]))) , (*g_783)) >= l_1653[5])) ^ 0x701BF78D84D792DALL)), (*g_1234))) > p_31) && p_31) , 0x9D3FL) == p_31); } if (l_1669[1]) continue; } } } for (g_265.f4.f1 = 0; (g_265.f4.f1 > 13); g_265.f4.f1++) { /* block id: 770 */ int16_t l_1674 = 0xEBC7L; uint64_t *l_1689 = &g_263; int32_t l_1690 = 0L; int32_t *l_1691 = &g_193; int32_t *l_1692 = &l_1169[2][0][0]; const int64_t * const * const **l_1704 = (void*)0; const int64_t * const * const ***l_1703 = &l_1704; int32_t l_1722 = 0xF60A2766L; } return g_1753; } /* ------------------------------------------ */ /* * reads : g_72.f0.f1 g_72 g_36 g_37 g_96 g_794.f4 g_533 g_397 g_744 g_444 g_445 g_446 g_273 g_315 g_669 * writes: g_72.f0.f1 g_96 g_794.f4 g_273 g_315 */ static uint32_t * func_44(uint32_t * p_45, uint32_t p_46, const uint32_t * p_47, uint32_t * p_48, uint64_t p_49) { /* block id: 479 */ int64_t l_1047[4] = {0x9B631F46FCA66B23LL,0x9B631F46FCA66B23LL,0x9B631F46FCA66B23LL,0x9B631F46FCA66B23LL}; int32_t l_1048[8][3][4] = {{{(-7L),1L,0x0E120BACL,0x0E120BACL},{(-7L),(-7L),0x6D171B75L,(-9L)},{(-10L),0x0E120BACL,(-7L),0xCC2C739FL}},{{1L,0x13F1BBE5L,0xF7E7A015L,(-7L)},{(-6L),0x13F1BBE5L,(-6L),0xCC2C739FL},{0x13F1BBE5L,0x0E120BACL,(-1L),(-9L)}},{{(-9L),(-7L),1L,0x0E120BACL},{0x2D14B7A0L,1L,1L,0x2D14B7A0L},{(-9L),0xCC2C739FL,(-1L),(-6L)}},{{(-9L),(-1L),0x0E120BACL,0x13F1BBE5L},{0x0E120BACL,0x13F1BBE5L,(-10L),0x13F1BBE5L},{0x2D14B7A0L,(-1L),0x6D171B75L,0x0E120BACL}},{{(-6L),0x16347743L,0x13F1BBE5L,(-7L)},{0x6D171B75L,0x2D14B7A0L,1L,1L},{0x6D171B75L,0x6D171B75L,0x13F1BBE5L,0xCC2C739FL}},{{(-6L),1L,0x6D171B75L,0x16347743L},{0x2D14B7A0L,(-9L),(-10L),0x6D171B75L},{0x0E120BACL,(-9L),0x0E120BACL,0x16347743L}},{{(-9L),1L,0xF7E7A015L,0xCC2C739FL},{0xCC2C739FL,0x6D171B75L,0x2D14B7A0L,1L},{(-7L),0x2D14B7A0L,0x2D14B7A0L,(-7L)}},{{0xCC2C739FL,0x16347743L,0xF7E7A015L,0x0E120BACL},{(-9L),(-1L),0x0E120BACL,0x13F1BBE5L},{0x0E120BACL,0x13F1BBE5L,(-10L),0x13F1BBE5L}}}; uint32_t *l_1072[9] = {&g_37,&g_37,&g_37,&g_37,&g_37,&g_37,&g_37,&g_37,&g_37}; struct S1 *l_1079 = &g_72; struct S1 **l_1078 = &l_1079; uint32_t l_1104 = 0UL; int64_t *l_1105 = &g_794[3][0].f4; int i, j, k; for (g_72.f0.f1 = (-16); (g_72.f0.f1 > 59); g_72.f0.f1 = safe_add_func_uint16_t_u_u(g_72.f0.f1, 3)) { /* block id: 482 */ uint64_t l_1049 = 0x8D9E1FA8E2CA9F13LL; uint32_t *l_1056 = &g_37; struct S0 * const *l_1065 = (void*)0; int32_t l_1071 = 0xBF7EDEAFL; int32_t *l_1073 = (void*)0; } (****g_744) ^= (((safe_div_func_int64_t_s_s((((((void*)0 == &g_744) >= (l_1047[1] < (safe_lshift_func_int64_t_s_u(((*l_1105) ^= (g_72 , (((safe_mod_func_int8_t_s_s((safe_mod_func_uint8_t_u_u((((safe_lshift_func_uint16_t_u_u(p_49, ((((safe_lshift_func_uint32_t_u_u((((safe_mul_func_int8_t_s_s((l_1047[2] , (safe_rshift_func_int16_t_s_u((safe_mul_func_int8_t_s_s((safe_lshift_func_int32_t_s_u(0x01D3B1ACL, (((*p_48) = (p_46 < (safe_rshift_func_uint8_t_u_u(p_49, 1)))) | p_46))), l_1047[3])), l_1104))), p_49)) || 18446744073709551610UL) | p_49), 16)) && (*g_36)) && p_46) <= p_49))) <= 0xFDA12E94419D923BLL) == l_1048[2][0][2]), l_1047[1])), 0x5CL)) || p_46) , p_46))), p_46)))) , (*g_533)) == (void*)0), 0xABF16E01606EAE75LL)) , l_1047[3]) & (*p_45)); return &g_669; } /* ------------------------------------------ */ /* * reads : g_94 g_37 g_263 g_445 g_446 g_876 g_448 g_409 g_877 g_783 g_43.f5 g_207.f0 g_273 g_315 g_506.f4.f1 g_265.f4.f2 g_963 g_969 g_425.f4 g_796 g_797 g_744 g_444 g_72.f0.f4 g_425.f0.f2 g_1029 g_794.f4 g_72.f1 * writes: g_94 g_521 g_263 g_273 g_315 g_193 g_506.f4.f1 g_265.f4.f2 g_36 g_425.f4 g_797 g_425.f0.f2 g_794.f4 g_446 */ static uint8_t func_58(int16_t p_59, int16_t p_60, int64_t p_61, uint32_t * p_62) { /* block id: 399 */ uint32_t l_886[2]; int32_t l_903 = 0L; uint8_t *l_904 = &g_94[2]; uint8_t *l_907 = &g_521; int32_t l_923[4] = {(-9L),(-9L),(-9L),(-9L)}; uint64_t *l_924 = &g_263; int8_t l_927 = 0xA9L; int8_t l_928 = 0L; int32_t l_929[4][6][10] = {{{(-9L),0xF685BBF0L,7L,0L,(-9L),7L,0L,2L,(-1L),0x77918752L},{(-9L),1L,0xA73912B8L,0x77918752L,8L,0xFD95DDC8L,0x77918752L,0x391ED156L,8L,(-9L)},{0xFD95DDC8L,0x77918752L,0x391ED156L,8L,(-9L),0xA73912B8L,0xA73912B8L,(-9L),8L,0x391ED156L},{2L,2L,7L,0x77918752L,0L,(-1L),0xF685BBF0L,0x77918752L,(-1L),2L},{0L,0xA73912B8L,0x391ED156L,0L,8L,1L,0xF685BBF0L,0xFD95DDC8L,1L,0xF685BBF0L},{0xFD95DDC8L,2L,0xA73912B8L,1L,2L,8L,0xA73912B8L,0L,0xFD95DDC8L,0xFD95DDC8L}},{{0L,0x77918752L,7L,2L,2L,7L,0x77918752L,0L,(-1L),0xF685BBF0L},{2L,1L,1L,0L,8L,1L,0L,0x391ED156L,0xFD95DDC8L,2L},{0xFD95DDC8L,0xF685BBF0L,1L,8L,0L,0x391ED156L,0xA73912B8L,0L,1L,0x391ED156L},{(-9L),0L,7L,0xF685BBF0L,(-9L),(-1L),0L,0L,(-1L),(-9L)},{(-9L),0xA73912B8L,0xA73912B8L,(-9L),8L,0x391ED156L,0x77918752L,0xFD95DDC8L,8L,0x77918752L},{0xFD95DDC8L,(-9L),0x391ED156L,1L,(-9L),1L,0xA73912B8L,0x77918752L,(-6L),0xC16DB48BL}},{{0xFD95DDC8L,0x391ED156L,0L,1L,8L,0L,1L,1L,2L,0x391ED156L},{8L,(-1L),0x97EB1FDDL,1L,(-6L),(-6L),1L,0x97EB1FDDL,(-1L),8L},{0xC16DB48BL,0x391ED156L,7L,(-6L),0xFD95DDC8L,0x10770F47L,7L,0xFD95DDC8L,0xC16DB48BL,0x97EB1FDDL},{8L,1L,0L,0x391ED156L,0xFD95DDC8L,2L,0xA73912B8L,1L,2L,8L},{0xFD95DDC8L,7L,0x10770F47L,0xFD95DDC8L,(-6L),7L,0x391ED156L,0xC16DB48BL,0xC16DB48BL,0x391ED156L},{0xC16DB48BL,8L,0x10770F47L,0x10770F47L,8L,0xC16DB48BL,7L,1L,(-1L),0xC16DB48BL}},{{1L,1L,0L,8L,1L,0L,0x391ED156L,0xFD95DDC8L,2L,0xA73912B8L},{1L,(-1L),7L,0xA73912B8L,(-6L),0xC16DB48BL,0xA73912B8L,0x97EB1FDDL,(-6L),1L},{0xC16DB48BL,0xA73912B8L,0x97EB1FDDL,(-6L),1L,7L,7L,1L,(-6L),0x97EB1FDDL},{0xFD95DDC8L,0xFD95DDC8L,0L,0xA73912B8L,8L,2L,1L,0xA73912B8L,2L,0xFD95DDC8L},{8L,7L,0x97EB1FDDL,8L,(-6L),0x10770F47L,1L,0xC16DB48BL,(-1L),1L},{0xC16DB48BL,0xFD95DDC8L,7L,0x10770F47L,0xFD95DDC8L,(-6L),7L,0x391ED156L,0xC16DB48BL,0xC16DB48BL}}}; int32_t l_930 = (-10L); int32_t l_931 = 0xAC0F0A08L; struct S1 * const l_949 = &g_72; struct S1 * const *l_948 = &l_949; uint16_t l_1018 = 65535UL; int32_t *****l_1038 = (void*)0; int32_t l_1040[1]; int i, j, k; for (i = 0; i < 2; i++) l_886[i] = 5UL; for (i = 0; i < 1; i++) l_1040[i] = 0xFC9EF285L; lbl_958: l_931 = ((safe_sub_func_uint8_t_u_u((((safe_mod_func_int16_t_s_s((safe_add_func_uint8_t_u_u(((l_886[0] & ((l_930 &= (l_929[0][1][0] = (safe_mod_func_uint64_t_u_u((safe_add_func_uint8_t_u_u(((((l_923[0] = ((*g_876) = (safe_mul_func_uint64_t_u_u(l_886[0], ((safe_rshift_func_int32_t_s_u((safe_sub_func_uint16_t_u_u(((l_903 = ((**g_445) = (safe_unary_minus_func_int8_t_s((!((safe_sub_func_int16_t_s_s((l_886[1] | ((safe_add_func_uint8_t_u_u(((*l_907) = (((*l_904)++) , p_59)), (((safe_mul_func_uint8_t_u_u(((safe_rshift_func_int8_t_s_u(0x55L, 0)) & (safe_add_func_uint32_t_u_u((*p_62), (safe_sub_func_uint64_t_u_u(((!(((safe_div_func_int64_t_s_s((((l_903 >= (safe_div_func_int32_t_s_s((safe_div_func_int64_t_s_s(l_886[1], (++(*l_924)))), l_927))) , (-1L)) && l_927), p_60)) , 65527UL) | 0UL)) | p_61), p_61))))), l_923[0])) <= l_886[0]) == 0xC4CCL))) > p_61)), p_59)) , l_923[0])))))) ^ (*p_62)), p_60)), 2)) ^ l_928))))) , 0x8C38AC1DL) == (*p_62)) > 0x3DL), l_886[1])), p_60)))) , p_61)) <= p_61), 0x2EL)), 0x4B6AL)) , (void*)0) == g_448[4]), p_61)) || g_409[1][1]); (**g_445) = ((4L < ((safe_mod_func_uint8_t_u_u(((((l_929[0][1][6] != (safe_rshift_func_uint16_t_u_s((safe_mod_func_int32_t_s_s((p_60 , (&l_886[1] == (void*)0)), ((l_923[2] >= ((safe_sub_func_uint16_t_u_u(((safe_add_func_uint8_t_u_u(((((safe_mod_func_uint32_t_u_u((safe_add_func_uint32_t_u_u((safe_sub_func_int64_t_s_s(((((((g_877 , l_948) != ((safe_mul_func_int8_t_s_s(l_923[0], 0x89L)) , &l_949)) > 0x6A8E3CA47381B268LL) , (*g_783)) < l_929[3][0][4]) ^ 0xADC9L), (-10L))), l_929[0][5][9])), p_61)) ^ l_903) , l_886[0]) & 0x4F08E4B698BA581CLL), 7L)) > l_928), p_61)) , g_207.f0)) & l_929[1][5][6]))), 6))) , 0L) >= p_61) , 0x46L), p_60)) || 0UL)) <= p_61); (**g_445) &= p_60; for (p_60 = 0; (p_60 == 18); p_60 = safe_add_func_int64_t_s_s(p_60, 3)) { /* block id: 414 */ uint64_t l_982 = 0x6C9D62A4103BF776LL; int32_t l_991 = 0xD483DAC8L; int32_t l_992 = 0xD8657E12L; int32_t l_995 = 0xE15F0C30L; for (g_506.f4.f1 = 20; (g_506.f4.f1 != 18); g_506.f4.f1 = safe_sub_func_int32_t_s_s(g_506.f4.f1, 2)) { /* block id: 417 */ int32_t l_974 = 0L; int32_t l_993 = (-7L); int32_t l_996 = 0x3D111D31L; uint32_t l_1023 = 0UL; if ((&g_792[2][5] == &l_907)) { /* block id: 418 */ union U2 **l_968[6]; union U2 ***l_967 = &l_968[0]; int32_t l_976 = 0xC673C71FL; int i; for (i = 0; i < 6; i++) l_968[i] = (void*)0; for (g_265.f4.f2 = (-21); (g_265.f4.f2 != 28); g_265.f4.f2 = safe_add_func_int8_t_s_s(g_265.f4.f2, 7)) { /* block id: 421 */ int32_t l_980 = 0xC8040E93L; if (g_263) goto lbl_958; if (((++(*l_924)) < (safe_lshift_func_int64_t_s_s(((void*)0 == &g_448[4]), 52)))) { /* block id: 424 */ return g_963; } else { /* block id: 426 */ uint32_t **l_966 = &g_36; int64_t *l_975 = &g_425.f4; (**g_445) |= (safe_sub_func_int64_t_s_s(((((p_62 == ((*l_966) = &g_37)) > ((-4L) | ((l_967 == ((*p_62) , &g_708[1][6][5])) == (g_969 , (l_976 = ((*l_975) |= ((((safe_div_func_int32_t_s_s((safe_rshift_func_int8_t_s_u(l_928, 7)), ((p_61 = p_61) ^ l_974))) && 0x95L) | 0x0BL) | (-7L)))))))) , p_59) , p_60), 0UL)); if (p_61) break; l_923[0] |= 0x52664EFCL; } if (l_976) { /* block id: 435 */ l_974 ^= (0xC4927A11567ADD80LL < 0x1FE89529B0A5244FLL); if (l_974) continue; return l_974; } else { /* block id: 439 */ const int32_t **l_978 = &g_797; int32_t l_979 = 0x91FAC675L; int32_t *l_981[4] = {(void*)0,(void*)0,(void*)0,(void*)0}; int i; (*l_978) = (*g_796); l_982++; } } } else { /* block id: 444 */ int32_t *l_985 = &g_315; int32_t *l_986 = &l_929[0][1][0]; int32_t *l_987 = &l_923[1]; int32_t *l_988 = &g_193; int32_t *l_989 = &l_923[1]; int32_t *l_990[10][8] = {{&g_315,(void*)0,(void*)0,&g_315,(void*)0,&l_974,&l_930,&l_931},{&g_315,&l_931,&l_923[0],(void*)0,&l_974,(void*)0,&l_923[0],&l_931},{(void*)0,&l_931,&l_931,&l_923[0],&l_923[0],&l_974,&l_929[3][2][9],&l_929[3][2][9]},{&l_931,(void*)0,&g_42,&g_42,(void*)0,&l_931,&l_929[3][2][9],&l_974},{&l_930,&g_42,&l_931,&l_974,&l_923[0],&g_315,&l_923[0],&l_974},{&l_923[0],&g_315,&l_923[0],&l_974,&l_931,&g_42,&l_930,&l_974},{&l_929[3][2][9],&l_931,(void*)0,&g_42,&g_42,(void*)0,&l_931,&l_929[3][2][9]},{&l_929[3][2][9],&l_974,&l_923[0],&l_923[0],&l_931,&l_931,(void*)0,&l_931},{&g_42,&g_315,&l_930,&g_315,&g_42,&l_923[0],&l_929[3][2][9],(void*)0},{&l_923[0],&l_931,&g_315,&l_931,&g_315,&g_315,&l_931,&g_315}}; uint32_t l_997 = 0x64EE28CAL; uint8_t l_1000[7][4][9] = {{{0xDDL,0UL,249UL,0x84L,248UL,0xCAL,0UL,0xECL,255UL},{0xBFL,249UL,0xADL,252UL,0xF7L,248UL,0UL,0xADL,0xCEL},{0xCDL,0x08L,0UL,0x0EL,247UL,0UL,0xDBL,0x61L,0x0EL},{8UL,254UL,0x21L,0x72L,0xA8L,1UL,1UL,1UL,1UL}},{{0xF8L,0xDDL,0x84L,0xDDL,0xF8L,9UL,247UL,0x9FL,0UL},{0xADL,255UL,0x8AL,0x2EL,255UL,0x5DL,4UL,252UL,0x37L},{6UL,0UL,0xDDL,255UL,255UL,9UL,251UL,0x9AL,249UL},{0xF8L,5UL,0x51L,0x9CL,0xAAL,1UL,0xA8L,0x17L,1UL}},{{0x61L,247UL,0UL,0xCDL,0UL,0UL,0xCAL,0UL,0x60L},{249UL,0xAAL,0xA7L,0x5DL,0UL,248UL,1UL,255UL,1UL},{0xCAL,1UL,1UL,1UL,1UL,0xCAL,0xB2L,0UL,0xA8L},{0UL,248UL,1UL,248UL,0x21L,0xA5L,248UL,0xADL,0x67L}},{{0UL,0xCFL,255UL,255UL,0x9AL,0x60L,0xB2L,255UL,0UL},{8UL,0xADL,0UL,0x4EL,0xA8L,0x72L,1UL,0xAAL,0x4EL},{0x66L,8UL,0x84L,0UL,252UL,0xF8L,0xCAL,249UL,0x9FL},{0UL,4UL,248UL,0x13L,255UL,247UL,0xA8L,0x2EL,0x2EL}},{{251UL,1UL,0x9FL,0x9FL,0x9FL,1UL,251UL,255UL,0UL},{0x51L,255UL,0x00L,247UL,0x9CL,0x4EL,4UL,250UL,1UL},{255UL,0x0EL,0xCAL,0xFCL,255UL,0UL,247UL,255UL,253UL},{1UL,0xAAL,0xCEL,0x21L,0UL,0xADL,8UL,4UL,1UL}},{{0x61L,0x76L,0xDBL,255UL,9UL,0UL,251UL,248UL,0x08L},{0x21L,0x5DL,0xFEL,0xA8L,0xF8L,0x21L,0xF7L,0x72L,247UL},{0UL,0xF8L,0x84L,0UL,0UL,0x84L,0xF8L,0UL,255UL},{255UL,0xFEL,0x12L,0x37L,0xBFL,0x8AL,250UL,0x12L,0xA7L}},{{0x0EL,0UL,0x89L,255UL,0UL,0xDDL,255UL,0xDBL,255UL},{0x4EL,0UL,5UL,4UL,248UL,0x51L,0UL,0UL,247UL},{0xCAL,8UL,0UL,0x9FL,253UL,0UL,0UL,255UL,0x08L},{0x9BL,1UL,255UL,0x00L,0x51L,0xA7L,0xB7L,0x37L,1UL}}}; int64_t *l_1015 = &g_425.f4; int64_t *l_1039 = &g_794[3][0].f4; int i, j, k; l_997--; l_1000[4][1][5]++; if (((safe_mul_func_int64_t_s_s((l_930 |= ((p_59 || (safe_add_func_uint64_t_u_u((safe_div_func_int8_t_s_s(((l_992 != 0x23BEL) != (safe_add_func_uint16_t_u_u((safe_sub_func_uint64_t_u_u((((-9L) || (((****g_744) = p_60) >= (safe_div_func_int32_t_s_s(((*l_986) = p_61), 0x04A05F94L)))) > l_996), ((*l_1015) = (l_927 < 4L)))), p_61))), p_59)), p_61))) == g_72.f0.f4)), 0x3C48BC6F2AFAEA1DLL)) , p_59)) { /* block id: 451 */ int32_t l_1016 = 0x634A56A8L; int32_t l_1017 = 0x1DF261CFL; --l_1018; for (g_425.f0.f2 = 0; (g_425.f0.f2 > 26); g_425.f0.f2 = safe_add_func_uint32_t_u_u(g_425.f0.f2, 1)) { /* block id: 455 */ l_1017 = (-1L); } if (p_60) continue; if (p_60) continue; } else { /* block id: 460 */ l_1023 = 0x1F65AEB6L; return p_60; } (**g_445) ^= ((safe_mod_func_uint8_t_u_u((8UL == (((safe_lshift_func_int32_t_s_u((((safe_unary_minus_func_int32_t_s(g_1029[3])) < ((-6L) & l_995)) && l_1018), 11)) ^ ((safe_mul_func_int32_t_s_s((safe_mod_func_uint16_t_u_u((safe_div_func_uint8_t_u_u((((p_59 = 0xF972L) & ((&g_744 != l_1038) || (p_61 &= ((*l_1039) |= ((*l_1015) ^= 0xDC80F6D4B8F11B1ELL))))) < 0UL), p_60)), g_72.f1)), 5UL)) && 0UL)) <= p_60)), l_1040[0])) , p_60); } if (p_59) break; if (g_273) goto lbl_958; } (*g_445) = (***g_744); l_991 = p_60; } return l_928; } /* ------------------------------------------ */ /* * reads : g_72.f0.f2 g_36 g_37 g_72.f2 g_42 g_94 g_72.f7 g_72.f0.f0 g_72.f4 g_43.f5 g_72.f0 g_43.f1 g_72.f1 g_130 g_131 g_96 g_146 g_43.f3 g_236 g_237 g_846 g_444 g_445 g_446 g_273 g_315 g_876 g_193 g_744 * writes: g_72.f0.f5 g_96 g_43.f1 g_113 g_130 g_131 g_72.f0.f1 g_72.f4 g_36 g_712.f4.f5 g_263 g_193 g_273 g_315 */ static uint32_t func_68(uint32_t * p_69, int64_t p_70) { /* block id: 16 */ int32_t *l_84 = (void*)0; int32_t **l_85 = &l_84; int32_t **l_128 = &l_84; uint16_t *l_140[6] = {&g_43[4].f1,&g_43[4].f1,&g_43[4].f1,&g_43[4].f1,&g_43[4].f1,&g_43[4].f1}; int32_t l_151 = 0x99B8081AL; int32_t l_192 = 0x2FC3D5CCL; int32_t l_311 = 1L; int32_t l_312 = 0xB825B64AL; int32_t l_313[7]; struct S0 *l_326 = &g_212[0][1][1]; const int32_t *l_329 = &l_192; uint32_t l_361 = 18446744073709551612UL; struct S1 *l_422 = (void*)0; uint8_t *l_507 = &g_94[2]; int32_t l_519 = (-1L); uint64_t l_523[2]; int32_t l_580 = 0L; int8_t l_604 = 0L; int64_t *****l_615[9][7][1] = {{{&g_566},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{&g_566},{&g_566}},{{&g_566},{&g_566},{&g_566},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{&g_566},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{&g_566},{&g_566}},{{&g_566},{&g_566},{&g_566},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{&g_566},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{&g_566},{&g_566}},{{&g_566},{&g_566},{&g_566},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{&g_566},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{&g_566},{&g_566}},{{&g_566},{&g_566},{&g_566},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{&g_566},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{&g_566},{&g_566}}}; uint32_t l_683 = 0UL; int32_t l_701 = 0x9F64ACD3L; int32_t ****l_751 = &g_444[5]; uint32_t l_782 = 1UL; int32_t l_811[1][8][10] = {{{0xA470348FL,1L,0xF15FBAD7L,(-1L),0xF1D18A53L,0xB8547DB1L,1L,1L,0xB8547DB1L,0xF1D18A53L},{0xA60627C3L,3L,3L,0xA60627C3L,(-2L),0xCD821016L,0x32777201L,0xF1D18A53L,(-10L),(-2L)},{0L,9L,(-2L),0xED0FFF10L,1L,0xB78B7DEFL,3L,0x32777201L,(-10L),0xA470348FL},{3L,0x7B04A556L,0L,0xA60627C3L,0xB8547DB1L,0L,1L,0L,0xB8547DB1L,0xA60627C3L},{0x384233E2L,9L,0x384233E2L,(-1L),0x384233E2L,0xB78B7DEFL,0x32777201L,0xA60627C3L,0xF15FBAD7L,0xF1D18A53L},{(-10L),1L,0x384233E2L,9L,9L,0x32777201L,0xED0FFF10L,0xA60627C3L,1L,0xE9FCAD25L},{0xF266C632L,0x384233E2L,1L,0x0A20F5ADL,0xF15FBAD7L,(-10L),(-10L),0xF15FBAD7L,0x0A20F5ADL,1L},{0L,0L,0xF1D18A53L,(-1L),0xB78B7DEFL,0x0A20F5ADL,3L,0xCD821016L,0xB8547DB1L,(-10L)}}}; uint64_t *l_873 = &l_523[0]; uint64_t *l_874 = (void*)0; uint64_t *l_875 = &g_263; int i, j, k; for (i = 0; i < 7; i++) l_313[i] = 0xADE88CFFL; for (i = 0; i < 2; i++) l_523[i] = 18446744073709551615UL; (*l_85) = l_84; lbl_859: if ((g_72.f0.f2 || (*g_36))) { /* block id: 18 */ uint64_t l_86[6][9] = {{1UL,18446744073709551615UL,1UL,0xB313CF365AED0E34LL,0x99F3DF38E6A276D0LL,0UL,0x52544EE796224A10LL,0x52544EE796224A10LL,0UL},{0UL,18446744073709551615UL,1UL,18446744073709551615UL,0UL,0xBEBE4505C2614AC9LL,0xF8EE8584DF831B5ELL,0xB313CF365AED0E34LL,0xB313CF365AED0E34LL},{18446744073709551615UL,6UL,0UL,0xB313CF365AED0E34LL,0UL,6UL,18446744073709551615UL,0x99F3DF38E6A276D0LL,0xC803B8C793451EA7LL},{0x52544EE796224A10LL,0xC803B8C793451EA7LL,18446744073709551615UL,0xBEBE4505C2614AC9LL,0x99F3DF38E6A276D0LL,0xBEBE4505C2614AC9LL,18446744073709551615UL,0xC803B8C793451EA7LL,0x52544EE796224A10LL},{6UL,0xBEBE4505C2614AC9LL,0x52544EE796224A10LL,0x99F3DF38E6A276D0LL,0xF8EE8584DF831B5ELL,0UL,0xF8EE8584DF831B5ELL,0x99F3DF38E6A276D0LL,0x52544EE796224A10LL},{0xF8EE8584DF831B5ELL,0xF8EE8584DF831B5ELL,6UL,1UL,0xC803B8C793451EA7LL,0xB313CF365AED0E34LL,0x52544EE796224A10LL,0xB313CF365AED0E34LL,0xC803B8C793451EA7LL}}; int32_t **l_129[7] = {&l_84,&l_84,&l_84,&l_84,&l_84,&l_84,&l_84}; uint32_t **l_145 = &g_36; int64_t *l_147 = (void*)0; int64_t *l_148 = &g_72.f4; uint32_t *l_149 = (void*)0; uint32_t *l_150[4][10] = {{&g_37,(void*)0,&g_96,(void*)0,&g_96,(void*)0,&g_96,(void*)0,&g_96,(void*)0},{&g_37,&g_96,&g_37,&g_96,&g_37,(void*)0,(void*)0,&g_37,&g_96,&g_96},{(void*)0,(void*)0,&g_37,&g_96,&g_96,&g_96,&g_37,&g_37,&g_96,&g_96},{&g_37,&g_96,&g_96,&g_37,&g_37,(void*)0,&g_96,(void*)0,&g_96,(void*)0}}; int i, j; for (g_72.f0.f5 = 0; (g_72.f0.f5 <= 5); g_72.f0.f5 += 1) { /* block id: 21 */ uint32_t *l_95 = &g_96; int32_t l_109 = 7L; uint16_t *l_110 = &g_43[4].f1; const int32_t *l_112 = &g_72.f1; const int32_t **l_111 = &l_112; l_109 = (p_70 && ((*l_110) = ((((safe_sub_func_uint8_t_u_u((safe_mul_func_int16_t_s_s((((((((+g_72.f2) | ((*l_95) = (safe_sub_func_int8_t_s_s(g_42, g_94[2])))) != ((safe_mul_func_int32_t_s_s((-2L), ((((safe_lshift_func_int64_t_s_s(p_70, 39)) && (safe_rshift_func_uint16_t_u_s((g_72.f7 > (safe_div_func_int64_t_s_s(((*p_69) != (safe_rshift_func_int32_t_s_u((((safe_sub_func_uint8_t_u_u(0x6FL, g_72.f0.f0)) != p_70) || (*g_36)), (*p_69)))), 0x84F164E9E2562E96LL))), p_70))) , l_109) , (*g_36)))) ^ 0x6F5C0CD63D7C5F07LL)) < 1UL) >= 1L) , 0x5B7FL) & g_72.f4), p_70)), g_43[4].f5)) >= g_72.f7) >= (*p_69)) , p_70))); g_113 = l_111; g_130 |= ((0UL || (safe_sub_func_int64_t_s_s((safe_sub_func_int32_t_s_s((((g_72.f0 , ((safe_sub_func_uint32_t_u_u((g_43[4].f1 == (((safe_mod_func_uint64_t_u_u(p_70, (safe_lshift_func_int64_t_s_s((safe_div_func_uint8_t_u_u((~(l_128 != l_129[1])), (p_70 ^ p_70))), 50)))) ^ (-5L)) < 0xAC23FC00924423CCLL)), 0xEBE71B68L)) < g_72.f0.f4)) , (void*)0) != &g_114), (*l_112))), p_70))) || p_70); g_131--; for (g_72.f0.f1 = 0; (g_72.f0.f1 <= 5); g_72.f0.f1 += 1) { /* block id: 30 */ int32_t l_141 = 0x0612D794L; int i, j; for (g_72.f4 = 0; (g_72.f4 <= 6); g_72.f4 += 1) { /* block id: 33 */ int i, j; l_109 ^= ((safe_mod_func_int32_t_s_s((-1L), (--(*l_95)))) , (safe_rshift_func_int8_t_s_u(((void*)0 != l_140[5]), l_86[g_72.f0.f1][g_72.f4]))); } if (g_37) goto lbl_859; l_141 |= l_86[g_72.f0.f5][g_72.f0.f1]; } } (*l_128) = (p_70 , p_69); l_151 ^= ((((safe_rshift_func_int64_t_s_u(((g_96 ^= ((0xAC3CA6ABCE84173BLL & 0x64CB8E9996A1BC1FLL) >= (+((((*l_145) = &g_96) == ((**l_128) , p_69)) == ((*l_148) = (g_72.f0 , ((g_72.f0.f0 == g_72.f0.f2) , (g_146 , (-1L))))))))) | p_70), 8)) , g_146) , p_70) > g_37); } else { /* block id: 45 */ uint32_t l_153 = 8UL; int32_t l_155 = 0xB42F0577L; int32_t *l_214 = &l_192; uint32_t *l_274 = &g_96; int16_t *l_286 = (void*)0; int32_t l_310 = 6L; int32_t l_314 = (-2L); int32_t l_316 = 0x77A0422CL; int32_t l_318 = 0x380F5ECDL; int32_t l_319 = 5L; const int32_t *l_335 = &l_192; int32_t *** const l_390 = &l_128; struct S1 *l_424 = &g_425; uint8_t l_606 = 0x29L; uint8_t l_641[8] = {0xA1L,1UL,1UL,0xA1L,1UL,1UL,0xA1L,1UL}; int16_t l_700 = 0x8315L; int32_t l_734 = 0L; int32_t l_735 = 5L; int32_t l_736 = 1L; int32_t l_738 = 0L; uint64_t *l_795 = &g_263; int8_t l_826 = (-8L); int8_t *l_830 = &g_794[3][0].f0.f5; int8_t **l_829[4][10] = {{&l_830,&l_830,(void*)0,(void*)0,&l_830,&l_830,(void*)0,(void*)0,&l_830,&l_830},{&l_830,(void*)0,(void*)0,&l_830,&l_830,(void*)0,(void*)0,&l_830,&l_830,(void*)0},{&l_830,&l_830,(void*)0,(void*)0,&l_830,&l_830,(void*)0,(void*)0,&l_830,&l_830},{&l_830,(void*)0,(void*)0,&l_830,&l_830,(void*)0,(void*)0,&l_830,&l_830,(void*)0}}; int i, j; l_155 = (l_153 = (~g_43[4].f3)); } (*g_876) &= ((p_70 = (((safe_lshift_func_uint64_t_u_u((safe_add_func_uint8_t_u_u((0xA7E0L > (safe_lshift_func_uint16_t_u_u(((void*)0 == l_422), 2))), (((safe_sub_func_int64_t_s_s((+((*g_846) = ((*g_236) == &p_70))), (*l_329))) || ((4294967289UL == ((((*l_875) = (safe_mul_func_int8_t_s_s(((*g_846) = (-1L)), (safe_mul_func_uint64_t_u_u(((*l_873) ^= p_70), 18446744073709551613UL))))) ^ p_70) > 0x25L)) != 0x38EDL)) , 0xB5L))), g_43[4].f1)) , 0x8AL) > 0xFEL)) & (****l_751)); (****g_744) ^= 6L; return (*g_36); } /* ---------------------------------------- */ int main (int argc, char* argv[]) { int i, j, k; int print_hash_value = 0; if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1; platform_main_begin(); crc32_gentab(); func_1(); transparent_crc(g_26, "g_26", print_hash_value); transparent_crc(g_37, "g_37", print_hash_value); transparent_crc(g_42, "g_42", print_hash_value); for (i = 0; i < 5; i++) { transparent_crc(g_43[i].f0, "g_43[i].f0", print_hash_value); transparent_crc(g_43[i].f1, "g_43[i].f1", print_hash_value); transparent_crc(g_43[i].f2, "g_43[i].f2", print_hash_value); transparent_crc(g_43[i].f3, "g_43[i].f3", print_hash_value); transparent_crc(g_43[i].f4, "g_43[i].f4", print_hash_value); transparent_crc(g_43[i].f5, "g_43[i].f5", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_72.f0.f0, "g_72.f0.f0", print_hash_value); transparent_crc(g_72.f0.f1, "g_72.f0.f1", print_hash_value); transparent_crc(g_72.f0.f2, "g_72.f0.f2", print_hash_value); transparent_crc(g_72.f0.f3, "g_72.f0.f3", print_hash_value); transparent_crc(g_72.f0.f4, "g_72.f0.f4", print_hash_value); transparent_crc(g_72.f0.f5, "g_72.f0.f5", print_hash_value); transparent_crc(g_72.f1, "g_72.f1", print_hash_value); transparent_crc(g_72.f2, "g_72.f2", print_hash_value); transparent_crc(g_72.f3, "g_72.f3", print_hash_value); transparent_crc(g_72.f4, "g_72.f4", print_hash_value); transparent_crc(g_72.f5, "g_72.f5", print_hash_value); transparent_crc(g_72.f6, "g_72.f6", print_hash_value); transparent_crc(g_72.f7, "g_72.f7", print_hash_value); transparent_crc(g_72.f8, "g_72.f8", print_hash_value); for (i = 0; i < 7; i++) { transparent_crc(g_94[i], "g_94[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_96, "g_96", print_hash_value); transparent_crc(g_130, "g_130", print_hash_value); transparent_crc(g_131, "g_131", print_hash_value); transparent_crc(g_146.f0, "g_146.f0", print_hash_value); for (i = 0; i < 2; i++) { transparent_crc(g_182[i], "g_182[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_193, "g_193", print_hash_value); for (i = 0; i < 8; i++) { for (j = 0; j < 4; j++) { for (k = 0; k < 3; k++) { transparent_crc(g_195[i][j][k], "g_195[i][j][k]", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_198.f0, "g_198.f0", print_hash_value); transparent_crc(g_198.f1, "g_198.f1", print_hash_value); transparent_crc(g_198.f2, "g_198.f2", print_hash_value); transparent_crc(g_198.f3, "g_198.f3", print_hash_value); transparent_crc(g_198.f4, "g_198.f4", print_hash_value); transparent_crc(g_198.f5, "g_198.f5", print_hash_value); transparent_crc(g_207.f0, "g_207.f0", print_hash_value); for (i = 0; i < 7; i++) { for (j = 0; j < 5; j++) { for (k = 0; k < 2; k++) { transparent_crc(g_212[i][j][k].f0, "g_212[i][j][k].f0", print_hash_value); transparent_crc(g_212[i][j][k].f1, "g_212[i][j][k].f1", print_hash_value); transparent_crc(g_212[i][j][k].f2, "g_212[i][j][k].f2", print_hash_value); transparent_crc(g_212[i][j][k].f3, "g_212[i][j][k].f3", print_hash_value); transparent_crc(g_212[i][j][k].f4, "g_212[i][j][k].f4", print_hash_value); transparent_crc(g_212[i][j][k].f5, "g_212[i][j][k].f5", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_218, "g_218", print_hash_value); transparent_crc(g_238, "g_238", print_hash_value); transparent_crc(g_263, "g_263", print_hash_value); transparent_crc(g_273, "g_273", print_hash_value); transparent_crc(g_315, "g_315", print_hash_value); for (i = 0; i < 8; i++) { transparent_crc(g_317[i], "g_317[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_320, "g_320", print_hash_value); for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { transparent_crc(g_409[i][j], "g_409[i][j]", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_425.f0.f0, "g_425.f0.f0", print_hash_value); transparent_crc(g_425.f0.f1, "g_425.f0.f1", print_hash_value); transparent_crc(g_425.f0.f2, "g_425.f0.f2", print_hash_value); transparent_crc(g_425.f0.f3, "g_425.f0.f3", print_hash_value); transparent_crc(g_425.f0.f4, "g_425.f0.f4", print_hash_value); transparent_crc(g_425.f0.f5, "g_425.f0.f5", print_hash_value); transparent_crc(g_425.f1, "g_425.f1", print_hash_value); transparent_crc(g_425.f2, "g_425.f2", print_hash_value); transparent_crc(g_425.f3, "g_425.f3", print_hash_value); transparent_crc(g_425.f4, "g_425.f4", print_hash_value); transparent_crc(g_425.f5, "g_425.f5", print_hash_value); transparent_crc(g_425.f6, "g_425.f6", print_hash_value); transparent_crc(g_425.f7, "g_425.f7", print_hash_value); transparent_crc(g_425.f8, "g_425.f8", print_hash_value); transparent_crc(g_506.f0, "g_506.f0", print_hash_value); transparent_crc(g_521, "g_521", print_hash_value); transparent_crc(g_602.f0, "g_602.f0", print_hash_value); transparent_crc(g_617.f0, "g_617.f0", print_hash_value); transparent_crc(g_669, "g_669", print_hash_value); transparent_crc(g_705, "g_705", print_hash_value); transparent_crc(g_712.f0, "g_712.f0", print_hash_value); transparent_crc(g_746.f0, "g_746.f0", print_hash_value); transparent_crc(g_746.f1, "g_746.f1", print_hash_value); transparent_crc(g_746.f2, "g_746.f2", print_hash_value); transparent_crc(g_746.f3, "g_746.f3", print_hash_value); transparent_crc(g_746.f4, "g_746.f4", print_hash_value); transparent_crc(g_746.f5, "g_746.f5", print_hash_value); for (i = 0; i < 4; i++) { for (j = 0; j < 5; j++) { transparent_crc(g_794[i][j].f0.f0, "g_794[i][j].f0.f0", print_hash_value); transparent_crc(g_794[i][j].f0.f1, "g_794[i][j].f0.f1", print_hash_value); transparent_crc(g_794[i][j].f0.f2, "g_794[i][j].f0.f2", print_hash_value); transparent_crc(g_794[i][j].f0.f3, "g_794[i][j].f0.f3", print_hash_value); transparent_crc(g_794[i][j].f0.f4, "g_794[i][j].f0.f4", print_hash_value); transparent_crc(g_794[i][j].f0.f5, "g_794[i][j].f0.f5", print_hash_value); transparent_crc(g_794[i][j].f1, "g_794[i][j].f1", print_hash_value); transparent_crc(g_794[i][j].f2, "g_794[i][j].f2", print_hash_value); transparent_crc(g_794[i][j].f3, "g_794[i][j].f3", print_hash_value); transparent_crc(g_794[i][j].f4, "g_794[i][j].f4", print_hash_value); transparent_crc(g_794[i][j].f5, "g_794[i][j].f5", print_hash_value); transparent_crc(g_794[i][j].f6, "g_794[i][j].f6", print_hash_value); transparent_crc(g_794[i][j].f7, "g_794[i][j].f7", print_hash_value); transparent_crc(g_794[i][j].f8, "g_794[i][j].f8", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } for (i = 0; i < 3; i++) { for (j = 0; j < 5; j++) { transparent_crc(g_808[i][j].f0, "g_808[i][j].f0", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_827.f0.f0, "g_827.f0.f0", print_hash_value); transparent_crc(g_827.f0.f1, "g_827.f0.f1", print_hash_value); transparent_crc(g_827.f0.f2, "g_827.f0.f2", print_hash_value); transparent_crc(g_827.f0.f3, "g_827.f0.f3", print_hash_value); transparent_crc(g_827.f0.f4, "g_827.f0.f4", print_hash_value); transparent_crc(g_827.f0.f5, "g_827.f0.f5", print_hash_value); transparent_crc(g_827.f1, "g_827.f1", print_hash_value); transparent_crc(g_827.f2, "g_827.f2", print_hash_value); transparent_crc(g_827.f3, "g_827.f3", print_hash_value); transparent_crc(g_827.f4, "g_827.f4", print_hash_value); transparent_crc(g_827.f5, "g_827.f5", print_hash_value); transparent_crc(g_827.f6, "g_827.f6", print_hash_value); transparent_crc(g_827.f7, "g_827.f7", print_hash_value); transparent_crc(g_827.f8, "g_827.f8", print_hash_value); transparent_crc(g_836.f0, "g_836.f0", print_hash_value); transparent_crc(g_836.f1, "g_836.f1", print_hash_value); transparent_crc(g_836.f2, "g_836.f2", print_hash_value); transparent_crc(g_836.f3, "g_836.f3", print_hash_value); transparent_crc(g_836.f4, "g_836.f4", print_hash_value); transparent_crc(g_836.f5, "g_836.f5", print_hash_value); transparent_crc(g_857.f0, "g_857.f0", print_hash_value); transparent_crc(g_857.f1, "g_857.f1", print_hash_value); transparent_crc(g_857.f2, "g_857.f2", print_hash_value); transparent_crc(g_857.f3, "g_857.f3", print_hash_value); transparent_crc(g_857.f4, "g_857.f4", print_hash_value); transparent_crc(g_857.f5, "g_857.f5", print_hash_value); transparent_crc(g_877.f0, "g_877.f0", print_hash_value); transparent_crc(g_963, "g_963", print_hash_value); transparent_crc(g_969.f0, "g_969.f0", print_hash_value); transparent_crc(g_969.f1, "g_969.f1", print_hash_value); transparent_crc(g_969.f2, "g_969.f2", print_hash_value); transparent_crc(g_969.f3, "g_969.f3", print_hash_value); transparent_crc(g_969.f4, "g_969.f4", print_hash_value); transparent_crc(g_969.f5, "g_969.f5", print_hash_value); transparent_crc(g_994, "g_994", print_hash_value); for (i = 0; i < 5; i++) { transparent_crc(g_1029[i], "g_1029[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_1055.f0, "g_1055.f0", print_hash_value); transparent_crc(g_1138, "g_1138", print_hash_value); transparent_crc(g_1140.f0.f0, "g_1140.f0.f0", print_hash_value); transparent_crc(g_1140.f0.f1, "g_1140.f0.f1", print_hash_value); transparent_crc(g_1140.f0.f2, "g_1140.f0.f2", print_hash_value); transparent_crc(g_1140.f0.f3, "g_1140.f0.f3", print_hash_value); transparent_crc(g_1140.f0.f4, "g_1140.f0.f4", print_hash_value); transparent_crc(g_1140.f0.f5, "g_1140.f0.f5", print_hash_value); transparent_crc(g_1140.f1, "g_1140.f1", print_hash_value); transparent_crc(g_1140.f2, "g_1140.f2", print_hash_value); transparent_crc(g_1140.f3, "g_1140.f3", print_hash_value); transparent_crc(g_1140.f4, "g_1140.f4", print_hash_value); transparent_crc(g_1140.f5, "g_1140.f5", print_hash_value); transparent_crc(g_1140.f6, "g_1140.f6", print_hash_value); transparent_crc(g_1140.f7, "g_1140.f7", print_hash_value); transparent_crc(g_1140.f8, "g_1140.f8", print_hash_value); for (i = 0; i < 1; i++) { for (j = 0; j < 3; j++) { transparent_crc(g_1153[i][j].f0, "g_1153[i][j].f0", print_hash_value); transparent_crc(g_1153[i][j].f1, "g_1153[i][j].f1", print_hash_value); transparent_crc(g_1153[i][j].f2, "g_1153[i][j].f2", print_hash_value); transparent_crc(g_1153[i][j].f3, "g_1153[i][j].f3", print_hash_value); transparent_crc(g_1153[i][j].f4, "g_1153[i][j].f4", print_hash_value); transparent_crc(g_1153[i][j].f5, "g_1153[i][j].f5", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } for (i = 0; i < 4; i++) { for (j = 0; j < 8; j++) { transparent_crc(g_1165[i][j], "g_1165[i][j]", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_1170, "g_1170", print_hash_value); transparent_crc(g_1212, "g_1212", print_hash_value); transparent_crc(g_1229, "g_1229", print_hash_value); transparent_crc(g_1258, "g_1258", print_hash_value); transparent_crc(g_1285.f0, "g_1285.f0", print_hash_value); transparent_crc(g_1285.f1, "g_1285.f1", print_hash_value); transparent_crc(g_1285.f2, "g_1285.f2", print_hash_value); transparent_crc(g_1285.f3, "g_1285.f3", print_hash_value); transparent_crc(g_1285.f4, "g_1285.f4", print_hash_value); transparent_crc(g_1285.f5, "g_1285.f5", print_hash_value); for (i = 0; i < 7; i++) { transparent_crc(g_1317[i], "g_1317[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_1320, "g_1320", print_hash_value); transparent_crc(g_1365.f0, "g_1365.f0", print_hash_value); transparent_crc(g_1365.f1, "g_1365.f1", print_hash_value); transparent_crc(g_1365.f2, "g_1365.f2", print_hash_value); transparent_crc(g_1365.f3, "g_1365.f3", print_hash_value); transparent_crc(g_1365.f4, "g_1365.f4", print_hash_value); transparent_crc(g_1365.f5, "g_1365.f5", print_hash_value); for (i = 0; i < 5; i++) { transparent_crc(g_1368[i], "g_1368[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } for (i = 0; i < 7; i++) { transparent_crc(g_1455[i].f0, "g_1455[i].f0", print_hash_value); transparent_crc(g_1455[i].f1, "g_1455[i].f1", print_hash_value); transparent_crc(g_1455[i].f2, "g_1455[i].f2", print_hash_value); transparent_crc(g_1455[i].f3, "g_1455[i].f3", print_hash_value); transparent_crc(g_1455[i].f4, "g_1455[i].f4", print_hash_value); transparent_crc(g_1455[i].f5, "g_1455[i].f5", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_1490.f0, "g_1490.f0", print_hash_value); for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) { for (k = 0; k < 8; k++) { transparent_crc(g_1506[i][j][k].f0, "g_1506[i][j][k].f0", print_hash_value); transparent_crc(g_1506[i][j][k].f1, "g_1506[i][j][k].f1", print_hash_value); transparent_crc(g_1506[i][j][k].f2, "g_1506[i][j][k].f2", print_hash_value); transparent_crc(g_1506[i][j][k].f3, "g_1506[i][j][k].f3", print_hash_value); transparent_crc(g_1506[i][j][k].f4, "g_1506[i][j][k].f4", print_hash_value); transparent_crc(g_1506[i][j][k].f5, "g_1506[i][j][k].f5", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_1550.f0.f0, "g_1550.f0.f0", print_hash_value); transparent_crc(g_1550.f0.f1, "g_1550.f0.f1", print_hash_value); transparent_crc(g_1550.f0.f2, "g_1550.f0.f2", print_hash_value); transparent_crc(g_1550.f0.f3, "g_1550.f0.f3", print_hash_value); transparent_crc(g_1550.f0.f4, "g_1550.f0.f4", print_hash_value); transparent_crc(g_1550.f0.f5, "g_1550.f0.f5", print_hash_value); transparent_crc(g_1550.f1, "g_1550.f1", print_hash_value); transparent_crc(g_1550.f2, "g_1550.f2", print_hash_value); transparent_crc(g_1550.f3, "g_1550.f3", print_hash_value); transparent_crc(g_1550.f4, "g_1550.f4", print_hash_value); transparent_crc(g_1550.f5, "g_1550.f5", print_hash_value); transparent_crc(g_1550.f6, "g_1550.f6", print_hash_value); transparent_crc(g_1550.f7, "g_1550.f7", print_hash_value); transparent_crc(g_1550.f8, "g_1550.f8", print_hash_value); transparent_crc(g_1554.f0, "g_1554.f0", print_hash_value); transparent_crc(g_1554.f1, "g_1554.f1", print_hash_value); transparent_crc(g_1554.f2, "g_1554.f2", print_hash_value); transparent_crc(g_1554.f3, "g_1554.f3", print_hash_value); transparent_crc(g_1554.f4, "g_1554.f4", print_hash_value); transparent_crc(g_1554.f5, "g_1554.f5", print_hash_value); transparent_crc(g_1557, "g_1557", print_hash_value); transparent_crc(g_1598, "g_1598", print_hash_value); transparent_crc(g_1607.f0, "g_1607.f0", print_hash_value); transparent_crc(g_1607.f1, "g_1607.f1", print_hash_value); transparent_crc(g_1607.f2, "g_1607.f2", print_hash_value); transparent_crc(g_1607.f3, "g_1607.f3", print_hash_value); transparent_crc(g_1607.f4, "g_1607.f4", print_hash_value); transparent_crc(g_1607.f5, "g_1607.f5", print_hash_value); transparent_crc(g_1655, "g_1655", print_hash_value); transparent_crc(g_1667.f0, "g_1667.f0", print_hash_value); for (i = 0; i < 7; i++) { for (j = 0; j < 2; j++) { transparent_crc(g_1668[i][j].f0, "g_1668[i][j].f0", print_hash_value); transparent_crc(g_1668[i][j].f1, "g_1668[i][j].f1", print_hash_value); transparent_crc(g_1668[i][j].f2, "g_1668[i][j].f2", print_hash_value); transparent_crc(g_1668[i][j].f3, "g_1668[i][j].f3", print_hash_value); transparent_crc(g_1668[i][j].f4, "g_1668[i][j].f4", print_hash_value); transparent_crc(g_1668[i][j].f5, "g_1668[i][j].f5", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_1685.f0, "g_1685.f0", print_hash_value); for (i = 0; i < 7; i++) { for (j = 0; j < 1; j++) { transparent_crc(g_1734[i][j].f0, "g_1734[i][j].f0", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_1746, "g_1746", print_hash_value); transparent_crc(g_1753.f0, "g_1753.f0", print_hash_value); transparent_crc(g_1753.f1, "g_1753.f1", print_hash_value); transparent_crc(g_1753.f2, "g_1753.f2", print_hash_value); transparent_crc(g_1753.f3, "g_1753.f3", print_hash_value); transparent_crc(g_1753.f4, "g_1753.f4", print_hash_value); transparent_crc(g_1753.f5, "g_1753.f5", print_hash_value); transparent_crc(g_1767, "g_1767", print_hash_value); transparent_crc(g_1830.f0, "g_1830.f0", print_hash_value); transparent_crc(g_1830.f1, "g_1830.f1", print_hash_value); transparent_crc(g_1830.f2, "g_1830.f2", print_hash_value); transparent_crc(g_1830.f3, "g_1830.f3", print_hash_value); transparent_crc(g_1830.f4, "g_1830.f4", print_hash_value); transparent_crc(g_1830.f5, "g_1830.f5", print_hash_value); transparent_crc(g_1871, "g_1871", print_hash_value); for (i = 0; i < 3; i++) { for (j = 0; j < 9; j++) { transparent_crc(g_1931[i][j].f0.f0, "g_1931[i][j].f0.f0", print_hash_value); transparent_crc(g_1931[i][j].f0.f1, "g_1931[i][j].f0.f1", print_hash_value); transparent_crc(g_1931[i][j].f0.f2, "g_1931[i][j].f0.f2", print_hash_value); transparent_crc(g_1931[i][j].f0.f3, "g_1931[i][j].f0.f3", print_hash_value); transparent_crc(g_1931[i][j].f0.f4, "g_1931[i][j].f0.f4", print_hash_value); transparent_crc(g_1931[i][j].f0.f5, "g_1931[i][j].f0.f5", print_hash_value); transparent_crc(g_1931[i][j].f1, "g_1931[i][j].f1", print_hash_value); transparent_crc(g_1931[i][j].f2, "g_1931[i][j].f2", print_hash_value); transparent_crc(g_1931[i][j].f3, "g_1931[i][j].f3", print_hash_value); transparent_crc(g_1931[i][j].f4, "g_1931[i][j].f4", print_hash_value); transparent_crc(g_1931[i][j].f5, "g_1931[i][j].f5", print_hash_value); transparent_crc(g_1931[i][j].f6, "g_1931[i][j].f6", print_hash_value); transparent_crc(g_1931[i][j].f7, "g_1931[i][j].f7", print_hash_value); transparent_crc(g_1931[i][j].f8, "g_1931[i][j].f8", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_1974.f0, "g_1974.f0", print_hash_value); transparent_crc(g_1974.f1, "g_1974.f1", print_hash_value); transparent_crc(g_1974.f2, "g_1974.f2", print_hash_value); transparent_crc(g_1974.f3, "g_1974.f3", print_hash_value); transparent_crc(g_1974.f4, "g_1974.f4", print_hash_value); transparent_crc(g_1974.f5, "g_1974.f5", print_hash_value); transparent_crc(g_1978.f0, "g_1978.f0", print_hash_value); transparent_crc(g_1978.f1, "g_1978.f1", print_hash_value); transparent_crc(g_1978.f2, "g_1978.f2", print_hash_value); transparent_crc(g_1978.f3, "g_1978.f3", print_hash_value); transparent_crc(g_1978.f4, "g_1978.f4", print_hash_value); transparent_crc(g_1978.f5, "g_1978.f5", print_hash_value); transparent_crc(g_1981, "g_1981", print_hash_value); transparent_crc(g_2109, "g_2109", print_hash_value); transparent_crc(g_2117.f0.f0, "g_2117.f0.f0", print_hash_value); transparent_crc(g_2117.f0.f1, "g_2117.f0.f1", print_hash_value); transparent_crc(g_2117.f0.f2, "g_2117.f0.f2", print_hash_value); transparent_crc(g_2117.f0.f3, "g_2117.f0.f3", print_hash_value); transparent_crc(g_2117.f0.f4, "g_2117.f0.f4", print_hash_value); transparent_crc(g_2117.f0.f5, "g_2117.f0.f5", print_hash_value); transparent_crc(g_2117.f1, "g_2117.f1", print_hash_value); transparent_crc(g_2117.f2, "g_2117.f2", print_hash_value); transparent_crc(g_2117.f3, "g_2117.f3", print_hash_value); transparent_crc(g_2117.f4, "g_2117.f4", print_hash_value); transparent_crc(g_2117.f5, "g_2117.f5", print_hash_value); transparent_crc(g_2117.f6, "g_2117.f6", print_hash_value); transparent_crc(g_2117.f7, "g_2117.f7", print_hash_value); transparent_crc(g_2117.f8, "g_2117.f8", print_hash_value); transparent_crc(g_2137.f0, "g_2137.f0", print_hash_value); transparent_crc(g_2151.f0.f0, "g_2151.f0.f0", print_hash_value); transparent_crc(g_2151.f0.f1, "g_2151.f0.f1", print_hash_value); transparent_crc(g_2151.f0.f2, "g_2151.f0.f2", print_hash_value); transparent_crc(g_2151.f0.f3, "g_2151.f0.f3", print_hash_value); transparent_crc(g_2151.f0.f4, "g_2151.f0.f4", print_hash_value); transparent_crc(g_2151.f0.f5, "g_2151.f0.f5", print_hash_value); transparent_crc(g_2151.f1, "g_2151.f1", print_hash_value); transparent_crc(g_2151.f2, "g_2151.f2", print_hash_value); transparent_crc(g_2151.f3, "g_2151.f3", print_hash_value); transparent_crc(g_2151.f4, "g_2151.f4", print_hash_value); transparent_crc(g_2151.f5, "g_2151.f5", print_hash_value); transparent_crc(g_2151.f6, "g_2151.f6", print_hash_value); transparent_crc(g_2151.f7, "g_2151.f7", print_hash_value); transparent_crc(g_2151.f8, "g_2151.f8", print_hash_value); transparent_crc(g_2271.f0, "g_2271.f0", print_hash_value); transparent_crc(g_2271.f1, "g_2271.f1", print_hash_value); transparent_crc(g_2271.f2, "g_2271.f2", print_hash_value); transparent_crc(g_2271.f3, "g_2271.f3", print_hash_value); transparent_crc(g_2271.f4, "g_2271.f4", print_hash_value); transparent_crc(g_2271.f5, "g_2271.f5", print_hash_value); transparent_crc(g_2283.f0.f0, "g_2283.f0.f0", print_hash_value); transparent_crc(g_2283.f0.f1, "g_2283.f0.f1", print_hash_value); transparent_crc(g_2283.f0.f2, "g_2283.f0.f2", print_hash_value); transparent_crc(g_2283.f0.f3, "g_2283.f0.f3", print_hash_value); transparent_crc(g_2283.f0.f4, "g_2283.f0.f4", print_hash_value); transparent_crc(g_2283.f0.f5, "g_2283.f0.f5", print_hash_value); transparent_crc(g_2283.f1, "g_2283.f1", print_hash_value); transparent_crc(g_2283.f2, "g_2283.f2", print_hash_value); transparent_crc(g_2283.f3, "g_2283.f3", print_hash_value); transparent_crc(g_2283.f4, "g_2283.f4", print_hash_value); transparent_crc(g_2283.f5, "g_2283.f5", print_hash_value); transparent_crc(g_2283.f6, "g_2283.f6", print_hash_value); transparent_crc(g_2283.f7, "g_2283.f7", print_hash_value); transparent_crc(g_2283.f8, "g_2283.f8", print_hash_value); transparent_crc(g_2286, "g_2286", print_hash_value); transparent_crc(g_2411.f0.f0, "g_2411.f0.f0", print_hash_value); transparent_crc(g_2411.f0.f1, "g_2411.f0.f1", print_hash_value); transparent_crc(g_2411.f0.f2, "g_2411.f0.f2", print_hash_value); transparent_crc(g_2411.f0.f3, "g_2411.f0.f3", print_hash_value); transparent_crc(g_2411.f0.f4, "g_2411.f0.f4", print_hash_value); transparent_crc(g_2411.f0.f5, "g_2411.f0.f5", print_hash_value); transparent_crc(g_2411.f1, "g_2411.f1", print_hash_value); transparent_crc(g_2411.f2, "g_2411.f2", print_hash_value); transparent_crc(g_2411.f3, "g_2411.f3", print_hash_value); transparent_crc(g_2411.f4, "g_2411.f4", print_hash_value); transparent_crc(g_2411.f5, "g_2411.f5", print_hash_value); transparent_crc(g_2411.f6, "g_2411.f6", print_hash_value); transparent_crc(g_2411.f7, "g_2411.f7", print_hash_value); transparent_crc(g_2411.f8, "g_2411.f8", print_hash_value); transparent_crc(g_2434.f0, "g_2434.f0", print_hash_value); transparent_crc(g_2434.f1, "g_2434.f1", print_hash_value); transparent_crc(g_2434.f2, "g_2434.f2", print_hash_value); transparent_crc(g_2434.f3, "g_2434.f3", print_hash_value); transparent_crc(g_2434.f4, "g_2434.f4", print_hash_value); transparent_crc(g_2434.f5, "g_2434.f5", print_hash_value); transparent_crc(g_2454, "g_2454", print_hash_value); transparent_crc(g_2480, "g_2480", print_hash_value); transparent_crc(g_2555.f0, "g_2555.f0", print_hash_value); transparent_crc(g_2555.f1, "g_2555.f1", print_hash_value); transparent_crc(g_2555.f2, "g_2555.f2", print_hash_value); transparent_crc(g_2555.f3, "g_2555.f3", print_hash_value); transparent_crc(g_2555.f4, "g_2555.f4", print_hash_value); transparent_crc(g_2555.f5, "g_2555.f5", print_hash_value); transparent_crc(g_2748.f0, "g_2748.f0", print_hash_value); transparent_crc(g_2748.f1, "g_2748.f1", print_hash_value); transparent_crc(g_2748.f2, "g_2748.f2", print_hash_value); transparent_crc(g_2748.f3, "g_2748.f3", print_hash_value); transparent_crc(g_2748.f4, "g_2748.f4", print_hash_value); transparent_crc(g_2748.f5, "g_2748.f5", print_hash_value); transparent_crc(g_2794.f0.f0, "g_2794.f0.f0", print_hash_value); transparent_crc(g_2794.f0.f1, "g_2794.f0.f1", print_hash_value); transparent_crc(g_2794.f0.f2, "g_2794.f0.f2", print_hash_value); transparent_crc(g_2794.f0.f3, "g_2794.f0.f3", print_hash_value); transparent_crc(g_2794.f0.f4, "g_2794.f0.f4", print_hash_value); transparent_crc(g_2794.f0.f5, "g_2794.f0.f5", print_hash_value); transparent_crc(g_2794.f1, "g_2794.f1", print_hash_value); transparent_crc(g_2794.f2, "g_2794.f2", print_hash_value); transparent_crc(g_2794.f3, "g_2794.f3", print_hash_value); transparent_crc(g_2794.f4, "g_2794.f4", print_hash_value); transparent_crc(g_2794.f5, "g_2794.f5", print_hash_value); transparent_crc(g_2794.f6, "g_2794.f6", print_hash_value); transparent_crc(g_2794.f7, "g_2794.f7", print_hash_value); transparent_crc(g_2794.f8, "g_2794.f8", print_hash_value); transparent_crc(g_2805.f0, "g_2805.f0", print_hash_value); for (i = 0; i < 4; i++) { for (j = 0; j < 7; j++) { transparent_crc(g_2822[i][j].f0.f0, "g_2822[i][j].f0.f0", print_hash_value); transparent_crc(g_2822[i][j].f0.f1, "g_2822[i][j].f0.f1", print_hash_value); transparent_crc(g_2822[i][j].f0.f2, "g_2822[i][j].f0.f2", print_hash_value); transparent_crc(g_2822[i][j].f0.f3, "g_2822[i][j].f0.f3", print_hash_value); transparent_crc(g_2822[i][j].f0.f4, "g_2822[i][j].f0.f4", print_hash_value); transparent_crc(g_2822[i][j].f0.f5, "g_2822[i][j].f0.f5", print_hash_value); transparent_crc(g_2822[i][j].f1, "g_2822[i][j].f1", print_hash_value); transparent_crc(g_2822[i][j].f2, "g_2822[i][j].f2", print_hash_value); transparent_crc(g_2822[i][j].f3, "g_2822[i][j].f3", print_hash_value); transparent_crc(g_2822[i][j].f4, "g_2822[i][j].f4", print_hash_value); transparent_crc(g_2822[i][j].f5, "g_2822[i][j].f5", print_hash_value); transparent_crc(g_2822[i][j].f6, "g_2822[i][j].f6", print_hash_value); transparent_crc(g_2822[i][j].f7, "g_2822[i][j].f7", print_hash_value); transparent_crc(g_2822[i][j].f8, "g_2822[i][j].f8", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } for (i = 0; i < 10; i++) { transparent_crc(g_2825[i].f0, "g_2825[i].f0", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2839.f0, "g_2839.f0", print_hash_value); transparent_crc(g_2839.f1, "g_2839.f1", print_hash_value); transparent_crc(g_2839.f2, "g_2839.f2", print_hash_value); transparent_crc(g_2839.f3, "g_2839.f3", print_hash_value); transparent_crc(g_2839.f4, "g_2839.f4", print_hash_value); transparent_crc(g_2839.f5, "g_2839.f5", print_hash_value); transparent_crc(g_2884.f0, "g_2884.f0", print_hash_value); transparent_crc(g_2957.f0, "g_2957.f0", print_hash_value); transparent_crc(g_2978.f0.f0, "g_2978.f0.f0", print_hash_value); transparent_crc(g_2978.f0.f1, "g_2978.f0.f1", print_hash_value); transparent_crc(g_2978.f0.f2, "g_2978.f0.f2", print_hash_value); transparent_crc(g_2978.f0.f3, "g_2978.f0.f3", print_hash_value); transparent_crc(g_2978.f0.f4, "g_2978.f0.f4", print_hash_value); transparent_crc(g_2978.f0.f5, "g_2978.f0.f5", print_hash_value); transparent_crc(g_2978.f1, "g_2978.f1", print_hash_value); transparent_crc(g_2978.f2, "g_2978.f2", print_hash_value); transparent_crc(g_2978.f3, "g_2978.f3", print_hash_value); transparent_crc(g_2978.f4, "g_2978.f4", print_hash_value); transparent_crc(g_2978.f5, "g_2978.f5", print_hash_value); transparent_crc(g_2978.f6, "g_2978.f6", print_hash_value); transparent_crc(g_2978.f7, "g_2978.f7", print_hash_value); transparent_crc(g_2978.f8, "g_2978.f8", print_hash_value); for (i = 0; i < 6; i++) { transparent_crc(g_3040[i].f0, "g_3040[i].f0", print_hash_value); transparent_crc(g_3040[i].f1, "g_3040[i].f1", print_hash_value); transparent_crc(g_3040[i].f2, "g_3040[i].f2", print_hash_value); transparent_crc(g_3040[i].f3, "g_3040[i].f3", print_hash_value); transparent_crc(g_3040[i].f4, "g_3040[i].f4", print_hash_value); transparent_crc(g_3040[i].f5, "g_3040[i].f5", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } for (i = 0; i < 7; i++) { for (j = 0; j < 8; j++) { for (k = 0; k < 4; k++) { transparent_crc(g_3062[i][j][k].f0.f0, "g_3062[i][j][k].f0.f0", print_hash_value); transparent_crc(g_3062[i][j][k].f0.f1, "g_3062[i][j][k].f0.f1", print_hash_value); transparent_crc(g_3062[i][j][k].f0.f2, "g_3062[i][j][k].f0.f2", print_hash_value); transparent_crc(g_3062[i][j][k].f0.f3, "g_3062[i][j][k].f0.f3", print_hash_value); transparent_crc(g_3062[i][j][k].f0.f4, "g_3062[i][j][k].f0.f4", print_hash_value); transparent_crc(g_3062[i][j][k].f0.f5, "g_3062[i][j][k].f0.f5", print_hash_value); transparent_crc(g_3062[i][j][k].f1, "g_3062[i][j][k].f1", print_hash_value); transparent_crc(g_3062[i][j][k].f2, "g_3062[i][j][k].f2", print_hash_value); transparent_crc(g_3062[i][j][k].f3, "g_3062[i][j][k].f3", print_hash_value); transparent_crc(g_3062[i][j][k].f4, "g_3062[i][j][k].f4", print_hash_value); transparent_crc(g_3062[i][j][k].f5, "g_3062[i][j][k].f5", print_hash_value); transparent_crc(g_3062[i][j][k].f6, "g_3062[i][j][k].f6", print_hash_value); transparent_crc(g_3062[i][j][k].f7, "g_3062[i][j][k].f7", print_hash_value); transparent_crc(g_3062[i][j][k].f8, "g_3062[i][j][k].f8", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_3095, "g_3095", print_hash_value); for (i = 0; i < 8; i++) { transparent_crc(g_3097[i], "g_3097[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_3130, "g_3130", print_hash_value); transparent_crc(g_3134.f0, "g_3134.f0", print_hash_value); transparent_crc(g_3152.f0, "g_3152.f0", print_hash_value); transparent_crc(g_3174.f0, "g_3174.f0", print_hash_value); transparent_crc(g_3216.f0.f0, "g_3216.f0.f0", print_hash_value); transparent_crc(g_3216.f0.f1, "g_3216.f0.f1", print_hash_value); transparent_crc(g_3216.f0.f2, "g_3216.f0.f2", print_hash_value); transparent_crc(g_3216.f0.f3, "g_3216.f0.f3", print_hash_value); transparent_crc(g_3216.f0.f4, "g_3216.f0.f4", print_hash_value); transparent_crc(g_3216.f0.f5, "g_3216.f0.f5", print_hash_value); transparent_crc(g_3216.f1, "g_3216.f1", print_hash_value); transparent_crc(g_3216.f2, "g_3216.f2", print_hash_value); transparent_crc(g_3216.f3, "g_3216.f3", print_hash_value); transparent_crc(g_3216.f4, "g_3216.f4", print_hash_value); transparent_crc(g_3216.f5, "g_3216.f5", print_hash_value); transparent_crc(g_3216.f6, "g_3216.f6", print_hash_value); transparent_crc(g_3216.f7, "g_3216.f7", print_hash_value); transparent_crc(g_3216.f8, "g_3216.f8", print_hash_value); transparent_crc(g_3348.f0, "g_3348.f0", print_hash_value); transparent_crc(g_3348.f1, "g_3348.f1", print_hash_value); transparent_crc(g_3348.f2, "g_3348.f2", print_hash_value); transparent_crc(g_3348.f3, "g_3348.f3", print_hash_value); transparent_crc(g_3348.f4, "g_3348.f4", print_hash_value); transparent_crc(g_3348.f5, "g_3348.f5", print_hash_value); transparent_crc(g_3352.f0.f0, "g_3352.f0.f0", print_hash_value); transparent_crc(g_3352.f0.f1, "g_3352.f0.f1", print_hash_value); transparent_crc(g_3352.f0.f2, "g_3352.f0.f2", print_hash_value); transparent_crc(g_3352.f0.f3, "g_3352.f0.f3", print_hash_value); transparent_crc(g_3352.f0.f4, "g_3352.f0.f4", print_hash_value); transparent_crc(g_3352.f0.f5, "g_3352.f0.f5", print_hash_value); transparent_crc(g_3352.f1, "g_3352.f1", print_hash_value); transparent_crc(g_3352.f2, "g_3352.f2", print_hash_value); transparent_crc(g_3352.f3, "g_3352.f3", print_hash_value); transparent_crc(g_3352.f4, "g_3352.f4", print_hash_value); transparent_crc(g_3352.f5, "g_3352.f5", print_hash_value); transparent_crc(g_3352.f6, "g_3352.f6", print_hash_value); transparent_crc(g_3352.f7, "g_3352.f7", print_hash_value); transparent_crc(g_3352.f8, "g_3352.f8", print_hash_value); transparent_crc(g_3430.f0, "g_3430.f0", print_hash_value); transparent_crc(g_3533, "g_3533", print_hash_value); transparent_crc(g_3543.f0.f0, "g_3543.f0.f0", print_hash_value); transparent_crc(g_3543.f0.f1, "g_3543.f0.f1", print_hash_value); transparent_crc(g_3543.f0.f2, "g_3543.f0.f2", print_hash_value); transparent_crc(g_3543.f0.f3, "g_3543.f0.f3", print_hash_value); transparent_crc(g_3543.f0.f4, "g_3543.f0.f4", print_hash_value); transparent_crc(g_3543.f0.f5, "g_3543.f0.f5", print_hash_value); transparent_crc(g_3543.f1, "g_3543.f1", print_hash_value); transparent_crc(g_3543.f2, "g_3543.f2", print_hash_value); transparent_crc(g_3543.f3, "g_3543.f3", print_hash_value); transparent_crc(g_3543.f4, "g_3543.f4", print_hash_value); transparent_crc(g_3543.f5, "g_3543.f5", print_hash_value); transparent_crc(g_3543.f6, "g_3543.f6", print_hash_value); transparent_crc(g_3543.f7, "g_3543.f7", print_hash_value); transparent_crc(g_3543.f8, "g_3543.f8", print_hash_value); transparent_crc(g_3544.f0.f0, "g_3544.f0.f0", print_hash_value); transparent_crc(g_3544.f0.f1, "g_3544.f0.f1", print_hash_value); transparent_crc(g_3544.f0.f2, "g_3544.f0.f2", print_hash_value); transparent_crc(g_3544.f0.f3, "g_3544.f0.f3", print_hash_value); transparent_crc(g_3544.f0.f4, "g_3544.f0.f4", print_hash_value); transparent_crc(g_3544.f0.f5, "g_3544.f0.f5", print_hash_value); transparent_crc(g_3544.f1, "g_3544.f1", print_hash_value); transparent_crc(g_3544.f2, "g_3544.f2", print_hash_value); transparent_crc(g_3544.f3, "g_3544.f3", print_hash_value); transparent_crc(g_3544.f4, "g_3544.f4", print_hash_value); transparent_crc(g_3544.f5, "g_3544.f5", print_hash_value); transparent_crc(g_3544.f6, "g_3544.f6", print_hash_value); transparent_crc(g_3544.f7, "g_3544.f7", print_hash_value); transparent_crc(g_3544.f8, "g_3544.f8", print_hash_value); for (i = 0; i < 5; i++) { transparent_crc(g_3696[i].f0, "g_3696[i].f0", print_hash_value); transparent_crc(g_3696[i].f1, "g_3696[i].f1", print_hash_value); transparent_crc(g_3696[i].f2, "g_3696[i].f2", print_hash_value); transparent_crc(g_3696[i].f3, "g_3696[i].f3", print_hash_value); transparent_crc(g_3696[i].f4, "g_3696[i].f4", print_hash_value); transparent_crc(g_3696[i].f5, "g_3696[i].f5", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_3763.f0, "g_3763.f0", print_hash_value); platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); return 0; } /************************ statistics ************************* XXX max struct depth: 2 breakdown: depth: 0, occurrence: 995 depth: 1, occurrence: 25 depth: 2, occurrence: 14 XXX total union variables: 22 XXX non-zero bitfields defined in structs: 2 XXX zero bitfields defined in structs: 1 XXX const bitfields defined in structs: 0 XXX volatile bitfields defined in structs: 1 XXX structs with bitfields in the program: 32 breakdown: indirect level: 0, occurrence: 14 indirect level: 1, occurrence: 11 indirect level: 2, occurrence: 7 XXX full-bitfields structs in the program: 0 breakdown: XXX times a bitfields struct's address is taken: 30 XXX times a bitfields struct on LHS: 0 XXX times a bitfields struct on RHS: 27 XXX times a single bitfield on LHS: 0 XXX times a single bitfield on RHS: 4 XXX max expression depth: 51 breakdown: depth: 1, occurrence: 361 depth: 2, occurrence: 91 depth: 3, occurrence: 7 depth: 4, occurrence: 6 depth: 5, occurrence: 6 depth: 6, occurrence: 3 depth: 7, occurrence: 1 depth: 10, occurrence: 1 depth: 12, occurrence: 1 depth: 13, occurrence: 3 depth: 14, occurrence: 3 depth: 15, occurrence: 1 depth: 16, occurrence: 5 depth: 17, occurrence: 4 depth: 18, occurrence: 4 depth: 19, occurrence: 2 depth: 20, occurrence: 6 depth: 21, occurrence: 5 depth: 22, occurrence: 6 depth: 23, occurrence: 1 depth: 24, occurrence: 5 depth: 26, occurrence: 5 depth: 28, occurrence: 1 depth: 29, occurrence: 2 depth: 30, occurrence: 2 depth: 31, occurrence: 1 depth: 32, occurrence: 1 depth: 33, occurrence: 2 depth: 34, occurrence: 1 depth: 37, occurrence: 3 depth: 39, occurrence: 1 depth: 41, occurrence: 2 depth: 43, occurrence: 1 depth: 45, occurrence: 1 depth: 51, occurrence: 1 XXX total number of pointers: 869 XXX times a variable address is taken: 2495 XXX times a pointer is dereferenced on RHS: 513 breakdown: depth: 1, occurrence: 432 depth: 2, occurrence: 58 depth: 3, occurrence: 14 depth: 4, occurrence: 9 XXX times a pointer is dereferenced on LHS: 477 breakdown: depth: 1, occurrence: 398 depth: 2, occurrence: 47 depth: 3, occurrence: 18 depth: 4, occurrence: 14 XXX times a pointer is compared with null: 74 XXX times a pointer is compared with address of another variable: 15 XXX times a pointer is compared with another pointer: 29 XXX times a pointer is qualified to be dereferenced: 15237 XXX max dereference level: 5 breakdown: level: 0, occurrence: 0 level: 1, occurrence: 2039 level: 2, occurrence: 628 level: 3, occurrence: 158 level: 4, occurrence: 212 level: 5, occurrence: 99 XXX number of pointers point to pointers: 341 XXX number of pointers point to scalars: 492 XXX number of pointers point to structs: 24 XXX percent of pointers has null in alias set: 31.9 XXX average alias set size: 1.57 XXX times a non-volatile is read: 3044 XXX times a non-volatile is write: 1571 XXX times a volatile is read: 191 XXX times read thru a pointer: 22 XXX times a volatile is write: 52 XXX times written thru a pointer: 2 XXX times a volatile is available for access: 1.09e+04 XXX percentage of non-volatile access: 95 XXX forward jumps: 2 XXX backward jumps: 12 XXX stmts: 358 XXX max block depth: 5 breakdown: depth: 0, occurrence: 37 depth: 1, occurrence: 34 depth: 2, occurrence: 41 depth: 3, occurrence: 50 depth: 4, occurrence: 83 depth: 5, occurrence: 113 XXX percentage a fresh-made variable is used: 16.5 XXX percentage an existing variable is used: 83.5 FYI: the random generator makes assumptions about the integer size. See platform.info for more details. XXX total OOB instances added: 0 ********************* end of statistics **********************/ chibicc-1.0.24/test/csmith_4204.c000066400000000000000000003624351517770275000162750ustar00rootroot00000000000000/* * This is a RANDOMLY GENERATED PROGRAM. * * Generator: csmith 2.4.0 * Git version: 0cdc710 * Options: --seed 24511 * Seed: 24511 */ #include "csmith.h" static long __undefined; /* --- Struct/Union Declarations --- */ union U0 { signed f0 : 30; }; /* --- GLOBAL VARIABLES --- */ static int16_t g_8 = 0x7671L; static uint16_t g_13[4][3] = {{5UL,5UL,5UL},{5UL,5UL,5UL},{5UL,5UL,5UL},{5UL,5UL,5UL}}; static uint64_t g_59[8][4][5] = {{{0UL,0UL,18446744073709551611UL,0xC04BB91E25501822LL,0UL},{0x8EBCCE3F50E16FFALL,0xFD5D1AFC438F8743LL,0xAF8A8FF013EC5CB5LL,18446744073709551608UL,0xD0685B90C327405ELL},{0UL,0UL,2UL,0UL,0UL},{0x8EBCCE3F50E16FFALL,0xAD5032406135443CLL,18446744073709551610UL,0x7CD2BAB91EE328DBLL,18446744073709551615UL}},{{0UL,18446744073709551607UL,18446744073709551607UL,0UL,18446744073709551611UL},{0x7CD2BAB91EE328DBLL,18446744073709551610UL,0xAD5032406135443CLL,0x8EBCCE3F50E16FFALL,1UL},{0UL,2UL,0UL,0UL,18446744073709551611UL},{0x0979B5CEC8167BA9LL,0x7CD2BAB91EE328DBLL,0x8EBCCE3F50E16FFALL,1UL,0xD0685B90C327405ELL}},{{0x3CBAA6F4ED832CB8LL,18446744073709551607UL,18446744073709551615UL,0xFA766E9B1CC8FFCALL,18446744073709551615UL},{0xC7D4E785E8A77F2ALL,0xC7D4E785E8A77F2ALL,18446744073709551610UL,2UL,0x7CD2BAB91EE328DBLL},{0xFAD241D88C924DFBLL,0x672A6DFE1602A050LL,2UL,0UL,0xFA766E9B1CC8FFCALL},{0x8103B8AF769BF4A3LL,18446744073709551610UL,0xFA629A01EED764E3LL,0x0979B5CEC8167BA9LL,18446744073709551610UL}},{{18446744073709551607UL,0x672A6DFE1602A050LL,0UL,0x3CBAA6F4ED832CB8LL,0UL},{1UL,0xC7D4E785E8A77F2ALL,0x0979B5CEC8167BA9LL,0xC7D4E785E8A77F2ALL,1UL},{0UL,18446744073709551607UL,1UL,0xFAD241D88C924DFBLL,0UL},{18446744073709551608UL,0x7CD2BAB91EE328DBLL,1UL,0x8103B8AF769BF4A3LL,0x0979B5CEC8167BA9LL}},{{1UL,18446744073709551615UL,3UL,18446744073709551607UL,0UL},{18446744073709551610UL,0x8103B8AF769BF4A3LL,18446744073709551608UL,1UL,1UL},{0UL,0UL,0UL,0UL,0UL},{0xFD5D1AFC438F8743LL,0x8D6DB9E588CE324ELL,0xAD5032406135443CLL,18446744073709551608UL,18446744073709551610UL}},{{0UL,0UL,0UL,1UL,0xFA766E9B1CC8FFCALL},{1UL,0x8EBCCE3F50E16FFALL,0xAD5032406135443CLL,18446744073709551610UL,0x7CD2BAB91EE328DBLL},{0UL,18446744073709551615UL,0UL,0UL,18446744073709551615UL},{2UL,18446744073709551610UL,18446744073709551608UL,0xFD5D1AFC438F8743LL,0xD0685B90C327405ELL}},{{18446744073709551615UL,2UL,3UL,0UL,18446744073709551611UL},{0xAD5032406135443CLL,0xFA629A01EED764E3LL,1UL,1UL,0x5D0016D172E30E5DLL},{18446744073709551615UL,0UL,1UL,0UL,18446744073709551607UL},{2UL,0x0979B5CEC8167BA9LL,0x0979B5CEC8167BA9LL,2UL,18446744073709551608UL}},{{0UL,1UL,0UL,18446744073709551615UL,0UL},{1UL,1UL,0xFA629A01EED764E3LL,0xAD5032406135443CLL,18446744073709551615UL},{0UL,3UL,2UL,18446744073709551615UL,18446744073709551613UL},{0xFD5D1AFC438F8743LL,18446744073709551608UL,18446744073709551610UL,2UL,18446744073709551610UL}}}; static int32_t g_63 = (-1L); static int32_t *g_62 = &g_63; static uint8_t g_83 = 0UL; static volatile uint16_t g_86[6] = {0xD6D6L,0xD6D6L,0xD6D6L,0xD6D6L,0xD6D6L,0xD6D6L}; static int8_t g_120 = (-5L); static union U0 g_130 = {0x358544EDL}; static uint32_t g_134[8] = {0xE1702014L,0xE1702014L,0xBD7FBB02L,0xE1702014L,0xE1702014L,0xBD7FBB02L,0xE1702014L,0xE1702014L}; static uint32_t g_137[7] = {4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL}; static int32_t ** volatile g_138 = &g_62;/* VOLATILE GLOBAL g_138 */ static int32_t **g_143 = &g_62; static int32_t *** volatile g_142[8][1] = {{&g_143},{&g_143},{&g_143},{&g_143},{&g_143},{&g_143},{&g_143},{&g_143}}; static int32_t *** volatile g_144 = &g_143;/* VOLATILE GLOBAL g_144 */ static uint16_t g_165 = 65535UL; static volatile uint64_t * volatile *g_186 = (void*)0; static uint32_t g_220 = 7UL; static int32_t *g_236 = &g_63; static int64_t g_239[4][3][2] = {{{9L,0x30313B4598823A16LL},{0x73A34EB400375982LL,0x17209D690791E5CBLL},{0x73A34EB400375982LL,0x30313B4598823A16LL}},{{9L,0x30313B4598823A16LL},{0x73A34EB400375982LL,0x17209D690791E5CBLL},{0x73A34EB400375982LL,0x30313B4598823A16LL}},{{9L,0x30313B4598823A16LL},{0x73A34EB400375982LL,0x17209D690791E5CBLL},{0x73A34EB400375982LL,0x30313B4598823A16LL}},{{9L,0x30313B4598823A16LL},{0x73A34EB400375982LL,0x17209D690791E5CBLL},{0x73A34EB400375982LL,0x30313B4598823A16LL}}}; static int8_t g_261 = (-7L); static volatile int16_t g_296 = 0xF7D2L;/* VOLATILE GLOBAL g_296 */ static const union U0 g_312 = {1L}; static uint64_t *g_318 = &g_59[4][2][1]; static uint64_t **g_317 = &g_318; static uint16_t *g_398 = &g_165; static int8_t g_452 = 0xFBL; static int8_t *g_451 = &g_452; static const uint64_t g_502[7] = {0xC4BC9DE005252114LL,0xC4BC9DE005252114LL,0xC4BC9DE005252114LL,0xC4BC9DE005252114LL,0xC4BC9DE005252114LL,0xC4BC9DE005252114LL,0xC4BC9DE005252114LL}; static int16_t g_526 = 0xA6ADL; static uint16_t g_540 = 4UL; static union U0 * volatile g_571 = &g_130;/* VOLATILE GLOBAL g_571 */ static union U0 * volatile * volatile g_570[10] = {&g_571,&g_571,&g_571,&g_571,&g_571,&g_571,&g_571,&g_571,&g_571,&g_571}; static int32_t *** volatile g_579 = &g_143;/* VOLATILE GLOBAL g_579 */ static int32_t **g_707 = &g_236; static int32_t g_711 = 7L; static uint32_t g_794 = 0xED509A4BL; static int32_t g_828 = 1L; static volatile int8_t *g_1024 = (void*)0; static volatile int8_t ** const g_1023 = &g_1024; static const volatile uint64_t *** const volatile * volatile * volatile g_1032[5] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; static volatile int32_t g_1053 = 4L;/* VOLATILE GLOBAL g_1053 */ static const int16_t g_1074 = (-9L); static union U0 *g_1080 = &g_130; static union U0 ** volatile g_1079 = &g_1080;/* VOLATILE GLOBAL g_1079 */ static uint32_t *g_1166 = &g_794; static uint32_t **g_1165 = &g_1166; static volatile uint8_t * volatile * const g_1183 = (void*)0; static int32_t * volatile g_1198 = (void*)0;/* VOLATILE GLOBAL g_1198 */ static int32_t * volatile g_1199 = &g_63;/* VOLATILE GLOBAL g_1199 */ static const union U0 *g_1206 = &g_130; static int32_t * volatile g_1207 = (void*)0;/* VOLATILE GLOBAL g_1207 */ static uint32_t g_1224 = 0x3DE503E5L; static uint16_t g_1247 = 4UL; static int8_t g_1257 = 0x37L; static int32_t * volatile g_1289 = (void*)0;/* VOLATILE GLOBAL g_1289 */ static int32_t g_1291 = 0xFD2CF0E2L; static uint8_t g_1300 = 0xAEL; static union U0 **g_1332 = &g_1080; static int64_t *g_1345 = (void*)0; static int64_t **g_1344 = &g_1345; static int32_t ***g_1379 = &g_143; static int32_t ****g_1378 = &g_1379; static int32_t ****g_1380 = &g_1379; static union U0 ** volatile g_1419 = &g_1080;/* VOLATILE GLOBAL g_1419 */ static volatile uint8_t * volatile * const *g_1441 = &g_1183; static volatile uint8_t * volatile * const ** volatile g_1440 = &g_1441;/* VOLATILE GLOBAL g_1440 */ static volatile uint32_t g_1518 = 18446744073709551615UL;/* VOLATILE GLOBAL g_1518 */ static uint32_t g_1522 = 0xFAFB62E7L; static volatile int8_t g_1619[9][8][1] = {{{0L},{0x06L},{0xA2L},{0x06L},{0L},{1L},{0xBAL},{0x1BL}},{{0L},{7L},{0xA2L},{7L},{0L},{0x1BL},{0xBAL},{1L}},{{0L},{0x06L},{0xA2L},{0x06L},{0L},{1L},{0xBAL},{0x1BL}},{{0L},{7L},{0xA2L},{7L},{0L},{0x1BL},{0xBAL},{1L}},{{0L},{0x06L},{0xA2L},{0x06L},{0L},{1L},{0xBAL},{0x1BL}},{{0L},{7L},{0xA2L},{7L},{0L},{0x1BL},{0xBAL},{1L}},{{0L},{0x06L},{0xA2L},{0x06L},{0L},{1L},{0xBAL},{0x1BL}},{{0L},{7L},{0xA2L},{7L},{0L},{0x1BL},{0xBAL},{1L}},{{0L},{0x06L},{0xA2L},{0x06L},{0L},{1L},{0xBAL},{0x1BL}}}; static uint8_t *g_1643 = &g_83; static uint8_t **g_1642[9][6][4] = {{{&g_1643,(void*)0,&g_1643,(void*)0},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,&g_1643,(void*)0},{&g_1643,&g_1643,&g_1643,&g_1643},{(void*)0,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,(void*)0,&g_1643}},{{(void*)0,&g_1643,&g_1643,&g_1643},{&g_1643,(void*)0,&g_1643,(void*)0},{&g_1643,(void*)0,(void*)0,&g_1643},{&g_1643,&g_1643,&g_1643,&g_1643},{&g_1643,(void*)0,&g_1643,&g_1643},{&g_1643,(void*)0,&g_1643,(void*)0}},{{&g_1643,&g_1643,(void*)0,(void*)0},{&g_1643,(void*)0,&g_1643,&g_1643},{&g_1643,(void*)0,&g_1643,&g_1643},{(void*)0,&g_1643,(void*)0,&g_1643},{&g_1643,(void*)0,&g_1643,(void*)0},{&g_1643,(void*)0,&g_1643,&g_1643}},{{&g_1643,&g_1643,&g_1643,&g_1643},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,&g_1643,&g_1643},{&g_1643,&g_1643,&g_1643,(void*)0},{&g_1643,&g_1643,&g_1643,&g_1643},{&g_1643,&g_1643,(void*)0,(void*)0}},{{(void*)0,(void*)0,&g_1643,&g_1643},{&g_1643,&g_1643,&g_1643,(void*)0},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,&g_1643,&g_1643}},{{(void*)0,(void*)0,&g_1643,(void*)0},{&g_1643,(void*)0,&g_1643,&g_1643},{(void*)0,&g_1643,&g_1643,&g_1643},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,&g_1643,(void*)0}},{{(void*)0,&g_1643,&g_1643,&g_1643},{&g_1643,&g_1643,&g_1643,&g_1643},{(void*)0,&g_1643,&g_1643,(void*)0},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,(void*)0,&g_1643,&g_1643}},{{&g_1643,&g_1643,&g_1643,&g_1643},{&g_1643,&g_1643,&g_1643,(void*)0},{&g_1643,&g_1643,&g_1643,&g_1643},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,(void*)0,(void*)0},{&g_1643,&g_1643,(void*)0,&g_1643}},{{&g_1643,&g_1643,&g_1643,&g_1643},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,&g_1643,(void*)0,&g_1643},{&g_1643,(void*)0,(void*)0,(void*)0},{&g_1643,(void*)0,&g_1643,&g_1643},{&g_1643,&g_1643,&g_1643,&g_1643}}}; static uint8_t ***g_1641[5][9][3] = {{{&g_1642[0][0][0],(void*)0,(void*)0},{&g_1642[4][4][1],&g_1642[4][4][1],&g_1642[4][4][1]},{&g_1642[3][5][2],&g_1642[4][4][1],&g_1642[4][4][1]},{&g_1642[3][5][2],&g_1642[4][4][1],&g_1642[0][0][0]},{&g_1642[4][4][1],&g_1642[4][4][1],&g_1642[4][4][1]},{&g_1642[0][0][0],&g_1642[4][4][1],&g_1642[4][4][1]},{(void*)0,&g_1642[4][4][1],&g_1642[4][4][1]},{&g_1642[2][3][3],(void*)0,&g_1642[4][1][0]},{(void*)0,&g_1642[3][5][2],&g_1642[4][4][1]}},{{&g_1642[5][2][2],&g_1642[4][4][1],&g_1642[4][4][1]},{&g_1642[4][4][1],(void*)0,&g_1642[4][4][1]},{&g_1642[7][0][0],&g_1642[7][0][3],&g_1642[4][4][1]},{(void*)0,&g_1642[4][4][1],(void*)0},{&g_1642[4][4][1],&g_1642[4][4][1],&g_1642[4][4][1]},{&g_1642[4][4][1],&g_1642[4][4][1],&g_1642[4][4][1]},{&g_1642[7][3][0],&g_1642[7][0][3],&g_1642[4][4][1]},{&g_1642[3][2][3],(void*)0,&g_1642[4][4][1]},{&g_1642[0][4][1],&g_1642[4][4][1],&g_1642[3][3][1]}},{{&g_1642[4][4][1],&g_1642[3][5][2],&g_1642[0][0][0]},{(void*)0,(void*)0,(void*)0},{(void*)0,&g_1642[4][4][1],&g_1642[4][1][0]},{&g_1642[4][4][0],&g_1642[4][4][1],(void*)0},{(void*)0,&g_1642[4][4][1],(void*)0},{(void*)0,&g_1642[4][4][1],&g_1642[4][4][1]},{&g_1642[7][0][0],&g_1642[4][4][1],&g_1642[4][4][1]},{(void*)0,&g_1642[4][4][1],(void*)0},{&g_1642[4][4][1],(void*)0,(void*)0}},{{&g_1642[0][4][1],&g_1642[4][4][1],&g_1642[4][4][1]},{(void*)0,&g_1642[4][4][1],(void*)0},{(void*)0,&g_1642[4][4][1],&g_1642[4][4][1]},{&g_1642[4][4][1],(void*)0,&g_1642[6][1][0]},{&g_1642[3][3][1],(void*)0,&g_1642[3][3][1]},{(void*)0,&g_1642[4][4][1],(void*)0},{&g_1642[0][0][0],&g_1642[4][4][1],&g_1642[3][2][3]},{&g_1642[4][4][1],(void*)0,&g_1642[7][0][0]},{&g_1642[4][4][1],(void*)0,&g_1642[4][4][1]}},{{&g_1642[4][4][1],(void*)0,&g_1642[4][1][0]},{&g_1642[0][0][0],&g_1642[4][4][0],(void*)0},{(void*)0,&g_1642[4][4][1],&g_1642[5][2][2]},{&g_1642[3][3][1],&g_1642[3][2][3],&g_1642[7][0][0]},{&g_1642[4][4][1],&g_1642[4][4][1],&g_1642[4][4][1]},{(void*)0,(void*)0,(void*)0},{(void*)0,&g_1642[4][4][1],&g_1642[7][0][3]},{&g_1642[4][4][1],&g_1642[7][0][2],&g_1642[4][4][0]},{&g_1642[3][3][1],(void*)0,&g_1642[4][4][1]}}}; static uint8_t ****g_1640 = &g_1641[4][4][0]; static volatile uint32_t *g_1656 = &g_1518; static volatile uint32_t **g_1655 = &g_1656; static volatile uint32_t ** volatile *g_1654 = &g_1655; static volatile uint32_t ** volatile * volatile *g_1653[9][5][4] = {{{&g_1654,&g_1654,(void*)0,&g_1654},{&g_1654,&g_1654,&g_1654,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{&g_1654,&g_1654,(void*)0,&g_1654},{&g_1654,(void*)0,&g_1654,&g_1654}},{{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,(void*)0,(void*)0,&g_1654},{&g_1654,&g_1654,&g_1654,(void*)0},{(void*)0,(void*)0,&g_1654,(void*)0},{&g_1654,&g_1654,&g_1654,&g_1654}},{{&g_1654,&g_1654,&g_1654,(void*)0},{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,(void*)0,(void*)0}},{{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,&g_1654,(void*)0},{&g_1654,&g_1654,(void*)0,&g_1654},{&g_1654,&g_1654,&g_1654,(void*)0},{&g_1654,(void*)0,&g_1654,(void*)0}},{{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,&g_1654,&g_1654},{(void*)0,(void*)0,&g_1654,&g_1654}},{{&g_1654,&g_1654,(void*)0,&g_1654},{&g_1654,&g_1654,&g_1654,(void*)0},{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,(void*)0,&g_1654},{&g_1654,(void*)0,(void*)0,&g_1654}},{{(void*)0,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,(void*)0,&g_1654},{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,&g_1654,(void*)0},{&g_1654,(void*)0,&g_1654,&g_1654}},{{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,&g_1654,&g_1654},{&g_1654,&g_1654,(void*)0,&g_1654},{&g_1654,&g_1654,&g_1654,(void*)0},{&g_1654,&g_1654,&g_1654,&g_1654}},{{&g_1654,(void*)0,&g_1654,(void*)0},{(void*)0,&g_1654,(void*)0,&g_1654},{(void*)0,&g_1654,&g_1654,&g_1654},{&g_1654,(void*)0,&g_1654,&g_1654},{&g_1654,&g_1654,&g_1654,&g_1654}}}; static volatile int32_t g_1703 = 0xD5CA555DL;/* VOLATILE GLOBAL g_1703 */ static uint64_t * volatile *g_1822 = &g_318; static uint64_t * volatile **g_1821 = &g_1822; static uint64_t * volatile ** const *g_1820 = &g_1821; static union U0 ** volatile g_1850 = (void*)0;/* VOLATILE GLOBAL g_1850 */ static const uint32_t *g_1860 = &g_794; static const uint32_t **g_1859 = &g_1860; static const volatile uint16_t *g_1901 = &g_86[5]; static const volatile uint16_t * volatile *g_1900 = &g_1901; static const volatile uint16_t * volatile **g_1899 = &g_1900; static uint64_t *****g_2026 = (void*)0; static uint64_t g_2165 = 1UL; static uint64_t * const g_2164 = &g_2165; static uint64_t * const *g_2163[9][7][4] = {{{(void*)0,&g_2164,&g_2164,(void*)0},{&g_2164,&g_2164,&g_2164,&g_2164},{(void*)0,(void*)0,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,(void*)0,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164}},{{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,(void*)0,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{(void*)0,&g_2164,&g_2164,&g_2164}},{{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,(void*)0,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,(void*)0},{(void*)0,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,(void*)0,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164}},{{&g_2164,&g_2164,&g_2164,&g_2164},{(void*)0,&g_2164,(void*)0,(void*)0},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,(void*)0,(void*)0,(void*)0},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,(void*)0,&g_2164},{&g_2164,&g_2164,&g_2164,(void*)0}},{{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,(void*)0,&g_2164},{&g_2164,(void*)0,&g_2164,(void*)0},{&g_2164,(void*)0,&g_2164,&g_2164},{(void*)0,&g_2164,&g_2164,&g_2164},{(void*)0,&g_2164,&g_2164,&g_2164},{(void*)0,&g_2164,&g_2164,&g_2164}},{{(void*)0,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{(void*)0,&g_2164,&g_2164,&g_2164},{&g_2164,(void*)0,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164}},{{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,(void*)0,&g_2164,&g_2164},{&g_2164,(void*)0,&g_2164,&g_2164},{(void*)0,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,(void*)0},{&g_2164,(void*)0,(void*)0,&g_2164},{&g_2164,(void*)0,(void*)0,(void*)0}},{{&g_2164,&g_2164,&g_2164,(void*)0},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,(void*)0,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164}},{{&g_2164,&g_2164,&g_2164,(void*)0},{&g_2164,(void*)0,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,(void*)0,&g_2164,(void*)0},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164},{&g_2164,&g_2164,&g_2164,&g_2164}}}; static uint64_t * const **g_2162 = &g_2163[4][0][1]; static uint64_t * const ***g_2161 = &g_2162; static uint64_t * const ****g_2160[7] = {&g_2161,&g_2161,&g_2161,&g_2161,&g_2161,&g_2161,&g_2161}; static const int32_t *g_2202 = (void*)0; static const int32_t ** const volatile g_2201 = &g_2202;/* VOLATILE GLOBAL g_2201 */ static int64_t g_2252 = 0x006B9A275D891B15LL; static uint32_t ** volatile * volatile g_2341 = &g_1165;/* VOLATILE GLOBAL g_2341 */ static const volatile uint8_t g_2356 = 0xB4L;/* VOLATILE GLOBAL g_2356 */ static int8_t **g_2369 = &g_451; static int8_t ***g_2368 = &g_2369; static int8_t **** volatile g_2367 = &g_2368;/* VOLATILE GLOBAL g_2367 */ static int32_t g_2373 = 0x09103576L; static volatile int64_t g_2407[6] = {6L,(-6L),(-6L),6L,(-6L),(-6L)}; static int64_t ***g_2445 = (void*)0; static int64_t ****g_2444 = &g_2445; static int64_t g_2562 = (-7L); static uint64_t ****g_2599 = (void*)0; static uint64_t ***g_2601 = &g_317; static uint64_t ****g_2600 = &g_2601; static uint8_t g_2730 = 0x47L; static uint64_t g_2764[6][5][5] = {{{0UL,1UL,18446744073709551615UL,1UL,1UL},{0x5E70141EF85F04FDLL,0UL,0xBE8B0B73074AAC6ELL,18446744073709551614UL,0UL},{1UL,0UL,18446744073709551615UL,18446744073709551615UL,0UL},{0x5E70141EF85F04FDLL,0xE779E2196E44C7DCLL,18446744073709551610UL,18446744073709551614UL,0xE779E2196E44C7DCLL},{0UL,0UL,0UL,1UL,0UL}},{{0x3E2F7EDDB55E725CLL,0UL,18446744073709551610UL,18446744073709551610UL,0UL},{0UL,1UL,18446744073709551615UL,1UL,1UL},{0x5E70141EF85F04FDLL,0UL,0xBE8B0B73074AAC6ELL,18446744073709551614UL,0UL},{1UL,0UL,18446744073709551615UL,18446744073709551615UL,0UL},{0x5E70141EF85F04FDLL,0xE779E2196E44C7DCLL,18446744073709551610UL,18446744073709551614UL,0xE779E2196E44C7DCLL}},{{0UL,0UL,0UL,1UL,0UL},{0x3E2F7EDDB55E725CLL,0UL,18446744073709551610UL,18446744073709551610UL,0UL},{0UL,1UL,18446744073709551615UL,1UL,1UL},{0x5E70141EF85F04FDLL,0UL,0xBE8B0B73074AAC6ELL,18446744073709551614UL,0UL},{1UL,0UL,18446744073709551615UL,18446744073709551615UL,0UL}},{{18446744073709551615UL,0x718C5A2EF1F4B5F4LL,0x20E374B52499D8FBLL,0xE779E2196E44C7DCLL,0x718C5A2EF1F4B5F4LL},{0x98C1F280EE186638LL,18446744073709551611UL,0UL,1UL,18446744073709551611UL},{18446744073709551613UL,0x8B2CE8B895E1AE21LL,0x20E374B52499D8FBLL,0x20E374B52499D8FBLL,0x8B2CE8B895E1AE21LL},{0x98C1F280EE186638LL,0x9CAAF6605ACDB2F6LL,0x0962232F3820E806LL,1UL,0x9CAAF6605ACDB2F6LL},{18446744073709551615UL,0x8B2CE8B895E1AE21LL,0UL,0xE779E2196E44C7DCLL,0x8B2CE8B895E1AE21LL}},{{5UL,18446744073709551611UL,0x0962232F3820E806LL,0x0962232F3820E806LL,18446744073709551611UL},{18446744073709551615UL,0x718C5A2EF1F4B5F4LL,0x20E374B52499D8FBLL,0xE779E2196E44C7DCLL,0x718C5A2EF1F4B5F4LL},{0x98C1F280EE186638LL,18446744073709551611UL,0UL,1UL,18446744073709551611UL},{18446744073709551613UL,0x8B2CE8B895E1AE21LL,0x20E374B52499D8FBLL,0x20E374B52499D8FBLL,0x8B2CE8B895E1AE21LL},{0x98C1F280EE186638LL,0x9CAAF6605ACDB2F6LL,0x0962232F3820E806LL,1UL,0x9CAAF6605ACDB2F6LL}},{{18446744073709551615UL,0x8B2CE8B895E1AE21LL,0UL,0xE779E2196E44C7DCLL,0x8B2CE8B895E1AE21LL},{5UL,18446744073709551611UL,0x0962232F3820E806LL,0x0962232F3820E806LL,18446744073709551611UL},{18446744073709551615UL,0x718C5A2EF1F4B5F4LL,0x20E374B52499D8FBLL,0xE779E2196E44C7DCLL,0x718C5A2EF1F4B5F4LL},{0x98C1F280EE186638LL,18446744073709551611UL,0UL,1UL,18446744073709551611UL},{18446744073709551613UL,0x8B2CE8B895E1AE21LL,0x20E374B52499D8FBLL,0x20E374B52499D8FBLL,0x8B2CE8B895E1AE21LL}}}; static uint64_t g_2794 = 4UL; static volatile int8_t * volatile *g_2803 = &g_1024; static const volatile int64_t g_2830 = 0xC9222DBF207C322CLL;/* VOLATILE GLOBAL g_2830 */ static volatile union U0 g_2860 = {0xA5FE2FC5L};/* VOLATILE GLOBAL g_2860 */ static uint32_t g_2963[8][7] = {{2UL,0x166D58E5L,0x59061369L,0x07BB553EL,0x59061369L,0x166D58E5L,2UL},{0x166D58E5L,0x3AA7BC1DL,0xC5D4CBC0L,0xE1B65B1CL,18446744073709551614UL,0x59061369L,18446744073709551614UL},{0x166D58E5L,18446744073709551614UL,18446744073709551614UL,0x166D58E5L,18446744073709551613UL,9UL,0x07BB553EL},{2UL,9UL,0xC5D4CBC0L,18446744073709551613UL,18446744073709551613UL,0xC5D4CBC0L,9UL},{18446744073709551613UL,2UL,0x59061369L,0x3AA7BC1DL,18446744073709551614UL,0x07BB553EL,0x07BB553EL},{0x59061369L,2UL,18446744073709551613UL,2UL,0x59061369L,0x3AA7BC1DL,18446744073709551614UL},{0xC5D4CBC0L,9UL,2UL,0x3AA7BC1DL,0xE1B65B1CL,0x3AA7BC1DL,2UL},{18446744073709551614UL,18446744073709551614UL,0x166D58E5L,18446744073709551613UL,9UL,0x07BB553EL,0xC5D4CBC0L}}; static union U0 ** volatile g_2966 = (void*)0;/* VOLATILE GLOBAL g_2966 */ static volatile uint32_t g_2969 = 0x00B6D233L;/* VOLATILE GLOBAL g_2969 */ static int16_t *g_3020 = (void*)0; static int16_t **g_3019 = &g_3020; static int32_t ** volatile g_3024 = (void*)0;/* VOLATILE GLOBAL g_3024 */ static int32_t ** volatile g_3025 = &g_62;/* VOLATILE GLOBAL g_3025 */ static int16_t g_3083 = 0x23A0L; static const uint16_t *g_3174 = &g_13[2][0]; static const uint16_t **g_3173 = &g_3174; static const uint16_t *** volatile g_3172 = &g_3173;/* VOLATILE GLOBAL g_3172 */ static int32_t *g_3284[7][1][6] = {{{&g_711,&g_711,&g_711,&g_711,&g_711,&g_711}},{{&g_711,&g_711,&g_711,&g_711,&g_711,&g_711}},{{&g_711,&g_711,&g_711,&g_711,&g_711,&g_711}},{{&g_711,&g_711,&g_711,&g_711,&g_711,&g_711}},{{&g_711,&g_711,&g_711,&g_711,&g_711,&g_711}},{{&g_711,&g_711,&g_711,&g_711,&g_711,&g_711}},{{&g_711,&g_711,&g_711,&g_711,&g_711,&g_711}}}; static volatile int64_t g_3316[1][6] = {{0x2CEA4543D93CC10ALL,0x2CEA4543D93CC10ALL,0x2CEA4543D93CC10ALL,0x2CEA4543D93CC10ALL,0x2CEA4543D93CC10ALL,0x2CEA4543D93CC10ALL}}; static int8_t g_3381[6] = {0x6AL,0x6AL,0x6AL,0x6AL,0x6AL,0x6AL}; static uint32_t ***g_3387 = &g_1165; static uint32_t ****g_3386[6][10][1] = {{{&g_3387},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{(void*)0},{&g_3387}},{{&g_3387},{&g_3387},{(void*)0},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{(void*)0},{&g_3387}},{{&g_3387},{&g_3387},{(void*)0},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{(void*)0},{&g_3387}},{{&g_3387},{&g_3387},{(void*)0},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{(void*)0},{&g_3387}},{{&g_3387},{&g_3387},{(void*)0},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{(void*)0},{&g_3387}},{{&g_3387},{&g_3387},{(void*)0},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{&g_3387},{(void*)0},{&g_3387}}}; static uint32_t *****g_3385 = &g_3386[5][2][0]; static uint32_t *****g_3388 = &g_3386[5][2][0]; static int32_t ** volatile g_3443 = &g_236;/* VOLATILE GLOBAL g_3443 */ static int32_t g_3448 = 3L; static int16_t g_3449 = (-1L); static int32_t ** const *g_3451 = &g_707; static int32_t ** const **g_3450 = &g_3451; static uint64_t g_3593 = 0UL; static uint64_t ** const **g_3611 = (void*)0; static uint64_t ** const ***g_3610 = &g_3611; static int64_t g_3612[3] = {1L,1L,1L}; static int16_t *** volatile g_3625 = &g_3019;/* VOLATILE GLOBAL g_3625 */ static uint32_t g_3627 = 0UL; static uint8_t g_3635[2] = {252UL,252UL}; static int64_t g_3784 = 5L; static uint8_t ***** volatile g_3805[1] = {&g_1640}; static uint8_t ***** volatile g_3806 = (void*)0;/* VOLATILE GLOBAL g_3806 */ static uint8_t ***** volatile g_3807[9] = {&g_1640,&g_1640,&g_1640,&g_1640,&g_1640,&g_1640,&g_1640,&g_1640,&g_1640}; static uint8_t ***** volatile g_3808[9] = {&g_1640,&g_1640,&g_1640,&g_1640,&g_1640,&g_1640,&g_1640,&g_1640,&g_1640}; static volatile int32_t g_3854 = 3L;/* VOLATILE GLOBAL g_3854 */ static int8_t ****g_3856 = &g_2368; static int8_t *****g_3855 = &g_3856; static int8_t g_3866 = 0L; static union U0 *g_3973 = &g_130; static uint16_t **g_3984 = &g_398; static uint16_t ***g_3983 = &g_3984; static volatile uint64_t g_4013 = 0xA3187110E6B6CD33LL;/* VOLATILE GLOBAL g_4013 */ static int32_t g_4044 = 0x19EFCC72L; static int8_t g_4053 = 0x95L; static uint16_t g_4093 = 0x14DCL; static const int32_t *g_4191[9][9][1] = {{{(void*)0},{(void*)0},{&g_1291},{(void*)0},{(void*)0},{&g_2373},{&g_63},{&g_2373},{(void*)0}},{{(void*)0},{&g_1291},{(void*)0},{(void*)0},{&g_1291},{&g_63},{&g_1291},{(void*)0},{(void*)0}},{{&g_1291},{(void*)0},{(void*)0},{&g_2373},{&g_63},{&g_2373},{(void*)0},{(void*)0},{&g_1291}},{{(void*)0},{(void*)0},{&g_1291},{&g_63},{&g_1291},{(void*)0},{(void*)0},{&g_1291},{(void*)0}},{{(void*)0},{&g_2373},{&g_63},{&g_2373},{(void*)0},{(void*)0},{&g_1291},{(void*)0},{(void*)0}},{{&g_1291},{&g_63},{&g_1291},{(void*)0},{(void*)0},{&g_1291},{(void*)0},{(void*)0},{&g_2373}},{{&g_63},{&g_2373},{(void*)0},{(void*)0},{&g_1291},{(void*)0},{(void*)0},{&g_1291},{&g_63}},{{&g_1291},{(void*)0},{(void*)0},{&g_1291},{(void*)0},{(void*)0},{&g_2373},{&g_63},{&g_2373}},{{(void*)0},{(void*)0},{&g_1291},{(void*)0},{(void*)0},{&g_1291},{&g_63},{&g_1291},{(void*)0}}}; static const int32_t ** volatile g_4190 = &g_4191[8][6][0];/* VOLATILE GLOBAL g_4190 */ /* --- FORWARD DECLARATIONS --- */ static int32_t func_1(void); static int32_t func_2(uint8_t p_3, uint64_t p_4, uint64_t p_5, const uint32_t p_6); static const uint8_t func_21(union U0 p_22, const uint16_t * p_23, const int32_t p_24, int32_t p_25, union U0 p_26); static union U0 func_27(int8_t p_28, int16_t * p_29, int16_t * p_30); static uint16_t func_35(int32_t p_36); static int32_t * func_37(int16_t * p_38, int32_t * p_39, int16_t * p_40, int32_t p_41); static int32_t * func_43(union U0 p_44, uint16_t * p_45, uint32_t p_46, int32_t p_47, int32_t p_48); static uint16_t * func_50(int32_t * p_51); static uint64_t * func_70(uint8_t p_71, int32_t * p_72, uint32_t p_73); static int32_t * func_77(uint8_t p_78, int16_t * p_79, uint8_t p_80, int32_t p_81); /* --- FUNCTIONS --- */ /* ------------------------------------------ */ /* * reads : g_3450 g_3451 g_707 g_236 g_63 * writes: */ static int32_t func_1(void) { /* block id: 0 */ int32_t l_7[4][4] = {{0xA11C1574L,0xA11C1574L,1L,0xA11C1574L},{0xA11C1574L,0x2E31D832L,0x2E31D832L,0xA11C1574L},{0x2E31D832L,0xA11C1574L,0x2E31D832L,0x2E31D832L},{0xA11C1574L,0xA11C1574L,1L,0xA11C1574L}}; uint16_t *l_11 = (void*)0; uint16_t *l_12 = &g_13[2][2]; int16_t *l_14[4][4][1]; int32_t l_15 = (-1L); int32_t l_16 = 0x189F42C6L; union U0 *l_1896 = &g_130; uint64_t l_1897[2]; union U0 l_1898[6] = {{0xCEB33353L},{0xCEB33353L},{0xCEB33353L},{0xCEB33353L},{0xCEB33353L},{0xCEB33353L}}; int32_t *l_2372[6][8][3] = {{{&g_2373,(void*)0,(void*)0},{&g_2373,(void*)0,&g_2373},{&g_2373,(void*)0,(void*)0},{&g_2373,&g_2373,(void*)0},{(void*)0,&g_2373,&g_2373},{&g_2373,&g_2373,&g_2373},{(void*)0,(void*)0,(void*)0},{&g_2373,(void*)0,&g_2373}},{{(void*)0,&g_2373,(void*)0},{(void*)0,&g_2373,&g_2373},{&g_2373,&g_2373,&g_2373},{(void*)0,(void*)0,(void*)0},{&g_2373,(void*)0,&g_2373},{(void*)0,&g_2373,(void*)0},{(void*)0,&g_2373,&g_2373},{&g_2373,&g_2373,&g_2373}},{{(void*)0,(void*)0,(void*)0},{&g_2373,(void*)0,&g_2373},{(void*)0,&g_2373,(void*)0},{(void*)0,&g_2373,&g_2373},{&g_2373,&g_2373,&g_2373},{(void*)0,(void*)0,(void*)0},{&g_2373,(void*)0,&g_2373},{(void*)0,&g_2373,(void*)0}},{{(void*)0,&g_2373,&g_2373},{&g_2373,&g_2373,&g_2373},{(void*)0,(void*)0,(void*)0},{&g_2373,(void*)0,&g_2373},{(void*)0,&g_2373,(void*)0},{(void*)0,&g_2373,&g_2373},{&g_2373,&g_2373,&g_2373},{(void*)0,(void*)0,(void*)0}},{{&g_2373,(void*)0,&g_2373},{(void*)0,&g_2373,(void*)0},{(void*)0,&g_2373,&g_2373},{&g_2373,&g_2373,&g_2373},{(void*)0,(void*)0,(void*)0},{&g_2373,(void*)0,&g_2373},{(void*)0,&g_2373,(void*)0},{(void*)0,&g_2373,&g_2373}},{{&g_2373,&g_2373,&g_2373},{(void*)0,(void*)0,(void*)0},{&g_2373,(void*)0,&g_2373},{(void*)0,&g_2373,(void*)0},{(void*)0,&g_2373,&g_2373},{&g_2373,&g_2373,&g_2373},{(void*)0,(void*)0,(void*)0},{&g_2373,(void*)0,&g_2373}}}; uint32_t l_2389 = 0x3BFC38B6L; uint32_t *l_2391 = &g_134[3]; uint16_t l_2392[9][5][5] = {{{0x6D72L,65527UL,0x41F5L,0x41F5L,65527UL},{0xFEE6L,0x7161L,0x9E12L,1UL,8UL},{0x566EL,1UL,0x566EL,0x41F5L,65527UL},{0x903DL,0x846EL,8UL,0x846EL,0x903DL},{0x566EL,0x6D72L,1UL,65527UL,1UL}},{{0xFEE6L,0UL,8UL,0x0104L,0UL},{0x6D72L,0x566EL,0x566EL,0x6D72L,1UL},{1UL,0x0104L,0x9E12L,0x674DL,0x903DL},{1UL,0x566EL,0x41F5L,65527UL,65527UL},{65530UL,0UL,65530UL,0x674DL,8UL}},{{65527UL,0x6D72L,65527UL,0x6D72L,65527UL},{65530UL,0x7161L,0UL,0x674DL,0UL},{65535UL,65535UL,1UL,0x41F5L,0x6D72L},{65530UL,0x0104L,0x903DL,0x7161L,0UL},{0x566EL,0x41F5L,65527UL,65527UL,0x41F5L}},{{0UL,0x0104L,8UL,0UL,0xFEE6L},{65527UL,65535UL,65527UL,65527UL,1UL},{0x9E12L,0x7161L,0xFEE6L,0x7161L,0x9E12L},{65527UL,0x566EL,65535UL,0x41F5L,65535UL},{0UL,0x5ACFL,0xFEE6L,0x674DL,1UL}},{{0x566EL,65527UL,65527UL,0x566EL,65535UL},{65530UL,0x674DL,8UL,1UL,0x9E12L},{65535UL,65527UL,65527UL,1UL,1UL},{0x903DL,0x5ACFL,0x903DL,1UL,0xFEE6L},{0x41F5L,0x566EL,1UL,0x566EL,0x41F5L}},{{0x903DL,0x7161L,0UL,0x674DL,0UL},{65535UL,65535UL,1UL,0x41F5L,0x6D72L},{65530UL,0x0104L,0x903DL,0x7161L,0UL},{0x566EL,0x41F5L,65527UL,65527UL,0x41F5L},{0UL,0x0104L,8UL,0UL,0xFEE6L}},{{65527UL,65535UL,65527UL,65527UL,1UL},{0x9E12L,0x7161L,0xFEE6L,0x7161L,0x9E12L},{65527UL,0x566EL,65535UL,0x41F5L,65535UL},{0UL,0x5ACFL,0xFEE6L,0x674DL,1UL},{0x566EL,65527UL,65527UL,0x566EL,65535UL}},{{65530UL,0x674DL,8UL,1UL,0x9E12L},{65535UL,65527UL,65527UL,1UL,1UL},{0x903DL,0x5ACFL,0x903DL,1UL,0xFEE6L},{0x41F5L,0x566EL,1UL,0x566EL,0x41F5L},{0x903DL,0x7161L,0UL,0x674DL,0UL}},{{65535UL,65535UL,1UL,0x41F5L,0x6D72L},{65530UL,0x0104L,0x903DL,0x7161L,0UL},{0x566EL,0x41F5L,65527UL,65527UL,0x41F5L},{0UL,0x0104L,8UL,0UL,0xFEE6L},{65527UL,65535UL,65527UL,65527UL,1UL}}}; uint32_t l_2393 = 0xEEC245D8L; int8_t l_2394 = 0x28L; uint64_t ***l_2403 = &g_317; uint64_t ****l_2402[4][3][6] = {{{&l_2403,&l_2403,&l_2403,&l_2403,&l_2403,(void*)0},{&l_2403,&l_2403,(void*)0,&l_2403,(void*)0,&l_2403},{&l_2403,&l_2403,&l_2403,&l_2403,&l_2403,&l_2403}},{{(void*)0,(void*)0,(void*)0,&l_2403,&l_2403,(void*)0},{&l_2403,(void*)0,&l_2403,(void*)0,&l_2403,&l_2403},{&l_2403,&l_2403,(void*)0,(void*)0,(void*)0,&l_2403}},{{&l_2403,&l_2403,&l_2403,&l_2403,&l_2403,&l_2403},{(void*)0,&l_2403,(void*)0,&l_2403,&l_2403,&l_2403},{&l_2403,&l_2403,&l_2403,&l_2403,&l_2403,(void*)0}},{{&l_2403,&l_2403,(void*)0,&l_2403,(void*)0,&l_2403},{&l_2403,&l_2403,&l_2403,&l_2403,&l_2403,&l_2403},{(void*)0,(void*)0,(void*)0,&l_2403,&l_2403,(void*)0}}}; int32_t l_2408 = 1L; int8_t l_2410 = 1L; uint8_t **l_2422 = &g_1643; const int64_t l_2457 = 0x1829AB1F02715E0BLL; uint32_t l_2525[7] = {0xF85D5714L,0x2A164DE1L,0x2A164DE1L,0xF85D5714L,0x2A164DE1L,0x2A164DE1L,0xF85D5714L}; int16_t l_2526 = 0x31D2L; uint16_t ***l_2549 = (void*)0; int8_t l_2551 = 0L; int16_t l_2561 = (-1L); uint8_t ***l_2575 = (void*)0; int32_t ** const *l_2624 = &g_707; int64_t *l_2649 = &g_239[0][0][1]; uint32_t l_2651[7]; uint32_t ***l_2678 = &g_1165; uint32_t ****l_2677 = &l_2678; uint8_t l_2724[9] = {0xF6L,0xF6L,0xF6L,0xF6L,0xF6L,0xF6L,0xF6L,0xF6L,0xF6L}; int8_t l_2731 = 0L; uint8_t l_2835 = 0x73L; int32_t l_2845[3]; int8_t **l_2942 = &g_451; int32_t l_2961 = 0x1501D439L; int32_t ****l_2983 = (void*)0; uint32_t l_3120 = 0x87D8A516L; uint32_t l_3121[7][6][1] = {{{4UL},{5UL},{0UL},{1UL},{0UL},{5UL}},{{4UL},{0UL},{5UL},{7UL},{0x9F897886L},{0UL}},{{18446744073709551608UL},{0UL},{0UL},{18446744073709551608UL},{0UL},{0x9F897886L}},{{7UL},{5UL},{0UL},{4UL},{5UL},{0UL}},{{1UL},{0UL},{5UL},{4UL},{0UL},{5UL}},{{7UL},{0x9F897886L},{0UL},{18446744073709551608UL},{0UL},{0UL}},{{18446744073709551608UL},{0UL},{0x9F897886L},{7UL},{5UL},{0UL}}}; int16_t l_3146 = 0x1895L; uint32_t l_3197 = 0UL; int16_t l_3200 = 0x291CL; int16_t l_3221 = 0xAB47L; uint16_t l_3256 = 1UL; int32_t l_3319 = 0x5A80AA6CL; int64_t l_3320 = 0x9FFFFA48BAD59446LL; int16_t l_3321 = 4L; int64_t ** const *l_3379 = (void*)0; int8_t l_3396 = 0xD5L; uint16_t l_3397 = 0x2FAAL; int8_t l_3574 = 6L; uint16_t l_3575 = 0x4A0AL; uint32_t l_3613 = 0UL; uint8_t l_3622 = 0UL; uint8_t *l_3758 = &g_83; int8_t ****l_3829 = &g_2368; int8_t *****l_3828 = &l_3829; uint16_t l_3857 = 0x3B9EL; int16_t l_3862[1][10] = {{0x5599L,0x4099L,0x5599L,0x5599L,0x4099L,0x5599L,0x5599L,0x4099L,0x5599L,0x5599L}}; int16_t l_3863 = 1L; int16_t l_3867[4]; uint16_t l_3868 = 1UL; const uint64_t l_3869 = 1UL; uint16_t l_3870[7][2] = {{0x76FEL,0x4BB9L},{0x76FEL,0x4BB9L},{0x76FEL,0x4BB9L},{0x76FEL,0x4BB9L},{0x76FEL,0x4BB9L},{0x76FEL,0x4BB9L},{0x76FEL,0x4BB9L}}; uint32_t l_3871 = 0xF7F4F075L; uint32_t l_3883 = 0x91EBC51FL; uint32_t l_3899 = 0x1AA1FAE7L; uint32_t l_3901 = 18446744073709551612UL; int64_t l_3906 = 0L; int32_t l_3961 = 0xD4D07A41L; uint16_t l_3976 = 1UL; uint8_t l_3993 = 0xE4L; int16_t l_4012 = 0x00FDL; int32_t l_4074 = 0xBD61EB32L; uint8_t l_4101 = 0x40L; uint8_t l_4135 = 1UL; uint32_t l_4166 = 4294967292UL; uint8_t l_4196 = 0x55L; int32_t l_4204 = 0x612E287BL; int i, j, k; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { for (k = 0; k < 1; k++) l_14[i][j][k] = (void*)0; } } for (i = 0; i < 2; i++) l_1897[i] = 18446744073709551615UL; for (i = 0; i < 7; i++) l_2651[i] = 0UL; for (i = 0; i < 3; i++) l_2845[i] = (-8L); for (i = 0; i < 4; i++) l_3867[i] = (-8L); return (****g_3450); } /* ------------------------------------------ */ /* * reads : * writes: */ static int32_t func_2(uint8_t p_3, uint64_t p_4, uint64_t p_5, const uint32_t p_6) { /* block id: 1053 */ int32_t l_2371 = 0x629752A0L; return l_2371; } /* ------------------------------------------ */ /* * reads : g_1899 g_398 g_165 g_451 g_220 g_1300 g_137 g_1643 g_1522 g_1821 g_1822 g_318 g_828 g_452 g_707 g_236 g_1379 g_143 g_1165 g_1166 g_1703 g_59 g_83 g_1901 g_86 g_540 g_134 g_1247 g_1257 g_2201 g_239 g_502 g_1199 g_63 g_2252 g_2164 g_130.f0 g_2341 g_2367 * writes: g_1899 g_828 g_452 g_137 g_165 g_1257 g_83 g_59 g_1247 g_236 g_62 g_794 g_540 g_134 g_86 g_2160 g_1522 g_2202 g_526 g_2252 g_2165 g_239 g_2368 */ static const uint8_t func_21(union U0 p_22, const uint16_t * p_23, const int32_t p_24, int32_t p_25, union U0 p_26) { /* block id: 866 */ const volatile uint16_t * volatile ***l_1902 = &g_1899; int32_t l_1918 = 1L; int32_t l_1926 = 0x8130040CL; const union U0 *l_1950[5]; uint32_t l_1971[4][1]; uint16_t l_1976 = 1UL; int16_t *l_2007[5][2][8] = {{{&g_526,&g_526,&g_8,&g_526,&g_526,&g_526,&g_8,&g_526},{&g_526,(void*)0,&g_526,&g_526,&g_8,&g_526,&g_8,&g_526}},{{(void*)0,&g_526,&g_8,&g_526,(void*)0,&g_526,&g_8,&g_8},{&g_8,&g_526,(void*)0,&g_8,&g_8,&g_526,&g_526,&g_526}},{{&g_526,&g_8,(void*)0,&g_526,&g_526,(void*)0,&g_8,&g_526},{&g_8,&g_526,&g_8,&g_8,&g_526,&g_526,&g_8,(void*)0}},{{(void*)0,&g_8,&g_526,&g_526,&g_8,&g_526,&g_8,&g_526},{&g_8,&g_526,&g_8,&g_8,&g_8,&g_526,&g_526,&g_526}},{{&g_8,&g_8,&g_526,&g_526,&g_526,(void*)0,&g_8,&g_8},{&g_8,&g_8,&g_8,&g_8,&g_8,&g_8,(void*)0,&g_526}}}; uint64_t l_2009 = 18446744073709551613UL; uint16_t **l_2224[2][6][1] = {{{&g_398},{&g_398},{&g_398},{&g_398},{&g_398},{&g_398}},{{&g_398},{&g_398},{&g_398},{&g_398},{&g_398},{&g_398}}}; uint16_t ***l_2223 = &l_2224[0][0][0]; uint16_t l_2251 = 0x6DA6L; int16_t l_2263 = (-1L); int64_t *l_2300 = &g_239[0][0][1]; int32_t l_2302 = 0x1F3DB490L; int32_t l_2303 = (-3L); int32_t l_2304 = 7L; int32_t l_2305 = 0x3E6207B4L; int32_t l_2306 = 0xB928BA42L; int32_t l_2307 = 0x599E6D18L; uint8_t l_2311 = 0x5FL; int32_t ***l_2338 = &g_707; uint32_t l_2342 = 4294967290UL; int32_t **l_2343 = &g_236; uint16_t l_2355[7][9][4] = {{{65535UL,0x8648L,0xA97EL,65535UL},{0x6BECL,65535UL,0x116CL,0xE997L},{0xE997L,0x41B9L,4UL,4UL},{9UL,9UL,0xE997L,0x116CL},{0x65D6L,0xABB2L,65535UL,0xA97EL},{65535UL,0xE997L,65535UL,65535UL},{65532UL,0xE997L,0xA89FL,0xA97EL},{0xE997L,0xABB2L,0xF8D4L,0x116CL},{65535UL,9UL,0x1086L,4UL}},{{65535UL,0x41B9L,65535UL,0xE997L},{0x612DL,65535UL,0x8648L,65535UL},{0xADB8L,0x8648L,4UL,65535UL},{0xE997L,65530UL,4UL,0xA89FL},{0xADB8L,9UL,0x8648L,0xF8D4L},{0x612DL,0x35B6L,65535UL,0x1086L},{65535UL,0x1086L,0x1086L,65535UL},{65535UL,0xA97EL,0xF8D4L,0x8648L},{0xE997L,0x56F4L,0xA89FL,4UL}},{{65532UL,9UL,65535UL,4UL},{65535UL,0x56F4L,65535UL,0x8648L},{0x65D6L,0xA97EL,0xE997L,65535UL},{9UL,0x1086L,4UL,0x1086L},{0xE997L,0x35B6L,0x116CL,0xF8D4L},{0x6BECL,9UL,0xA97EL,0xA89FL},{65535UL,65530UL,65535UL,65535UL},{65535UL,0x8648L,0xA97EL,65535UL},{0x6BECL,65535UL,0x116CL,0xE997L}},{{0xE997L,0x41B9L,4UL,4UL},{9UL,9UL,0xE997L,0x116CL},{0x65D6L,0xABB2L,65535UL,0xA97EL},{65535UL,0xE997L,65535UL,65535UL},{65532UL,0xE997L,0xA89FL,0xA97EL},{0xE997L,0xABB2L,0xF8D4L,0x116CL},{65535UL,9UL,0x1086L,4UL},{65535UL,0x41B9L,65535UL,0xE997L},{0x612DL,65535UL,0x8648L,65535UL}},{{0xADB8L,0x8648L,4UL,65535UL},{0xE997L,65530UL,4UL,0xA89FL},{0xADB8L,9UL,0x8648L,0xF8D4L},{0x612DL,65535UL,4UL,65535UL},{4UL,65535UL,65535UL,4UL},{0xA97EL,0x612DL,65530UL,65535UL},{65535UL,0xADB8L,0xABB2L,0x35B6L},{0x8648L,0xE997L,0x65D6L,0x35B6L},{4UL,0xADB8L,4UL,65535UL}},{{0xA89FL,0x612DL,65535UL,4UL},{0xE997L,65535UL,0x41B9L,65535UL},{65535UL,65535UL,0x56F4L,65530UL},{0x1086L,0xE997L,0x612DL,0xABB2L},{0x116CL,65532UL,4UL,0x65D6L},{0x116CL,65535UL,0x612DL,4UL},{0x1086L,0x65D6L,0x56F4L,65535UL},{65535UL,9UL,0x41B9L,0x41B9L},{0xE997L,0xE997L,65535UL,0x56F4L}},{{0xA89FL,0x6BECL,4UL,0x612DL},{4UL,65535UL,0x65D6L,4UL},{0x8648L,65535UL,0xABB2L,0x612DL},{65535UL,0x6BECL,65530UL,0x56F4L},{0xA97EL,0xE997L,65535UL,0x41B9L},{4UL,9UL,4UL,65535UL},{0xF8D4L,0x65D6L,65535UL,4UL},{65535UL,65535UL,0x35B6L,0x65D6L},{65535UL,65532UL,0x35B6L,0xABB2L}}}; int8_t *l_2359 = &g_261; int16_t l_2360 = (-1L); int8_t **l_2366 = &l_2359; int8_t ***l_2365 = &l_2366; int i, j, k; for (i = 0; i < 5; i++) l_1950[i] = &g_312; for (i = 0; i < 4; i++) { for (j = 0; j < 1; j++) l_1971[i][j] = 0x62D8B141L; } lbl_2206: (*l_1902) = g_1899; for (g_828 = 3; (g_828 >= 0); g_828 -= 1) { /* block id: 870 */ int8_t l_1921 = (-9L); int64_t *l_1925 = (void*)0; int16_t l_1927 = 1L; uint32_t *l_1928 = &g_137[4]; int32_t l_1929 = (-1L); uint64_t l_1959 = 0x701BD2CFB3903AB4LL; int32_t l_1977[1]; int8_t l_2005 = 0x58L; int16_t *l_2006 = &g_526; int32_t *l_2008 = &l_1918; int64_t l_2079[4][6][4] = {{{0xE2CD5B9AADFED411LL,0x93538B87B6FF5786LL,0x1D26016E5DCA5B7FLL,0xB80EAEAAC79E06D3LL},{0x93538B87B6FF5786LL,(-4L),0x93538B87B6FF5786LL,0xC9F79E4B39C2D96ALL},{0xEA4F543A9B16E5D1LL,0x1D26016E5DCA5B7FLL,0L,0x5AEB5978FFC2FE0ELL},{0x27326B30262A889ELL,0xEA4F543A9B16E5D1LL,0xC9F79E4B39C2D96ALL,0x1D26016E5DCA5B7FLL},{0xB80EAEAAC79E06D3LL,(-1L),0xC9F79E4B39C2D96ALL,0x6BC84746BA864CC4LL},{0x27326B30262A889ELL,0L,0L,0x27326B30262A889ELL}},{{0xEA4F543A9B16E5D1LL,0xB80EAEAAC79E06D3LL,0x93538B87B6FF5786LL,0xABDC482A8E6F95D9LL},{0x93538B87B6FF5786LL,0xABDC482A8E6F95D9LL,0x1D26016E5DCA5B7FLL,(-1L)},{0xE2CD5B9AADFED411LL,0L,2L,(-1L)},{0x5AEB5978FFC2FE0ELL,0xABDC482A8E6F95D9LL,0xE2CD5B9AADFED411LL,0xABDC482A8E6F95D9LL},{0L,0xB80EAEAAC79E06D3LL,(-4L),0x27326B30262A889ELL},{0x1D26016E5DCA5B7FLL,0L,0x5AEB5978FFC2FE0ELL,0x6BC84746BA864CC4LL}},{{0L,(-1L),0x6BC84746BA864CC4LL,0x1D26016E5DCA5B7FLL},{0L,0xEA4F543A9B16E5D1LL,0x5AEB5978FFC2FE0ELL,0x5AEB5978FFC2FE0ELL},{0x1D26016E5DCA5B7FLL,0x1D26016E5DCA5B7FLL,(-4L),0xC9F79E4B39C2D96ALL},{0L,(-4L),0xE2CD5B9AADFED411LL,0xB80EAEAAC79E06D3LL},{0x5AEB5978FFC2FE0ELL,0x93538B87B6FF5786LL,2L,0xE2CD5B9AADFED411LL},{0xE2CD5B9AADFED411LL,0x93538B87B6FF5786LL,0x1D26016E5DCA5B7FLL,0xB80EAEAAC79E06D3LL}},{{0x93538B87B6FF5786LL,(-4L),0x93538B87B6FF5786LL,0xC9F79E4B39C2D96ALL},{0xEA4F543A9B16E5D1LL,0x1D26016E5DCA5B7FLL,0L,0x5AEB5978FFC2FE0ELL},{0x27326B30262A889ELL,0xEA4F543A9B16E5D1LL,0xC9F79E4B39C2D96ALL,0x1D26016E5DCA5B7FLL},{0xB80EAEAAC79E06D3LL,(-1L),0xC9F79E4B39C2D96ALL,0x6BC84746BA864CC4LL},{0x27326B30262A889ELL,0L,0L,0x27326B30262A889ELL},{0xEA4F543A9B16E5D1LL,0xB80EAEAAC79E06D3LL,0x93538B87B6FF5786LL,0xABDC482A8E6F95D9LL}}}; int8_t l_2080[8][6] = {{(-10L),0L,0x5EL,5L,0x2AL,(-1L)},{0x7CL,(-1L),0x5EL,(-1L),0x7CL,(-6L)},{1L,(-1L),(-10L),0xCAL,0x2AL,0xCAL},{1L,0L,1L,(-1L),(-10L),0xCAL},{0x7CL,(-6L),(-10L),5L,(-10L),(-6L)},{(-10L),0L,0x5EL,5L,0x2AL,(-1L)},{0x7CL,(-1L),0x5EL,(-1L),0x7CL,(-6L)},{1L,(-1L),(-10L),0xCAL,0x2AL,0xCAL}}; const uint8_t **l_2083 = (void*)0; const uint8_t ***l_2082 = &l_2083; const uint16_t *l_2088[3]; const uint16_t **l_2087[6][2][2] = {{{&l_2088[1],&l_2088[1]},{&l_2088[0],&l_2088[1]}},{{&l_2088[1],(void*)0},{(void*)0,&l_2088[1]}},{{&l_2088[1],&l_2088[0]},{&l_2088[1],&l_2088[1]}},{{(void*)0,(void*)0},{&l_2088[1],&l_2088[1]}},{{&l_2088[0],&l_2088[1]},{&l_2088[1],(void*)0}},{{(void*)0,&l_2088[1]},{&l_2088[1],&l_2088[0]}}}; const uint16_t ***l_2086[4][3] = {{(void*)0,&l_2087[2][0][0],(void*)0},{&l_2087[2][0][0],&l_2087[2][0][0],&l_2087[2][0][0]},{(void*)0,&l_2087[2][0][0],(void*)0},{&l_2087[2][0][0],&l_2087[2][0][0],&l_2087[2][0][0]}}; int64_t ** const *l_2178 = &g_1344; uint16_t ****l_2268 = &l_2223; int i, j, k; for (i = 0; i < 1; i++) l_1977[i] = 4L; for (i = 0; i < 3; i++) l_2088[i] = &l_1976; l_1929 &= ((*g_398) > (safe_mod_func_int32_t_s_s((safe_div_func_uint32_t_u_u(((*l_1928) = ((safe_mul_func_int64_t_s_s((safe_rshift_func_int8_t_s_u((safe_mul_func_uint16_t_u_u((safe_sub_func_uint16_t_u_u((+(safe_add_func_int32_t_s_s(((*g_398) | l_1918), ((safe_rshift_func_int8_t_s_s((l_1921 || ((*g_451) = 0xF9L)), l_1918)) > (safe_mul_func_int32_t_s_s((+0xFC24A529L), ((l_1926 = l_1921) < (g_220 && p_24)))))))), l_1927)), (*g_398))), 6)), l_1927)) == 0x6707L)), p_24)), l_1918))); for (g_452 = 0; (g_452 <= 0); g_452 += 1) { /* block id: 877 */ union U0 l_1944 = {3L}; int32_t l_1953[6][5][3] = {{{0x5C5C6B19L,(-2L),0x5C5C6B19L},{0x3BFD4A0CL,0L,0L},{0x006AD4C5L,(-2L),0x006AD4C5L},{0x3BFD4A0CL,0x3BFD4A0CL,0L},{0x5C5C6B19L,(-2L),0x5C5C6B19L}},{{0x3BFD4A0CL,0L,0L},{0x006AD4C5L,(-2L),0x006AD4C5L},{0x3BFD4A0CL,0x3BFD4A0CL,0L},{0x5C5C6B19L,(-2L),0x5C5C6B19L},{0x3BFD4A0CL,0L,0L}},{{0x006AD4C5L,(-2L),0x006AD4C5L},{0x3BFD4A0CL,0x3BFD4A0CL,0L},{0x5C5C6B19L,(-2L),0x5C5C6B19L},{0x3BFD4A0CL,0L,0L},{0x006AD4C5L,(-2L),0x006AD4C5L}},{{0x3BFD4A0CL,0x3BFD4A0CL,0L},{0x5C5C6B19L,(-2L),0x5C5C6B19L},{0x3BFD4A0CL,0L,0L},{0x006AD4C5L,(-2L),0x006AD4C5L},{0x3BFD4A0CL,0x3BFD4A0CL,0L}},{{0x5C5C6B19L,(-2L),0x5C5C6B19L},{0x3BFD4A0CL,0L,0L},{0x006AD4C5L,(-2L),0x006AD4C5L},{0x3BFD4A0CL,0x3BFD4A0CL,0L},{0x5C5C6B19L,(-2L),0x5C5C6B19L}},{{0x3BFD4A0CL,0L,0L},{0x006AD4C5L,(-2L),0x006AD4C5L},{0x3BFD4A0CL,0x3BFD4A0CL,0L},{0x5C5C6B19L,(-2L),0x5C5C6B19L},{0x3BFD4A0CL,0L,0L}}}; int8_t **l_1957 = (void*)0; int8_t ***l_1956[10][2][6] = {{{&l_1957,&l_1957,&l_1957,&l_1957,&l_1957,&l_1957},{&l_1957,(void*)0,&l_1957,&l_1957,(void*)0,&l_1957}},{{&l_1957,&l_1957,&l_1957,(void*)0,(void*)0,(void*)0},{&l_1957,&l_1957,&l_1957,(void*)0,&l_1957,&l_1957}},{{&l_1957,&l_1957,&l_1957,&l_1957,&l_1957,&l_1957},{&l_1957,(void*)0,&l_1957,(void*)0,&l_1957,(void*)0}},{{&l_1957,&l_1957,(void*)0,(void*)0,&l_1957,&l_1957},{&l_1957,&l_1957,(void*)0,&l_1957,&l_1957,(void*)0}},{{&l_1957,&l_1957,&l_1957,(void*)0,&l_1957,&l_1957},{&l_1957,&l_1957,&l_1957,&l_1957,&l_1957,&l_1957}},{{&l_1957,(void*)0,&l_1957,(void*)0,&l_1957,(void*)0},{&l_1957,&l_1957,(void*)0,(void*)0,&l_1957,&l_1957}},{{&l_1957,&l_1957,(void*)0,&l_1957,&l_1957,(void*)0},{&l_1957,&l_1957,&l_1957,(void*)0,&l_1957,&l_1957}},{{&l_1957,&l_1957,&l_1957,&l_1957,&l_1957,&l_1957},{&l_1957,(void*)0,&l_1957,(void*)0,&l_1957,(void*)0}},{{&l_1957,&l_1957,(void*)0,(void*)0,&l_1957,&l_1957},{&l_1957,&l_1957,(void*)0,&l_1957,&l_1957,(void*)0}},{{&l_1957,&l_1957,&l_1957,(void*)0,&l_1957,&l_1957},{&l_1957,&l_1957,&l_1957,&l_1957,&l_1957,&l_1957}}}; uint16_t **l_2036[8][9] = {{&g_398,&g_398,&g_398,&g_398,(void*)0,(void*)0,&g_398,&g_398,&g_398},{&g_398,&g_398,(void*)0,&g_398,(void*)0,&g_398,&g_398,&g_398,&g_398},{(void*)0,&g_398,&g_398,&g_398,(void*)0,&g_398,&g_398,&g_398,(void*)0},{&g_398,&g_398,(void*)0,(void*)0,(void*)0,(void*)0,&g_398,&g_398,&g_398},{&g_398,&g_398,(void*)0,&g_398,&g_398,&g_398,&g_398,&g_398,(void*)0},{&g_398,(void*)0,(void*)0,&g_398,(void*)0,&g_398,&g_398,&g_398,&g_398},{(void*)0,(void*)0,&g_398,(void*)0,(void*)0,&g_398,&g_398,(void*)0,(void*)0},{&g_398,(void*)0,&g_398,&g_398,&g_398,&g_398,&g_398,(void*)0,&g_398}}; uint16_t ***l_2035[1]; uint8_t ***l_2047 = &g_1642[3][1][1]; int32_t l_2081 = (-9L); int16_t *l_2101 = &l_1927; int8_t l_2116[7][6] = {{0x72L,(-7L),6L,(-7L),0x72L,0x72L},{0x4DL,(-7L),(-7L),0x4DL,0x48L,0x4DL},{0x4DL,0x48L,0x4DL,(-7L),0x4DL,6L},{(-7L),(-7L),0x4DL,0x48L,0x4DL,(-7L)},{0x4DL,0x72L,0x48L,0x48L,0x72L,0x4DL},{(-7L),0x4DL,0x48L,0x4DL,(-7L),(-7L)},{6L,0x4DL,0x4DL,6L,0x72L,6L}}; uint64_t l_2128 = 0xDA42F3C5D46ADFC3LL; const int32_t l_2143[5][3] = {{0x4D0DCD5FL,0x4D0DCD5FL,0x4D0DCD5FL},{0x4D0DCD5FL,0x4D0DCD5FL,0x4D0DCD5FL},{0x4D0DCD5FL,0x4D0DCD5FL,0x4D0DCD5FL},{0x4D0DCD5FL,0x4D0DCD5FL,0x4D0DCD5FL},{0x4D0DCD5FL,0x4D0DCD5FL,0x4D0DCD5FL}}; uint32_t *l_2188[9][9][3] = {{{&g_794,(void*)0,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,(void*)0},{&g_794,&g_794,(void*)0},{&g_794,(void*)0,&g_794},{&g_794,&g_794,&g_794},{(void*)0,(void*)0,&g_794},{(void*)0,&g_794,&g_794}},{{(void*)0,&g_794,&g_794},{(void*)0,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,(void*)0,&g_794},{&g_794,(void*)0,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,(void*)0},{&g_794,&g_794,(void*)0}},{{&g_794,(void*)0,&g_794},{&g_794,&g_794,&g_794},{(void*)0,(void*)0,&g_794},{(void*)0,&g_794,&g_794},{(void*)0,&g_794,&g_794},{(void*)0,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,(void*)0,&g_794},{&g_794,(void*)0,&g_794}},{{&g_794,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,(void*)0},{&g_794,&g_794,(void*)0},{&g_794,(void*)0,&g_794},{&g_794,&g_794,&g_794},{(void*)0,(void*)0,&g_794},{(void*)0,&g_794,&g_794},{(void*)0,&g_794,&g_794}},{{(void*)0,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,(void*)0,&g_794},{&g_794,(void*)0,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,(void*)0},{&g_794,&g_794,(void*)0},{&g_794,(void*)0,&g_794}},{{&g_794,&g_794,&g_794},{(void*)0,(void*)0,&g_794},{(void*)0,&g_794,&g_794},{(void*)0,&g_794,&g_794},{(void*)0,&g_794,&g_794},{&g_794,&g_794,(void*)0},{(void*)0,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,&g_794}},{{(void*)0,&g_794,&g_794},{&g_794,(void*)0,&g_794},{&g_794,&g_794,&g_794},{(void*)0,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,(void*)0,(void*)0},{&g_794,&g_794,&g_794}},{{&g_794,&g_794,(void*)0},{(void*)0,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,&g_794},{(void*)0,&g_794,&g_794},{&g_794,(void*)0,&g_794},{&g_794,&g_794,&g_794},{(void*)0,&g_794,&g_794},{&g_794,&g_794,&g_794}},{{&g_794,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,(void*)0,(void*)0},{&g_794,&g_794,&g_794},{&g_794,&g_794,(void*)0},{(void*)0,&g_794,&g_794},{&g_794,&g_794,&g_794},{&g_794,&g_794,&g_794},{(void*)0,&g_794,&g_794}}}; uint16_t ****l_2269[10] = {&l_2035[0],&l_2035[0],&l_2223,&l_2035[0],&l_2035[0],&l_2035[0],&l_2035[0],&l_2223,&l_2035[0],&l_2035[0]}; int32_t *l_2286 = &g_1291; int i, j, k; for (i = 0; i < 1; i++) l_2035[i] = &l_2036[7][2]; for (l_1918 = 0; (l_1918 <= 3); l_1918 += 1) { /* block id: 880 */ union U0 *l_1945 = (void*)0; union U0 *l_1946 = &l_1944; union U0 **l_1949 = &l_1945; int i, j; l_1953[4][0][0] = ((4294967295UL >= (safe_sub_func_uint16_t_u_u((safe_div_func_int32_t_s_s((((safe_sub_func_uint32_t_u_u(((safe_rshift_func_int16_t_s_s((-1L), (safe_sub_func_uint32_t_u_u(0xF471B12FL, ((*l_1928) ^= (safe_mul_func_int32_t_s_s((safe_mod_func_uint32_t_u_u((((*l_1946) = l_1944) , 0x9156173FL), (0xCFECC299E20EBF47LL & ((safe_mul_func_uint8_t_u_u((((*l_1949) = l_1945) == l_1950[2]), ((safe_rshift_func_int8_t_s_s(0xD7L, p_22.f0)) < p_22.f0))) >= g_1300)))), 0x1502DAB0L))))))) <= p_22.f0), p_24)) < l_1929) || 0UL), l_1918)), l_1927))) != 0x0E9941A7L); } for (g_165 = 0; (g_165 <= 0); g_165 += 1) { /* block id: 888 */ int8_t **l_1955 = &g_451; int8_t *** const l_1954 = &l_1955; int32_t l_1972 = 0x65C476FFL; uint16_t *l_2027[1]; uint64_t *l_2032 = &l_2009; uint16_t **l_2037 = &l_2027[0]; int i, j; for (i = 0; i < 1; i++) l_2027[i] = (void*)0; } if ((safe_mod_func_int64_t_s_s((safe_lshift_func_int64_t_s_u(p_22.f0, ((***g_1821) = ((((l_2047 != ((safe_div_func_int16_t_s_s(l_1971[1][0], (*l_2008))) , (((safe_lshift_func_uint32_t_u_s((((*g_1643) = ((safe_mul_func_uint8_t_u_u((g_220 != (safe_lshift_func_int16_t_s_u((safe_unary_minus_func_int32_t_s((safe_mod_func_int64_t_s_s((safe_mod_func_uint32_t_u_u((safe_add_func_int16_t_s_s((safe_add_func_uint8_t_u_u((safe_div_func_uint8_t_u_u((safe_mod_func_uint8_t_u_u(0x64L, (l_1953[4][0][0] = (safe_sub_func_uint32_t_u_u((((safe_div_func_int16_t_s_s(((g_1257 = (l_1926 = (safe_add_func_int8_t_s_s(((l_1944.f0 = (-1L)) < (safe_div_func_int16_t_s_s((((safe_lshift_func_int8_t_s_s(p_25, p_25)) < 0x09715B7D07A12536LL) && l_1953[4][0][0]), p_26.f0))), l_1953[3][2][0])))) <= l_1953[0][3][2]), p_24)) , p_24) ^ (*l_2008)), p_24))))), l_2079[0][3][2])), 0UL)), (*l_2008))), p_25)), 18446744073709551615UL)))), 11))), l_2080[2][2])) ^ 255UL)) , 0x7798ED4FL), 9)) != l_2081) , l_2082))) == p_26.f0) <= l_1976) >= g_1522)))), p_24))) { /* block id: 935 */ int32_t l_2098[3][1][9] = {{{(-10L),0xE3948B2FL,0x1CF63C10L,0x1CF63C10L,0xE3948B2FL,(-10L),1L,0xE3948B2FL,1L}},{{(-10L),0xE3948B2FL,0x1CF63C10L,0x1CF63C10L,0xE3948B2FL,(-10L),1L,0xE3948B2FL,1L}},{{(-10L),0xE3948B2FL,0x1CF63C10L,0x1CF63C10L,0xE3948B2FL,(-10L),1L,0xE3948B2FL,1L}}}; uint8_t l_2113 = 7UL; int32_t l_2132 = 0x563820F0L; int64_t * const * const *l_2181[4]; uint8_t l_2190[5][1]; int i, j, k; for (i = 0; i < 4; i++) l_2181[i] = (void*)0; for (i = 0; i < 5; i++) { for (j = 0; j < 1; j++) l_2190[i][j] = 0x4EL; } for (p_25 = 3; (p_25 >= 1); p_25 -= 1) { /* block id: 938 */ uint32_t *l_2099 = (void*)0; uint32_t *l_2100 = &l_1971[2][0]; int i, j, k; (*l_2008) &= (safe_sub_func_uint8_t_u_u(g_137[(g_828 + 3)], ((&l_2036[(p_25 + 1)][(p_25 + 2)] != l_2086[0][0]) || (((p_22.f0 & (~(safe_mod_func_uint32_t_u_u(((safe_rshift_func_int32_t_s_s((p_22.f0 == ((safe_rshift_func_int32_t_s_s(g_137[(g_828 + 3)], 12)) <= 0x2C87538CL)), 4)) ^ 1UL), ((*l_2100) = (safe_add_func_int16_t_s_s(l_2098[2][0][7], 0x42F4L))))))) ^ p_24) >= g_137[(g_452 + 3)])))); } for (g_1247 = 0; (g_1247 <= 7); g_1247 += 1) { /* block id: 944 */ int16_t *l_2102 = &l_1927; int32_t l_2131 = 0L; uint64_t *****l_2155 = (void*)0; (*g_707) = func_37(l_2101, &p_25, l_2102, p_22.f0); if (p_25) { /* block id: 946 */ int32_t *l_2103 = &l_2098[2][0][7]; int32_t *l_2104 = &l_1929; int32_t *l_2105 = (void*)0; int32_t *l_2106 = &l_1918; int32_t *l_2107 = &l_1926; int32_t *l_2108 = &l_2098[2][0][7]; int32_t *l_2109 = &l_1953[5][4][1]; int32_t *l_2110 = &l_1926; int32_t *l_2111 = &g_63; int32_t *l_2112[8][2]; int i, j; for (i = 0; i < 8; i++) { for (j = 0; j < 2; j++) l_2112[i][j] = &l_1953[4][0][0]; } l_2113++; (**g_1379) = (*g_707); } else { /* block id: 949 */ int32_t *l_2121[7]; int i, j, k; for (i = 0; i < 7; i++) l_2121[i] = &l_2098[0][0][8]; (*g_236) &= l_2116[4][2]; l_2132 |= ((safe_add_func_int16_t_s_s(((l_2081 <= (safe_add_func_uint32_t_u_u((((l_2121[3] == &p_25) | ((l_1953[1][2][0] & ((((**g_1165) = (((*g_1643) = (((p_26.f0 < (safe_lshift_func_int32_t_s_u(((safe_sub_func_uint64_t_u_u((safe_sub_func_uint8_t_u_u((l_2128 | p_26.f0), (safe_rshift_func_uint8_t_u_u((p_22.f0 >= (l_1918 ^ 0x823BF627L)), 3)))), p_25)) > p_24), l_2098[1][0][1]))) != p_26.f0) == p_22.f0)) ^ p_25)) , p_22.f0) && 0xFCL)) , g_1703)) <= (*g_398)), l_2131))) | (*g_398)), (*l_2008))) != (*g_318)); } for (g_540 = 0; (g_540 <= 1); g_540 += 1) { /* block id: 957 */ int16_t *l_2142 = &g_526; int32_t *l_2144 = &l_2132; uint64_t * const *l_2159 = &g_318; uint64_t * const **l_2158 = &l_2159; uint64_t * const ***l_2157 = &l_2158; uint64_t * const ****l_2156 = &l_2157; int64_t * const * const *l_2179 = (void*)0; int64_t * const * const **l_2180[5][3][8] = {{{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179},{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179},{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179}},{{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179},{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179},{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179}},{{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179},{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179},{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179}},{{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179},{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179},{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179}},{{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179},{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179},{&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179,&l_2179}}}; union U0 l_2185 = {0x0422813CL}; uint16_t ****l_2189 = &l_2035[0]; int i, j, k; l_2144 = func_77((*g_1643), func_50(((**g_1379) = &p_25)), p_22.f0, (safe_lshift_func_int16_t_s_u(((safe_mod_func_int8_t_s_s(p_26.f0, ((*l_2008) = (safe_lshift_func_int8_t_s_u(((safe_rshift_func_uint64_t_u_s((254UL || (~(g_134[g_540] |= (((*l_2008) | (func_27((*l_2008), l_2007[2][0][0], l_2142) , p_24)) < (*g_1901))))), 7)) >= 0x6704L), p_25))))) || l_2143[3][0]), 3))); if ((*l_2008)) break; (**g_707) = (safe_mul_func_int16_t_s_s(((((*l_2008) | (g_59[g_1247][g_828][g_828] = (safe_add_func_int16_t_s_s((0xEBF16E3DL >= ((safe_mod_func_uint16_t_u_u((((((safe_mul_func_int8_t_s_s((safe_sub_func_uint8_t_u_u((l_2155 == (g_2160[5] = l_2156)), ((l_1926 &= ((0x67FFFD43EB6FFE17LL > p_22.f0) > (g_1300 > p_26.f0))) , (p_26.f0 == 1UL)))), 8L)) & 0x15EAAFD9258287A3LL) > 0UL) , l_1971[2][0]) ^ l_2132), p_25)) ^ p_22.f0)), (*g_398))))) , (*l_2008)) ^ p_25), 0L)); (**g_707) = (safe_mul_func_uint16_t_u_u((safe_add_func_uint32_t_u_u(l_2098[2][0][7], ((safe_rshift_func_int16_t_s_u((p_24 , (safe_mul_func_int16_t_s_s(((safe_add_func_int64_t_s_s((((safe_lshift_func_uint64_t_u_s((g_59[(g_452 + 2)][(g_540 + 2)][g_452] = ((l_2178 == (l_2181[1] = l_2179)) > 4294967288UL)), 40)) , (safe_div_func_int64_t_s_s((+(l_2185 , (safe_add_func_uint32_t_u_u(((l_2132 = ((p_25 || ((*g_1643) &= ((((void*)0 == l_2188[0][3][2]) , &g_1899) == l_2189))) > p_26.f0)) || (*l_2008)), 0x56DCA7D6L)))), 18446744073709551615UL))) ^ p_24), p_25)) , g_1257), (*l_2008)))), 10)) , p_25))), p_22.f0)); } } (*l_2008) |= (65535UL && l_2190[3][0]); } else { /* block id: 975 */ for (g_1522 = 0; (g_1522 <= 4); g_1522 += 1) { /* block id: 978 */ uint64_t l_2198 = 7UL; for (g_165 = 1; (g_165 <= 4); g_165 += 1) { /* block id: 981 */ int32_t l_2191 = (-6L); int32_t *l_2192 = &l_1926; int32_t *l_2193 = &l_1918; int32_t *l_2194 = &l_1977[0]; int32_t *l_2195 = &l_1926; int32_t *l_2196 = &l_1929; int32_t *l_2197 = &l_1929; int i, j; l_2198++; (*g_2201) = &p_24; return l_2116[g_1522][g_165]; } for (g_526 = 3; (g_526 >= 0); g_526 -= 1) { /* block id: 988 */ uint32_t l_2203 = 0xA93EDA46L; (**g_1379) = &p_25; --l_2203; } for (l_2198 = 0; (l_2198 <= 4); l_2198 += 1) { /* block id: 994 */ if (l_2198) goto lbl_2206; } } } (*l_2008) = 4L; for (g_1522 = 0; (g_1522 <= 4); g_1522 += 1) { /* block id: 1002 */ uint16_t l_2218 = 65532UL; int8_t l_2262 = 0x43L; uint16_t * const *l_2272 = &g_398; uint16_t * const **l_2271 = &l_2272; uint16_t * const ***l_2270 = &l_2271; if (((safe_mul_func_uint32_t_u_u((+(safe_mul_func_uint32_t_u_u((safe_rshift_func_int16_t_s_u(((safe_sub_func_int16_t_s_s((5L && ((((safe_add_func_uint64_t_u_u((l_2218 | 0x03418026454160E1LL), l_1944.f0)) & p_26.f0) , 4294967290UL) == 1L)), ((*l_2008) >= p_24))) && (*l_2008)), 13)), p_25))), l_1926)) , p_22.f0)) { /* block id: 1003 */ uint16_t ****l_2225 = &l_2035[0]; int32_t l_2261 = (-7L); if ((safe_div_func_int8_t_s_s(p_26.f0, (safe_sub_func_int32_t_s_s(p_24, (&g_1900 == ((*l_2225) = l_2223))))))) { /* block id: 1005 */ uint32_t ***l_2250 = &g_1165; uint32_t ****l_2249 = &l_2250; int32_t *l_2253 = &l_1929; int32_t *l_2254 = (void*)0; int32_t *l_2255 = &l_1929; int32_t *l_2256 = (void*)0; int32_t *l_2257 = &l_1977[0]; int32_t *l_2258 = &l_1977[0]; int32_t *l_2259 = &l_2081; int32_t *l_2260[2]; int8_t l_2264 = 0x09L; uint16_t l_2265 = 7UL; int i; for (i = 0; i < 2; i++) l_2260[i] = (void*)0; (*g_143) = &l_1953[4][0][0]; g_2252 = (safe_lshift_func_int16_t_s_u((safe_sub_func_uint32_t_u_u(((-4L) >= (safe_sub_func_int8_t_s_s(p_26.f0, (((*l_2101) = (p_24 < ((safe_rshift_func_uint32_t_u_s((safe_add_func_int64_t_s_s((safe_lshift_func_int16_t_s_u(((safe_div_func_uint8_t_u_u((l_2081 = l_2218), ((((safe_add_func_int8_t_s_s(p_24, ((safe_sub_func_uint32_t_u_u((safe_div_func_uint64_t_u_u(((~(*g_451)) || (((safe_mod_func_int16_t_s_s(g_239[2][2][1], ((((*l_2249) = &g_1165) != (void*)0) | p_26.f0))) || g_134[3]) < 1UL)), p_22.f0)), p_22.f0)) <= l_2251))) , (*g_398)) , 0xEF7D714BD8925AE9LL) && p_25))) , (-2L)), 4)), 0x58EA937B62A77DD4LL)), 2)) & g_59[0][2][0]))) , (*g_1643))))), p_26.f0)), 15)); l_2265++; (*l_2253) = ((p_26.f0 > l_1944.f0) >= (((l_2269[4] = l_2268) != l_2270) | (*g_451))); } else { /* block id: 1014 */ uint32_t l_2273 = 0x87FE98B0L; int64_t *l_2285 = &g_2252; l_2286 = func_77((l_2273 >= ((l_1926 = g_502[0]) && (safe_mul_func_uint16_t_u_u(l_2273, (~(safe_lshift_func_int32_t_s_s((*g_1199), 14))))))), l_2101, (safe_rshift_func_uint64_t_u_s((safe_mul_func_uint16_t_u_u(65535UL, 0xE63DL)), ((*l_2285) &= ((func_27((l_2263 , (safe_rshift_func_int64_t_s_s((l_2273 | (-1L)), 2))), &g_8, &l_1927) , p_25) >= p_25)))), g_239[0][0][1]); return l_1971[1][0]; } return l_2261; } else { /* block id: 1021 */ return l_2251; } } } for (g_540 = 0; (g_540 <= 3); g_540 += 1) { /* block id: 1028 */ l_1950[2] = &p_26; (*l_2008) ^= p_24; return l_1971[2][0]; } } if ((safe_sub_func_int8_t_s_s((safe_rshift_func_uint32_t_u_s(g_502[0], 6)), (~((safe_mul_func_uint8_t_u_u(((void*)0 == l_1950[2]), (((*l_2300) &= (safe_mul_func_uint32_t_u_u((l_1971[2][0] > (safe_div_func_int16_t_s_s(p_26.f0, 8UL))), ((safe_sub_func_uint64_t_u_u(((*g_2164) = (p_25 == 0x82L)), ((***g_1821) ^= (0x30379E35B24F8A20LL != 0xB95D9890B11C7D08LL)))) != l_2251)))) ^ l_1926))) == p_22.f0))))) { /* block id: 1037 */ int32_t *l_2301[5][4] = {{&g_63,&l_1926,&g_63,&l_1926},{&g_63,&l_1926,&l_1926,&g_63},{&g_63,&l_1926,(void*)0,&l_1926},{&l_1926,&l_1926,(void*)0,(void*)0},{&g_63,&g_63,&l_1926,(void*)0}}; uint32_t l_2308 = 7UL; int32_t ***l_2336[4][6]; int32_t ****l_2337 = &l_2336[1][0]; int64_t l_2339 = (-1L); uint32_t *l_2340 = &g_134[6]; uint32_t ***l_2346 = &g_1165; uint64_t *l_2354 = &g_2165; union U0 l_2361[5][6] = {{{0x739AFE91L},{9L},{0L},{0L},{9L},{0x739AFE91L}},{{0xC2F7F7D6L},{-8L},{1L},{0x100C5AB9L},{0x739AFE91L},{0xFC68337EL}},{{9L},{-3L},{0xC1F87D23L},{0x739AFE91L},{0xC1F87D23L},{-3L}},{{9L},{0xFC68337EL},{0x739AFE91L},{0x100C5AB9L},{1L},{-8L}},{{0xC2F7F7D6L},{0x739AFE91L},{9L},{0L},{0L},{9L}}}; uint16_t *l_2362 = &l_2251; uint16_t l_2363[6] = {0x8A47L,65533UL,65533UL,0x8A47L,65533UL,65533UL}; uint64_t l_2364 = 18446744073709551614UL; int i, j; for (i = 0; i < 4; i++) { for (j = 0; j < 6; j++) l_2336[i][j] = &g_707; } ++l_2308; --l_2311; l_2307 = (safe_sub_func_int16_t_s_s(((((safe_mul_func_uint64_t_u_u((((safe_add_func_uint8_t_u_u(((((*l_2340) = (((safe_add_func_int16_t_s_s(0x34BAL, 0x0764L)) != 0UL) | (safe_sub_func_uint64_t_u_u((((safe_rshift_func_uint16_t_u_u(((p_25 & p_26.f0) && p_25), 5)) , (safe_div_func_int16_t_s_s((safe_div_func_uint8_t_u_u(((safe_div_func_uint64_t_u_u(0x43F4B0CF76250865LL, ((*l_2300) = (safe_mul_func_uint32_t_u_u(((((*l_2337) = l_2336[1][0]) == (l_2338 = l_2338)) <= p_26.f0), g_130.f0))))) | (***g_1821)), (*g_451))), (*g_398)))) | p_24), l_2339)))) , g_2341) == (void*)0), l_2009)) & 18446744073709551606UL) == (*g_451)), l_2342)) , (*l_2338)) != l_2343) ^ 18446744073709551615UL), 0L)); (*g_143) = &p_25; } else { /* block id: 1047 */ uint32_t ***l_2370 = (void*)0; (*g_2367) = l_2365; p_22.f0 |= p_26.f0; p_26.f0 ^= (l_2370 != l_2370); } return p_24; } /* ------------------------------------------ */ /* * reads : * writes: */ static union U0 func_27(int8_t p_28, int16_t * p_29, int16_t * p_30) { /* block id: 863 */ union U0 l_1895 = {0L}; return l_1895; } /* ------------------------------------------ */ /* * reads : g_8 g_59 g_63 g_526 g_451 g_452 g_236 g_711 g_707 g_1291 g_86 g_83 g_1300 g_398 g_165 g_143 g_220 g_1247 g_1344 g_312.f0 g_318 g_579 g_62 g_120 g_502 g_1257 g_1199 g_1419 g_540 g_1379 g_1332 g_1440 g_317 g_130.f0 g_828 g_794 g_137 g_1224 g_1522 g_239 g_1653 g_134 g_1655 g_1656 g_1643 g_1859 g_1165 g_1822 g_1079 g_1080 * writes: g_59 g_62 g_526 g_63 g_711 g_236 g_1291 g_452 g_83 g_220 g_1332 g_137 g_1344 g_1378 g_1380 g_165 g_1080 g_1257 g_540 g_1441 g_239 g_794 g_86 g_1224 g_1640 g_261 g_1859 g_1165 */ static uint16_t func_35(int32_t p_36) { /* block id: 4 */ int16_t *l_42 = &g_8; union U0 l_49 = {1L}; uint64_t *l_58 = &g_59[7][1][2]; int32_t *l_66 = &g_63; int32_t *l_1301 = &g_1291; int32_t *l_1302 = &g_63; int32_t *l_1303[8] = {&g_1291,&g_1291,&g_1291,&g_1291,&g_1291,&g_1291,&g_1291,&g_1291}; int32_t l_1304 = 0x0859AB4FL; int32_t l_1305 = 0x669327E6L; int32_t l_1306 = 0x68856F1AL; uint32_t l_1307 = 0x4C642036L; uint32_t *l_1310 = &g_220; int64_t l_1314[7][10][3] = {{{5L,1L,0x17070E1508D0BA7ELL},{0x9F8EDECF38484771LL,1L,0x0A3619D49B900F51LL},{0xC18FC2CD67F0C0EELL,0xF925C46F4C7C1682LL,1L},{0xA45ED02ADF28B1C3LL,(-7L),1L},{0xC18FC2CD67F0C0EELL,(-1L),0x377B8315E85D1381LL},{0x9F8EDECF38484771LL,0xC18FC2CD67F0C0EELL,0xF96D7F68531AFCCBLL},{5L,0x0A3619D49B900F51LL,(-1L)},{(-7L),0xA5D21496A811FB85LL,0x763BA2A322D12E41LL},{1L,0xA9BA624E3F8E3950LL,0xE99F2F48F5E9B4C8LL},{0xEF6429E98E50D5E4LL,(-4L),0x07118739AE3C3A9ALL}},{{0xA4006A194CBBE8D6LL,0x07118739AE3C3A9ALL,1L},{6L,0x9F8EDECF38484771LL,1L},{6L,0xCE401ECEE3023E5CLL,1L},{1L,1L,1L},{(-1L),0x5FB515AF80D5A858LL,1L},{0x4646558C7E34A349LL,1L,1L},{0x763BA2A322D12E41LL,0L,0x07118739AE3C3A9ALL},{0x873E4D29669D43E4LL,0xE35F3E5EC87E1606LL,0xE99F2F48F5E9B4C8LL},{0xCE401ECEE3023E5CLL,0L,0x763BA2A322D12E41LL},{0xF96D7F68531AFCCBLL,(-1L),(-1L)}},{{0xFB1A6DD13B864EE4LL,6L,0xF96D7F68531AFCCBLL},{1L,0x763BA2A322D12E41LL,0x377B8315E85D1381LL},{(-4L),0x00B1625B49744B0BLL,(-1L)},{0x0BFF6072A2240038LL,0xF925C46F4C7C1682LL,1L},{0x377B8315E85D1381LL,0x00B1625B49744B0BLL,8L},{0x6F0C0C2539024FBDLL,0xA45ED02ADF28B1C3LL,0x9F8EDECF38484771LL},{0xA5D21496A811FB85LL,1L,2L},{8L,0xF96D7F68531AFCCBLL,0x00B1625B49744B0BLL},{0x07118739AE3C3A9ALL,1L,0x0A3619D49B900F51LL},{1L,0xAF5A5193086460CELL,(-1L)}},{{0xEF2F0410C45F6F54LL,0xFB1A6DD13B864EE4LL,0xAF5A5193086460CELL},{1L,(-1L),0L},{0xC18FC2CD67F0C0EELL,(-7L),0xFB1A6DD13B864EE4LL},{(-1L),1L,0xA9BA624E3F8E3950LL},{(-1L),(-4L),1L},{0xC18FC2CD67F0C0EELL,0xE35F3E5EC87E1606LL,0xA4006A194CBBE8D6LL},{1L,0xB7B1003026C121F2LL,0x1C8CBA28886749E1LL},{0xEF2F0410C45F6F54LL,5L,1L},{1L,(-1L),0x6F0C0C2539024FBDLL},{0x07118739AE3C3A9ALL,(-2L),0xC18FC2CD67F0C0EELL}},{{8L,8L,0xA5D21496A811FB85LL},{0xA5D21496A811FB85LL,(-10L),(-6L)},{0x6F0C0C2539024FBDLL,6L,0x763BA2A322D12E41LL},{0x377B8315E85D1381LL,2L,1L},{0x0BFF6072A2240038LL,0x6F0C0C2539024FBDLL,0x763BA2A322D12E41LL},{5L,5L,(-6L)},{0x29FE85962FEDFEABLL,0xE99F2F48F5E9B4C8LL,0xA5D21496A811FB85LL},{(-1L),1L,0xC18FC2CD67F0C0EELL},{0x0996CA353EF0F5DELL,0xEF2F0410C45F6F54LL,0x6F0C0C2539024FBDLL},{(-4L),0xC18FC2CD67F0C0EELL,1L}},{{0x0A3619D49B900F51LL,0x4F4508B57529F969LL,0x1C8CBA28886749E1LL},{0xA45ED02ADF28B1C3LL,0x0BFF6072A2240038LL,0xA4006A194CBBE8D6LL},{0xEF6429E98E50D5E4LL,(-1L),1L},{0x873E4D29669D43E4LL,0xCE401ECEE3023E5CLL,0xA9BA624E3F8E3950LL},{5L,0xCE401ECEE3023E5CLL,0xFB1A6DD13B864EE4LL},{0x1C8CBA28886749E1LL,(-1L),0L},{1L,0x0BFF6072A2240038LL,0xAF5A5193086460CELL},{0x5FB515AF80D5A858LL,0x4F4508B57529F969LL,(-1L)},{(-6L),0xC18FC2CD67F0C0EELL,0x0A3619D49B900F51LL},{1L,0xEF2F0410C45F6F54LL,0x00B1625B49744B0BLL}},{{2L,1L,2L},{1L,0xE99F2F48F5E9B4C8LL,0x9F8EDECF38484771LL},{0xE35F3E5EC87E1606LL,5L,8L},{(-10L),0x6F0C0C2539024FBDLL,1L},{0xDC1B3AC0FD11D456LL,2L,(-1L)},{(-10L),6L,0xCE401ECEE3023E5CLL},{0xE35F3E5EC87E1606LL,(-10L),0x0996CA353EF0F5DELL},{1L,8L,0xF96D7F68531AFCCBLL},{2L,(-2L),0xA45ED02ADF28B1C3LL},{1L,(-1L),0x17070E1508D0BA7ELL}}}; int32_t l_1316 = 0x4630D074L; uint64_t l_1317 = 0xC76C9B124995615ALL; uint16_t l_1342 = 1UL; int32_t **l_1350 = (void*)0; int32_t **l_1351[6][1][4] = {{{&g_236,&g_236,&g_236,&g_236}},{{&g_236,&g_236,&g_236,&g_236}},{{&g_236,&g_236,&g_236,&g_236}},{{&g_236,&g_236,&g_236,&g_236}},{{&g_236,&g_236,&g_236,&g_236}},{{&g_236,&g_236,&g_236,&g_236}}}; uint32_t l_1442 = 0UL; int32_t l_1519[10] = {0x499F762FL,0x499F762FL,0x499F762FL,0x499F762FL,0x499F762FL,0x499F762FL,0x499F762FL,0x499F762FL,0x499F762FL,0x499F762FL}; uint64_t ***l_1547 = &g_317; int32_t l_1574 = 0x571FD22CL; const uint32_t **l_1603 = (void*)0; const uint32_t ***l_1602 = &l_1603; int64_t l_1621 = 0x5C1739A081A11A5BLL; uint32_t l_1622 = 18446744073709551610UL; uint8_t *** const *l_1637 = (void*)0; int64_t l_1701[1][1]; uint16_t l_1711 = 65535UL; int8_t ***l_1746[3]; int8_t l_1799 = 0xABL; uint32_t * const *l_1856[3]; uint32_t * const * const *l_1855[8][4][3] = {{{&l_1856[2],&l_1856[1],&l_1856[2]},{&l_1856[0],&l_1856[1],&l_1856[1]},{(void*)0,&l_1856[1],&l_1856[1]},{&l_1856[2],&l_1856[1],&l_1856[2]}},{{&l_1856[0],&l_1856[1],&l_1856[2]},{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[2],&l_1856[1],&l_1856[2]}},{{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[2],&l_1856[1],&l_1856[2]},{&l_1856[1],&l_1856[1],&l_1856[1]}},{{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[2],&l_1856[1],&l_1856[2]},{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[1],&l_1856[1],&l_1856[1]}},{{&l_1856[2],&l_1856[1],&l_1856[2]},{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[2],&l_1856[1],&l_1856[2]}},{{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[2],&l_1856[1],&l_1856[2]},{&l_1856[1],&l_1856[1],&l_1856[1]}},{{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[2],&l_1856[1],&l_1856[2]},{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[1],&l_1856[1],&l_1856[1]}},{{&l_1856[2],&l_1856[1],&l_1856[2]},{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[1],&l_1856[1],&l_1856[1]},{&l_1856[2],&l_1856[1],&l_1856[2]}}}; uint32_t * const * const **l_1854 = &l_1855[0][1][0]; uint32_t * const * const ***l_1853[10] = {&l_1854,(void*)0,(void*)0,&l_1854,(void*)0,(void*)0,&l_1854,(void*)0,(void*)0,&l_1854}; union U0 *l_1881 = &l_49; int i, j, k; for (i = 0; i < 1; i++) { for (j = 0; j < 1; j++) l_1701[i][j] = (-3L); } for (i = 0; i < 3; i++) l_1746[i] = (void*)0; for (i = 0; i < 3; i++) l_1856[i] = &g_1166; (*g_707) = func_37(l_42, func_43(l_49, (g_8 , func_50(((safe_add_func_uint64_t_u_u((safe_mod_func_uint64_t_u_u((8L ^ (safe_lshift_func_uint64_t_u_s((((*l_58)--) , g_59[4][1][0]), ((p_36 = l_49.f0) > ((g_62 = (void*)0) == &g_63))))), (safe_div_func_uint16_t_u_u(l_49.f0, l_49.f0)))), g_8)) , l_66))), (*l_66), (*l_66), (*l_66)), &g_8, l_49.f0); for (g_63 = 0; (g_63 < (-28)); g_63 = safe_sub_func_uint32_t_u_u(g_63, 5)) { /* block id: 533 */ int32_t *l_1290 = &g_1291; int16_t *l_1295 = &g_526; uint8_t *l_1297[10] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; int i; (*l_1290) ^= (safe_lshift_func_int32_t_s_s((-1L), 2)); (*l_1290) &= ((+((((*g_451) = (g_86[1] > (!(p_36 , (p_36 = (18446744073709551615UL && (safe_unary_minus_func_int64_t_s(p_36)))))))) >= ((l_1295 == (void*)0) == (*l_66))) , (((!((g_83++) > g_1300)) && 0x27EE68EDEABE1D05LL) & (*g_398)))) || g_8); (*g_143) = &p_36; l_1290 = ((*g_707) = &p_36); } l_1307--; if ((((*l_1310) |= g_452) != (((((*l_1302) , 0L) > (*l_1301)) , 0xF9L) >= ((*l_66) == 255UL)))) { /* block id: 545 */ int8_t l_1311 = 0xB6L; int32_t l_1312 = 1L; int32_t l_1313[9][5] = {{(-2L),(-2L),7L,(-2L),(-2L)},{(-1L),0x9328354FL,(-1L),(-1L),0x9328354FL},{(-2L),(-8L),(-8L),(-2L),(-8L)},{0x9328354FL,0x9328354FL,0x75F210A3L,0x9328354FL,0x9328354FL},{(-8L),(-2L),(-8L),(-8L),(-2L)},{0x9328354FL,(-1L),(-1L),0x9328354FL,(-1L)},{(-2L),(-2L),7L,(-2L),(-2L)},{(-1L),0x9328354FL,(-1L),(-1L),0x9328354FL},{(-2L),(-8L),(-8L),(-2L),(-8L)}}; int32_t l_1315 = 0L; union U0 **l_1331 = &g_1080; uint32_t *l_1343 = &g_137[2]; int i, j; --l_1317; (*g_236) = (((safe_mul_func_int64_t_s_s(p_36, ((safe_add_func_uint16_t_u_u((safe_rshift_func_int16_t_s_u((((*l_1343) = (safe_mul_func_uint16_t_u_u((*g_398), ((((safe_div_func_int8_t_s_s((!((*l_1301) = (((p_36 , (((g_1332 = l_1331) == &g_1080) < p_36)) == ((*l_1310) = (p_36 , (safe_rshift_func_int8_t_s_u((+(safe_mul_func_int8_t_s_s((safe_div_func_int32_t_s_s(((p_36 < (safe_mul_func_uint64_t_u_u((p_36 && 0x616883DAL), 1UL))) < l_1313[0][1]), l_1313[1][4])), p_36))), p_36))))) >= g_1247))), (-1L))) < p_36) && 5L) == l_1342)))) , (-3L)), 0)), 7UL)) ^ (*g_398)))) ^ 0x2478B4BEL) | p_36); } else { /* block id: 552 */ int64_t ***l_1346 = &g_1344; const int32_t l_1354 = (-1L); int32_t l_1360[5]; int16_t *l_1384 = &g_8; union U0 * const l_1416 = &l_49; uint32_t *l_1487 = &g_220; int8_t **l_1491 = (void*)0; int8_t ***l_1490 = &l_1491; uint64_t *****l_1546 = (void*)0; uint16_t *l_1563 = (void*)0; uint16_t *l_1564 = (void*)0; uint16_t *l_1565 = (void*)0; uint16_t *l_1566 = &l_1342; int64_t *l_1571 = &g_239[0][0][1]; const uint32_t l_1583 = 0x8407C0E6L; uint32_t ***l_1599 = &g_1165; const uint8_t l_1606 = 0xCDL; int32_t l_1609 = 0x6D3B180AL; int32_t l_1613 = 1L; int32_t l_1617 = (-6L); int32_t *l_1625 = &g_63; int64_t l_1626[10] = {0xF034B09F980EC8A5LL,0xF034B09F980EC8A5LL,(-1L),0xF034B09F980EC8A5LL,0xF034B09F980EC8A5LL,(-1L),0xF034B09F980EC8A5LL,0xF034B09F980EC8A5LL,(-1L),0xF034B09F980EC8A5LL}; uint16_t l_1645 = 0xED1FL; uint8_t *****l_1649 = &g_1640; uint64_t *l_1650 = &l_1317; uint32_t ****l_1652 = &l_1599; uint32_t *****l_1651 = &l_1652; int8_t l_1675 = (-1L); int32_t *l_1801 = &l_1306; int8_t l_1890[5][9][5] = {{{0x45L,(-5L),0xDFL,0xA1L,0xA1L},{(-3L),0x8CL,(-3L),0xCEL,0xBAL},{0xDFL,(-5L),0x45L,0x61L,0x07L},{0L,(-1L),(-1L),0L,(-3L)},{(-1L),0x58L,0x45L,0x07L,(-5L)},{(-1L),0L,(-3L),0L,(-1L)},{0x58L,0x61L,0xDFL,(-5L),0L},{(-3L),0L,(-1L),(-1L),0L},{0x61L,0x92L,0xDFL,0x58L,0L}},{{0x8CL,(-1L),1L,0L,1L},{0L,0L,(-1L),0x61L,(-1L)},{0x8CL,(-1L),(-3L),0L,0L},{0x61L,0x07L,0x61L,0x45L,(-5L)},{(-3L),(-1L),0x8CL,0L,2L},{(-1L),0L,0L,(-1L),0x61L},{1L,(-1L),0x8CL,2L,(-1L)},{0xDFL,0x92L,0x61L,0x92L,0xDFL},{(-1L),0L,(-3L),2L,0xCEL}},{{0xA1L,0x58L,(-1L),(-1L),0x58L},{0L,0x8CL,1L,0L,0xCEL},{0x92L,(-1L),0xDFL,0x45L,0xDFL},{0xCEL,0xCEL,(-1L),0L,(-1L)},{0x92L,(-1L),0xA1L,0x61L,0x61L},{0L,0xBAL,0L,0L,2L},{0xA1L,(-1L),0x92L,0x58L,(-5L)},{(-1L),0xCEL,0xCEL,(-1L),0L},{0xDFL,(-1L),0x92L,(-5L),(-1L)}},{{1L,0x8CL,0L,0x8CL,1L},{(-1L),0x58L,0xA1L,(-5L),0L},{(-3L),0L,(-1L),(-1L),0L},{0x61L,0x92L,0xDFL,0x58L,0L},{0x8CL,(-1L),1L,0L,1L},{0L,0L,(-1L),0x61L,(-1L)},{0x8CL,(-1L),(-3L),0L,0L},{0x61L,0x07L,0x61L,0x45L,(-5L)},{(-3L),(-1L),0x8CL,0L,2L}},{{(-1L),0L,0L,(-1L),0x61L},{1L,(-1L),0x8CL,2L,(-1L)},{0xDFL,0x92L,0x61L,0x92L,0xDFL},{(-1L),0L,(-3L),2L,0xCEL},{0xA1L,0x58L,(-1L),(-1L),0x58L},{0L,0x8CL,1L,0L,0xCEL},{0x92L,(-1L),0xDFL,0x45L,0xDFL},{0xCEL,0xCEL,(-1L),0L,(-1L)},{0x92L,(-1L),0xA1L,0x61L,0x58L}}}; int i, j, k; for (i = 0; i < 5; i++) l_1360[i] = (-1L); if ((((*l_1346) = g_1344) != &g_1345)) { /* block id: 554 */ int32_t ***l_1349[1][5][2] = {{{&g_707,&g_707},{&g_707,&g_707},{&g_707,&g_707},{&g_707,&g_707},{&g_707,&g_707}}}; int32_t l_1375 = 0xDC353209L; uint8_t *l_1396 = &g_1300; int32_t l_1424 = 0xC59237F5L; int32_t *l_1437 = &g_63; int64_t *l_1444 = &l_1314[6][4][0]; uint64_t **l_1482 = &l_58; uint64_t ***l_1504 = &l_1482; uint64_t **** const l_1503 = &l_1504; int i, j, k; if (((safe_mul_func_uint64_t_u_u(((*l_1346) != (void*)0), ((((l_1350 = &l_1302) != (l_1351[5][0][2] = (void*)0)) ^ p_36) < (safe_rshift_func_uint8_t_u_u(9UL, l_1354))))) >= (safe_mul_func_int64_t_s_s(((((l_1360[0] = (p_36 != ((safe_sub_func_int32_t_s_s((+p_36), g_312.f0)) >= 0x49A7CCD125DCDF55LL))) < p_36) > p_36) & p_36), 0x2A406B8A3E771BF1LL)))) { /* block id: 558 */ int32_t ***l_1361 = &g_143; const int64_t *l_1368[4] = {&g_239[0][0][1],&g_239[0][0][1],&g_239[0][0][1],&g_239[0][0][1]}; int i; if (((l_1349[0][1][0] = l_1361) != ((*g_318) , &l_1350))) { /* block id: 560 */ return p_36; } else { /* block id: 562 */ int64_t *l_1365 = (void*)0; int64_t *l_1366[4][9] = {{&l_1314[0][7][0],(void*)0,(void*)0,&g_239[2][1][0],&l_1314[6][4][0],&l_1314[6][4][0],&g_239[2][1][0],(void*)0,(void*)0},{&l_1314[6][4][0],&g_239[0][0][1],&g_239[2][2][0],&g_239[0][0][1],&g_239[0][0][1],(void*)0,&l_1314[6][4][0],&l_1314[6][4][0],(void*)0},{&g_239[0][0][1],(void*)0,(void*)0,(void*)0,&g_239[0][0][1],&g_239[0][0][1],&g_239[0][1][1],&g_239[2][2][0],&g_239[2][1][0]},{&g_239[0][1][1],&g_239[0][0][1],&g_239[0][0][1],(void*)0,(void*)0,(void*)0,&g_239[0][0][1],&g_239[0][0][1],&g_239[0][1][1]}}; int32_t l_1367 = 0L; int32_t ****l_1377 = &l_1361; int32_t *****l_1376[5][4][1]; int i, j, k; for (i = 0; i < 5; i++) { for (j = 0; j < 4; j++) { for (k = 0; k < 1; k++) l_1376[i][j][k] = &l_1377; } } (*g_143) = (((safe_div_func_int64_t_s_s(((((safe_unary_minus_func_uint64_t_u(((p_36 | (l_1367 = 0x9CC7B353C2F67D67LL)) ^ ((*g_398) > (p_36 , ((0x00L != (l_1368[3] == l_1368[3])) || (safe_lshift_func_uint16_t_u_s((&g_142[6][0] != (g_1380 = (g_1378 = ((safe_add_func_int16_t_s_s((safe_div_func_int16_t_s_s((l_1375 = 1L), (*g_398))), (*l_1302))) , (void*)0)))), g_59[4][3][3])))))))) > (-3L)) & (*g_451)) || p_36), 0x648365AAAD2D054FLL)) < (*g_451)) , (void*)0); for (l_1316 = (-24); (l_1316 >= 26); ++l_1316) { /* block id: 570 */ (**l_1361) = (**g_579); } } if (g_83) goto lbl_1383; lbl_1383: (*g_707) = (*g_143); for (l_1307 = 2; (l_1307 <= 9); l_1307 += 1) { /* block id: 578 */ uint8_t *l_1397 = &g_83; int32_t l_1402 = (-2L); const int32_t *l_1411 = &l_1316; const int32_t **l_1410 = &l_1411; const int32_t ***l_1409[3][10][7] = {{{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,(void*)0,&l_1410,&l_1410,&l_1410,(void*)0,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,(void*)0,&l_1410,&l_1410,(void*)0,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,(void*)0,&l_1410,&l_1410,&l_1410,&l_1410}},{{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,(void*)0,&l_1410,&l_1410,&l_1410,(void*)0,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,(void*)0,&l_1410,&l_1410,(void*)0,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,(void*)0,&l_1410,&l_1410,&l_1410,&l_1410}},{{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{(void*)0,(void*)0,(void*)0,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{(void*)0,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410},{&l_1410,(void*)0,&l_1410,&l_1410,&l_1410,&l_1410,&l_1410}}}; int i, j, k; for (l_1305 = 0; (l_1305 <= 5); l_1305 += 1) { /* block id: 581 */ int16_t **l_1385 = &l_42; int32_t l_1393 = 0x3476407EL; uint8_t **l_1398 = (void*)0; uint8_t **l_1399 = &l_1397; int i; (*g_707) = func_37(((*l_1385) = l_1384), (**l_1361), ((g_86[l_1305] <= (((0x50L != (p_36 , (4294967295UL <= (safe_rshift_func_uint16_t_u_s(((+p_36) < ((safe_rshift_func_uint8_t_u_u(p_36, 1)) , ((safe_lshift_func_uint64_t_u_s(l_1393, 34)) || g_120))), p_36))))) > l_1360[3]) ^ l_1354)) , l_1384), p_36); if (p_36) continue; (*l_1302) &= (safe_add_func_uint16_t_u_u(((*g_398) ^= ((l_1396 = &g_83) == ((*l_1399) = l_1397))), (safe_sub_func_uint16_t_u_u((l_1402 , ((&g_1345 == &g_1345) != (g_502[0] ^ (safe_sub_func_int64_t_s_s((safe_rshift_func_uint16_t_u_u(((safe_mul_func_int64_t_s_s((-10L), ((((void*)0 != l_1409[2][5][5]) != l_1360[3]) == g_1257))) <= p_36), 14)), (-1L)))))), 0x04DFL)))); } for (p_36 = 5; (p_36 >= 0); p_36 -= 1) { /* block id: 592 */ int i; if (g_86[p_36]) break; if ((*g_1199)) break; (*l_1301) = (safe_add_func_int64_t_s_s(1L, (safe_rshift_func_uint64_t_u_u(0UL, p_36)))); (*l_66) ^= ((void*)0 != l_1384); } } for (p_36 = 0; (p_36 <= 2); p_36 += 1) { /* block id: 601 */ return p_36; } } else { /* block id: 604 */ union U0 **l_1417[3][4][5] = {{{&g_1080,&g_1080,&g_1080,&g_1080,&g_1080},{&g_1080,(void*)0,&g_1080,&g_1080,&g_1080},{&g_1080,&g_1080,&g_1080,&g_1080,(void*)0},{&g_1080,(void*)0,&g_1080,&g_1080,&g_1080}},{{&g_1080,&g_1080,&g_1080,&g_1080,&g_1080},{&g_1080,&g_1080,&g_1080,&g_1080,&g_1080},{&g_1080,&g_1080,&g_1080,&g_1080,&g_1080},{&g_1080,(void*)0,&g_1080,&g_1080,&g_1080}},{{&g_1080,&g_1080,&g_1080,&g_1080,(void*)0},{&g_1080,(void*)0,&g_1080,&g_1080,&g_1080},{&g_1080,&g_1080,&g_1080,&g_1080,&g_1080},{&g_1080,&g_1080,&g_1080,&g_1080,&g_1080}}}; union U0 **l_1418 = (void*)0; int i, j, k; (*g_1419) = l_1416; } for (l_1375 = 4; (l_1375 >= 0); l_1375 -= 1) { /* block id: 609 */ return p_36; } for (g_1257 = 0; (g_1257 <= (-5)); g_1257--) { /* block id: 614 */ int32_t l_1425 = 0x43713631L; int32_t l_1426 = (-1L); uint32_t l_1434[5] = {18446744073709551609UL,18446744073709551609UL,18446744073709551609UL,18446744073709551609UL,18446744073709551609UL}; int i; for (g_540 = 0; (g_540 != 24); g_540 = safe_add_func_int32_t_s_s(g_540, 8)) { /* block id: 617 */ uint64_t l_1427 = 0x7DE67EAB36A2C5C5LL; union U0 *l_1432 = &l_49; l_1427++; for (l_1316 = 0; (l_1316 != 0); l_1316 = safe_add_func_int16_t_s_s(l_1316, 8)) { /* block id: 621 */ int32_t l_1433 = 0L; (**g_1379) = &l_1426; (*g_1332) = l_1432; ++l_1434[3]; } (**g_1379) = l_1437; } return p_36; } for (g_540 = 0; (g_540 != 6); g_540 = safe_add_func_int32_t_s_s(g_540, 3)) { /* block id: 632 */ int64_t *l_1443 = (void*)0; int32_t l_1447 = 0x980B3A8CL; int16_t l_1455 = 0xF5D2L; int64_t l_1462[1]; int32_t l_1466 = (-5L); uint8_t l_1485 = 0xC8L; int16_t *l_1486 = &g_526; uint64_t *** const l_1502[6][8] = {{&l_1482,&g_317,(void*)0,&l_1482,&l_1482,(void*)0,&g_317,&l_1482},{&l_1482,&g_317,(void*)0,(void*)0,&l_1482,(void*)0,&l_1482,(void*)0},{&l_1482,(void*)0,&l_1482,&g_317,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,&g_317,&l_1482,&l_1482,&g_317,(void*)0,(void*)0,&l_1482},{(void*)0,&g_317,&l_1482,&g_317,(void*)0,&g_317,&l_1482,&g_317},{&l_1482,&l_1482,(void*)0,&g_317,&l_1482,&g_317,&g_317,&l_1482}}; uint64_t *** const * const l_1501 = &l_1502[1][7]; uint8_t l_1521 = 0xA8L; int64_t l_1523 = (-1L); int32_t l_1542 = 0x7E99B5B2L; int i, j; for (i = 0; i < 1; i++) l_1462[i] = 0xE91355144F92D847LL; (*g_1440) = &g_1183; } } else { /* block id: 664 */ uint64_t ***l_1548 = &g_317; (*l_1302) &= (safe_rshift_func_int64_t_s_u((~((void*)0 == l_1546)), (**g_317))); l_1548 = l_1547; } lbl_1690: if ((safe_mul_func_int16_t_s_s((safe_rshift_func_uint8_t_u_s((safe_mul_func_int64_t_s_s((((safe_rshift_func_uint16_t_u_s((safe_rshift_func_int64_t_s_u((safe_add_func_uint64_t_u_u((((*l_1566) = ((*g_398)--)) != p_36), ((((p_36 != ((*l_1302) |= ((*g_318)++))) & ((l_1360[0] , ((safe_div_func_int32_t_s_s(((((&g_1023 != (((*l_1571) = (-1L)) , ((safe_lshift_func_int64_t_s_u(l_1574, (((safe_div_func_int8_t_s_s(p_36, (safe_lshift_func_uint64_t_u_u(l_1360[1], (safe_div_func_int32_t_s_s((((safe_rshift_func_uint32_t_u_s(((*l_1487) = g_130.f0), 0)) && p_36) <= p_36), l_1360[0])))))) >= l_1583) != 1L))) , &g_1023))) || p_36) == 0x70L) | (-1L)), 0xBD5EE773L)) && p_36)) > l_1360[1])) , p_36) && 0x0D2E98C0L))), 15)), 4)) && g_828) >= 2L), 0x423F08C9E7F3EC2DLL)), 4)), g_8))) { /* block id: 674 */ uint64_t ***l_1594 = (void*)0; int32_t l_1607 = 0L; int32_t l_1615 = 0xC0A2408AL; int32_t l_1616 = 0x7E705719L; int32_t l_1618 = 0xD8D3B5B0L; int32_t l_1620[4] = {0x6E6AC076L,0x6E6AC076L,0x6E6AC076L,0x6E6AC076L}; int i; lbl_1610: (*l_1302) = ((*l_1301) = l_1354); for (g_794 = 0; (g_794 <= 1); g_794 += 1) { /* block id: 679 */ uint32_t ***l_1598 = (void*)0; uint32_t ****l_1597[5][4] = {{&l_1598,&l_1598,(void*)0,&l_1598},{(void*)0,&l_1598,(void*)0,&l_1598},{(void*)0,&l_1598,&l_1598,(void*)0},{(void*)0,&l_1598,&l_1598,&l_1598},{&l_1598,&l_1598,&l_1598,&l_1598}}; const uint32_t ***l_1601 = (void*)0; const uint32_t ****l_1600[6][2][10] = {{{&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601},{&l_1601,&l_1601,(void*)0,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,(void*)0,&l_1601}},{{&l_1601,(void*)0,&l_1601,(void*)0,&l_1601,&l_1601,(void*)0,&l_1601,&l_1601,&l_1601},{&l_1601,&l_1601,(void*)0,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,(void*)0}},{{(void*)0,(void*)0,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,(void*)0},{&l_1601,&l_1601,&l_1601,(void*)0,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601}},{{(void*)0,(void*)0,&l_1601,&l_1601,(void*)0,&l_1601,&l_1601,&l_1601,(void*)0,(void*)0},{&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,(void*)0,(void*)0,&l_1601,&l_1601}},{{(void*)0,(void*)0,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,(void*)0},{&l_1601,&l_1601,&l_1601,(void*)0,&l_1601,&l_1601,&l_1601,&l_1601,(void*)0,&l_1601}},{{&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601},{&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,&l_1601,(void*)0,&l_1601,&l_1601,&l_1601}}}; int32_t l_1611[3][3][10] = {{{0x51B34EFEL,1L,0x51B34EFEL,0x4CA1D912L,(-1L),(-6L),0x3EC5DA94L,0x3EC5DA94L,(-6L),(-1L)},{4L,0x768EC989L,0x768EC989L,4L,0x51B34EFEL,0x1BE1B80BL,0x4CA1D912L,0x3EC5DA94L,0x4CA1D912L,0x1BE1B80BL},{(-6L),9L,0x51B34EFEL,9L,(-6L),3L,0x768EC989L,0x4CA1D912L,0x4CA1D912L,0x768EC989L}},{{0x3EC5DA94L,3L,4L,4L,3L,0x3EC5DA94L,(-1L),0x768EC989L,(-6L),0x768EC989L},{9L,4L,(-6L),0x4CA1D912L,(-6L),4L,9L,(-1L),0x1BE1B80BL,0x1BE1B80BL},{9L,0x1BE1B80BL,0x3EC5DA94L,0x51B34EFEL,3L,0x51B34EFEL,(-6L),1L,4L,0x1BE1B80BL}},{{0x51B34EFEL,(-6L),1L,4L,0x1BE1B80BL,4L,1L,(-6L),0x51B34EFEL,3L},{0x3EC5DA94L,0x768EC989L,1L,0x1BE1B80BL,(-6L),(-6L),0x1BE1B80BL,1L,0x768EC989L,0x3EC5DA94L},{0x768EC989L,4L,0x51B34EFEL,0x1BE1B80BL,0x4CA1D912L,0x3EC5DA94L,0x4CA1D912L,0x1BE1B80BL,0x51B34EFEL,4L}}}; int i, j, k; (**g_1379) = func_77(g_137[(g_794 + 5)], &g_8, ((safe_lshift_func_int8_t_s_u((~(g_86[g_794] && ((~((((p_36 < p_36) < (safe_rshift_func_uint32_t_u_s(((((*l_1302) = (safe_sub_func_uint8_t_u_u((safe_rshift_func_uint64_t_u_s((((l_1594 == ((safe_add_func_int32_t_s_s(((((l_1599 = &g_1165) != (l_1602 = (void*)0)) && (safe_rshift_func_uint64_t_u_s((g_1224 ^ 0x7691L), 20))) != 0xD8AFL), l_1606)) , (void*)0)) == l_1607) <= g_1522), 51)), 8UL))) != 0x28E087AEL) , g_1247), 2))) && (*g_398)) >= l_1354)) , (*l_66)))), g_828)) , p_36), p_36); for (g_1224 = 1; (g_1224 <= 5); g_1224 += 1) { /* block id: 686 */ const uint64_t *l_1608 = &l_1317; int32_t l_1612 = 0xF2B4EA32L; int32_t l_1614[9]; int i; for (i = 0; i < 9; i++) l_1614[i] = (-1L); for (l_1307 = 1; (l_1307 <= 5); l_1307 += 1) { /* block id: 689 */ l_1609 = (l_1360[4] = ((**l_1547) == l_1608)); } if (l_1317) goto lbl_1610; l_1622++; for (p_36 = 1; (p_36 >= 0); p_36 -= 1) { /* block id: 697 */ int i, j, k; (*g_143) = l_1625; if (g_239[p_36][g_794][p_36]) break; if (l_1618) continue; } for (l_1304 = 1; (l_1304 >= 0); l_1304 -= 1) { /* block id: 704 */ if (p_36) break; (*l_1301) &= 0x9B2FEB7DL; return (*g_398); } } } l_1615 ^= ((*l_1625) = (*l_1302)); } else { /* block id: 713 */ uint8_t ****l_1638 = (void*)0; uint8_t *****l_1639[6] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; int16_t *l_1644[9][4]; int i, j; for (i = 0; i < 9; i++) { for (j = 0; j < 4; j++) l_1644[i][j] = &g_526; } (*l_1301) &= (l_1626[7] != ((safe_rshift_func_uint64_t_u_u(((((safe_add_func_int32_t_s_s(((((safe_div_func_int8_t_s_s((((*l_1571) = ((void*)0 == &g_1074)) || ((p_36 , ((*l_1625) = (g_526 = (((safe_div_func_uint64_t_u_u((*l_1625), 0x36ECB18FDBD4A20DLL)) & 0xEEB0L) != ((*l_1571) ^= (safe_sub_func_uint64_t_u_u((l_1637 == (g_1640 = l_1638)), (*l_1625)))))))) > p_36)), 0x65L)) & p_36) && 0x4A2241D6L) >= 0x3993145FL), g_137[6])) , 0x501E089694402898LL) > l_1645) , 0xFE4F1E40143FB4C0LL), 15)) , p_36)); } if ((p_36 || (((((*l_66) , (safe_rshift_func_int32_t_s_u(((((void*)0 == (*l_1547)) | 0xCCCCB10A6CBD9001LL) ^ (((*g_318) & (((*l_1651) = (((!0x15013FC4A29A517ALL) == (((l_1649 != (((*l_1650) = (*l_1625)) , &l_1637)) , 0xBEA9L) && 4UL)) , &l_1599)) != g_1653[6][3][0])) != (-9L))), g_134[3]))) != p_36) ^ (*l_1302)) | g_1224))) { /* block id: 723 */ int64_t l_1684 = (-4L); int32_t l_1685 = (-1L); uint16_t l_1686[1]; int32_t l_1687 = (-3L); int i; for (i = 0; i < 1; i++) l_1686[i] = 0xCC6EL; l_1687 |= (safe_mul_func_uint16_t_u_u((*g_398), ((safe_mod_func_uint8_t_u_u((((safe_lshift_func_int64_t_s_s((((*g_451) = (safe_add_func_uint64_t_u_u(((*l_1650) ^= ((*g_1655) != (((safe_lshift_func_int16_t_s_u((g_526 = (safe_lshift_func_uint8_t_u_u(p_36, 2))), 3)) <= (*g_398)) , func_77((l_1685 &= ((((p_36 == (safe_rshift_func_uint8_t_u_u((safe_mul_func_int8_t_s_s((*g_451), (l_1675 = ((*g_1643)--)))), 1))) < (safe_add_func_int64_t_s_s((safe_rshift_func_int32_t_s_u(((((((safe_lshift_func_uint32_t_u_s((((*g_398) , ((safe_mod_func_uint16_t_u_u(p_36, 2L)) || p_36)) & 0x576FL), 6)) != 0xB36DB58148E9B1FFLL) , (void*)0) != &g_1344) < l_1684) > (*g_398)), p_36)), (*l_1625)))) ^ (*l_1625)) && p_36)), l_42, p_36, p_36)))), l_1684))) | 0x98L), p_36)) ^ 8L) || (*l_1625)), l_1686[0])) != (*l_1625)))); for (g_83 = 14; (g_83 <= 12); g_83 = safe_sub_func_int32_t_s_s(g_83, 2)) { /* block id: 733 */ int32_t *l_1693[4]; int i; for (i = 0; i < 4; i++) l_1693[i] = &l_1617; if (l_1645) goto lbl_1690; for (l_1304 = 0; (l_1304 < (-18)); l_1304 = safe_sub_func_int16_t_s_s(l_1304, 2)) { /* block id: 737 */ if (p_36) break; return p_36; } if (p_36) continue; l_1693[3] = (*g_143); } } else { /* block id: 744 */ uint32_t l_1697 = 0x5ADC332EL; int32_t l_1704 = 0x1A1245BEL; int32_t l_1705 = 0x271D2EF8L; int32_t l_1706 = 4L; int32_t l_1707 = 0x6523884CL; int32_t l_1708 = 6L; int32_t l_1709 = 6L; int32_t l_1710[9][2] = {{1L,0xFAC970DFL},{0xFAC970DFL,1L},{0xFAC970DFL,0xFAC970DFL},{1L,0xFAC970DFL},{0xFAC970DFL,1L},{0xFAC970DFL,0xFAC970DFL},{1L,0xFAC970DFL},{0xFAC970DFL,1L},{0xFAC970DFL,0xFAC970DFL}}; int i, j; for (l_1574 = (-28); (l_1574 != 1); ++l_1574) { /* block id: 747 */ int16_t l_1696 = 0x30EDL; int32_t l_1700 = 0L; int32_t l_1702[10][6] = {{(-4L),0xBAE47055L,(-4L),0x2DF7D9E5L,0L,0x2DF7D9E5L},{(-4L),0xBAE47055L,(-4L),0x2DF7D9E5L,0L,0x2DF7D9E5L},{(-4L),0xBAE47055L,(-4L),0x2DF7D9E5L,0L,0x2DF7D9E5L},{(-4L),0xBAE47055L,(-4L),0x2DF7D9E5L,0L,0x2DF7D9E5L},{(-4L),0xBAE47055L,(-4L),0x2DF7D9E5L,0L,0x2DF7D9E5L},{(-4L),0xBAE47055L,(-4L),0x2DF7D9E5L,0L,0x2DF7D9E5L},{(-4L),0xBAE47055L,(-4L),0x2DF7D9E5L,0L,0x2DF7D9E5L},{(-4L),0xBAE47055L,(-4L),0x2DF7D9E5L,0L,0x2DF7D9E5L},{(-4L),0xBAE47055L,(-4L),0x2DF7D9E5L,0L,0x2DF7D9E5L},{(-4L),0xBAE47055L,(-4L),0x2DF7D9E5L,0L,0x2DF7D9E5L}}; int i, j; l_1697--; --l_1711; if (l_1606) goto lbl_1690; } } for (l_1305 = 3; (l_1305 >= 0); l_1305 -= 1) { /* block id: 755 */ const uint8_t l_1722[2] = {0x9BL,0x9BL}; int64_t ** const *l_1740 = &g_1344; uint8_t *l_1749 = &g_1300; uint32_t ***l_1762 = &g_1165; int32_t l_1763 = 5L; int32_t l_1769 = 5L; int32_t l_1770[9] = {(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}; uint16_t *l_1794 = (void*)0; uint32_t ** const *l_1831 = &g_1165; uint32_t ** const * const *l_1830 = &l_1831; uint32_t ** const * const **l_1829[7] = {&l_1830,(void*)0,(void*)0,&l_1830,(void*)0,(void*)0,&l_1830}; int32_t l_1874 = (-1L); int8_t l_1888 = (-1L); uint8_t l_1892 = 0UL; int i; (*l_1302) = (safe_mod_func_uint8_t_u_u(1UL, (*l_1625))); for (g_261 = 0; (g_261 <= 3); g_261 += 1) { /* block id: 759 */ int32_t l_1729 = 0x41D59823L; int32_t l_1730[5][7][7] = {{{0L,(-7L),8L,0x7E50A76EL,0x510641B4L,(-6L),8L},{8L,(-9L),0L,5L,0x7800A0BEL,(-2L),0xCE2B57CEL},{0L,8L,(-2L),1L,(-2L),0x1463DA77L,0x59C7D4FEL},{1L,0x4B228FD8L,0x3C60792BL,8L,(-2L),(-5L),0xB0C3BDF0L},{0xE762CBE7L,0L,0x80D4D9E8L,0x785789DBL,0x7800A0BEL,0L,4L},{8L,0L,(-4L),0x74A570F4L,0x510641B4L,(-1L),(-2L)},{0x7800A0BEL,0L,0xC1D9A72EL,0x1F67724BL,0L,3L,0L}},{{0xF0052E60L,0xA84A61F3L,1L,0xF0052E60L,(-9L),0xF6051579L,0xCA3AE5FAL},{0xE23E31C4L,8L,8L,0L,0x59C7D4FEL,0x59C7D4FEL,0L},{(-9L),0x1F67724BL,(-9L),5L,0xE3E37529L,0xD8594BEBL,0x7B026F2BL},{(-6L),(-9L),0xE3E37529L,0L,0x6B6712ABL,6L,0x4CE866B4L},{0L,0x510641B4L,(-10L),(-5L),(-6L),0xD8594BEBL,0xCFE3CF03L},{0L,6L,0L,0x94F41749L,0x42F61533L,0x59C7D4FEL,(-10L)},{0L,0xF467142FL,4L,(-1L),0x42EA4F14L,0xF6051579L,0L}},{{0x488AC491L,0x80555080L,1L,0x47B4CD91L,0x74A570F4L,0xE3E37529L,0xAAF70A83L},{(-5L),(-4L),0L,(-1L),0xD772EE6AL,(-1L),0xF20CB931L},{0x7B026F2BL,(-1L),0xD8594BEBL,1L,0x80D4D9E8L,0xCE2B57CEL,0x36AD3A96L},{(-4L),0x8BCC84F0L,(-1L),0xF6051579L,(-1L),0x80D4D9E8L,(-1L)},{0xA84A61F3L,0x4CE866B4L,0xC1D9A72EL,0xF467142FL,6L,0x42F61533L,(-1L)},{4L,(-1L),0xCFE3CF03L,(-9L),(-1L),0xB0C3BDF0L,0x36AD3A96L},{8L,0x6B6712ABL,0x7E50A76EL,(-4L),0L,0x47B4CD91L,0xF20CB931L}},{{0x7800A0BEL,0x59C7D4FEL,0xF0052E60L,(-2L),(-5L),0x80555080L,0xAAF70A83L},{0x1F67724BL,0x785789DBL,(-1L),8L,0x510641B4L,8L,0L},{0x8BCC84F0L,0xC68CD51BL,7L,0x30EFBFE9L,1L,(-10L),(-10L)},{0x90AEE8F6L,0xD4AE2788L,0L,0xD4AE2788L,0x90AEE8F6L,0L,0xCFE3CF03L},{0xC5B1FF19L,(-2L),(-7L),0x7B026F2BL,0L,(-1L),0x4CE866B4L},{0x59C7D4FEL,(-1L),0x7800A0BEL,(-1L),0L,5L,0x7B026F2BL},{0xC5B1FF19L,0x7B026F2BL,6L,0x80555080L,0L,0xC58B87C3L,0L}},{{0x90AEE8F6L,0x4CCF1BE2L,(-2L),(-9L),0L,0L,0xCA3AE5FAL},{0x8BCC84F0L,0x4B228FD8L,1L,0L,0x36AD3A96L,8L,(-1L)},{0x1F67724BL,0xCFE3CF03L,(-1L),0xD8594BEBL,0x4CE866B4L,(-9L),0xB0C3BDF0L},{0x7800A0BEL,0xA84A61F3L,(-1L),0xA7127844L,8L,0x8BCC84F0L,6L},{8L,0x42F61533L,6L,0xF20CB931L,0x30EFBFE9L,0xB25BC273L,0x94F41749L},{4L,(-10L),0x4B228FD8L,0xE762CBE7L,0x6B788EC7L,(-9L),(-1L)},{0xA84A61F3L,(-10L),5L,(-4L),0L,0x30EFBFE9L,8L}}}; int32_t l_1731[5][10] = {{(-10L),(-10L),0x0C28EF23L,0x0C28EF23L,(-10L),(-10L),0x0C28EF23L,0x0C28EF23L,(-10L),(-10L)},{(-10L),0x0C28EF23L,0x0C28EF23L,(-10L),(-10L),0x0C28EF23L,0x0C28EF23L,(-10L),(-10L),0x0C28EF23L},{(-10L),(-10L),0x0C28EF23L,0x0C28EF23L,(-10L),(-10L),0x0C28EF23L,0x0C28EF23L,(-10L),(-10L)},{(-10L),0x0C28EF23L,0x0C28EF23L,(-10L),(-10L),0x0C28EF23L,0x0C28EF23L,(-10L),(-10L),0x0C28EF23L},{(-10L),(-10L),0x0C28EF23L,0x0C28EF23L,(-10L),(-10L),0x0C28EF23L,0x0C28EF23L,(-10L),(-10L)}}; int8_t *** const l_1745[3][2][3] = {{{&l_1491,&l_1491,&l_1491},{&l_1491,&l_1491,&l_1491}},{{&l_1491,&l_1491,&l_1491},{&l_1491,&l_1491,&l_1491}},{{&l_1491,&l_1491,&l_1491},{&l_1491,&l_1491,&l_1491}}}; uint8_t *l_1751 = &g_1300; uint32_t l_1823[10][8][3] = {{{4294967295UL,1UL,0xCBBD640DL},{1UL,4294967295UL,4294967294UL},{4294967295UL,0x9375DEFAL,4294967295UL},{0x5C19B97DL,4294967295UL,0x0EFBB75BL},{0UL,0xFAABF9CDL,0xCA90F419L},{4294967290UL,0UL,0xEEE8E81DL},{4294967295UL,0x3EF2A568L,5UL},{0x7DE11C74L,0xA15D804EL,0x931ED854L}},{{0xD6837DD4L,4294967295UL,0xC169690FL},{4UL,0x96DDD8FBL,7UL},{4294967288UL,0xC8CF76ABL,4294967295UL},{4294967288UL,4294967288UL,0xD6837DD4L},{4UL,0x39472F76L,4294967295UL},{0xD6837DD4L,4294967288UL,4UL},{0x7DE11C74L,4294967290UL,0xCBBD640DL},{4294967295UL,0xCA90F419L,0UL}},{{4294967290UL,4294967294UL,0x668489F8L},{0UL,1UL,0x5C19B97DL},{0x5C19B97DL,4294967291UL,0x6572FDF2L},{4294967295UL,0x5C0CC08BL,4294967295UL},{1UL,0x3EF2A568L,0x3AA58588L},{4294967295UL,0xFAABF9CDL,4294967295UL},{4294967295UL,5UL,4294967289UL},{4294967291UL,0UL,5UL}},{{4294967288UL,0x8D4B2965L,0xADA947C6L},{0x0EFBB75BL,4294967291UL,5UL},{4UL,0xEEE8E81DL,0xEEE8E81DL},{0x76080292L,1UL,0UL},{0UL,4294967288UL,0x9E1A92F9L},{1UL,4294967295UL,0xDE433EEEL},{4294967292UL,0x7DE11C74L,4UL},{4294967288UL,4294967295UL,0x5C19B97DL}},{{1UL,4294967288UL,4294967295UL},{4294967290UL,1UL,1UL},{5UL,0xEEE8E81DL,0x23B1CF08L},{0x0B40084FL,4294967291UL,4294967294UL},{0xC8CF76ABL,0x8D4B2965L,0xDE433EEEL},{1UL,0UL,0x3AA58588L},{0UL,5UL,4294967295UL},{0x39472F76L,0xFAABF9CDL,1UL}},{{0xFBC0A035L,4294967295UL,4294967291UL},{0xC71E7ACAL,0x7DE11C74L,0xCBBD640DL},{0UL,0xFBC0A035L,0xD6837DD4L},{5UL,0x851E595CL,0x6572FDF2L},{4294967295UL,0xB97B3B62L,4294967295UL},{4294967292UL,4294967295UL,4294967294UL},{0UL,0xEEE8E81DL,0xBF37D38AL},{1UL,0UL,0UL}},{{0xC71E7ACAL,0x96DDD8FBL,0UL},{0xBB558768L,0x5C0CC08BL,4294967293UL},{1UL,0x10CFF29DL,4294967293UL},{0x0EFBB75BL,4UL,0UL},{0x125D31ADL,0xE1522C5FL,0UL},{0x7AD38832L,4294967288UL,0xBF37D38AL},{1UL,4294967295UL,4294967294UL},{0UL,4294967291UL,4294967295UL}},{{7UL,0x0EFBB75BL,0x6572FDF2L},{0xE1522C5FL,4294967289UL,0xD6837DD4L},{0x3EF2A568L,7UL,0xCBBD640DL},{4294967294UL,0xE1522C5FL,4294967291UL},{0UL,0UL,0x851E595CL},{4294967295UL,0x7AD38832L,0x9375DEFAL},{0x009905F4L,0x9375DEFAL,0x2B81436CL},{0x2B04F408L,0xEEE8E81DL,4294967295UL}},{{0xF06EEE74L,0xC71E7ACAL,4294967295UL},{0x3EF2A568L,7UL,0UL},{0x3741FE13L,4294967295UL,0x3741FE13L},{0x96DDD8FBL,0x16C5D946L,0xE1522C5FL},{0x0EFBB75BL,4294967295UL,0x125D31ADL},{0x1F19F209L,0x3741FE13L,0x931ED854L},{0xB97B3B62L,4294967288UL,4294967295UL},{0x1F19F209L,4294967289UL,0xC8CF76ABL}},{{0x0EFBB75BL,0x3AA58588L,4294967295UL},{0x96DDD8FBL,0UL,4294967295UL},{0x3741FE13L,0UL,0UL},{0x3EF2A568L,0x7DE11C74L,0x0B40084FL},{0xF06EEE74L,0x3741FE13L,0x9E1A92F9L},{0x2B04F408L,0UL,0x6572FDF2L},{0x009905F4L,0x10CFF29DL,0x8D4B2965L},{4294967295UL,0UL,0x2B81436CL}}}; int16_t l_1846 = (-3L); int i, j, k; } for (g_452 = 3; (g_452 >= 0); g_452 -= 1) { /* block id: 840 */ const uint32_t ***l_1861 = &g_1859; int32_t l_1862 = 0L; uint64_t l_1873 = 0xF26AAE2F8A2D26CDLL; union U0 *l_1882 = &g_130; int32_t l_1883 = 0x208CF0F4L; int32_t l_1884 = 3L; int32_t l_1885 = 0xA32D05C8L; int32_t l_1886 = 0x964366E7L; int32_t l_1887 = (-1L); int32_t l_1889 = 0L; int32_t l_1891[3]; int i; for (i = 0; i < 3; i++) l_1891[i] = (-7L); if (p_36) break; l_1874 ^= (((l_1853[1] == (void*)0) , ((p_36 <= ((safe_add_func_uint8_t_u_u(((((*l_1861) = g_1859) != ((**l_1652) = (**l_1652))) < (-1L)), (l_1862 = p_36))) == ((safe_div_func_int8_t_s_s(((((safe_mod_func_int16_t_s_s((safe_mul_func_int16_t_s_s(g_1300, (safe_add_func_int32_t_s_s((safe_lshift_func_int16_t_s_s((g_526 = ((l_1763 = p_36) , 0xAC6FL)), 4)), (*l_1625))))), 0x9D33L)) ^ p_36) == l_1873) && (**g_1822)), 1UL)) ^ 0xA6L))) , (-5L))) == p_36); (*l_1302) ^= (safe_lshift_func_int8_t_s_u((safe_lshift_func_int16_t_s_u(p_36, 7)), (&l_1625 != ((safe_sub_func_int16_t_s_s((l_1770[1] = (0x1EB2L & p_36)), (l_1769 = (((*g_1419) = (l_1881 = (*g_1079))) != l_1882)))) , &l_1625)))); l_1892--; for (g_1291 = 3; (g_1291 >= 0); g_1291 -= 1) { /* block id: 856 */ if (l_1873) break; } } } } return p_36; } /* ------------------------------------------ */ /* * reads : * writes: */ static int32_t * func_37(int16_t * p_38, int32_t * p_39, int16_t * p_40, int32_t p_41) { /* block id: 528 */ return p_39; } /* ------------------------------------------ */ /* * reads : g_526 g_451 g_452 g_236 g_711 g_707 * writes: g_526 g_63 g_711 */ static int32_t * func_43(union U0 p_44, uint16_t * p_45, uint32_t p_46, int32_t p_47, int32_t p_48) { /* block id: 399 */ int32_t l_924[3]; int16_t *l_929 = &g_526; int8_t **l_955 = (void*)0; uint8_t l_958[4][5]; uint64_t * const l_963 = &g_59[7][0][2]; uint16_t l_990 = 0x11A0L; int8_t l_1050 = 0x92L; const int16_t *l_1073[10][1] = {{&g_1074},{&g_1074},{&g_1074},{&g_1074},{&g_1074},{&g_1074},{&g_1074},{&g_1074},{&g_1074},{&g_1074}}; int8_t l_1083[2][2]; uint32_t l_1085 = 0x00135576L; const uint64_t *l_1120 = (void*)0; const uint64_t **l_1119 = &l_1120; const uint64_t ***l_1118 = &l_1119; int32_t l_1133 = 0x3616818BL; uint16_t l_1171 = 0x4DF2L; int32_t l_1258 = (-6L); uint16_t l_1267 = 0x1BCCL; int i, j; for (i = 0; i < 3; i++) l_924[i] = 0L; for (i = 0; i < 4; i++) { for (j = 0; j < 5; j++) l_958[i][j] = 1UL; } for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) l_1083[i][j] = (-3L); } (*g_236) = ((safe_sub_func_uint8_t_u_u((safe_lshift_func_int32_t_s_s((((void*)0 == &g_318) != (safe_mul_func_int64_t_s_s(0x877CBFC6A2076F79LL, (l_924[1] | 0xCEFC86E5L)))), (safe_rshift_func_int64_t_s_s(((l_924[1] && (l_924[2] > (p_47 <= (((safe_lshift_func_int16_t_s_u(((*l_929) |= (-1L)), 11)) <= l_924[0]) ^ 1L)))) , g_526), p_46)))), (*g_451))) & (*g_451)); for (g_711 = 0; (g_711 <= 9); g_711 += 1) { /* block id: 404 */ uint32_t l_930 = 1UL; int16_t l_957 = 0x2543L; int32_t l_961 = 0x68FF8DCDL; uint32_t l_962 = 18446744073709551615UL; int32_t l_994[8][8][4] = {{{0x464CAB38L,0xCEBE3FAFL,0x611C6332L,(-4L)},{0x02FA13EAL,0L,0xBDEA18B4L,0xBDEA18B4L},{6L,6L,(-1L),0x049EFEB7L},{5L,0xABC07DE3L,0xD2248F8EL,(-6L)},{(-1L),0xD75EDC8EL,0x376451CCL,0xD2248F8EL},{0x3F638F11L,0xD75EDC8EL,1L,(-6L)},{0xD75EDC8EL,0xABC07DE3L,0L,0x049EFEB7L},{0L,6L,0xCB6699CDL,0xBDEA18B4L}},{{4L,0L,7L,(-4L)},{0x36FC5E23L,0xCEBE3FAFL,(-8L),(-9L)},{0xD2248F8EL,0x049EFEB7L,0L,0x8A37F1FEL},{0xC0D6553CL,(-4L),0xA67A1CECL,0x547CBB45L},{(-9L),1L,(-1L),2L},{0xCEBE3FAFL,1L,(-9L),(-4L)},{0xC0D6553CL,2L,0x73654891L,(-1L)},{1L,0x50D10423L,0xA67A1CECL,0x903B59A9L}},{{6L,0x8A37F1FEL,0xCB2D2CC8L,(-1L)},{0xCB6699CDL,(-1L),0L,0xCB6699CDL},{0L,2L,0xD51530D9L,0x02FA13EAL},{7L,(-8L),1L,(-9L)},{0x226A817FL,0x903B59A9L,0x36FC5E23L,0xD2248F8EL},{0x9CF43BA0L,0x25FF6F62L,3L,0x02FA13EAL},{0x50D10423L,0L,0xE913468FL,0xFA8A6766L},{0x932AE8AFL,(-1L),(-6L),(-1L)}},{{0xCEBE3FAFL,0xB49F38A1L,2L,0x903B59A9L},{0xF3D41279L,0x376451CCL,0xF3D41279L,1L},{(-9L),0xCEBE3FAFL,4L,0x226A817FL},{(-4L),(-9L),(-1L),0xCEBE3FAFL},{0xD51530D9L,0xFFF2EA43L,(-1L),(-4L)},{(-4L),0xED51AEA3L,4L,0x41BD469AL},{(-9L),0x4F34FB87L,0xF3D41279L,0L},{0xF3D41279L,0L,2L,1L}},{{0xCEBE3FAFL,0xBDEA18B4L,(-6L),0x611C6332L},{0x932AE8AFL,(-1L),0xE913468FL,0x9CF43BA0L},{0x50D10423L,1L,3L,2L},{0x9CF43BA0L,0x41BD469AL,0x36FC5E23L,0x90AA7B82L},{0x226A817FL,7L,1L,0L},{7L,1L,0xD51530D9L,0x4F34FB87L},{0L,0x932AE8AFL,0L,0x611C6332L},{0xCB6699CDL,0xD51530D9L,0xCB2D2CC8L,0xED51AEA3L}},{{6L,0L,0xA67A1CECL,(-10L)},{0x90AA7B82L,0x9CF43BA0L,1L,0x41BD469AL},{(-4L),1L,0xB49F38A1L,(-4L)},{(-10L),0xFFF2EA43L,0xB7C4580FL,0x7D290883L},{0L,0xABC07DE3L,0xD75EDC8EL,0x226A817FL},{(-4L),0x7D290883L,1L,1L},{3L,0x376451CCL,0xA67A1CECL,0xCB2D2CC8L},{(-1L),0x8A37F1FEL,0x2B6D7DDFL,(-1L)}},{{0xCB6699CDL,6L,6L,0xCB6699CDL},{0x73654891L,0L,0xD51530D9L,0xD9F6D32EL},{0x41BD469AL,(-8L),5L,0xD2248F8EL},{0x226A817FL,0xCB2D2CC8L,0xFA8A6766L,0xD2248F8EL},{0x4F34FB87L,(-8L),3L,0xD9F6D32EL},{0x376451CCL,0L,6L,0xCB6699CDL},{0x932AE8AFL,6L,9L,(-1L)},{0x7D290883L,0x8A37F1FEL,2L,0xCB2D2CC8L}},{{0xCCD2EFFFL,0x376451CCL,0x547CBB45L,1L},{(-9L),0x7D290883L,0x50D10423L,0x226A817FL},{(-4L),0xABC07DE3L,(-1L),0x7D290883L},{0xBDEA18B4L,0xFFF2EA43L,0L,(-4L)},{(-4L),1L,0x50D10423L,0x41BD469AL},{0xA67A1CECL,0x9CF43BA0L,0xF3D41279L,(-10L)},{0xCCD2EFFFL,0L,0x0CBD54F8L,0xED51AEA3L},{(-10L),(-6L),0x0CBD54F8L,2L}}}; uint16_t l_997 = 1UL; uint64_t **l_1052 = &g_318; int8_t **l_1075 = &g_451; int32_t l_1084 = 0x77A2BF4EL; uint32_t *l_1164 = &l_962; uint32_t **l_1163 = &l_1164; uint64_t ***l_1177 = &l_1052; uint64_t ****l_1176 = &l_1177; uint64_t l_1192 = 0xE4211D5349C06AFELL; const uint32_t l_1196 = 0xADA89BECL; int64_t l_1255 = 0xC2E5FA98D0C7819CLL; uint16_t l_1272 = 65535UL; int32_t *l_1283 = (void*)0; int32_t *l_1284 = &l_924[2]; int i, j, k; if (p_44.f0) break; } return (*g_707); } /* ------------------------------------------ */ /* * reads : * writes: */ static uint16_t * func_50(int32_t * p_51) { /* block id: 8 */ uint64_t * const l_69 = (void*)0; int32_t l_76 = 0x6201886AL; uint8_t *l_82[1][6][6] = {{{&g_83,(void*)0,&g_83,&g_83,(void*)0,&g_83},{&g_83,&g_83,&g_83,&g_83,&g_83,&g_83},{&g_83,&g_83,&g_83,&g_83,&g_83,&g_83},{&g_83,(void*)0,&g_83,&g_83,(void*)0,&g_83},{&g_83,&g_83,&g_83,&g_83,&g_83,&g_83},{&g_83,&g_83,&g_83,&g_83,&g_83,&g_83}}}; int32_t l_84 = 4L; uint64_t *l_93 = &g_59[7][1][2]; uint64_t **l_92 = &l_93; union U0 l_112[6] = {{0x0CAD1337L},{0x0CAD1337L},{0x0CAD1337L},{0x0CAD1337L},{0x0CAD1337L},{0x0CAD1337L}}; const int32_t l_118 = 0L; int32_t l_122 = 1L; uint16_t *l_164 = &g_165; union U0 l_166 = {0x4D2273A5L}; int32_t l_267[9] = {0L,6L,0L,0L,6L,0L,0L,6L,0L}; uint16_t l_280 = 2UL; int32_t l_340 = 3L; int32_t l_341 = 0x0756A289L; int32_t l_343 = 0x4629C2FFL; int32_t l_347 = 2L; uint8_t l_370 = 0x42L; uint64_t l_373 = 0x3E16D2C6600DF704LL; uint8_t l_380 = 252UL; int64_t l_448[7][10] = {{0x1943BED079876280LL,0xF68BFCF804601D3CLL,0xE1501E2DED0C490ELL,0x4B32BAE79238BF04LL,0x1943BED079876280LL,0x4B32BAE79238BF04LL,0xE1501E2DED0C490ELL,0xF68BFCF804601D3CLL,0x1943BED079876280LL,0xF68BFCF804601D3CLL},{0L,0x4B32BAE79238BF04LL,0xAE3C5E761DEE8267LL,0xB5CB705B32277573LL,0xAE3C5E761DEE8267LL,0x4B32BAE79238BF04LL,0L,0xB5CB705B32277573LL,0L,0x4B32BAE79238BF04LL},{0x1943BED079876280LL,0xB5CB705B32277573LL,(-8L),0xB5CB705B32277573LL,0x1943BED079876280LL,0x0E37F837E54007F7LL,(-8L),0x0E37F837E54007F7LL,0x1943BED079876280LL,0xB5CB705B32277573LL},{0xAE3C5E761DEE8267LL,0xB5CB705B32277573LL,0xAE3C5E761DEE8267LL,0x4B32BAE79238BF04LL,0L,0xB5CB705B32277573LL,0L,0x4B32BAE79238BF04LL,0xAE3C5E761DEE8267LL,0xB5CB705B32277573LL},{0x1943BED079876280LL,0x4B32BAE79238BF04LL,0xE1501E2DED0C490ELL,0xF68BFCF804601D3CLL,0x1943BED079876280LL,0xF68BFCF804601D3CLL,0xE1501E2DED0C490ELL,0x4B32BAE79238BF04LL,0x1943BED079876280LL,0x4B32BAE79238BF04LL},{0L,0xF68BFCF804601D3CLL,0xAE3C5E761DEE8267LL,0x0E37F837E54007F7LL,0xAE3C5E761DEE8267LL,0xF68BFCF804601D3CLL,0L,0x0E37F837E54007F7LL,0L,0xF68BFCF804601D3CLL},{0x1943BED079876280LL,0x0E37F837E54007F7LL,(-8L),0x0E37F837E54007F7LL,0x1943BED079876280LL,0xB5CB705B32277573LL,(-8L),0xB5CB705B32277573LL,0x1943BED079876280LL,0x0E37F837E54007F7LL}}; uint32_t *l_473 = &g_137[6]; int32_t *l_478 = &l_340; int64_t l_479 = 1L; const uint8_t l_480 = 0xC1L; int64_t *l_481 = (void*)0; int64_t *l_482 = (void*)0; int64_t *l_483 = &g_239[0][0][1]; int64_t *l_484 = &l_448[2][2]; int32_t ****l_485 = (void*)0; int32_t ***l_487 = (void*)0; int32_t ****l_486 = &l_487; int32_t **l_596 = &g_236; int32_t **l_708 = &l_478; int32_t *l_713 = (void*)0; int64_t l_808 = (-9L); uint16_t l_850 = 0x7E0EL; int16_t *l_902 = &g_8; int i, j, k; return &g_540; } /* ------------------------------------------ */ /* * reads : * writes: g_63 */ static uint64_t * func_70(uint8_t p_71, int32_t * p_72, uint32_t p_73) { /* block id: 13 */ const int32_t l_89 = 0x8C6C5A51L; int32_t *l_90 = &g_63; uint64_t *l_91 = &g_59[7][1][2]; (*l_90) = l_89; return l_91; } /* ------------------------------------------ */ /* * reads : g_86 * writes: g_86 */ static int32_t * func_77(uint8_t p_78, int16_t * p_79, uint8_t p_80, int32_t p_81) { /* block id: 10 */ int32_t *l_85[2][2][3] = {{{&g_63,&g_63,(void*)0},{&g_63,&g_63,(void*)0}},{{&g_63,&g_63,(void*)0},{&g_63,&g_63,(void*)0}}}; int i, j, k; ++g_86[1]; return l_85[0][0][1]; } /* ---------------------------------------- */ int main (int argc, char* argv[]) { int i, j, k; int print_hash_value = 0; if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1; platform_main_begin(); crc32_gentab(); func_1(); transparent_crc(g_8, "g_8", print_hash_value); for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { transparent_crc(g_13[i][j], "g_13[i][j]", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } for (i = 0; i < 8; i++) { for (j = 0; j < 4; j++) { for (k = 0; k < 5; k++) { transparent_crc(g_59[i][j][k], "g_59[i][j][k]", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_63, "g_63", print_hash_value); transparent_crc(g_83, "g_83", print_hash_value); for (i = 0; i < 6; i++) { transparent_crc(g_86[i], "g_86[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_120, "g_120", print_hash_value); transparent_crc(g_130.f0, "g_130.f0", print_hash_value); for (i = 0; i < 8; i++) { transparent_crc(g_134[i], "g_134[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } for (i = 0; i < 7; i++) { transparent_crc(g_137[i], "g_137[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_165, "g_165", print_hash_value); transparent_crc(g_220, "g_220", print_hash_value); for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { for (k = 0; k < 2; k++) { transparent_crc(g_239[i][j][k], "g_239[i][j][k]", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_261, "g_261", print_hash_value); transparent_crc(g_296, "g_296", print_hash_value); transparent_crc(g_312.f0, "g_312.f0", print_hash_value); transparent_crc(g_452, "g_452", print_hash_value); for (i = 0; i < 7; i++) { transparent_crc(g_502[i], "g_502[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_526, "g_526", print_hash_value); transparent_crc(g_540, "g_540", print_hash_value); transparent_crc(g_711, "g_711", print_hash_value); transparent_crc(g_794, "g_794", print_hash_value); transparent_crc(g_828, "g_828", print_hash_value); transparent_crc(g_1053, "g_1053", print_hash_value); transparent_crc(g_1074, "g_1074", print_hash_value); transparent_crc(g_1224, "g_1224", print_hash_value); transparent_crc(g_1247, "g_1247", print_hash_value); transparent_crc(g_1257, "g_1257", print_hash_value); transparent_crc(g_1291, "g_1291", print_hash_value); transparent_crc(g_1300, "g_1300", print_hash_value); transparent_crc(g_1518, "g_1518", print_hash_value); transparent_crc(g_1522, "g_1522", print_hash_value); for (i = 0; i < 9; i++) { for (j = 0; j < 8; j++) { for (k = 0; k < 1; k++) { transparent_crc(g_1619[i][j][k], "g_1619[i][j][k]", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_1703, "g_1703", print_hash_value); transparent_crc(g_2165, "g_2165", print_hash_value); transparent_crc(g_2252, "g_2252", print_hash_value); transparent_crc(g_2356, "g_2356", print_hash_value); transparent_crc(g_2373, "g_2373", print_hash_value); for (i = 0; i < 6; i++) { transparent_crc(g_2407[i], "g_2407[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2562, "g_2562", print_hash_value); transparent_crc(g_2730, "g_2730", print_hash_value); for (i = 0; i < 6; i++) { for (j = 0; j < 5; j++) { for (k = 0; k < 5; k++) { transparent_crc(g_2764[i][j][k], "g_2764[i][j][k]", print_hash_value); if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); } } } transparent_crc(g_2794, "g_2794", print_hash_value); transparent_crc(g_2830, "g_2830", print_hash_value); transparent_crc(g_2860.f0, "g_2860.f0", print_hash_value); for (i = 0; i < 8; i++) { for (j = 0; j < 7; j++) { transparent_crc(g_2963[i][j], "g_2963[i][j]", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_2969, "g_2969", print_hash_value); transparent_crc(g_3083, "g_3083", print_hash_value); for (i = 0; i < 1; i++) { for (j = 0; j < 6; j++) { transparent_crc(g_3316[i][j], "g_3316[i][j]", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } for (i = 0; i < 6; i++) { transparent_crc(g_3381[i], "g_3381[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_3448, "g_3448", print_hash_value); transparent_crc(g_3449, "g_3449", print_hash_value); transparent_crc(g_3593, "g_3593", print_hash_value); for (i = 0; i < 3; i++) { transparent_crc(g_3612[i], "g_3612[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_3627, "g_3627", print_hash_value); for (i = 0; i < 2; i++) { transparent_crc(g_3635[i], "g_3635[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_3784, "g_3784", print_hash_value); transparent_crc(g_3854, "g_3854", print_hash_value); transparent_crc(g_3866, "g_3866", print_hash_value); transparent_crc(g_4013, "g_4013", print_hash_value); transparent_crc(g_4044, "g_4044", print_hash_value); transparent_crc(g_4053, "g_4053", print_hash_value); transparent_crc(g_4093, "g_4093", print_hash_value); platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); return 0; } /************************ statistics ************************* XXX max struct depth: 0 breakdown: depth: 0, occurrence: 1133 XXX total union variables: 25 XXX non-zero bitfields defined in structs: 1 XXX zero bitfields defined in structs: 0 XXX const bitfields defined in structs: 0 XXX volatile bitfields defined in structs: 0 XXX structs with bitfields in the program: 48 breakdown: indirect level: 0, occurrence: 25 indirect level: 1, occurrence: 14 indirect level: 2, occurrence: 9 XXX full-bitfields structs in the program: 0 breakdown: XXX times a bitfields struct's address is taken: 54 XXX times a bitfields struct on LHS: 2 XXX times a bitfields struct on RHS: 53 XXX times a single bitfield on LHS: 16 XXX times a single bitfield on RHS: 126 XXX max expression depth: 42 breakdown: depth: 1, occurrence: 154 depth: 2, occurrence: 45 depth: 3, occurrence: 4 depth: 4, occurrence: 1 depth: 5, occurrence: 2 depth: 6, occurrence: 1 depth: 8, occurrence: 1 depth: 12, occurrence: 1 depth: 14, occurrence: 1 depth: 15, occurrence: 2 depth: 17, occurrence: 2 depth: 18, occurrence: 2 depth: 19, occurrence: 1 depth: 20, occurrence: 1 depth: 21, occurrence: 2 depth: 22, occurrence: 1 depth: 23, occurrence: 2 depth: 24, occurrence: 2 depth: 25, occurrence: 1 depth: 26, occurrence: 1 depth: 27, occurrence: 2 depth: 29, occurrence: 1 depth: 30, occurrence: 1 depth: 31, occurrence: 2 depth: 39, occurrence: 1 depth: 40, occurrence: 1 depth: 42, occurrence: 1 XXX total number of pointers: 809 XXX times a variable address is taken: 2134 XXX times a pointer is dereferenced on RHS: 570 breakdown: depth: 1, occurrence: 428 depth: 2, occurrence: 84 depth: 3, occurrence: 45 depth: 4, occurrence: 10 depth: 5, occurrence: 3 XXX times a pointer is dereferenced on LHS: 500 breakdown: depth: 1, occurrence: 410 depth: 2, occurrence: 57 depth: 3, occurrence: 26 depth: 4, occurrence: 6 depth: 5, occurrence: 1 XXX times a pointer is compared with null: 96 XXX times a pointer is compared with address of another variable: 20 XXX times a pointer is compared with another pointer: 29 XXX times a pointer is qualified to be dereferenced: 16633 XXX max dereference level: 5 breakdown: level: 0, occurrence: 0 level: 1, occurrence: 1865 level: 2, occurrence: 760 level: 3, occurrence: 488 level: 4, occurrence: 173 level: 5, occurrence: 30 XXX number of pointers point to pointers: 473 XXX number of pointers point to scalars: 310 XXX number of pointers point to structs: 0 XXX percent of pointers has null in alias set: 31 XXX average alias set size: 1.52 XXX times a non-volatile is read: 3625 XXX times a non-volatile is write: 1637 XXX times a volatile is read: 135 XXX times read thru a pointer: 54 XXX times a volatile is write: 30 XXX times written thru a pointer: 2 XXX times a volatile is available for access: 5.3e+03 XXX percentage of non-volatile access: 97 XXX forward jumps: 1 XXX backward jumps: 18 XXX stmts: 161 XXX max block depth: 5 breakdown: depth: 0, occurrence: 21 depth: 1, occurrence: 21 depth: 2, occurrence: 24 depth: 3, occurrence: 30 depth: 4, occurrence: 27 depth: 5, occurrence: 38 XXX percentage a fresh-made variable is used: 15.5 XXX percentage an existing variable is used: 84.5 FYI: the random generator makes assumptions about the integer size. See platform.info for more details. XXX total OOB instances added: 0 ********************* end of statistics **********************/ chibicc-1.0.24/test/curl2.c000066400000000000000000000031121517770275000153440ustar00rootroot00000000000000#include #include #include #include "test.h" // Declare the variadic function (simulating curl_msprintf or dprintf_format) // Simulated curl-style dprintf_format int dprintf_format(const char *fmt, ...) { va_list ap; va_start(ap, fmt); int ret = vprintf(fmt, ap); // You can replace this with vsnprintf if needed va_end(ap); return ret; } int main(void) { char c = -1; unsigned char uc = 255; short s = -12345; unsigned short us = 54321; int i = -123456; unsigned int ui = 123456; long l = -123456789; unsigned long ul = 123456789; long long ll = -123456789012345; unsigned long long ull = 123456789012345; float f = 1.25f; double d = 3.14159; // Pass all the above to your variadic dprintf_format int n = dprintf_format( "char: %hhd\n" "unsigned char: %hhu\n" "short: %hd\n" "unsigned short: %hu\n" "int: %d\n" "unsigned int: %u\n" "long: %ld\n" "unsigned long: %lu\n" "long long: %lld\n" "unsigned long long: %llu\n" "float: %f\n" "double: %f\n", c, uc, s, us, i, ui, l, ul, ll, ull, f, d); printf("Printed %d characters\n", n); ASSERT(-1, c); ASSERT(255, uc); ASSERT(-12345, s); ASSERT(54321, us); ASSERT(-123456, i); ASSERT(123456, ui); ASSERT(-123456789, l); ASSERT(123456789, ul); ASSERT(-123456789012345LL, ll); ASSERT(123456789012345ULL, ull); ASSERT(1.25f, f); ASSERT(3.14159, d); printf("All tests passed!\n"); return 0; } chibicc-1.0.24/test/curl6.c000066400000000000000000000017161517770275000153600ustar00rootroot00000000000000#include #include #include "test.h" void print_args(int count, ...) { va_list ap; va_start(ap, count); for (int i = 0; i < count; i++) { int val = va_arg(ap, int); printf("arg[%d] = %d\n", i, val); if (i == 127) ASSERT(127, val); } va_end(ap); } int main() { // Call print_args with 128 integer args: 0, 1, 2, ..., 127 print_args(128, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,17,18,19, 20,21,22,23,24,25,26,27,28,29, 30,31,32,33,34,35,36,37,38,39, 40,41,42,43,44,45,46,47,48,49, 50,51,52,53,54,55,56,57,58,59, 60,61,62,63,64,65,66,67,68,69, 70,71,72,73,74,75,76,77,78,79, 80,81,82,83,84,85,86,87,88,89, 90,91,92,93,94,95,96,97,98,99, 100,101,102,103,104,105,106,107,108,109, 110,111,112,113,114,115,116,117,118,119, 120,121,122,123,124,125,126,127 ); return 0; } chibicc-1.0.24/test/debug_types.c000066400000000000000000000032721517770275000166360ustar00rootroot00000000000000#include "test.h" typedef struct Point { int x; long y; } Point; typedef union Number { int i; long l; } Number; int g_int = 11; static long g_static_long = 22; unsigned short g_ushort = 33; _Bool g_bool = 1; char g_char = 'A'; float g_float = 1.25f; double g_double = 2.5; long double g_ldouble = 3.75L; const int g_const = 44; volatile int g_volatile = 55; int g_arr[3] = {1, 2, 3}; Point g_point = {3, 4}; Number g_num = {7}; static long mix_scalars(int a, long b, char c, double d, long double ld) { short s = 5; unsigned int ui = 6; long long ll = 7; unsigned long long ull = 8; __int128 i128 = 9; unsigned __int128 u128 = 10; int out = a + (int)b + c + (int)d + (int)ld + s + (int)ui + (int)ll + (int)ull; out += (int)i128 + (int)u128; return out; } static int use_compound_and_qual(Point *p, int arr[3]) { Point local_p = *p; Number local_n; local_n.l = 9; const int c_local = local_p.x; volatile int v_local = arr[1]; int tmp = arr[2]; int *restrict rp = &tmp; Point *pp = &local_p; int first = pp->x; int second = *(rp); return first + second + c_local + v_local + (int)local_n.l; } int main(void) { int local_arr[3] = {10, 20, 30}; Point local_point = g_point; Point *ptr = &local_point; long a = mix_scalars(1, 2, 3, 4.0, 5.0L); int b = use_compound_and_qual(ptr, local_arr); ASSERT(60, (int)a); ASSERT(65, b); ASSERT(11, g_int); LASSERT(22, g_static_long); ASSERT(33, g_ushort); ASSERT(1, g_bool); ASSERT(65, g_char); ASSERT(2, (int)g_double); ASSERT(3, (int)g_ldouble); ASSERT(44, g_const); ASSERT(55, g_volatile); ASSERT(2, g_arr[1]); ASSERT(3, g_point.x); LASSERT(7, g_num.i); printf("OK\n"); return 0; } chibicc-1.0.24/test/debug_vla.c000066400000000000000000000002171517770275000162500ustar00rootroot00000000000000#include "test.h" void fn(int x, int a[x]) { int y = sizeof(a); ASSERT(8, y); } int main() { fn(5, 0); printf("OK\n"); return 0; } chibicc-1.0.24/test/decl.c000077500000000000000000000010351517770275000152310ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(1, ({ char x; sizeof(x); })); ASSERT(2, ({ short int x; sizeof(x); })); ASSERT(2, ({ int short x; sizeof(x); })); ASSERT(4, ({ int x; sizeof(x); })); ASSERT(8, ({ long int x; sizeof(x); })); ASSERT(8, ({ int long x; sizeof(x); })); ASSERT(8, ({ long long x; sizeof(x); })); ASSERT(0, ({ _Bool x=0; x; })); ASSERT(1, ({ _Bool x=1; x; })); ASSERT(1, ({ _Bool x=2; x; })); ASSERT(1, (_Bool)1); ASSERT(1, (_Bool)2); ASSERT(0, (_Bool)(char)256); printf("OK\n"); return 0; } chibicc-1.0.24/test/decl2.c000066400000000000000000000011351517770275000153110ustar00rootroot00000000000000#include "test.h" long double ld = 0.0L; #define CAT(x) b##x int CAT(6_) = 7; //int CAT(8µ) = 9; int arr[2][2] = {{1,2},{3,4}}; int *p1 = arr[1]; int fn(float), var1 = 7, fn2(void), var2 = 11; int main(void) { { ASSERT(7, b6_); //ASSERT(9, b8µ); } { ASSERT(3, *p1); } { ASSERT(7, var1); ASSERT(11, var2); ASSERT(13, fn(13.0f)); ASSERT(19, fn2()); } { char arr2[3] = {11, 22, 33}; ASSERT(33, (&arr2)[0][2]); ASSERT(22, (*&arr2)[1]); ASSERT(11, (**&arr2)); } printf("OK\n"); } int fn(float f) { return f; } int fn2(void) { return 19; }chibicc-1.0.24/test/define.c000077500000000000000000000002111517770275000155470ustar00rootroot00000000000000 #include "test.h" int main() { int m; #if defined(M13) m = 3; #else m = 4; #endif printf("%d\n", m); ASSERT(4, m); return 0; }chibicc-1.0.24/test/deprecated.c000077500000000000000000000011101517770275000164140ustar00rootroot00000000000000 #include "test.h" // Pre-attribute __attribute__((deprecated)) enum Color1 { RED1, GREEN1, BLUE1 }; // Post-attribute enum Color2 __attribute__((deprecated)) { RED2, GREEN2, BLUE2 }; // Attribute on enum constants enum Color3 { RED3 __attribute__((deprecated)), GREEN3, BLUE3 }; int main() { enum Color1 c1 = RED1; enum Color2 c2 = RED2; enum Color3 c3 = RED3; printf("Color1: %d\n", c1); ASSERT(0, c1); printf("Color2: %d\n", c2); ASSERT(0, c2); printf("Color3: %d\n", c3); ASSERT(0, c3); return 0; } chibicc-1.0.24/test/deprecated2.c000066400000000000000000000004621517770275000165040ustar00rootroot00000000000000#include "test.h" #define Py_DEPRECATED(version) __attribute__((deprecated)) typedef long Py_hash_t; struct S { Py_DEPRECATED(3.11) Py_hash_t ob_shash; }; int main(void) { struct S s; (void)s; s.ob_shash = 8; printf("%ld\n", s.ob_shash); ASSERT(8, s.ob_shash); return 0; } chibicc-1.0.24/test/dereference.c000066400000000000000000000131631517770275000165730ustar00rootroot00000000000000#include "test.h" /* confdefs.h */ #define PACKAGE_NAME "PostgreSQL" #define PACKAGE_TARNAME "postgresql" #define PACKAGE_VERSION "17devel" #define PACKAGE_STRING "PostgreSQL 17devel" #define PACKAGE_BUGREPORT "pgsql-bugs@lists.postgresql.org" #define PACKAGE_URL "https://www.postgresql.org/" #define CONFIGURE_ARGS " 'CC=chibicc' 'CFLAGS=-fpic' 'LDFLAGS=-fpic'" #define PG_MAJORVERSION "17" #define PG_MAJORVERSION_NUM 17 #define PG_MINORVERSION_NUM 0 #define PG_VERSION "17devel" #define DEF_PGPORT 5432 #define DEF_PGPORT_STR "5432" #define BLCKSZ 8192 #define RELSEG_SIZE 131072 #define XLOG_BLCKSZ 8192 /* end confdefs.h. */ /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int); // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ ||__STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } int main (int argc, char **argv) { int ok = 0; ok |= (argc == 0 ||f (e, argv, 0) != argv[0] ||f (e, argv, 1) != argv[1]); // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success ||bignum == 0LL ||ubignum == 0uLL ||newvar[0] == 'x' ||dynamic_array[ni.number - 1] != 543); printf("\nOK=%d\n", ok); ASSERT(0, ok); return ok; }chibicc-1.0.24/test/des_local.c000066400000000000000000000221501517770275000162450ustar00rootroot00000000000000/* * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #ifndef OSSL_CRYPTO_DES_LOCAL_H # define OSSL_CRYPTO_DES_LOCAL_H # include # include "test.h" # include # include # include # ifdef OPENSSL_BUILD_SHLIBCRYPTO # undef OPENSSL_EXTERN # define OPENSSL_EXTERN OPENSSL_EXPORT # endif # define ITERATIONS 16 # define HALF_ITERATIONS 8 # define c2l(c,l) (l =((DES_LONG)(*((c)++))) , \ l|=((DES_LONG)(*((c)++)))<< 8L, \ l|=((DES_LONG)(*((c)++)))<<16L, \ l|=((DES_LONG)(*((c)++)))<<24L) /* NOTE - c is not incremented as per c2l */ # define c2ln(c,l1,l2,n) { \ c+=n; \ l1=l2=0; \ switch (n) { \ case 8: l2 =((DES_LONG)(*(--(c))))<<24L; \ /* fall through */ \ case 7: l2|=((DES_LONG)(*(--(c))))<<16L; \ /* fall through */ \ case 6: l2|=((DES_LONG)(*(--(c))))<< 8L; \ /* fall through */ \ case 5: l2|=((DES_LONG)(*(--(c)))); \ /* fall through */ \ case 4: l1 =((DES_LONG)(*(--(c))))<<24L; \ /* fall through */ \ case 3: l1|=((DES_LONG)(*(--(c))))<<16L; \ /* fall through */ \ case 2: l1|=((DES_LONG)(*(--(c))))<< 8L; \ /* fall through */ \ case 1: l1|=((DES_LONG)(*(--(c)))); \ } \ } # define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \ *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \ *((c)++)=(unsigned char)(((l)>>16L)&0xff), \ *((c)++)=(unsigned char)(((l)>>24L)&0xff)) /* NOTE - c is not incremented as per l2c */ # define l2cn(l1,l2,c,n) { \ c+=n; \ switch (n) { \ case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \ /* fall through */ \ case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \ /* fall through */ \ case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \ /* fall through */ \ case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \ /* fall through */ \ case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \ /* fall through */ \ case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \ /* fall through */ \ case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \ /* fall through */ \ case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \ } \ } # if defined(_MSC_VER) # define ROTATE(a,n) (_lrotr(a,n)) # elif defined(__ICC) # define ROTATE(a,n) (_rotr(a,n)) # elif defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) # if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) # define ROTATE(a,n) ({ register unsigned int ret; \ asm ("rorl %1,%0" \ : "=r"(ret) \ : "I"(n),"0"(a) \ : "cc"); \ ret; \ }) # elif defined(__riscv_zbb) || defined(__riscv_zbkb) # if __riscv_xlen == 64 # define ROTATE(x, n) ({ register unsigned int ret; \ asm ("roriw %0, %1, %2" \ : "=r"(ret) \ : "r"(x), "i"(n)); ret; }) # endif # if __riscv_xlen == 32 # define ROTATE(x, n) ({ register unsigned int ret; \ asm ("rori %0, %1, %2" \ : "=r"(ret) \ : "r"(x), "i"(n)); ret; }) # endif # endif # endif # ifndef ROTATE # define ROTATE(a,n) (((a)>>(n))+((a)<<(32-(n)))) # endif /* * Don't worry about the LOAD_DATA() stuff, that is used by fcrypt() to add * it's little bit to the front */ # ifdef DES_FCRYPT # define LOAD_DATA_tmp(R,S,u,t,E0,E1) \ { DES_LONG tmp; LOAD_DATA(R,S,u,t,E0,E1,tmp); } # define LOAD_DATA(R,S,u,t,E0,E1,tmp) \ t=R^(R>>16L); \ u=t&E0; t&=E1; \ tmp=(u<<16); u^=R^s[S ]; u^=tmp; \ tmp=(t<<16); t^=R^s[S+1]; t^=tmp # else # define LOAD_DATA_tmp(a,b,c,d,e,f) LOAD_DATA(a,b,c,d,e,f,g) # define LOAD_DATA(R,S,u,t,E0,E1,tmp) \ u=R^s[S ]; \ t=R^s[S+1] # endif /* * It recently occurred to me that 0^0^0^0^0^0^0 == 0, so there is no reason * to not xor all the sub items together. This potentially saves a register * since things can be xored directly into L */ # define D_ENCRYPT(LL,R,S) { \ LOAD_DATA_tmp(R,S,u,t,E0,E1); \ t=ROTATE(t,4); \ LL^= \ DES_SPtrans[0][(u>> 2L)&0x3f]^ \ DES_SPtrans[2][(u>>10L)&0x3f]^ \ DES_SPtrans[4][(u>>18L)&0x3f]^ \ DES_SPtrans[6][(u>>26L)&0x3f]^ \ DES_SPtrans[1][(t>> 2L)&0x3f]^ \ DES_SPtrans[3][(t>>10L)&0x3f]^ \ DES_SPtrans[5][(t>>18L)&0x3f]^ \ DES_SPtrans[7][(t>>26L)&0x3f]; } /*- * IP and FP * The problem is more of a geometric problem that random bit fiddling. 0 1 2 3 4 5 6 7 62 54 46 38 30 22 14 6 8 9 10 11 12 13 14 15 60 52 44 36 28 20 12 4 16 17 18 19 20 21 22 23 58 50 42 34 26 18 10 2 24 25 26 27 28 29 30 31 to 56 48 40 32 24 16 8 0 32 33 34 35 36 37 38 39 63 55 47 39 31 23 15 7 40 41 42 43 44 45 46 47 61 53 45 37 29 21 13 5 48 49 50 51 52 53 54 55 59 51 43 35 27 19 11 3 56 57 58 59 60 61 62 63 57 49 41 33 25 17 9 1 The output has been subject to swaps of the form 0 1 -> 3 1 but the odd and even bits have been put into 2 3 2 0 different words. The main trick is to remember that t=((l>>size)^r)&(mask); r^=t; l^=(t<>(n))^(b))&(m)),\ (b)^=(t),\ (a)^=((t)<<(n))) # define IP(l,r) \ { \ register DES_LONG tt; \ PERM_OP(r,l,tt, 4,0x0f0f0f0fL); \ PERM_OP(l,r,tt,16,0x0000ffffL); \ PERM_OP(r,l,tt, 2,0x33333333L); \ PERM_OP(l,r,tt, 8,0x00ff00ffL); \ PERM_OP(r,l,tt, 1,0x55555555L); \ } # define FP(l,r) \ { \ register DES_LONG tt; \ PERM_OP(l,r,tt, 1,0x55555555L); \ PERM_OP(r,l,tt, 8,0x00ff00ffL); \ PERM_OP(l,r,tt, 2,0x33333333L); \ PERM_OP(r,l,tt,16,0x0000ffffL); \ PERM_OP(l,r,tt, 4,0x0f0f0f0fL); \ } extern const DES_LONG DES_SPtrans[8][64]; void fcrypt_body(DES_LONG *out, DES_key_schedule *ks, DES_LONG Eswap0, DES_LONG Eswap1); #endif int main() { DES_LONG l = 1; DES_LONG r = 2; IP(l, r); printf("%d\n", l); ASSERT(134217728, l); printf("%d\n", r); ASSERT(-2147483648, r); ROTATE(l, 1); printf("Ok\n"); return 0; }chibicc-1.0.24/test/diagnose.c000066400000000000000000000006341517770275000161140ustar00rootroot00000000000000#include "test.h" #define ATTR_DIAG(_, __, ___) \ __attribute__((__diagnose_if__(_, __, ___))) ATTR_DIAG(1, "msg", warning) int f1(int x); ATTR_DIAG(x > 0, "x must be positive", error) int f2(int x); int f1(int x) { return x; } int f2(int x) { return x; } int main(void) { f1(1); f2(-1); // expected-error {{x must be positive}} ASSERT(1, f1(1)); ASSERT(-1, f2(-1)); printf("OK\n"); return 0; }chibicc-1.0.24/test/driver.sh000077500000000000000000000225341517770275000160140ustar00rootroot00000000000000#!/bin/bash chibicc=$1 tmp=`mktemp -d /tmp/chibicc-test-XXXXXX` trap 'rm -rf $tmp' INT TERM HUP EXIT echo > $tmp/empty.c check() { if [ $? -eq 0 ]; then echo "testing $1 ... passed" else echo "testing $1 ... failed" exit 1 fi } # switch expression type-checking (autoconf relies on this) echo 'int main(){char *p=0; switch(p){case 0: break;} return 0;}' | $chibicc -c -o /dev/null -xc - >/dev/null 2>&1 [ $? -ne 0 ] check 'switch pointer rejected' # -o rm -f $tmp/out ./chibicc -c -o $tmp/out $tmp/empty.c [ -f $tmp/out ] check -o # --help $chibicc --help 2>&1 | grep -q chibicc check --help # -S echo 'int main() {}' | $chibicc -S -o- -xc - | grep -q 'main:' check -S # Default output file rm -f $tmp/out.o $tmp/out.s echo 'int main() {}' > $tmp/out.c (cd $tmp; $OLDPWD/$chibicc -c out.c) [ -f $tmp/out.o ] check 'default output file' (cd $tmp; $OLDPWD/$chibicc -c -S out.c) [ -f $tmp/out.s ] check 'default output file' # Multiple input files rm -f $tmp/foo.o $tmp/bar.o echo 'int x;' > $tmp/foo.c echo 'int y;' > $tmp/bar.c (cd $tmp; $OLDPWD/$chibicc -c $tmp/foo.c $tmp/bar.c) [ -f $tmp/foo.o ] && [ -f $tmp/bar.o ] check 'multiple input files' rm -f $tmp/foo.s $tmp/bar.s echo 'int x;' > $tmp/foo.c echo 'int y;' > $tmp/bar.c (cd $tmp; $OLDPWD/$chibicc -c -S $tmp/foo.c $tmp/bar.c) [ -f $tmp/foo.s ] && [ -f $tmp/bar.s ] check 'multiple input files' # Run linker rm -f $tmp/foo echo 'int main() { return 0; }' | $chibicc -o $tmp/foo -xc -xc - $tmp/foo check linker rm -f $tmp/foo echo 'int bar(); int main() { return bar(); }' > $tmp/foo.c echo 'int bar() { return 42; }' > $tmp/bar.c $chibicc -o $tmp/foo $tmp/foo.c $tmp/bar.c $tmp/foo [ "$?" = 42 ] check linker # a.out rm -f $tmp/a.out echo 'int main() {}' > $tmp/foo.c (cd $tmp; $OLDPWD/$chibicc foo.c) [ -f $tmp/a.out ] check a.out # -E echo foo > $tmp/out echo "#include \"$tmp/out\"" | $chibicc -E -xc - | grep -q foo check -E echo foo > $tmp/out1 echo "#include \"$tmp/out1\"" | $chibicc -E -o $tmp/out2 -xc - cat $tmp/out2 | grep -q foo check '-E and -o' # -I mkdir $tmp/dir echo foo > $tmp/dir/i-option-test echo "#include \"i-option-test\"" | $chibicc -I$tmp/dir -E -xc - | grep -q foo check -I # -D echo foo | $chibicc -Dfoo -E -xc - | grep -q 1 check -D # -D echo foo | $chibicc -Dfoo=bar -E -xc - | grep -q bar check -D # -U echo foo | $chibicc -Dfoo=bar -Ufoo -E -xc - | grep -q foo check -U # ignored options $chibicc -c -O -Wall -g -std=c11 -ffreestanding -fno-builtin \ -fno-omit-frame-pointer -fno-stack-protector -fno-strict-aliasing \ -m64 -mno-red-zone -w -o /dev/null $tmp/empty.c check 'ignored options' # BOM marker printf '\xef\xbb\xbfxyz\n' | $chibicc -E -o- -xc - | grep -q '^xyz' check 'BOM marker' # Inline functions echo 'inline void foo() {}' > $tmp/inline1.c echo 'inline void foo() {}' > $tmp/inline2.c echo 'int main() { return 0; }' > $tmp/inline3.c $chibicc -o /dev/null $tmp/inline1.c $tmp/inline2.c $tmp/inline3.c check inline echo 'extern inline void foo() {}' > $tmp/inline1.c echo 'int foo(); int main() { foo(); }' > $tmp/inline2.c $chibicc -o /dev/null $tmp/inline1.c $tmp/inline2.c check inline echo 'static inline void f1() {}' | $chibicc -o- -S -xc - | grep -v -q f1: check inline echo 'static inline void f1() {} void foo() { f1(); }' | $chibicc -o- -S -xc - | grep -q f1: check inline echo 'static inline void f1() {} static inline void f2() { f1(); } void foo() { f1(); }' | $chibicc -o- -S -xc - | grep -q f1: check inline echo 'static inline void f1() {} static inline void f2() { f1(); } void foo() { f1(); }' | $chibicc -o- -S -xc - | grep -v -q f2: check inline echo 'static inline void f1() {} static inline void f2() { f1(); } void foo() { f2(); }' | $chibicc -o- -S -xc - | grep -q f1: check inline echo 'static inline void f1() {} static inline void f2() { f1(); } void foo() { f2(); }' | $chibicc -o- -S -xc - | grep -q f2: check inline echo 'static inline void f2(); static inline void f1() { f2(); } static inline void f2() { f1(); } void foo() {}' | $chibicc -o- -S -xc - | grep -v -q f1: check inline echo 'static inline void f2(); static inline void f1() { f2(); } static inline void f2() { f1(); } void foo() {}' | $chibicc -o- -S -xc - | grep -v -q f2: check inline echo 'static inline void f2(); static inline void f1() { f2(); } static inline void f2() { f1(); } void foo() { f1(); }' | $chibicc -o- -S -xc - | grep -q f1: check inline echo 'static inline void f2(); static inline void f1() { f2(); } static inline void f2() { f1(); } void foo() { f1(); }' | $chibicc -o- -S -xc - | grep -q f2: check inline echo 'static inline void f2(); static inline void f1() { f2(); } static inline void f2() { f1(); } void foo() { f2(); }' | $chibicc -o- -S -xc - | grep -q f1: check inline echo 'static inline void f2(); static inline void f1() { f2(); } static inline void f2() { f1(); } void foo() { f2(); }' | $chibicc -o- -S -xc - | grep -q f2: check inline # -idirafter mkdir -p $tmp/dir1 $tmp/dir2 echo foo > $tmp/dir1/idirafter echo bar > $tmp/dir2/idirafter echo "#include \"idirafter\"" | $chibicc -I$tmp/dir1 -I$tmp/dir2 -E -xc - | grep -q foo check -idirafter echo "#include \"idirafter\"" | $chibicc -idirafter $tmp/dir1 -I$tmp/dir2 -E -xc - | grep -q bar check -idirafter # -fcommon echo 'int foo;' | $chibicc -S -o- -xc - | grep -q '\.comm foo' check '-fcommon (default)' echo 'int foo;' | $chibicc -fcommon -S -o- -xc - | grep -q '\.comm foo' check '-fcommon' # -fno-common echo 'int foo;' | $chibicc -fno-common -S -o- -xc - | grep -q '^foo:' check '-fno-common' # -include echo foo > $tmp/out.h echo bar | $chibicc -include $tmp/out.h -E -o- -xc - | grep -q -z 'foo.*bar' check -include echo NULL | $chibicc -Iinclude -include stdio.h -E -o- -xc - | grep -q 0 check -include # -x echo 'int x;' | $chibicc -c -xc -o $tmp/foo.o - check -xc echo 'x:' | $chibicc -c -x assembler -o $tmp/foo.o - check '-x assembler' echo 'int x;' > $tmp/foo.c $chibicc -c -x assembler -x none -o $tmp/foo.o $tmp/foo.c check '-x none' # -E echo foo | $chibicc -E - | grep -q foo check -E # .a file echo 'void foo() {}' | $chibicc -c -xc -o $tmp/foo.o - echo 'void bar() {}' | $chibicc -c -xc -o $tmp/bar.o - ar rcs $tmp/foo.a $tmp/foo.o $tmp/bar.o echo 'void foo(); void bar(); int main() { foo(); bar(); }' > $tmp/main.c $chibicc -o $tmp/foo $tmp/main.c $tmp/foo.a check '.a' # .so file echo 'void foo() {}' | cc -fPIC -c -xc -o $tmp/foo.o - echo 'void bar() {}' | cc -fPIC -c -xc -o $tmp/bar.o - cc -shared -o $tmp/foo.so $tmp/foo.o $tmp/bar.o echo 'void foo(); void bar(); int main() { foo(); bar(); }' > $tmp/main.c $chibicc -o $tmp/foo $tmp/main.c $tmp/foo.so check '.so' $chibicc -hashmap-test check 'hashmap' # -M echo '#include "out2.h"' > $tmp/out.c echo '#include "out3.h"' >> $tmp/out.c touch $tmp/out2.h $tmp/out3.h $chibicc -M -I$tmp $tmp/out.c | grep -q -z '^out.o: .*/out\.c .*/out2\.h .*/out3\.h' check -M # -MF $chibicc -MF $tmp/mf -M -I$tmp $tmp/out.c grep -q -z '^out.o: .*/out\.c .*/out2\.h .*/out3\.h' $tmp/mf check -MF # -MP $chibicc -MF $tmp/mp -MP -M -I$tmp $tmp/out.c grep -q '^.*/out2.h:' $tmp/mp check -MP grep -q '^.*/out3.h:' $tmp/mp check -MP # -MT $chibicc -MT foo -M -I$tmp $tmp/out.c | grep -q '^foo:' check -MT $chibicc -MT foo -MT bar -M -I$tmp $tmp/out.c | grep -q '^foo bar:' check -MT # -MD echo '#include "out2.h"' > $tmp/md2.c echo '#include "out3.h"' > $tmp/md3.c (cd $tmp; $OLDPWD/$chibicc -c -MD -I. md2.c md3.c) grep -q -z '^md2.o:.* md2\.c .* ./out2\.h' $tmp/md2.d check -MD grep -q -z '^md3.o:.* md3\.c .* ./out3\.h' $tmp/md3.d check -MD $chibicc -c -MD -MF $tmp/md-mf.d -I. $tmp/md2.c grep -q -z '^md2.o:.*md2\.c .*/out2\.h' $tmp/md-mf.d check -MD echo 'extern int bar; int foo() { return bar; }' | $chibicc -fPIC -xc -c -o $tmp/foo.o - cc -shared -o $tmp/foo.so $tmp/foo.o echo 'int foo(); int bar=3; int main() { foo(); }' > $tmp/main.c $chibicc -o $tmp/foo $tmp/main.c $tmp/foo.so check -fPIC # #include_next mkdir -p $tmp/next1 $tmp/next2 $tmp/next3 echo '#include "file1.h"' > $tmp/file.c echo '#include_next "file1.h"' > $tmp/next1/file1.h echo '#include_next "file2.h"' > $tmp/next2/file1.h echo 'foo' > $tmp/next3/file2.h $chibicc -I$tmp/next1 -I$tmp/next2 -I$tmp/next3 -E $tmp/file.c | grep -q foo check '#include_next' # -static echo 'extern int bar; int foo() { return bar; }' > $tmp/foo.c echo 'int foo(); int bar=3; int main() { foo(); }' > $tmp/bar.c $chibicc -static -o $tmp/foo $tmp/foo.c $tmp/bar.c check -static file $tmp/foo | grep -q 'statically linked' check -static # -shared echo 'extern int bar; int foo() { return bar; }' > $tmp/foo.c echo 'int foo(); int bar=3; int main() { foo(); }' > $tmp/bar.c $chibicc -fPIC -shared -o $tmp/foo.so $tmp/foo.c $tmp/bar.c check -shared # -L echo 'extern int bar; int foo() { return bar; }' > $tmp/foo.c $chibicc -fPIC -shared -o $tmp/libfoobar.so $tmp/foo.c echo 'int foo(); int bar=3; int main() { foo(); }' > $tmp/bar.c $chibicc -o $tmp/foo $tmp/bar.c -L$tmp -lfoobar check -L # -Wl, echo 'int foo() {}' | $chibicc -c -o $tmp/foo.o -xc - echo 'int foo() {}' | $chibicc -c -o $tmp/bar.o -xc - echo 'int main() {}' | $chibicc -c -o $tmp/baz.o -xc - cc -Wl,-z,muldefs,--gc-sections -o $tmp/foo $tmp/foo.o $tmp/bar.o $tmp/baz.o check -Wl, # -Xlinker echo 'int foo() {}' | $chibicc -c -o $tmp/foo.o -xc - echo 'int foo() {}' | $chibicc -c -o $tmp/bar.o -xc - echo 'int main() {}' | $chibicc -c -o $tmp/baz.o -xc - cc -Xlinker -z -Xlinker muldefs -Xlinker --gc-sections -o $tmp/foo $tmp/foo.o $tmp/bar.o $tmp/baz.o check -Xlinker echo OK chibicc-1.0.24/test/encode_base64_avx2.c000066400000000000000000001355001517770275000176650ustar00rootroot00000000000000/* * test_evp_encode_update_ia32cap.c * * Test case for EVP_EncodeUpdate exercising the HAS_IA32CAP_IS_64 branch. * * Compiled with: * gcc -DHAS_IA32CAP_IS_64 -o test_evp_encode_update test_evp_encode_update_ia32cap.c -lssl -lcrypto * * Two sub-tests: * 1. AVX2 path : OPENSSL_ia32cap_P[2] bit 5 SET → encode_base64_avx2() * 2. scalar path: OPENSSL_ia32cap_P[2] bit 5 CLEAR → evp_encodeblock_int() */ #include #include #include #include #include #include #include #include #define HAS_IA32CAP_IS_64 1 #define EVP_ENCODE_B64_LENGTH 48 #define EVP_ENCODE_CTX_NO_NEWLINES 1 void OPENSSL_cpuid_setup() { return ;}; /* ── capability word exposed by OpenSSL ────────────────────────────────── */ unsigned int OPENSSL_ia32cap_P[10]; /* 40 bytes, matches OpenSSL layout */ /* AVX2 is reported in OPENSSL_ia32cap_P[2] bit 5 (CPUID leaf 7, EBX bit 5) */ #define AVX2_BIT (1u << 5) #define EVP_ENCODE_CTX_USE_SRP_ALPHABET 2 struct evp_Encode_Ctx_st { /* number saved in a partial encode/decode */ int num; /* data to encode */ unsigned char enc_data[80]; /* number read on current line */ int line_num; unsigned int flags; }; typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX; static const unsigned char data_bin2ascii[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /* SRP uses a different base64 alphabet */ static const unsigned char srpdata_bin2ascii[65] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./"; #define conv_bin2ascii(a, table) ((table)[(a) & 0x3f]) static const unsigned char base64_srp_bin2ascii_0[256] = { '0', '0', '0', '0', '1', '1', '1', '1', '2', '2', '2', '2', '3', '3', '3', '3', '4', '4', '4', '4', '5', '5', '5', '5', '6', '6', '6', '6', '7', '7', '7', '7', '8', '8', '8', '8', '9', '9', '9', '9', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'C', 'C', 'C', 'C', 'D', 'D', 'D', 'D', 'E', 'E', 'E', 'E', 'F', 'F', 'F', 'F', 'G', 'G', 'G', 'G', 'H', 'H', 'H', 'H', 'I', 'I', 'I', 'I', 'J', 'J', 'J', 'J', 'K', 'K', 'K', 'K', 'L', 'L', 'L', 'L', 'M', 'M', 'M', 'M', 'N', 'N', 'N', 'N', 'O', 'O', 'O', 'O', 'P', 'P', 'P', 'P', 'Q', 'Q', 'Q', 'Q', 'R', 'R', 'R', 'R', 'S', 'S', 'S', 'S', 'T', 'T', 'T', 'T', 'U', 'U', 'U', 'U', 'V', 'V', 'V', 'V', 'W', 'W', 'W', 'W', 'X', 'X', 'X', 'X', 'Y', 'Y', 'Y', 'Y', 'Z', 'Z', 'Z', 'Z', 'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'c', 'c', 'c', 'c', 'd', 'd', 'd', 'd', 'e', 'e', 'e', 'e', 'f', 'f', 'f', 'f', 'g', 'g', 'g', 'g', 'h', 'h', 'h', 'h', 'i', 'i', 'i', 'i', 'j', 'j', 'j', 'j', 'k', 'k', 'k', 'k', 'l', 'l', 'l', 'l', 'm', 'm', 'm', 'm', 'n', 'n', 'n', 'n', 'o', 'o', 'o', 'o', 'p', 'p', 'p', 'p', 'q', 'q', 'q', 'q', 'r', 'r', 'r', 'r', 's', 's', 's', 's', 't', 't', 't', 't', 'u', 'u', 'u', 'u', 'v', 'v', 'v', 'v', 'w', 'w', 'w', 'w', 'x', 'x', 'x', 'x', 'y', 'y', 'y', 'y', 'z', 'z', 'z', 'z', '.', '.', '.', '.', '/', '/', '/', '/' }; static const unsigned char base64_srp_bin2ascii_1[256] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/' }; static const unsigned char base64_srp_bin2ascii_2[256] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', '/' }; static const unsigned char base64_std_bin2ascii_0[256] = { 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'C', 'C', 'C', 'C', 'D', 'D', 'D', 'D', 'E', 'E', 'E', 'E', 'F', 'F', 'F', 'F', 'G', 'G', 'G', 'G', 'H', 'H', 'H', 'H', 'I', 'I', 'I', 'I', 'J', 'J', 'J', 'J', 'K', 'K', 'K', 'K', 'L', 'L', 'L', 'L', 'M', 'M', 'M', 'M', 'N', 'N', 'N', 'N', 'O', 'O', 'O', 'O', 'P', 'P', 'P', 'P', 'Q', 'Q', 'Q', 'Q', 'R', 'R', 'R', 'R', 'S', 'S', 'S', 'S', 'T', 'T', 'T', 'T', 'U', 'U', 'U', 'U', 'V', 'V', 'V', 'V', 'W', 'W', 'W', 'W', 'X', 'X', 'X', 'X', 'Y', 'Y', 'Y', 'Y', 'Z', 'Z', 'Z', 'Z', 'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'c', 'c', 'c', 'c', 'd', 'd', 'd', 'd', 'e', 'e', 'e', 'e', 'f', 'f', 'f', 'f', 'g', 'g', 'g', 'g', 'h', 'h', 'h', 'h', 'i', 'i', 'i', 'i', 'j', 'j', 'j', 'j', 'k', 'k', 'k', 'k', 'l', 'l', 'l', 'l', 'm', 'm', 'm', 'm', 'n', 'n', 'n', 'n', 'o', 'o', 'o', 'o', 'p', 'p', 'p', 'p', 'q', 'q', 'q', 'q', 'r', 'r', 'r', 'r', 's', 's', 's', 's', 't', 't', 't', 't', 'u', 'u', 'u', 'u', 'v', 'v', 'v', 'v', 'w', 'w', 'w', 'w', 'x', 'x', 'x', 'x', 'y', 'y', 'y', 'y', 'z', 'z', 'z', 'z', '0', '0', '0', '0', '1', '1', '1', '1', '2', '2', '2', '2', '3', '3', '3', '3', '4', '4', '4', '4', '5', '5', '5', '5', '6', '6', '6', '6', '7', '7', '7', '7', '8', '8', '8', '8', '9', '9', '9', '9', '+', '+', '+', '+', '/', '/', '/', '/' }; static const unsigned char base64_std_bin2ascii_1[256] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; static const unsigned char base64_std_bin2ascii_2[256] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; static const uint8_t shuffle_masks[16][16] = { { 0x80, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, { 0, 0x80, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, { 0, 1, 0x80, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, { 0, 1, 2, 0x80, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, { 0, 1, 2, 3, 0x80, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, { 0, 1, 2, 3, 4, 0x80, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, { 0, 1, 2, 3, 4, 5, 0x80, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, { 0, 1, 2, 3, 4, 5, 6, 0x80, 7, 8, 9, 10, 11, 12, 13, 14 }, { 0, 1, 2, 3, 4, 5, 6, 7, 0x80, 8, 9, 10, 11, 12, 13, 14 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 0x80, 9, 10, 11, 12, 13, 14 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0x80, 10, 11, 12, 13, 14 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0x80, 11, 12, 13, 14 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0x80, 12, 13, 14 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0x80, 13, 14 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0x80, 14 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0x80 } }; static inline __m256i insert_newlines_by_mask(__m256i data, __m256i mask) { __m256i newline = _mm256_set1_epi8('\n'); return _mm256_or_si256(_mm256_and_si256(mask, newline), _mm256_andnot_si256(mask, data)); } static inline size_t insert_nl_str8(const __m256i v0, uint8_t *output) { __m256i shuffling_mask = _mm256_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, (char)0xFF, 8, 9, 10, 11, 12, 13, 14, (char)0xFF, (char)0xFF, 0, 1, 2, 3, 4, 5, 6, 7, (char)0xFF, 8, 9, 10, 11, 12); __m256i shuffled_4_bytes = _mm256_shuffle_epi8(v0, shuffling_mask); _mm256_storeu_si256((__m256i *)(output), shuffled_4_bytes); int8_t rem_1_L = _mm256_extract_epi8(v0, 15); int8_t rem_2_L_P1 = _mm256_extract_epi8(v0, 29); int16_t rem_2_L_P2 = _mm256_extract_epi16(v0, 15); uint8_t *out = output; memcpy(out + 16, &rem_1_L, sizeof(rem_1_L)); memcpy(out + 32, &rem_2_L_P1, sizeof(rem_2_L_P1)); memcpy(out + 32 + 1, &rem_2_L_P2, sizeof(rem_2_L_P2)); output[8] = '\n'; output[17] = '\n'; output[26] = '\n'; output[35] = '\n'; out += 32 + 4; size_t written = (out - output); return written; } static inline __m256i lookup_pshufb_srp(__m256i input) { const __m256i zero = _mm256_setzero_si256(); const __m256i hi = _mm256_set1_epi8((char)0x80); __m256i invalid = _mm256_or_si256(_mm256_cmpgt_epi8(zero, input), _mm256_cmpgt_epi8(input, _mm256_set1_epi8(63))); __m256i idx = _mm256_setzero_si256(); idx = _mm256_sub_epi8(idx, _mm256_cmpgt_epi8(input, _mm256_set1_epi8(9))); idx = _mm256_sub_epi8(idx, _mm256_cmpgt_epi8(input, _mm256_set1_epi8(35))); idx = _mm256_blendv_epi8(idx, _mm256_set1_epi8(3), _mm256_cmpeq_epi8(input, _mm256_set1_epi8(62))); idx = _mm256_blendv_epi8(idx, _mm256_set1_epi8(4), _mm256_cmpeq_epi8(input, _mm256_set1_epi8(63))); /* Zero-out invalid lanes via PSHUFB's high-bit mechanism */ idx = _mm256_or_si256(idx, _mm256_and_si256(invalid, hi)); const __m256i shift_LUT = _mm256_setr_epi8('0' - 0, 'A' - 10, 'a' - 36, '.' - 62, '/' - 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0' - 0, 'A' - 10, 'a' - 36, '.' - 62, '/' - 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); __m256i shift = _mm256_shuffle_epi8(shift_LUT, idx); __m256i ascii = _mm256_add_epi8(shift, input); return ascii; } static __m256i lookup_pshufb_std(__m256i input) { __m256i result = _mm256_subs_epu8(input, _mm256_set1_epi8(51)); const __m256i less = _mm256_cmpgt_epi8(_mm256_set1_epi8(26), input); result = _mm256_or_si256(result, _mm256_and_si256(less, _mm256_set1_epi8(13))); __m256i shift_LUT = _mm256_setr_epi8('a' - 26, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '+' - 62, '/' - 63, 'A', 0, 0, 'a' - 26, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '0' - 52, '+' - 62, '/' - 63, 'A', 0, 0); result = _mm256_shuffle_epi8(shift_LUT, result); return _mm256_add_epi8(result, input); } static inline size_t insert_nl_str4(const __m256i v0, uint8_t *output) { __m256i shuffling_mask = _mm256_setr_epi8(0, 1, 2, 3, (char)0xFF, 4, 5, 6, 7, (char)0xFF, 8, 9, 10, 11, (char)0xFF, 12, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, 0, 1, 2, 3, (char)0xFF, 4, 5, 6, 7, (char)0xFF, 8, 9); __m256i mask_5_bytes = _mm256_setr_epi8(0, 0, 0, 0, (char)0xFF, 0, 0, 0, 0, (char)0xFF, 0, 0, 0, 0, (char)0xFF, 0, 0, 0, 0, (char)0xFF, 0, 0, 0, 0, (char)0xFF, 0, 0, 0, 0, (char)0xFF, 0, 0); __m256i shuffled_4_bytes = _mm256_shuffle_epi8(v0, shuffling_mask); __m256i v0_w_nl = insert_newlines_by_mask(shuffled_4_bytes, mask_5_bytes); _mm256_storeu_si256((__m256i *)(output + 0), v0_w_nl); /* Handle cross-lane remainder logic */ /* Without macros, _mm256_srli_si256 complains that the last arg must be an 8-bit immediate */ #define B_LANE 16 /* Bytes per lane */ #define N_RET_1_L 3 /* bytes "shifted out" of lane 0 */ #define N_RET_2_L (N_RET_1_L + 4) /* bytes "shifted out" of lane 1 */ /* Bytes that were shifted out of lane 0 */ __m256i rem_1_L = _mm256_srli_si256(v0, B_LANE - N_RET_1_L); /* Bytes that were shifted out of lane 1 */ __m256i rem_2_L_P1 = _mm256_srli_si256(_mm256_slli_si256(_mm256_srli_si256(v0, B_LANE - N_RET_2_L), B_LANE - N_RET_1_L), B_LANE - 2); /* isolate the bytes that were shifted out of lane 1 */ __m256i rem_2_L_P2 = _mm256_slli_si256( _mm256_srli_si256(v0, B_LANE - N_RET_2_L + N_RET_1_L), N_RET_1_L); __m256i rem_2_L = _mm256_or_si256(rem_2_L_P1, rem_2_L_P2); int32_t rem_1_L_ext = _mm256_extract_epi32(rem_1_L, 0); int64_t rem_2_L_ext = _mm256_extract_epi64(rem_2_L, 2); uint8_t *out = output + 16; memcpy(out, &rem_1_L_ext, sizeof(rem_1_L_ext)); out += 3; *out++ = '\n'; out = output + 32; memcpy(out, &rem_2_L_ext, sizeof(rem_2_L_ext)); out += 2; *out++ = '\n'; out += 4; *out++ = '\n'; size_t written = (out - output); return written; } static inline __m256i shift_left_zeros(__m256i v, int n) { switch (n) { case 0: return v; case 1: return _mm256_slli_si256(v, 1); case 2: return _mm256_slli_si256(v, 2); case 3: return _mm256_slli_si256(v, 3); case 4: return _mm256_slli_si256(v, 4); case 5: return _mm256_slli_si256(v, 5); case 6: return _mm256_slli_si256(v, 6); case 7: return _mm256_slli_si256(v, 7); case 8: return _mm256_slli_si256(v, 8); case 9: return _mm256_slli_si256(v, 9); case 10: return _mm256_slli_si256(v, 10); case 11: return _mm256_slli_si256(v, 11); case 12: return _mm256_slli_si256(v, 12); case 13: return _mm256_slli_si256(v, 13); case 14: return _mm256_slli_si256(v, 14); case 15: return _mm256_slli_si256(v, 15); case 16: return _mm256_setzero_si256(); default: return _mm256_setzero_si256(); } } static inline __m256i shift_right_zeros(__m256i v, int n) { switch (n) { case 0: return v; case 1: return _mm256_srli_si256(v, 1); case 2: return _mm256_srli_si256(v, 2); case 3: return _mm256_srli_si256(v, 3); case 4: return _mm256_srli_si256(v, 4); case 5: return _mm256_srli_si256(v, 5); case 6: return _mm256_srli_si256(v, 6); case 7: return _mm256_srli_si256(v, 7); case 8: return _mm256_srli_si256(v, 8); case 9: return _mm256_srli_si256(v, 9); case 10: return _mm256_srli_si256(v, 10); case 11: return _mm256_srli_si256(v, 11); case 12: return _mm256_srli_si256(v, 12); case 13: return _mm256_srli_si256(v, 13); case 14: return _mm256_srli_si256(v, 14); case 15: return _mm256_srli_si256(v, 15); default: return _mm256_setzero_si256(); } } static inline size_t insert_nl_gt16(const __m256i v0, uint8_t *output, int wrap_max, int *wrap_cnt) { uint8_t *out = output; int wrap_rem = wrap_max - *wrap_cnt; _mm256_storeu_si256((__m256i *)(output), v0); if (wrap_rem > 32) { *wrap_cnt += 32; return 32; } __m256i all_ff_mask = _mm256_set1_epi8((char)0xFF); __m256i mask_second_lane = _mm256_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF); __m256i blended_0L = v0; int surplus_0 = wrap_rem < 16 ? 1 : 0; if (surplus_0 == 1) { __m256i shifted_0_L = shift_left_zeros(shift_right_zeros(v0, wrap_rem), wrap_rem + surplus_0); __m256i mask_shifted_0_L = shift_left_zeros(all_ff_mask, wrap_rem + surplus_0); __m256i mask = _mm256_or_si256(mask_shifted_0_L, mask_second_lane); __m256i shifted_1_L = shift_left_zeros(v0, 1); __m256i shifted = _mm256_blendv_epi8(shifted_0_L, shifted_1_L, mask); blended_0L = _mm256_blendv_epi8(v0, shifted, mask); _mm256_storeu_si256((__m256i *)(output), blended_0L); wrap_rem += wrap_max; } int surplus_1 = (wrap_rem >= 16 && wrap_rem < 32) ? 1 : 0; int last_of_1L = _mm256_extract_epi8(v0, 31); if (surplus_1 == 1) { uint16_t sec_last_of_1L = _mm256_extract_epi8(v0, 30); int wrap_rem_1 = wrap_rem - 16; __m256i shifted_1_L = shift_left_zeros(shift_right_zeros(v0, wrap_rem_1), wrap_rem_1 + surplus_0 + surplus_1); __m256i mask_shifted_1_L = shift_left_zeros(all_ff_mask, wrap_rem_1 + surplus_0 + surplus_1); __m256i mask = _mm256_and_si256(mask_second_lane, mask_shifted_1_L); __m256i blended_1L = _mm256_blendv_epi8(blended_0L, shifted_1_L, mask); _mm256_storeu_si256((__m256i *)(output), blended_1L); output[wrap_rem + surplus_0] = '\n'; output[31 + surplus_0] = (uint8_t)sec_last_of_1L; output[31 + surplus_0 + surplus_1] = last_of_1L; } if (surplus_0 == 1) { output[wrap_rem - wrap_max] = '\n'; output[16] = _mm256_extract_epi8(v0, 15); output[31 + surplus_0 + surplus_1] = last_of_1L; } *wrap_cnt = wrap_rem > 32 ? 32 - (wrap_rem - wrap_max) : 32 - wrap_rem; int nl_at_end = 0; if (*wrap_cnt == wrap_max || *wrap_cnt == 0) { *wrap_cnt = 0; output[32 + surplus_0 + surplus_1] = '\n'; nl_at_end = 1; } out += 32 + surplus_0 + surplus_1 + nl_at_end; size_t written = (size_t)(out - output); return written; } static inline __m256i insert_line_feed32(__m256i input, int K) { __m256i line_feed_vector = _mm256_set1_epi8('\n'); __m128i identity = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); if (K >= 16) { __m128i maskhi = _mm_loadu_si128((__m128i *)shuffle_masks[K - 16]); __m256i mask = _mm256_set_m128i(maskhi, identity); __m256i lf_pos = _mm256_cmpeq_epi8(mask, _mm256_set1_epi8((char)0x80)); __m256i shuffled = _mm256_shuffle_epi8(input, mask); __m256i result = _mm256_blendv_epi8(shuffled, line_feed_vector, lf_pos); return result; } /* Shift input right by 1 byte */ __m256i shift = _mm256_alignr_epi8(input, _mm256_permute2x128_si256(input, input, 0x21), 15); input = _mm256_blend_epi32(input, shift, 0xF0); __m128i masklo = _mm_loadu_si128((__m128i *)shuffle_masks[K]); __m256i mask = _mm256_set_m128i(identity, masklo); __m256i lf_pos = _mm256_cmpeq_epi8(mask, _mm256_set1_epi8((char)0x80)); __m256i shuffled = _mm256_shuffle_epi8(input, mask); __m256i result = _mm256_blendv_epi8(shuffled, line_feed_vector, lf_pos); return result; } static inline size_t ins_nl_gt32(__m256i v, uint8_t *out, int stride, int *wrap_cnt) { const int until_nl = stride - *wrap_cnt; if (until_nl > 32) { _mm256_storeu_si256((__m256i *)out, v); *wrap_cnt += 32; return 32; } if (until_nl == 32) { _mm256_storeu_si256((__m256i *)out, v); out[32] = '\n'; *wrap_cnt = 0; return 33; } const uint8_t last = (uint8_t)_mm256_extract_epi8(v, 31); const __m256i with_lf = insert_line_feed32(v, until_nl); _mm256_storeu_si256((__m256i *)out, with_lf); out[32] = last; *wrap_cnt = 32 - until_nl; return 33; } static inline size_t insert_nl_2nd_vec_stride_12(const __m256i v0, uint8_t *output, int dummy_stride, int *wrap_cnt) { __m256i shuffling_mask = _mm256_setr_epi8(0, 1, 2, 3, (char)0xFF, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, (char)0xFF, (char)0xFF, (char)0xFF, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, (char)0xFF, 12); __m256i shuffled = _mm256_shuffle_epi8(v0, shuffling_mask); _mm256_storeu_si256((__m256i *)(output + 0), shuffled); int16_t rem_1_L_ext = _mm256_extract_epi16(v0, 7); int8_t rem_2_L_ext_P1 = _mm256_extract_epi8(v0, 29); int16_t rem_2_L_ext_P2 = _mm256_extract_epi16(v0, 15); uint8_t *out = output; out[4] = '\n'; memcpy(out + 15, &rem_1_L_ext, sizeof(rem_1_L_ext)); out[16 + 1] = '\n'; memcpy(out + 15 + 17, &rem_2_L_ext_P1, sizeof(rem_2_L_ext_P1)); out[16 + 14] = '\n'; memcpy(out + 15 + 17 + 1, &rem_2_L_ext_P2, sizeof(rem_2_L_ext_P2)); out += 32 + 3; *wrap_cnt = 4; size_t written = (out - output); return written; } static int evp_encodeblock_int_old(EVP_ENCODE_CTX *ctx, unsigned char *t, const unsigned char *f, int dlen) { int i, ret = 0; unsigned long l; const unsigned char *table; if (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0) table = srpdata_bin2ascii; else table = data_bin2ascii; for (i = dlen; i > 0; i -= 3) { if (i >= 3) { l = (((unsigned long)f[0]) << 16L) | (((unsigned long)f[1]) << 8L) | f[2]; *(t++) = conv_bin2ascii(l >> 18L, table); *(t++) = conv_bin2ascii(l >> 12L, table); *(t++) = conv_bin2ascii(l >> 6L, table); *(t++) = conv_bin2ascii(l, table); } else { l = ((unsigned long)f[0]) << 16L; if (i == 2) l |= ((unsigned long)f[1] << 8L); *(t++) = conv_bin2ascii(l >> 18L, table); *(t++) = conv_bin2ascii(l >> 12L, table); *(t++) = (i == 1) ? '=' : conv_bin2ascii(l >> 6L, table); *(t++) = '='; } ret += 4; f += 3; } *t = '\0'; return ret; } size_t evp_encodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t, const unsigned char *f, int dlen, int *wrap_cnt) { int i = 0; size_t ret = 0; uint8_t t1, t2, t3; const unsigned char *e0, *e1, *e2; int srp = (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0); int wrap_cnt_by_input = *wrap_cnt / 4 * 3; const int ctx_length = (ctx != NULL) ? EVP_ENCODE_B64_LENGTH : 0; if (srp) { e0 = base64_srp_bin2ascii_0; e1 = base64_srp_bin2ascii_1; e2 = base64_srp_bin2ascii_2; } else { e0 = base64_std_bin2ascii_0; e1 = base64_std_bin2ascii_1; e2 = base64_std_bin2ascii_2; } if (ctx_length == 1) { while (i < dlen && ctx != NULL) { t1 = f[i]; *(t++) = e0[t1]; *(t++) = e1[(t1 & 0x03) << 4]; *(t++) = '='; *(t++) = '='; *(t++) = '\n'; ret += 5; i++; } *t = '\0'; ret--; return ret; } else if (ctx_length % 3 != 0) { i = 0; int wrap_cnt_nm3 = 0; while (i + 2 < dlen) { if (ctx != NULL) { if ((wrap_cnt_nm3 < EVP_ENCODE_B64_LENGTH && (wrap_cnt_nm3 + 3 + wrap_cnt_by_input) > EVP_ENCODE_B64_LENGTH) && ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0)) { switch (EVP_ENCODE_B64_LENGTH % 3) { case 0: break; case 1: t1 = f[i]; *(t++) = e0[t1]; *(t++) = e1[(t1 & 0x03) << 4]; *(t++) = '='; *(t++) = '='; ret += 4; i++; break; case 2: t1 = f[i]; t2 = f[i + 1]; *(t++) = e0[t1]; *(t++) = e1[((t1 & 0x03) << 4) | ((t2 >> 4) & 0x0F)]; *(t++) = e2[(t2 & 0x0F) << 2]; *(t++) = '='; i += 2; ret += 4; break; } *(t++) = '\n'; ret++; wrap_cnt_nm3 = 0; } } if (ctx_length >= 4 && i + 2 < dlen) { t1 = f[i]; t2 = f[i + 1]; t3 = f[i + 2]; *(t++) = e0[t1]; *(t++) = e1[((t1 & 0x03) << 4) | ((t2 >> 4) & 0x0F)]; *(t++) = e1[((t2 & 0x0F) << 2) | ((t3 >> 6) & 0x03)]; *(t++) = e2[t3]; ret += 4; wrap_cnt_nm3 += 3; i += 3; } } } else { for (i = 0; i + 2 < dlen; i += 3) { t1 = f[i]; t2 = f[i + 1]; t3 = f[i + 2]; *(t++) = e0[t1]; *(t++) = e1[((t1 & 0x03) << 4) | ((t2 >> 4) & 0x0F)]; *(t++) = e1[((t2 & 0x0F) << 2) | ((t3 >> 6) & 0x03)]; *(t++) = e2[t3]; ret += 4; if (ctx != NULL) { if ((i + 3 + wrap_cnt_by_input) % EVP_ENCODE_B64_LENGTH == 0 && ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0) && EVP_ENCODE_B64_LENGTH % 3 == 0) { *(t++) = '\n'; ret++; } } } } switch (dlen - i) { case 0: break; case 1: t1 = f[i]; *(t++) = e0[t1]; *(t++) = e1[(t1 & 0x03) << 4]; *(t++) = '='; *(t++) = '='; ret += 4; if (ctx != NULL) { if ((i + 1 + wrap_cnt_by_input) % EVP_ENCODE_B64_LENGTH == 0 && ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0) && EVP_ENCODE_B64_LENGTH % 3 == 0) { *(t++) = '\n'; ret++; } } break; case 2: t1 = f[i]; t2 = f[i + 1]; *(t++) = e0[t1]; *(t++) = e1[((t1 & 0x03) << 4) | ((t2 >> 4) & 0x0F)]; *(t++) = e2[(t2 & 0x0F) << 2]; *(t++) = '='; ret += 4; if (ctx != NULL) { if ((i + 2 + wrap_cnt_by_input) % EVP_ENCODE_B64_LENGTH == 0 && ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0) && EVP_ENCODE_B64_LENGTH % 3 == 0) { *(t++) = '\n'; ret++; } } break; } *t = '\0'; return ret; } size_t encode_base64_avx2(EVP_ENCODE_CTX *ctx, unsigned char *dst, const unsigned char *src, int srclen, int ctx_length, int *final_wrap_cnt) { const uint8_t *input = (const uint8_t *)src; uint8_t *out = (uint8_t *)dst; int i = 0; int stride = (ctx == NULL) ? 0 : ctx_length / 3 * 4; int wrap_cnt = 0; const int use_srp = (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0); const __m256i shuf = _mm256_set_epi8(10, 11, 9, 10, 7, 8, 6, 7, 4, 5, 3, 4, 1, 2, 0, 1, 10, 11, 9, 10, 7, 8, 6, 7, 4, 5, 3, 4, 1, 2, 0, 1); int base = 0; /* Process 96 bytes at a time */ for (; i + 100 <= srclen; i += 96) { _mm_prefetch((const char *)(input + i + 192), _MM_HINT_T0); /* * Interleaved for each vector: load, shuffle, bit-split, lookup * before starting the next, giving the OoO engine independent work chains * across execution ports. */ const __m128i lo0 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 0)); const __m128i hi0 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 1)); __m256i in0 = _mm256_shuffle_epi8(_mm256_set_m128i(hi0, lo0), shuf); const __m256i t0_0 = _mm256_and_si256(in0, _mm256_set1_epi32(0x0fc0fc00)); const __m256i t1_0 = _mm256_mulhi_epu16(t0_0, _mm256_set1_epi32(0x04000040)); const __m256i t2_0 = _mm256_and_si256(in0, _mm256_set1_epi32(0x003f03f0)); const __m256i t3_0 = _mm256_mullo_epi16(t2_0, _mm256_set1_epi32(0x01000010)); const __m256i input0 = _mm256_or_si256(t1_0, t3_0); const __m128i lo1 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 2)); const __m128i hi1 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 3)); __m256i in1 = _mm256_shuffle_epi8(_mm256_set_m128i(hi1, lo1), shuf); const __m256i t0_1 = _mm256_and_si256(in1, _mm256_set1_epi32(0x0fc0fc00)); const __m256i t1_1 = _mm256_mulhi_epu16(t0_1, _mm256_set1_epi32(0x04000040)); const __m256i t2_1 = _mm256_and_si256(in1, _mm256_set1_epi32(0x003f03f0)); const __m256i t3_1 = _mm256_mullo_epi16(t2_1, _mm256_set1_epi32(0x01000010)); const __m256i input1 = _mm256_or_si256(t1_1, t3_1); const __m128i lo2 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 4)); const __m128i hi2 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 5)); __m256i in2 = _mm256_shuffle_epi8(_mm256_set_m128i(hi2, lo2), shuf); const __m256i t0_2 = _mm256_and_si256(in2, _mm256_set1_epi32(0x0fc0fc00)); const __m256i t1_2 = _mm256_mulhi_epu16(t0_2, _mm256_set1_epi32(0x04000040)); const __m256i t2_2 = _mm256_and_si256(in2, _mm256_set1_epi32(0x003f03f0)); const __m256i t3_2 = _mm256_mullo_epi16(t2_2, _mm256_set1_epi32(0x01000010)); const __m256i input2 = _mm256_or_si256(t1_2, t3_2); const __m128i lo3 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 6)); const __m128i hi3 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 7)); __m256i in3 = _mm256_shuffle_epi8(_mm256_set_m128i(hi3, lo3), shuf); const __m256i t0_3 = _mm256_and_si256(in3, _mm256_set1_epi32(0x0fc0fc00)); const __m256i t1_3 = _mm256_mulhi_epu16(t0_3, _mm256_set1_epi32(0x04000040)); const __m256i t2_3 = _mm256_and_si256(in3, _mm256_set1_epi32(0x003f03f0)); const __m256i t3_3 = _mm256_mullo_epi16(t2_3, _mm256_set1_epi32(0x01000010)); const __m256i input3 = _mm256_or_si256(t1_3, t3_3); __m256i vec0; __m256i vec1; __m256i vec2; __m256i vec3; if (use_srp) { vec0 = lookup_pshufb_srp(input0); vec1 = lookup_pshufb_srp(input1); vec2 = lookup_pshufb_srp(input2); vec3 = lookup_pshufb_srp(input3); } else { vec0 = lookup_pshufb_std(input0); vec1 = lookup_pshufb_std(input1); vec2 = lookup_pshufb_std(input2); vec3 = lookup_pshufb_std(input3); } if (stride == 0) { _mm256_storeu_si256((__m256i *)out, vec0); out += 32; _mm256_storeu_si256((__m256i *)out, vec1); out += 32; _mm256_storeu_si256((__m256i *)out, vec2); out += 32; _mm256_storeu_si256((__m256i *)out, vec3); out += 32; } else if (stride == 64) { _mm256_storeu_si256((__m256i *)out, vec0); out += 32; _mm256_storeu_si256((__m256i *)out, vec1); out += 32; *(out++) = '\n'; _mm256_storeu_si256((__m256i *)out, vec2); out += 32; _mm256_storeu_si256((__m256i *)out, vec3); out += 32; *(out++) = '\n'; } else if (stride == 4) { int out_idx = 0; out_idx += (int)insert_nl_str4(vec0, out + out_idx); out_idx += (int)insert_nl_str4(vec1, out + out_idx); out_idx += (int)insert_nl_str4(vec2, out + out_idx); out_idx += (int)insert_nl_str4(vec3, out + out_idx); out += out_idx; } else if (stride == 8) { out += insert_nl_str8(vec0, out); out += insert_nl_str8(vec1, out); out += insert_nl_str8(vec2, out); out += insert_nl_str8(vec3, out); } else if (stride == 12) { switch (base) { case 0: out += insert_nl_gt16(vec0, out, stride, &wrap_cnt); out += insert_nl_2nd_vec_stride_12(vec1, out, stride, &wrap_cnt); out += insert_nl_gt16(vec2, out, stride, &wrap_cnt); out += insert_nl_gt16(vec3, out, stride, &wrap_cnt); break; case 1: out += insert_nl_2nd_vec_stride_12(vec0, out, stride, &wrap_cnt); out += insert_nl_gt16(vec1, out, stride, &wrap_cnt); out += insert_nl_gt16(vec2, out, stride, &wrap_cnt); out += insert_nl_2nd_vec_stride_12(vec3, out, stride, &wrap_cnt); break; default: /* base == 2 */ out += insert_nl_gt16(vec0, out, stride, &wrap_cnt); out += insert_nl_gt16(vec1, out, stride, &wrap_cnt); out += insert_nl_2nd_vec_stride_12(vec2, out, stride, &wrap_cnt); out += insert_nl_gt16(vec3, out, stride, &wrap_cnt); break; } if (++base == 3) base = 0; } else if (stride >= 32) { out += ins_nl_gt32(vec0, out, stride, &wrap_cnt); out += ins_nl_gt32(vec1, out, stride, &wrap_cnt); out += ins_nl_gt32(vec2, out, stride, &wrap_cnt); out += ins_nl_gt32(vec3, out, stride, &wrap_cnt); } else if (stride >= 16) { out += insert_nl_gt16(vec0, out, stride, &wrap_cnt); out += insert_nl_gt16(vec1, out, stride, &wrap_cnt); out += insert_nl_gt16(vec2, out, stride, &wrap_cnt); out += insert_nl_gt16(vec3, out, stride, &wrap_cnt); } } if (stride == 0) { for (; i + 28 <= srclen; i += 24) { /* lo = [xxxx|DDDC|CCBB|BAAA] */ /* hi = [xxxx|HHHG|GGFF|FEEE] */ const __m128i lo = _mm_loadu_si128((const __m128i *)(input + i)); const __m128i hi = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3)); /* * bytes from groups A, B and C are needed in separate 32-bit lanes * in = [0HHH|0GGG|0FFF|0EEE[0DDD|0CCC|0BBB|0AAA] */ __m256i in = _mm256_shuffle_epi8(_mm256_set_m128i(hi, lo), shuf); const __m256i t0 = _mm256_and_si256(in, _mm256_set1_epi32(0x0fc0fc00)); const __m256i t1 = _mm256_mulhi_epu16(t0, _mm256_set1_epi32(0x04000040)); const __m256i t2 = _mm256_and_si256(in, _mm256_set1_epi32(0x003f03f0)); const __m256i t3 = _mm256_mullo_epi16(t2, _mm256_set1_epi32(0x01000010)); const __m256i indices = _mm256_or_si256(t1, t3); _mm256_storeu_si256((__m256i *)out, (use_srp ? lookup_pshufb_srp : lookup_pshufb_std)(indices)); out += 32; } } *final_wrap_cnt = wrap_cnt; if (stride >= 32 && wrap_cnt == stride) { wrap_cnt = 0; *out++ = '\n'; } return (size_t)(out - (uint8_t *)dst) + evp_encodeblock_int(ctx, out, src + i, srclen - i, final_wrap_cnt); } int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl) { int i; size_t j; size_t total = 0; *outl = 0; if (inl <= 0) return 0; assert(EVP_ENCODE_B64_LENGTH <= (int)sizeof(ctx->enc_data)); if (EVP_ENCODE_B64_LENGTH - ctx->num > inl) { memcpy(&(ctx->enc_data[ctx->num]), in, inl); ctx->num += inl; return 1; } if (ctx->num != 0) { i = EVP_ENCODE_B64_LENGTH - ctx->num; memcpy(&(ctx->enc_data[ctx->num]), in, i); in += i; inl -= i; int wrap_cnt = 0; j = evp_encodeblock_int(ctx, out, ctx->enc_data, EVP_ENCODE_B64_LENGTH, &wrap_cnt); ctx->num = 0; out += j; total = j; *out = '\0'; } int wrap_cnt = 0; if (EVP_ENCODE_B64_LENGTH % 3 != 0) { j = evp_encodeblock_int(ctx, out, in, inl - (inl % EVP_ENCODE_B64_LENGTH), &wrap_cnt); } else { #if defined(__AVX2__) const int newlines = !(ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) ? EVP_ENCODE_B64_LENGTH : 0; j = encode_base64_avx2(ctx, (unsigned char *)out, (const unsigned char *)in, inl - (inl % EVP_ENCODE_B64_LENGTH), newlines, &wrap_cnt); #elif defined(HAS_IA32CAP_IS_64) if ((OPENSSL_ia32cap_P[2] & (1u << 5)) != 0) { const int newlines = !(ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) ? EVP_ENCODE_B64_LENGTH : 0; j = encode_base64_avx2(ctx, (unsigned char *)out, (const unsigned char *)in, inl - (inl % EVP_ENCODE_B64_LENGTH), newlines, &wrap_cnt); } else { j = evp_encodeblock_int(ctx, out, in, inl - (inl % EVP_ENCODE_B64_LENGTH), &wrap_cnt); } #else j = evp_encodeblock_int(ctx, out, in, inl - (inl % EVP_ENCODE_B64_LENGTH), &wrap_cnt); #endif } in += inl - (inl % EVP_ENCODE_B64_LENGTH); inl -= inl - (inl % EVP_ENCODE_B64_LENGTH); out += j; total += j; if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0 && EVP_ENCODE_B64_LENGTH % 3 != 0) { *(out++) = '\n'; total++; } *out = '\0'; if (total > INT_MAX) { /* Too much output data! */ *outl = 0; return 0; } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl; *outl = (int)total; return 1; } /* ── helpers ────────────────────────────────────────────────────────────── */ int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen) { int wrap_cnt = 0; #if defined(__AVX2__) return (int)encode_base64_avx2(NULL, t, f, dlen, 0, &wrap_cnt); #elif defined(HAS_IA32CAP_IS_64) if ((OPENSSL_ia32cap_P[2] & (1u << 5)) != 0) return (int)encode_base64_avx2(NULL, t, f, dlen, 0, &wrap_cnt); else return (int)evp_encodeblock_int(NULL, t, f, dlen, &wrap_cnt); #else return (int)evp_encodeblock_int(NULL, t, f, dlen, &wrap_cnt); #endif } /* * base64_decode_and_compare * Decodes the base64 string produced by EVP_EncodeUpdate / EVP_EncodeFinal * and verifies it matches the original plaintext. */ static int base64_round_trip_ok(const unsigned char *encoded, int enc_len, const unsigned char *original, int orig_len) { EVP_ENCODE_CTX *dctx = EVP_ENCODE_CTX_new(); if (!dctx) return 0; unsigned char *decoded = malloc(enc_len + 4); if (!decoded) { EVP_ENCODE_CTX_free(dctx); return 0; } int dec_total = 0, n = 0; EVP_DecodeInit(dctx); EVP_DecodeUpdate(dctx, decoded, &n, encoded, enc_len); dec_total = n; EVP_DecodeFinal(dctx, decoded + dec_total, &n); dec_total += n; EVP_ENCODE_CTX_free(dctx); int ok = (dec_total == orig_len) && (memcmp(decoded, original, orig_len) == 0); free(decoded); return ok; } /* * run_encode_test * Drives EVP_EncodeUpdate + EVP_EncodeFinal on `in`/`inl`, * prints the result, and validates the round-trip. * Returns 1 on success, 0 on failure. */ static int run_encode_test(const char *label, const unsigned char *in, int inl, int use_newlines) { /* Output buffer: base64 expands ≤ 4/3 * inl, plus newlines + slop */ int out_buf_size = ((inl / 3) + 2) * 4 + (inl / 48) + 64; unsigned char *out = calloc(1, out_buf_size); if (!out) return 0; EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new(); if (!ctx) { free(out); return 0; } if (!use_newlines) /* EVP_EncodeInit always sets newlines; clear the flag manually */ EVP_ENCODE_CTX_free(ctx), ctx = EVP_ENCODE_CTX_new(), /* reinit */ /* set NO_NEWLINES via the public flag after init */ (void)0; /* flag set below */ EVP_EncodeInit(ctx); if (!use_newlines) { /* * EVP_ENCODE_CTX_no_newlines() is OpenSSL 3.x. * For older trees, cast and set the flag directly. * Adjust to your OpenSSL version: */ #ifdef EVP_ENCODE_CTX_NO_NEWLINES /* public API (OpenSSL 3) */ ctx->flags |= EVP_ENCODE_CTX_NO_NEWLINES; #endif } int outl = 0, total = 0; int ret = EVP_EncodeUpdate(ctx, out, &outl, in, inl); total = outl; unsigned char final_buf[8]; int final_len = 0; EVP_EncodeFinal(ctx, final_buf, &final_len); if (final_len > 0) memcpy(out + total, final_buf, final_len); total += final_len; EVP_ENCODE_CTX_free(ctx); printf("[%s] EVP_EncodeUpdate returned %d, total encoded bytes = %d\n", label, ret, total); printf("[%s] Encoded output:\n%.*s\n", label, total, out); int ok = base64_round_trip_ok(out, total, in, inl); printf("[%s] Round-trip decode: %s\n\n", label, ok ? "PASS" : "FAIL"); free(out); return ok; } /* ── main ───────────────────────────────────────────────────────────────── */ int main(void) { int all_pass = 1; /* * Build input that is large enough to exercise the main encoding loop * (needs to exceed EVP_ENCODE_B64_LENGTH = 48 bytes so that the * inner block-processing branch is reached). * * Use 192 bytes (= 4 × 48) so every alignment case is covered and * the AVX2 / scalar paths each process multiple full blocks. */ unsigned char input[192]; for (int i = 0; i < (int)sizeof(input); i++) input[i] = (unsigned char)(i & 0xFF); /* ── sub-test 1 : force AVX2 path ───────────────────────────────── */ printf("=== Sub-test 1: HAS_IA32CAP_IS_64, AVX2 bit SET (encode_base64_avx2) ===\n"); unsigned int saved_cap = OPENSSL_ia32cap_P[2]; if ((OPENSSL_ia32cap_P[2] & (1u << 5)) == 0) { OPENSSL_ia32cap_P[2] |= AVX2_BIT; /* set bit 5 */ all_pass &= run_encode_test("AVX2-path, with-newlines", input, sizeof(input), 1); all_pass &= run_encode_test("AVX2-path, no-newlines", input, sizeof(input), 0); /* ── sub-test 2 : force scalar path ─────────────────────────────── */ printf("=== Sub-test 2: HAS_IA32CAP_IS_64, AVX2 bit CLEAR (evp_encodeblock_int) ===\n"); OPENSSL_ia32cap_P[2] &= ~AVX2_BIT; /* clear bit 5 */ all_pass &= run_encode_test("scalar-path, with-newlines", input, sizeof(input), 1); all_pass &= run_encode_test("scalar-path, no-newlines", input, sizeof(input), 0); /* restore capability word */ OPENSSL_ia32cap_P[2] = saved_cap; /* ── sub-test 3 : partial block (ctx->num carry-over path) ──────── */ printf("=== Sub-test 3: partial-block carry-over (num != 0 path) ===\n"); /* * Feed data in two chunks so that ctx->num is non-zero on the * second call, exercising the memcpy + encode of the partial block. */ { unsigned char out[512]; int outl = 0, total = 0; EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new(); EVP_EncodeInit(ctx); /* First call: 20 bytes → stored in ctx->enc_data, ctx->num = 20 */ OPENSSL_ia32cap_P[2] |= AVX2_BIT; int r1 = EVP_EncodeUpdate(ctx, out, &outl, input, 20); total += outl; printf("[partial-block] first call (20 bytes): ret=%d outl=%d\n", r1, outl); /* Second call: 172 bytes → triggers the ctx->num != 0 flush */ int r2 = EVP_EncodeUpdate(ctx, out + total, &outl, input + 20, 172); total += outl; printf("[partial-block] second call (172 bytes): ret=%d outl=%d\n", r2, outl); int final_len = 0; EVP_EncodeFinal(ctx, out + total, &final_len); total += final_len; EVP_ENCODE_CTX_free(ctx); OPENSSL_ia32cap_P[2] = saved_cap; int ok = base64_round_trip_ok(out, total, input, sizeof(input)); printf("[partial-block] Round-trip decode: %s\n\n", ok ? "PASS" : "FAIL"); all_pass &= ok; } } printf("==============================\n"); printf("Overall result: %s\n", all_pass ? "ALL TESTS PASSED" : "SOME TESTS FAILED"); return all_pass ? 0 : 1; } chibicc-1.0.24/test/enum.c000077500000000000000000000013041517770275000152650ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(0, ({ enum { zero, one, two }; zero; })); ASSERT(1, ({ enum { zero, one, two }; one; })); ASSERT(2, ({ enum { zero, one, two }; two; })); ASSERT(5, ({ enum { five=5, six, seven }; five; })); ASSERT(6, ({ enum { five=5, six, seven }; six; })); ASSERT(0, ({ enum { zero, five=5, three=3, four }; zero; })); ASSERT(5, ({ enum { zero, five=5, three=3, four }; five; })); ASSERT(3, ({ enum { zero, five=5, three=3, four }; three; })); ASSERT(4, ({ enum { zero, five=5, three=3, four }; four; })); ASSERT(4, ({ enum { zero, one, two } x; sizeof(x); })); ASSERT(4, ({ enum t { zero, one, two }; enum t y; sizeof(y); })); printf("OK\n"); return 0; } chibicc-1.0.24/test/enum_extensibility.c000066400000000000000000000006161517770275000202430ustar00rootroot00000000000000 #include "test.h" // enum_extensibility_basic.c enum __attribute__((enum_extensibility(open))) Color { RED, GREEN, BLUE }; enum __attribute__((enum_extensibility(closed))) Shape { CIRCLE, SQUARE }; int main(void) { enum Color c = RED; enum Shape s = CIRCLE; printf("%d %d\n", c, s); ASSERT(RED, c); ASSERT(CIRCLE, s); printf("OK\n"); return 0; } chibicc-1.0.24/test/extasm_mem_no_reg.c000066400000000000000000000003541517770275000200120ustar00rootroot00000000000000#include "test.h" int main() { int x = 0; __asm__ volatile( "# %rax %rbx %rcx %rdx %rsi %rdi %r8 %r9 %r10 %r11 %r12 %r13 %r14 %r15\n" "movl $123, %0\n" : "=m"(x) : : "memory"); ASSERT(123, x); return 0; } chibicc-1.0.24/test/extern.c000077500000000000000000000005061517770275000156310ustar00rootroot00000000000000#include "test.h" extern int ext1; extern int *ext2; inline int inline_fn(void) { return 3; } int main() { ASSERT(5, ext1); ASSERT(5, *ext2); extern int ext3; ASSERT(7, ext3); int ext_fn1(int x); ASSERT(5, ext_fn1(5)); extern int ext_fn2(int x); ASSERT(8, ext_fn2(8)); printf("OK\n"); return 0; } chibicc-1.0.24/test/fallthrough.c000066400000000000000000000011071517770275000166360ustar00rootroot00000000000000#include "test.h" int main() { int state = 0; int c = '5'; // ASCII value of character '5' int arg = -1; switch (state) { case 0: // Simulate condition that fails (c < 0x3c or c > 0x3f), so no break if (c >= 0x3c && c <= 0x3f) { // shouldn't enter here break; } // fallthrough to case 1 arg = 0; // no break case 1: if (c >= '0' && c <= '9') { arg *= 10; arg += c - '0'; } break; } printf("arg = %d\n", arg); ASSERT(5, arg); return 0; } chibicc-1.0.24/test/flag_enum.c000066400000000000000000000016431517770275000162610ustar00rootroot00000000000000#include "test.h" enum __attribute__((__flag_enum__)) FileMode { FM_READ = 1 << 0, FM_WRITE = 1 << 1, FM_EXEC = 1 << 2 }; typedef enum __attribute__((__flag_enum__)) { OPT_A = 1, OPT_B = 2, OPT_C = 4 } Options; Options enable_all(void) { return OPT_A | OPT_B | OPT_C; } enum __attribute__((__flag_enum__)) Flags { F1 = 1, F2 = 2 }; int f(enum Flags x) { return x & F1; } enum __attribute__((packed, __flag_enum__)) Flags2 { A = 1, B = 2 }; int use(enum Flags2 f) { return f | A; } int can_write(enum FileMode m) { return (m & FM_WRITE) != 0; } int main(void) { enum FileMode mode = FM_READ | FM_WRITE; ASSERT(1, can_write(mode)); mode = FM_READ | FM_EXEC; ASSERT(0, can_write(mode)); ASSERT(OPT_A | OPT_B | OPT_C, enable_all()); ASSERT(1, f(F1)); ASSERT(0, f(F2)); ASSERT(3, use(B)); printf("OK\n"); return 0; } chibicc-1.0.24/test/float.c000077500000000000000000000042451517770275000154350ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(35, (float)(char)35); ASSERT(35, (float)(short)35); ASSERT(35, (float)(int)35); ASSERT(35, (float)(long)35); ASSERT(35, (float)(unsigned char)35); ASSERT(35, (float)(unsigned short)35); ASSERT(35, (float)(unsigned int)35); ASSERT(35, (float)(unsigned long)35); ASSERT(35, (double)(char)35); ASSERT(35, (double)(short)35); ASSERT(35, (double)(int)35); ASSERT(35, (double)(long)35); ASSERT(35, (double)(unsigned char)35); ASSERT(35, (double)(unsigned short)35); ASSERT(35, (double)(unsigned int)35); ASSERT(35, (double)(unsigned long)35); ASSERT(35, (char)(float)35); ASSERT(35, (short)(float)35); ASSERT(35, (int)(float)35); ASSERT(35, (long)(float)35); ASSERT(35, (unsigned char)(float)35); ASSERT(35, (unsigned short)(float)35); ASSERT(35, (unsigned int)(float)35); ASSERT(35, (unsigned long)(float)35); ASSERT(35, (char)(double)35); ASSERT(35, (short)(double)35); ASSERT(35, (int)(double)35); ASSERT(35, (long)(double)35); ASSERT(35, (unsigned char)(double)35); ASSERT(35, (unsigned short)(double)35); ASSERT(35, (unsigned int)(double)35); ASSERT(35, (unsigned long)(double)35); ASSERT(-2147483648, (double)(unsigned long)(long)-1); ASSERT(1, 2e3==2e3); ASSERT(0, 2e3==2e5); ASSERT(1, 2.0==2); ASSERT(0, 5.1<5); ASSERT(0, 5.0<5); ASSERT(1, 4.9<5); ASSERT(0, 5.1<=5); ASSERT(1, 5.0<=5); ASSERT(1, 4.9<=5); ASSERT(1, 2e3f==2e3); ASSERT(0, 2e3f==2e5); ASSERT(1, 2.0f==2); ASSERT(0, 5.1f<5); ASSERT(0, 5.0f<5); ASSERT(1, 4.9f<5); ASSERT(0, 5.1f<=5); ASSERT(1, 5.0f<=5); ASSERT(1, 4.9f<=5); ASSERT(6, 2.3+3.8); ASSERT(-1, 2.3-3.8); ASSERT(-3, -3.8); ASSERT(13, 3.3*4); ASSERT(2, 5.0/2); ASSERT(6, 2.3f+3.8f); ASSERT(6, 2.3f+3.8); ASSERT(-1, 2.3f-3.8); ASSERT(-3, -3.8f); ASSERT(13, 3.3f*4); ASSERT(2, 5.0f/2); ASSERT(0, 0.0/0.0 == 0.0/0.0); ASSERT(1, 0.0/0.0 != 0.0/0.0); ASSERT(0, 0.0/0.0 < 0); ASSERT(0, 0.0/0.0 <= 0); ASSERT(0, 0.0/0.0 > 0); ASSERT(0, 0.0/0.0 >= 0); ASSERT(0, !3.); ASSERT(1, !0.); ASSERT(0, !3.f); ASSERT(1, !0.f); ASSERT(5, 0.0 ? 3 : 5); ASSERT(3, 1.2 ? 3 : 5); printf("OK\n"); return 0; } chibicc-1.0.24/test/float2.c000066400000000000000000000030041517770275000155040ustar00rootroot00000000000000#include "test.h" long double g0 = 343.4314; int main(void) { long double l0 = 343.4314; long double l1 = 343.4314L; ASSERT(0, g0 == l1); ASSERT(0, l0 == l1); ASSERT(0, 0.0/0.0 == 0.0/0.0); ASSERT(1, 0.0/0.0 != 0.0/0.0); ASSERT(0, 0.0/0.0 < 0); ASSERT(0, 0.0/0.0 <= 0); ASSERT(0, 0.0/0.0 > 0); ASSERT(0, 0.0/0.0 >= 0); ASSERT(0, 0.0f/0.0f == 0.0f/0.0f); ASSERT(1, 0.0f/0.0f != 0.0f/0.0f); ASSERT(0, 0.0f/0.0f < 0); ASSERT(0, 0.0f/0.0f <= 0); ASSERT(0, 0.0f/0.0f > 0); ASSERT(0, 0.0f/0.0f >= 0); ASSERT(0, 0.0L/0.0L == 0.0L/0.0L); ASSERT(1, 0.0L/0.0L != 0.0L/0.0L); ASSERT(0, 0.0L/0.0L < 0); ASSERT(0, 0.0L/0.0L <= 0); ASSERT(0, 0.0L/0.0L > 0); ASSERT(0, 0.0L/0.0L >= 0); ASSERT(1, ({ float f = 0.0f; (_Bool)(f/f); })); ASSERT(1, ({ double d = -0.0; (d/d)?1:0; })); ASSERT(1, ({ long double ld = 0.0L; int i = 0; if(ld/ld) i = 1; i; })); { float pos_z; pos_z = +0.0f; float neg_z; neg_z = -0.0f; ASSERT(1, pos_z == neg_z && memcmp(&pos_z, &neg_z, sizeof(float))); pos_z = -pos_z; ASSERT(1, pos_z == neg_z && !memcmp(&pos_z, &neg_z, sizeof(float))); } { double pos_z; pos_z = +0.0; double neg_z; neg_z = -0.0; ASSERT(1, pos_z == neg_z && memcmp(&pos_z, &neg_z, sizeof(double))); neg_z = -neg_z; ASSERT(1, pos_z == neg_z && !memcmp(&pos_z, &neg_z, sizeof(double))); } { long double pos_z; pos_z = +0.0L; long double neg_z; neg_z = -0.0L; ASSERT(1, pos_z == neg_z && memcmp(&pos_z, &neg_z, 10)); } printf("OK\n"); } chibicc-1.0.24/test/floatb.c000066400000000000000000000002431517770275000155660ustar00rootroot00000000000000 #include "test.h" float add_float2(float x, float y) { return x + y; } int main() { float r = add_float2(2.3, 3.8); printf("%f\n", r); ASSERT(6.1, r); } chibicc-1.0.24/test/foo.c000066400000000000000000000002161517770275000151020ustar00rootroot00000000000000 #include "test.h" const char str[] = {"foo"}; int main() { printf("foo %ld\n", sizeof(str)); ASSERT(4, sizeof(str)); return 0; }chibicc-1.0.24/test/fork2.c000066400000000000000000000040111517770275000153370ustar00rootroot00000000000000#define _GNU_SOURCE #include #include #include #include #include typedef struct ThreadState { int id; int value; } ThreadState; // Simulate Python's _PyThreadState_Current using TLS __thread ThreadState *thread_state = NULL; // Constructor to initialize main thread state __attribute__((constructor)) static void init_main_thread_state(void) { thread_state = malloc(sizeof(ThreadState)); thread_state->id = 1; thread_state->value = 42; printf("Constructor: main thread_state->value=%d\n", thread_state->value); } void *thread_func(void *arg) { // Each thread must initialize its own thread_state thread_state = malloc(sizeof(ThreadState)); thread_state->id = 2; thread_state->value = 100; printf("Thread: id=%d, value=%d\n", thread_state->id, thread_state->value); thread_state->value += 7; printf("Thread after update: id=%d, value=%d\n", thread_state->id, thread_state->value); return NULL; } int main(void) { printf("Main before fork: id=%d, value=%d\n", thread_state->id, thread_state->value); // Launch a thread pthread_t th; if (pthread_create(&th, NULL, thread_func, NULL)) { perror("pthread_create"); exit(1); } pthread_join(th, NULL); printf("Main after thread: id=%d, value=%d\n", thread_state->id, thread_state->value); // Fork child process pid_t pid = fork(); if (pid < 0) { perror("fork"); exit(1); } else if (pid == 0) { // Child process printf("Child process before change: id=%d, value=%d\n", thread_state->id, thread_state->value); thread_state->value += 1000; printf("Child process after change: id=%d, value=%d\n", thread_state->id, thread_state->value); exit(0); } else { // Parent process int status; waitpid(pid, &status, 0); printf("Parent after child: id=%d, value=%d\n", thread_state->id, thread_state->value); } free(thread_state); return 0; } chibicc-1.0.24/test/fpie.c000066400000000000000000000003151517770275000152420ustar00rootroot00000000000000 #include "test.h" char message[] = "Hello World"; int main(int argc, char *argv[], char *envp[]) { puts(message); printf("%ld\n", sizeof(message)); ASSERT(12, sizeof(message)); return 0; }chibicc-1.0.24/test/frame_address.c000066400000000000000000000021601517770275000171160ustar00rootroot00000000000000#include "test.h" // Force stack alignment > 16 to trigger use_rbx in chibicc void *get_parent_frame(void) __attribute__((noinline)); void *get_parent_frame(void) { volatile int x __attribute__((aligned(32))) = 0; // This should return the frame pointer of the caller (main) // If chibicc uses %rbx (lvar_ptr) instead of %rbp, this will return garbage/wrong frame return __builtin_frame_address(1); } void *get_return_addr(void) __attribute__((noinline)); void *get_return_addr(void) { volatile int x __attribute__((aligned(32))) = 0; return __builtin_return_address(0); } int main() { void *main_fp = __builtin_frame_address(0); void *parent_fp = get_parent_frame(); // The parent of get_parent_frame should be main's frame pointer if (main_fp != parent_fp) { printf("FAIL: main_fp %p != parent_fp %p\n", main_fp, parent_fp); exit(1); } void *ra = get_return_addr(); // Return address should be non-null and look like a code address if (!ra) { printf("FAIL: return address is NULL\n"); exit(1); } printf("OK\n"); return 0; } chibicc-1.0.24/test/funcstack.c000066400000000000000000000046071517770275000163100ustar00rootroot00000000000000#include "test.h" typedef struct StRegSized { unsigned char r; } StRegSized; void func1(int a, int b, int c, int d, StRegSized st) { ASSERT(1, a); ASSERT(2, b); ASSERT(3, c); ASSERT(4, d); ASSERT(99, st.r); } void func2(int a, int b, int c, int d, int e, StRegSized st) { ASSERT(1, a); ASSERT(2, b); ASSERT(3, c); ASSERT(4, d); ASSERT(5, e); ASSERT(99, st.r); } void func3(int a, int b, int c, int d, int e, int f, StRegSized st) { ASSERT(1, a); ASSERT(2, b); ASSERT(3, c); ASSERT(4, d); ASSERT(5, e); ASSERT(6, f); ASSERT(99, st.r); } void func4(int a, int b, int c, int d, int e, int f, int g, StRegSized st) { ASSERT(1, a); ASSERT(2, b); ASSERT(3, c); ASSERT(4, d); ASSERT(5, e); ASSERT(6, f); ASSERT(7, g); ASSERT(99, st.r); } void func5(int a, int b, int c, StRegSized st) { ASSERT(1, a); ASSERT(2, b); ASSERT(3, c); ASSERT(99, st.r); } void func6(int a, int b, StRegSized st) { ASSERT(1, a); ASSERT(2, b); ASSERT(99, st.r); } void func7(int a, StRegSized st) { ASSERT(1, a); ASSERT(99, st.r); } void func8(int a, int b, int c, StRegSized st, int d) { ASSERT(1, a); ASSERT(2, b); ASSERT(3, c); ASSERT(99, st.r); ASSERT(4, d); } void func9(int a, int b, StRegSized st, int c, int d) { ASSERT(1, a); ASSERT(2, b); ASSERT(99, st.r); ASSERT(3, c); ASSERT(4, d); } void funca(int a, StRegSized st, int b, int c, int d) { ASSERT(1, a); ASSERT(99, st.r); ASSERT(2, b); ASSERT(3, c); ASSERT(4, d); } void funcb(int a, StRegSized st, int b, StRegSized st2, int c) { ASSERT(1, a); ASSERT(99, st.r); ASSERT(2, b); ASSERT(98, st2.r); ASSERT(3, c); } void funcc(int a, StRegSized st, int b, StRegSized st2, StRegSized st3) { ASSERT(1, a); ASSERT(99, st.r); ASSERT(2, b); ASSERT(98, st2.r); ASSERT(97, st3.r); } void funcd(int a, StRegSized st, int b, StRegSized st2, StRegSized st3, int c) { ASSERT(1, a); ASSERT(99, st.r); ASSERT(2, b); ASSERT(98, st2.r); ASSERT(97, st3.r); ASSERT(3, c); } int main(void) { StRegSized x = {99}; StRegSized y = {98}; StRegSized z = {97}; func1(1, 2, 3, 4, x); func2(1, 2, 3, 4, 5, x); func3(1, 2, 3, 4, 5, 6, x); func4(1, 2, 3, 4, 5, 6, 7, x); func5(1, 2, 3, x); func6(1, 2, x); func7(1, x); func8(1, 2, 3, x, 4); func9(1, 2, x, 3, 4); funca(1, x, 2, 3, 4); funcb(1, x, 2, y, 3); funcc(1, x, 2, y, z); funcd(1, x, 2, y, z, 3); }chibicc-1.0.24/test/function.c000077500000000000000000000233551517770275000161600ustar00rootroot00000000000000#include "test.h" int ret3(void) { return 3; return 5; } int add2(int x, int y) { return x + y; } int sub2(int x, int y) { return x - y; } int add6(int a, int b, int c, int d, int e, int f) { return a + b + c + d + e + f; } int addx(int *x, int y) { return *x + y; } int sub_char(char a, char b, char c) { return a - b - c; } int fib(int x) { if (x <= 1) return 1; return fib(x - 1) + fib(x - 2); } int sub_long(long a, long b, long c) { return a - b - c; } int sub_short(short a, short b, short c) { return a - b - c; } int g1; int *g1_ptr(void) { return &g1; } char int_to_char(int x) { return x; } int div_long(long a, long b) { return a / b; } _Bool bool_fn_add(_Bool x) { return x + 1; } _Bool bool_fn_sub(_Bool x) { return x - 1; } static int static_fn(void) { return 3; } int param_decay(int x[]) { return x[0]; } int counter() { static int i; static int j = 1 + 1; return i++ + j++; } void ret_none() { return; } _Bool true_fn(); _Bool false_fn(); char char_fn(); short short_fn(); unsigned char uchar_fn(); unsigned short ushort_fn(); char schar_fn(); short sshort_fn(); int multiple1(), multiple2(); int add_all(int n, ...); typedef struct { int gp_offset; int fp_offset; void *overflow_arg_area; unsigned int remaining; void *reg_save_area; } __va_elem; typedef __va_elem va_list[1]; int add_all(int n, ...); int sprintf(char *buf, char *fmt, ...); int vsprintf(char *buf, char *fmt, va_list ap); char *fmt(char *buf, char *fmt, ...) { va_list ap; *ap = *(__va_elem *)__va_area__; vsprintf(buf, fmt, ap); } double add_double(double x, double y); float add_float(float x, float y); float add_float3(float x, float y, float z) { return x + y + z; } double add_double3(double x, double y, double z) { return x + y + z; } int (*fnptr(int (*fn)(int n, ...)))(int, ...) { return fn; } int param_decay2(int x()) { return x(); } char *func_fn(void) { return __func__; } char *function_fn(void) { return __FUNCTION__; } int add10_int(int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8, int x9, int x10); float add10_float(float x1, float x2, float x3, float x4, float x5, float x6, float x7, float x8, float x9, float x10); double add10_double(double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9, double x10); int many_args1(int a, int b, int c, int d, int e, int f, int g, int h) { return g / h; } double many_args2(double a, double b, double c, double d, double e, double f, double g, double h, double i, double j) { return i / j; } int many_args3(int a, double b, int c, int d, double e, int f, double g, int h, double i, double j, double k, double l, double m, int n, int o, double p) { return o / p; } typedef struct { int a, b; short c; char d; } Ty4; typedef struct { int a; float b; double c; } Ty5; typedef struct { unsigned char a[3]; } Ty6; typedef struct { long a, b, c; } Ty7; int struct_test5(Ty5 x, int n); int struct_test4(Ty4 x, int n); int struct_test6(Ty6 x, int n); int struct_test7(Ty7 x, int n); int struct_test14(Ty4 x, int n) { switch (n) { case 0: return x.a; case 1: return x.b; case 2: return x.c; default: return x.d; } } int struct_test15(Ty5 x, int n) { switch (n) { case 0: return x.a; case 1: return x.b; default: return x.c; } } typedef struct { unsigned char a[10]; } Ty20; typedef struct { unsigned char a[20]; } Ty21; Ty4 struct_test24(void); Ty5 struct_test25(void); Ty6 struct_test26(void); Ty20 struct_test27(void); Ty21 struct_test28(void); Ty4 struct_test34(void) { return (Ty4){10, 20, 30, 40}; } Ty5 struct_test35(void) { return (Ty5){10, 20, 30}; } Ty6 struct_test36(void) { return (Ty6){10, 20, 30}; } Ty20 struct_test37(void) { return (Ty20){10, 20, 30, 40, 50, 60, 70, 80, 90, 100}; } Ty21 struct_test38(void) { return (Ty21){1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}; } inline int inline_fn(void) { return 3; } double to_double(long double x) { return x; } long double to_ldouble(int x) { return x; } int main() { ASSERT(3, ret3()); ASSERT(8, add2(3, 5)); ASSERT(2, sub2(5, 3)); ASSERT(21, add6(1, 2, 3, 4, 5, 6)); ASSERT(66, add6(1, 2, add6(3, 4, 5, 6, 7, 8), 9, 10, 11)); ASSERT(136, add6(1, 2, add6(3, add6(4, 5, 6, 7, 8, 9), 10, 11, 12, 13), 14, 15, 16)); ASSERT(7, add2(3, 4)); ASSERT(1, sub2(4, 3)); ASSERT(55, fib(9)); ASSERT(1, ({ sub_char(7, 3, 3); })); ASSERT(1, sub_long(7, 3, 3)); ASSERT(1, sub_short(7, 3, 3)); g1 = 3; ASSERT(3, *g1_ptr()); ASSERT(5, int_to_char(261)); ASSERT(5, int_to_char(261)); ASSERT(-5, div_long(-10, 2)); ASSERT(1, bool_fn_add(3)); ASSERT(0, bool_fn_sub(3)); ASSERT(1, bool_fn_add(-3)); ASSERT(0, bool_fn_sub(-3)); ASSERT(1, bool_fn_add(0)); ASSERT(1, bool_fn_sub(0)); ASSERT(3, static_fn()); ASSERT(3, ({ int x[2]; x[0]=3; param_decay(x); })); ASSERT(2, counter()); ASSERT(4, counter()); ASSERT(6, counter()); ret_none(); ASSERT(1, true_fn()); ASSERT(0, false_fn()); ASSERT(3, char_fn()); ASSERT(5, short_fn()); ASSERT(6, add_all(3, 1, 2, 3)); ASSERT(5, add_all(4, 1, 2, 3, -1)); { char buf[100]; fmt(buf, "%d %d %s", 1, 2, "foo"); printf("%s\n", buf); } ASSERT(0, ({ char buf[100]; sprintf(buf, "%d %d %s", 1, 2, "foo"); strcmp("1 2 foo", buf); })); ASSERT(0, ({ char buf[100]; fmt(buf, "%d %d %s", 1, 2, "foo"); strcmp("1 2 foo", buf); })); ASSERT(251, uchar_fn()); ASSERT(65528, ushort_fn()); ASSERT(-5, schar_fn()); ASSERT(-8, sshort_fn()); ASSERT(6, add_float(2.3, 3.8)); ASSERT(6, add_double(2.3, 3.8)); ASSERT(7, add_float3(2.5, 2.5, 2.5)); ASSERT(7, add_double3(2.5, 2.5, 2.5)); ASSERT(0, ({ char buf[100]; sprintf(buf, "%.1f", (float)3.5); strcmp(buf, "3.5"); })); ASSERT(0, ({ char buf[100]; fmt(buf, "%.1f", (float)3.5); strcmp(buf, "3.5"); })); ASSERT(5, (add2)(2, 3)); ASSERT(5, (&add2)(2, 3)); ASSERT(7, ({ int (*fn)(int,int) = add2; fn(2,5); })); ASSERT(6, fnptr(add_all)(3, 1, 2, 3)); ASSERT(3, param_decay2(ret3)); ASSERT(5, sizeof(__func__)); ASSERT(0, strcmp("main", __func__)); ASSERT(0, strcmp("func_fn", func_fn())); ASSERT(0, strcmp("main", __FUNCTION__)); ASSERT(0, strcmp("function_fn", function_fn())); ASSERT(55, add10_int(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); ASSERT(55, add10_float(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); ASSERT(55, add10_double(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); ASSERT(0, ({ char buf[200]; sprintf(buf, "%d %.1f %.1f %.1f %d %d %.1f %d %d %d %d %.1f %d %d %.1f %.1f %.1f %.1f %d", 1, 1.0, 1.0, 1.0, 1, 1, 1.0, 1, 1, 1, 1, 1.0, 1, 1, 1.0, 1.0, 1.0, 1.0, 1); strcmp("1 1.0 1.0 1.0 1 1 1.0 1 1 1 1 1.0 1 1 1.0 1.0 1.0 1.0 1", buf); })); ASSERT(4, many_args1(1, 2, 3, 4, 5, 6, 40, 10)); ASSERT(4, many_args2(1, 2, 3, 4, 5, 6, 7, 8, 40, 10)); ASSERT(8, many_args3(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 80, 10)); ASSERT(10, ({ Ty4 x={10,20,30,40}; struct_test4(x, 0); })); ASSERT(20, ({ Ty4 x={10,20,30,40}; struct_test4(x, 1); })); ASSERT(30, ({ Ty4 x={10,20,30,40}; struct_test4(x, 2); })); ASSERT(40, ({ Ty4 x={10,20,30,40}; struct_test4(x, 3); })); ASSERT(10, ({ Ty5 x={10,20,30}; struct_test5(x, 0); })); ASSERT(20, ({ Ty5 x={10,20,30}; struct_test5(x, 1); })); ASSERT(30, ({ Ty5 x={10,20,30}; struct_test5(x, 2); })); ASSERT(10, ({ Ty6 x={10,20,30}; struct_test6(x, 0); })); ASSERT(20, ({ Ty6 x={10,20,30}; struct_test6(x, 1); })); ASSERT(30, ({ Ty6 x={10,20,30}; struct_test6(x, 2); })); ASSERT(10, ({ Ty7 x={10,20,30}; struct_test7(x, 0); })); ASSERT(20, ({ Ty7 x={10,20,30}; struct_test7(x, 1); })); ASSERT(30, ({ Ty7 x={10,20,30}; struct_test7(x, 2); })); ASSERT(10, ({ Ty4 x={10,20,30,40}; struct_test14(x, 0); })); ASSERT(20, ({ Ty4 x={10,20,30,40}; struct_test14(x, 1); })); ASSERT(30, ({ Ty4 x={10,20,30,40}; struct_test14(x, 2); })); ASSERT(40, ({ Ty4 x={10,20,30,40}; struct_test14(x, 3); })); ASSERT(10, ({ Ty5 x={10,20,30}; struct_test15(x, 0); })); ASSERT(20, ({ Ty5 x={10,20,30}; struct_test15(x, 1); })); ASSERT(30, ({ Ty5 x={10,20,30}; struct_test15(x, 2); })); ASSERT(10, struct_test24().a); ASSERT(20, struct_test24().b); ASSERT(30, struct_test24().c); ASSERT(40, struct_test24().d); ASSERT(10, struct_test25().a); ASSERT(20, struct_test25().b); ASSERT(30, struct_test25().c); ASSERT(10, struct_test26().a[0]); ASSERT(20, struct_test26().a[1]); ASSERT(30, struct_test26().a[2]); ASSERT(10, struct_test27().a[0]); ASSERT(60, struct_test27().a[5]); ASSERT(100, struct_test27().a[9]); ASSERT(1, struct_test28().a[0]); ASSERT(5, struct_test28().a[4]); ASSERT(10, struct_test28().a[9]); ASSERT(15, struct_test28().a[14]); ASSERT(20, struct_test28().a[19]); ASSERT(10, struct_test34().a); ASSERT(20, struct_test34().b); ASSERT(30, struct_test34().c); ASSERT(40, struct_test34().d); ASSERT(10, struct_test35().a); ASSERT(20, struct_test35().b); ASSERT(30, struct_test35().c); ASSERT(10, struct_test36().a[0]); ASSERT(20, struct_test36().a[1]); ASSERT(30, struct_test36().a[2]); ASSERT(10, struct_test37().a[0]); ASSERT(60, struct_test37().a[5]); ASSERT(100, struct_test37().a[9]); ASSERT(1, struct_test38().a[0]); ASSERT(5, struct_test38().a[4]); ASSERT(10, struct_test38().a[9]); ASSERT(15, struct_test38().a[14]); ASSERT(20, struct_test38().a[19]); ASSERT(5, (***add2)(2, 3)); ASSERT(3, inline_fn()); ASSERT(0, ({ char buf[100]; sprintf(buf, "%Lf", (long double)12.3); strncmp(buf, "12.3", 4); })); ASSERT(1, to_double(3.5) == 3.5); ASSERT(0, to_double(3.5) == 3); ASSERT(1, (long double)5.0 == (long double)5.0); ASSERT(0, (long double)5.0 == (long double)5.2); ASSERT(1, to_ldouble(5.0) == 5.0); ASSERT(0, to_ldouble(5.0) == 5.2); printf("OK\n"); } chibicc-1.0.24/test/function2.c000066400000000000000000000045511517770275000162340ustar00rootroot00000000000000#include "test.h" typedef struct { char g; } G; typedef struct { float f; } F; typedef struct { char l; float d; } A; extern float struct_test101( G g0, G g1, G g2, G g3, G g4, G g5, F f0, F f1, F f2, F f3, F f4, F f5, F f6, F f7, G gs0, F fs0, G gs1, F fs1 ); float struct_test100( G g0, G g1, G g2, G g3, G g4, G g5, F f0, F f1, F f2, F f3, F f4, F f5, F f6, F f7, G gs0, F fs0, G gs1, F fs1 ) { return g0.g + g1.g + g2.g + g3.g + g4.g + g5.g + f0.f + f1.f + f2.f + f3.f + f4.f + f5.f + f6.f + f7.f + gs0.g + gs1.g + fs0.f + fs1.f; } extern float struct_test111( F f0, F f1, F f2, F f3, F f4, F f5, F f6, F f7, G g0, G g1, G g2, G g3, G g4, G g5, G gs0, F fs0, G gs1, F fs1 ); float struct_test110( F f0, F f1, F f2, F f3, F f4, F f5, F f6, F f7, G g0, G g1, G g2, G g3, G g4, G g5, G gs0, F fs0, G gs1, F fs1 ) { return g0.g + g1.g + g2.g + g3.g + g4.g + g5.g + f0.f + f1.f + f2.f + f3.f + f4.f + f5.f + f6.f + f7.f + gs0.g + gs1.g + fs0.f + fs1.f; } extern float struct_test121( A reg0, A reg1, A reg2, A reg3, A reg4, A reg5, A s0, F f6, F f7, A s1); float struct_test120( A reg0, A reg1, A reg2, A reg3, A reg4, A reg5, A s0, F f6, F f7, A s1) { return reg0.l + reg0.d + reg1.l + reg1.d + reg2.l + reg2.d + reg3.l + reg3.d + reg4.l + reg4.d + reg5.l + reg5.d + s0.l + s0.d + s1.l + s1.d + f6.f + f7.f; } int main(void) { G g[] = {10,11,12,13,14,15}; F f[] = {20,21,22,23,24,25,26,27}; G gs[] = {30,31}; F fs[] = {40,41}; ASSERT(405, struct_test100( g[0], g[1], g[2], g[3], g[4], g[5], f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], gs[0], fs[0], gs[1], fs[1])); ASSERT(405, struct_test101( g[0], g[1], g[2], g[3], g[4], g[5], f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], gs[0], fs[0], gs[1], fs[1])); ASSERT(405, struct_test110( f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], g[0], g[1], g[2], g[3], g[4], g[5], gs[0], fs[0], gs[1], fs[1])); ASSERT(405, struct_test111( f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], g[0], g[1], g[2], g[3], g[4], g[5], gs[0], fs[0], gs[1], fs[1])); A reg[] = {10,11,20,21,30,31,40,41,50,51,60,61}; A as[] = {70,71,80,81}; ASSERT(781, struct_test120( reg[0], reg[1], reg[2], reg[3], reg[4], reg[5], as[0], f[6], f[7], as[1])); ASSERT(781, struct_test121( reg[0], reg[1], reg[2], reg[3], reg[4], reg[5], as[0], f[6], f[7], as[1])); printf("OK\n"); }chibicc-1.0.24/test/function3b.c000066400000000000000000000027641517770275000164030ustar00rootroot00000000000000#include #include #include "test.h" typedef struct { char g; } G; typedef struct { float f; } F; long double test_func(G g0, G g1, F f0, F f1, int i0, int i1, ...) { va_list ap; va_start(ap, i1); long double ret = i0 + i1; ret += va_arg(ap, long double); ret += va_arg(ap, int); ret += va_arg(ap, double); va_end(ap); return ret; } long double test_func1(G g0, G g1, F f0, F f1, int i0, int i1, ...) { va_list ap; va_start(ap, i1); long double ld = va_arg(ap, long double); va_end(ap); return ld; } double test_func2(G g0, G g1, F f0, F f1, int i0, int i1, ...) { va_list ap; va_start(ap, i1); double d = va_arg(ap, double); va_end(ap); return d; } int test_func3(G g0, G g1, F f0, F f1, int i0, int i1, ...) { va_list ap; va_start(ap, i1); int x = va_arg(ap, int); va_end(ap); return x; } int main() { G g0 = {10}, g1 = {11}; F f0 = {20.0f}, f1 = {21.0f}; long double ld = 2.5L; int i = 5; double d = 4.5; long double res1 = test_func1(g0, g1, f0, f1, 1, 2, ld); printf("Result: %Lf\n", res1); ASSERT(2, res1); double res2 = test_func2(g0, g1, f0, f1, 1, 2, d); printf("Result: %f\n", res2); ASSERT(4, res2); int res3 = test_func3(g0, g1, f0, f1, 1, 2, i); printf("Result: %d\n", res3); ASSERT(5, res3); long double res = test_func(g0, g1, f0, f1, 1, 2, ld, i, d); printf("Result: %Lf\n", res); ASSERT(15, res); return 0; } chibicc-1.0.24/test/function3c.c000066400000000000000000000032171517770275000163760ustar00rootroot00000000000000#include #include "test.h" typedef struct { char g; } G; typedef struct { float f; } F; typedef struct { char l; float d; } A; typedef struct __attribute__((aligned(32))) { char c; char pad[31]; // ensure struct size >= alignment } Aligned1024; long double test_variadic(G g0, G g1, F f0, F f1, int i0, int i1, ...) { va_list ap; va_start(ap, i1); long double ret = i0 + i1; printf("start ret=%Lf\n", ret); ASSERT(300, ret); // Read long double long double ld = va_arg(ap, long double); ret += ld; printf("after long double ret=%Lf\n", ret); ASSERT(301, ret); // Read Aligned1024 Aligned1024 s1 = va_arg(ap, Aligned1024); ret += s1.c; printf("after Aligned1024 ret=%Lf (s1.c=%d)\n", ret, s1.c); ASSERT(378, ret); // Read int int i2 = va_arg(ap, int); ret += i2; printf("after int ret=%Lf (i2=%d)\n", ret, i2); ASSERT(678, ret); // Read double double d = va_arg(ap, double); ret += d; printf("after double ret=%Lf (d=%f)\n", ret, d); ASSERT(683, ret); // Read another Aligned1024 Aligned1024 s2 = va_arg(ap, Aligned1024); ret += s2.c; printf("after second Aligned1024 ret=%Lf (s2.c=%d)\n", ret, s2.c); ASSERT(760, ret); int i3 = va_arg(ap, int); ret += i3; printf("after last int ret=%Lf (d=%d)\n", ret, i3); ASSERT(1160, ret); va_end(ap); return ret; } int main(void) { G g0 = {10}, g1 = {11}; F f0 = {20.0}, f1 = {21.0}; Aligned1024 s = {.c = 77}; long double res = test_variadic( g0, g1, f0, f1, 100, 200, (long double)1.5, s, 300, (double)4.5, s, 400 ); printf("Final result: %Lf\n", res); ASSERT(1160, res); return 0; } chibicc-1.0.24/test/function4.c000066400000000000000000000011741517770275000162340ustar00rootroot00000000000000#include #include #include "test.h" typedef struct { char _Alignas(1024) c; } Aligned1024; void test_va_args(const char *label, int n, ...) { va_list ap; va_start(ap, n); long double ld = va_arg(ap, long double); Aligned1024 *a = va_arg(ap, Aligned1024 *); int i = va_arg(ap, int); printf("%s:\n", label); printf("long double = %Lf\n", ld); printf("Aligned1024->c = %d\n", a->c); printf("int = %d\n", i); ASSERT(77, a->c); va_end(ap); } int main(void) { long double ld = 3.1415926535897932384626L; Aligned1024 a = {.c = 77}; test_va_args("Test2", 3, ld, &a, 123); return 0; } chibicc-1.0.24/test/function5.c000066400000000000000000000015761517770275000162430ustar00rootroot00000000000000#include #include #include "test.h" void dummy(long double x1, long double x2, long double x3, long double x4, long double x5, long double x6, long double x7, long double x8, long double x9, long double x10, long double x11, long double x12, long double x13, long double x14, int dummy, ...) { va_list ap; va_start(ap, dummy); long double x = va_arg(ap, long double); // Should now be on stack printf("Overflow long double = %Lf\n", x); ASSERT( 99.99L, x); va_end(ap); } int main() { // 14 long double args → xmm0-xmm7 are full → remaining will go to overflow (stack) dummy(1.1L, 2.2L, 3.3L, 4.4L, 5.5L, 6.6L, 7.7L, 8.8L, 9.9L, 10.10L, 11.11L, 12.12L, 13.13L, 14.14L, 42, // Dummy int to mark end of named args 99.99L); // This long double should be read from stack return 0; } chibicc-1.0.24/test/function6.c000066400000000000000000000025471517770275000162430ustar00rootroot00000000000000#include #include "test.h" typedef int G; // Dummy placeholder for G type typedef double F; // Dummy placeholder for F type typedef struct { char c; // no special alignment here } Aligned1024; // name kept, but no _Alignas long double struct_test130( G g0, G g1, G g2, G g3, G g4, F f0, F f1, F f2, F f3, F f4, F f5, int i0, int i1, ... ) { va_list ap; va_start(ap, i1); long double ret = i0 + i1; ret += va_arg(ap, long double); ASSERT(310, ret); ret += va_arg(ap, int); // read int ASSERT(330, ret); ret += va_arg(ap, Aligned1024).c; // read struct (just its char) ASSERT(337, ret); // you can uncomment and add more va_arg calls here as needed va_end(ap); return ret; } int main() { G g_vals[5] = {1,2,3,4,5}; F f_vals[6] = {1,2,3,4,5,6}; Aligned1024 s = {7}; // Call with variadic args: long double, int, Aligned1024 long double ld = 10.5L; int i = 20; long double result = struct_test130( g_vals[0], g_vals[1], g_vals[2], g_vals[3], g_vals[4], f_vals[0], f_vals[1], f_vals[2], f_vals[3], f_vals[4], f_vals[5], 100, 200, ld, // variadic long double i, // variadic int s // variadic struct ); printf("Result = %.2Lf\n", result); // Expected: 100 + 200 + 10.5 + 20 + 7 = 337.5 ASSERT(337.5, result); return 0; } chibicc-1.0.24/test/function6b.c000066400000000000000000000025541517770275000164030ustar00rootroot00000000000000#include #include "test.h" typedef int G; // Dummy placeholder for G type typedef double F; // Dummy placeholder for F type typedef struct { char c; // no special alignment here } Aligned1024; // name kept, but no _Alignas long double struct_test130( G g0, G g1, G g2, G g3, G g4, F f0, F f1, F f2, F f3, F f4, F f5, int i0, int i1, ... ) { va_list ap; va_start(ap, i1); long double ret = i0 + i1; ret += va_arg(ap, int); // read int ASSERT(320, ret); ret += va_arg(ap, long double); ASSERT(330, ret); ret += va_arg(ap, Aligned1024).c; // read struct (just its char) ASSERT(337, ret); // you can uncomment and add more va_arg calls here as needed va_end(ap); return ret; } int main() { G g_vals[5] = {1,2,3,4,5}; F f_vals[6] = {1,2,3,4,5,6}; Aligned1024 s = {7}; // Call with variadic args: long double, int, Aligned1024 long double ld = 10.5L; int i = 20; long double result = struct_test130( g_vals[0], g_vals[1], g_vals[2], g_vals[3], g_vals[4], f_vals[0], f_vals[1], f_vals[2], f_vals[3], f_vals[4], f_vals[5], 100, 200, i, // variadic int ld, // variadic long double s // variadic struct ); printf("Result = %.2Lf\n", result); // Expected: 100 + 200 + 10.5 + 20 + 7 = 337.5 ASSERT(337.5, result); return 0; } chibicc-1.0.24/test/function6c.c000066400000000000000000000011301517770275000163710ustar00rootroot00000000000000#include #include #include "test.h" void test_variadic(double first_named, int count, ...) { printf("named arg = %f\n", first_named); va_list ap; va_start(ap, count); for (int i = 0; i < count; i++) { double val = va_arg(ap, double); printf("variadic arg[%d] = %f\n", i, val); if (i == 15) ASSERT(15, val ); } va_end(ap); } int main() { test_variadic( 0.0, 15, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.10, 11.11, 12.12, 13.13, 14.14, 15.15 ); return 0; } chibicc-1.0.24/test/function6d.c000066400000000000000000000026341517770275000164040ustar00rootroot00000000000000#include #include #include "test.h" void test_variadic(int named_int, double named_double, long double named_longdouble, int count, ...) { printf("named int = %d\n", named_int); printf("named double = %f\n", named_double); printf("named long double = %Lf\n", named_longdouble); va_list ap; va_start(ap, count); int v_int = va_arg(ap, int); printf("variadic int = %d\n", v_int); ASSERT(11, v_int); double v_double = va_arg(ap, double); printf("variadic double = %f\n", v_double); ASSERT(6, v_double); long double v_longdouble = va_arg(ap, long double); printf("variadic long double = %Lf\n", v_longdouble); ASSERT(1, v_longdouble); for (int i = 0; i < count; i++) { double val = va_arg(ap, double); printf("variadic extra double[%d] = %f\n", i, val); } va_end(ap); } int main() { test_variadic( 42, // named int 3.14159, // named double 2.718281828459, // named long double 10, // count of extra doubles // Variadic arguments 11, // variadic int 6.62607015, // variadic double 1.61803398875L, // variadic long double // 10 extra variadic doubles 10.10, 20.20, 30.30, 40.40, 50.50, 60.60, 70.70, 80.80, 90.90, 100.100 ); return 0; } chibicc-1.0.24/test/function7.c000066400000000000000000000007441517770275000162410ustar00rootroot00000000000000#include #include #include "test.h" long double add_int_ld_variadic(int count, ...) { va_list ap; va_start(ap, count); int a = va_arg(ap, int); long double b = va_arg(ap, long double); va_end(ap); return a + b; } int main() { int x = 100; long double y = 10.5; long double result = add_int_ld_variadic(2, x, y); printf("Result = %.2Lf\n", result); ASSERT(110.5, result); // Expected: 110.50 return 0; } chibicc-1.0.24/test/gcc_attr_check.c000066400000000000000000000003551517770275000172460ustar00rootroot00000000000000#include #include struct S1 { int x __attribute__((aligned(32))), y; }; int main(){printf("offx=%zu offy=%zu align=%zu size=%zu\n",offsetof(struct S1,x),offsetof(struct S1,y),_Alignof(struct S1),sizeof(struct S1));} chibicc-1.0.24/test/generic.c000077500000000000000000000006371517770275000157450ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(1, _Generic(100.0, double: 1, int *: 2, int: 3, float: 4)); ASSERT(2, _Generic((int *)0, double: 1, int *: 2, int: 3, float: 4)); ASSERT(2, _Generic((int[3]){}, double: 1, int *: 2, int: 3, float: 4)); ASSERT(3, _Generic(100, double: 1, int *: 2, int: 3, float: 4)); ASSERT(4, _Generic(100f, double: 1, int *: 2, int: 3, float: 4)); printf("OK\n"); return 0; } chibicc-1.0.24/test/generic2.c000066400000000000000000000026271517770275000160250ustar00rootroot00000000000000#include "test.h" int main(int argc, char**argv) { ASSERT(1, ({ char c; _Generic(c << 1, int:1 ); }) ); ASSERT(1, ({ short s; _Generic(s >> 1, int:1 ); }) ); ASSERT(1, ({ struct { unsigned int c : 17; } s; _Generic(~s.c, int:1 ); }) ); ASSERT(1, ({ struct { unsigned long long c : 17; } s; _Generic(~s.c, int:1 ); }) ); ASSERT(1, ({ char c; _Generic(-c, int:1 ); }) ); ASSERT(1, ({ short s; _Generic(+s, int:1 ); }) ); ASSERT(1, _Generic((long){0}, long:1, long long:0) ); ASSERT(1, _Generic((long long){0}, long long:1, long:0) ); ASSERT(1, _Generic(1L, long:1, long long:0) ); ASSERT(1, _Generic(1LL, long long:1, long:0) ); ASSERT(1, _Generic(1UL, unsigned long:1, unsigned long long:0) ); ASSERT(1, _Generic(1lu, unsigned long:1, unsigned long long:0) ); ASSERT(1, _Generic(1ULL, unsigned long long:1, unsigned long:0) ); ASSERT(1, _Generic(1llu, unsigned long long:1, unsigned long:0) ); ASSERT(1, ({ unsigned long a; long long b; _Generic(a + b, unsigned long long:1, unsigned long:0); }) ); // ASSERT(1, ({ void *p; _Generic(argc ? p : "a", void*:1, char*:2); }) ); // ASSERT(1, ({ void *p; _Generic(argc ? "a" : p, void*:1, char*:2); }) ); // ASSERT(1, ({ double *p; char *q; _Generic(argc ? p : q, void*:1 ); }) ); // ASSERT(1, ({ double *p; char *q; _Generic(argc ? q : p, void*:1 ); }) ); ASSERT(1, ({ int vla[argc]; _Generic(vla, int*:1 ); }) ); printf("OK\n"); }chibicc-1.0.24/test/generic3.c000066400000000000000000000020441517770275000160170ustar00rootroot00000000000000#include "test.h" #include static bool test_unsigned(unsigned a, unsigned *r) { *r = a + 1; return true; } static bool test_ulong(unsigned long a, unsigned long *r) { *r = a + 10; return true; } static bool test_ull(unsigned long long a, unsigned long long *r) { *r = a + 100; return true; } // Generic macro using pointer type #define add_generic(a, r) \ _Generic((r), \ unsigned*: test_unsigned(a, (unsigned *)(r)), \ unsigned long*: test_ulong(a, (unsigned long *)(r)), \ unsigned long long*: test_ull(a, (unsigned long long *)(r))) int main(void) { unsigned u = 1; unsigned long ul = 10; unsigned long long ull = 100; unsigned ru = 0; unsigned long rul = 0; unsigned long long rull = 0; add_generic(u, &ru); add_generic(ul, &rul); add_generic(ull, &rull); printf("Results: ru=%u, rul=%lu, rull=%llu\n", ru, rul, rull); ASSERT(2, ru); ASSERT(20, rul); ASSERT(200, rull); return 0; } chibicc-1.0.24/test/has_builtin_edges.c000066400000000000000000000007501517770275000177720ustar00rootroot00000000000000#include "test.h" #ifndef __has_builtin #error #endif #if !__has_builtin(__builtin_offsetof) #error #endif #define HB __has_builtin #define NAME __builtin_offsetof #define WRAP(x) x #if !HB(NAME) #error #endif // Macro expansion inside argument should be accepted. #if !__has_builtin(__builtin_offsetof) #error #endif // Macro expansion inside argument should be accepted. #if !__has_builtin(WRAP(__builtin_offsetof)) #error #endif int main(void) { printf("OK\n"); return 0; } chibicc-1.0.24/test/hash.h000066400000000000000000000003771517770275000152570ustar00rootroot00000000000000#ifndef HASH_H #define HASH_H typedef uint32_t (*hash_func)(const void *key, size_t length); extern hash_func hash; enum hashfunc_type { JENKINS_HASH=0, MURMUR3_HASH, XXH3_HASH }; int hash_init(enum hashfunc_type type); #endif /* HASH_H */ chibicc-1.0.24/test/hello.c000077500000000000000000000002231517770275000154230ustar00rootroot00000000000000 #include "test.h" int main(int argc, char **argv) { printf("Hello World!\n"); printf("%d\n", argc); ASSERT(1, argc); return 0; }chibicc-1.0.24/test/huge.c000066400000000000000000000013561517770275000152550ustar00rootroot00000000000000 #include #include "test.h" int main() { // Test with HUGE_VALF float huge_valf = HUGE_VALF; if (huge_valf == __builtin_huge_valf()) { printf("HUGE_VALF test passed: %f\n", huge_valf); } else { printf("HUGE_VALF test failed.\n"); } // Test with HUGE_VALL long double huge_vall = HUGE_VALL; if (huge_vall == __builtin_huge_vall()) { printf("HUGE_VALL test passed: %Lf\n", huge_vall); } else { printf("HUGE_VALL test failed.\n"); } // Test with HUGE_VAL double huge_val = HUGE_VAL; if (huge_val == __builtin_huge_val()) { printf("HUGE_VAL test passed: %f\n", huge_val); } else { printf("HUGE_VAL test failed.\n"); } return 0; } chibicc-1.0.24/test/imm_arith.c000066400000000000000000000152071517770275000162760ustar00rootroot00000000000000#include "test.h" #include #define TESTOPT2(Ty,x,Op,imm) \ ASSERT(1,((Ty)(x)Op(Ty)(imm)) == ({Ty a=x; a Op (Ty)(imm);}));\ ASSERT(1,((Ty)(x)Op(Ty)(imm)) == ({Ty b=imm; (Ty)(x) Op b;})); #define TESTOPT(Ty,x,Op,imm) \ TESTOPT2(Ty,x,Op,imm) \ TESTOPT2(u##Ty,x,Op,imm) #define FILL32 0xF1234567 #define FILL64 0xABCDEF0123456789 #define FILL32i 0x789ABCDE #define FILL64i 0x789ABCDEF0123456 int main(void) { TESTOPT(int32_t, FILL32, +, 0); TESTOPT(int64_t, FILL64, +, 0); TESTOPT(int32_t, FILL32, +, 1); TESTOPT(int64_t, FILL64, +, 1); TESTOPT(int32_t, FILL32, +, -1); TESTOPT(int64_t, FILL64, +, -1); TESTOPT(int32_t, FILL32, -, 0); TESTOPT(int64_t, FILL64, -, 0); TESTOPT(int32_t, FILL32, -, 1); TESTOPT(int64_t, FILL64, -, 1); TESTOPT(int32_t, FILL32, -, -1); TESTOPT(int64_t, FILL64, -, -1); TESTOPT(int32_t, FILL32, &, 0); TESTOPT(int64_t, FILL64, &, 0); TESTOPT(int32_t, FILL32, &, -1); TESTOPT(int64_t, FILL64, &, -1); TESTOPT(int32_t, FILL32, |, 0); TESTOPT(int64_t, FILL64, |, 0); TESTOPT(int32_t, FILL32, |, -1); TESTOPT(int64_t, FILL64, |, -1); TESTOPT(int32_t, FILL32, ^, 0); TESTOPT(int64_t, FILL64, ^, 0); TESTOPT(int32_t, FILL32, ^, -1); TESTOPT(int64_t, FILL64, ^, -1); TESTOPT(int32_t, FILL32, *, 0); TESTOPT(int64_t, FILL64, *, 0); TESTOPT(int32_t, FILL32, *, 1); TESTOPT(int64_t, FILL64, *, 1); TESTOPT(int32_t, FILL32, *, -1); TESTOPT(int64_t, FILL64, *, -1); TESTOPT(int32_t, FILL32, /, 1); TESTOPT(int64_t, FILL64, /, 1); TESTOPT(int32_t, FILL32, /, -1); TESTOPT(int64_t, FILL64, /, -1); TESTOPT(int32_t, -1, /, -1); TESTOPT(int64_t, -1, /, -1); TESTOPT(int32_t, FILL32, %, 1); TESTOPT(int64_t, FILL64, %, 1); TESTOPT(int32_t, FILL32, %, -1); TESTOPT(int64_t, FILL64, %, -1); TESTOPT(int32_t, -1, %, -1); TESTOPT(int64_t, -1, %, -1); TESTOPT(int32_t, FILL32, *, 1024); TESTOPT(int64_t, FILL64, *, 1024); TESTOPT2(uint32_t, FILL32, /, 1 << 5); TESTOPT2(uint64_t, FILL64, /, 1LL << 35); TESTOPT2(uint32_t, FILL32, %, 1U << 1); TESTOPT2(uint32_t, FILL32, %, 1U << 2); TESTOPT2(uint32_t, FILL32, %, 1U << 3); TESTOPT2(uint32_t, FILL32, %, 1U << 29); TESTOPT2(uint32_t, FILL32, %, 1U << 30); TESTOPT2(uint32_t, FILL32, %, 1U << 31); TESTOPT2(int32_t, FILL32, %, 1U << 1); TESTOPT2(int32_t, FILL32, %, 1U << 2); TESTOPT2(int32_t, FILL32, %, 1U << 3); TESTOPT2(int32_t, FILL32, %, 1U << 29); TESTOPT2(int32_t, FILL32, %, 1U << 30); TESTOPT2(int32_t, FILL32, %, 1U << 31); TESTOPT2(int32_t, FILL32i, %, 1U << 1); TESTOPT2(int32_t, FILL32i, %, 1U << 2); TESTOPT2(int32_t, FILL32i, %, 1U << 3); TESTOPT2(int32_t, FILL32i, %, 1U << 29); TESTOPT2(int32_t, FILL32i, %, 1U << 30); TESTOPT2(int32_t, FILL32i, %, 1U << 31); TESTOPT2(uint32_t, FILL32, /, 1U << 1); TESTOPT2(uint32_t, FILL32, /, 1U << 2); TESTOPT2(uint32_t, FILL32, /, 1U << 3); TESTOPT2(uint32_t, FILL32, /, 1U << 29); TESTOPT2(uint32_t, FILL32, /, 1U << 30); TESTOPT2(uint32_t, FILL32, /, 1U << 31); TESTOPT2(int32_t, FILL32, /, 1U << 1); TESTOPT2(int32_t, FILL32, /, 1U << 2); TESTOPT2(int32_t, FILL32, /, 1U << 3); TESTOPT2(int32_t, FILL32, /, 1U << 29); TESTOPT2(int32_t, FILL32, /, 1U << 30); TESTOPT2(int32_t, FILL32, /, 1U << 31); TESTOPT2(int32_t, FILL32i, /, 1U << 1); TESTOPT2(int32_t, FILL32i, /, 1U << 2); TESTOPT2(int32_t, FILL32i, /, 1U << 3); TESTOPT2(int32_t, FILL32i, /, 1U << 29); TESTOPT2(int32_t, FILL32i, /, 1U << 30); TESTOPT2(int32_t, FILL32i, /, 1U << 31); TESTOPT2(uint64_t, FILL64, %, 1ULL << 1); TESTOPT2(uint64_t, FILL64, %, 1ULL << 2); TESTOPT2(uint64_t, FILL64, %, 1ULL << 3); TESTOPT2(uint64_t, FILL64, %, 1ULL << 29); TESTOPT2(uint64_t, FILL64, %, 1ULL << 30); TESTOPT2(uint64_t, FILL64, %, 1ULL << 31); TESTOPT2(uint64_t, FILL64, %, 1ULL << 32); TESTOPT2(uint64_t, FILL64, %, 1ULL << 33); TESTOPT2(uint64_t, FILL64, %, 1ULL << 34); TESTOPT2(uint64_t, FILL64, %, 1ULL << 61); TESTOPT2(uint64_t, FILL64, %, 1ULL << 62); TESTOPT2(uint64_t, FILL64, %, 1ULL << 63); TESTOPT2(int64_t, FILL64, %, 1ULL << 1); TESTOPT2(int64_t, FILL64, %, 1ULL << 2); TESTOPT2(int64_t, FILL64, %, 1ULL << 3); TESTOPT2(int64_t, FILL64, %, 1ULL << 29); TESTOPT2(int64_t, FILL64, %, 1ULL << 30); TESTOPT2(int64_t, FILL64, %, 1ULL << 31); TESTOPT2(int64_t, FILL64, %, 1ULL << 32); TESTOPT2(int64_t, FILL64, %, 1ULL << 33); TESTOPT2(int64_t, FILL64, %, 1ULL << 34); TESTOPT2(int64_t, FILL64, %, 1ULL << 61); TESTOPT2(int64_t, FILL64, %, 1ULL << 62); TESTOPT2(int64_t, FILL64, %, 1ULL << 63); TESTOPT2(int64_t, FILL64i, %, 1ULL << 1); TESTOPT2(int64_t, FILL64i, %, 1ULL << 2); TESTOPT2(int64_t, FILL64i, %, 1ULL << 3); TESTOPT2(int64_t, FILL64i, %, 1ULL << 29); TESTOPT2(int64_t, FILL64i, %, 1ULL << 30); TESTOPT2(int64_t, FILL64i, %, 1ULL << 31); TESTOPT2(int64_t, FILL64i, %, 1ULL << 32); TESTOPT2(int64_t, FILL64i, %, 1ULL << 33); TESTOPT2(int64_t, FILL64i, %, 1ULL << 34); TESTOPT2(int64_t, FILL64i, %, 1ULL << 61); TESTOPT2(int64_t, FILL64i, %, 1ULL << 62); TESTOPT2(int64_t, FILL64i, %, 1ULL << 63); TESTOPT2(uint64_t, FILL64, /, 1ULL << 1); TESTOPT2(uint64_t, FILL64, /, 1ULL << 2); TESTOPT2(uint64_t, FILL64, /, 1ULL << 3); TESTOPT2(uint64_t, FILL64, /, 1ULL << 29); TESTOPT2(uint64_t, FILL64, /, 1ULL << 30); TESTOPT2(uint64_t, FILL64, /, 1ULL << 31); TESTOPT2(uint64_t, FILL64, /, 1ULL << 32); TESTOPT2(uint64_t, FILL64, /, 1ULL << 33); TESTOPT2(uint64_t, FILL64, /, 1ULL << 34); TESTOPT2(uint64_t, FILL64, /, 1ULL << 61); TESTOPT2(uint64_t, FILL64, /, 1ULL << 62); TESTOPT2(uint64_t, FILL64, /, 1ULL << 63); TESTOPT2(int64_t, FILL64, /, 1ULL << 1); TESTOPT2(int64_t, FILL64, /, 1ULL << 2); TESTOPT2(int64_t, FILL64, /, 1ULL << 3); TESTOPT2(int64_t, FILL64, /, 1ULL << 29); TESTOPT2(int64_t, FILL64, /, 1ULL << 30); TESTOPT2(int64_t, FILL64, /, 1ULL << 31); TESTOPT2(int64_t, FILL64, /, 1ULL << 32); TESTOPT2(int64_t, FILL64, /, 1ULL << 33); TESTOPT2(int64_t, FILL64, /, 1ULL << 34); TESTOPT2(int64_t, FILL64, /, 1ULL << 61); TESTOPT2(int64_t, FILL64, /, 1ULL << 62); TESTOPT2(int64_t, FILL64, /, 1ULL << 63); TESTOPT2(int64_t, FILL64i, /, 1ULL << 1); TESTOPT2(int64_t, FILL64i, /, 1ULL << 2); TESTOPT2(int64_t, FILL64i, /, 1ULL << 3); TESTOPT2(int64_t, FILL64i, /, 1ULL << 29); TESTOPT2(int64_t, FILL64i, /, 1ULL << 30); TESTOPT2(int64_t, FILL64i, /, 1ULL << 31); TESTOPT2(int64_t, FILL64i, /, 1ULL << 32); TESTOPT2(int64_t, FILL64i, /, 1ULL << 33); TESTOPT2(int64_t, FILL64i, /, 1ULL << 34); TESTOPT2(int64_t, FILL64i, /, 1ULL << 61); TESTOPT2(int64_t, FILL64i, /, 1ULL << 62); TESTOPT2(int64_t, FILL64i, /, 1ULL << 63); printf("OK\n"); return 0; } chibicc-1.0.24/test/implicit.c000066400000000000000000000003171517770275000161330ustar00rootroot00000000000000#include #include #include int execl(const char *path, ...); //#include int main() { execl("/bin/sh", "sh", "-c", "echo hello", NULL); return 0; }chibicc-1.0.24/test/implicit2.c000066400000000000000000000001451517770275000162140ustar00rootroot00000000000000#include int main() { printf("Hello world\n"); fflush(stdout); return 0; }chibicc-1.0.24/test/inb.c000066400000000000000000000007241517770275000150730ustar00rootroot00000000000000#include "test.h" #include #include #include #include int main() { if (geteuid() != 0) { printf("Must be run as root.\n"); return 0; } // Request access to port 0x60 (keyboard controller) if (ioperm(0x60, 1, 1)) { printf("ioperm failed\n"); return 0; } unsigned char val = inb(0x60); printf("Read value: 0x%02x from port 0x60\n", val); // Revoke access ioperm(0x60, 1, 0); return 0; }chibicc-1.0.24/test/include1.h000077500000000000000000000001541517770275000160340ustar00rootroot00000000000000#include "include2.h" char *include1_filename = __FILE__; int include1_line = __LINE__; int include1 = 5; chibicc-1.0.24/test/include2.h000077500000000000000000000000221517770275000160270ustar00rootroot00000000000000int include2 = 7; chibicc-1.0.24/test/include3.h000077500000000000000000000000161517770275000160330ustar00rootroot00000000000000#define foo 3 chibicc-1.0.24/test/include4.h000077500000000000000000000000161517770275000160340ustar00rootroot00000000000000#define foo 4 chibicc-1.0.24/test/initializer.c000077500000000000000000000223771517770275000166610ustar00rootroot00000000000000#include "test.h" char g3 = 3; short g4 = 4; int g5 = 5; long g6 = 6; int g9[3] = {0, 1, 2}; struct {char a; int b;} g11[2] = {{1, 2}, {3, 4}}; struct {int a[2];} g12[2] = {{{1, 2}}}; union { int a; char b[8]; } g13[2] = {0x01020304, 0x05060708}; char g17[] = "foobar"; char g18[10] = "foobar"; char g19[3] = "foobar"; char *g20 = g17+0; char *g21 = g17+3; char (*g22)[7] = &g17-3; char *g23[] = {g17+0, g17+3, g17-3}; int g24=3; int *g25=&g24; int g26[3] = {1, 2, 3}; int *g27 = g26 + 1; int *g28 = &g11[1].a; long g29 = (long)(long)g26; struct { struct { int a[3]; } a; } g30 = {{{1,2,3}}}; int *g31=g30.a.a; struct {int a[2];} g40[2] = {{1, 2}, 3, 4}; struct {int a[2];} g41[2] = {1, 2, 3, 4}; char g43[][4] = {'f', 'o', 'o', 0, 'b', 'a', 'r', 0}; char *g44 = {"foo"}; union { int a; char b[4]; } g50 = {.b[2]=0x12}; union { int a; } g51[2] = {}; typedef char T60[]; T60 g60 = {1, 2, 3}; T60 g61 = {1, 2, 3, 4, 5, 6}; typedef struct { char a, b[]; } T65; T65 g65 = {'f','o','o',0}; T65 g66 = {'f','o','o','b','a','r',0}; int main() { ASSERT(1, ({ int x[3]={1,2,3}; x[0]; })); ASSERT(2, ({ int x[3]={1,2,3}; x[1]; })); ASSERT(3, ({ int x[3]={1,2,3}; x[2]; })); ASSERT(3, ({ int x[3]={1,2,3}; x[2]; })); ASSERT(2, ({ int x[2][3]={{1,2,3},{4,5,6}}; x[0][1]; })); ASSERT(4, ({ int x[2][3]={{1,2,3},{4,5,6}}; x[1][0]; })); ASSERT(6, ({ int x[2][3]={{1,2,3},{4,5,6}}; x[1][2]; })); ASSERT(0, ({ int x[3]={}; x[0]; })); ASSERT(0, ({ int x[3]={}; x[1]; })); ASSERT(0, ({ int x[3]={}; x[2]; })); ASSERT(2, ({ int x[2][3]={{1,2}}; x[0][1]; })); ASSERT(0, ({ int x[2][3]={{1,2}}; x[1][0]; })); ASSERT(0, ({ int x[2][3]={{1,2}}; x[1][2]; })); ASSERT('a', ({ char x[4]="abc"; x[0]; })); ASSERT('c', ({ char x[4]="abc"; x[2]; })); ASSERT(0, ({ char x[4]="abc"; x[3]; })); ASSERT('a', ({ char x[2][4]={"abc","def"}; x[0][0]; })); ASSERT(0, ({ char x[2][4]={"abc","def"}; x[0][3]; })); ASSERT('d', ({ char x[2][4]={"abc","def"}; x[1][0]; })); ASSERT('f', ({ char x[2][4]={"abc","def"}; x[1][2]; })); ASSERT(4, ({ int x[]={1,2,3,4}; x[3]; })); ASSERT(16, ({ int x[]={1,2,3,4}; sizeof(x); })); ASSERT(4, ({ char x[]="foo"; sizeof(x); })); ASSERT(4, ({ typedef char T[]; T x="foo"; T y="x"; sizeof(x); })); ASSERT(2, ({ typedef char T[]; T x="foo"; T y="x"; sizeof(y); })); ASSERT(2, ({ typedef char T[]; T x="x"; T y="foo"; sizeof(x); })); ASSERT(4, ({ typedef char T[]; T x="x"; T y="foo"; sizeof(y); })); ASSERT(1, ({ struct {int a; int b; int c;} x={1,2,3}; x.a; })); ASSERT(2, ({ struct {int a; int b; int c;} x={1,2,3}; x.b; })); ASSERT(3, ({ struct {int a; int b; int c;} x={1,2,3}; x.c; })); ASSERT(1, ({ struct {int a; int b; int c;} x={1}; x.a; })); ASSERT(0, ({ struct {int a; int b; int c;} x={1}; x.b; })); ASSERT(0, ({ struct {int a; int b; int c;} x={1}; x.c; })); ASSERT(1, ({ struct {int a; int b;} x[2]={{1,2},{3,4}}; x[0].a; })); ASSERT(2, ({ struct {int a; int b;} x[2]={{1,2},{3,4}}; x[0].b; })); ASSERT(3, ({ struct {int a; int b;} x[2]={{1,2},{3,4}}; x[1].a; })); ASSERT(4, ({ struct {int a; int b;} x[2]={{1,2},{3,4}}; x[1].b; })); ASSERT(0, ({ struct {int a; int b;} x[2]={{1,2}}; x[1].b; })); ASSERT(0, ({ struct {int a; int b;} x={}; x.a; })); ASSERT(0, ({ struct {int a; int b;} x={}; x.b; })); ASSERT(5, ({ typedef struct {int a,b,c,d,e,f;} T; T x={1,2,3,4,5,6}; T y; y=x; y.e; })); ASSERT(2, ({ typedef struct {int a,b;} T; T x={1,2}; T y, z; z=y=x; z.b; })); ASSERT(1, ({ typedef struct {int a,b;} T; T x={1,2}; T y=x; y.a; })); ASSERT(4, ({ union { int a; char b[4]; } x={0x01020304}; x.b[0]; })); ASSERT(3, ({ union { int a; char b[4]; } x={0x01020304}; x.b[1]; })); ASSERT(0x01020304, ({ union { struct { char a,b,c,d; } e; int f; } x={{4,3,2,1}}; x.f; })); ASSERT(3, g3); ASSERT(4, g4); ASSERT(5, g5); ASSERT(6, g6); ASSERT(0, g9[0]); ASSERT(1, g9[1]); ASSERT(2, g9[2]); ASSERT(1, g11[0].a); ASSERT(2, g11[0].b); ASSERT(3, g11[1].a); ASSERT(4, g11[1].b); ASSERT(1, g12[0].a[0]); ASSERT(2, g12[0].a[1]); ASSERT(0, g12[1].a[0]); ASSERT(0, g12[1].a[1]); ASSERT(4, g13[0].b[0]); ASSERT(3, g13[0].b[1]); ASSERT(8, g13[1].b[0]); ASSERT(7, g13[1].b[1]); ASSERT(7, sizeof(g17)); ASSERT(10, sizeof(g18)); ASSERT(3, sizeof(g19)); ASSERT(0, memcmp(g17, "foobar", 7)); ASSERT(0, memcmp(g18, "foobar\0\0\0", 10)); ASSERT(0, memcmp(g19, "foo", 3)); ASSERT(0, strcmp(g20, "foobar")); ASSERT(0, strcmp(g21, "bar")); ASSERT(0, strcmp(*(g22+3), "foobar")); ASSERT(0, strcmp(g23[0], "foobar")); ASSERT(0, strcmp(g23[1], "bar")); ASSERT(0, strcmp(g23[2]+3, "foobar")); ASSERT(3, g24); ASSERT(3, *g25); ASSERT(2, *g27); ASSERT(3, *g28); ASSERT(1, *(int *)g29); ASSERT(1, g31[0]); ASSERT(2, g31[1]); ASSERT(3, g31[2]); ASSERT(1, g40[0].a[0]); ASSERT(2, g40[0].a[1]); ASSERT(3, g40[1].a[0]); ASSERT(4, g40[1].a[1]); ASSERT(1, g41[0].a[0]); ASSERT(2, g41[0].a[1]); ASSERT(3, g41[1].a[0]); ASSERT(4, g41[1].a[1]); ASSERT(0, ({ int x[2][3]={0,1,2,3,4,5}; x[0][0]; })); ASSERT(3, ({ int x[2][3]={0,1,2,3,4,5}; x[1][0]; })); ASSERT(0, ({ struct {int a; int b;} x[2]={0,1,2,3}; x[0].a; })); ASSERT(2, ({ struct {int a; int b;} x[2]={0,1,2,3}; x[1].a; })); ASSERT(0, strcmp(g43[0], "foo")); ASSERT(0, strcmp(g43[1], "bar")); ASSERT(0, strcmp(g44, "foo")); ASSERT(3, ({ int a[]={1,2,3,}; a[2]; })); ASSERT(1, ({ struct {int a,b,c;} x={1,2,3,}; x.a; })); ASSERT(1, ({ union {int a; char b;} x={1,}; x.a; })); ASSERT(2, ({ enum {x,y,z,}; z; })); ASSERT(3, sizeof(g60)); ASSERT(6, sizeof(g61)); ASSERT(1, sizeof(g65)); ASSERT(1, sizeof(g66)); ASSERT(0, strcmp(g65.b, "oo")); ASSERT(0, strcmp(g66.b, "oobar")); ASSERT(4, ({ int x[3]={1, 2, 3, [0]=4, 5}; x[0]; })); ASSERT(5, ({ int x[3]={1, 2, 3, [0]=4, 5}; x[1]; })); ASSERT(3, ({ int x[3]={1, 2, 3, [0]=4, 5}; x[2]; })); ASSERT(10, ({ int x[2][3]={1,2,3,4,5,6,[0][1]=7,8,[0]=9,[0]=10,11,[1][0]=12}; x[0][0]; })); ASSERT(11, ({ int x[2][3]={1,2,3,4,5,6,[0][1]=7,8,[0]=9,[0]=10,11,[1][0]=12}; x[0][1]; })); ASSERT(8, ({ int x[2][3]={1,2,3,4,5,6,[0][1]=7,8,[0]=9,[0]=10,11,[1][0]=12}; x[0][2]; })); ASSERT(12, ({ int x[2][3]={1,2,3,4,5,6,[0][1]=7,8,[0]=9,[0]=10,11,[1][0]=12}; x[1][0]; })); ASSERT(5, ({ int x[2][3]={1,2,3,4,5,6,[0][1]=7,8,[0]=9,[0]=10,11,[1][0]=12}; x[1][1]; })); ASSERT(6, ({ int x[2][3]={1,2,3,4,5,6,[0][1]=7,8,[0]=9,[0]=10,11,[1][0]=12}; x[1][2]; })); ASSERT(7, ({ int x[2][3]={1,2,3,4,5,6,[0]={7,8},9,10}; x[0][0]; })); ASSERT(8, ({ int x[2][3]={1,2,3,4,5,6,[0]={7,8},9,10}; x[0][1]; })); ASSERT(3, ({ int x[2][3]={1,2,3,4,5,6,[0]={7,8},9,10}; x[0][2]; })); ASSERT(9, ({ int x[2][3]={1,2,3,4,5,6,[0]={7,8},9,10}; x[1][0]; })); ASSERT(10, ({ int x[2][3]={1,2,3,4,5,6,[0]={7,8},9,10}; x[1][1]; })); ASSERT(6, ({ int x[2][3]={1,2,3,4,5,6,[0]={7,8},9,10}; x[1][2]; })); ASSERT(7, ((int[10]){ [3]=7 })[3]); ASSERT(0, ((int[10]){ [3]=7 })[4]); ASSERT(10, ({ char x[]={[10-3]=1,2,3}; sizeof(x); })); ASSERT(20, ({ char x[][2]={[8][1]=1,2}; sizeof(x); })); ASSERT(4, ({ struct { int a,b; } x={1,2,.b=3,.a=4}; x.a; })); ASSERT(3, ({ struct { int a,b; } x={1,2,.b=3,.a=4}; x.b; })); ASSERT(1, ({ struct { struct { int a,b; } c; } x={.c=1,2}; x.c.a; })); ASSERT(2, ({ struct { struct { int a,b; } c; } x={.c=1,2}; x.c.b; })); ASSERT(0, ({ struct { struct { int a,b; } c; } x={.c.b=1}; x.c.a; })); ASSERT(1, ({ struct { struct { int a,b; } c; } x={.c.b=1}; x.c.b; })); ASSERT(1, ({ struct { int a[2]; } x={.a=1,2}; x.a[0]; })); ASSERT(2, ({ struct { int a[2]; } x={.a=1,2}; x.a[1]; })); ASSERT(0, ({ struct { int a[2]; } x={.a[1]=1}; x.a[0]; })); ASSERT(1, ({ struct { int a[2]; } x={.a[1]=1}; x.a[1]; })); ASSERT(3, ({ struct { int a,b; } x[]={[1].b=1,2,[0]=3,4,}; x[0].a; })); ASSERT(4, ({ struct { int a,b; } x[]={[1].b=1,2,[0]=3,4,}; x[0].b; })); ASSERT(0, ({ struct { int a,b; } x[]={[1].b=1,2,[0]=3,4,}; x[1].a; })); ASSERT(1, ({ struct { int a,b; } x[]={[1].b=1,2,[0]=3,4,}; x[1].b; })); ASSERT(2, ({ struct { int a,b; } x[]={[1].b=1,2,[0]=3,4,}; x[2].a; })); ASSERT(0, ({ struct { int a,b; } x[]={[1].b=1,2,[0]=3,4,}; x[2].b; })); ASSERT(1, ({ typedef struct { int a,b; } T; T x={1,2}; T y[]={x}; y[0].a; })); ASSERT(2, ({ typedef struct { int a,b; } T; T x={1,2}; T y[]={x}; y[0].b; })); ASSERT(0, ({ typedef struct { int a,b; } T; T x={1,2}; T y[]={x, [0].b=3}; y[0].a; })); ASSERT(3, ({ typedef struct { int a,b; } T; T x={1,2}; T y[]={x, [0].b=3}; y[0].b; })); ASSERT(5, ((struct { int a,b,c; }){ .c=5 }).c); ASSERT(0, ((struct { int a,b,c; }){ .c=5 }).a); ASSERT(0x00ff, ({ union { unsigned short a; char b[2]; } x={.b[0]=0xff}; x.a; })); ASSERT(0xff00, ({ union { unsigned short a; char b[2]; } x={.b[1]=0xff}; x.a; })); ASSERT(0x00120000, g50.a); ASSERT(0, g51[0].a); ASSERT(0, g51[1].a); ASSERT(1, ({ struct { struct { int a; struct { int b; }; }; int c; } x={1,2,3,.b=4,5}; x.a; })); ASSERT(4, ({ struct { struct { int a; struct { int b; }; }; int c; } x={1,2,3,.b=4,5}; x.b; })); ASSERT(5, ({ struct { struct { int a; struct { int b; }; }; int c; } x={1,2,3,.b=4,5}; x.c; })); ASSERT(16, ({ char x[]={[2 ... 10]='a', [7]='b', [15 ... 15]='c', [3 ... 5]='d'}; sizeof(x); })); ASSERT(0, ({ char x[]={[2 ... 10]='a', [7]='b', [15 ... 15]='c', [3 ... 5]='d'}; memcmp(x, "\0\0adddabaaa\0\0\0\0c", 16); })); printf("OK\n"); return 0; }chibicc-1.0.24/test/initializer2.c000066400000000000000000000025731517770275000167340ustar00rootroot00000000000000#include "test.h" long double ld = 0.0L; const int arr[2][2] = {{1,2},{3,4}}; int *const p1 = arr[1]; int g1 = ((int){77}); int g2 = arr[1][1]; const struct { int *a, *b, *c; } relo = {.a = &g1, .c = &g2}; int *p2 = relo.c; int *p1p = p1; struct S { int i, j, k; }; struct S const s1 = {99, 88, 77}; struct S s2 = (struct S){33,44,55}; struct S s3 = s1; #ifdef NOTGCC int g3 = (struct S){55,66,77}.j; int g4 = (const int[]){11,22,33,44}[2]; #endif static long long obar = 2 + (long long)"foobar"; _Bool b = 2; _Bool ba[] = {3,3,3}; struct { _Bool b; } bs = {4}; int main(void) { ASSERT(3, *p1); ASSERT(77, g1); ASSERT(4, g2); ASSERT(1, p2 == &g2); ASSERT(1, p1p == p1); ASSERT(33, s2.i); ASSERT(44, s2.j); ASSERT(55, s2.k); ASSERT(99, s3.i); ASSERT(88, s3.j); ASSERT(77, s3.k); #ifdef NOTGCC ASSERT(66, g3); ASSERT(33, g4); #endif ASSERT(1, b); ASSERT(1, ba[2]); ASSERT(1, bs.b); ASSERT(0, strcmp("obar", (char *)obar)); { int i[2][4] = {[0][0 ... 1] = 4, 2, 3, 7, [1][1 ... 2] = 1, 9}; int ans[] = {4,4,2,3,7,1,1,9}; ASSERT(0, memcmp(&i, &ans, sizeof(ans))); } { struct Sub { int i; }; struct S { struct Sub b; int j; }; struct Sub b = {3}; struct S s[] = {b, 6, 7}; ASSERT(3, s[0].b.i); ASSERT(6, s[0].j); ASSERT(7, s[1].b.i); ASSERT(0, s[1].j); } printf("OK\n"); }chibicc-1.0.24/test/initializer_list.c000066400000000000000000000013351517770275000177000ustar00rootroot00000000000000 #include "test.h" struct __pthread_rwlock_arch_t { unsigned int __readers; unsigned int __writers; unsigned int __wrphase_futex; unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; int __cur_writer; int __shared; signed char __rwelision; unsigned char __pad1[7]; unsigned long int __pad2; unsigned int __flags; }; typedef union { struct __pthread_rwlock_arch_t __data; char __size[56]; long int __align; } pthread_rwlock_t; typedef union { char __size[8]; long int __align; } pthread_rwlockattr_t; int main() { pthread_rwlock_t lock = {0, }; lock.__align = 8; printf("%ld\n", lock.__align); ASSERT(8, lock.__align); printf("%ld\n", sizeof(lock)); ASSERT(56, sizeof(lock)); return 0; }chibicc-1.0.24/test/int128.c000066400000000000000000006615461517770275000153670ustar00rootroot00000000000000/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ │ vi: set et ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi │ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright 2020 Justine Alexandra Roberts Tunney │ │ │ │ Permission to use, copy, modify, and/or distribute this software for │ │ any purpose with or without fee is hereby granted, provided that the │ │ above copyright notice and this permission notice appear in all copies. │ │ │ │ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ │ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ │ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ │ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ │ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ │ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "test.h" #include #define BANE 0x8000000000000000 #define BANE1 0x8000000000000001 #define BANE2 0x8000000000000002 #define IMAX 0x7fffffffffffffff #define IMAX2 0xfffffffffffffffd #define I128(HI, LO) ((LO) | (unsigned __int128)(HI) << 64) __int128 add128(__int128 x, __int128 y) { return x + y; } __int128 sub128x5(__int128 a, __int128 b, __int128 c, __int128 d, __int128 e) { return a - b - c - d - e; } __int128 sub128x6(int f, __int128 a, __int128 b, __int128 c, __int128 d, __int128 e) { return f - a - b - c - d - e; } void lotsOfArgs(const char *file, int line, const char *func, __int128 beg, __int128 end, __int128 got, const char *gotcode, bool isfatal) { } void testLang128(void) { lotsOfArgs(__FILE__, __LINE__, __FUNCTION__, 0, 0, 0, "", false); ASSERT(16, sizeof(__int128)); ASSERT(16, sizeof(unsigned __int128)); ASSERT(16, _Alignof(__int128)); ASSERT(16, ({ struct T { __int128 x; }; _Alignof(struct T); })); ASSERT(16, ({ struct __attribute__((__aligned__(16))) T { __int128 x; }; _Alignof(struct T); })); ASSERT128(7, ({ __int128 i = 2; i += 5; i; })); ASSERT128(I128(0xffffffffffffffff, 0xffffffffffffffff), ({ __int128 i = 0; add128(i, -1); })); ASSERT128(I128(0x3a8eaaa2e9af03f5, 0xd7ed730a55920176), sub128x5(I128(0x0db9cd085ab6ba38, 0xdaf9c05f15896b5f), I128(0xb6429ba7b5b38454, 0x4061839d268a0a78), I128(0x19a0da005190a5ac, 0x755fa06484419e38), I128(0xafc6e44400b9eadd, 0x05e5afdb2e66cdb8), I128(0x5380c8796909a165, 0x47657977e6c4f381))); ASSERT128(I128(0x1f1b109234418f84, 0x21f9f24c8535e4f0), sub128x6(0x5ab6ba38, I128(0x0db9cd085ab6ba38, 0xdaf9c05f15896b5f), I128(0xb6429ba7b5b38454, 0x4061839d268a0a78), I128(0x19a0da005190a5ac, 0x755fa06484419e38), I128(0xafc6e44400b9eadd, 0x05e5afdb2e66cdb8), I128(0x5380c8796909a165, 0x47657977e6c4f381))); } void testCompare128(void) { __int128 x = 1, y = 2; ASSERT(0, x == y); ASSERT(1, x != y); ASSERT(1, x < y); ASSERT(1, x <= y); ASSERT(0, x > y); ASSERT(0, x >= y); ASSERT(1, x >= x); x = I128(-1ul, 2); y = I128(0xfffffffffffffff0, 2); ASSERT(0, x == y); } void testCastDblInt128(void) { int k; double f; __int128 i, w; k = 110; i = 1; i <<= k; f = i; f /= 2; i = f; w = 1; w <<= k - 1; ASSERT128(w, i); } void testCastDblUint128(void) { double f; unsigned __int128 i; i = 0x0000ffffffffffff; ++i; f = i; --f; i = f; --i; ASSERT128(0x0000fffffffffffe, i); } void testCastLdblInt128(void) { int k; __int128 i, w; long double f; k = 110; i = 1; i <<= k; f = i; f /= 2; i = f; w = 1; w <<= k - 1; ASSERT128(w, i); } void testCastLdblUint128(void) { long double f; unsigned __int128 i; i = 0xffffffffffffffff; ++i; f = i; --f; i = f; --i; ASSERT128(0xfffffffffffffffe, i); } void testAdd128(void) { __int128 x, y; x = I128(0, 0); y = I128(0, 0); ASSERT128(I128(0, 0), x + y); x = I128(0, 0); y = I128(0, 2); ASSERT128(I128(0, 2), x + y); x = I128(0, 0); y = I128(0, BANE); ASSERT128(I128(0, BANE), x + y); x = I128(0, 0); y = I128(0, -1ul); ASSERT128(I128(0, -1ul), x + y); x = I128(0, 0); y = I128(2, 0); ASSERT128(I128(2, 0), x + y); x = I128(0, 0); y = I128(2, 2); ASSERT128(I128(2, 2), x + y); x = I128(0, 0); y = I128(2, BANE); ASSERT128(I128(2, BANE), x + y); x = I128(0, 0); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x + y); x = I128(0, 0); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x + y); x = I128(0, 0); y = I128(BANE, 2); ASSERT128(I128(BANE, 2), x + y); x = I128(0, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE), x + y); x = I128(0, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x + y); x = I128(0, 0); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0), x + y); x = I128(0, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x + y); x = I128(0, 0); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x + y); x = I128(0, 0); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x + y); x = I128(0, 2); y = I128(0, 0); ASSERT128(I128(0, 2), x + y); x = I128(0, 2); y = I128(0, 2); ASSERT128(I128(0, 4), x + y); x = I128(0, 2); y = I128(0, BANE); ASSERT128(I128(0, BANE2), x + y); x = I128(0, 2); y = I128(0, -1ul); ASSERT128(I128(1, 1), x + y); x = I128(0, 2); y = I128(2, 0); ASSERT128(I128(2, 2), x + y); x = I128(0, 2); y = I128(2, 2); ASSERT128(I128(2, 4), x + y); x = I128(0, 2); y = I128(2, BANE); ASSERT128(I128(2, BANE2), x + y); x = I128(0, 2); y = I128(2, -1ul); ASSERT128(I128(3, 1), x + y); x = I128(0, 2); y = I128(BANE, 0); ASSERT128(I128(BANE, 2), x + y); x = I128(0, 2); y = I128(BANE, 2); ASSERT128(I128(BANE, 4), x + y); x = I128(0, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE2), x + y); x = I128(0, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE1, 1), x + y); x = I128(0, 2); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 2), x + y); x = I128(0, 2); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 4), x + y); x = I128(0, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE2), x + y); x = I128(0, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 1), x + y); x = I128(0, BANE); y = I128(0, 0); ASSERT128(I128(0, BANE), x + y); x = I128(0, BANE); y = I128(0, 2); ASSERT128(I128(0, BANE2), x + y); x = I128(0, BANE); y = I128(0, BANE); ASSERT128(I128(1, 0), x + y); x = I128(0, BANE); y = I128(0, -1ul); ASSERT128(I128(1, IMAX), x + y); x = I128(0, BANE); y = I128(2, 0); ASSERT128(I128(2, BANE), x + y); x = I128(0, BANE); y = I128(2, 2); ASSERT128(I128(2, BANE2), x + y); x = I128(0, BANE); y = I128(2, BANE); ASSERT128(I128(3, 0), x + y); x = I128(0, BANE); y = I128(2, -1ul); ASSERT128(I128(3, IMAX), x + y); x = I128(0, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE, BANE), x + y); x = I128(0, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE, BANE2), x + y); x = I128(0, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE1, 0), x + y); x = I128(0, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE1, IMAX), x + y); x = I128(0, BANE); y = I128(-1ul, 0); ASSERT128(I128(-1ul, BANE), x + y); x = I128(0, BANE); y = I128(-1ul, 2); ASSERT128(I128(-1ul, BANE2), x + y); x = I128(0, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x + y); x = I128(0, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, IMAX), x + y); x = I128(0, -1ul); y = I128(0, 0); ASSERT128(I128(0, -1ul), x + y); x = I128(0, -1ul); y = I128(0, 2); ASSERT128(I128(1, 1), x + y); x = I128(0, -1ul); y = I128(0, BANE); ASSERT128(I128(1, IMAX), x + y); x = I128(0, -1ul); y = I128(0, -1ul); ASSERT128(I128(1, 0xfffffffffffffffe), x + y); x = I128(0, -1ul); y = I128(2, 0); ASSERT128(I128(2, -1ul), x + y); x = I128(0, -1ul); y = I128(2, 2); ASSERT128(I128(3, 1), x + y); x = I128(0, -1ul); y = I128(2, BANE); ASSERT128(I128(3, IMAX), x + y); x = I128(0, -1ul); y = I128(2, -1ul); ASSERT128(I128(3, 0xfffffffffffffffe), x + y); x = I128(0, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, -1ul), x + y); x = I128(0, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE1, 1), x + y); x = I128(0, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE1, IMAX), x + y); x = I128(0, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE1, 0xfffffffffffffffe), x + y); x = I128(0, -1ul); y = I128(-1ul, 0); ASSERT128(I128(-1ul, -1ul), x + y); x = I128(0, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, 1), x + y); x = I128(0, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, IMAX), x + y); x = I128(0, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0xfffffffffffffffe), x + y); x = I128(2, 0); y = I128(0, 0); ASSERT128(I128(2, 0), x + y); x = I128(2, 0); y = I128(0, 2); ASSERT128(I128(2, 2), x + y); x = I128(2, 0); y = I128(0, BANE); ASSERT128(I128(2, BANE), x + y); x = I128(2, 0); y = I128(0, -1ul); ASSERT128(I128(2, -1ul), x + y); x = I128(2, 0); y = I128(2, 0); ASSERT128(I128(4, 0), x + y); x = I128(2, 0); y = I128(2, 2); ASSERT128(I128(4, 2), x + y); x = I128(2, 0); y = I128(2, BANE); ASSERT128(I128(4, BANE), x + y); x = I128(2, 0); y = I128(2, -1ul); ASSERT128(I128(4, -1ul), x + y); x = I128(2, 0); y = I128(BANE, 0); ASSERT128(I128(BANE2, 0), x + y); x = I128(2, 0); y = I128(BANE, 2); ASSERT128(I128(BANE2, 2), x + y); x = I128(2, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE2, BANE), x + y); x = I128(2, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE2, -1ul), x + y); x = I128(2, 0); y = I128(-1ul, 0); ASSERT128(I128(1, 0), x + y); x = I128(2, 0); y = I128(-1ul, 2); ASSERT128(I128(1, 2), x + y); x = I128(2, 0); y = I128(-1ul, BANE); ASSERT128(I128(1, BANE), x + y); x = I128(2, 0); y = I128(-1ul, -1ul); ASSERT128(I128(1, -1ul), x + y); x = I128(2, 2); y = I128(0, 0); ASSERT128(I128(2, 2), x + y); x = I128(2, 2); y = I128(0, 2); ASSERT128(I128(2, 4), x + y); x = I128(2, 2); y = I128(0, BANE); ASSERT128(I128(2, BANE2), x + y); x = I128(2, 2); y = I128(0, -1ul); ASSERT128(I128(3, 1), x + y); x = I128(2, 2); y = I128(2, 0); ASSERT128(I128(4, 2), x + y); x = I128(2, 2); y = I128(2, 2); ASSERT128(I128(4, 4), x + y); x = I128(2, 2); y = I128(2, BANE); ASSERT128(I128(4, BANE2), x + y); x = I128(2, 2); y = I128(2, -1ul); ASSERT128(I128(5, 1), x + y); x = I128(2, 2); y = I128(BANE, 0); ASSERT128(I128(BANE2, 2), x + y); x = I128(2, 2); y = I128(BANE, 2); ASSERT128(I128(BANE2, 4), x + y); x = I128(2, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE2, BANE2), x + y); x = I128(2, 2); y = I128(BANE, -1ul); ASSERT128(I128(0x8000000000000003, 1), x + y); x = I128(2, 2); y = I128(-1ul, 0); ASSERT128(I128(1, 2), x + y); x = I128(2, 2); y = I128(-1ul, 2); ASSERT128(I128(1, 4), x + y); x = I128(2, 2); y = I128(-1ul, BANE); ASSERT128(I128(1, BANE2), x + y); x = I128(2, 2); y = I128(-1ul, -1ul); ASSERT128(I128(2, 1), x + y); x = I128(2, BANE); y = I128(0, 0); ASSERT128(I128(2, BANE), x + y); x = I128(2, BANE); y = I128(0, 2); ASSERT128(I128(2, BANE2), x + y); x = I128(2, BANE); y = I128(0, BANE); ASSERT128(I128(3, 0), x + y); x = I128(2, BANE); y = I128(0, -1ul); ASSERT128(I128(3, IMAX), x + y); x = I128(2, BANE); y = I128(2, 0); ASSERT128(I128(4, BANE), x + y); x = I128(2, BANE); y = I128(2, 2); ASSERT128(I128(4, BANE2), x + y); x = I128(2, BANE); y = I128(2, BANE); ASSERT128(I128(5, 0), x + y); x = I128(2, BANE); y = I128(2, -1ul); ASSERT128(I128(5, IMAX), x + y); x = I128(2, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE2, BANE), x + y); x = I128(2, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE2, BANE2), x + y); x = I128(2, BANE); y = I128(BANE, BANE); ASSERT128(I128(0x8000000000000003, 0), x + y); x = I128(2, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0x8000000000000003, IMAX), x + y); x = I128(2, BANE); y = I128(-1ul, 0); ASSERT128(I128(1, BANE), x + y); x = I128(2, BANE); y = I128(-1ul, 2); ASSERT128(I128(1, BANE2), x + y); x = I128(2, BANE); y = I128(-1ul, BANE); ASSERT128(I128(2, 0), x + y); x = I128(2, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(2, IMAX), x + y); x = I128(2, -1ul); y = I128(0, 0); ASSERT128(I128(2, -1ul), x + y); x = I128(2, -1ul); y = I128(0, 2); ASSERT128(I128(3, 1), x + y); x = I128(2, -1ul); y = I128(0, BANE); ASSERT128(I128(3, IMAX), x + y); x = I128(2, -1ul); y = I128(0, -1ul); ASSERT128(I128(3, 0xfffffffffffffffe), x + y); x = I128(2, -1ul); y = I128(2, 0); ASSERT128(I128(4, -1ul), x + y); x = I128(2, -1ul); y = I128(2, 2); ASSERT128(I128(5, 1), x + y); x = I128(2, -1ul); y = I128(2, BANE); ASSERT128(I128(5, IMAX), x + y); x = I128(2, -1ul); y = I128(2, -1ul); ASSERT128(I128(5, 0xfffffffffffffffe), x + y); x = I128(2, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE2, -1ul), x + y); x = I128(2, -1ul); y = I128(BANE, 2); ASSERT128(I128(0x8000000000000003, 1), x + y); x = I128(2, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0x8000000000000003, IMAX), x + y); x = I128(2, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0x8000000000000003, 0xfffffffffffffffe), x + y); x = I128(2, -1ul); y = I128(-1ul, 0); ASSERT128(I128(1, -1ul), x + y); x = I128(2, -1ul); y = I128(-1ul, 2); ASSERT128(I128(2, 1), x + y); x = I128(2, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(2, IMAX), x + y); x = I128(2, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(2, 0xfffffffffffffffe), x + y); x = I128(BANE, 0); y = I128(0, 0); ASSERT128(I128(BANE, 0), x + y); x = I128(BANE, 0); y = I128(0, 2); ASSERT128(I128(BANE, 2), x + y); x = I128(BANE, 0); y = I128(0, BANE); ASSERT128(I128(BANE, BANE), x + y); x = I128(BANE, 0); y = I128(0, -1ul); ASSERT128(I128(BANE, -1ul), x + y); x = I128(BANE, 0); y = I128(2, 0); ASSERT128(I128(BANE2, 0), x + y); x = I128(BANE, 0); y = I128(2, 2); ASSERT128(I128(BANE2, 2), x + y); x = I128(BANE, 0); y = I128(2, BANE); ASSERT128(I128(BANE2, BANE), x + y); x = I128(BANE, 0); y = I128(2, -1ul); ASSERT128(I128(BANE2, -1ul), x + y); x = I128(BANE, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x + y); x = I128(BANE, 0); y = I128(BANE, 2); ASSERT128(I128(0, 2), x + y); x = I128(BANE, 0); y = I128(BANE, BANE); ASSERT128(I128(0, BANE), x + y); x = I128(BANE, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, -1ul), x + y); x = I128(BANE, 0); y = I128(-1ul, 0); ASSERT128(I128(IMAX, 0), x + y); x = I128(BANE, 0); y = I128(-1ul, 2); ASSERT128(I128(IMAX, 2), x + y); x = I128(BANE, 0); y = I128(-1ul, BANE); ASSERT128(I128(IMAX, BANE), x + y); x = I128(BANE, 0); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX, -1ul), x + y); x = I128(BANE, 2); y = I128(0, 0); ASSERT128(I128(BANE, 2), x + y); x = I128(BANE, 2); y = I128(0, 2); ASSERT128(I128(BANE, 4), x + y); x = I128(BANE, 2); y = I128(0, BANE); ASSERT128(I128(BANE, BANE2), x + y); x = I128(BANE, 2); y = I128(0, -1ul); ASSERT128(I128(BANE1, 1), x + y); x = I128(BANE, 2); y = I128(2, 0); ASSERT128(I128(BANE2, 2), x + y); x = I128(BANE, 2); y = I128(2, 2); ASSERT128(I128(BANE2, 4), x + y); x = I128(BANE, 2); y = I128(2, BANE); ASSERT128(I128(BANE2, BANE2), x + y); x = I128(BANE, 2); y = I128(2, -1ul); ASSERT128(I128(0x8000000000000003, 1), x + y); x = I128(BANE, 2); y = I128(BANE, 0); ASSERT128(I128(0, 2), x + y); x = I128(BANE, 2); y = I128(BANE, 2); ASSERT128(I128(0, 4), x + y); x = I128(BANE, 2); y = I128(BANE, BANE); ASSERT128(I128(0, BANE2), x + y); x = I128(BANE, 2); y = I128(BANE, -1ul); ASSERT128(I128(1, 1), x + y); x = I128(BANE, 2); y = I128(-1ul, 0); ASSERT128(I128(IMAX, 2), x + y); x = I128(BANE, 2); y = I128(-1ul, 2); ASSERT128(I128(IMAX, 4), x + y); x = I128(BANE, 2); y = I128(-1ul, BANE); ASSERT128(I128(IMAX, BANE2), x + y); x = I128(BANE, 2); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, 1), x + y); x = I128(BANE, BANE); y = I128(0, 0); ASSERT128(I128(BANE, BANE), x + y); x = I128(BANE, BANE); y = I128(0, 2); ASSERT128(I128(BANE, BANE2), x + y); x = I128(BANE, BANE); y = I128(0, BANE); ASSERT128(I128(BANE1, 0), x + y); x = I128(BANE, BANE); y = I128(0, -1ul); ASSERT128(I128(BANE1, IMAX), x + y); x = I128(BANE, BANE); y = I128(2, 0); ASSERT128(I128(BANE2, BANE), x + y); x = I128(BANE, BANE); y = I128(2, 2); ASSERT128(I128(BANE2, BANE2), x + y); x = I128(BANE, BANE); y = I128(2, BANE); ASSERT128(I128(0x8000000000000003, 0), x + y); x = I128(BANE, BANE); y = I128(2, -1ul); ASSERT128(I128(0x8000000000000003, IMAX), x + y); x = I128(BANE, BANE); y = I128(BANE, 0); ASSERT128(I128(0, BANE), x + y); x = I128(BANE, BANE); y = I128(BANE, 2); ASSERT128(I128(0, BANE2), x + y); x = I128(BANE, BANE); y = I128(BANE, BANE); ASSERT128(I128(1, 0), x + y); x = I128(BANE, BANE); y = I128(BANE, -1ul); ASSERT128(I128(1, IMAX), x + y); x = I128(BANE, BANE); y = I128(-1ul, 0); ASSERT128(I128(IMAX, BANE), x + y); x = I128(BANE, BANE); y = I128(-1ul, 2); ASSERT128(I128(IMAX, BANE2), x + y); x = I128(BANE, BANE); y = I128(-1ul, BANE); ASSERT128(I128(BANE, 0), x + y); x = I128(BANE, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, IMAX), x + y); x = I128(BANE, -1ul); y = I128(0, 0); ASSERT128(I128(BANE, -1ul), x + y); x = I128(BANE, -1ul); y = I128(0, 2); ASSERT128(I128(BANE1, 1), x + y); x = I128(BANE, -1ul); y = I128(0, BANE); ASSERT128(I128(BANE1, IMAX), x + y); x = I128(BANE, -1ul); y = I128(0, -1ul); ASSERT128(I128(BANE1, 0xfffffffffffffffe), x + y); x = I128(BANE, -1ul); y = I128(2, 0); ASSERT128(I128(BANE2, -1ul), x + y); x = I128(BANE, -1ul); y = I128(2, 2); ASSERT128(I128(0x8000000000000003, 1), x + y); x = I128(BANE, -1ul); y = I128(2, BANE); ASSERT128(I128(0x8000000000000003, IMAX), x + y); x = I128(BANE, -1ul); y = I128(2, -1ul); ASSERT128(I128(0x8000000000000003, 0xfffffffffffffffe), x + y); x = I128(BANE, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, -1ul), x + y); x = I128(BANE, -1ul); y = I128(BANE, 2); ASSERT128(I128(1, 1), x + y); x = I128(BANE, -1ul); y = I128(BANE, BANE); ASSERT128(I128(1, IMAX), x + y); x = I128(BANE, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(1, 0xfffffffffffffffe), x + y); x = I128(BANE, -1ul); y = I128(-1ul, 0); ASSERT128(I128(IMAX, -1ul), x + y); x = I128(BANE, -1ul); y = I128(-1ul, 2); ASSERT128(I128(BANE, 1), x + y); x = I128(BANE, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(BANE, IMAX), x + y); x = I128(BANE, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, 0xfffffffffffffffe), x + y); x = I128(-1ul, 0); y = I128(0, 0); ASSERT128(I128(-1ul, 0), x + y); x = I128(-1ul, 0); y = I128(0, 2); ASSERT128(I128(-1ul, 2), x + y); x = I128(-1ul, 0); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE), x + y); x = I128(-1ul, 0); y = I128(0, -1ul); ASSERT128(I128(-1ul, -1ul), x + y); x = I128(-1ul, 0); y = I128(2, 0); ASSERT128(I128(1, 0), x + y); x = I128(-1ul, 0); y = I128(2, 2); ASSERT128(I128(1, 2), x + y); x = I128(-1ul, 0); y = I128(2, BANE); ASSERT128(I128(1, BANE), x + y); x = I128(-1ul, 0); y = I128(2, -1ul); ASSERT128(I128(1, -1ul), x + y); x = I128(-1ul, 0); y = I128(BANE, 0); ASSERT128(I128(IMAX, 0), x + y); x = I128(-1ul, 0); y = I128(BANE, 2); ASSERT128(I128(IMAX, 2), x + y); x = I128(-1ul, 0); y = I128(BANE, BANE); ASSERT128(I128(IMAX, BANE), x + y); x = I128(-1ul, 0); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, -1ul), x + y); x = I128(-1ul, 0); y = I128(-1ul, 0); ASSERT128(I128(0xfffffffffffffffe, 0), x + y); x = I128(-1ul, 0); y = I128(-1ul, 2); ASSERT128(I128(0xfffffffffffffffe, 2), x + y); x = I128(-1ul, 0); y = I128(-1ul, BANE); ASSERT128(I128(0xfffffffffffffffe, BANE), x + y); x = I128(-1ul, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0xfffffffffffffffe, -1ul), x + y); x = I128(-1ul, 2); y = I128(0, 0); ASSERT128(I128(-1ul, 2), x + y); x = I128(-1ul, 2); y = I128(0, 2); ASSERT128(I128(-1ul, 4), x + y); x = I128(-1ul, 2); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE2), x + y); x = I128(-1ul, 2); y = I128(0, -1ul); ASSERT128(I128(0, 1), x + y); x = I128(-1ul, 2); y = I128(2, 0); ASSERT128(I128(1, 2), x + y); x = I128(-1ul, 2); y = I128(2, 2); ASSERT128(I128(1, 4), x + y); x = I128(-1ul, 2); y = I128(2, BANE); ASSERT128(I128(1, BANE2), x + y); x = I128(-1ul, 2); y = I128(2, -1ul); ASSERT128(I128(2, 1), x + y); x = I128(-1ul, 2); y = I128(BANE, 0); ASSERT128(I128(IMAX, 2), x + y); x = I128(-1ul, 2); y = I128(BANE, 2); ASSERT128(I128(IMAX, 4), x + y); x = I128(-1ul, 2); y = I128(BANE, BANE); ASSERT128(I128(IMAX, BANE2), x + y); x = I128(-1ul, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 1), x + y); x = I128(-1ul, 2); y = I128(-1ul, 0); ASSERT128(I128(0xfffffffffffffffe, 2), x + y); x = I128(-1ul, 2); y = I128(-1ul, 2); ASSERT128(I128(0xfffffffffffffffe, 4), x + y); x = I128(-1ul, 2); y = I128(-1ul, BANE); ASSERT128(I128(0xfffffffffffffffe, BANE2), x + y); x = I128(-1ul, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 1), x + y); x = I128(-1ul, BANE); y = I128(0, 0); ASSERT128(I128(-1ul, BANE), x + y); x = I128(-1ul, BANE); y = I128(0, 2); ASSERT128(I128(-1ul, BANE2), x + y); x = I128(-1ul, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x + y); x = I128(-1ul, BANE); y = I128(0, -1ul); ASSERT128(I128(0, IMAX), x + y); x = I128(-1ul, BANE); y = I128(2, 0); ASSERT128(I128(1, BANE), x + y); x = I128(-1ul, BANE); y = I128(2, 2); ASSERT128(I128(1, BANE2), x + y); x = I128(-1ul, BANE); y = I128(2, BANE); ASSERT128(I128(2, 0), x + y); x = I128(-1ul, BANE); y = I128(2, -1ul); ASSERT128(I128(2, IMAX), x + y); x = I128(-1ul, BANE); y = I128(BANE, 0); ASSERT128(I128(IMAX, BANE), x + y); x = I128(-1ul, BANE); y = I128(BANE, 2); ASSERT128(I128(IMAX, BANE2), x + y); x = I128(-1ul, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE, 0), x + y); x = I128(-1ul, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE, IMAX), x + y); x = I128(-1ul, BANE); y = I128(-1ul, 0); ASSERT128(I128(0xfffffffffffffffe, BANE), x + y); x = I128(-1ul, BANE); y = I128(-1ul, 2); ASSERT128(I128(0xfffffffffffffffe, BANE2), x + y); x = I128(-1ul, BANE); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0), x + y); x = I128(-1ul, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, IMAX), x + y); x = I128(-1ul, -1ul); y = I128(0, 0); ASSERT128(I128(-1ul, -1ul), x + y); x = I128(-1ul, -1ul); y = I128(0, 2); ASSERT128(I128(0, 1), x + y); x = I128(-1ul, -1ul); y = I128(0, BANE); ASSERT128(I128(0, IMAX), x + y); x = I128(-1ul, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 0xfffffffffffffffe), x + y); x = I128(-1ul, -1ul); y = I128(2, 0); ASSERT128(I128(1, -1ul), x + y); x = I128(-1ul, -1ul); y = I128(2, 2); ASSERT128(I128(2, 1), x + y); x = I128(-1ul, -1ul); y = I128(2, BANE); ASSERT128(I128(2, IMAX), x + y); x = I128(-1ul, -1ul); y = I128(2, -1ul); ASSERT128(I128(2, 0xfffffffffffffffe), x + y); x = I128(-1ul, -1ul); y = I128(BANE, 0); ASSERT128(I128(IMAX, -1ul), x + y); x = I128(-1ul, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE, 1), x + y); x = I128(-1ul, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE, IMAX), x + y); x = I128(-1ul, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 0xfffffffffffffffe), x + y); x = I128(-1ul, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0xfffffffffffffffe, -1ul), x + y); x = I128(-1ul, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 1), x + y); x = I128(-1ul, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, IMAX), x + y); x = I128(-1ul, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x + y); } void testSub128(void) { __int128 x, y; x = I128(0, 0); y = I128(0, 0); ASSERT128(I128(0, 0), x - y); x = I128(0, 0); y = I128(0, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x - y); x = I128(0, 0); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE), x - y); x = I128(0, 0); y = I128(0, -1ul); ASSERT128(I128(-1ul, 1), x - y); x = I128(0, 0); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, 0), x - y); x = I128(0, 0); y = I128(2, 2); ASSERT128(I128(IMAX2, 0xfffffffffffffffe), x - y); x = I128(0, 0); y = I128(2, BANE); ASSERT128(I128(IMAX2, BANE), x - y); x = I128(0, 0); y = I128(2, -1ul); ASSERT128(I128(IMAX2, 1), x - y); x = I128(0, 0); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x - y); x = I128(0, 0); y = I128(BANE, 2); ASSERT128(I128(IMAX, 0xfffffffffffffffe), x - y); x = I128(0, 0); y = I128(BANE, BANE); ASSERT128(I128(IMAX, BANE), x - y); x = I128(0, 0); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, 1), x - y); x = I128(0, 0); y = I128(-1ul, 0); ASSERT128(I128(1, 0), x - y); x = I128(0, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0xfffffffffffffffe), x - y); x = I128(0, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, BANE), x - y); x = I128(0, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 1), x - y); x = I128(0, 2); y = I128(0, 0); ASSERT128(I128(0, 2), x - y); x = I128(0, 2); y = I128(0, 2); ASSERT128(I128(0, 0), x - y); x = I128(0, 2); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE2), x - y); x = I128(0, 2); y = I128(0, -1ul); ASSERT128(I128(-1ul, 3), x - y); x = I128(0, 2); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, 2), x - y); x = I128(0, 2); y = I128(2, 2); ASSERT128(I128(0xfffffffffffffffe, 0), x - y); x = I128(0, 2); y = I128(2, BANE); ASSERT128(I128(IMAX2, BANE2), x - y); x = I128(0, 2); y = I128(2, -1ul); ASSERT128(I128(IMAX2, 3), x - y); x = I128(0, 2); y = I128(BANE, 0); ASSERT128(I128(BANE, 2), x - y); x = I128(0, 2); y = I128(BANE, 2); ASSERT128(I128(BANE, 0), x - y); x = I128(0, 2); y = I128(BANE, BANE); ASSERT128(I128(IMAX, BANE2), x - y); x = I128(0, 2); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, 3), x - y); x = I128(0, 2); y = I128(-1ul, 0); ASSERT128(I128(1, 2), x - y); x = I128(0, 2); y = I128(-1ul, 2); ASSERT128(I128(1, 0), x - y); x = I128(0, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, BANE2), x - y); x = I128(0, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 3), x - y); x = I128(0, BANE); y = I128(0, 0); ASSERT128(I128(0, BANE), x - y); x = I128(0, BANE); y = I128(0, 2); ASSERT128(I128(0, 0x7ffffffffffffffe), x - y); x = I128(0, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x - y); x = I128(0, BANE); y = I128(0, -1ul); ASSERT128(I128(-1ul, BANE1), x - y); x = I128(0, BANE); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, BANE), x - y); x = I128(0, BANE); y = I128(2, 2); ASSERT128(I128(0xfffffffffffffffe, 0x7ffffffffffffffe), x - y); x = I128(0, BANE); y = I128(2, BANE); ASSERT128(I128(0xfffffffffffffffe, 0), x - y); x = I128(0, BANE); y = I128(2, -1ul); ASSERT128(I128(IMAX2, BANE1), x - y); x = I128(0, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE, BANE), x - y); x = I128(0, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE, 0x7ffffffffffffffe), x - y); x = I128(0, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE, 0), x - y); x = I128(0, BANE); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, BANE1), x - y); x = I128(0, BANE); y = I128(-1ul, 0); ASSERT128(I128(1, BANE), x - y); x = I128(0, BANE); y = I128(-1ul, 2); ASSERT128(I128(1, 0x7ffffffffffffffe), x - y); x = I128(0, BANE); y = I128(-1ul, BANE); ASSERT128(I128(1, 0), x - y); x = I128(0, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, BANE1), x - y); x = I128(0, -1ul); y = I128(0, 0); ASSERT128(I128(0, -1ul), x - y); x = I128(0, -1ul); y = I128(0, 2); ASSERT128(I128(0, IMAX2), x - y); x = I128(0, -1ul); y = I128(0, BANE); ASSERT128(I128(0, IMAX), x - y); x = I128(0, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 0), x - y); x = I128(0, -1ul); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, -1ul), x - y); x = I128(0, -1ul); y = I128(2, 2); ASSERT128(I128(0xfffffffffffffffe, IMAX2), x - y); x = I128(0, -1ul); y = I128(2, BANE); ASSERT128(I128(0xfffffffffffffffe, IMAX), x - y); x = I128(0, -1ul); y = I128(2, -1ul); ASSERT128(I128(0xfffffffffffffffe, 0), x - y); x = I128(0, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, -1ul), x - y); x = I128(0, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE, IMAX2), x - y); x = I128(0, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE, IMAX), x - y); x = I128(0, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 0), x - y); x = I128(0, -1ul); y = I128(-1ul, 0); ASSERT128(I128(1, -1ul), x - y); x = I128(0, -1ul); y = I128(-1ul, 2); ASSERT128(I128(1, IMAX2), x - y); x = I128(0, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(1, IMAX), x - y); x = I128(0, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(1, 0), x - y); x = I128(2, 0); y = I128(0, 0); ASSERT128(I128(2, 0), x - y); x = I128(2, 0); y = I128(0, 2); ASSERT128(I128(1, 0xfffffffffffffffe), x - y); x = I128(2, 0); y = I128(0, BANE); ASSERT128(I128(1, BANE), x - y); x = I128(2, 0); y = I128(0, -1ul); ASSERT128(I128(1, 1), x - y); x = I128(2, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x - y); x = I128(2, 0); y = I128(2, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x - y); x = I128(2, 0); y = I128(2, BANE); ASSERT128(I128(-1ul, BANE), x - y); x = I128(2, 0); y = I128(2, -1ul); ASSERT128(I128(-1ul, 1), x - y); x = I128(2, 0); y = I128(BANE, 0); ASSERT128(I128(BANE2, 0), x - y); x = I128(2, 0); y = I128(BANE, 2); ASSERT128(I128(BANE1, 0xfffffffffffffffe), x - y); x = I128(2, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE1, BANE), x - y); x = I128(2, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE1, 1), x - y); x = I128(2, 0); y = I128(-1ul, 0); ASSERT128(I128(3, 0), x - y); x = I128(2, 0); y = I128(-1ul, 2); ASSERT128(I128(2, 0xfffffffffffffffe), x - y); x = I128(2, 0); y = I128(-1ul, BANE); ASSERT128(I128(2, BANE), x - y); x = I128(2, 0); y = I128(-1ul, -1ul); ASSERT128(I128(2, 1), x - y); x = I128(2, 2); y = I128(0, 0); ASSERT128(I128(2, 2), x - y); x = I128(2, 2); y = I128(0, 2); ASSERT128(I128(2, 0), x - y); x = I128(2, 2); y = I128(0, BANE); ASSERT128(I128(1, BANE2), x - y); x = I128(2, 2); y = I128(0, -1ul); ASSERT128(I128(1, 3), x - y); x = I128(2, 2); y = I128(2, 0); ASSERT128(I128(0, 2), x - y); x = I128(2, 2); y = I128(2, 2); ASSERT128(I128(0, 0), x - y); x = I128(2, 2); y = I128(2, BANE); ASSERT128(I128(-1ul, BANE2), x - y); x = I128(2, 2); y = I128(2, -1ul); ASSERT128(I128(-1ul, 3), x - y); x = I128(2, 2); y = I128(BANE, 0); ASSERT128(I128(BANE2, 2), x - y); x = I128(2, 2); y = I128(BANE, 2); ASSERT128(I128(BANE2, 0), x - y); x = I128(2, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE1, BANE2), x - y); x = I128(2, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE1, 3), x - y); x = I128(2, 2); y = I128(-1ul, 0); ASSERT128(I128(3, 2), x - y); x = I128(2, 2); y = I128(-1ul, 2); ASSERT128(I128(3, 0), x - y); x = I128(2, 2); y = I128(-1ul, BANE); ASSERT128(I128(2, BANE2), x - y); x = I128(2, 2); y = I128(-1ul, -1ul); ASSERT128(I128(2, 3), x - y); x = I128(2, BANE); y = I128(0, 0); ASSERT128(I128(2, BANE), x - y); x = I128(2, BANE); y = I128(0, 2); ASSERT128(I128(2, 0x7ffffffffffffffe), x - y); x = I128(2, BANE); y = I128(0, BANE); ASSERT128(I128(2, 0), x - y); x = I128(2, BANE); y = I128(0, -1ul); ASSERT128(I128(1, BANE1), x - y); x = I128(2, BANE); y = I128(2, 0); ASSERT128(I128(0, BANE), x - y); x = I128(2, BANE); y = I128(2, 2); ASSERT128(I128(0, 0x7ffffffffffffffe), x - y); x = I128(2, BANE); y = I128(2, BANE); ASSERT128(I128(0, 0), x - y); x = I128(2, BANE); y = I128(2, -1ul); ASSERT128(I128(-1ul, BANE1), x - y); x = I128(2, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE2, BANE), x - y); x = I128(2, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE2, 0x7ffffffffffffffe), x - y); x = I128(2, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE2, 0), x - y); x = I128(2, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE1, BANE1), x - y); x = I128(2, BANE); y = I128(-1ul, 0); ASSERT128(I128(3, BANE), x - y); x = I128(2, BANE); y = I128(-1ul, 2); ASSERT128(I128(3, 0x7ffffffffffffffe), x - y); x = I128(2, BANE); y = I128(-1ul, BANE); ASSERT128(I128(3, 0), x - y); x = I128(2, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(2, BANE1), x - y); x = I128(2, -1ul); y = I128(0, 0); ASSERT128(I128(2, -1ul), x - y); x = I128(2, -1ul); y = I128(0, 2); ASSERT128(I128(2, IMAX2), x - y); x = I128(2, -1ul); y = I128(0, BANE); ASSERT128(I128(2, IMAX), x - y); x = I128(2, -1ul); y = I128(0, -1ul); ASSERT128(I128(2, 0), x - y); x = I128(2, -1ul); y = I128(2, 0); ASSERT128(I128(0, -1ul), x - y); x = I128(2, -1ul); y = I128(2, 2); ASSERT128(I128(0, IMAX2), x - y); x = I128(2, -1ul); y = I128(2, BANE); ASSERT128(I128(0, IMAX), x - y); x = I128(2, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 0), x - y); x = I128(2, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE2, -1ul), x - y); x = I128(2, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE2, IMAX2), x - y); x = I128(2, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE2, IMAX), x - y); x = I128(2, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE2, 0), x - y); x = I128(2, -1ul); y = I128(-1ul, 0); ASSERT128(I128(3, -1ul), x - y); x = I128(2, -1ul); y = I128(-1ul, 2); ASSERT128(I128(3, IMAX2), x - y); x = I128(2, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(3, IMAX), x - y); x = I128(2, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(3, 0), x - y); x = I128(BANE, 0); y = I128(0, 0); ASSERT128(I128(BANE, 0), x - y); x = I128(BANE, 0); y = I128(0, 2); ASSERT128(I128(IMAX, 0xfffffffffffffffe), x - y); x = I128(BANE, 0); y = I128(0, BANE); ASSERT128(I128(IMAX, BANE), x - y); x = I128(BANE, 0); y = I128(0, -1ul); ASSERT128(I128(IMAX, 1), x - y); x = I128(BANE, 0); y = I128(2, 0); ASSERT128(I128(0x7ffffffffffffffe, 0), x - y); x = I128(BANE, 0); y = I128(2, 2); ASSERT128(I128(0x7ffffffffffffffd, 0xfffffffffffffffe), x - y); x = I128(BANE, 0); y = I128(2, BANE); ASSERT128(I128(0x7ffffffffffffffd, BANE), x - y); x = I128(BANE, 0); y = I128(2, -1ul); ASSERT128(I128(0x7ffffffffffffffd, 1), x - y); x = I128(BANE, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x - y); x = I128(BANE, 0); y = I128(BANE, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x - y); x = I128(BANE, 0); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE), x - y); x = I128(BANE, 0); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, 1), x - y); x = I128(BANE, 0); y = I128(-1ul, 0); ASSERT128(I128(BANE1, 0), x - y); x = I128(BANE, 0); y = I128(-1ul, 2); ASSERT128(I128(BANE, 0xfffffffffffffffe), x - y); x = I128(BANE, 0); y = I128(-1ul, BANE); ASSERT128(I128(BANE, BANE), x - y); x = I128(BANE, 0); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, 1), x - y); x = I128(BANE, 2); y = I128(0, 0); ASSERT128(I128(BANE, 2), x - y); x = I128(BANE, 2); y = I128(0, 2); ASSERT128(I128(BANE, 0), x - y); x = I128(BANE, 2); y = I128(0, BANE); ASSERT128(I128(IMAX, BANE2), x - y); x = I128(BANE, 2); y = I128(0, -1ul); ASSERT128(I128(IMAX, 3), x - y); x = I128(BANE, 2); y = I128(2, 0); ASSERT128(I128(0x7ffffffffffffffe, 2), x - y); x = I128(BANE, 2); y = I128(2, 2); ASSERT128(I128(0x7ffffffffffffffe, 0), x - y); x = I128(BANE, 2); y = I128(2, BANE); ASSERT128(I128(0x7ffffffffffffffd, BANE2), x - y); x = I128(BANE, 2); y = I128(2, -1ul); ASSERT128(I128(0x7ffffffffffffffd, 3), x - y); x = I128(BANE, 2); y = I128(BANE, 0); ASSERT128(I128(0, 2), x - y); x = I128(BANE, 2); y = I128(BANE, 2); ASSERT128(I128(0, 0), x - y); x = I128(BANE, 2); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE2), x - y); x = I128(BANE, 2); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, 3), x - y); x = I128(BANE, 2); y = I128(-1ul, 0); ASSERT128(I128(BANE1, 2), x - y); x = I128(BANE, 2); y = I128(-1ul, 2); ASSERT128(I128(BANE1, 0), x - y); x = I128(BANE, 2); y = I128(-1ul, BANE); ASSERT128(I128(BANE, BANE2), x - y); x = I128(BANE, 2); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, 3), x - y); x = I128(BANE, BANE); y = I128(0, 0); ASSERT128(I128(BANE, BANE), x - y); x = I128(BANE, BANE); y = I128(0, 2); ASSERT128(I128(BANE, 0x7ffffffffffffffe), x - y); x = I128(BANE, BANE); y = I128(0, BANE); ASSERT128(I128(BANE, 0), x - y); x = I128(BANE, BANE); y = I128(0, -1ul); ASSERT128(I128(IMAX, BANE1), x - y); x = I128(BANE, BANE); y = I128(2, 0); ASSERT128(I128(0x7ffffffffffffffe, BANE), x - y); x = I128(BANE, BANE); y = I128(2, 2); ASSERT128(I128(0x7ffffffffffffffe, 0x7ffffffffffffffe), x - y); x = I128(BANE, BANE); y = I128(2, BANE); ASSERT128(I128(0x7ffffffffffffffe, 0), x - y); x = I128(BANE, BANE); y = I128(2, -1ul); ASSERT128(I128(0x7ffffffffffffffd, BANE1), x - y); x = I128(BANE, BANE); y = I128(BANE, 0); ASSERT128(I128(0, BANE), x - y); x = I128(BANE, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 0x7ffffffffffffffe), x - y); x = I128(BANE, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x - y); x = I128(BANE, BANE); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, BANE1), x - y); x = I128(BANE, BANE); y = I128(-1ul, 0); ASSERT128(I128(BANE1, BANE), x - y); x = I128(BANE, BANE); y = I128(-1ul, 2); ASSERT128(I128(BANE1, 0x7ffffffffffffffe), x - y); x = I128(BANE, BANE); y = I128(-1ul, BANE); ASSERT128(I128(BANE1, 0), x - y); x = I128(BANE, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, BANE1), x - y); x = I128(BANE, -1ul); y = I128(0, 0); ASSERT128(I128(BANE, -1ul), x - y); x = I128(BANE, -1ul); y = I128(0, 2); ASSERT128(I128(BANE, IMAX2), x - y); x = I128(BANE, -1ul); y = I128(0, BANE); ASSERT128(I128(BANE, IMAX), x - y); x = I128(BANE, -1ul); y = I128(0, -1ul); ASSERT128(I128(BANE, 0), x - y); x = I128(BANE, -1ul); y = I128(2, 0); ASSERT128(I128(0x7ffffffffffffffe, -1ul), x - y); x = I128(BANE, -1ul); y = I128(2, 2); ASSERT128(I128(0x7ffffffffffffffe, IMAX2), x - y); x = I128(BANE, -1ul); y = I128(2, BANE); ASSERT128(I128(0x7ffffffffffffffe, IMAX), x - y); x = I128(BANE, -1ul); y = I128(2, -1ul); ASSERT128(I128(0x7ffffffffffffffe, 0), x - y); x = I128(BANE, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, -1ul), x - y); x = I128(BANE, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, IMAX2), x - y); x = I128(BANE, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, IMAX), x - y); x = I128(BANE, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x - y); x = I128(BANE, -1ul); y = I128(-1ul, 0); ASSERT128(I128(BANE1, -1ul), x - y); x = I128(BANE, -1ul); y = I128(-1ul, 2); ASSERT128(I128(BANE1, IMAX2), x - y); x = I128(BANE, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(BANE1, IMAX), x - y); x = I128(BANE, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(BANE1, 0), x - y); x = I128(-1ul, 0); y = I128(0, 0); ASSERT128(I128(-1ul, 0), x - y); x = I128(-1ul, 0); y = I128(0, 2); ASSERT128(I128(0xfffffffffffffffe, 0xfffffffffffffffe), x - y); x = I128(-1ul, 0); y = I128(0, BANE); ASSERT128(I128(0xfffffffffffffffe, BANE), x - y); x = I128(-1ul, 0); y = I128(0, -1ul); ASSERT128(I128(0xfffffffffffffffe, 1), x - y); x = I128(-1ul, 0); y = I128(2, 0); ASSERT128(I128(IMAX2, 0), x - y); x = I128(-1ul, 0); y = I128(2, 2); ASSERT128(I128(0xfffffffffffffffc, 0xfffffffffffffffe), x - y); x = I128(-1ul, 0); y = I128(2, BANE); ASSERT128(I128(0xfffffffffffffffc, BANE), x - y); x = I128(-1ul, 0); y = I128(2, -1ul); ASSERT128(I128(0xfffffffffffffffc, 1), x - y); x = I128(-1ul, 0); y = I128(BANE, 0); ASSERT128(I128(IMAX, 0), x - y); x = I128(-1ul, 0); y = I128(BANE, 2); ASSERT128(I128(0x7ffffffffffffffe, 0xfffffffffffffffe), x - y); x = I128(-1ul, 0); y = I128(BANE, BANE); ASSERT128(I128(0x7ffffffffffffffe, BANE), x - y); x = I128(-1ul, 0); y = I128(BANE, -1ul); ASSERT128(I128(0x7ffffffffffffffe, 1), x - y); x = I128(-1ul, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x - y); x = I128(-1ul, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x - y); x = I128(-1ul, 0); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x - y); x = I128(-1ul, 0); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 1), x - y); x = I128(-1ul, 2); y = I128(0, 0); ASSERT128(I128(-1ul, 2), x - y); x = I128(-1ul, 2); y = I128(0, 2); ASSERT128(I128(-1ul, 0), x - y); x = I128(-1ul, 2); y = I128(0, BANE); ASSERT128(I128(0xfffffffffffffffe, BANE2), x - y); x = I128(-1ul, 2); y = I128(0, -1ul); ASSERT128(I128(0xfffffffffffffffe, 3), x - y); x = I128(-1ul, 2); y = I128(2, 0); ASSERT128(I128(IMAX2, 2), x - y); x = I128(-1ul, 2); y = I128(2, 2); ASSERT128(I128(IMAX2, 0), x - y); x = I128(-1ul, 2); y = I128(2, BANE); ASSERT128(I128(0xfffffffffffffffc, BANE2), x - y); x = I128(-1ul, 2); y = I128(2, -1ul); ASSERT128(I128(0xfffffffffffffffc, 3), x - y); x = I128(-1ul, 2); y = I128(BANE, 0); ASSERT128(I128(IMAX, 2), x - y); x = I128(-1ul, 2); y = I128(BANE, 2); ASSERT128(I128(IMAX, 0), x - y); x = I128(-1ul, 2); y = I128(BANE, BANE); ASSERT128(I128(0x7ffffffffffffffe, BANE2), x - y); x = I128(-1ul, 2); y = I128(BANE, -1ul); ASSERT128(I128(0x7ffffffffffffffe, 3), x - y); x = I128(-1ul, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 2), x - y); x = I128(-1ul, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x - y); x = I128(-1ul, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE2), x - y); x = I128(-1ul, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 3), x - y); x = I128(-1ul, BANE); y = I128(0, 0); ASSERT128(I128(-1ul, BANE), x - y); x = I128(-1ul, BANE); y = I128(0, 2); ASSERT128(I128(-1ul, 0x7ffffffffffffffe), x - y); x = I128(-1ul, BANE); y = I128(0, BANE); ASSERT128(I128(-1ul, 0), x - y); x = I128(-1ul, BANE); y = I128(0, -1ul); ASSERT128(I128(0xfffffffffffffffe, BANE1), x - y); x = I128(-1ul, BANE); y = I128(2, 0); ASSERT128(I128(IMAX2, BANE), x - y); x = I128(-1ul, BANE); y = I128(2, 2); ASSERT128(I128(IMAX2, 0x7ffffffffffffffe), x - y); x = I128(-1ul, BANE); y = I128(2, BANE); ASSERT128(I128(IMAX2, 0), x - y); x = I128(-1ul, BANE); y = I128(2, -1ul); ASSERT128(I128(0xfffffffffffffffc, BANE1), x - y); x = I128(-1ul, BANE); y = I128(BANE, 0); ASSERT128(I128(IMAX, BANE), x - y); x = I128(-1ul, BANE); y = I128(BANE, 2); ASSERT128(I128(IMAX, 0x7ffffffffffffffe), x - y); x = I128(-1ul, BANE); y = I128(BANE, BANE); ASSERT128(I128(IMAX, 0), x - y); x = I128(-1ul, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0x7ffffffffffffffe, BANE1), x - y); x = I128(-1ul, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, BANE), x - y); x = I128(-1ul, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, 0x7ffffffffffffffe), x - y); x = I128(-1ul, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x - y); x = I128(-1ul, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, BANE1), x - y); x = I128(-1ul, -1ul); y = I128(0, 0); ASSERT128(I128(-1ul, -1ul), x - y); x = I128(-1ul, -1ul); y = I128(0, 2); ASSERT128(I128(-1ul, IMAX2), x - y); x = I128(-1ul, -1ul); y = I128(0, BANE); ASSERT128(I128(-1ul, IMAX), x - y); x = I128(-1ul, -1ul); y = I128(0, -1ul); ASSERT128(I128(-1ul, 0), x - y); x = I128(-1ul, -1ul); y = I128(2, 0); ASSERT128(I128(IMAX2, -1ul), x - y); x = I128(-1ul, -1ul); y = I128(2, 2); ASSERT128(I128(IMAX2, IMAX2), x - y); x = I128(-1ul, -1ul); y = I128(2, BANE); ASSERT128(I128(IMAX2, IMAX), x - y); x = I128(-1ul, -1ul); y = I128(2, -1ul); ASSERT128(I128(IMAX2, 0), x - y); x = I128(-1ul, -1ul); y = I128(BANE, 0); ASSERT128(I128(IMAX, -1ul), x - y); x = I128(-1ul, -1ul); y = I128(BANE, 2); ASSERT128(I128(IMAX, IMAX2), x - y); x = I128(-1ul, -1ul); y = I128(BANE, BANE); ASSERT128(I128(IMAX, IMAX), x - y); x = I128(-1ul, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, 0), x - y); x = I128(-1ul, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, -1ul), x - y); x = I128(-1ul, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, IMAX2), x - y); x = I128(-1ul, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, IMAX), x - y); x = I128(-1ul, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x - y); } void testMul128(void) { __int128 x, y; x = I128(0, 0); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(0, -1ul); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x * y); x = I128(0, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x * y); x = I128(0, 2); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(0, 2); y = I128(0, 2); ASSERT128(I128(0, 4), x * y); x = I128(0, 2); y = I128(0, BANE); ASSERT128(I128(1, 0), x * y); x = I128(0, 2); y = I128(0, -1ul); ASSERT128(I128(1, 0xfffffffffffffffe), x * y); x = I128(0, 2); y = I128(2, 0); ASSERT128(I128(4, 0), x * y); x = I128(0, 2); y = I128(2, 2); ASSERT128(I128(4, 4), x * y); x = I128(0, 2); y = I128(2, BANE); ASSERT128(I128(5, 0), x * y); x = I128(0, 2); y = I128(2, -1ul); ASSERT128(I128(5, 0xfffffffffffffffe), x * y); x = I128(0, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(0, 2); y = I128(BANE, 2); ASSERT128(I128(0, 4), x * y); x = I128(0, 2); y = I128(BANE, BANE); ASSERT128(I128(1, 0), x * y); x = I128(0, 2); y = I128(BANE, -1ul); ASSERT128(I128(1, 0xfffffffffffffffe), x * y); x = I128(0, 2); y = I128(-1ul, 0); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(0, 2); y = I128(-1ul, 2); ASSERT128(I128(0xfffffffffffffffe, 4), x * y); x = I128(0, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0), x * y); x = I128(0, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x * y); x = I128(0, BANE); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(0, BANE); y = I128(0, 2); ASSERT128(I128(1, 0), x * y); x = I128(0, BANE); y = I128(0, BANE); ASSERT128(I128(0x4000000000000000, 0), x * y); x = I128(0, BANE); y = I128(0, -1ul); ASSERT128(I128(IMAX, BANE), x * y); x = I128(0, BANE); y = I128(2, 0); ASSERT128(I128(0, 0), x * y); x = I128(0, BANE); y = I128(2, 2); ASSERT128(I128(1, 0), x * y); x = I128(0, BANE); y = I128(2, BANE); ASSERT128(I128(0x4000000000000000, 0), x * y); x = I128(0, BANE); y = I128(2, -1ul); ASSERT128(I128(IMAX, BANE), x * y); x = I128(0, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(0, BANE); y = I128(BANE, 2); ASSERT128(I128(1, 0), x * y); x = I128(0, BANE); y = I128(BANE, BANE); ASSERT128(I128(0x4000000000000000, 0), x * y); x = I128(0, BANE); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, BANE), x * y); x = I128(0, BANE); y = I128(-1ul, 0); ASSERT128(I128(BANE, 0), x * y); x = I128(0, BANE); y = I128(-1ul, 2); ASSERT128(I128(BANE1, 0), x * y); x = I128(0, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0xc000000000000000, 0), x * y); x = I128(0, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, BANE), x * y); x = I128(0, -1ul); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(0, -1ul); y = I128(0, 2); ASSERT128(I128(1, 0xfffffffffffffffe), x * y); x = I128(0, -1ul); y = I128(0, BANE); ASSERT128(I128(IMAX, BANE), x * y); x = I128(0, -1ul); y = I128(0, -1ul); ASSERT128(I128(0xfffffffffffffffe, 1), x * y); x = I128(0, -1ul); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(0, -1ul); y = I128(2, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x * y); x = I128(0, -1ul); y = I128(2, BANE); ASSERT128(I128(0x7ffffffffffffffd, BANE), x * y); x = I128(0, -1ul); y = I128(2, -1ul); ASSERT128(I128(0xfffffffffffffffc, 1), x * y); x = I128(0, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x * y); x = I128(0, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE1, 0xfffffffffffffffe), x * y); x = I128(0, -1ul); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE), x * y); x = I128(0, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0x7ffffffffffffffe, 1), x * y); x = I128(0, -1ul); y = I128(-1ul, 0); ASSERT128(I128(1, 0), x * y); x = I128(0, -1ul); y = I128(-1ul, 2); ASSERT128(I128(2, 0xfffffffffffffffe), x * y); x = I128(0, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(BANE, BANE), x * y); x = I128(0, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 1), x * y); x = I128(2, 0); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(2, 0); y = I128(0, 2); ASSERT128(I128(4, 0), x * y); x = I128(2, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x * y); x = I128(2, 0); y = I128(0, -1ul); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(2, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x * y); x = I128(2, 0); y = I128(2, 2); ASSERT128(I128(4, 0), x * y); x = I128(2, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x * y); x = I128(2, 0); y = I128(2, -1ul); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(2, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(2, 0); y = I128(BANE, 2); ASSERT128(I128(4, 0), x * y); x = I128(2, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x * y); x = I128(2, 0); y = I128(BANE, -1ul); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(2, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x * y); x = I128(2, 0); y = I128(-1ul, 2); ASSERT128(I128(4, 0), x * y); x = I128(2, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x * y); x = I128(2, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(2, 2); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(2, 2); y = I128(0, 2); ASSERT128(I128(4, 4), x * y); x = I128(2, 2); y = I128(0, BANE); ASSERT128(I128(1, 0), x * y); x = I128(2, 2); y = I128(0, -1ul); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x * y); x = I128(2, 2); y = I128(2, 0); ASSERT128(I128(4, 0), x * y); x = I128(2, 2); y = I128(2, 2); ASSERT128(I128(0x0000000000000008, 4), x * y); x = I128(2, 2); y = I128(2, BANE); ASSERT128(I128(5, 0), x * y); x = I128(2, 2); y = I128(2, -1ul); ASSERT128(I128(3, 0xfffffffffffffffe), x * y); x = I128(2, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(2, 2); y = I128(BANE, 2); ASSERT128(I128(4, 4), x * y); x = I128(2, 2); y = I128(BANE, BANE); ASSERT128(I128(1, 0), x * y); x = I128(2, 2); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x * y); x = I128(2, 2); y = I128(-1ul, 0); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(2, 2); y = I128(-1ul, 2); ASSERT128(I128(2, 4), x * y); x = I128(2, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0), x * y); x = I128(2, 2); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX2, 0xfffffffffffffffe), x * y); x = I128(2, BANE); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(2, BANE); y = I128(0, 2); ASSERT128(I128(5, 0), x * y); x = I128(2, BANE); y = I128(0, BANE); ASSERT128(I128(0x4000000000000000, 0), x * y); x = I128(2, BANE); y = I128(0, -1ul); ASSERT128(I128(0x7ffffffffffffffd, BANE), x * y); x = I128(2, BANE); y = I128(2, 0); ASSERT128(I128(0, 0), x * y); x = I128(2, BANE); y = I128(2, 2); ASSERT128(I128(5, 0), x * y); x = I128(2, BANE); y = I128(2, BANE); ASSERT128(I128(0x4000000000000000, 0), x * y); x = I128(2, BANE); y = I128(2, -1ul); ASSERT128(I128(0x7ffffffffffffffd, BANE), x * y); x = I128(2, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(2, BANE); y = I128(BANE, 2); ASSERT128(I128(5, 0), x * y); x = I128(2, BANE); y = I128(BANE, BANE); ASSERT128(I128(0x4000000000000000, 0), x * y); x = I128(2, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0x7ffffffffffffffd, BANE), x * y); x = I128(2, BANE); y = I128(-1ul, 0); ASSERT128(I128(BANE, 0), x * y); x = I128(2, BANE); y = I128(-1ul, 2); ASSERT128(I128(0x8000000000000005, 0), x * y); x = I128(2, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0xc000000000000000, 0), x * y); x = I128(2, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX2, BANE), x * y); x = I128(2, -1ul); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(2, -1ul); y = I128(0, 2); ASSERT128(I128(5, 0xfffffffffffffffe), x * y); x = I128(2, -1ul); y = I128(0, BANE); ASSERT128(I128(IMAX, BANE), x * y); x = I128(2, -1ul); y = I128(0, -1ul); ASSERT128(I128(0xfffffffffffffffc, 1), x * y); x = I128(2, -1ul); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(2, -1ul); y = I128(2, 2); ASSERT128(I128(3, 0xfffffffffffffffe), x * y); x = I128(2, -1ul); y = I128(2, BANE); ASSERT128(I128(0x7ffffffffffffffd, BANE), x * y); x = I128(2, -1ul); y = I128(2, -1ul); ASSERT128(I128(0xfffffffffffffffa, 1), x * y); x = I128(2, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x * y); x = I128(2, -1ul); y = I128(BANE, 2); ASSERT128(I128(0x8000000000000005, 0xfffffffffffffffe), x * y); x = I128(2, -1ul); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE), x * y); x = I128(2, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0x7ffffffffffffffc, 1), x * y); x = I128(2, -1ul); y = I128(-1ul, 0); ASSERT128(I128(1, 0), x * y); x = I128(2, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0x0000000000000006, 0xfffffffffffffffe), x * y); x = I128(2, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(BANE, BANE), x * y); x = I128(2, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX2, 1), x * y); x = I128(BANE, 0); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(0, -1ul); ASSERT128(I128(BANE, 0), x * y); x = I128(BANE, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(2, -1ul); ASSERT128(I128(BANE, 0), x * y); x = I128(BANE, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 0), x * y); x = I128(BANE, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 0); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, 0), x * y); x = I128(BANE, 2); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 2); y = I128(0, 2); ASSERT128(I128(0, 4), x * y); x = I128(BANE, 2); y = I128(0, BANE); ASSERT128(I128(1, 0), x * y); x = I128(BANE, 2); y = I128(0, -1ul); ASSERT128(I128(BANE1, 0xfffffffffffffffe), x * y); x = I128(BANE, 2); y = I128(2, 0); ASSERT128(I128(4, 0), x * y); x = I128(BANE, 2); y = I128(2, 2); ASSERT128(I128(4, 4), x * y); x = I128(BANE, 2); y = I128(2, BANE); ASSERT128(I128(5, 0), x * y); x = I128(BANE, 2); y = I128(2, -1ul); ASSERT128(I128(0x8000000000000005, 0xfffffffffffffffe), x * y); x = I128(BANE, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(BANE, 2); y = I128(BANE, 2); ASSERT128(I128(0, 4), x * y); x = I128(BANE, 2); y = I128(BANE, BANE); ASSERT128(I128(1, 0), x * y); x = I128(BANE, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE1, 0xfffffffffffffffe), x * y); x = I128(BANE, 2); y = I128(-1ul, 0); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(BANE, 2); y = I128(-1ul, 2); ASSERT128(I128(0xfffffffffffffffe, 4), x * y); x = I128(BANE, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0), x * y); x = I128(BANE, 2); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX, 0xfffffffffffffffe), x * y); x = I128(BANE, BANE); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(BANE, BANE); y = I128(0, 2); ASSERT128(I128(1, 0), x * y); x = I128(BANE, BANE); y = I128(0, BANE); ASSERT128(I128(0x4000000000000000, 0), x * y); x = I128(BANE, BANE); y = I128(0, -1ul); ASSERT128(I128(-1ul, BANE), x * y); x = I128(BANE, BANE); y = I128(2, 0); ASSERT128(I128(0, 0), x * y); x = I128(BANE, BANE); y = I128(2, 2); ASSERT128(I128(1, 0), x * y); x = I128(BANE, BANE); y = I128(2, BANE); ASSERT128(I128(0x4000000000000000, 0), x * y); x = I128(BANE, BANE); y = I128(2, -1ul); ASSERT128(I128(-1ul, BANE), x * y); x = I128(BANE, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(BANE, BANE); y = I128(BANE, 2); ASSERT128(I128(1, 0), x * y); x = I128(BANE, BANE); y = I128(BANE, BANE); ASSERT128(I128(0x4000000000000000, 0), x * y); x = I128(BANE, BANE); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, BANE), x * y); x = I128(BANE, BANE); y = I128(-1ul, 0); ASSERT128(I128(BANE, 0), x * y); x = I128(BANE, BANE); y = I128(-1ul, 2); ASSERT128(I128(BANE1, 0), x * y); x = I128(BANE, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0xc000000000000000, 0), x * y); x = I128(BANE, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX, BANE), x * y); x = I128(BANE, -1ul); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(BANE, -1ul); y = I128(0, 2); ASSERT128(I128(1, 0xfffffffffffffffe), x * y); x = I128(BANE, -1ul); y = I128(0, BANE); ASSERT128(I128(IMAX, BANE), x * y); x = I128(BANE, -1ul); y = I128(0, -1ul); ASSERT128(I128(0x7ffffffffffffffe, 1), x * y); x = I128(BANE, -1ul); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(BANE, -1ul); y = I128(2, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x * y); x = I128(BANE, -1ul); y = I128(2, BANE); ASSERT128(I128(0x7ffffffffffffffd, BANE), x * y); x = I128(BANE, -1ul); y = I128(2, -1ul); ASSERT128(I128(0x7ffffffffffffffc, 1), x * y); x = I128(BANE, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x * y); x = I128(BANE, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE1, 0xfffffffffffffffe), x * y); x = I128(BANE, -1ul); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE), x * y); x = I128(BANE, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0xfffffffffffffffe, 1), x * y); x = I128(BANE, -1ul); y = I128(-1ul, 0); ASSERT128(I128(1, 0), x * y); x = I128(BANE, -1ul); y = I128(-1ul, 2); ASSERT128(I128(2, 0xfffffffffffffffe), x * y); x = I128(BANE, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(BANE, BANE), x * y); x = I128(BANE, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX, 1), x * y); x = I128(-1ul, 0); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(-1ul, 0); y = I128(0, 2); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(-1ul, 0); y = I128(0, BANE); ASSERT128(I128(BANE, 0), x * y); x = I128(-1ul, 0); y = I128(0, -1ul); ASSERT128(I128(1, 0), x * y); x = I128(-1ul, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x * y); x = I128(-1ul, 0); y = I128(2, 2); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(-1ul, 0); y = I128(2, BANE); ASSERT128(I128(BANE, 0), x * y); x = I128(-1ul, 0); y = I128(2, -1ul); ASSERT128(I128(1, 0), x * y); x = I128(-1ul, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(-1ul, 0); y = I128(BANE, 2); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(-1ul, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE, 0), x * y); x = I128(-1ul, 0); y = I128(BANE, -1ul); ASSERT128(I128(1, 0), x * y); x = I128(-1ul, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x * y); x = I128(-1ul, 0); y = I128(-1ul, 2); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(-1ul, 0); y = I128(-1ul, BANE); ASSERT128(I128(BANE, 0), x * y); x = I128(-1ul, 0); y = I128(-1ul, -1ul); ASSERT128(I128(1, 0), x * y); x = I128(-1ul, 2); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(-1ul, 2); y = I128(0, 2); ASSERT128(I128(0xfffffffffffffffe, 4), x * y); x = I128(-1ul, 2); y = I128(0, BANE); ASSERT128(I128(BANE1, 0), x * y); x = I128(-1ul, 2); y = I128(0, -1ul); ASSERT128(I128(2, 0xfffffffffffffffe), x * y); x = I128(-1ul, 2); y = I128(2, 0); ASSERT128(I128(4, 0), x * y); x = I128(-1ul, 2); y = I128(2, 2); ASSERT128(I128(2, 4), x * y); x = I128(-1ul, 2); y = I128(2, BANE); ASSERT128(I128(0x8000000000000005, 0), x * y); x = I128(-1ul, 2); y = I128(2, -1ul); ASSERT128(I128(0x0000000000000006, 0xfffffffffffffffe), x * y); x = I128(-1ul, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(-1ul, 2); y = I128(BANE, 2); ASSERT128(I128(0xfffffffffffffffe, 4), x * y); x = I128(-1ul, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE1, 0), x * y); x = I128(-1ul, 2); y = I128(BANE, -1ul); ASSERT128(I128(2, 0xfffffffffffffffe), x * y); x = I128(-1ul, 2); y = I128(-1ul, 0); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(-1ul, 2); y = I128(-1ul, 2); ASSERT128(I128(0xfffffffffffffffc, 4), x * y); x = I128(-1ul, 2); y = I128(-1ul, BANE); ASSERT128(I128(IMAX, 0), x * y); x = I128(-1ul, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0xfffffffffffffffe), x * y); x = I128(-1ul, BANE); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(-1ul, BANE); y = I128(0, 2); ASSERT128(I128(-1ul, 0), x * y); x = I128(-1ul, BANE); y = I128(0, BANE); ASSERT128(I128(0xc000000000000000, 0), x * y); x = I128(-1ul, BANE); y = I128(0, -1ul); ASSERT128(I128(BANE, BANE), x * y); x = I128(-1ul, BANE); y = I128(2, 0); ASSERT128(I128(0, 0), x * y); x = I128(-1ul, BANE); y = I128(2, 2); ASSERT128(I128(-1ul, 0), x * y); x = I128(-1ul, BANE); y = I128(2, BANE); ASSERT128(I128(0xc000000000000000, 0), x * y); x = I128(-1ul, BANE); y = I128(2, -1ul); ASSERT128(I128(BANE, BANE), x * y); x = I128(-1ul, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x * y); x = I128(-1ul, BANE); y = I128(BANE, 2); ASSERT128(I128(-1ul, 0), x * y); x = I128(-1ul, BANE); y = I128(BANE, BANE); ASSERT128(I128(0xc000000000000000, 0), x * y); x = I128(-1ul, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE, BANE), x * y); x = I128(-1ul, BANE); y = I128(-1ul, 0); ASSERT128(I128(BANE, 0), x * y); x = I128(-1ul, BANE); y = I128(-1ul, 2); ASSERT128(I128(IMAX, 0), x * y); x = I128(-1ul, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0x4000000000000000, 0), x * y); x = I128(-1ul, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, BANE), x * y); x = I128(-1ul, -1ul); y = I128(0, 0); ASSERT128(I128(0, 0), x * y); x = I128(-1ul, -1ul); y = I128(0, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x * y); x = I128(-1ul, -1ul); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE), x * y); x = I128(-1ul, -1ul); y = I128(0, -1ul); ASSERT128(I128(-1ul, 1), x * y); x = I128(-1ul, -1ul); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, 0), x * y); x = I128(-1ul, -1ul); y = I128(2, 2); ASSERT128(I128(IMAX2, 0xfffffffffffffffe), x * y); x = I128(-1ul, -1ul); y = I128(2, BANE); ASSERT128(I128(IMAX2, BANE), x * y); x = I128(-1ul, -1ul); y = I128(2, -1ul); ASSERT128(I128(IMAX2, 1), x * y); x = I128(-1ul, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x * y); x = I128(-1ul, -1ul); y = I128(BANE, 2); ASSERT128(I128(IMAX, 0xfffffffffffffffe), x * y); x = I128(-1ul, -1ul); y = I128(BANE, BANE); ASSERT128(I128(IMAX, BANE), x * y); x = I128(-1ul, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, 1), x * y); x = I128(-1ul, -1ul); y = I128(-1ul, 0); ASSERT128(I128(1, 0), x * y); x = I128(-1ul, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, 0xfffffffffffffffe), x * y); x = I128(-1ul, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, BANE), x * y); x = I128(-1ul, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 1), x * y); } void testDiv128(void) { __int128 x, y; x = I128(0, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(0, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(0, 2); ASSERT128(I128(0, 1), x / y); x = I128(0, 2); y = I128(0, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(0, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x / y); x = I128(0, BANE); y = I128(0, 2); ASSERT128(I128(0, 0x4000000000000000), x / y); x = I128(0, BANE); y = I128(0, BANE); ASSERT128(I128(0, 1), x / y); x = I128(0, BANE); y = I128(0, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, -1ul), x / y); x = I128(0, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, BANE), x / y); x = I128(0, -1ul); y = I128(0, 2); ASSERT128(I128(0, IMAX), x / y); x = I128(0, -1ul); y = I128(0, BANE); ASSERT128(I128(0, 1), x / y); x = I128(0, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(0, -1ul); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, -1ul), x / y); x = I128(0, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, -1ul), x / y); x = I128(0, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 1), x / y); x = I128(2, 0); y = I128(0, 2); ASSERT128(I128(1, 0), x / y); x = I128(2, 0); y = I128(0, BANE); ASSERT128(I128(0, 4), x / y); x = I128(2, 0); y = I128(0, -1ul); ASSERT128(I128(0, 2), x / y); x = I128(2, 0); y = I128(2, 0); ASSERT128(I128(0, 1), x / y); x = I128(2, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x / y); x = I128(2, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x / y); x = I128(2, 0); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0xfffffffffffffffc), x / y); x = I128(2, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0xfffffffffffffffe, 0), x / y); x = I128(2, 2); y = I128(0, 2); ASSERT128(I128(1, 1), x / y); x = I128(2, 2); y = I128(0, BANE); ASSERT128(I128(0, 4), x / y); x = I128(2, 2); y = I128(0, -1ul); ASSERT128(I128(0, 2), x / y); x = I128(2, 2); y = I128(2, 0); ASSERT128(I128(0, 1), x / y); x = I128(2, 2); y = I128(2, 2); ASSERT128(I128(0, 1), x / y); x = I128(2, 2); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x / y); x = I128(2, 2); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x / y); x = I128(2, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0xfffffffffffffffc), x / y); x = I128(2, 2); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX2, 0xfffffffffffffffe), x / y); x = I128(2, BANE); y = I128(0, 2); ASSERT128(I128(1, 0x4000000000000000), x / y); x = I128(2, BANE); y = I128(0, BANE); ASSERT128(I128(0, 5), x / y); x = I128(2, BANE); y = I128(0, -1ul); ASSERT128(I128(0, 2), x / y); x = I128(2, BANE); y = I128(2, 0); ASSERT128(I128(0, 1), x / y); x = I128(2, BANE); y = I128(2, 2); ASSERT128(I128(0, 1), x / y); x = I128(2, BANE); y = I128(2, BANE); ASSERT128(I128(0, 1), x / y); x = I128(2, BANE); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x / y); x = I128(2, BANE); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x / y); x = I128(2, BANE); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0xfffffffffffffffb), x / y); x = I128(2, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX2, BANE), x / y); x = I128(2, -1ul); y = I128(0, 2); ASSERT128(I128(1, IMAX), x / y); x = I128(2, -1ul); y = I128(0, BANE); ASSERT128(I128(0, 5), x / y); x = I128(2, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 3), x / y); x = I128(2, -1ul); y = I128(2, 0); ASSERT128(I128(0, 1), x / y); x = I128(2, -1ul); y = I128(2, 2); ASSERT128(I128(0, 1), x / y); x = I128(2, -1ul); y = I128(2, BANE); ASSERT128(I128(0, 1), x / y); x = I128(2, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(2, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x / y); x = I128(2, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, IMAX2), x / y); x = I128(2, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0xfffffffffffffffb), x / y); x = I128(2, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX2, 1), x / y); x = I128(BANE, 0); y = I128(0, 2); ASSERT128(I128(0xc000000000000000, 0), x / y); x = I128(BANE, 0); y = I128(0, BANE); ASSERT128(I128(-1ul, 0), x / y); x = I128(BANE, 0); y = I128(0, -1ul); ASSERT128(I128(-1ul, BANE), x / y); x = I128(BANE, 0); y = I128(2, 0); ASSERT128(I128(-1ul, 0xc000000000000000), x / y); x = I128(BANE, 0); y = I128(2, 2); ASSERT128(I128(-1ul, 0xc000000000000001), x / y); x = I128(BANE, 0); y = I128(2, BANE); ASSERT128(I128(-1ul, 0xcccccccccccccccd), x / y); x = I128(BANE, 0); y = I128(2, -1ul); ASSERT128(I128(-1ul, 0xd555555555555556), x / y); x = I128(BANE, 0); y = I128(BANE, 0); ASSERT128(I128(0, 1), x / y); x = I128(BANE, 0); y = I128(BANE, 2); ASSERT128(I128(0, 1), x / y); x = I128(BANE, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 1), x / y); x = I128(BANE, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(BANE, 0); y = I128(-1ul, 0); ASSERT128(I128(0, BANE), x / y); x = I128(BANE, 0); y = I128(-1ul, 2); ASSERT128(I128(0, BANE1), x / y); x = I128(BANE, 0); y = I128(-1ul, BANE); ASSERT128(I128(1, 0), x / y); x = I128(BANE, 2); y = I128(0, 2); ASSERT128(I128(0xc000000000000000, 1), x / y); x = I128(BANE, 2); y = I128(0, BANE); ASSERT128(I128(-1ul, 1), x / y); x = I128(BANE, 2); y = I128(0, -1ul); ASSERT128(I128(-1ul, BANE), x / y); x = I128(BANE, 2); y = I128(2, 0); ASSERT128(I128(-1ul, 0xc000000000000001), x / y); x = I128(BANE, 2); y = I128(2, 2); ASSERT128(I128(-1ul, 0xc000000000000001), x / y); x = I128(BANE, 2); y = I128(2, BANE); ASSERT128(I128(-1ul, 0xcccccccccccccccd), x / y); x = I128(BANE, 2); y = I128(2, -1ul); ASSERT128(I128(-1ul, 0xd555555555555556), x / y); x = I128(BANE, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 2); y = I128(BANE, 2); ASSERT128(I128(0, 1), x / y); x = I128(BANE, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 1), x / y); x = I128(BANE, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(BANE, 2); y = I128(-1ul, 0); ASSERT128(I128(0, IMAX), x / y); x = I128(BANE, 2); y = I128(-1ul, 2); ASSERT128(I128(0, BANE1), x / y); x = I128(BANE, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, -1ul), x / y); x = I128(BANE, 2); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX, 0xfffffffffffffffe), x / y); x = I128(BANE, BANE); y = I128(0, 2); ASSERT128(I128(0xc000000000000000, 0x4000000000000000), x / y); x = I128(BANE, BANE); y = I128(0, BANE); ASSERT128(I128(-1ul, 1), x / y); x = I128(BANE, BANE); y = I128(0, -1ul); ASSERT128(I128(-1ul, BANE), x / y); x = I128(BANE, BANE); y = I128(2, 0); ASSERT128(I128(-1ul, 0xc000000000000001), x / y); x = I128(BANE, BANE); y = I128(2, 2); ASSERT128(I128(-1ul, 0xc000000000000001), x / y); x = I128(BANE, BANE); y = I128(2, BANE); ASSERT128(I128(-1ul, 0xcccccccccccccccd), x / y); x = I128(BANE, BANE); y = I128(2, -1ul); ASSERT128(I128(-1ul, 0xd555555555555556), x / y); x = I128(BANE, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(BANE, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(BANE, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 1), x / y); x = I128(BANE, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(BANE, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, IMAX), x / y); x = I128(BANE, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, BANE), x / y); x = I128(BANE, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, -1ul), x / y); x = I128(BANE, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX, BANE), x / y); x = I128(BANE, -1ul); y = I128(0, 2); ASSERT128(I128(0xc000000000000000, BANE), x / y); x = I128(BANE, -1ul); y = I128(0, BANE); ASSERT128(I128(-1ul, 2), x / y); x = I128(BANE, -1ul); y = I128(0, -1ul); ASSERT128(I128(-1ul, BANE1), x / y); x = I128(BANE, -1ul); y = I128(2, 0); ASSERT128(I128(-1ul, 0xc000000000000001), x / y); x = I128(BANE, -1ul); y = I128(2, 2); ASSERT128(I128(-1ul, 0xc000000000000001), x / y); x = I128(BANE, -1ul); y = I128(2, BANE); ASSERT128(I128(-1ul, 0xccccccccccccccce), x / y); x = I128(BANE, -1ul); y = I128(2, -1ul); ASSERT128(I128(-1ul, 0xd555555555555556), x / y); x = I128(BANE, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(BANE, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(BANE, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(BANE, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(BANE, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, IMAX), x / y); x = I128(BANE, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, BANE), x / y); x = I128(BANE, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, 0xfffffffffffffffe), x / y); x = I128(BANE, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX, 1), x / y); x = I128(-1ul, 0); y = I128(0, 2); ASSERT128(I128(-1ul, BANE), x / y); x = I128(-1ul, 0); y = I128(0, BANE); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x / y); x = I128(-1ul, 0); y = I128(0, -1ul); ASSERT128(I128(-1ul, -1ul), x / y); x = I128(-1ul, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 2), x / y); x = I128(-1ul, 0); y = I128(-1ul, -1ul); ASSERT128(I128(1, 0), x / y); x = I128(-1ul, 2); y = I128(0, 2); ASSERT128(I128(-1ul, BANE1), x / y); x = I128(-1ul, 2); y = I128(0, BANE); ASSERT128(I128(-1ul, -1ul), x / y); x = I128(-1ul, 2); y = I128(0, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0xfffffffffffffffe), x / y); x = I128(-1ul, BANE); y = I128(0, 2); ASSERT128(I128(-1ul, 0xc000000000000000), x / y); x = I128(-1ul, BANE); y = I128(0, BANE); ASSERT128(I128(-1ul, -1ul), x / y); x = I128(-1ul, BANE); y = I128(0, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, BANE), x / y); x = I128(-1ul, -1ul); y = I128(0, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(0, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 1), x / y); } void testDivu128(void) { unsigned __int128 x, y; x = I128(0, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(0, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(0, 2); ASSERT128(I128(0, 1), x / y); x = I128(0, 2); y = I128(0, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(0, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(0, 2); ASSERT128(I128(0, 0x4000000000000000), x / y); x = I128(0, BANE); y = I128(0, BANE); ASSERT128(I128(0, 1), x / y); x = I128(0, BANE); y = I128(0, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(0, 2); ASSERT128(I128(0, IMAX), x / y); x = I128(0, -1ul); y = I128(0, BANE); ASSERT128(I128(0, 1), x / y); x = I128(0, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(0, -1ul); y = I128(2, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(0, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(0, 2); ASSERT128(I128(1, 0), x / y); x = I128(2, 0); y = I128(0, BANE); ASSERT128(I128(0, 4), x / y); x = I128(2, 0); y = I128(0, -1ul); ASSERT128(I128(0, 2), x / y); x = I128(2, 0); y = I128(2, 0); ASSERT128(I128(0, 1), x / y); x = I128(2, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(0, 2); ASSERT128(I128(1, 1), x / y); x = I128(2, 2); y = I128(0, BANE); ASSERT128(I128(0, 4), x / y); x = I128(2, 2); y = I128(0, -1ul); ASSERT128(I128(0, 2), x / y); x = I128(2, 2); y = I128(2, 0); ASSERT128(I128(0, 1), x / y); x = I128(2, 2); y = I128(2, 2); ASSERT128(I128(0, 1), x / y); x = I128(2, 2); y = I128(2, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(0, 2); ASSERT128(I128(1, 0x4000000000000000), x / y); x = I128(2, BANE); y = I128(0, BANE); ASSERT128(I128(0, 5), x / y); x = I128(2, BANE); y = I128(0, -1ul); ASSERT128(I128(0, 2), x / y); x = I128(2, BANE); y = I128(2, 0); ASSERT128(I128(0, 1), x / y); x = I128(2, BANE); y = I128(2, 2); ASSERT128(I128(0, 1), x / y); x = I128(2, BANE); y = I128(2, BANE); ASSERT128(I128(0, 1), x / y); x = I128(2, BANE); y = I128(2, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(0, 2); ASSERT128(I128(1, IMAX), x / y); x = I128(2, -1ul); y = I128(0, BANE); ASSERT128(I128(0, 5), x / y); x = I128(2, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 3), x / y); x = I128(2, -1ul); y = I128(2, 0); ASSERT128(I128(0, 1), x / y); x = I128(2, -1ul); y = I128(2, 2); ASSERT128(I128(0, 1), x / y); x = I128(2, -1ul); y = I128(2, BANE); ASSERT128(I128(0, 1), x / y); x = I128(2, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(2, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(2, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 0); y = I128(0, 2); ASSERT128(I128(0x4000000000000000, 0), x / y); x = I128(BANE, 0); y = I128(0, BANE); ASSERT128(I128(1, 0), x / y); x = I128(BANE, 0); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x / y); x = I128(BANE, 0); y = I128(2, 0); ASSERT128(I128(0, 0x4000000000000000), x / y); x = I128(BANE, 0); y = I128(2, 2); ASSERT128(I128(0, 0x3fffffffffffffff), x / y); x = I128(BANE, 0); y = I128(2, BANE); ASSERT128(I128(0, 0x3333333333333333), x / y); x = I128(BANE, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0x2aaaaaaaaaaaaaaa), x / y); x = I128(BANE, 0); y = I128(BANE, 0); ASSERT128(I128(0, 1), x / y); x = I128(BANE, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 2); y = I128(0, 2); ASSERT128(I128(0x4000000000000000, 1), x / y); x = I128(BANE, 2); y = I128(0, BANE); ASSERT128(I128(1, 0), x / y); x = I128(BANE, 2); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x / y); x = I128(BANE, 2); y = I128(2, 0); ASSERT128(I128(0, 0x4000000000000000), x / y); x = I128(BANE, 2); y = I128(2, 2); ASSERT128(I128(0, 0x3fffffffffffffff), x / y); x = I128(BANE, 2); y = I128(2, BANE); ASSERT128(I128(0, 0x3333333333333333), x / y); x = I128(BANE, 2); y = I128(2, -1ul); ASSERT128(I128(0, 0x2aaaaaaaaaaaaaaa), x / y); x = I128(BANE, 2); y = I128(BANE, 0); ASSERT128(I128(0, 1), x / y); x = I128(BANE, 2); y = I128(BANE, 2); ASSERT128(I128(0, 1), x / y); x = I128(BANE, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(BANE, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(BANE, BANE); y = I128(0, 2); ASSERT128(I128(0x4000000000000000, 0x4000000000000000), x / y); x = I128(BANE, BANE); y = I128(0, BANE); ASSERT128(I128(1, 1), x / y); x = I128(BANE, BANE); y = I128(0, -1ul); ASSERT128(I128(0, BANE1), x / y); x = I128(BANE, BANE); y = I128(2, 0); ASSERT128(I128(0, 0x4000000000000000), x / y); x = I128(BANE, BANE); y = I128(2, 2); ASSERT128(I128(0, 0x4000000000000000), x / y); x = I128(BANE, BANE); y = I128(2, BANE); ASSERT128(I128(0, 0x3333333333333333), x / y); x = I128(BANE, BANE); y = I128(2, -1ul); ASSERT128(I128(0, 0x2aaaaaaaaaaaaaaa), x / y); x = I128(BANE, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 1), x / y); x = I128(BANE, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 1), x / y); x = I128(BANE, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 1), x / y); x = I128(BANE, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(BANE, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(BANE, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(BANE, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(BANE, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(BANE, -1ul); y = I128(0, 2); ASSERT128(I128(0x4000000000000000, IMAX), x / y); x = I128(BANE, -1ul); y = I128(0, BANE); ASSERT128(I128(1, 1), x / y); x = I128(BANE, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, BANE1), x / y); x = I128(BANE, -1ul); y = I128(2, 0); ASSERT128(I128(0, 0x4000000000000000), x / y); x = I128(BANE, -1ul); y = I128(2, 2); ASSERT128(I128(0, 0x4000000000000000), x / y); x = I128(BANE, -1ul); y = I128(2, BANE); ASSERT128(I128(0, 0x3333333333333333), x / y); x = I128(BANE, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 0x2aaaaaaaaaaaaaab), x / y); x = I128(BANE, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, 1), x / y); x = I128(BANE, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, 1), x / y); x = I128(BANE, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, 1), x / y); x = I128(BANE, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(BANE, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x / y); x = I128(BANE, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(BANE, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(BANE, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(0, 2); ASSERT128(I128(IMAX, BANE), x / y); x = I128(-1ul, 0); y = I128(0, BANE); ASSERT128(I128(1, 0xfffffffffffffffe), x / y); x = I128(-1ul, 0); y = I128(0, -1ul); ASSERT128(I128(1, 0), x / y); x = I128(-1ul, 0); y = I128(2, 0); ASSERT128(I128(0, IMAX), x / y); x = I128(-1ul, 0); y = I128(2, 2); ASSERT128(I128(0, IMAX), x / y); x = I128(-1ul, 0); y = I128(2, BANE); ASSERT128(I128(0, 0x6666666666666666), x / y); x = I128(-1ul, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0x5555555555555555), x / y); x = I128(-1ul, 0); y = I128(BANE, 0); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 0); y = I128(BANE, 2); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(0, 2); ASSERT128(I128(IMAX, BANE1), x / y); x = I128(-1ul, 2); y = I128(0, BANE); ASSERT128(I128(1, 0xfffffffffffffffe), x / y); x = I128(-1ul, 2); y = I128(0, -1ul); ASSERT128(I128(1, 0), x / y); x = I128(-1ul, 2); y = I128(2, 0); ASSERT128(I128(0, IMAX), x / y); x = I128(-1ul, 2); y = I128(2, 2); ASSERT128(I128(0, IMAX), x / y); x = I128(-1ul, 2); y = I128(2, BANE); ASSERT128(I128(0, 0x6666666666666666), x / y); x = I128(-1ul, 2); y = I128(2, -1ul); ASSERT128(I128(0, 0x5555555555555555), x / y); x = I128(-1ul, 2); y = I128(BANE, 0); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 2); y = I128(BANE, 2); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, BANE); y = I128(0, 2); ASSERT128(I128(IMAX, 0xc000000000000000), x / y); x = I128(-1ul, BANE); y = I128(0, BANE); ASSERT128(I128(1, -1ul), x / y); x = I128(-1ul, BANE); y = I128(0, -1ul); ASSERT128(I128(1, 0), x / y); x = I128(-1ul, BANE); y = I128(2, 0); ASSERT128(I128(0, IMAX), x / y); x = I128(-1ul, BANE); y = I128(2, 2); ASSERT128(I128(0, IMAX), x / y); x = I128(-1ul, BANE); y = I128(2, BANE); ASSERT128(I128(0, 0x6666666666666666), x / y); x = I128(-1ul, BANE); y = I128(2, -1ul); ASSERT128(I128(0, 0x5555555555555555), x / y); x = I128(-1ul, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x / y); x = I128(-1ul, -1ul); y = I128(0, 2); ASSERT128(I128(IMAX, -1ul), x / y); x = I128(-1ul, -1ul); y = I128(0, BANE); ASSERT128(I128(1, -1ul), x / y); x = I128(-1ul, -1ul); y = I128(0, -1ul); ASSERT128(I128(1, 1), x / y); x = I128(-1ul, -1ul); y = I128(2, 0); ASSERT128(I128(0, IMAX), x / y); x = I128(-1ul, -1ul); y = I128(2, 2); ASSERT128(I128(0, IMAX), x / y); x = I128(-1ul, -1ul); y = I128(2, BANE); ASSERT128(I128(0, 0x6666666666666666), x / y); x = I128(-1ul, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 0x5555555555555555), x / y); x = I128(-1ul, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, 1), x / y); x = I128(-1ul, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 1), x / y); } void testRem128(void) { __int128 x, y; x = I128(0, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(0, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, 2); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, 2); y = I128(0, BANE); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(0, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(2, 0); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(2, 2); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(2, BANE); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(2, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(BANE, 0); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(BANE, 2); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, BANE); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(2, 0); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(2, 2); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(2, BANE); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(2, -1ul); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(BANE, 0); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(BANE, 2); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, -1ul); y = I128(0, 2); ASSERT128(I128(0, 1), x % y); x = I128(0, -1ul); y = I128(0, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(0, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, -1ul); y = I128(2, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(2, 2); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(2, BANE); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, 1), x % y); x = I128(0, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(0, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(2, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(2, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(2, 0); y = I128(0, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(2, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x % y); x = I128(2, 0); y = I128(2, 2); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(2, BANE); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(2, -1ul); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(BANE, 0); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(BANE, 2); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(BANE, BANE); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(BANE, -1ul); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x % y); x = I128(2, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 4), x % y); x = I128(2, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x % y); x = I128(2, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(2, 2); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(2, 2); y = I128(0, BANE); ASSERT128(I128(0, 2), x % y); x = I128(2, 2); y = I128(0, -1ul); ASSERT128(I128(0, 4), x % y); x = I128(2, 2); y = I128(2, 0); ASSERT128(I128(0, 2), x % y); x = I128(2, 2); y = I128(2, 2); ASSERT128(I128(0, 0), x % y); x = I128(2, 2); y = I128(2, BANE); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(2, -1ul); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(BANE, 0); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(BANE, 2); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(BANE, BANE); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(BANE, -1ul); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 2), x % y); x = I128(2, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 0x0000000000000006), x % y); x = I128(2, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, 2), x % y); x = I128(2, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(2, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(2, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(2, BANE); y = I128(0, -1ul); ASSERT128(I128(0, BANE2), x % y); x = I128(2, BANE); y = I128(2, 0); ASSERT128(I128(0, BANE), x % y); x = I128(2, BANE); y = I128(2, 2); ASSERT128(I128(0, 0x7ffffffffffffffe), x % y); x = I128(2, BANE); y = I128(2, BANE); ASSERT128(I128(0, 0), x % y); x = I128(2, BANE); y = I128(2, -1ul); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(BANE, 0); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(BANE, 2); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(BANE, BANE); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(BANE, -1ul); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, BANE), x % y); x = I128(2, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, 0x8000000000000004), x % y); x = I128(2, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x % y); x = I128(2, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(2, -1ul); y = I128(0, 2); ASSERT128(I128(0, 1), x % y); x = I128(2, -1ul); y = I128(0, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(2, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(2, -1ul); y = I128(2, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(2, -1ul); y = I128(2, 2); ASSERT128(I128(0, IMAX2), x % y); x = I128(2, -1ul); y = I128(2, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(2, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(2, -1ul); y = I128(BANE, 0); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(BANE, 2); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(BANE, BANE); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(2, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, 5), x % y); x = I128(2, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(2, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 0); y = I128(0, -1ul); ASSERT128(I128(-1ul, BANE), x % y); x = I128(BANE, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 0); y = I128(2, 2); ASSERT128(I128(0xfffffffffffffffe, 0x7ffffffffffffffe), x % y); x = I128(BANE, 0); y = I128(2, BANE); ASSERT128(I128(-1ul, BANE), x % y); x = I128(BANE, 0); y = I128(2, -1ul); ASSERT128(I128(IMAX2, 0xd555555555555556), x % y); x = I128(BANE, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 0); y = I128(BANE, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x % y); x = I128(BANE, 0); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE), x % y); x = I128(BANE, 0); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, 1), x % y); x = I128(BANE, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x % y); x = I128(BANE, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 2); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 2); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE2), x % y); x = I128(BANE, 2); y = I128(0, -1ul); ASSERT128(I128(-1ul, BANE2), x % y); x = I128(BANE, 2); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, 2), x % y); x = I128(BANE, 2); y = I128(2, 2); ASSERT128(I128(0xfffffffffffffffe, BANE), x % y); x = I128(BANE, 2); y = I128(2, BANE); ASSERT128(I128(-1ul, BANE2), x % y); x = I128(BANE, 2); y = I128(2, -1ul); ASSERT128(I128(IMAX2, 0xd555555555555558), x % y); x = I128(BANE, 2); y = I128(BANE, 0); ASSERT128(I128(BANE, 2), x % y); x = I128(BANE, 2); y = I128(BANE, 2); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 2); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE2), x % y); x = I128(BANE, 2); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, 3), x % y); x = I128(BANE, 2); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 2), x % y); x = I128(BANE, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE2), x % y); x = I128(BANE, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(0, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, BANE), x % y); x = I128(BANE, BANE); y = I128(2, 2); ASSERT128(I128(0xfffffffffffffffe, 0xfffffffffffffffe), x % y); x = I128(BANE, BANE); y = I128(2, BANE); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(2, -1ul); ASSERT128(I128(0xfffffffffffffffe, 0x5555555555555556), x % y); x = I128(BANE, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE, BANE), x % y); x = I128(BANE, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE, BANE), x % y); x = I128(BANE, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, BANE1), x % y); x = I128(BANE, BANE); y = I128(-1ul, 0); ASSERT128(I128(-1ul, BANE), x % y); x = I128(BANE, BANE); y = I128(-1ul, 2); ASSERT128(I128(-1ul, BANE), x % y); x = I128(BANE, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(BANE, -1ul); y = I128(0, 2); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(BANE, -1ul); y = I128(0, BANE); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(BANE, -1ul); y = I128(0, -1ul); ASSERT128(I128(-1ul, BANE), x % y); x = I128(BANE, -1ul); y = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, -1ul), x % y); x = I128(BANE, -1ul); y = I128(2, 2); ASSERT128(I128(-1ul, 0x7ffffffffffffffd), x % y); x = I128(BANE, -1ul); y = I128(2, BANE); ASSERT128(I128(IMAX2, -1ul), x % y); x = I128(BANE, -1ul); y = I128(2, -1ul); ASSERT128(I128(0xfffffffffffffffe, 0xd555555555555555), x % y); x = I128(BANE, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, -1ul), x % y); x = I128(BANE, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE, -1ul), x % y); x = I128(BANE, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE, -1ul), x % y); x = I128(BANE, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(BANE, -1ul); y = I128(-1ul, 0); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(BANE, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(BANE, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(BANE, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 0); y = I128(0, -1ul); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, 0); y = I128(2, 0); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 0); y = I128(2, 2); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 0); y = I128(2, BANE); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 0); y = I128(2, -1ul); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 0); y = I128(BANE, 0); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 0); y = I128(BANE, 2); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 0); y = I128(BANE, BANE); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 0); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), x % y); x = I128(-1ul, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 2); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 2); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE2), x % y); x = I128(-1ul, 2); y = I128(0, -1ul); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(2, 0); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(2, 2); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(2, BANE); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(2, -1ul); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(BANE, 0); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(BANE, 2); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(BANE, BANE); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE2), x % y); x = I128(-1ul, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, BANE); y = I128(0, -1ul); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(2, 0); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(2, 2); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(2, BANE); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(2, -1ul); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(BANE, 0); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(BANE, 2); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(-1ul, 0); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(-1ul, 2); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, -1ul); y = I128(0, 2); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(0, BANE); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(0, -1ul); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(2, 0); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(2, 2); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(2, BANE); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(2, -1ul); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(BANE, 0); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(BANE, 2); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(BANE, BANE); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(-1ul, 0); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); } void testRemu128(void) { unsigned __int128 x, y; x = I128(0, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(0, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, 2); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, 2); y = I128(0, BANE); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(0, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(2, 0); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(2, 2); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(2, BANE); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(2, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(BANE, 0); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(BANE, 2); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, 2), x % y); x = I128(0, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(0, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(0, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(0, BANE); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(2, 0); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(2, 2); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(2, BANE); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(2, -1ul); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(BANE, 0); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(BANE, 2); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, BANE), x % y); x = I128(0, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, BANE), x % y); x = I128(0, -1ul); y = I128(0, 2); ASSERT128(I128(0, 1), x % y); x = I128(0, -1ul); y = I128(0, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(0, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(0, -1ul); y = I128(2, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(2, 2); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(2, BANE); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, -1ul), x % y); x = I128(0, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, -1ul), x % y); x = I128(2, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(2, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(2, 0); y = I128(0, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(2, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x % y); x = I128(2, 0); y = I128(2, 2); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(2, BANE); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(2, -1ul); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(BANE, 0); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(BANE, 2); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(BANE, BANE); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(BANE, -1ul); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(-1ul, 0); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(-1ul, 2); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(-1ul, BANE); ASSERT128(I128(2, 0), x % y); x = I128(2, 0); y = I128(-1ul, -1ul); ASSERT128(I128(2, 0), x % y); x = I128(2, 2); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(2, 2); y = I128(0, BANE); ASSERT128(I128(0, 2), x % y); x = I128(2, 2); y = I128(0, -1ul); ASSERT128(I128(0, 4), x % y); x = I128(2, 2); y = I128(2, 0); ASSERT128(I128(0, 2), x % y); x = I128(2, 2); y = I128(2, 2); ASSERT128(I128(0, 0), x % y); x = I128(2, 2); y = I128(2, BANE); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(2, -1ul); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(BANE, 0); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(BANE, 2); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(BANE, BANE); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(BANE, -1ul); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(-1ul, 0); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(-1ul, 2); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(-1ul, BANE); ASSERT128(I128(2, 2), x % y); x = I128(2, 2); y = I128(-1ul, -1ul); ASSERT128(I128(2, 2), x % y); x = I128(2, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(2, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(2, BANE); y = I128(0, -1ul); ASSERT128(I128(0, BANE2), x % y); x = I128(2, BANE); y = I128(2, 0); ASSERT128(I128(0, BANE), x % y); x = I128(2, BANE); y = I128(2, 2); ASSERT128(I128(0, 0x7ffffffffffffffe), x % y); x = I128(2, BANE); y = I128(2, BANE); ASSERT128(I128(0, 0), x % y); x = I128(2, BANE); y = I128(2, -1ul); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(BANE, 0); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(BANE, 2); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(BANE, BANE); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(BANE, -1ul); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(-1ul, 0); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(-1ul, 2); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(-1ul, BANE); ASSERT128(I128(2, BANE), x % y); x = I128(2, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(2, BANE), x % y); x = I128(2, -1ul); y = I128(0, 2); ASSERT128(I128(0, 1), x % y); x = I128(2, -1ul); y = I128(0, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(2, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(2, -1ul); y = I128(2, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(2, -1ul); y = I128(2, 2); ASSERT128(I128(0, IMAX2), x % y); x = I128(2, -1ul); y = I128(2, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(2, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(2, -1ul); y = I128(BANE, 0); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(BANE, 2); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(BANE, BANE); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(-1ul, 0); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(-1ul, 2); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(2, -1ul), x % y); x = I128(2, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(2, -1ul), x % y); x = I128(BANE, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 0); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x % y); x = I128(BANE, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 0); y = I128(2, 2); ASSERT128(I128(1, BANE2), x % y); x = I128(BANE, 0); y = I128(2, BANE); ASSERT128(I128(0, BANE), x % y); x = I128(BANE, 0); y = I128(2, -1ul); ASSERT128(I128(2, 0x2aaaaaaaaaaaaaaa), x % y); x = I128(BANE, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 0); y = I128(BANE, 2); ASSERT128(I128(BANE, 0), x % y); x = I128(BANE, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE, 0), x % y); x = I128(BANE, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 0), x % y); x = I128(BANE, 0); y = I128(-1ul, 0); ASSERT128(I128(BANE, 0), x % y); x = I128(BANE, 0); y = I128(-1ul, 2); ASSERT128(I128(BANE, 0), x % y); x = I128(BANE, 0); y = I128(-1ul, BANE); ASSERT128(I128(BANE, 0), x % y); x = I128(BANE, 2); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 2); y = I128(0, BANE); ASSERT128(I128(0, 2), x % y); x = I128(BANE, 2); y = I128(0, -1ul); ASSERT128(I128(0, BANE2), x % y); x = I128(BANE, 2); y = I128(2, 0); ASSERT128(I128(0, 2), x % y); x = I128(BANE, 2); y = I128(2, 2); ASSERT128(I128(1, 0x8000000000000004), x % y); x = I128(BANE, 2); y = I128(2, BANE); ASSERT128(I128(0, BANE2), x % y); x = I128(BANE, 2); y = I128(2, -1ul); ASSERT128(I128(2, 0x2aaaaaaaaaaaaaac), x % y); x = I128(BANE, 2); y = I128(BANE, 0); ASSERT128(I128(0, 2), x % y); x = I128(BANE, 2); y = I128(BANE, 2); ASSERT128(I128(0, 0), x % y); x = I128(BANE, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE, 2), x % y); x = I128(BANE, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 2), x % y); x = I128(BANE, 2); y = I128(-1ul, 0); ASSERT128(I128(BANE, 2), x % y); x = I128(BANE, 2); y = I128(-1ul, 2); ASSERT128(I128(BANE, 2), x % y); x = I128(BANE, 2); y = I128(-1ul, BANE); ASSERT128(I128(BANE, 2), x % y); x = I128(BANE, 2); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, 2), x % y); x = I128(BANE, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(0, -1ul); ASSERT128(I128(0, 1), x % y); x = I128(BANE, BANE); y = I128(2, 0); ASSERT128(I128(0, BANE), x % y); x = I128(BANE, BANE); y = I128(2, 2); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(2, BANE); ASSERT128(I128(1, 0), x % y); x = I128(BANE, BANE); y = I128(2, -1ul); ASSERT128(I128(2, 0xaaaaaaaaaaaaaaaa), x % y); x = I128(BANE, BANE); y = I128(BANE, 0); ASSERT128(I128(0, BANE), x % y); x = I128(BANE, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 0x7ffffffffffffffe), x % y); x = I128(BANE, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x % y); x = I128(BANE, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE, BANE), x % y); x = I128(BANE, BANE); y = I128(-1ul, 0); ASSERT128(I128(BANE, BANE), x % y); x = I128(BANE, BANE); y = I128(-1ul, 2); ASSERT128(I128(BANE, BANE), x % y); x = I128(BANE, BANE); y = I128(-1ul, BANE); ASSERT128(I128(BANE, BANE), x % y); x = I128(BANE, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, BANE), x % y); x = I128(BANE, -1ul); y = I128(0, 2); ASSERT128(I128(0, 1), x % y); x = I128(BANE, -1ul); y = I128(0, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(BANE, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x % y); x = I128(BANE, -1ul); y = I128(2, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(BANE, -1ul); y = I128(2, 2); ASSERT128(I128(0, IMAX), x % y); x = I128(BANE, -1ul); y = I128(2, BANE); ASSERT128(I128(1, IMAX), x % y); x = I128(BANE, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 0x2aaaaaaaaaaaaaaa), x % y); x = I128(BANE, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(BANE, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, IMAX2), x % y); x = I128(BANE, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(BANE, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(BANE, -1ul); y = I128(-1ul, 0); ASSERT128(I128(BANE, -1ul), x % y); x = I128(BANE, -1ul); y = I128(-1ul, 2); ASSERT128(I128(BANE, -1ul), x % y); x = I128(BANE, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(BANE, -1ul), x % y); x = I128(BANE, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, -1ul), x % y); x = I128(-1ul, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 0); y = I128(0, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 0); y = I128(2, 0); ASSERT128(I128(1, 0), x % y); x = I128(-1ul, 0); y = I128(2, 2); ASSERT128(I128(0, 2), x % y); x = I128(-1ul, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0x5555555555555555), x % y); x = I128(-1ul, 0); y = I128(BANE, 0); ASSERT128(I128(IMAX, 0), x % y); x = I128(-1ul, 0); y = I128(BANE, 2); ASSERT128(I128(0x7ffffffffffffffe, 0xfffffffffffffffe), x % y); x = I128(-1ul, 0); y = I128(BANE, BANE); ASSERT128(I128(0x7ffffffffffffffe, BANE), x % y); x = I128(-1ul, 0); y = I128(BANE, -1ul); ASSERT128(I128(0x7ffffffffffffffe, 1), x % y); x = I128(-1ul, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 0); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 0); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 0), x % y); x = I128(-1ul, 2); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 2); y = I128(0, BANE); ASSERT128(I128(0, 2), x % y); x = I128(-1ul, 2); y = I128(0, -1ul); ASSERT128(I128(0, 2), x % y); x = I128(-1ul, 2); y = I128(2, 0); ASSERT128(I128(1, 2), x % y); x = I128(-1ul, 2); y = I128(2, 2); ASSERT128(I128(0, 4), x % y); x = I128(-1ul, 2); y = I128(2, BANE); ASSERT128(I128(0, 2), x % y); x = I128(-1ul, 2); y = I128(2, -1ul); ASSERT128(I128(0, 0x5555555555555557), x % y); x = I128(-1ul, 2); y = I128(BANE, 0); ASSERT128(I128(IMAX, 2), x % y); x = I128(-1ul, 2); y = I128(BANE, 2); ASSERT128(I128(IMAX, 0), x % y); x = I128(-1ul, 2); y = I128(BANE, BANE); ASSERT128(I128(0x7ffffffffffffffe, BANE2), x % y); x = I128(-1ul, 2); y = I128(BANE, -1ul); ASSERT128(I128(0x7ffffffffffffffe, 3), x % y); x = I128(-1ul, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 2), x % y); x = I128(-1ul, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 2), x % y); x = I128(-1ul, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, BANE); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x % y); x = I128(-1ul, BANE); y = I128(2, 0); ASSERT128(I128(1, BANE), x % y); x = I128(-1ul, BANE); y = I128(2, 2); ASSERT128(I128(0, BANE2), x % y); x = I128(-1ul, BANE); y = I128(2, BANE); ASSERT128(I128(0, BANE), x % y); x = I128(-1ul, BANE); y = I128(2, -1ul); ASSERT128(I128(0, 0xd555555555555555), x % y); x = I128(-1ul, BANE); y = I128(BANE, 0); ASSERT128(I128(IMAX, BANE), x % y); x = I128(-1ul, BANE); y = I128(BANE, 2); ASSERT128(I128(IMAX, 0x7ffffffffffffffe), x % y); x = I128(-1ul, BANE); y = I128(BANE, BANE); ASSERT128(I128(IMAX, 0), x % y); x = I128(-1ul, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0x7ffffffffffffffe, BANE1), x % y); x = I128(-1ul, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, BANE), x % y); x = I128(-1ul, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, 0x7ffffffffffffffe), x % y); x = I128(-1ul, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, BANE), x % y); x = I128(-1ul, -1ul); y = I128(0, 2); ASSERT128(I128(0, 1), x % y); x = I128(-1ul, -1ul); y = I128(0, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(-1ul, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 0), x % y); x = I128(-1ul, -1ul); y = I128(2, 0); ASSERT128(I128(1, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(2, 2); ASSERT128(I128(1, 1), x % y); x = I128(-1ul, -1ul); y = I128(2, BANE); ASSERT128(I128(0, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(2, -1ul); ASSERT128(I128(1, 0x5555555555555554), x % y); x = I128(-1ul, -1ul); y = I128(BANE, 0); ASSERT128(I128(IMAX, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(BANE, 2); ASSERT128(I128(IMAX, IMAX2), x % y); x = I128(-1ul, -1ul); y = I128(BANE, BANE); ASSERT128(I128(IMAX, IMAX), x % y); x = I128(-1ul, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, 0), x % y); x = I128(-1ul, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, -1ul), x % y); x = I128(-1ul, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, IMAX2), x % y); x = I128(-1ul, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, IMAX), x % y); x = I128(-1ul, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x % y); } void testShr128(void) { unsigned __int128 x; x = I128(0, 0); x >>= 0; ASSERT128(I128(0, 0), x); x = I128(0, 0); x >>= 1; ASSERT128(I128(0, 0), x); x = I128(0, 0); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(0, 0); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(0, 2); x >>= 0; ASSERT128(I128(0, 2), x); x = I128(0, 2); x >>= 1; ASSERT128(I128(0, 1), x); x = I128(0, 2); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(0, 2); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(0, BANE); x >>= 0; ASSERT128(I128(0, BANE), x); x = I128(0, BANE); x >>= 1; ASSERT128(I128(0, 0x4000000000000000), x); x = I128(0, BANE); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(0, BANE); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(0, -1ul); x >>= 0; ASSERT128(I128(0, -1ul), x); x = I128(0, -1ul); x >>= 1; ASSERT128(I128(0, IMAX), x); x = I128(0, -1ul); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(0, -1ul); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(2, 0); x >>= 0; ASSERT128(I128(2, 0), x); x = I128(2, 0); x >>= 1; ASSERT128(I128(1, 0), x); x = I128(2, 0); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(2, 0); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(2, 2); x >>= 0; ASSERT128(I128(2, 2), x); x = I128(2, 2); x >>= 1; ASSERT128(I128(1, 1), x); x = I128(2, 2); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(2, 2); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(2, BANE); x >>= 0; ASSERT128(I128(2, BANE), x); x = I128(2, BANE); x >>= 1; ASSERT128(I128(1, 0x4000000000000000), x); x = I128(2, BANE); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(2, BANE); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(2, -1ul); x >>= 0; ASSERT128(I128(2, -1ul), x); x = I128(2, -1ul); x >>= 1; ASSERT128(I128(1, IMAX), x); x = I128(2, -1ul); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(2, -1ul); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(BANE, 0); x >>= 0; ASSERT128(I128(BANE, 0), x); x = I128(BANE, 0); x >>= 1; ASSERT128(I128(0x4000000000000000, 0), x); x = I128(BANE, 0); x >>= 126; ASSERT128(I128(0, 2), x); x = I128(BANE, 0); x >>= 127; ASSERT128(I128(0, 1), x); x = I128(BANE, 2); x >>= 0; ASSERT128(I128(BANE, 2), x); x = I128(BANE, 2); x >>= 1; ASSERT128(I128(0x4000000000000000, 1), x); x = I128(BANE, 2); x >>= 126; ASSERT128(I128(0, 2), x); x = I128(BANE, 2); x >>= 127; ASSERT128(I128(0, 1), x); x = I128(BANE, BANE); x >>= 0; ASSERT128(I128(BANE, BANE), x); x = I128(BANE, BANE); x >>= 1; ASSERT128(I128(0x4000000000000000, 0x4000000000000000), x); x = I128(BANE, BANE); x >>= 126; ASSERT128(I128(0, 2), x); x = I128(BANE, BANE); x >>= 127; ASSERT128(I128(0, 1), x); x = I128(BANE, -1ul); x >>= 0; ASSERT128(I128(BANE, -1ul), x); x = I128(BANE, -1ul); x >>= 1; ASSERT128(I128(0x4000000000000000, IMAX), x); x = I128(BANE, -1ul); x >>= 126; ASSERT128(I128(0, 2), x); x = I128(BANE, -1ul); x >>= 127; ASSERT128(I128(0, 1), x); x = I128(-1ul, 0); x >>= 0; ASSERT128(I128(-1ul, 0), x); x = I128(-1ul, 0); x >>= 1; ASSERT128(I128(IMAX, BANE), x); x = I128(-1ul, 0); x >>= 126; ASSERT128(I128(0, 3), x); x = I128(-1ul, 0); x >>= 127; ASSERT128(I128(0, 1), x); x = I128(-1ul, 2); x >>= 0; ASSERT128(I128(-1ul, 2), x); x = I128(-1ul, 2); x >>= 1; ASSERT128(I128(IMAX, BANE1), x); x = I128(-1ul, 2); x >>= 126; ASSERT128(I128(0, 3), x); x = I128(-1ul, 2); x >>= 127; ASSERT128(I128(0, 1), x); x = I128(-1ul, BANE); x >>= 0; ASSERT128(I128(-1ul, BANE), x); x = I128(-1ul, BANE); x >>= 1; ASSERT128(I128(IMAX, 0xc000000000000000), x); x = I128(-1ul, BANE); x >>= 126; ASSERT128(I128(0, 3), x); x = I128(-1ul, BANE); x >>= 127; ASSERT128(I128(0, 1), x); x = I128(-1ul, -1ul); x >>= 0; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, -1ul); x >>= 1; ASSERT128(I128(IMAX, -1ul), x); x = I128(-1ul, -1ul); x >>= 126; ASSERT128(I128(0, 3), x); x = I128(-1ul, -1ul); x >>= 127; ASSERT128(I128(0, 1), x); } void testSar128(void) { __int128 x; x = I128(0, 0); x >>= 0; ASSERT128(I128(0, 0), x); x = I128(0, 0); x >>= 1; ASSERT128(I128(0, 0), x); x = I128(0, 0); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(0, 0); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(0, 2); x >>= 0; ASSERT128(I128(0, 2), x); x = I128(0, 2); x >>= 1; ASSERT128(I128(0, 1), x); x = I128(0, 2); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(0, 2); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(0, BANE); x >>= 0; ASSERT128(I128(0, BANE), x); x = I128(0, BANE); x >>= 1; ASSERT128(I128(0, 0x4000000000000000), x); x = I128(0, BANE); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(0, BANE); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(0, -1ul); x >>= 0; ASSERT128(I128(0, -1ul), x); x = I128(0, -1ul); x >>= 1; ASSERT128(I128(0, IMAX), x); x = I128(0, -1ul); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(0, -1ul); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(2, 0); x >>= 0; ASSERT128(I128(2, 0), x); x = I128(2, 0); x >>= 1; ASSERT128(I128(1, 0), x); x = I128(2, 0); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(2, 0); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(2, 2); x >>= 0; ASSERT128(I128(2, 2), x); x = I128(2, 2); x >>= 1; ASSERT128(I128(1, 1), x); x = I128(2, 2); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(2, 2); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(2, BANE); x >>= 0; ASSERT128(I128(2, BANE), x); x = I128(2, BANE); x >>= 1; ASSERT128(I128(1, 0x4000000000000000), x); x = I128(2, BANE); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(2, BANE); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(2, -1ul); x >>= 0; ASSERT128(I128(2, -1ul), x); x = I128(2, -1ul); x >>= 1; ASSERT128(I128(1, IMAX), x); x = I128(2, -1ul); x >>= 126; ASSERT128(I128(0, 0), x); x = I128(2, -1ul); x >>= 127; ASSERT128(I128(0, 0), x); x = I128(BANE, 0); x >>= 0; ASSERT128(I128(BANE, 0), x); x = I128(BANE, 0); x >>= 1; ASSERT128(I128(0xc000000000000000, 0), x); x = I128(BANE, 0); x >>= 126; ASSERT128(I128(-1ul, 0xfffffffffffffffe), x); x = I128(BANE, 0); x >>= 127; ASSERT128(I128(-1ul, -1ul), x); x = I128(BANE, 2); x >>= 0; ASSERT128(I128(BANE, 2), x); x = I128(BANE, 2); x >>= 1; ASSERT128(I128(0xc000000000000000, 1), x); x = I128(BANE, 2); x >>= 126; ASSERT128(I128(-1ul, 0xfffffffffffffffe), x); x = I128(BANE, 2); x >>= 127; ASSERT128(I128(-1ul, -1ul), x); x = I128(BANE, BANE); x >>= 0; ASSERT128(I128(BANE, BANE), x); x = I128(BANE, BANE); x >>= 1; ASSERT128(I128(0xc000000000000000, 0x4000000000000000), x); x = I128(BANE, BANE); x >>= 126; ASSERT128(I128(-1ul, 0xfffffffffffffffe), x); x = I128(BANE, BANE); x >>= 127; ASSERT128(I128(-1ul, -1ul), x); x = I128(BANE, -1ul); x >>= 0; ASSERT128(I128(BANE, -1ul), x); x = I128(BANE, -1ul); x >>= 1; ASSERT128(I128(0xc000000000000000, IMAX), x); x = I128(BANE, -1ul); x >>= 126; ASSERT128(I128(-1ul, 0xfffffffffffffffe), x); x = I128(BANE, -1ul); x >>= 127; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, 0); x >>= 0; ASSERT128(I128(-1ul, 0), x); x = I128(-1ul, 0); x >>= 1; ASSERT128(I128(-1ul, BANE), x); x = I128(-1ul, 0); x >>= 126; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, 0); x >>= 127; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, 2); x >>= 0; ASSERT128(I128(-1ul, 2), x); x = I128(-1ul, 2); x >>= 1; ASSERT128(I128(-1ul, BANE1), x); x = I128(-1ul, 2); x >>= 126; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, 2); x >>= 127; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, BANE); x >>= 0; ASSERT128(I128(-1ul, BANE), x); x = I128(-1ul, BANE); x >>= 1; ASSERT128(I128(-1ul, 0xc000000000000000), x); x = I128(-1ul, BANE); x >>= 126; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, BANE); x >>= 127; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, -1ul); x >>= 0; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, -1ul); x >>= 1; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, -1ul); x >>= 126; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, -1ul); x >>= 127; ASSERT128(I128(-1ul, -1ul), x); } void testShl128(void) { __int128 x; x = I128(0, 0); x <<= 0; ASSERT128(I128(0, 0), x); x = I128(0, 0); x <<= 1; ASSERT128(I128(0, 0), x); x = I128(0, 0); x <<= 126; ASSERT128(I128(0, 0), x); x = I128(0, 0); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(0, 2); x <<= 0; ASSERT128(I128(0, 2), x); x = I128(0, 2); x <<= 1; ASSERT128(I128(0, 4), x); x = I128(0, 2); x <<= 126; ASSERT128(I128(BANE, 0), x); x = I128(0, 2); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(0, BANE); x <<= 0; ASSERT128(I128(0, BANE), x); x = I128(0, BANE); x <<= 1; ASSERT128(I128(1, 0), x); x = I128(0, BANE); x <<= 126; ASSERT128(I128(0, 0), x); x = I128(0, BANE); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(0, -1ul); x <<= 0; ASSERT128(I128(0, -1ul), x); x = I128(0, -1ul); x <<= 1; ASSERT128(I128(1, 0xfffffffffffffffe), x); x = I128(0, -1ul); x <<= 126; ASSERT128(I128(0xc000000000000000, 0), x); x = I128(0, -1ul); x <<= 127; ASSERT128(I128(BANE, 0), x); x = I128(2, 0); x <<= 0; ASSERT128(I128(2, 0), x); x = I128(2, 0); x <<= 1; ASSERT128(I128(4, 0), x); x = I128(2, 0); x <<= 126; ASSERT128(I128(0, 0), x); x = I128(2, 0); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(2, 2); x <<= 0; ASSERT128(I128(2, 2), x); x = I128(2, 2); x <<= 1; ASSERT128(I128(4, 4), x); x = I128(2, 2); x <<= 126; ASSERT128(I128(BANE, 0), x); x = I128(2, 2); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(2, BANE); x <<= 0; ASSERT128(I128(2, BANE), x); x = I128(2, BANE); x <<= 1; ASSERT128(I128(5, 0), x); x = I128(2, BANE); x <<= 126; ASSERT128(I128(0, 0), x); x = I128(2, BANE); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(2, -1ul); x <<= 0; ASSERT128(I128(2, -1ul), x); x = I128(2, -1ul); x <<= 1; ASSERT128(I128(5, 0xfffffffffffffffe), x); x = I128(2, -1ul); x <<= 126; ASSERT128(I128(0xc000000000000000, 0), x); x = I128(2, -1ul); x <<= 127; ASSERT128(I128(BANE, 0), x); x = I128(BANE, 0); x <<= 0; ASSERT128(I128(BANE, 0), x); x = I128(BANE, 0); x <<= 1; ASSERT128(I128(0, 0), x); x = I128(BANE, 0); x <<= 126; ASSERT128(I128(0, 0), x); x = I128(BANE, 0); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(BANE, 2); x <<= 0; ASSERT128(I128(BANE, 2), x); x = I128(BANE, 2); x <<= 1; ASSERT128(I128(0, 4), x); x = I128(BANE, 2); x <<= 126; ASSERT128(I128(BANE, 0), x); x = I128(BANE, 2); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(BANE, BANE); x <<= 0; ASSERT128(I128(BANE, BANE), x); x = I128(BANE, BANE); x <<= 1; ASSERT128(I128(1, 0), x); x = I128(BANE, BANE); x <<= 126; ASSERT128(I128(0, 0), x); x = I128(BANE, BANE); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(BANE, -1ul); x <<= 0; ASSERT128(I128(BANE, -1ul), x); x = I128(BANE, -1ul); x <<= 1; ASSERT128(I128(1, 0xfffffffffffffffe), x); x = I128(BANE, -1ul); x <<= 126; ASSERT128(I128(0xc000000000000000, 0), x); x = I128(BANE, -1ul); x <<= 127; ASSERT128(I128(BANE, 0), x); x = I128(-1ul, 0); x <<= 0; ASSERT128(I128(-1ul, 0), x); x = I128(-1ul, 0); x <<= 1; ASSERT128(I128(0xfffffffffffffffe, 0), x); x = I128(-1ul, 0); x <<= 126; ASSERT128(I128(0, 0), x); x = I128(-1ul, 0); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(-1ul, 2); x <<= 0; ASSERT128(I128(-1ul, 2), x); x = I128(-1ul, 2); x <<= 1; ASSERT128(I128(0xfffffffffffffffe, 4), x); x = I128(-1ul, 2); x <<= 126; ASSERT128(I128(BANE, 0), x); x = I128(-1ul, 2); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(-1ul, BANE); x <<= 0; ASSERT128(I128(-1ul, BANE), x); x = I128(-1ul, BANE); x <<= 1; ASSERT128(I128(-1ul, 0), x); x = I128(-1ul, BANE); x <<= 126; ASSERT128(I128(0, 0), x); x = I128(-1ul, BANE); x <<= 127; ASSERT128(I128(0, 0), x); x = I128(-1ul, -1ul); x <<= 0; ASSERT128(I128(-1ul, -1ul), x); x = I128(-1ul, -1ul); x <<= 1; ASSERT128(I128(-1ul, 0xfffffffffffffffe), x); x = I128(-1ul, -1ul); x <<= 126; ASSERT128(I128(0xc000000000000000, 0), x); x = I128(-1ul, -1ul); x <<= 127; ASSERT128(I128(BANE, 0), x); } void testNeg128(void) { __int128 x; x = I128(0, 0); ASSERT128(I128(0, 0), -x); x = I128(0, 2); ASSERT128(I128(-1ul, 0xfffffffffffffffe), -x); x = I128(0, BANE); ASSERT128(I128(-1ul, BANE), -x); x = I128(0, -1ul); ASSERT128(I128(-1ul, 1), -x); x = I128(2, 0); ASSERT128(I128(0xfffffffffffffffe, 0), -x); x = I128(2, 2); ASSERT128(I128(IMAX2, 0xfffffffffffffffe), -x); x = I128(2, BANE); ASSERT128(I128(IMAX2, BANE), -x); x = I128(2, -1ul); ASSERT128(I128(IMAX2, 1), -x); x = I128(BANE, 0); ASSERT128(I128(BANE, 0), -x); x = I128(BANE, 2); ASSERT128(I128(IMAX, 0xfffffffffffffffe), -x); x = I128(BANE, BANE); ASSERT128(I128(IMAX, BANE), -x); x = I128(BANE, -1ul); ASSERT128(I128(IMAX, 1), -x); x = I128(-1ul, 0); ASSERT128(I128(1, 0), -x); x = I128(-1ul, 2); ASSERT128(I128(0, 0xfffffffffffffffe), -x); x = I128(-1ul, BANE); ASSERT128(I128(0, BANE), -x); x = I128(-1ul, -1ul); ASSERT128(I128(0, 1), -x); } void testXor128(void) { __int128 x, y; x = I128(0, 0); y = I128(0, 2); ASSERT128(I128(0, 2), x ^ y); x = I128(0, 0); y = I128(0, BANE); ASSERT128(I128(0, BANE), x ^ y); x = I128(0, 0); y = I128(0, -1ul); ASSERT128(I128(0, -1ul), x ^ y); x = I128(0, 0); y = I128(2, 0); ASSERT128(I128(2, 0), x ^ y); x = I128(0, 0); y = I128(2, 2); ASSERT128(I128(2, 2), x ^ y); x = I128(0, 0); y = I128(2, BANE); ASSERT128(I128(2, BANE), x ^ y); x = I128(0, 0); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x ^ y); x = I128(0, 0); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x ^ y); x = I128(0, 0); y = I128(BANE, 2); ASSERT128(I128(BANE, 2), x ^ y); x = I128(0, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE), x ^ y); x = I128(0, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x ^ y); x = I128(0, 0); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0), x ^ y); x = I128(0, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x ^ y); x = I128(0, 0); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x ^ y); x = I128(0, 0); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x ^ y); x = I128(0, 2); y = I128(0, 2); ASSERT128(I128(0, 0), x ^ y); x = I128(0, 2); y = I128(0, BANE); ASSERT128(I128(0, BANE2), x ^ y); x = I128(0, 2); y = I128(0, -1ul); ASSERT128(I128(0, IMAX2), x ^ y); x = I128(0, 2); y = I128(2, 0); ASSERT128(I128(2, 2), x ^ y); x = I128(0, 2); y = I128(2, 2); ASSERT128(I128(2, 0), x ^ y); x = I128(0, 2); y = I128(2, BANE); ASSERT128(I128(2, BANE2), x ^ y); x = I128(0, 2); y = I128(2, -1ul); ASSERT128(I128(2, IMAX2), x ^ y); x = I128(0, 2); y = I128(BANE, 0); ASSERT128(I128(BANE, 2), x ^ y); x = I128(0, 2); y = I128(BANE, 2); ASSERT128(I128(BANE, 0), x ^ y); x = I128(0, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE2), x ^ y); x = I128(0, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE, IMAX2), x ^ y); x = I128(0, 2); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 2), x ^ y); x = I128(0, 2); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 0), x ^ y); x = I128(0, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE2), x ^ y); x = I128(0, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, IMAX2), x ^ y); x = I128(0, BANE); y = I128(0, 2); ASSERT128(I128(0, BANE2), x ^ y); x = I128(0, BANE); y = I128(0, BANE); ASSERT128(I128(0, 0), x ^ y); x = I128(0, BANE); y = I128(0, -1ul); ASSERT128(I128(0, IMAX), x ^ y); x = I128(0, BANE); y = I128(2, 0); ASSERT128(I128(2, BANE), x ^ y); x = I128(0, BANE); y = I128(2, 2); ASSERT128(I128(2, BANE2), x ^ y); x = I128(0, BANE); y = I128(2, BANE); ASSERT128(I128(2, 0), x ^ y); x = I128(0, BANE); y = I128(2, -1ul); ASSERT128(I128(2, IMAX), x ^ y); x = I128(0, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE, BANE), x ^ y); x = I128(0, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE, BANE2), x ^ y); x = I128(0, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE, 0), x ^ y); x = I128(0, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE, IMAX), x ^ y); x = I128(0, BANE); y = I128(-1ul, 0); ASSERT128(I128(-1ul, BANE), x ^ y); x = I128(0, BANE); y = I128(-1ul, 2); ASSERT128(I128(-1ul, BANE2), x ^ y); x = I128(0, BANE); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0), x ^ y); x = I128(0, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, IMAX), x ^ y); x = I128(0, -1ul); y = I128(0, 2); ASSERT128(I128(0, IMAX2), x ^ y); x = I128(0, -1ul); y = I128(0, BANE); ASSERT128(I128(0, IMAX), x ^ y); x = I128(0, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, 0), x ^ y); x = I128(0, -1ul); y = I128(2, 0); ASSERT128(I128(2, -1ul), x ^ y); x = I128(0, -1ul); y = I128(2, 2); ASSERT128(I128(2, IMAX2), x ^ y); x = I128(0, -1ul); y = I128(2, BANE); ASSERT128(I128(2, IMAX), x ^ y); x = I128(0, -1ul); y = I128(2, -1ul); ASSERT128(I128(2, 0), x ^ y); x = I128(0, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, -1ul), x ^ y); x = I128(0, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE, IMAX2), x ^ y); x = I128(0, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE, IMAX), x ^ y); x = I128(0, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 0), x ^ y); x = I128(0, -1ul); y = I128(-1ul, 0); ASSERT128(I128(-1ul, -1ul), x ^ y); x = I128(0, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, IMAX2), x ^ y); x = I128(0, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, IMAX), x ^ y); x = I128(0, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 0), x ^ y); x = I128(2, 0); y = I128(0, 2); ASSERT128(I128(2, 2), x ^ y); x = I128(2, 0); y = I128(0, BANE); ASSERT128(I128(2, BANE), x ^ y); x = I128(2, 0); y = I128(0, -1ul); ASSERT128(I128(2, -1ul), x ^ y); x = I128(2, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x ^ y); x = I128(2, 0); y = I128(2, 2); ASSERT128(I128(0, 2), x ^ y); x = I128(2, 0); y = I128(2, BANE); ASSERT128(I128(0, BANE), x ^ y); x = I128(2, 0); y = I128(2, -1ul); ASSERT128(I128(0, -1ul), x ^ y); x = I128(2, 0); y = I128(BANE, 0); ASSERT128(I128(BANE2, 0), x ^ y); x = I128(2, 0); y = I128(BANE, 2); ASSERT128(I128(BANE2, 2), x ^ y); x = I128(2, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE2, BANE), x ^ y); x = I128(2, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE2, -1ul), x ^ y); x = I128(2, 0); y = I128(-1ul, 0); ASSERT128(I128(IMAX2, 0), x ^ y); x = I128(2, 0); y = I128(-1ul, 2); ASSERT128(I128(IMAX2, 2), x ^ y); x = I128(2, 0); y = I128(-1ul, BANE); ASSERT128(I128(IMAX2, BANE), x ^ y); x = I128(2, 0); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX2, -1ul), x ^ y); x = I128(2, 2); y = I128(0, 2); ASSERT128(I128(2, 0), x ^ y); x = I128(2, 2); y = I128(0, BANE); ASSERT128(I128(2, BANE2), x ^ y); x = I128(2, 2); y = I128(0, -1ul); ASSERT128(I128(2, IMAX2), x ^ y); x = I128(2, 2); y = I128(2, 0); ASSERT128(I128(0, 2), x ^ y); x = I128(2, 2); y = I128(2, 2); ASSERT128(I128(0, 0), x ^ y); x = I128(2, 2); y = I128(2, BANE); ASSERT128(I128(0, BANE2), x ^ y); x = I128(2, 2); y = I128(2, -1ul); ASSERT128(I128(0, IMAX2), x ^ y); x = I128(2, 2); y = I128(BANE, 0); ASSERT128(I128(BANE2, 2), x ^ y); x = I128(2, 2); y = I128(BANE, 2); ASSERT128(I128(BANE2, 0), x ^ y); x = I128(2, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE2, BANE2), x ^ y); x = I128(2, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE2, IMAX2), x ^ y); x = I128(2, 2); y = I128(-1ul, 0); ASSERT128(I128(IMAX2, 2), x ^ y); x = I128(2, 2); y = I128(-1ul, 2); ASSERT128(I128(IMAX2, 0), x ^ y); x = I128(2, 2); y = I128(-1ul, BANE); ASSERT128(I128(IMAX2, BANE2), x ^ y); x = I128(2, 2); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX2, IMAX2), x ^ y); x = I128(2, BANE); y = I128(0, 2); ASSERT128(I128(2, BANE2), x ^ y); x = I128(2, BANE); y = I128(0, BANE); ASSERT128(I128(2, 0), x ^ y); x = I128(2, BANE); y = I128(0, -1ul); ASSERT128(I128(2, IMAX), x ^ y); x = I128(2, BANE); y = I128(2, 0); ASSERT128(I128(0, BANE), x ^ y); x = I128(2, BANE); y = I128(2, 2); ASSERT128(I128(0, BANE2), x ^ y); x = I128(2, BANE); y = I128(2, BANE); ASSERT128(I128(0, 0), x ^ y); x = I128(2, BANE); y = I128(2, -1ul); ASSERT128(I128(0, IMAX), x ^ y); x = I128(2, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE2, BANE), x ^ y); x = I128(2, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE2, BANE2), x ^ y); x = I128(2, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE2, 0), x ^ y); x = I128(2, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE2, IMAX), x ^ y); x = I128(2, BANE); y = I128(-1ul, 0); ASSERT128(I128(IMAX2, BANE), x ^ y); x = I128(2, BANE); y = I128(-1ul, 2); ASSERT128(I128(IMAX2, BANE2), x ^ y); x = I128(2, BANE); y = I128(-1ul, BANE); ASSERT128(I128(IMAX2, 0), x ^ y); x = I128(2, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX2, IMAX), x ^ y); x = I128(2, -1ul); y = I128(0, 2); ASSERT128(I128(2, IMAX2), x ^ y); x = I128(2, -1ul); y = I128(0, BANE); ASSERT128(I128(2, IMAX), x ^ y); x = I128(2, -1ul); y = I128(0, -1ul); ASSERT128(I128(2, 0), x ^ y); x = I128(2, -1ul); y = I128(2, 0); ASSERT128(I128(0, -1ul), x ^ y); x = I128(2, -1ul); y = I128(2, 2); ASSERT128(I128(0, IMAX2), x ^ y); x = I128(2, -1ul); y = I128(2, BANE); ASSERT128(I128(0, IMAX), x ^ y); x = I128(2, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, 0), x ^ y); x = I128(2, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE2, -1ul), x ^ y); x = I128(2, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE2, IMAX2), x ^ y); x = I128(2, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE2, IMAX), x ^ y); x = I128(2, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE2, 0), x ^ y); x = I128(2, -1ul); y = I128(-1ul, 0); ASSERT128(I128(IMAX2, -1ul), x ^ y); x = I128(2, -1ul); y = I128(-1ul, 2); ASSERT128(I128(IMAX2, IMAX2), x ^ y); x = I128(2, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(IMAX2, IMAX), x ^ y); x = I128(2, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX2, 0), x ^ y); x = I128(BANE, 0); y = I128(0, 2); ASSERT128(I128(BANE, 2), x ^ y); x = I128(BANE, 0); y = I128(0, BANE); ASSERT128(I128(BANE, BANE), x ^ y); x = I128(BANE, 0); y = I128(0, -1ul); ASSERT128(I128(BANE, -1ul), x ^ y); x = I128(BANE, 0); y = I128(2, 0); ASSERT128(I128(BANE2, 0), x ^ y); x = I128(BANE, 0); y = I128(2, 2); ASSERT128(I128(BANE2, 2), x ^ y); x = I128(BANE, 0); y = I128(2, BANE); ASSERT128(I128(BANE2, BANE), x ^ y); x = I128(BANE, 0); y = I128(2, -1ul); ASSERT128(I128(BANE2, -1ul), x ^ y); x = I128(BANE, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x ^ y); x = I128(BANE, 0); y = I128(BANE, 2); ASSERT128(I128(0, 2), x ^ y); x = I128(BANE, 0); y = I128(BANE, BANE); ASSERT128(I128(0, BANE), x ^ y); x = I128(BANE, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, -1ul), x ^ y); x = I128(BANE, 0); y = I128(-1ul, 0); ASSERT128(I128(IMAX, 0), x ^ y); x = I128(BANE, 0); y = I128(-1ul, 2); ASSERT128(I128(IMAX, 2), x ^ y); x = I128(BANE, 0); y = I128(-1ul, BANE); ASSERT128(I128(IMAX, BANE), x ^ y); x = I128(BANE, 2); y = I128(0, 2); ASSERT128(I128(BANE, 0), x ^ y); x = I128(BANE, 2); y = I128(0, BANE); ASSERT128(I128(BANE, BANE2), x ^ y); x = I128(BANE, 2); y = I128(0, -1ul); ASSERT128(I128(BANE, IMAX2), x ^ y); x = I128(BANE, 2); y = I128(2, 0); ASSERT128(I128(BANE2, 2), x ^ y); x = I128(BANE, 2); y = I128(2, 2); ASSERT128(I128(BANE2, 0), x ^ y); x = I128(BANE, 2); y = I128(2, BANE); ASSERT128(I128(BANE2, BANE2), x ^ y); x = I128(BANE, 2); y = I128(2, -1ul); ASSERT128(I128(BANE2, IMAX2), x ^ y); x = I128(BANE, 2); y = I128(BANE, 0); ASSERT128(I128(0, 2), x ^ y); x = I128(BANE, 2); y = I128(BANE, 2); ASSERT128(I128(0, 0), x ^ y); x = I128(BANE, 2); y = I128(BANE, BANE); ASSERT128(I128(0, BANE2), x ^ y); x = I128(BANE, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, IMAX2), x ^ y); x = I128(BANE, 2); y = I128(-1ul, 0); ASSERT128(I128(IMAX, 2), x ^ y); x = I128(BANE, 2); y = I128(-1ul, 2); ASSERT128(I128(IMAX, 0), x ^ y); x = I128(BANE, 2); y = I128(-1ul, BANE); ASSERT128(I128(IMAX, BANE2), x ^ y); x = I128(BANE, 2); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX, IMAX2), x ^ y); x = I128(BANE, BANE); y = I128(0, 2); ASSERT128(I128(BANE, BANE2), x ^ y); x = I128(BANE, BANE); y = I128(0, BANE); ASSERT128(I128(BANE, 0), x ^ y); x = I128(BANE, BANE); y = I128(0, -1ul); ASSERT128(I128(BANE, IMAX), x ^ y); x = I128(BANE, BANE); y = I128(2, 0); ASSERT128(I128(BANE2, BANE), x ^ y); x = I128(BANE, BANE); y = I128(2, 2); ASSERT128(I128(BANE2, BANE2), x ^ y); x = I128(BANE, BANE); y = I128(2, BANE); ASSERT128(I128(BANE2, 0), x ^ y); x = I128(BANE, BANE); y = I128(2, -1ul); ASSERT128(I128(BANE2, IMAX), x ^ y); x = I128(BANE, BANE); y = I128(BANE, 0); ASSERT128(I128(0, BANE), x ^ y); x = I128(BANE, BANE); y = I128(BANE, 2); ASSERT128(I128(0, BANE2), x ^ y); x = I128(BANE, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x ^ y); x = I128(BANE, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, IMAX), x ^ y); x = I128(BANE, BANE); y = I128(-1ul, 0); ASSERT128(I128(IMAX, BANE), x ^ y); x = I128(BANE, BANE); y = I128(-1ul, 2); ASSERT128(I128(IMAX, BANE2), x ^ y); x = I128(BANE, BANE); y = I128(-1ul, BANE); ASSERT128(I128(IMAX, 0), x ^ y); x = I128(BANE, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX, IMAX), x ^ y); x = I128(BANE, -1ul); y = I128(0, 2); ASSERT128(I128(BANE, IMAX2), x ^ y); x = I128(BANE, -1ul); y = I128(0, BANE); ASSERT128(I128(BANE, IMAX), x ^ y); x = I128(BANE, -1ul); y = I128(0, -1ul); ASSERT128(I128(BANE, 0), x ^ y); x = I128(BANE, -1ul); y = I128(2, 0); ASSERT128(I128(BANE2, -1ul), x ^ y); x = I128(BANE, -1ul); y = I128(2, 2); ASSERT128(I128(BANE2, IMAX2), x ^ y); x = I128(BANE, -1ul); y = I128(2, BANE); ASSERT128(I128(BANE2, IMAX), x ^ y); x = I128(BANE, -1ul); y = I128(2, -1ul); ASSERT128(I128(BANE2, 0), x ^ y); x = I128(BANE, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, -1ul), x ^ y); x = I128(BANE, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, IMAX2), x ^ y); x = I128(BANE, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, IMAX), x ^ y); x = I128(BANE, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x ^ y); x = I128(BANE, -1ul); y = I128(-1ul, 0); ASSERT128(I128(IMAX, -1ul), x ^ y); x = I128(BANE, -1ul); y = I128(-1ul, 2); ASSERT128(I128(IMAX, IMAX2), x ^ y); x = I128(BANE, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(IMAX, IMAX), x ^ y); x = I128(BANE, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(IMAX, 0), x ^ y); x = I128(-1ul, 0); y = I128(0, 2); ASSERT128(I128(-1ul, 2), x ^ y); x = I128(-1ul, 0); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE), x ^ y); x = I128(-1ul, 0); y = I128(0, -1ul); ASSERT128(I128(-1ul, -1ul), x ^ y); x = I128(-1ul, 0); y = I128(2, 0); ASSERT128(I128(IMAX2, 0), x ^ y); x = I128(-1ul, 0); y = I128(2, 2); ASSERT128(I128(IMAX2, 2), x ^ y); x = I128(-1ul, 0); y = I128(2, BANE); ASSERT128(I128(IMAX2, BANE), x ^ y); x = I128(-1ul, 0); y = I128(2, -1ul); ASSERT128(I128(IMAX2, -1ul), x ^ y); x = I128(-1ul, 0); y = I128(BANE, 0); ASSERT128(I128(IMAX, 0), x ^ y); x = I128(-1ul, 0); y = I128(BANE, 2); ASSERT128(I128(IMAX, 2), x ^ y); x = I128(-1ul, 0); y = I128(BANE, BANE); ASSERT128(I128(IMAX, BANE), x ^ y); x = I128(-1ul, 0); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, -1ul), x ^ y); x = I128(-1ul, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x ^ y); x = I128(-1ul, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 2), x ^ y); x = I128(-1ul, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, BANE), x ^ y); x = I128(-1ul, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, -1ul), x ^ y); x = I128(-1ul, 2); y = I128(0, 2); ASSERT128(I128(-1ul, 0), x ^ y); x = I128(-1ul, 2); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE2), x ^ y); x = I128(-1ul, 2); y = I128(0, -1ul); ASSERT128(I128(-1ul, IMAX2), x ^ y); x = I128(-1ul, 2); y = I128(2, 0); ASSERT128(I128(IMAX2, 2), x ^ y); x = I128(-1ul, 2); y = I128(2, 2); ASSERT128(I128(IMAX2, 0), x ^ y); x = I128(-1ul, 2); y = I128(2, BANE); ASSERT128(I128(IMAX2, BANE2), x ^ y); x = I128(-1ul, 2); y = I128(2, -1ul); ASSERT128(I128(IMAX2, IMAX2), x ^ y); x = I128(-1ul, 2); y = I128(BANE, 0); ASSERT128(I128(IMAX, 2), x ^ y); x = I128(-1ul, 2); y = I128(BANE, 2); ASSERT128(I128(IMAX, 0), x ^ y); x = I128(-1ul, 2); y = I128(BANE, BANE); ASSERT128(I128(IMAX, BANE2), x ^ y); x = I128(-1ul, 2); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, IMAX2), x ^ y); x = I128(-1ul, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 2), x ^ y); x = I128(-1ul, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x ^ y); x = I128(-1ul, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, BANE2), x ^ y); x = I128(-1ul, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, IMAX2), x ^ y); x = I128(-1ul, BANE); y = I128(0, 2); ASSERT128(I128(-1ul, BANE2), x ^ y); x = I128(-1ul, BANE); y = I128(0, BANE); ASSERT128(I128(-1ul, 0), x ^ y); x = I128(-1ul, BANE); y = I128(0, -1ul); ASSERT128(I128(-1ul, IMAX), x ^ y); x = I128(-1ul, BANE); y = I128(2, 0); ASSERT128(I128(IMAX2, BANE), x ^ y); x = I128(-1ul, BANE); y = I128(2, 2); ASSERT128(I128(IMAX2, BANE2), x ^ y); x = I128(-1ul, BANE); y = I128(2, BANE); ASSERT128(I128(IMAX2, 0), x ^ y); x = I128(-1ul, BANE); y = I128(2, -1ul); ASSERT128(I128(IMAX2, IMAX), x ^ y); x = I128(-1ul, BANE); y = I128(BANE, 0); ASSERT128(I128(IMAX, BANE), x ^ y); x = I128(-1ul, BANE); y = I128(BANE, 2); ASSERT128(I128(IMAX, BANE2), x ^ y); x = I128(-1ul, BANE); y = I128(BANE, BANE); ASSERT128(I128(IMAX, 0), x ^ y); x = I128(-1ul, BANE); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, IMAX), x ^ y); x = I128(-1ul, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, BANE), x ^ y); x = I128(-1ul, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, BANE2), x ^ y); x = I128(-1ul, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x ^ y); x = I128(-1ul, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, IMAX), x ^ y); x = I128(-1ul, -1ul); y = I128(0, 2); ASSERT128(I128(-1ul, IMAX2), x ^ y); x = I128(-1ul, -1ul); y = I128(0, BANE); ASSERT128(I128(-1ul, IMAX), x ^ y); x = I128(-1ul, -1ul); y = I128(0, -1ul); ASSERT128(I128(-1ul, 0), x ^ y); x = I128(-1ul, -1ul); y = I128(2, 0); ASSERT128(I128(IMAX2, -1ul), x ^ y); x = I128(-1ul, -1ul); y = I128(2, 2); ASSERT128(I128(IMAX2, IMAX2), x ^ y); x = I128(-1ul, -1ul); y = I128(2, BANE); ASSERT128(I128(IMAX2, IMAX), x ^ y); x = I128(-1ul, -1ul); y = I128(2, -1ul); ASSERT128(I128(IMAX2, 0), x ^ y); x = I128(-1ul, -1ul); y = I128(BANE, 0); ASSERT128(I128(IMAX, -1ul), x ^ y); x = I128(-1ul, -1ul); y = I128(BANE, 2); ASSERT128(I128(IMAX, IMAX2), x ^ y); x = I128(-1ul, -1ul); y = I128(BANE, BANE); ASSERT128(I128(IMAX, IMAX), x ^ y); x = I128(-1ul, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(IMAX, 0), x ^ y); x = I128(-1ul, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, -1ul), x ^ y); x = I128(-1ul, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, IMAX2), x ^ y); x = I128(-1ul, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, IMAX), x ^ y); x = I128(-1ul, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x ^ y); } void testAnd128(void) { __int128 x, y; x = I128(0, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(0, -1ul); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x & y); x = I128(0, 0); y = I128(-1ul, -1ul); ASSERT128(I128(0, 0), x & y); x = I128(0, 2); y = I128(0, 2); ASSERT128(I128(0, 2), x & y); x = I128(0, 2); y = I128(0, BANE); ASSERT128(I128(0, 0), x & y); x = I128(0, 2); y = I128(0, -1ul); ASSERT128(I128(0, 2), x & y); x = I128(0, 2); y = I128(2, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, 2); y = I128(2, 2); ASSERT128(I128(0, 2), x & y); x = I128(0, 2); y = I128(2, BANE); ASSERT128(I128(0, 0), x & y); x = I128(0, 2); y = I128(2, -1ul); ASSERT128(I128(0, 2), x & y); x = I128(0, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, 2); y = I128(BANE, 2); ASSERT128(I128(0, 2), x & y); x = I128(0, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x & y); x = I128(0, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 2), x & y); x = I128(0, 2); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, 2); y = I128(-1ul, 2); ASSERT128(I128(0, 2), x & y); x = I128(0, 2); y = I128(-1ul, BANE); ASSERT128(I128(0, 0), x & y); x = I128(0, 2); y = I128(-1ul, -1ul); ASSERT128(I128(0, 2), x & y); x = I128(0, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x & y); x = I128(0, BANE); y = I128(0, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(0, BANE); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x & y); x = I128(0, BANE); y = I128(2, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, BANE); y = I128(2, 2); ASSERT128(I128(0, 0), x & y); x = I128(0, BANE); y = I128(2, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(0, BANE); y = I128(2, -1ul); ASSERT128(I128(0, BANE), x & y); x = I128(0, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 0), x & y); x = I128(0, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(0, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, BANE), x & y); x = I128(0, BANE); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, BANE); y = I128(-1ul, 2); ASSERT128(I128(0, 0), x & y); x = I128(0, BANE); y = I128(-1ul, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(0, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(0, BANE), x & y); x = I128(0, -1ul); y = I128(0, 2); ASSERT128(I128(0, 2), x & y); x = I128(0, -1ul); y = I128(0, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(0, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, -1ul), x & y); x = I128(0, -1ul); y = I128(2, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, -1ul); y = I128(2, 2); ASSERT128(I128(0, 2), x & y); x = I128(0, -1ul); y = I128(2, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(0, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, -1ul), x & y); x = I128(0, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, 2), x & y); x = I128(0, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(0, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, -1ul), x & y); x = I128(0, -1ul); y = I128(-1ul, 0); ASSERT128(I128(0, 0), x & y); x = I128(0, -1ul); y = I128(-1ul, 2); ASSERT128(I128(0, 2), x & y); x = I128(0, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(0, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(0, -1ul), x & y); x = I128(2, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x & y); x = I128(2, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x & y); x = I128(2, 0); y = I128(0, -1ul); ASSERT128(I128(0, 0), x & y); x = I128(2, 0); y = I128(2, 0); ASSERT128(I128(2, 0), x & y); x = I128(2, 0); y = I128(2, 2); ASSERT128(I128(2, 0), x & y); x = I128(2, 0); y = I128(2, BANE); ASSERT128(I128(2, 0), x & y); x = I128(2, 0); y = I128(2, -1ul); ASSERT128(I128(2, 0), x & y); x = I128(2, 0); y = I128(BANE, 0); ASSERT128(I128(0, 0), x & y); x = I128(2, 0); y = I128(BANE, 2); ASSERT128(I128(0, 0), x & y); x = I128(2, 0); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x & y); x = I128(2, 0); y = I128(BANE, -1ul); ASSERT128(I128(0, 0), x & y); x = I128(2, 0); y = I128(-1ul, 0); ASSERT128(I128(2, 0), x & y); x = I128(2, 0); y = I128(-1ul, 2); ASSERT128(I128(2, 0), x & y); x = I128(2, 0); y = I128(-1ul, BANE); ASSERT128(I128(2, 0), x & y); x = I128(2, 0); y = I128(-1ul, -1ul); ASSERT128(I128(2, 0), x & y); x = I128(2, 2); y = I128(0, 2); ASSERT128(I128(0, 2), x & y); x = I128(2, 2); y = I128(0, BANE); ASSERT128(I128(0, 0), x & y); x = I128(2, 2); y = I128(0, -1ul); ASSERT128(I128(0, 2), x & y); x = I128(2, 2); y = I128(2, 0); ASSERT128(I128(2, 0), x & y); x = I128(2, 2); y = I128(2, 2); ASSERT128(I128(2, 2), x & y); x = I128(2, 2); y = I128(2, BANE); ASSERT128(I128(2, 0), x & y); x = I128(2, 2); y = I128(2, -1ul); ASSERT128(I128(2, 2), x & y); x = I128(2, 2); y = I128(BANE, 0); ASSERT128(I128(0, 0), x & y); x = I128(2, 2); y = I128(BANE, 2); ASSERT128(I128(0, 2), x & y); x = I128(2, 2); y = I128(BANE, BANE); ASSERT128(I128(0, 0), x & y); x = I128(2, 2); y = I128(BANE, -1ul); ASSERT128(I128(0, 2), x & y); x = I128(2, 2); y = I128(-1ul, 0); ASSERT128(I128(2, 0), x & y); x = I128(2, 2); y = I128(-1ul, 2); ASSERT128(I128(2, 2), x & y); x = I128(2, 2); y = I128(-1ul, BANE); ASSERT128(I128(2, 0), x & y); x = I128(2, 2); y = I128(-1ul, -1ul); ASSERT128(I128(2, 2), x & y); x = I128(2, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x & y); x = I128(2, BANE); y = I128(0, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(2, BANE); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x & y); x = I128(2, BANE); y = I128(2, 0); ASSERT128(I128(2, 0), x & y); x = I128(2, BANE); y = I128(2, 2); ASSERT128(I128(2, 0), x & y); x = I128(2, BANE); y = I128(2, BANE); ASSERT128(I128(2, BANE), x & y); x = I128(2, BANE); y = I128(2, -1ul); ASSERT128(I128(2, BANE), x & y); x = I128(2, BANE); y = I128(BANE, 0); ASSERT128(I128(0, 0), x & y); x = I128(2, BANE); y = I128(BANE, 2); ASSERT128(I128(0, 0), x & y); x = I128(2, BANE); y = I128(BANE, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(2, BANE); y = I128(BANE, -1ul); ASSERT128(I128(0, BANE), x & y); x = I128(2, BANE); y = I128(-1ul, 0); ASSERT128(I128(2, 0), x & y); x = I128(2, BANE); y = I128(-1ul, 2); ASSERT128(I128(2, 0), x & y); x = I128(2, BANE); y = I128(-1ul, BANE); ASSERT128(I128(2, BANE), x & y); x = I128(2, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(2, BANE), x & y); x = I128(2, -1ul); y = I128(0, 2); ASSERT128(I128(0, 2), x & y); x = I128(2, -1ul); y = I128(0, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(2, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, -1ul), x & y); x = I128(2, -1ul); y = I128(2, 0); ASSERT128(I128(2, 0), x & y); x = I128(2, -1ul); y = I128(2, 2); ASSERT128(I128(2, 2), x & y); x = I128(2, -1ul); y = I128(2, BANE); ASSERT128(I128(2, BANE), x & y); x = I128(2, -1ul); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x & y); x = I128(2, -1ul); y = I128(BANE, 0); ASSERT128(I128(0, 0), x & y); x = I128(2, -1ul); y = I128(BANE, 2); ASSERT128(I128(0, 2), x & y); x = I128(2, -1ul); y = I128(BANE, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(2, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(0, -1ul), x & y); x = I128(2, -1ul); y = I128(-1ul, 0); ASSERT128(I128(2, 0), x & y); x = I128(2, -1ul); y = I128(-1ul, 2); ASSERT128(I128(2, 2), x & y); x = I128(2, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(2, BANE), x & y); x = I128(2, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(2, -1ul), x & y); x = I128(BANE, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x & y); x = I128(BANE, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x & y); x = I128(BANE, 0); y = I128(0, -1ul); ASSERT128(I128(0, 0), x & y); x = I128(BANE, 0); y = I128(2, 0); ASSERT128(I128(0, 0), x & y); x = I128(BANE, 0); y = I128(2, 2); ASSERT128(I128(0, 0), x & y); x = I128(BANE, 0); y = I128(2, BANE); ASSERT128(I128(0, 0), x & y); x = I128(BANE, 0); y = I128(2, -1ul); ASSERT128(I128(0, 0), x & y); x = I128(BANE, 0); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 0); y = I128(BANE, 2); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 0); y = I128(-1ul, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 0); y = I128(-1ul, 2); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 0); y = I128(-1ul, BANE); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 2); y = I128(0, 2); ASSERT128(I128(0, 2), x & y); x = I128(BANE, 2); y = I128(0, BANE); ASSERT128(I128(0, 0), x & y); x = I128(BANE, 2); y = I128(0, -1ul); ASSERT128(I128(0, 2), x & y); x = I128(BANE, 2); y = I128(2, 0); ASSERT128(I128(0, 0), x & y); x = I128(BANE, 2); y = I128(2, 2); ASSERT128(I128(0, 2), x & y); x = I128(BANE, 2); y = I128(2, BANE); ASSERT128(I128(0, 0), x & y); x = I128(BANE, 2); y = I128(2, -1ul); ASSERT128(I128(0, 2), x & y); x = I128(BANE, 2); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 2); y = I128(BANE, 2); ASSERT128(I128(BANE, 2), x & y); x = I128(BANE, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 2), x & y); x = I128(BANE, 2); y = I128(-1ul, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 2); y = I128(-1ul, 2); ASSERT128(I128(BANE, 2), x & y); x = I128(BANE, 2); y = I128(-1ul, BANE); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, 2); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, 2), x & y); x = I128(BANE, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x & y); x = I128(BANE, BANE); y = I128(0, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(BANE, BANE); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x & y); x = I128(BANE, BANE); y = I128(2, 0); ASSERT128(I128(0, 0), x & y); x = I128(BANE, BANE); y = I128(2, 2); ASSERT128(I128(0, 0), x & y); x = I128(BANE, BANE); y = I128(2, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(BANE, BANE); y = I128(2, -1ul); ASSERT128(I128(0, BANE), x & y); x = I128(BANE, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE), x & y); x = I128(BANE, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE, BANE), x & y); x = I128(BANE, BANE); y = I128(-1ul, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, BANE); y = I128(-1ul, 2); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, BANE); y = I128(-1ul, BANE); ASSERT128(I128(BANE, BANE), x & y); x = I128(BANE, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, BANE), x & y); x = I128(BANE, -1ul); y = I128(0, 2); ASSERT128(I128(0, 2), x & y); x = I128(BANE, -1ul); y = I128(0, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(BANE, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, -1ul), x & y); x = I128(BANE, -1ul); y = I128(2, 0); ASSERT128(I128(0, 0), x & y); x = I128(BANE, -1ul); y = I128(2, 2); ASSERT128(I128(0, 2), x & y); x = I128(BANE, -1ul); y = I128(2, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(BANE, -1ul); y = I128(2, -1ul); ASSERT128(I128(0, -1ul), x & y); x = I128(BANE, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE, 2), x & y); x = I128(BANE, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE), x & y); x = I128(BANE, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x & y); x = I128(BANE, -1ul); y = I128(-1ul, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(BANE, -1ul); y = I128(-1ul, 2); ASSERT128(I128(BANE, 2), x & y); x = I128(BANE, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(BANE, BANE), x & y); x = I128(BANE, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(BANE, -1ul), x & y); x = I128(-1ul, 0); y = I128(0, 2); ASSERT128(I128(0, 0), x & y); x = I128(-1ul, 0); y = I128(0, BANE); ASSERT128(I128(0, 0), x & y); x = I128(-1ul, 0); y = I128(0, -1ul); ASSERT128(I128(0, 0), x & y); x = I128(-1ul, 0); y = I128(2, 0); ASSERT128(I128(2, 0), x & y); x = I128(-1ul, 0); y = I128(2, 2); ASSERT128(I128(2, 0), x & y); x = I128(-1ul, 0); y = I128(2, BANE); ASSERT128(I128(2, 0), x & y); x = I128(-1ul, 0); y = I128(2, -1ul); ASSERT128(I128(2, 0), x & y); x = I128(-1ul, 0); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(-1ul, 0); y = I128(BANE, 2); ASSERT128(I128(BANE, 0), x & y); x = I128(-1ul, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE, 0), x & y); x = I128(-1ul, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 0), x & y); x = I128(-1ul, 0); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0), x & y); x = I128(-1ul, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 0), x & y); x = I128(-1ul, 0); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0), x & y); x = I128(-1ul, 0); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 0), x & y); x = I128(-1ul, 2); y = I128(0, 2); ASSERT128(I128(0, 2), x & y); x = I128(-1ul, 2); y = I128(0, BANE); ASSERT128(I128(0, 0), x & y); x = I128(-1ul, 2); y = I128(0, -1ul); ASSERT128(I128(0, 2), x & y); x = I128(-1ul, 2); y = I128(2, 0); ASSERT128(I128(2, 0), x & y); x = I128(-1ul, 2); y = I128(2, 2); ASSERT128(I128(2, 2), x & y); x = I128(-1ul, 2); y = I128(2, BANE); ASSERT128(I128(2, 0), x & y); x = I128(-1ul, 2); y = I128(2, -1ul); ASSERT128(I128(2, 2), x & y); x = I128(-1ul, 2); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(-1ul, 2); y = I128(BANE, 2); ASSERT128(I128(BANE, 2), x & y); x = I128(-1ul, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE, 0), x & y); x = I128(-1ul, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE, 2), x & y); x = I128(-1ul, 2); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0), x & y); x = I128(-1ul, 2); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x & y); x = I128(-1ul, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, 0), x & y); x = I128(-1ul, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, 2), x & y); x = I128(-1ul, BANE); y = I128(0, 2); ASSERT128(I128(0, 0), x & y); x = I128(-1ul, BANE); y = I128(0, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(-1ul, BANE); y = I128(0, -1ul); ASSERT128(I128(0, BANE), x & y); x = I128(-1ul, BANE); y = I128(2, 0); ASSERT128(I128(2, 0), x & y); x = I128(-1ul, BANE); y = I128(2, 2); ASSERT128(I128(2, 0), x & y); x = I128(-1ul, BANE); y = I128(2, BANE); ASSERT128(I128(2, BANE), x & y); x = I128(-1ul, BANE); y = I128(2, -1ul); ASSERT128(I128(2, BANE), x & y); x = I128(-1ul, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(-1ul, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE, 0), x & y); x = I128(-1ul, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE), x & y); x = I128(-1ul, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE, BANE), x & y); x = I128(-1ul, BANE); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0), x & y); x = I128(-1ul, BANE); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 0), x & y); x = I128(-1ul, BANE); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x & y); x = I128(-1ul, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, BANE), x & y); x = I128(-1ul, -1ul); y = I128(0, 2); ASSERT128(I128(0, 2), x & y); x = I128(-1ul, -1ul); y = I128(0, BANE); ASSERT128(I128(0, BANE), x & y); x = I128(-1ul, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, -1ul), x & y); x = I128(-1ul, -1ul); y = I128(2, 0); ASSERT128(I128(2, 0), x & y); x = I128(-1ul, -1ul); y = I128(2, 2); ASSERT128(I128(2, 2), x & y); x = I128(-1ul, -1ul); y = I128(2, BANE); ASSERT128(I128(2, BANE), x & y); x = I128(-1ul, -1ul); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x & y); x = I128(-1ul, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x & y); x = I128(-1ul, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE, 2), x & y); x = I128(-1ul, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE), x & y); x = I128(-1ul, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x & y); x = I128(-1ul, -1ul); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0), x & y); x = I128(-1ul, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x & y); x = I128(-1ul, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x & y); x = I128(-1ul, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x & y); } void testOr128(void) { __int128 x, y; x = I128(0, 0); y = I128(0, 2); ASSERT128(I128(0, 2), x | y); x = I128(0, 0); y = I128(0, BANE); ASSERT128(I128(0, BANE), x | y); x = I128(0, 0); y = I128(0, -1ul); ASSERT128(I128(0, -1ul), x | y); x = I128(0, 0); y = I128(2, 0); ASSERT128(I128(2, 0), x | y); x = I128(0, 0); y = I128(2, 2); ASSERT128(I128(2, 2), x | y); x = I128(0, 0); y = I128(2, BANE); ASSERT128(I128(2, BANE), x | y); x = I128(0, 0); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(0, 0); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x | y); x = I128(0, 0); y = I128(BANE, 2); ASSERT128(I128(BANE, 2), x | y); x = I128(0, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE), x | y); x = I128(0, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(0, 0); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0), x | y); x = I128(0, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(0, 0); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(0, 0); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(0, 2); y = I128(0, 2); ASSERT128(I128(0, 2), x | y); x = I128(0, 2); y = I128(0, BANE); ASSERT128(I128(0, BANE2), x | y); x = I128(0, 2); y = I128(0, -1ul); ASSERT128(I128(0, -1ul), x | y); x = I128(0, 2); y = I128(2, 0); ASSERT128(I128(2, 2), x | y); x = I128(0, 2); y = I128(2, 2); ASSERT128(I128(2, 2), x | y); x = I128(0, 2); y = I128(2, BANE); ASSERT128(I128(2, BANE2), x | y); x = I128(0, 2); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(0, 2); y = I128(BANE, 0); ASSERT128(I128(BANE, 2), x | y); x = I128(0, 2); y = I128(BANE, 2); ASSERT128(I128(BANE, 2), x | y); x = I128(0, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE2), x | y); x = I128(0, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(0, 2); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 2), x | y); x = I128(0, 2); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(0, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(0, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(0, BANE); y = I128(0, 2); ASSERT128(I128(0, BANE2), x | y); x = I128(0, BANE); y = I128(0, BANE); ASSERT128(I128(0, BANE), x | y); x = I128(0, BANE); y = I128(0, -1ul); ASSERT128(I128(0, -1ul), x | y); x = I128(0, BANE); y = I128(2, 0); ASSERT128(I128(2, BANE), x | y); x = I128(0, BANE); y = I128(2, 2); ASSERT128(I128(2, BANE2), x | y); x = I128(0, BANE); y = I128(2, BANE); ASSERT128(I128(2, BANE), x | y); x = I128(0, BANE); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(0, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE, BANE), x | y); x = I128(0, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE, BANE2), x | y); x = I128(0, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE), x | y); x = I128(0, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(0, BANE); y = I128(-1ul, 0); ASSERT128(I128(-1ul, BANE), x | y); x = I128(0, BANE); y = I128(-1ul, 2); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(0, BANE); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(0, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(0, -1ul); y = I128(0, 2); ASSERT128(I128(0, -1ul), x | y); x = I128(0, -1ul); y = I128(0, BANE); ASSERT128(I128(0, -1ul), x | y); x = I128(0, -1ul); y = I128(0, -1ul); ASSERT128(I128(0, -1ul), x | y); x = I128(0, -1ul); y = I128(2, 0); ASSERT128(I128(2, -1ul), x | y); x = I128(0, -1ul); y = I128(2, 2); ASSERT128(I128(2, -1ul), x | y); x = I128(0, -1ul); y = I128(2, BANE); ASSERT128(I128(2, -1ul), x | y); x = I128(0, -1ul); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(0, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, -1ul), x | y); x = I128(0, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE, -1ul), x | y); x = I128(0, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE, -1ul), x | y); x = I128(0, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(0, -1ul); y = I128(-1ul, 0); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(0, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(0, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(0, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(2, 0); y = I128(0, 2); ASSERT128(I128(2, 2), x | y); x = I128(2, 0); y = I128(0, BANE); ASSERT128(I128(2, BANE), x | y); x = I128(2, 0); y = I128(0, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(2, 0); y = I128(2, 0); ASSERT128(I128(2, 0), x | y); x = I128(2, 0); y = I128(2, 2); ASSERT128(I128(2, 2), x | y); x = I128(2, 0); y = I128(2, BANE); ASSERT128(I128(2, BANE), x | y); x = I128(2, 0); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(2, 0); y = I128(BANE, 0); ASSERT128(I128(BANE2, 0), x | y); x = I128(2, 0); y = I128(BANE, 2); ASSERT128(I128(BANE2, 2), x | y); x = I128(2, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE2, BANE), x | y); x = I128(2, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(2, 0); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0), x | y); x = I128(2, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(2, 0); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(2, 0); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(2, 2); y = I128(0, 2); ASSERT128(I128(2, 2), x | y); x = I128(2, 2); y = I128(0, BANE); ASSERT128(I128(2, BANE2), x | y); x = I128(2, 2); y = I128(0, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(2, 2); y = I128(2, 0); ASSERT128(I128(2, 2), x | y); x = I128(2, 2); y = I128(2, 2); ASSERT128(I128(2, 2), x | y); x = I128(2, 2); y = I128(2, BANE); ASSERT128(I128(2, BANE2), x | y); x = I128(2, 2); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(2, 2); y = I128(BANE, 0); ASSERT128(I128(BANE2, 2), x | y); x = I128(2, 2); y = I128(BANE, 2); ASSERT128(I128(BANE2, 2), x | y); x = I128(2, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE2, BANE2), x | y); x = I128(2, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(2, 2); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 2), x | y); x = I128(2, 2); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(2, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(2, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(2, BANE); y = I128(0, 2); ASSERT128(I128(2, BANE2), x | y); x = I128(2, BANE); y = I128(0, BANE); ASSERT128(I128(2, BANE), x | y); x = I128(2, BANE); y = I128(0, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(2, BANE); y = I128(2, 0); ASSERT128(I128(2, BANE), x | y); x = I128(2, BANE); y = I128(2, 2); ASSERT128(I128(2, BANE2), x | y); x = I128(2, BANE); y = I128(2, BANE); ASSERT128(I128(2, BANE), x | y); x = I128(2, BANE); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(2, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE2, BANE), x | y); x = I128(2, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE2, BANE2), x | y); x = I128(2, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE2, BANE), x | y); x = I128(2, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(2, BANE); y = I128(-1ul, 0); ASSERT128(I128(-1ul, BANE), x | y); x = I128(2, BANE); y = I128(-1ul, 2); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(2, BANE); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(2, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(2, -1ul); y = I128(0, 2); ASSERT128(I128(2, -1ul), x | y); x = I128(2, -1ul); y = I128(0, BANE); ASSERT128(I128(2, -1ul), x | y); x = I128(2, -1ul); y = I128(0, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(2, -1ul); y = I128(2, 0); ASSERT128(I128(2, -1ul), x | y); x = I128(2, -1ul); y = I128(2, 2); ASSERT128(I128(2, -1ul), x | y); x = I128(2, -1ul); y = I128(2, BANE); ASSERT128(I128(2, -1ul), x | y); x = I128(2, -1ul); y = I128(2, -1ul); ASSERT128(I128(2, -1ul), x | y); x = I128(2, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(2, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(2, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(2, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(2, -1ul); y = I128(-1ul, 0); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(2, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(2, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(2, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(BANE, 0); y = I128(0, 2); ASSERT128(I128(BANE, 2), x | y); x = I128(BANE, 0); y = I128(0, BANE); ASSERT128(I128(BANE, BANE), x | y); x = I128(BANE, 0); y = I128(0, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, 0); y = I128(2, 0); ASSERT128(I128(BANE2, 0), x | y); x = I128(BANE, 0); y = I128(2, 2); ASSERT128(I128(BANE2, 2), x | y); x = I128(BANE, 0); y = I128(2, BANE); ASSERT128(I128(BANE2, BANE), x | y); x = I128(BANE, 0); y = I128(2, -1ul); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(BANE, 0); y = I128(BANE, 0); ASSERT128(I128(BANE, 0), x | y); x = I128(BANE, 0); y = I128(BANE, 2); ASSERT128(I128(BANE, 2), x | y); x = I128(BANE, 0); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE), x | y); x = I128(BANE, 0); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, 0); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0), x | y); x = I128(BANE, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(BANE, 0); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(BANE, 2); y = I128(0, 2); ASSERT128(I128(BANE, 2), x | y); x = I128(BANE, 2); y = I128(0, BANE); ASSERT128(I128(BANE, BANE2), x | y); x = I128(BANE, 2); y = I128(0, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, 2); y = I128(2, 0); ASSERT128(I128(BANE2, 2), x | y); x = I128(BANE, 2); y = I128(2, 2); ASSERT128(I128(BANE2, 2), x | y); x = I128(BANE, 2); y = I128(2, BANE); ASSERT128(I128(BANE2, BANE2), x | y); x = I128(BANE, 2); y = I128(2, -1ul); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(BANE, 2); y = I128(BANE, 0); ASSERT128(I128(BANE, 2), x | y); x = I128(BANE, 2); y = I128(BANE, 2); ASSERT128(I128(BANE, 2), x | y); x = I128(BANE, 2); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE2), x | y); x = I128(BANE, 2); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, 2); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 2), x | y); x = I128(BANE, 2); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(BANE, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(BANE, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(BANE, BANE); y = I128(0, 2); ASSERT128(I128(BANE, BANE2), x | y); x = I128(BANE, BANE); y = I128(0, BANE); ASSERT128(I128(BANE, BANE), x | y); x = I128(BANE, BANE); y = I128(0, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, BANE); y = I128(2, 0); ASSERT128(I128(BANE2, BANE), x | y); x = I128(BANE, BANE); y = I128(2, 2); ASSERT128(I128(BANE2, BANE2), x | y); x = I128(BANE, BANE); y = I128(2, BANE); ASSERT128(I128(BANE2, BANE), x | y); x = I128(BANE, BANE); y = I128(2, -1ul); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(BANE, BANE); y = I128(BANE, 0); ASSERT128(I128(BANE, BANE), x | y); x = I128(BANE, BANE); y = I128(BANE, 2); ASSERT128(I128(BANE, BANE2), x | y); x = I128(BANE, BANE); y = I128(BANE, BANE); ASSERT128(I128(BANE, BANE), x | y); x = I128(BANE, BANE); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, BANE); y = I128(-1ul, 0); ASSERT128(I128(-1ul, BANE), x | y); x = I128(BANE, BANE); y = I128(-1ul, 2); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(BANE, BANE); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(BANE, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(BANE, -1ul); y = I128(0, 2); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, -1ul); y = I128(0, BANE); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, -1ul); y = I128(0, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, -1ul); y = I128(2, 0); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(BANE, -1ul); y = I128(2, 2); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(BANE, -1ul); y = I128(2, BANE); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(BANE, -1ul); y = I128(2, -1ul); ASSERT128(I128(BANE2, -1ul), x | y); x = I128(BANE, -1ul); y = I128(BANE, 0); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, -1ul); y = I128(BANE, 2); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, -1ul); y = I128(BANE, BANE); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(BANE, -1ul), x | y); x = I128(BANE, -1ul); y = I128(-1ul, 0); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(BANE, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(BANE, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(BANE, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, 0); y = I128(0, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 0); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, 0); y = I128(0, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, 0); y = I128(2, 0); ASSERT128(I128(-1ul, 0), x | y); x = I128(-1ul, 0); y = I128(2, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 0); y = I128(2, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, 0); y = I128(2, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, 0); y = I128(BANE, 0); ASSERT128(I128(-1ul, 0), x | y); x = I128(-1ul, 0); y = I128(BANE, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 0); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, 0); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, 0); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 0), x | y); x = I128(-1ul, 0); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 0); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, 0); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, 2); y = I128(0, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 2); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(-1ul, 2); y = I128(0, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, 2); y = I128(2, 0); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 2); y = I128(2, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 2); y = I128(2, BANE); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(-1ul, 2); y = I128(2, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, 2); y = I128(BANE, 0); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 2); y = I128(BANE, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 2); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(-1ul, 2); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, 2); y = I128(-1ul, 0); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 2); y = I128(-1ul, 2); ASSERT128(I128(-1ul, 2), x | y); x = I128(-1ul, 2); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(-1ul, 2); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, BANE); y = I128(0, 2); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(-1ul, BANE); y = I128(0, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, BANE); y = I128(0, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, BANE); y = I128(2, 0); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, BANE); y = I128(2, 2); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(-1ul, BANE); y = I128(2, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, BANE); y = I128(2, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, BANE); y = I128(BANE, 0); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, BANE); y = I128(BANE, 2); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(-1ul, BANE); y = I128(BANE, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, BANE); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, BANE); y = I128(-1ul, 0); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, BANE); y = I128(-1ul, 2); ASSERT128(I128(-1ul, BANE2), x | y); x = I128(-1ul, BANE); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, BANE), x | y); x = I128(-1ul, BANE); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(0, 2); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(0, BANE); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(0, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(2, 0); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(2, 2); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(2, BANE); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(2, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(BANE, 0); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(BANE, 2); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(BANE, BANE); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(BANE, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(-1ul, 0); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(-1ul, 2); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(-1ul, BANE); ASSERT128(I128(-1ul, -1ul), x | y); x = I128(-1ul, -1ul); y = I128(-1ul, -1ul); ASSERT128(I128(-1ul, -1ul), x | y); } void testNot128(void) { __int128 x; x = I128(0, 0); ASSERT128(I128(-1ul, -1ul), ~x); x = I128(0, 2); ASSERT128(I128(-1ul, IMAX2), ~x); x = I128(0, BANE); ASSERT128(I128(-1ul, IMAX), ~x); x = I128(0, -1ul); ASSERT128(I128(-1ul, 0), ~x); x = I128(2, 0); ASSERT128(I128(IMAX2, -1ul), ~x); x = I128(2, 2); ASSERT128(I128(IMAX2, IMAX2), ~x); x = I128(2, BANE); ASSERT128(I128(IMAX2, IMAX), ~x); x = I128(2, -1ul); ASSERT128(I128(IMAX2, 0), ~x); x = I128(BANE, 0); ASSERT128(I128(IMAX, -1ul), ~x); x = I128(BANE, 2); ASSERT128(I128(IMAX, IMAX2), ~x); x = I128(BANE, BANE); ASSERT128(I128(IMAX, IMAX), ~x); x = I128(BANE, -1ul); ASSERT128(I128(IMAX, 0), ~x); x = I128(-1ul, 0); ASSERT128(I128(0, -1ul), ~x); x = I128(-1ul, 2); ASSERT128(I128(0, IMAX2), ~x); x = I128(-1ul, BANE); ASSERT128(I128(0, IMAX), ~x); x = I128(-1ul, -1ul); ASSERT128(I128(0, 0), ~x); } // Helper macro to append a 128-bit value to a string in minimal hex #define PRINT_I128(buf, v) do { \ unsigned long long hi = (unsigned long long)((v) >> 64); \ unsigned long long lo = (unsigned long long)(v); \ char tmp[32]; \ sprintf(tmp, "%llx%llx", hi, lo); \ strcat(buf, tmp); \ } while(0) void testAbi(void) { ASSERT(11, ({ char buf[200]; sprintf(buf, "%d %d %d %d %032jjx %032jjx", 1, 2, 3, 4, I128(0x1ffffffff, 0x2ffffffff), I128(0x3eeeeeeee, 0x4eeeeeeee)); strcmp("1 2 3 4 00000001ffffffff00000002ffffffff " "00000003eeeeeeee00000004eeeeeeee", buf); })); ASSERT(11, ({ char buf[200]; sprintf(buf, "%d %d %d %d %d %032jjx %032jjx", 1, 2, 3, 4, 5, I128(0x1ffffffff, 0x2ffffffff), I128(0x3eeeeeeee, 0x4eeeeeeee)); strcmp("1 2 3 4 5 00000001ffffffff00000002ffffffff " "00000003eeeeeeee00000004eeeeeeee", buf); })); } int main(void) { testLang128(); testCompare128(); testAdd128(); testSub128(); testMul128(); testDiv128(); testDivu128(); testRem128(); testRemu128(); testShr128(); testSar128(); testShl128(); testNeg128(); testXor128(); testAnd128(); testOr128(); testNot128(); testCastDblInt128(); testCastDblUint128(); testCastLdblInt128(); testCastLdblUint128(); testAbi(); printf("OK\n"); return 0; }chibicc-1.0.24/test/int128_div.c000066400000000000000000000041051517770275000162070ustar00rootroot00000000000000#include "test.h" typedef __int128 int128; typedef unsigned __int128 uint128; // Aligned struct (natural alignment for __int128 is 16) struct A { char c; uint128 val; }; // Packed struct (misaligned __int128 starting at offset 1) struct P { char c; uint128 val; } __attribute__((packed)); int main() { // 1. Unsigned division and modulo // u1 = 10 * 2^64 uint128 u1 = (uint128)10 << 64; uint128 u2 = 3; uint128 uq = u1 / u2; uint128 ur = u1 % u2; // q = (10 * 2^64) / 3 = 61489146912365172053 // High 64 bits should be 3. // Low 64 bits should be 6148914691236517205. ASSERT(3, (long)(uq >> 64)); ASSERT(6148914691236517205ULL, (unsigned long)(uq & 0xFFFFFFFFFFFFFFFFULL)); ASSERT(1, (long)ur); // 2. Signed division and modulo int128 s1 = (int128)-100; int128 s2 = 3; ASSERT(-33, (long)(s1 / s2)); ASSERT(-1, (long)(s1 % s2)); int128 s3 = 100; int128 s4 = -3; ASSERT(-33, (long)(s3 / s4)); ASSERT(1, (long)(s3 % s4)); int128 s5 = -100; int128 s6 = -3; ASSERT(33, (long)(s5 / s6)); ASSERT(-1, (long)(s5 % s6)); // 3. Large signed values crossing 64-bit boundary // s7 = 5 * 2^70 int128 s7 = (int128)5 << 70; int128 s8 = (int128)1 << 60; // Result should be 5 * 2^10 = 5120 ASSERT(5120, (long)(s7 / s8)); int128 s9 = -((int128)5 << 70); ASSERT(-5120, (long)(s9 / s8)); // 4. Power of 2 division uint128 u3 = (uint128)1 << 100; uint128 u4 = (uint128)1 << 96; ASSERT(16, (long)(u3 / u4)); // 5. Modulo with large result uint128 u5 = ((uint128)1 << 64) + 10; ASSERT(10, (long)(u5 % ((uint128)1 << 64))); // 6. Packed struct (potentially misaligned) struct P p_inst; p_inst.val = (uint128)20 << 64; uint128 uq_p = p_inst.val / 3; ASSERT(6, (long)(uq_p >> 64)); // (20 * 2^64) / 3 -> high part is 6 ASSERT(2, (long)(p_inst.val % 3)); // (20 * 2^64) % 3 -> 2 // 7. Aligned struct struct A a_inst; a_inst.val = (uint128)15 << 64; ASSERT(5, (long)(a_inst.val / 3 >> 64)); // (15 * 2^64) / 3 -> high part is 5 ASSERT(0, (long)(a_inst.val % 3)); // (15 * 2^64) % 3 -> 0 printf("OK\n"); return 0; } chibicc-1.0.24/test/int128_test.c000066400000000000000000000007011517770275000164020ustar00rootroot00000000000000#include "test.h" int main() { __int128 a = 8 ; __int128 b = 7; __int128 c = a + b ; printf("c=%d\n", c); ASSERT(15, c); c = c + 17 + a + b + (7 * 8); printf("c=%d\n", c); ASSERT(103, c); c = a - b; ASSERT(1, c); c = a * b; ASSERT(56, c); c = c / 2; ASSERT(28, c); c = c % 2; ASSERT(0, c); c++; ASSERT(1, c); c--; ASSERT(0, c); printf("OK\n"); return 0; }chibicc-1.0.24/test/int128_tests.c000066400000000000000000000366101517770275000165750ustar00rootroot00000000000000// test_int128.c — stress test for __int128 in chibicc // Compile with: chibicc test_int128.c -o test_int128 && ./test_int128 // Or reference: gcc test_int128.c -o test_int128_ref && ./test_int128_ref #include "test.h" // --------------------------------------------------------------------------- // Helpers // --------------------------------------------------------------------------- static int failures = 0; /* Print a 128-bit value as two 64-bit halves (hex). */ static void print128(const char *label, __int128 v) { unsigned long long hi = (unsigned long long)((unsigned __int128)v >> 64); unsigned long long lo = (unsigned long long)(unsigned __int128)v; printf(" %-40s hi=0x%016llx lo=0x%016llx\n", label, hi, lo); } /* Compare and report. */ static void check(const char *label, __int128 got, __int128 expected) { if (got != expected) { failures++; printf("FAIL %s\n", label); print128(" got ", got); print128(" expected", expected); } else { printf("PASS %s\n", label); } } static void check_u(const char *label, unsigned __int128 got, unsigned __int128 expected) { if (got != expected) { failures++; printf("FAIL %s\n", label); print128(" got ", (__int128)got); print128(" expected", (__int128)expected); } else { printf("PASS %s\n", label); } } // --------------------------------------------------------------------------- // 1. Constants & Assignment // --------------------------------------------------------------------------- static void test_constants(void) { printf("\n--- 1. Constants & Assignment ---\n"); __int128 zero = 0; check("zero == 0", zero, (__int128)0); __int128 one = 1; check("one == 1", one, (__int128)1); /* Build 2^64 without a 128-bit literal (chibicc may not support them). */ __int128 two64 = (__int128)1 << 64; check("(1<<64) hi=1 lo=0", two64, (__int128)1 << 64); /* Maximum positive signed 128-bit: (2^127) - 1 */ __int128 smax = ((__int128)1 << 127) - 1; print128("INT128_MAX", smax); /* visual check */ /* Minimum signed 128-bit: -(2^127) */ __int128 smin = (__int128)1 << 127; print128("INT128_MIN", smin); /* Negative one */ __int128 neg1 = -1; check("neg1 all-bits-set", neg1, (__int128)-1); } // --------------------------------------------------------------------------- // 2. Arithmetic // --------------------------------------------------------------------------- static void test_arithmetic(void) { printf("\n--- 2. Arithmetic ---\n"); __int128 a = (__int128)9000000000000000000LL; /* 9e18 */ __int128 b = (__int128)9000000000000000000LL; /* Addition that overflows 64-bit */ __int128 sum = a + b; check("9e18 + 9e18", sum, (__int128)18000000000000000000ULL); /* Subtraction */ __int128 diff = sum - a; check("18e18 - 9e18 == 9e18", diff, a); /* Subtraction crossing zero */ __int128 neg = (__int128)0 - a; check("0 - 9e18 negative", neg, -(__int128)9000000000000000000LL); /* Multiplication: 10^18 * 10^18 = 10^36 */ __int128 p = (__int128)1000000000000000000LL * (__int128)1000000000000000000LL; /* 10^36 => hi = 0x00c097ce7bc90715, lo = 0xb34b9f1000000000 */ __int128 expected_p = ((__int128)0x00c097ce7bc90715ULL << 64) | 0xb34b9f1000000000ULL; check("1e18 * 1e18 == 1e36", p, expected_p); /* Division */ __int128 q = p / (__int128)1000000000000000000LL; check("1e36 / 1e18 == 1e18", q, (__int128)1000000000000000000LL); /* Modulo */ __int128 r = (p + 7) % (__int128)1000000000000000000LL; check("(1e36+7) % 1e18 == 7", r, (__int128)7); /* Negation */ __int128 neg2 = -p; check("-1e36 + 1e36 == 0", neg2 + p, (__int128)0); /* Unary plus */ __int128 pos = +a; check("unary + identity", pos, a); } // --------------------------------------------------------------------------- // 3. Bitwise Operations // --------------------------------------------------------------------------- static void test_bitwise(void) { printf("\n--- 3. Bitwise Operations ---\n"); __int128 all_ones = (__int128)-1; /* 0xFFFF…FFFF */ __int128 hi_half = all_ones << 64; /* top 64 bits set */ __int128 lo_half = (__int128)0xFFFFFFFFFFFFFFFFULL; check("hi_half & lo_half == 0", hi_half & lo_half, (__int128)0); check("hi_half | lo_half == -1", hi_half | lo_half, all_ones); check("hi_half ^ lo_half == -1", hi_half ^ lo_half, all_ones); check("~0 == -1", ~(__int128)0, all_ones); check("~(-1) == 0", ~all_ones, (__int128)0); check("AND with self", all_ones & all_ones, all_ones); check("XOR with self == 0", all_ones ^ all_ones, (__int128)0); } // --------------------------------------------------------------------------- // 4. Shift Operations // --------------------------------------------------------------------------- static void test_shifts(void) { printf("\n--- 4. Shifts ---\n"); __int128 one = (__int128)1; /* Left shifts across the 64-bit boundary */ for (int i = 0; i <= 127; i++) { __int128 shifted = one << i; /* Shift back; for i<127 we should recover 1 */ if (i < 127) { __int128 back = shifted >> i; if (back != one) { failures++; printf("FAIL 1<<%-3d >>%-3d != 1\n", i, i); } } } printf("PASS round-trip left/right shift for i in [0..126]\n"); /* Specific boundary cases */ check("1 << 63", (__int128)1 << 63, (__int128)(1ULL << 63)); check("1 << 64", (__int128)1 << 64, ((__int128)1) << 64); check("1 << 127 >> 127 (signed, negative)", ((__int128)1 << 127) >> 127, (__int128)-1); /* Unsigned right shift (no arithmetic shift) */ unsigned __int128 u = (unsigned __int128)1 << 127; check_u("u(1<<127) >> 127 == 1", u >> 127, (unsigned __int128)1); /* Multi-word shift: 0xDEADBEEF_00000000_00000000 >> 32 */ __int128 v = (__int128)0xDEADBEEFULL << 96; __int128 v_shr32 = (unsigned __int128)v >> 32; check("0xDEADBEEF<<96 >>u 32", v_shr32, (__int128)0xDEADBEEFULL << 64); } // --------------------------------------------------------------------------- // 5. Comparison Operators // --------------------------------------------------------------------------- static void test_comparisons(void) { printf("\n--- 5. Comparisons ---\n"); __int128 big = (__int128)1 << 100; __int128 big2 = big + 1; __int128 neg = -big; if (!(big < big2)) { failures++; printf("FAIL big < big2\n"); } else printf("PASS big < big2\n"); if (!(big > neg)) { failures++; printf("FAIL big > neg\n"); } else printf("PASS big > neg\n"); if (!(neg < (__int128)0)) { failures++; printf("FAIL neg < 0\n"); } else printf("PASS neg < 0\n"); if (!(big == big)) { failures++; printf("FAIL big == big\n"); } else printf("PASS big == big\n"); if (!(big != big2)) { failures++; printf("FAIL big != big2\n"); } else printf("PASS big != big2\n"); if (!(big >= big)) { failures++; printf("FAIL big >= big\n"); } else printf("PASS big >= big\n"); if (!(big2 >= big)) { failures++; printf("FAIL big2 >= big\n"); } else printf("PASS big2 >= big\n"); } // --------------------------------------------------------------------------- // 6. Increment / Decrement & Compound Assignment // --------------------------------------------------------------------------- static void test_compound(void) { printf("\n--- 6. Compound Assignment & Inc/Dec ---\n"); __int128 x = (__int128)1 << 64; x++; check("(1<<64)++ == (1<<64)+1", x, ((__int128)1 << 64) + 1); x--; check("(1<<64)+1 -- == 1<<64", x, (__int128)1 << 64); x += (__int128)1 << 63; check("+= 1<<63", x, ((__int128)1 << 64) + ((__int128)1 << 63)); x -= (__int128)1 << 63; check("-= 1<<63", x, (__int128)1 << 64); x *= 3; check("*= 3", x, (__int128)3 << 64); x /= 3; check("/= 3", x, (__int128)1 << 64); x %= ((__int128)1 << 64) - 1; check("%= (1<<64)-1 → 1", x, (__int128)1); x = (__int128)0xFF << 64; x &= (__int128)0x0F << 64; check("&= mask", x, (__int128)0x0F << 64); x |= (__int128)0xF0 << 64; check("|= mask", x, (__int128)0xFF << 64); x ^= (__int128)0xFF << 64; check("^= self → 0", x, (__int128)0); x = (__int128)1; x <<= 70; check("<<= 70", x, (__int128)1 << 70); x >>= 70; check(">>= 70", x, (__int128)1); } // --------------------------------------------------------------------------- // 7. Type Conversions (casting) // --------------------------------------------------------------------------- static void test_casts(void) { printf("\n--- 7. Type Conversions ---\n"); /* int → __int128 */ int small = -42; __int128 promoted = (__int128)small; check("(int)-42 → __int128", promoted, (__int128)-42); /* long long → __int128 */ long long ll = -9000000000000000000LL; __int128 from_ll = (__int128)ll; check("(long long) → __int128 negative", from_ll, (__int128)-9000000000000000000LL); /* __int128 → int (truncation expected) */ __int128 big = ((__int128)1 << 64) + 0x1234; int truncated = (int)big; if (truncated != 0x1234) { failures++; printf("FAIL (__int128 → int) truncation: got 0x%x expected 0x1234\n", truncated); } else { printf("PASS __int128 → int truncation\n"); } /* __int128 → long long */ long long ll2 = (long long)big; if (ll2 != 0x1234LL) { failures++; printf("FAIL (__int128 → long long) truncation: got 0x%llx expected 0x1234\n", ll2); } else { printf("PASS __int128 → long long truncation\n"); } /* unsigned __int128 → __int128 and back */ unsigned __int128 u = (unsigned __int128)-1; /* all bits set */ __int128 s = (__int128)u; check("(unsigned __int128)-1 as signed == -1", s, (__int128)-1); check_u("(__int128)-1 as unsigned == UINT128_MAX", (unsigned __int128)s, u); /* double → __int128 */ double d = 1.8446744073709552e19; /* ≈ 2^64 */ __int128 from_d = (__int128)d; /* We just check it's in the right ballpark; FP precision varies */ int approx_ok = (from_d >> 63) == (__int128)1 || (from_d >> 64) <= (__int128)2; if (!approx_ok) { failures++; printf("FAIL double → __int128 ballpark\n"); print128(" from_d", from_d); } else { printf("PASS double → __int128 ballpark\n"); } } // --------------------------------------------------------------------------- // 8. Pointer / Array Usage // --------------------------------------------------------------------------- static void test_array(void) { printf("\n--- 8. Array & Pointer ---\n"); __int128 arr[4]; for (int i = 0; i < 4; i++) arr[i] = (__int128)1 << (i * 32); for (int i = 0; i < 4; i++) { __int128 expected = (__int128)1 << (i * 32); char label[64]; sprintf(label, "arr[%d] == 1<<%d", i, i*32); check(label, arr[i], expected); } /* Pointer arithmetic */ __int128 *p = arr + 2; check("pointer arr+2 dereference", *p, arr[2]); } // --------------------------------------------------------------------------- // 9. Struct Embedding // --------------------------------------------------------------------------- typedef struct { int tag; __int128 value; int trailer; } Box; static void test_struct(void) { printf("\n--- 9. Struct Embedding ---\n"); Box b; b.tag = 0xAB; b.value = ((__int128)0xDEADBEEFCAFEBABEULL << 64) | 0x0102030405060708ULL; b.trailer = 0xCD; if (b.tag != 0xAB) { failures++; printf("FAIL struct tag\n"); } else printf("PASS struct tag intact\n"); if (b.trailer != 0xCD) { failures++; printf("FAIL struct trailer\n"); } else printf("PASS struct trailer intact\n"); __int128 expected = ((__int128)0xDEADBEEFCAFEBABEULL << 64) | 0x0102030405060708ULL; check("struct __int128 field", b.value, expected); } // --------------------------------------------------------------------------- // 10. Function Arguments & Return Values // --------------------------------------------------------------------------- static __int128 mul128(__int128 a, __int128 b) { return a * b; } static __int128 add128(__int128 a, __int128 b) { return a + b; } static __int128 shl128(__int128 v, int n) { return v << n; } static void test_functions(void) { printf("\n--- 10. Function Args & Return ---\n"); __int128 r = mul128((__int128)1 << 60, (__int128)1 << 60); check("mul128(1<<60, 1<<60) == 1<<120", r, (__int128)1 << 120); __int128 s = add128((__int128)1 << 126, (__int128)1 << 126); check("add128(1<<126,1<<126) == 1<<127", s, (__int128)1 << 127); __int128 t = shl128((__int128)1, 100); check("shl128(1, 100) == 1<<100", t, (__int128)1 << 100); } // --------------------------------------------------------------------------- // 11. Signed vs Unsigned Division & Modulo Edge Cases // --------------------------------------------------------------------------- static void test_signed_unsigned_div(void) { printf("\n--- 11. Signed vs Unsigned Div/Mod ---\n"); /* Signed division with negatives */ __int128 a = (__int128)-17; __int128 b = (__int128)5; check("(-17) / 5 == -3", a / b, (__int128)-3); check("(-17) % 5 == -2", a % b, (__int128)-2); check("17 / (-5) == -3", (__int128)17 / (__int128)-5, (__int128)-3); check("17 % (-5) == 2", (__int128)17 % (__int128)-5, (__int128)2); /* Unsigned large division */ unsigned __int128 ua = (unsigned __int128)1 << 127; unsigned __int128 ub = (unsigned __int128)3; /* 2^127 / 3 = 0x55555555_55555555_55555555_55555555 */ unsigned __int128 uq = ua / ub; unsigned __int128 ur = ua % ub; /* verify: uq*3 + ur == ua */ check_u("uq*3 + ur == 2^127", uq * ub + ur, ua); } // --------------------------------------------------------------------------- // 12. Overflow / Wrap-Around // --------------------------------------------------------------------------- static void test_overflow(void) { printf("\n--- 12. Overflow / Wrap-Around ---\n"); /* Unsigned wrap */ unsigned __int128 umax = (unsigned __int128)-1; check_u("umax + 1 == 0", umax + 1, (unsigned __int128)0); check_u("0 - 1 == umax", (unsigned __int128)0 - 1, umax); /* Signed: INT128_MIN - 1 wraps to INT128_MAX (UB but we observe) */ __int128 smin = (__int128)1 << 127; __int128 smax = smin - 1; check("smin - 1 == smax (wrap)", smin - 1, smax); check("smax + 1 == smin (wrap)", smax + 1, smin); } // --------------------------------------------------------------------------- // main // --------------------------------------------------------------------------- int main(void) { printf("=== __int128 stress test ===\n"); test_constants(); test_arithmetic(); test_bitwise(); test_shifts(); test_comparisons(); test_compound(); test_casts(); test_array(); test_struct(); test_functions(); test_signed_unsigned_div(); test_overflow(); printf("\n============================\n"); if (failures == 0) printf("ALL TESTS PASSED\n"); else printf("FAILED: %d test(s)\n", failures); printf("============================\n"); return failures != 0; }chibicc-1.0.24/test/ipcs.c000066400000000000000000000016501517770275000152600ustar00rootroot00000000000000#include #include #include #include "test.h" int main() { int id = semget(IPC_PRIVATE, 1, IPC_CREAT | 0666); if (id < 0) { perror("semget failed"); return 1; } struct semid_ds buf; int ret = semctl(id, 0, IPC_STAT, &buf); if (ret < 0) { perror("semctl IPC_STAT failed"); } else { printf("semctl IPC_STAT succeeded\n"); } semctl(id, 0, IPC_RMID); printf("sizeof(msginfo) = %zu\n", sizeof(struct msginfo)); ASSERT(32, sizeof(struct msginfo)); printf("msgmax offset = %zu\n", offsetof(struct msginfo, msgmax)); ASSERT(8, offsetof(struct msginfo, msgmax) ); printf("msgmnb offset = %zu\n", offsetof(struct msginfo, msgmnb)); ASSERT(12, offsetof(struct msginfo, msgmnb)); printf("msgtql offset = %zu\n", offsetof(struct msginfo, msgtql)); ASSERT(24, offsetof(struct msginfo, msgtql)); return 0; } chibicc-1.0.24/test/isl.c000066400000000000000000000001331517770275000151040ustar00rootroot00000000000000 #include "test.h" int main() { int x = 42; printf("x=%d\n", x); return 0; }chibicc-1.0.24/test/issue105.c000077500000000000000000000001441517770275000157000ustar00rootroot00000000000000#define __WCHAR_TYPE__ unsigned char; typedef __WCHAR_TYPE__ wchar_t; int main() { return 0; }chibicc-1.0.24/test/issue106.c000077500000000000000000000352141517770275000157070ustar00rootroot00000000000000#include #include # define VLC_EXPORT __attribute__((visibility("default"))) # define VLC_USED __attribute__((warn_unused_result)) #define VLC_STATIC_ONCE { ATOMIC_VAR_INIT(0) } # define VLC_EXTERN typedef int64_t vlc_tick_t; typedef struct date_t date_t; struct date_t { vlc_tick_t date; uint32_t i_divider_num; uint32_t i_divider_den; uint32_t i_remainder; }; #define VLC_API VLC_EXTERN VLC_EXPORT typedef struct { long long quot; /* Quotient. */ long long rem; /* Remainder. */ } lldiv_t; lldiv_t lldiv (long long num, long long denom) { lldiv_t d = { num / denom, num % denom, }; return d; } /***************************************************************************** * vlc_config.h: limits and configuration * Defines all compilation-time configuration constants and size limits ***************************************************************************** * Copyright (C) 1999-2003 VLC authors and VideoLAN * * Authors: Vincent Seguin * Samuel Hocevar * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /** * \file * This file defines of values used in interface, vout, aout and vlc core functions. */ /* Conventions regarding names of symbols and variables * ---------------------------------------------------- * * - Symbols should begin with a prefix indicating in which module they are * used, such as INTF_, VOUT_ or AOUT_. */ /***************************************************************************** * General configuration *****************************************************************************/ /* All timestamp below or equal to this define are invalid/unset * XXX the numerical value is 0 because of historical reason and will change.*/ #define VLC_TICK_INVALID INT64_C(0) #define VLC_TICK_0 INT64_C(1) #define CLOCK_FREQ INT64_C(1000000) /***************************************************************************** * Interface configuration *****************************************************************************/ /* Base delay in micro second for interface sleeps */ #define INTF_IDLE_SLEEP VLC_TICK_FROM_MS(50) /***************************************************************************** * Input thread configuration *****************************************************************************/ /* Used in ErrorThread */ #define INPUT_IDLE_SLEEP VLC_TICK_FROM_MS(100) /* * General limitations */ /* Duration between the time we receive the data packet, and the time we will * mark it to be presented */ #define DEFAULT_PTS_DELAY VLC_TICK_FROM_MS(300) /***************************************************************************** * Video configuration *****************************************************************************/ /* * Default settings for video output threads */ /* Multiplier value for aspect ratio calculation (2^7 * 3^3 * 5^3) */ #define VOUT_ASPECT_FACTOR 432000 /* Maximum width of a scaled source picture - this should be relatively high, * since higher stream values will result in no display at all. */ #define VOUT_MAX_WIDTH 4096 /* Number of planes in a picture */ #define VOUT_MAX_PLANES 5 /* * Time settings */ /* Time to sleep when waiting for a buffer (from vout or the video fifo). * It should be approximately the time needed to perform a complete picture * loop. Since it only happens when the video heap is full, it does not need * to be too low, even if it blocks the decoder. */ #define VOUT_OUTMEM_SLEEP VLC_TICK_FROM_MS(20) /* The default video output window title */ #define VOUT_TITLE "VLC" /***************************************************************************** * vlc_tick.h: high resolution time management functions ***************************************************************************** * This header provides portable high precision time management functions, * which should be the only ones used in other segments of the program, since * functions like gettimeofday() and ftime() are not always supported. * Most functions are declared as inline or as macros since they are only * interfaces to system calls and have to be called frequently. ***************************************************************************** * Copyright (C) 1996, 1997, 1998, 1999, 2000 VLC authors and VideoLAN * * Authors: Vincent Seguin * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifndef __VLC_MTIME_H # define __VLC_MTIME_H 1 struct timespec; /** * High precision date or time interval * * Store a high precision date or time interval. The maximum precision is the * microsecond, and a 64 bits integer is used to avoid overflows (maximum * time interval is then 292271 years, which should be long enough for any * video). Dates are stored as microseconds since a common date (usually the * epoch). Note that date and time intervals can be manipulated using regular * arithmetic operators, and that no special functions are required. */ typedef int64_t vlc_tick_t; #define VLC_TICK_MIN INT64_MIN #define VLC_TICK_MAX INT64_MAX /* * vlc_tick_t <> seconds (sec) conversions */ #define VLC_TICK_FROM_SEC(sec) (CLOCK_FREQ * (sec)) #define SEC_FROM_VLC_TICK(vtk) ((vtk) / CLOCK_FREQ) #ifdef __cplusplus #include template static inline auto vlc_tick_from_sec(T sec) -> typename std::enable_if::value, vlc_tick_t>::type { return CLOCK_FREQ * sec; } /* seconds in floating point */ static inline vlc_tick_t vlc_tick_from_sec(double secf) { return (vlc_tick_t)(CLOCK_FREQ * secf); /* TODO use llround ? */ } #else /* !__cplusplus */ static inline vlc_tick_t vlc_tick_from_seci(int64_t sec) { return CLOCK_FREQ * sec; } /* seconds in floating point */ static inline vlc_tick_t vlc_tick_from_secf(double secf) { return (vlc_tick_t)(CLOCK_FREQ * secf); /* TODO use llround ? */ } #define vlc_tick_from_sec(sec) _Generic((sec), \ double: vlc_tick_from_secf(sec), \ float: vlc_tick_from_secf(sec), \ default: vlc_tick_from_seci(sec) ) #endif /* !__cplusplus */ /* seconds in floating point from vlc_tick_t */ static inline double secf_from_vlc_tick(vlc_tick_t vtk) { return (double)vtk / (double)CLOCK_FREQ; } static inline vlc_tick_t vlc_tick_rate_duration(float frame_rate) { return CLOCK_FREQ / frame_rate; } /* * samples<>vlc_tick_t */ static inline vlc_tick_t vlc_tick_from_samples(int64_t samples, int samp_rate) { return CLOCK_FREQ * samples / samp_rate; } static inline int64_t samples_from_vlc_tick(vlc_tick_t t, int samp_rate) { return t * samp_rate / CLOCK_FREQ; } static inline vlc_tick_t vlc_tick_from_frac(uint64_t num, uint64_t den) { lldiv_t d = lldiv (num, den); return vlc_tick_from_sec( d.quot ) + vlc_tick_from_samples(d.rem, den); } /* * vlc_tick_t <> milliseconds (ms) conversions */ #if (CLOCK_FREQ % 1000) == 0 #define VLC_TICK_FROM_MS(ms) ((CLOCK_FREQ / INT64_C(1000)) * (ms)) #define MS_FROM_VLC_TICK(vtk) ((vtk) / (CLOCK_FREQ / INT64_C(1000))) #elif (1000 % CLOCK_FREQ) == 0 #define VLC_TICK_FROM_MS(ms) ((ms) / (INT64_C(1000) / CLOCK_FREQ)) #define MS_FROM_VLC_TICK(vtk) ((vtk) * (INT64_C(1000) / CLOCK_FREQ)) #else /* rounded overflowing conversion */ #define VLC_TICK_FROM_MS(ms) (CLOCK_FREQ * (ms) / 1000) #define MS_FROM_VLC_TICK(vtk) ((vtk) * 1000 / CLOCK_FREQ) #endif /* CLOCK_FREQ / 1000 */ /* * vlc_tick_t <> microseconds (us) conversions */ #if (CLOCK_FREQ % 1000000) == 0 #define VLC_TICK_FROM_US(us) ((CLOCK_FREQ / INT64_C(1000000)) * (us)) #define US_FROM_VLC_TICK(vtk) ((vtk) / (CLOCK_FREQ / INT64_C(1000000))) #elif (1000000 % CLOCK_FREQ) == 0 #define VLC_TICK_FROM_US(us) ((us) / (INT64_C(1000000) / CLOCK_FREQ)) #define US_FROM_VLC_TICK(vtk) ((vtk) * (INT64_C(1000000) / CLOCK_FREQ)) #else /* rounded overflowing conversion */ #define VLC_TICK_FROM_US(us) (CLOCK_FREQ * (us) / INT64_C(1000000)) #define US_FROM_VLC_TICK(vtk) ((vtk) * INT64_C(1000000) / CLOCK_FREQ) #endif /* CLOCK_FREQ / 1000000 */ /* * vlc_tick_t <> nanoseconds (ns) conversions */ #if (CLOCK_FREQ % 1000000000) == 0 #define VLC_TICK_FROM_NS(ns) ((ns) * (CLOCK_FREQ / (INT64_C(1000000000)))) #define NS_FROM_VLC_TICK(vtk) ((vtk) / (CLOCK_FREQ / (INT64_C(1000000000)))) #elif (1000000000 % CLOCK_FREQ) == 0 #define VLC_TICK_FROM_NS(ns) ((ns) / (INT64_C(1000000000) / CLOCK_FREQ)) #define NS_FROM_VLC_TICK(vtk) ((vtk) * (INT64_C(1000000000) / CLOCK_FREQ)) #else /* rounded overflowing conversion */ #define VLC_TICK_FROM_NS(ns) (CLOCK_FREQ * (ns) / INT64_C(1000000000)) #define NS_FROM_VLC_TICK(vtk) ((vtk) * INT64_C(1000000000) / CLOCK_FREQ) #endif /* CLOCK_FREQ / 1000000000 */ /* * msftime_t is a time with 100ns resolutions, typically used by Microsoft */ typedef int64_t msftime_t; #define MSFTIME_FROM_SEC(sec) (INT64_C(10000000) * (sec)) /* seconds in msftime_t */ #define MSFTIME_FROM_MS(sec) (INT64_C(10000) * (sec)) /* milliseconds in msftime_t */ #if (CLOCK_FREQ % 10000000) == 0 #define VLC_TICK_FROM_MSFTIME(msft) ((msft) * (CLOCK_FREQ / INT64_C(10000000)) #define MSFTIME_FROM_VLC_TICK(vtk) ((vtk) / (CLOCK_FREQ / INT64_C(10000000)) #elif (10000000 % CLOCK_FREQ) == 0 #define VLC_TICK_FROM_MSFTIME(msft) ((msft) / (INT64_C(10000000) / CLOCK_FREQ)) #define MSFTIME_FROM_VLC_TICK(vtk) ((vtk) * (INT64_C(10000000) / CLOCK_FREQ)) #else /* rounded overflowing conversion */ #define VLC_TICK_FROM_MSFTIME(msft) (CLOCK_FREQ * (msft) / INT64_C(10000000)) #define MSFTIME_FROM_VLC_TICK(vtk) ((vtk) * INT64_C(10000000) / CLOCK_FREQ) #endif /* CLOCK_FREQ / 10000000 */ #define vlc_tick_from_timeval(tv) \ (vlc_tick_from_sec( (tv)->tv_sec ) + VLC_TICK_FROM_US( (tv)->tv_usec )) #define vlc_tick_from_timespec(tv) \ (vlc_tick_from_sec( (tv)->tv_sec ) + VLC_TICK_FROM_NS( (tv)->tv_nsec )) /** * Converts a VLC tick to a POSIX time specification. * * \param ts [out] storage space for the time specification * \param tick VLC tick * \return @c ts */ VLC_API struct timespec *vlc_tick_to_timespec(struct timespec *restrict ts, vlc_tick_t tick); /***************************************************************************** * MSTRTIME_MAX_SIZE: maximum possible size of vlc_tick_to_str ***************************************************************************** * This values is the maximal possible size of the string returned by the * vlc_tick_to_str() function, including '-' and the final '\0'. It should be * used to allocate the buffer. *****************************************************************************/ #define MSTRTIME_MAX_SIZE 22 /***************************************************************************** * Prototypes *****************************************************************************/ /** * Convert seconds to a time in the format h:mm:ss. * * This function is provided for any interface function which need to print a * time string in the format h:mm:ss * date. * \param ticks the time to be converted * \param psz_buffer should be a buffer at least MSTRTIME_MAX_SIZE characters * \return psz_buffer is returned so this can be used as printf parameter. */ VLC_API char * vlc_tick_to_str( char *psz_buffer, vlc_tick_t ticks ); /** * \defgroup date Timestamps, error-free * These functions support generating timestamps without long term rounding * errors due to sample rate conversions. * \ingroup input * @{ */ /** * Timestamps without long-term rounding errors */ /** * Initializes a date_t. * * \param date date to initialize [OUT] * \param num divider (sample rate) numerator * \param den divider (sample rate) denominator */ VLC_API void date_Init(date_t *restrict date, uint32_t num, uint32_t den); /** * Changes the rate of a date_t. * * \param date date to change * \param num divider (sample rate) numerator * \param den divider (sample rate) denominator */ VLC_API void date_Change(date_t *restrict date, uint32_t num, uint32_t den); /** * Sets the exact timestamp of a date_t. * * \param date date to set the timestamp into * \param value date value */ static inline void date_Set(date_t *restrict date, vlc_tick_t value) { date->date = value; date->i_remainder = 0; } /** * Gets the current timestamp from a date_t. * * \param date date to fetch the timestamp from * \return date value */ VLC_USED static inline vlc_tick_t date_Get(const date_t *restrict date) { return date->date; } /** * Increments a date. * * Moves the date_t timestamp forward by a given number of samples. * * \param date date to move forward * \param count number of samples * \return timestamp value after incrementing */ VLC_API vlc_tick_t date_Increment(date_t *restrict date, uint32_t count); /** * Decrements a date. * * Moves the date_t timestamp backward by a given number of samples. * * \param date date to move backward * \param count number of samples * \return date value */ VLC_API vlc_tick_t date_Decrement(date_t *restrict date, uint32_t count); /** @} */ /** * @return NTP 64-bits timestamp in host byte order. */ VLC_API uint64_t NTPtime64( void ); #endif /* !__VLC_MTIME_ */ int main(void) { return 0; }chibicc-1.0.24/test/issue107.c000077500000000000000000000032411517770275000157030ustar00rootroot00000000000000 #include "test.h" #define gettext_noop(str) (str) #define N_(str) gettext_noop (str) static const char vlc_usage[] = N_( "Usage: %s [options] [stream] ...\n" "You can specify multiple streams on the commandline.\n" "They will be enqueued in the playlist.\n" "The first item specified will be played first.\n" "\n" "Options-styles:\n" " --option A global option that is set for the duration of the program.\n" " -option A single letter version of a global --option.\n" " :option An option that only applies to the stream directly before it\n" " and that overrides previous settings.\n" "\n" "Stream MRL syntax:\n" " [[access][/demux]://]URL[#[title][:chapter][-[title][:chapter]]]\n" " [:option=value ...]\n" "\n" " Many of the global --options can also be used as MRL specific :options.\n" " Multiple :option=value pairs can be specified.\n" "\n" "URL syntax:\n" " file:///path/file Plain media file\n" " http://host[:port]/file HTTP URL\n" " ftp://host[:port]/file FTP URL\n" " mms://host[:port]/file MMS URL\n" " screen:// Screen capture\n" " dvd://[device] DVD device\n" " vcd://[device] VCD device\n" " cdda://[device] Audio CD device\n" " udp://[[]@[][:]]\n" " UDP stream sent by a streaming server\n" " vlc://pause: Pause the playlist for a certain time\n" " vlc://quit Special item to quit VLC\n" "\n"); int main(void) { printf("%s", vlc_usage); return 0; }chibicc-1.0.24/test/issue108.c000077500000000000000000000004601517770275000157040ustar00rootroot00000000000000#include "test.h" #define VLC_USED __attribute__((warn_unused_result)) #ifndef VLC_CHARSET_H #define VLC_CHARSET_H 1 int vlc_sscanf_c(const char*, const char*, ...) VLC_USED #ifdef __GNUC__ __attribute__((format(scanf, 2, 3))) #endif ; /** @} */ /** @} */ #endif int main(void) { return 0; }chibicc-1.0.24/test/issue109.c000077500000000000000000000001241517770275000157020ustar00rootroot00000000000000 #warning "input_clock_SetJitter needs more work" int main(void) { return 0; }chibicc-1.0.24/test/issue110.c000077500000000000000000000075401517770275000157030ustar00rootroot00000000000000 #include #include #include #include #warning "input_clock_SetJitter needs more work" enum input_control_e { INPUT_CONTROL_SET_STATE, INPUT_CONTROL_SET_RATE, INPUT_CONTROL_SET_POSITION, INPUT_CONTROL_JUMP_POSITION, INPUT_CONTROL_SET_TIME, INPUT_CONTROL_JUMP_TIME, INPUT_CONTROL_SET_PROGRAM, INPUT_CONTROL_SET_TITLE, INPUT_CONTROL_SET_TITLE_NEXT, INPUT_CONTROL_SET_TITLE_PREV, INPUT_CONTROL_SET_SEEKPOINT, INPUT_CONTROL_SET_SEEKPOINT_NEXT, INPUT_CONTROL_SET_SEEKPOINT_PREV, INPUT_CONTROL_SET_BOOKMARK, INPUT_CONTROL_NAV_ACTIVATE, // NOTE: INPUT_CONTROL_NAV_* values must be INPUT_CONTROL_NAV_UP, // contiguous and in the same order as INPUT_CONTROL_NAV_DOWN, // INPUT_NAV_* and DEMUX_NAV_*. INPUT_CONTROL_NAV_LEFT, INPUT_CONTROL_NAV_RIGHT, INPUT_CONTROL_NAV_POPUP, INPUT_CONTROL_NAV_MENU, INPUT_CONTROL_SET_ES, INPUT_CONTROL_SET_ES_LIST, // select a list of ES atomically INPUT_CONTROL_UNSET_ES, INPUT_CONTROL_RESTART_ES, INPUT_CONTROL_SET_ES_CAT_IDS, INPUT_CONTROL_SET_VIEWPOINT, // new absolute viewpoint INPUT_CONTROL_SET_INITIAL_VIEWPOINT, // set initial viewpoint (generally from video) INPUT_CONTROL_UPDATE_VIEWPOINT, // update viewpoint relative to current INPUT_CONTROL_SET_CATEGORY_DELAY, INPUT_CONTROL_SET_ES_DELAY, INPUT_CONTROL_ADD_SLAVE, INPUT_CONTROL_SET_SUBS_FPS, INPUT_CONTROL_SET_RECORD_STATE, INPUT_CONTROL_SET_FRAME_NEXT, INPUT_CONTROL_SET_RENDERER, INPUT_CONTROL_SET_VBI_PAGE, INPUT_CONTROL_SET_VBI_TRANSPARENCY, }; typedef struct input_item_node_t input_item_node_t; struct input_item_node_t { char * p_item; int i_children; input_item_node_t **pp_children; }; struct vlc_object_t { struct vlc_logger *logger; union { struct vlc_object_internals *priv; struct vlc_object_marker *obj; }; bool no_interact; /** Module probe flag * * A boolean during module probing when the probe is "forced". * See \ref module_need(). */ bool force; }; typedef struct stream_t stream_t; struct stream_t { struct vlc_object_t obj; char *psz_name; char *psz_url; /**< Full URL or MRL (can be NULL) */ const char *psz_location; /**< Location (URL with the scheme stripped) */ char *psz_filepath; /**< Local file path (if applicable) */ bool b_preparsing; /**< True if this access is used to preparse */ char *p_input_item;/**< Input item (can be NULL) */ stream_t *s; char *out; /* our p_es_out */ ssize_t (*pf_read)(stream_t *, void *buf, size_t len); char *(*pf_block)(stream_t *, bool *eof); int (*pf_readdir)(stream_t *, input_item_node_t *); int (*pf_demux)(stream_t *); int (*pf_seek)(stream_t *, uint64_t); int (*pf_control)(stream_t *, int i_query, va_list); void *p_sys; }; typedef union { char * val; char * viewpoint; char *id; struct { int cat; char **ids; } list; struct { bool b_fast_seek; int i_val; } time; struct { bool b_fast_seek; double f_val; } pos; struct { int cat; int delay; } cat_delay; struct { int cat; char *str_ids; } cat_ids; struct { char *id; int delay; } es_delay; struct { char *id; unsigned page; } vbi_page; struct { char *id; bool enabled; } vbi_transparency; struct { bool enabled; char *dir_path; } record_state; } input_control_param_t; int main(void) { char * p_input; input_control_param_t it = { .id = p_input, .time.i_val = 1}; return 0; }chibicc-1.0.24/test/issue111.c000077500000000000000000000074621517770275000157070ustar00rootroot00000000000000 #include #include #include #include enum input_control_e { INPUT_CONTROL_SET_STATE, INPUT_CONTROL_SET_RATE, INPUT_CONTROL_SET_POSITION, INPUT_CONTROL_JUMP_POSITION, INPUT_CONTROL_SET_TIME, INPUT_CONTROL_JUMP_TIME, INPUT_CONTROL_SET_PROGRAM, INPUT_CONTROL_SET_TITLE, INPUT_CONTROL_SET_TITLE_NEXT, INPUT_CONTROL_SET_TITLE_PREV, INPUT_CONTROL_SET_SEEKPOINT, INPUT_CONTROL_SET_SEEKPOINT_NEXT, INPUT_CONTROL_SET_SEEKPOINT_PREV, INPUT_CONTROL_SET_BOOKMARK, INPUT_CONTROL_NAV_ACTIVATE, // NOTE: INPUT_CONTROL_NAV_* values must be INPUT_CONTROL_NAV_UP, // contiguous and in the same order as INPUT_CONTROL_NAV_DOWN, // INPUT_NAV_* and DEMUX_NAV_*. INPUT_CONTROL_NAV_LEFT, INPUT_CONTROL_NAV_RIGHT, INPUT_CONTROL_NAV_POPUP, INPUT_CONTROL_NAV_MENU, INPUT_CONTROL_SET_ES, INPUT_CONTROL_SET_ES_LIST, // select a list of ES atomically INPUT_CONTROL_UNSET_ES, INPUT_CONTROL_RESTART_ES, INPUT_CONTROL_SET_ES_CAT_IDS, INPUT_CONTROL_SET_VIEWPOINT, // new absolute viewpoint INPUT_CONTROL_SET_INITIAL_VIEWPOINT, // set initial viewpoint (generally from video) INPUT_CONTROL_UPDATE_VIEWPOINT, // update viewpoint relative to current INPUT_CONTROL_SET_CATEGORY_DELAY, INPUT_CONTROL_SET_ES_DELAY, INPUT_CONTROL_ADD_SLAVE, INPUT_CONTROL_SET_SUBS_FPS, INPUT_CONTROL_SET_RECORD_STATE, INPUT_CONTROL_SET_FRAME_NEXT, INPUT_CONTROL_SET_RENDERER, INPUT_CONTROL_SET_VBI_PAGE, INPUT_CONTROL_SET_VBI_TRANSPARENCY, }; typedef struct input_item_node_t input_item_node_t; struct input_item_node_t { char * p_item; int i_children; input_item_node_t **pp_children; }; struct vlc_object_t { struct vlc_logger *logger; union { struct vlc_object_internals *priv; struct vlc_object_marker *obj; }; bool no_interact; /** Module probe flag * * A boolean during module probing when the probe is "forced". * See \ref module_need(). */ bool force; }; typedef struct stream_t stream_t; struct stream_t { struct vlc_object_t obj; char *psz_name; char *psz_url; /**< Full URL or MRL (can be NULL) */ const char *psz_location; /**< Location (URL with the scheme stripped) */ char *psz_filepath; /**< Local file path (if applicable) */ bool b_preparsing; /**< True if this access is used to preparse */ char *p_input_item;/**< Input item (can be NULL) */ stream_t *s; char *out; /* our p_es_out */ ssize_t (*pf_read)(stream_t *, void *buf, size_t len); char *(*pf_block)(stream_t *, bool *eof); int (*pf_readdir)(stream_t *, input_item_node_t *); int (*pf_demux)(stream_t *); int (*pf_seek)(stream_t *, uint64_t); int (*pf_control)(stream_t *, int i_query, va_list); void *p_sys; }; typedef union { char * val; char * viewpoint; char *id; struct { int cat; char **ids; } list; struct { bool b_fast_seek; int i_val; } time; struct { bool b_fast_seek; double f_val; } pos; struct { int cat; int delay; } cat_delay; struct { int cat; char *str_ids; } cat_ids; struct { char *id; int delay; } es_delay; struct { char *id; unsigned page; } vbi_page; struct { char *id; bool enabled; } vbi_transparency; struct { bool enabled; char *dir_path; } record_state; } input_control_param_t; int main(void) { char * p_input; input_control_param_t it = { .id = p_input, .time.i_val = 1,}; return 0; } chibicc-1.0.24/test/issue113.c000077500000000000000000000012671517770275000157060ustar00rootroot00000000000000 struct vlc_param { union { _Atomic int i; /**< Current value (if integer or boolean) */ _Atomic float f; /**< Current value (if floating point) */ char *_Atomic str; /**< Current value (if character string) */ } value; unsigned char shortname; /**< Optional short option name */ unsigned internal:1; /**< Hidden from preferences and help */ unsigned unsaved:1; /**< Not stored in persistent configuration */ unsigned safe:1; /**< Safe for untrusted provisioning (playlists) */ unsigned obsolete:1; /**< Ignored for backward compatibility */ }; int main(void) { struct vlc_param vlc1 = { .value.i = 1, .value.f = 1.0f}; return 0; }chibicc-1.0.24/test/issue114.c000077500000000000000000000074411517770275000157070ustar00rootroot00000000000000 #include #include #include #include enum input_control_e { INPUT_CONTROL_SET_STATE, INPUT_CONTROL_SET_RATE, INPUT_CONTROL_SET_POSITION, INPUT_CONTROL_JUMP_POSITION, INPUT_CONTROL_SET_TIME, INPUT_CONTROL_JUMP_TIME, INPUT_CONTROL_SET_PROGRAM, INPUT_CONTROL_SET_TITLE, INPUT_CONTROL_SET_TITLE_NEXT, INPUT_CONTROL_SET_TITLE_PREV, INPUT_CONTROL_SET_SEEKPOINT, INPUT_CONTROL_SET_SEEKPOINT_NEXT, INPUT_CONTROL_SET_SEEKPOINT_PREV, INPUT_CONTROL_SET_BOOKMARK, INPUT_CONTROL_NAV_ACTIVATE, // NOTE: INPUT_CONTROL_NAV_* values must be INPUT_CONTROL_NAV_UP, // contiguous and in the same order as INPUT_CONTROL_NAV_DOWN, // INPUT_NAV_* and DEMUX_NAV_*. INPUT_CONTROL_NAV_LEFT, INPUT_CONTROL_NAV_RIGHT, INPUT_CONTROL_NAV_POPUP, INPUT_CONTROL_NAV_MENU, INPUT_CONTROL_SET_ES, INPUT_CONTROL_SET_ES_LIST, // select a list of ES atomically INPUT_CONTROL_UNSET_ES, INPUT_CONTROL_RESTART_ES, INPUT_CONTROL_SET_ES_CAT_IDS, INPUT_CONTROL_SET_VIEWPOINT, // new absolute viewpoint INPUT_CONTROL_SET_INITIAL_VIEWPOINT, // set initial viewpoint (generally from video) INPUT_CONTROL_UPDATE_VIEWPOINT, // update viewpoint relative to current INPUT_CONTROL_SET_CATEGORY_DELAY, INPUT_CONTROL_SET_ES_DELAY, INPUT_CONTROL_ADD_SLAVE, INPUT_CONTROL_SET_SUBS_FPS, INPUT_CONTROL_SET_RECORD_STATE, INPUT_CONTROL_SET_FRAME_NEXT, INPUT_CONTROL_SET_RENDERER, INPUT_CONTROL_SET_VBI_PAGE, INPUT_CONTROL_SET_VBI_TRANSPARENCY, }; typedef struct input_item_node_t input_item_node_t; struct input_item_node_t { char * p_item; int i_children; input_item_node_t **pp_children; }; struct vlc_object_t { struct vlc_logger *logger; union { struct vlc_object_internals *priv; struct vlc_object_marker *obj; }; bool no_interact; /** Module probe flag * * A boolean during module probing when the probe is "forced". * See \ref module_need(). */ bool force; }; typedef struct stream_t stream_t; struct stream_t { struct vlc_object_t obj; char *psz_name; char *psz_url; /**< Full URL or MRL (can be NULL) */ const char *psz_location; /**< Location (URL with the scheme stripped) */ char *psz_filepath; /**< Local file path (if applicable) */ bool b_preparsing; /**< True if this access is used to preparse */ char *p_input_item;/**< Input item (can be NULL) */ stream_t *s; char *out; /* our p_es_out */ ssize_t (*pf_read)(stream_t *, void *buf, size_t len); char *(*pf_block)(stream_t *, bool *eof); int (*pf_readdir)(stream_t *, input_item_node_t *); int (*pf_demux)(stream_t *); int (*pf_seek)(stream_t *, uint64_t); int (*pf_control)(stream_t *, int i_query, va_list); void *p_sys; }; typedef union { char * val; char * viewpoint; char *id; struct { int cat; char **ids; } list; struct { bool b_fast_seek; int i_val; } time; struct { bool b_fast_seek; double f_val; } pos; struct { int cat; int delay; } cat_delay; struct { int cat; char *str_ids; } cat_ids; struct { char *id; int delay; } es_delay; struct { char *id; unsigned page; } vbi_page; struct { char *id; bool enabled; } vbi_transparency; struct { bool enabled; char *dir_path; } record_state; } input_control_param_t; int main(void) { char * p_input; input_control_param_t it = { .id = p_input,}; return 0; } chibicc-1.0.24/test/issue116.c000077500000000000000000000006451517770275000157100ustar00rootroot00000000000000#include struct DH { char *field1; char *field2; }; typedef struct DH DH; #define make_dh(x) \ char *DH_get_##x(void) \ { \ char *dh; \ if (dh == NULL) \ return NULL; \ return dh; \ } char *DH_get_tt1024_160() { char *dh; return dh; } int main(void) { make_dh(1024_160); return 0; } chibicc-1.0.24/test/issue117.c000077500000000000000000000041751517770275000157130ustar00rootroot00000000000000#include #define OSSL_FUNC_DECODER_NEWCTX 1 #define OSSL_FUNC_DECODER_FREECTX 2 #define OSSL_FUNC_DECODER_GET_PARAMS 3 #define OSSL_FUNC_DECODER_GETTABLE_PARAMS 4 #define OSSL_FUNC_DECODER_SET_CTX_PARAMS 5 #define OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS 6 #define OSSL_FUNC_DECODER_DOES_SELECTION 10 #define OSSL_FUNC_DECODER_DECODE 11 #define OSSL_FUNC_DECODER_EXPORT_OBJECT 20 #define OSSL_OBJECT_UNKNOWN 0 #define OSSL_OBJECT_NAME 1 /* char * */ #define OSSL_OBJECT_PKEY 2 /* EVP_PKEY * */ #define OSSL_OBJECT_CERT 3 /* X509 * */ #define OSSL_OBJECT_CRL 4 /* X509_CRL * */ struct ossl_dispatch_st { int function_id; void (*function)(void); }; static void any2obj_freectx(void *vctx) { } static void *any2obj_newctx(void *provctx) { return provctx; } typedef struct ossl_dispatch_st OSSL_DISPATCH; static void *pem2der_newctx(void *provctx) { return provctx; } static void pem2der_freectx(void *vctx) { void *tmp = vctx; } static int der2obj_decode(void *provctx) { return 0; } static int pvk2obj_decode(void *provctx) { return 0; } static int msblob2obj_decode(void *provctx) { return 0; } static int any2obj_decode_final(void *provctx) { return 0; } static int pem2der_decode(void *vctx) { #define MAKE_DECODER(fromtype, objtype) \ static const OSSL_DISPATCH fromtype##_to_obj_decoder_functions[] = { \ {OSSL_FUNC_DECODER_NEWCTX, (void (*)(void))any2obj_newctx}, \ {OSSL_FUNC_DECODER_FREECTX, (void (*)(void))any2obj_freectx}, \ {OSSL_FUNC_DECODER_DECODE, (void (*)(void))fromtype##2obj_decode}, \ {0, NULL} \ } MAKE_DECODER(der, OSSL_OBJECT_UNKNOWN); MAKE_DECODER(msblob, OSSL_OBJECT_PKEY); MAKE_DECODER(pvk, OSSL_OBJECT_PKEY); return 0; } const OSSL_DISPATCH ossl_pem_to_der_decoder_functions[] = { {OSSL_FUNC_DECODER_NEWCTX, (void (*)(void))pem2der_newctx}, {OSSL_FUNC_DECODER_FREECTX, (void (*)(void))pem2der_freectx}, {OSSL_FUNC_DECODER_DECODE, (void (*)(void))pem2der_decode}, {0, NULL}}; int main(void) { return 0; } chibicc-1.0.24/test/issue118.c000066400000000000000000000026671517770275000157150ustar00rootroot00000000000000#include #include "test.h" #define NID_sha1 64 #define NID_sha224 675 #define NID_sha256 672 #define NID_sha384 673 #define NID_sha512 674 #define NID_sha512_224 1094 #define NID_sha512_256 1095 static const unsigned char der_aid_mgf1SHA512_224Identifier[] = { }; static const unsigned char der_aid_mgf1SHA512Identifier[] = { }; static const unsigned char der_aid_mgf1SHA384Identifier[] = { }; static const unsigned char der_aid_mgf1SHA256Identifier[] = { }; static const unsigned char der_aid_mgf1SHA224Identifier[] = { }; static const unsigned char der_aid_mgf1SHA512_256Identifier[] = { }; #define MGF1_SHA_CASE(bits, var) \ case NID_sha##bits: \ var = der_aid_mgf1SHA##bits##Identifier; \ var##_sz = sizeof(der_aid_mgf1SHA##bits##Identifier); \ printf("sizeof=%ld\n", sizeof(der_aid_mgf1SHA##bits##Identifier)); \ break; int main(void) { int maskgenhashalg_nid = 64; const unsigned char *maskgenalg = NULL; size_t maskgenalg_sz = 0; switch (maskgenhashalg_nid) { case NID_sha1: MGF1_SHA_CASE(224, maskgenalg); MGF1_SHA_CASE(256, maskgenalg); MGF1_SHA_CASE(384, maskgenalg); MGF1_SHA_CASE(512, maskgenalg); MGF1_SHA_CASE(512_224, maskgenalg); MGF1_SHA_CASE(512_256, maskgenalg); break; default: return 0; } return 0; }chibicc-1.0.24/test/issue119.c000066400000000000000000000010501517770275000156770ustar00rootroot00000000000000 #if !defined(__DJGPP__) #if defined(__STDC_VERSION__) #if __STDC_VERSION__ >= 199901L #include #endif #endif #endif #include // chibicc -Iinclude -Iapps/include -pthread -m64 -Wall -O3 -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -c -o test/rsa_complex-bin-rsa_complex.o test/rsa_complex.c // /usr/include/x86_64-linux-gnu/bits/cmathcalls.h:55: __MATHCALL (cacos, (_Mdouble_complex_ __z)); // ^ expected ',' int main(void) { return 0; }chibicc-1.0.24/test/issue121.c000066400000000000000000000024071517770275000156770ustar00rootroot00000000000000 //#include #include #include #include #include #include // test typedef struct PodTag { int i; double d; char c; } PodType; struct vcddev_s { char *psz_dev; /* vcd device name */ /* Section used in vcd image mode */ int i_vcdimage_handle; }; typedef struct vcddev_s vcddev_t; typedef struct { vcddev_t *vcddev; /* vcd device descriptor */ unsigned start; /**< Track first sector */ unsigned length; /**< Track total sectors */ unsigned position; /**< Current offset within track sectors */ } demux_sys_t; static_assert(offsetof(demux_sys_t, vcddev) == 0, "Invalid cast"); static const size_t alignv[] = { alignof(char), alignof(short), alignof(int), alignof(long), alignof(long long), alignof(float), alignof(double), alignof(struct big_align_struct), alignof(void *), alignof(max_align_t), }; static_assert(sizeof(atomic_uint) <= sizeof(struct vlc_suuint), "Size mismatch"); static_assert(alignof(atomic_uint) <= alignof(struct vlc_suuint), "Alignment mismatch"); int main(void) { printf("%llu\n", offsetof(PodType, c)); assert(16 == offsetof(PodType, c)); return 0; }chibicc-1.0.24/test/issue122.c000066400000000000000000000006341517770275000157000ustar00rootroot00000000000000 /* Value type. */ /* Value type. */ #if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 294 "sys-utils/hwclock-parse-date.y" int intval; char *textintval; struct timespec timespec; int rel; #line 454 "sys-utils/hwclock-parse-date.c" }; typedef union YYSTYPE YYSTYPE; #define YYSTYPE_IS_TRIVIAL 1 #define YYSTYPE_IS_DECLARED 1 #endif int main(void) { return 0; }chibicc-1.0.24/test/issue123.c000066400000000000000000000004321517770275000156750ustar00rootroot00000000000000#include #include #include union semun { int val; struct semid_ds *buf; unsigned short *array; struct seminfo *__buf; }; int main() { union semun sem_union; if (sizeof(sem_union) > 0) return 0; return 1; } chibicc-1.0.24/test/issue124.c000066400000000000000000000005031517770275000156750ustar00rootroot00000000000000 // if we move the use of the macro after #define statement chibicc compiles it fine. // but if the macro is used before its definition, chibicc fails to compile it. gcc compiles it fine! static const char rcsid[] __attribute__((unused)) = "@(#) $Header$"; #define __attribute__(args) int main(void) { return 0; }chibicc-1.0.24/test/issue125a.c000066400000000000000000000002611517770275000160400ustar00rootroot00000000000000#include #include "test.h" int main(void) { __u32 val = 12; val = __arch_swab32(val); printf("%d\n", val); ASSERT(201326592, val); return 0; }chibicc-1.0.24/test/issue126.c000066400000000000000000000016341517770275000157050ustar00rootroot00000000000000#include #include #include "test.h" size_t strlcpy(dst, src, siz) char *dst; const char *src; size_t siz; { register char *d = dst; register const char *s = src; register size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return (s - src - 1); /* count does not include NUL */ } int main(void) { size_t res; char *src = "hello"; char *dst = calloc (20, sizeof(char)); int siz = 6; res = strlcpy(dst, src, siz); printf("res=%ld dst=%s\n", res, dst); ASSERT(5, res); printf("OK\n"); return 0; }chibicc-1.0.24/test/issue127.c000066400000000000000000000004401517770275000157000ustar00rootroot00000000000000 #include "test.h" typedef struct StRegSized { unsigned char r; } StRegSized; void func1(int a, int b, int c, int d, StRegSized st) { printf("%d %d %d %d %d\n", a, b, c, d, st.r); ASSERT(99, st.r); } int main(void) { StRegSized x = {99}; func1(1, 2, 3, 4, x); return 0; }chibicc-1.0.24/test/issue129.c000066400000000000000000000022641517770275000157100ustar00rootroot00000000000000 #include #include "test.h" #define HYPERVISOR_INFO_LEAF 0x40000000 #define VMWARE_BDOOR_MAGIC 0x564D5868 #define VMWARE_BDOOR_PORT 0x5658 #define VMWARE_BDOOR_CMD_GETVERSION 10 static inline void cpuid(unsigned int op, unsigned int *teax, unsigned int *tebx, unsigned int *tecx, unsigned int *tedx) { __asm__( "cpuid;" : "=b"(*tebx), "=a"(*teax), "=c"(*tecx), "=d"(*tedx) : "1"(op), "c"(0)); } // void vmware_bdoor(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) // { // __asm__( // "inl (%%dx), %%eax;" // : "=b"(*ebx), // "=a"(*eax), // "=c"(*ecx), // "=d"(*edx) // : "0"(VMWARE_BDOOR_MAGIC), // "1"(VMWARE_BDOOR_CMD_GETVERSION), // "2"(VMWARE_BDOOR_PORT), // "3"(0) // : "memory"); // } int main(void) { unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0; cpuid(HYPERVISOR_INFO_LEAF, &eax, &ebx, &ecx, &edx); printf("%d %d %d %d\n", eax, ebx, ecx, edx); ASSERT(1073741835, eax); ASSERT(1919117645, ebx); ASSERT(1718580079, ecx); ASSERT(1984438388, edx); // uint32_t eax2, ebx2, ecx2, edx2; // vmware_bdoor(&eax2, &ebx2, &ecx2, &edx2); // printf("%d %d %d %d\n", eax2, ebx2, ecx2, edx2); return 0; }chibicc-1.0.24/test/issue130.c000066400000000000000000000001041517770275000156670ustar00rootroot00000000000000#include int main() { static_assert(3 < 4, "hello"); }chibicc-1.0.24/test/issue134.c000066400000000000000000000071001517770275000156760ustar00rootroot00000000000000 #define FAR #define Z_U8 unsigned long #define Z_U4 unsigned typedef Z_U4 z_crc_t; typedef Z_U8 z_word_t; #define W 8 #define local local const z_crc_t FAR crc_table[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d}; local z_crc_t crc_word(z_word_t data) { int k; for (k = 0; k < W; k++) data = (data >> 8) ^ crc_table[data & 0xff]; return (z_crc_t)data; } int main(void) { return 0; }chibicc-1.0.24/test/issue137.c000066400000000000000000000006641517770275000157110ustar00rootroot00000000000000#include #include static const char hello[] = "hello, hello!"; void test_compress(compr, comprLen, uncompr, uncomprLen) char *compr, *uncompr; long comprLen, uncomprLen; { int err; long len = (long)strlen(hello) + 1; //strncpy(uncompr, "garbage", 8); printf("uncompress(): %s\n", (char *)uncompr); } int main(int argc, char **argv) { test_compress(&hello, 14, &hello, 14); return 0; } chibicc-1.0.24/test/issue138.c000066400000000000000000000017031517770275000157050ustar00rootroot00000000000000#include #include #include "test.h" #define NGX_SMP_LOCK #define ngx_inline inline typedef __u_char u_char; typedef unsigned long ngx_atomic_uint_t; typedef volatile ngx_atomic_uint_t ngx_atomic_t; static ngx_inline ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old, ngx_atomic_uint_t set) { u_char res; __asm__ volatile( NGX_SMP_LOCK " cmpxchgq %3, %1; " " sete %0; " : "=a"(res) : "m"(*lock), "a"(old), "r"(set) : "cc", "memory"); return res; } int main(void) { ngx_atomic_uint_t mylock = 8; ngx_atomic_t *lock = &mylock; ngx_atomic_uint_t old = 7; ngx_atomic_uint_t set = 1; ngx_atomic_uint_t t = ngx_atomic_cmp_set(lock, old, set); printf("lock = %ld, old= %ld, set = %ld\n", mylock, old, set); ASSERT(8, mylock); ASSERT(7, old); ASSERT(1, set); return 0; }chibicc-1.0.24/test/issue142.c000066400000000000000000000004471517770275000157040ustar00rootroot00000000000000#include #include "test.h" #define WITH_LIBGC #define PRINT_ERROR(...) ((void)fprintf(stderr, __VA_ARGS__)) int main(int argc, char *argv[]) { PRINT_ERROR( "NIT_GC_OPTION accepts 'malloc', 'large'" #ifdef WITH_LIBGC ", 'boehm'" #endif ". Default is 0.\n"); return 0; }chibicc-1.0.24/test/issue145.c000066400000000000000000000006241517770275000157040ustar00rootroot00000000000000#include "test.h" #define THREAD_LOCAL static __thread int uuid_generate_time_generic() { const int cs_min = 1<<6; const int cs_max = (1<<18); const int cs_factor = 2; THREAD_LOCAL int num = 0; THREAD_LOCAL int cache_size = cs_min; //int cache_size = cs_min; return cs_min; } int main() { int a = uuid_generate_time_generic(); printf("a=%d\n", a); ASSERT(64, a); return 0; }chibicc-1.0.24/test/issue147.c000066400000000000000000000004721517770275000157070ustar00rootroot00000000000000#include #include #include "test.h" #define __ORDER_LITTLE_ENDIAN__ 1234 //#define __BYTE_ORDER__ 1234 #define IS_LITTLE_ENDIAN (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) int main() { printf("is_little_endian=%d\n", IS_LITTLE_ENDIAN); ASSERT(1, IS_LITTLE_ENDIAN); return 0; }chibicc-1.0.24/test/issue148.c000066400000000000000000000002411517770275000157020ustar00rootroot00000000000000#include "test.h" static_assert(1 == 1, "channel count mismatch"); typedef struct { int remap[1]; } aout_filters_cfg_t; int main() { return 0; }chibicc-1.0.24/test/issue149.c000077500000000000000000000015001517770275000157050ustar00rootroot00000000000000 #include "test.h" #ifdef _WIN32 #include #include typedef unsigned __int32 uint32_t; #else #include #endif int main (void) { uint32_t r[4]; uint32_t eax_in = 0x80000008U; // uint32_t eax_out = r[0]; // uint32_t vaddr = ((eax_out & 0x0000ff00U) >> 8); // FILE *f = fopen("./conftest.out", "w"); // if (f == NULL) { // printf("f is null\n"); // return 1; // } #ifdef _WIN32 __cpuid((int *)r, (int)eax_in); #else asm volatile ("cpuid" : "=a" (r[3]), "=b" (r[1]), "=c" (r[2]), "=d" (r[0]) : "a" (eax_in), "c" (0) ); #endif // if (vaddr > (sizeof(void *) << 3)) { // vaddr = sizeof(void *) << 3; // } //fprintf(f, "%u", vaddr); printf("%d, %d, %d, %d\n", r[0], r[1], r[2], r[3]); //fclose(f); ASSERT(1, r[3] == 12334 || r[3] == 12336); return 0; ; return 0; } chibicc-1.0.24/test/issue149b.c000077500000000000000000000020321517770275000160500ustar00rootroot00000000000000 #include "test.h" #ifdef _WIN32 #include #include typedef unsigned __int32 uint32_t; #else #include #endif int main (void) { uint32_t r[4] = {1, 2, 3, 4}; uint32_t eax_in = 0x80000008U; uint32_t a = 7, b = 8, c = 9, d = 6; // uint32_t eax_out = r[0]; // uint32_t vaddr = ((eax_out & 0x0000ff00U) >> 8); // FILE *f = fopen("./conftest.out", "w"); // if (f == NULL) { // printf("f is null\n"); // return 1; // } #ifdef _WIN32 __cpuid((int *)r, (int)eax_in); #else asm volatile ("cpuid" : "=a" (r[0]), "=b" (r[1]), "=c" (r[2]), "=d" (r[3]) : "a" (eax_in), "c" (0) ); #endif printf("%d, %d, %d, %d\n", a, b, c, d); printf("%d, %d, %d, %d\n", r[0], r[1], r[2], r[3]); ASSERT(1, r[0] == 12336 || r[0] == 12334); // if (vaddr > (sizeof(void *) << 3)) { // vaddr = sizeof(void *) << 3; // } //fprintf(f, "%u", vaddr); // printf("%d, %d, %d, %d\n", r[0], r[1], r[2], r[3]); // for (int i = 0; i < (sizeof(r)/sizeof(r[0])); i++) // printf("%d\n", r[i]); //fclose(f); return 0; } chibicc-1.0.24/test/issue149c.c000077500000000000000000000011651517770275000160570ustar00rootroot00000000000000 #include "test.h" #ifdef _WIN32 #include #include typedef unsigned __int32 uint32_t; #else #include #endif void asmfunc(void) { uint32_t eax_in = 0x80000008U; uint32_t r[4] = {1, 2, 3, 4}; printf("%d, %d, %d, %d\n", r[0], r[1], r[2], r[3]); #ifdef _WIN32 __cpuid((int *)r, (int)eax_in); #else asm volatile ("cpuid" : "=a" (r[0]), "=b" (r[1]), "=c" (r[2]), "=d" (r[3]) : "a" (eax_in), "c" (0) ); #endif for (int i = 0; i < (sizeof(r)/sizeof(r[0])); i++) printf("%d\n", r[i]); ASSERT(1, r[0] == 12336 || r[0] == 12334 ); } int main (void) { asmfunc(); return 0; } chibicc-1.0.24/test/issue149d.c000066400000000000000000000016171517770275000160570ustar00rootroot00000000000000 #include "test.h" static void GetCPUInfo(int cpu_info[4], int info_type) { __asm__ volatile ( "cpuid\n" : "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3]) : "a"(info_type), "c"(0)); for (int i = 0; i < 4; i++) { printf("%d\n", cpu_info[i]); } } void mycpuinfo(void) { int max_cpuid_value; int cpu_info[4] = {1, 2, 3, 4}; int is_intel = 0; // get the highest feature value cpuid supports GetCPUInfo(cpu_info, 0); max_cpuid_value = cpu_info[0]; for (int i = 0; i < 4; i++) printf("%d\n", cpu_info[i]); //it depends on which computer is it running //ASSERT(20, cpu_info[0]); ASSERT(1, cpu_info[1] == 1752462657 || cpu_info[1] == 1970169159); ASSERT(1, cpu_info[2] == 1145913699 || cpu_info[2] == 1818588270); ASSERT(1, cpu_info[3] == 1769238117 || cpu_info[3] == 1231384169); } int main() { mycpuinfo(); return 0; }chibicc-1.0.24/test/issue150.c000066400000000000000000000002751517770275000157020ustar00rootroot00000000000000 #include "test.h" #define HOST_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) int main() { printf("%d\n", __ORDER_BIG_ENDIAN__ ); ASSERT(4321, __ORDER_BIG_ENDIAN__); return 0; }chibicc-1.0.24/test/issue151.c000066400000000000000000000006001517770275000156730ustar00rootroot00000000000000 #include "test.h" static int ngx_atomic_fetch_add(char *value, int add) { int *ptr = &add; __asm__ volatile ( " xaddq %0, %1; " : "+r" (ptr) : "m" (*value) : "cc", "memory"); return add; } int main () { int a = 10; int *b = 8; int res = ngx_atomic_fetch_add(&b, a); printf("res=%d\n", res); ASSERT(10, res); return 0; }chibicc-1.0.24/test/issue155.c000066400000000000000000000002331517770275000157010ustar00rootroot00000000000000 int main() { #if defined(__i386__) || defined(__x86_64__) __asm__ __volatile__("rep; nop;"::: "memory"); /* a.k.a. PAUSE */ #endif return 0; }chibicc-1.0.24/test/issue155b.c000066400000000000000000000037741517770275000160600ustar00rootroot00000000000000#include #include #include #include "test.h" static inline int lxc_caps_down(void) { return 0; } static inline int lxc_caps_up(void) { return 0; } static inline int lxc_ambient_caps_up(void) { return 0; } static inline int lxc_ambient_caps_down(void) { return 0; } static inline int lxc_caps_init(void) { return 0; } static inline int lxc_caps_last_cap(__u32 *cap) { return -1; } typedef int cap_value_t; typedef int cap_flag_t; static inline bool lxc_proc_cap_is_set(cap_value_t cap, cap_flag_t flag) { return false; } static inline bool lxc_file_cap_is_set(const char *path, cap_value_t cap, cap_flag_t flag) { return false; } #define lxc_priv(__lxc_function) \ ({ \ __label__ out; \ int __ret, __ret2, ___errno = 0; \ __ret = lxc_caps_up(); \ if (__ret) \ goto out; \ __ret = __lxc_function; \ if (__ret) \ ___errno = errno; \ __ret2 = lxc_caps_down(); \ out: \ __ret ? errno = ___errno, __ret : __ret2; \ }) #define lxc_unpriv(__lxc_function) \ ({ \ __label__ out; \ int __ret, __ret2, ___errno = 0; \ __ret = lxc_caps_down(); \ if (__ret) \ goto out; \ __ret = __lxc_function; \ if (__ret) \ ___errno = errno; \ __ret2 = lxc_caps_up(); \ out: \ __ret ? errno = ___errno, __ret : __ret2; \ }) int main() { int a = lxc_unpriv(lxc_caps_up()); printf("%d\n", a); ASSERT(0, a); return 0; } chibicc-1.0.24/test/issue156.c000066400000000000000000000042361517770275000157110ustar00rootroot00000000000000#include #include "test.h" #include #include #include /* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */ #define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */ #define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */ #define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */ #define lengthof(array) (sizeof (array) / sizeof ((array)[0])) typedef size_t Size; typedef struct MemoryChunk { /* bitfield for storing details about the chunk */ unsigned long int hdrmask; /* must be last */ } MemoryChunk; typedef enum MemoryContextMethodID { MCTX_UNUSED1_ID, /* 000 occurs in never-used memory */ MCTX_UNUSED2_ID, /* glibc malloc'd chunks usually match 001 */ MCTX_UNUSED3_ID, /* glibc malloc'd chunks > 128kB match 010 */ MCTX_ASET_ID, MCTX_GENERATION_ID, MCTX_SLAB_ID, MCTX_ALIGNED_REDIRECT_ID, MCTX_UNUSED4_ID /* 111 occurs in wipe_mem'd memory */ } MemoryContextMethodID; STATIC_ASSERT(EPOLL_CTL_ADD < 4); struct uv__io_cqring_offsets { uint32_t head; uint32_t tail; uint32_t ring_mask; uint32_t ring_entries; uint32_t overflow; uint32_t cqes; uint64_t reserved0; uint64_t reserved1; }; STATIC_ASSERT(40 == sizeof(struct uv__io_cqring_offsets)); struct uv__io_sqring_offsets { uint32_t head; uint32_t tail; uint32_t ring_mask; uint32_t ring_entries; uint32_t flags; uint32_t dropped; uint32_t array; uint32_t reserved0; uint64_t reserved1; }; struct uv__io_uring_params { uint32_t sq_entries; uint32_t cq_entries; uint32_t flags; uint32_t sq_thread_cpu; uint32_t sq_thread_idle; uint32_t features; uint32_t reserved[4]; struct uv__io_sqring_offsets sq_off; /* 40 bytes */ struct uv__io_cqring_offsets cq_off; /* 40 bytes */ }; STATIC_ASSERT(40 + 40 + 40 == sizeof(struct uv__io_uring_params)); int main() { char s [10] = {0}; int x = lengthof(s); MemoryChunk *chunk = (struct MemoryChunk*)malloc(sizeof(struct MemoryChunk)); Size value; MemoryContextMethodID methodid = 3; chunk->hdrmask = (((unsigned long int) 100) << 34) | (((unsigned long int) value) << 4) | methodid; return 0; }chibicc-1.0.24/test/issue156b.c000066400000000000000000000006251517770275000160510ustar00rootroot00000000000000#include #include "test.h" void asmfunc(void) { const uint32_t ecx = 0; uint32_t eax, edx; // Use the raw opcode for xgetbv for compatibility with older toolchains. __asm__ volatile ( ".byte 0x0f, 0x01, 0xd0\n" : "=a"(eax), "=d"(edx) : "c" (ecx)); ASSERT(7, eax); ASSERT(0, edx); printf("eax=%d, edx=%d\n", eax, edx); } int main() { asmfunc(); return 0; }chibicc-1.0.24/test/issue157.c000066400000000000000000000016751517770275000157160ustar00rootroot00000000000000#include #include #include "test.h" #define Array(T) \ struct { \ T *contents; \ uint32_t size; \ uint32_t capacity; \ } typedef union { char * data; const char *ptr; } Subtree; typedef struct { uint32_t bytes; char *extent; } Length; typedef struct { const Subtree *subtree; Length position; uint32_t child_index; uint32_t structural_child_index; uint32_t descendant_index; } TreeCursorEntry; typedef struct { const char *tree; Array(TreeCursorEntry) stack; } TreeCursor; typedef struct { TreeCursor cursor; const char *language; unsigned visible_depth; bool in_padding; } Iterator; static bool iterator_tree_is_visible(const Iterator *self) { if (self->cursor.stack.size > 1) { Subtree parent = *self->cursor.stack.contents[self->cursor.stack.size - 2].subtree; return false; } return false; } int main() { return 0; }chibicc-1.0.24/test/issue157b.c000066400000000000000000000010331517770275000160440ustar00rootroot00000000000000// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2002 Roman Zippel */ #include #include #include "test.h" #include #include //#include "lkc.h" #define DEBUG_EXPR 0 enum string_value_kind { k_string, k_signed, k_unsigned, }; union string_value { unsigned long long u; signed long long s; }; void expr_calc_value(struct expr *e) { union string_value lval = {}, rval = {}; } int main() { return 0; }chibicc-1.0.24/test/issue158.c000066400000000000000000000013471517770275000157130ustar00rootroot00000000000000#include "test.h" #include #include #define MPACK_PARENT_NODE(n) (((n) - 1)->pos == (size_t)-1 ? NULL : (n) - 1) typedef struct mpack_node_s { char *tok; size_t pos; /* flag to determine if the key was visited when traversing a map */ int key_visited; /* allow 2 instances mpack_data_t per node. the reason is that when * serializing, the user may need to keep track of traversal state besides the * parent node reference */ char *data[2]; } mpack_node_t; typedef struct { char *parser; int reg, ext, unpacking, mtdict; char *string_buffer; } Unpacker; int main() { Unpacker *unpacker; mpack_node_t *node; if (1 == 0 ) unpacker->string_buffer + MPACK_PARENT_NODE(node)->pos; return 0; }chibicc-1.0.24/test/issue159.c000066400000000000000000000035211517770275000157100ustar00rootroot00000000000000 #include #include #include "test.h" // represents a variable union Var { float f; char *s; bool b; // 'f' 's' or 'b' char type; }; // #define foo(x) \ // __builtin_choose_expr ( \ // __builtin_types_compatible_p (typeof (x), double), \ // foo_double (x), \ // __builtin_choose_expr ( \ // __builtin_types_compatible_p (typeof (x), float), \ // foo_float (x), \ // /* The void expression results in a compile-time error \ // when assigning the result to something. */ \ // (void)0)) #define ts_subtree_children(self) \ ((self) ? NULL : (union Var *)((self))) // // setter void set_int(union Var *var, int newval) { var->f = (float)newval; var->type = 'f'; } void set_float(union Var *var, float newval) { var->f = newval; var->type = 'f'; printf("var->f=%f\n", var->f); ASSERT(1, var->f);} void set_char(union Var *var, char newval) { var->s = (char[2]){newval, 0}; var->type = 's'; } void set_string(union Var *var, char *newval) { var->s = newval; var->type = 's'; } void set_bool(union Var *var, bool newval) { var->b = newval; var->type = 'b'; } #define set(VAR, X) \ _Generic((X), \ int: set_int, \ float: set_float, \ double: set_float, \ char: set_char, \ char *: set_string, \ bool: set_bool)((VAR), (X)) int main(void) { union Var myvar; set(&myvar, 1.5); char c = 'c'; char *pc = &c; int i = 0; union Var *tsubtree[1]; const union Var *child = &ts_subtree_children(tsubtree)[i]; ASSERT(NULL, child); printf("child is null! = %p\n", child); return 0; }chibicc-1.0.24/test/issue159b.c000066400000000000000000000004301517770275000160460ustar00rootroot00000000000000#include #include #include "test.h" static inline uint32_t lj_bswap(uint32_t x) { uint32_t r; __asm__("bswap %0" : "=r" (r) : "0" (x)); return r; } int main() { int a = lj_bswap(18); printf("%d\n", a); ASSERT(301989888, a); return 0; }chibicc-1.0.24/test/issue160.c000066400000000000000000000006671517770275000157100ustar00rootroot00000000000000#include #include #include #include "memcached.h" #include int main() { int t1 = IOV_MAX - 1; int iovused = 10; int iovcnt = 10; bool resp = false; while (resp && iovused + iovcnt < IOV_MAX-1) { break; } printf("t1=%d iovused=%d iovcnt=%d\n", t1, iovused, iovcnt); assert(1023 == t1); assert(10 == iovused); assert(10 == iovcnt); return 0; }chibicc-1.0.24/test/issue162.c000066400000000000000000000045071517770275000157070ustar00rootroot00000000000000#include #include "test.h" #ifndef __cplusplus #ifdef HAVE__STATIC_ASSERT #define StaticAssertDecl(condition, errmessage) \ _Static_assert(condition, errmessage) #define StaticAssertStmt(condition, errmessage) \ do { _Static_assert(condition, errmessage); } while(0) #define StaticAssertExpr(condition, errmessage) \ ((void) ({ StaticAssertStmt(condition, errmessage); true; })) #else /* !HAVE__STATIC_ASSERT */ #define StaticAssertDecl(condition, errmessage) \ extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1]) #define StaticAssertStmt(condition, errmessage) \ ((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; })) #define StaticAssertExpr(condition, errmessage) \ StaticAssertStmt(condition, errmessage) #endif /* HAVE__STATIC_ASSERT */ #else /* C++ */ #if defined(__cpp_static_assert) && __cpp_static_assert >= 200410 #define StaticAssertDecl(condition, errmessage) \ static_assert(condition, errmessage) #define StaticAssertStmt(condition, errmessage) \ static_assert(condition, errmessage) #define StaticAssertExpr(condition, errmessage) \ ({ static_assert(condition, errmessage); }) #else /* !__cpp_static_assert */ #define StaticAssertDecl(condition, errmessage) \ extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1]) #define StaticAssertStmt(condition, errmessage) \ do { struct static_assert_struct { int static_assert_failure : (condition) ? 1 : -1; }; } while(0) #define StaticAssertExpr(condition, errmessage) \ ((void) ({ StaticAssertStmt(condition, errmessage); })) #endif /* __cpp_static_assert */ #endif /* C++ */ #define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1 #if defined(HAVE__BUILTIN_TYPES_COMPATIBLE_P) #define unconstify(underlying_type, expr) \ (StaticAssertExpr(__builtin_types_compatible_p(__typeof(expr), const underlying_type), \ "wrong cast"), \ (underlying_type) (expr)) #define unvolatize(underlying_type, expr) \ (StaticAssertExpr(__builtin_types_compatible_p(__typeof(expr), volatile underlying_type), \ "wrong cast"), \ (underlying_type) (expr)) #else #define unconstify(underlying_type, expr) \ ((underlying_type) (expr)) #define unvolatize(underlying_type, expr) \ ((underlying_type) (expr)) #endif int main() { bool b = unconstify(int, 5 + 8); ASSERT(1, b); return 0; }chibicc-1.0.24/test/issue164.c000066400000000000000000000006371517770275000157110ustar00rootroot00000000000000#include "test.h" typedef struct pg_atomic_flag { volatile char value; } pg_atomic_flag; pg_atomic_test_set_flag_impl(volatile pg_atomic_flag *ptr) { char _res = 1; __asm__ __volatile__( " lock \n" " xchgb %0,%1 \n" : "+q"(_res), "+m"(ptr->value) : : "memory"); ASSERT(8, _res); return _res == 0; } int main() { pg_atomic_flag t = {.value= 8}; pg_atomic_test_set_flag_impl(&t); return 0; }chibicc-1.0.24/test/issue165.c000066400000000000000000000006111517770275000157020ustar00rootroot00000000000000//#include #include "test.h" #define BT_OFFSET_MASK 0x0FFF #define INDEX_MAX_KEYS 32 StaticAssertDecl(BT_OFFSET_MASK >= INDEX_MAX_KEYS, "BT_OFFSET_MASK can't fit INDEX_MAX_KEYS"); //static_assert(8 > 10, "8 can't be greater than 10"); ; int main() { int c = BT_OFFSET_MASK; printf("c=%d\n", c); ASSERT(0x0FFF, c); return 0; }chibicc-1.0.24/test/issue166.c000066400000000000000000000065131517770275000157120ustar00rootroot00000000000000 #include #include #include #include #include "test.h" #define MAXIMUM_ALIGNOF 8 #define BLCKSZ 8192 typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ typedef uint8 bits8; /* >= 8 bits */ typedef uint16 bits16; /* >= 16 bits */ typedef uint32 bits32; /* >= 32 bits */ #define FLEXIBLE_ARRAY_MEMBER /* empty */ typedef struct ItemIdData { unsigned lp_off:15, /* offset to tuple (from start of page) */ lp_flags:2, /* state of line pointer, see below */ lp_len:15; /* byte length of tuple */ } ItemIdData; struct HeapTupleHeaderData { union { char * t_heap; char * t_datum; } t_choice; char * t_ctid; /* current TID of this or newer tuple (or a * speculative insertion token) */ /* Fields below here must match MinimalTupleData! */ #define FIELDNO_HEAPTUPLEHEADERDATA_INFOMASK2 2 uint16 t_infomask2; /* number of attributes + various flags */ #define FIELDNO_HEAPTUPLEHEADERDATA_INFOMASK 3 uint16 t_infomask; /* various flag bits, see below */ #define FIELDNO_HEAPTUPLEHEADERDATA_HOFF 4 uint8 t_hoff; /* sizeof header incl. bitmap, padding */ /* ^ - 23 bytes - ^ */ #define FIELDNO_HEAPTUPLEHEADERDATA_BITS 5 bits8 t_bits[FLEXIBLE_ARRAY_MEMBER]; /* bitmap of NULLs */ }; typedef struct HeapTupleHeaderData HeapTupleHeaderData; typedef struct PageHeaderData { /* XXX LSN is member of *any* block, not only page-organized ones */ char * pd_lsn; /* LSN: next byte after last byte of xlog * record for last change to this page */ uint16 pd_checksum; /* checksum */ uint16 pd_flags; /* flag bits, see below */ int * pd_lower; /* offset to start of free space */ int * pd_upper; /* offset to end of free space */ int * pd_special; /* offset to start of special space */ uint16 pd_pagesize_version; char * pd_prune_xid; /* oldest prunable XID, or zero if none */ ItemIdData pd_linp[FLEXIBLE_ARRAY_MEMBER]; /* line pointer array */ } PageHeaderData; #define SizeofHeapTupleHeader offsetof(HeapTupleHeaderData, t_bits) // #define offsetof(t, d) __builtin_offsetof(t, d) #define SizeOfPageHeaderData (offsetof(PageHeaderData, pd_linp)) #define TYPEALIGN(ALIGNVAL,LEN) \ (((uintptr_t) (LEN) + ((ALIGNVAL) - 1)) & ~((uintptr_t) ((ALIGNVAL) - 1))) #define MAXALIGN(LEN) TYPEALIGN(MAXIMUM_ALIGNOF, (LEN)) #define MaxHeapTuplesPerPage \ ((int) ((BLCKSZ - SizeOfPageHeaderData) / \ (MAXALIGN(SizeofHeapTupleHeader) + sizeof(ItemIdData)))) // #define myvalue 190 // #define MaxHeapTuplesPerPage myvalue + 100 #define MAX_TUPLES_PER_PAGE MaxHeapTuplesPerPage typedef struct { int nredirected; /* numbers of entries in arrays below */ int ndead; int nunused; /* * marked[i] is true if item i is entered in one of the above arrays. * * This needs to be MaxHeapTuplesPerPage + 1 long as FirstOffsetNumber is * 1. Otherwise every access would need to subtract 1. */ bool marked[MaxHeapTuplesPerPage + 1]; } PruneState; int heap_page_prune() { PruneState prstate; memset(prstate.marked, 0, sizeof(prstate.marked)); printf("====%ld\n", sizeof(prstate.marked)); ASSERT(291, sizeof(prstate.marked) ); printf("====%d\n", MaxHeapTuplesPerPage + 1); ASSERT(291, MaxHeapTuplesPerPage + 1); return 0; } int main() { heap_page_prune(); return 0; }chibicc-1.0.24/test/issue166b.c000066400000000000000000000010001517770275000160360ustar00rootroot00000000000000#include #include #include struct abc1 { int a, b, c; }; union abc2 { int a, b, c; }; typedef struct abc1 abc1; typedef union abc2 abc2; int main () { assert(offsetof(abc1, a) == 0); // always, because there's no padding before a. assert(offsetof(abc1, b) == 4); // here, on my system assert(offsetof(abc2, a) == offsetof(abc2, b)); // (members overlap) printf("%ld\n", offsetof(abc1, a) ); printf("%ld\n", offsetof(abc1, b) ); printf("%ld\n", offsetof(abc2, a) ); return 0; }chibicc-1.0.24/test/issue166c.c000066400000000000000000000005551517770275000160550ustar00rootroot00000000000000#include #include "test.h" #define N 4 typedef struct { bool arr[N + 1]; } S; int foo(int x) { typedef struct { bool arr[x + 1]; } S; return sizeof(S); } int main() { S s = {0}; s.arr[0] = 1; printf("%d\n", foo(10)); //should return 11 ASSERT(11, foo(10)); if (s.arr[0]) return 0; return 1; } chibicc-1.0.24/test/issue167.c000066400000000000000000000034651517770275000157160ustar00rootroot00000000000000#include #include #include #include "test.h" typedef unsigned long int uint64; typedef unsigned int uint32; typedef struct pg_atomic_uint64 { /* alignment guaranteed due to being on a 64bit platform */ volatile uint64 value; } pg_atomic_uint64; typedef struct pg_atomic_uint32 { volatile uint32 value; } pg_atomic_uint32; static inline bool pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 *expected, uint64 newval) { char ret; /* * Perform cmpxchg and use the zero flag which it implicitly sets when * equal to measure the success. */ __asm__ __volatile__( " lock \n" " cmpxchgq %4,%5 \n" " setz %2 \n" : "=a" (*expected), "=m"(ptr->value), "=q" (ret) : "a" (*expected), "r" (newval), "m"(ptr->value) : "memory", "cc"); ASSERT(1, ret); return (bool) ret; } static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 *expected, uint32 newval) { char ret; /* * Perform cmpxchg and use the zero flag which it implicitly sets when * equal to measure the success. */ __asm__ __volatile__( " lock \n" " cmpxchgl %4,%5 \n" " setz %2 \n" : "=a" (*expected), "=m"(ptr->value), "=q" (ret) : "a" (*expected), "r" (newval), "m"(ptr->value) : "memory", "cc"); return (bool) ret; } int main() { pg_atomic_uint32 a; a.value = 10; uint32 b = 17; uint32 c = 0; pg_atomic_compare_exchange_u32_impl(&a, &b, c); ASSERT(10, a.value); ASSERT(10, b); ASSERT(0, c); return 0; }chibicc-1.0.24/test/issue168.c000066400000000000000000000021661517770275000157140ustar00rootroot00000000000000#include #include #include "test.h" //#include #define HIGHBIT (0x80) #define IS_HIGHBIT_SET(ch) ((unsigned char)(ch) & HIGHBIT) int pg_strcasecmp(const char *s1, const char *s2) { // for (;;) // { // unsigned char ch1 = (unsigned char) *s1++; // unsigned char ch2 = (unsigned char) *s2++; // if (ch1 != ch2) // { // if (ch1 >= 'A' && ch1 <= 'Z') // ch1 += 'a' - 'A'; // else if (IS_HIGHBIT_SET(ch1) && isupper(ch1)) // ch1 = tolower(ch1); // if (ch2 >= 'A' && ch2 <= 'Z') // ch2 += 'a' - 'A'; // else if (IS_HIGHBIT_SET(ch2) && isupper(ch2)) // ch2 = tolower(ch2); // if (ch1 != ch2) // return (int) ch1 - (int) ch2; // } // if (ch1 == 0) // break; // } return 0; } void add_additional_variables(char *name, bool insert) { int (* strcmp_fn)(const char *, const char *) = ((name[0] == ':' || name[0] == '"') ? strcmp : pg_strcasecmp); //int (* strcmp_fn) = ((name[0] == ':' || name[0] == '"') ? strcmp : pg_strcasecmp); } int main() { char *name = "test"; bool insert = true; add_additional_variables(name, insert); return 0; }chibicc-1.0.24/test/issue168b.c000066400000000000000000000002731517770275000160530ustar00rootroot00000000000000 #include "test.h" int add2(int x, int y) { return x + y; } int main() { int res = 0; int (*fn)(int,int) = add2; res = fn(2,5); printf("res=%d\n", res); ASSERT(7, res); return 0; }chibicc-1.0.24/test/issue168c.c000066400000000000000000000007461517770275000160610ustar00rootroot00000000000000#include #include #include "test.h" #define CDTEXT_MAX_TRACKS 0x7f static void CdTextParsePackText( const int *p_pack, size_t *pi_textbuffer, size_t *pi_repeatbuffer, char *textbuffer, int *pi_last_track, char *pppsz_info[CDTEXT_MAX_TRACKS + 1][0x10] ) { return; } int main() { return 0; }chibicc-1.0.24/test/issue170b.c000066400000000000000000000606021517770275000160460ustar00rootroot00000000000000#include "assert.h" #include #ifdef __cplusplus # error "A C++ compiler has been selected for C." #endif #if defined(__18CXX) # define ID_VOID_MAIN #endif #if defined(__CLASSIC_C__) /* cv-qualifiers did not exist in K&R C */ # define const # define volatile #endif #if !defined(__has_include) /* If the compiler does not have __has_include, pretend the answer is always no. */ # define __has_include(x) 0 #endif /* Version number components: V=Version, R=Revision, P=Patch Version date components: YYYY=Year, MM=Month, DD=Day */ #if defined(__INTEL_COMPILER) || defined(__ICC) # define COMPILER_ID "Intel" # if defined(_MSC_VER) # define SIMULATE_ID "MSVC" # endif # if defined(__GNUC__) # define SIMULATE_ID "GNU" # endif /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, except that a few beta releases use the old format with V=2021. */ # if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) # if defined(__INTEL_COMPILER_UPDATE) # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) # else # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) # endif # else # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) /* The third version component from --version is an update index, but no macro is provided for it. */ # define COMPILER_VERSION_PATCH DEC(0) # endif # if defined(__INTEL_COMPILER_BUILD_DATE) /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) # endif # if defined(_MSC_VER) /* _MSC_VER = VVRR */ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) # endif # if defined(__GNUC__) # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) # elif defined(__GNUG__) # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) # endif # if defined(__GNUC_MINOR__) # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) # endif # if defined(__GNUC_PATCHLEVEL__) # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) # endif #elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) # define COMPILER_ID "IntelLLVM" #if defined(_MSC_VER) # define SIMULATE_ID "MSVC" #endif #if defined(__GNUC__) # define SIMULATE_ID "GNU" #endif /* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and * later. Look for 6 digit vs. 8 digit version number to decide encoding. * VVVV is no smaller than the current year when a version is released. */ #if __INTEL_LLVM_COMPILER < 1000000L # define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) #else # define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) #endif #if defined(_MSC_VER) /* _MSC_VER = VVRR */ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) #endif #if defined(__GNUC__) # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) #elif defined(__GNUG__) # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) #endif #if defined(__GNUC_MINOR__) # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) #endif #if defined(__GNUC_PATCHLEVEL__) # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) #endif #elif defined(__PATHCC__) # define COMPILER_ID "PathScale" # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) # if defined(__PATHCC_PATCHLEVEL__) # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) # endif #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) # define COMPILER_ID "Embarcadero" # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) #elif defined(__BORLANDC__) # define COMPILER_ID "Borland" /* __BORLANDC__ = 0xVRR */ # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 # define COMPILER_ID "Watcom" /* __WATCOMC__ = VVRR */ # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) # if (__WATCOMC__ % 10) > 0 # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) # endif #elif defined(__WATCOMC__) # define COMPILER_ID "OpenWatcom" /* __WATCOMC__ = VVRP + 1100 */ # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) # if (__WATCOMC__ % 10) > 0 # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) # endif #elif defined(__SUNPRO_C) # define COMPILER_ID "SunPro" # if __SUNPRO_C >= 0x5100 /* __SUNPRO_C = 0xVRRP */ # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) # else /* __SUNPRO_CC = 0xVRP */ # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) # endif #elif defined(__HP_cc) # define COMPILER_ID "HP" /* __HP_cc = VVRRPP */ # define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) # define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) # define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) #elif defined(__DECC) # define COMPILER_ID "Compaq" /* __DECC_VER = VVRRTPPPP */ # define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) # define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) # define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) #elif defined(__IBMC__) && defined(__COMPILER_VER__) # define COMPILER_ID "zOS" /* __IBMC__ = VRP */ # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) #elif defined(__ibmxl__) && defined(__clang__) # define COMPILER_ID "XLClang" # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 # define COMPILER_ID "XL" /* __IBMC__ = VRP */ # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 # define COMPILER_ID "VisualAge" /* __IBMC__ = VRP */ # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) #elif defined(__NVCOMPILER) # define COMPILER_ID "NVHPC" # define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) # define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) # if defined(__NVCOMPILER_PATCHLEVEL__) # define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) # endif #elif defined(__PGI) # define COMPILER_ID "PGI" # define COMPILER_VERSION_MAJOR DEC(__PGIC__) # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) # if defined(__PGIC_PATCHLEVEL__) # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) # endif #elif defined(_CRAYC) # define COMPILER_ID "Cray" # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) #elif defined(__TI_COMPILER_VERSION__) # define COMPILER_ID "TI" /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) #elif defined(__CLANG_FUJITSU) # define COMPILER_ID "FujitsuClang" # define COMPILER_VERSION_MAJOR DEC(__FCC_major__) # define COMPILER_VERSION_MINOR DEC(__FCC_minor__) # define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) # define COMPILER_VERSION_INTERNAL_STR __clang_version__ #elif defined(__FUJITSU) # define COMPILER_ID "Fujitsu" # if defined(__FCC_version__) # define COMPILER_VERSION __FCC_version__ # elif defined(__FCC_major__) # define COMPILER_VERSION_MAJOR DEC(__FCC_major__) # define COMPILER_VERSION_MINOR DEC(__FCC_minor__) # define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) # endif # if defined(__fcc_version) # define COMPILER_VERSION_INTERNAL DEC(__fcc_version) # elif defined(__FCC_VERSION) # define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) # endif #elif defined(__ghs__) # define COMPILER_ID "GHS" /* __GHS_VERSION_NUMBER = VVVVRP */ # ifdef __GHS_VERSION_NUMBER # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) # endif #elif defined(__TINYC__) # define COMPILER_ID "TinyCC" #elif defined(__BCC__) # define COMPILER_ID "Bruce" #elif defined(__SCO_VERSION__) # define COMPILER_ID "SCO" #elif defined(__ARMCC_VERSION) && !defined(__clang__) # define COMPILER_ID "ARMCC" #if __ARMCC_VERSION >= 1000000 /* __ARMCC_VERSION = VRRPPPP */ # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) #else /* __ARMCC_VERSION = VRPPPP */ # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) #endif #elif defined(__clang__) && defined(__apple_build_version__) # define COMPILER_ID "AppleClang" # if defined(_MSC_VER) # define SIMULATE_ID "MSVC" # endif # define COMPILER_VERSION_MAJOR DEC(__clang_major__) # define COMPILER_VERSION_MINOR DEC(__clang_minor__) # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) # if defined(_MSC_VER) /* _MSC_VER = VVRR */ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) # endif # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) # define COMPILER_ID "ARMClang" # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) #elif defined(__clang__) # define COMPILER_ID "Clang" # if defined(_MSC_VER) # define SIMULATE_ID "MSVC" # endif # define COMPILER_VERSION_MAJOR DEC(__clang_major__) # define COMPILER_VERSION_MINOR DEC(__clang_minor__) # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) # if defined(_MSC_VER) /* _MSC_VER = VVRR */ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) # endif #elif defined(__GNUC__) # define COMPILER_ID "GNU" # define COMPILER_VERSION_MAJOR DEC(__GNUC__) # if defined(__GNUC_MINOR__) # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) # endif # if defined(__GNUC_PATCHLEVEL__) # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) # endif #elif defined(_MSC_VER) # define COMPILER_ID "MSVC" /* _MSC_VER = VVRR */ # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) # if defined(_MSC_FULL_VER) # if _MSC_VER >= 1400 /* _MSC_FULL_VER = VVRRPPPPP */ # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) # else /* _MSC_FULL_VER = VVRRPPPP */ # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) # endif # endif # if defined(_MSC_BUILD) # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) # endif #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) # define COMPILER_ID "ADSP" #if defined(__VISUALDSPVERSION__) /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) #endif #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) # define COMPILER_ID "IAR" # if defined(__VER__) && defined(__ICCARM__) # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) # endif #elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) # define COMPILER_ID "SDCC" # if defined(__SDCC_VERSION_MAJOR) # define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) # define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) # define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) # else /* SDCC = VRP */ # define COMPILER_VERSION_MAJOR DEC(SDCC/100) # define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) # define COMPILER_VERSION_PATCH DEC(SDCC % 10) # endif /* These compilers are either not known or too old to define an identification macro. Try to identify the platform and guess that it is the native compiler. */ #elif defined(__hpux) || defined(__hpua) # define COMPILER_ID "HP" #else /* unknown compiler */ # define COMPILER_ID "" #endif /* Construct the string literal in pieces to prevent the source from getting matched. Store it in a pointer rather than an array because some compilers will just produce instructions to fill the array rather than assigning a pointer to a static array. */ char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; #ifdef SIMULATE_ID char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; #endif #ifdef __QNXNTO__ char const* qnxnto = "INFO" ":" "qnxnto[]"; #endif #if defined(__CRAYXT_COMPUTE_LINUX_TARGET) char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; #endif #define STRINGIFY_HELPER(X) #X #define STRINGIFY(X) STRINGIFY_HELPER(X) /* Identify known platforms by name. */ #if defined(__linux) || defined(__linux__) || defined(linux) # define PLATFORM_ID "Linux" #elif defined(__MSYS__) # define PLATFORM_ID "MSYS" #elif defined(__CYGWIN__) # define PLATFORM_ID "Cygwin" #elif defined(__MINGW32__) # define PLATFORM_ID "MinGW" #elif defined(__APPLE__) # define PLATFORM_ID "Darwin" #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) # define PLATFORM_ID "Windows" #elif defined(__FreeBSD__) || defined(__FreeBSD) # define PLATFORM_ID "FreeBSD" #elif defined(__NetBSD__) || defined(__NetBSD) # define PLATFORM_ID "NetBSD" #elif defined(__OpenBSD__) || defined(__OPENBSD) # define PLATFORM_ID "OpenBSD" #elif defined(__sun) || defined(sun) # define PLATFORM_ID "SunOS" #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) # define PLATFORM_ID "AIX" #elif defined(__hpux) || defined(__hpux__) # define PLATFORM_ID "HP-UX" #elif defined(__HAIKU__) # define PLATFORM_ID "Haiku" #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) # define PLATFORM_ID "BeOS" #elif defined(__QNX__) || defined(__QNXNTO__) # define PLATFORM_ID "QNX" #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) # define PLATFORM_ID "Tru64" #elif defined(__riscos) || defined(__riscos__) # define PLATFORM_ID "RISCos" #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) # define PLATFORM_ID "SINIX" #elif defined(__UNIX_SV__) # define PLATFORM_ID "UNIX_SV" #elif defined(__bsdos__) # define PLATFORM_ID "BSDOS" #elif defined(_MPRAS) || defined(MPRAS) # define PLATFORM_ID "MP-RAS" #elif defined(__osf) || defined(__osf__) # define PLATFORM_ID "OSF1" #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) # define PLATFORM_ID "SCO_SV" #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) # define PLATFORM_ID "ULTRIX" #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) # define PLATFORM_ID "Xenix" #elif defined(__WATCOMC__) # if defined(__LINUX__) # define PLATFORM_ID "Linux" # elif defined(__DOS__) # define PLATFORM_ID "DOS" # elif defined(__OS2__) # define PLATFORM_ID "OS2" # elif defined(__WINDOWS__) # define PLATFORM_ID "Windows3x" # elif defined(__VXWORKS__) # define PLATFORM_ID "VxWorks" # else /* unknown platform */ # define PLATFORM_ID # endif #elif defined(__INTEGRITY) # if defined(INT_178B) # define PLATFORM_ID "Integrity178" # else /* regular Integrity */ # define PLATFORM_ID "Integrity" # endif #else /* unknown platform */ # define PLATFORM_ID #endif /* For windows compilers MSVC and Intel we can determine the architecture of the compiler being used. This is because the compilers do not have flags that can change the architecture, but rather depend on which compiler is being used */ #if defined(_WIN32) && defined(_MSC_VER) # if defined(_M_IA64) # define ARCHITECTURE_ID "IA64" # elif defined(_M_ARM64EC) # define ARCHITECTURE_ID "ARM64EC" # elif defined(_M_X64) || defined(_M_AMD64) # define ARCHITECTURE_ID "x64" # elif defined(_M_IX86) # define ARCHITECTURE_ID "X86" # elif defined(_M_ARM64) # define ARCHITECTURE_ID "ARM64" # elif defined(_M_ARM) # if _M_ARM == 4 # define ARCHITECTURE_ID "ARMV4I" # elif _M_ARM == 5 # define ARCHITECTURE_ID "ARMV5I" # else # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) # endif # elif defined(_M_MIPS) # define ARCHITECTURE_ID "MIPS" # elif defined(_M_SH) # define ARCHITECTURE_ID "SHx" # else /* unknown architecture */ # define ARCHITECTURE_ID "" # endif #elif defined(__WATCOMC__) # if defined(_M_I86) # define ARCHITECTURE_ID "I86" # elif defined(_M_IX86) # define ARCHITECTURE_ID "X86" # else /* unknown architecture */ # define ARCHITECTURE_ID "" # endif #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) # if defined(__ICCARM__) # define ARCHITECTURE_ID "ARM" # elif defined(__ICCRX__) # define ARCHITECTURE_ID "RX" # elif defined(__ICCRH850__) # define ARCHITECTURE_ID "RH850" # elif defined(__ICCRL78__) # define ARCHITECTURE_ID "RL78" # elif defined(__ICCRISCV__) # define ARCHITECTURE_ID "RISCV" # elif defined(__ICCAVR__) # define ARCHITECTURE_ID "AVR" # elif defined(__ICC430__) # define ARCHITECTURE_ID "MSP430" # elif defined(__ICCV850__) # define ARCHITECTURE_ID "V850" # elif defined(__ICC8051__) # define ARCHITECTURE_ID "8051" # elif defined(__ICCSTM8__) # define ARCHITECTURE_ID "STM8" # else /* unknown architecture */ # define ARCHITECTURE_ID "" # endif #elif defined(__ghs__) # if defined(__PPC64__) # define ARCHITECTURE_ID "PPC64" # elif defined(__ppc__) # define ARCHITECTURE_ID "PPC" # elif defined(__ARM__) # define ARCHITECTURE_ID "ARM" # elif defined(__x86_64__) # define ARCHITECTURE_ID "x64" # elif defined(__i386__) # define ARCHITECTURE_ID "X86" # else /* unknown architecture */ # define ARCHITECTURE_ID "" # endif #elif defined(__TI_COMPILER_VERSION__) # if defined(__TI_ARM__) # define ARCHITECTURE_ID "ARM" # elif defined(__MSP430__) # define ARCHITECTURE_ID "MSP430" # elif defined(__TMS320C28XX__) # define ARCHITECTURE_ID "TMS320C28x" # elif defined(__TMS320C6X__) || defined(_TMS320C6X) # define ARCHITECTURE_ID "TMS320C6x" # else /* unknown architecture */ # define ARCHITECTURE_ID "" # endif #else # define ARCHITECTURE_ID #endif /* Convert integer to decimal digit literals. */ #define DEC(n) \ ('0' + (((n) / 10000000)%10)), \ ('0' + (((n) / 1000000)%10)), \ ('0' + (((n) / 100000)%10)), \ ('0' + (((n) / 10000)%10)), \ ('0' + (((n) / 1000)%10)), \ ('0' + (((n) / 100)%10)), \ ('0' + (((n) / 10)%10)), \ ('0' + ((n) % 10)) /* Convert integer to hex digit literals. */ #define HEX(n) \ ('0' + ((n)>>28 & 0xF)), \ ('0' + ((n)>>24 & 0xF)), \ ('0' + ((n)>>20 & 0xF)), \ ('0' + ((n)>>16 & 0xF)), \ ('0' + ((n)>>12 & 0xF)), \ ('0' + ((n)>>8 & 0xF)), \ ('0' + ((n)>>4 & 0xF)), \ ('0' + ((n) & 0xF)) /* Construct a string literal encoding the version number. */ #ifdef COMPILER_VERSION char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; /* Construct a string literal encoding the version number components. */ #elif defined(COMPILER_VERSION_MAJOR) char const info_version[] = { 'I', 'N', 'F', 'O', ':', 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', COMPILER_VERSION_MAJOR, # ifdef COMPILER_VERSION_MINOR '.', COMPILER_VERSION_MINOR, # ifdef COMPILER_VERSION_PATCH '.', COMPILER_VERSION_PATCH, # ifdef COMPILER_VERSION_TWEAK '.', COMPILER_VERSION_TWEAK, # endif # endif # endif ']','\0'}; #endif /* Construct a string literal encoding the internal version number. */ #ifdef COMPILER_VERSION_INTERNAL char const info_version_internal[] = { 'I', 'N', 'F', 'O', ':', 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', 'i','n','t','e','r','n','a','l','[', COMPILER_VERSION_INTERNAL,']','\0'}; #elif defined(COMPILER_VERSION_INTERNAL_STR) char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; #endif /* Construct a string literal encoding the version number components. */ #ifdef SIMULATE_VERSION_MAJOR char const info_simulate_version[] = { 'I', 'N', 'F', 'O', ':', 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', SIMULATE_VERSION_MAJOR, # ifdef SIMULATE_VERSION_MINOR '.', SIMULATE_VERSION_MINOR, # ifdef SIMULATE_VERSION_PATCH '.', SIMULATE_VERSION_PATCH, # ifdef SIMULATE_VERSION_TWEAK '.', SIMULATE_VERSION_TWEAK, # endif # endif # endif ']','\0'}; #endif /* Construct the string literal in pieces to prevent the source from getting matched. Store it in a pointer rather than an array because some compilers will just produce instructions to fill the array rather than assigning a pointer to a static array. */ char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; #if !defined(__STDC__) && !defined(__clang__) # if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) # define C_VERSION "90" # else # define C_VERSION # endif #elif __STDC_VERSION__ > 201710L # define C_VERSION "23" #elif __STDC_VERSION__ >= 201710L # define C_VERSION "17" #elif __STDC_VERSION__ >= 201000L # define C_VERSION "11" #elif __STDC_VERSION__ >= 199901L # define C_VERSION "99" #else # define C_VERSION "90" #endif const char* info_language_standard_default = "INFO" ":" "standard_default[" C_VERSION "]"; const char* info_language_extensions_default = "INFO" ":" "extensions_default[" /* !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode. */ #if (defined(__clang__) || defined(__GNUC__) || \ defined(__TI_COMPILER_VERSION__)) && \ !defined(__STRICT_ANSI__) && !defined(_MSC_VER) "ON" #else "OFF" #endif "]"; /*--------------------------------------------------------------------------*/ #ifdef ID_VOID_MAIN void main() {} #else # if defined(__CLASSIC_C__) int main(argc, argv) int argc; char *argv[]; # else int main(int argc, char* argv[]) # endif { int require = 0; require += info_compiler[argc]; require += info_platform[argc]; require += info_arch[argc]; #ifdef COMPILER_VERSION_MAJOR require += info_version[argc]; #endif #ifdef COMPILER_VERSION_INTERNAL require += info_version_internal[argc]; #endif #ifdef SIMULATE_ID require += info_simulate[argc]; #endif #ifdef SIMULATE_VERSION_MAJOR require += info_simulate_version[argc]; #endif #if defined(__CRAYXT_COMPUTE_LINUX_TARGET) require += info_cray[argc]; #endif require += info_language_standard_default[argc]; require += info_language_extensions_default[argc]; (void)argv; assert(require != 0 ? printf("require=%d\n"): "require should not be 0"); return 0; } #endifchibicc-1.0.24/test/issue170c.c000066400000000000000000000002101517770275000160340ustar00rootroot00000000000000 #include "test.h" int main(int argc, char *argv[]) { printf("argc=%d\n", argc); ASSERT(1, argc); return argc - 1; }chibicc-1.0.24/test/issue31.c000077500000000000000000000004751517770275000156250ustar00rootroot00000000000000 #include "test.h" struct info { int key; int :5; int data; }; int Get(struct info * m) { return m->data;} int main() { struct info info = {1, 1, 1}; printf("%ld\n", sizeof(info)); ASSERT(12, sizeof(info)); printf("%d\n", Get(&info)); ASSERT(1, Get(&info)); return 0; }chibicc-1.0.24/test/issue35.c000077500000000000000000000007111517770275000156220ustar00rootroot00000000000000#include "test.h" #define SIZE 10 int myarr[SIZE]; int myarr[] = {11, 34, }; int main(void) { for(int i = 0; i < SIZE; i++) { printf("%d: %d\n", i, myarr[i]); } ASSERT(11, myarr[0]); ASSERT(34, myarr[1]); ASSERT(0, myarr[2]); ASSERT(0, myarr[3]); ASSERT(0, myarr[4]); ASSERT(0, myarr[5]); ASSERT(0, myarr[6]); ASSERT(0, myarr[7]); ASSERT(0, myarr[8]); ASSERT(0, myarr[9]); return 0; }chibicc-1.0.24/test/issue36.c000077500000000000000000000003571517770275000156310ustar00rootroot00000000000000 #include "test.h" typedef struct empty_struct {} empty_struct; int f(empty_struct a) { return 0; } int main() { f((empty_struct){}); printf("%ld\n", sizeof(empty_struct)); ASSERT(0, sizeof(empty_struct)); return 0; }chibicc-1.0.24/test/issue37.c000077500000000000000000000002111517770275000156170ustar00rootroot00000000000000#include "test.h" int main() { int r = ({ int x; goto label; label: x = 42; ASSERT(42, x); x; }); return 0; }chibicc-1.0.24/test/issue40.c000077500000000000000000000004161517770275000156200ustar00rootroot00000000000000 #include "test.h" int fun(int n, int a[n]) { int res = 0; for (int i = 0; i < n; i++) res = res + a[i]; return res; }; int main(void) { int a[3] = {1, 2, 3}; int b = fun(3, a); printf("%d %p \n", b, a); ASSERT(6, b); return 0; }chibicc-1.0.24/test/issue40a.c000077500000000000000000000003421517770275000157570ustar00rootroot00000000000000 #include "test.h" // fails silently (pointer to VLA) int x = 10; void fun(char (*a)[x]) { sizeof *a; printf("%zu\n", sizeof *a); ASSERT(10, sizeof *a);} int main(void) { char arr[10][20]; fun(arr); return 0; }chibicc-1.0.24/test/issue40b.c000077500000000000000000000005141517770275000157610ustar00rootroot00000000000000 #include "test.h" int fun( int n, int a[n]) { int res = 0; for (int i = 0; i < n; i++) res = res + a[i]; return res; }; int main(void) { int c = 3; int a[c]; for (int i = 0; i < c; i++) a[i] = i + 1; int b = fun(c, a); printf("%d %d \n", b, a[0]); ASSERT(6, b); return 0; }chibicc-1.0.24/test/issue45.c000077500000000000000000000001521517770275000156220ustar00rootroot00000000000000struct S { union { int A; }; }; int main(void) { (struct S){.A = 0}; return 0; }chibicc-1.0.24/test/issue47.c000077500000000000000000000002241517770275000156240ustar00rootroot00000000000000#include "test.h" // a.c struct S { int n; }; int main(void) { printf("%d\n", (struct S){1}.n); ASSERT(1, (struct S){1}.n); return 0; }chibicc-1.0.24/test/issue59.c000077500000000000000000000002631517770275000156320ustar00rootroot00000000000000#include "test.h" typedef int MyInt, MyInt2[4]; enum MyEnum { ENUM_TEST }; typedef enum MyEnum MyEnum; int main() { printf("OK\n"); ASSERT(0, ENUM_TEST); return 0; }chibicc-1.0.24/test/issue62.c000077500000000000000000000004611517770275000156240ustar00rootroot00000000000000 #include "test.h" struct s { struct { int i; int j; } t; int k; }; int main() { struct s x = {.t.i = 1, .k = 2}; //int x[2][3]={1,2,3,4,5,6,[0][1]=7,8,[0]=9,[0]=10,11,[1][0]=12}; //printf("%d\n", x[0][2]); printf("%d %d %d\n", x.t.i, x.t.j, x.k); ASSERT(2, x.k); return 0; }chibicc-1.0.24/test/issue63.c000077500000000000000000000000621517770275000156220ustar00rootroot00000000000000int f(int(int)); int main(void) { return 0; }chibicc-1.0.24/test/issue65.c000077500000000000000000000002141517770275000156230ustar00rootroot00000000000000#include "test.h" struct S { unsigned long long int b:32; } s; void f() { s.b = 10; ASSERT(10, s.b); } int main() { return 0; }chibicc-1.0.24/test/issue69.c000077500000000000000000000002111517770275000156240ustar00rootroot00000000000000 #include "test.h" long double x = 0; int main(void) { printf("%Lf %ld\n", x, sizeof(x)); ASSERT(16, sizeof(x)); return 0; }chibicc-1.0.24/test/issue71.c000077500000000000000000000001301517770275000156150ustar00rootroot00000000000000_Atomic long double b; void bug(void) { b += 3; } int main(void) { return 0; }chibicc-1.0.24/test/issue72.c000077500000000000000000000000621517770275000156220ustar00rootroot00000000000000long f1[] = "a"; int main(void) { return 0; }chibicc-1.0.24/test/issue80.c000077500000000000000000000002131517770275000156170ustar00rootroot00000000000000 #include "test.h" const char str[] = {"foo"}; int main() { printf("%d\n", sizeof(str) ); ASSERT(4, sizeof(str)); return 0; }chibicc-1.0.24/test/issue94.c000066400000000000000000000001441517770275000156240ustar00rootroot00000000000000 #include "test.h" #if !1u - 1 > 0 #error #endif int main() { printf("OK\n"); return 0; }chibicc-1.0.24/test/issue96.c000077500000000000000000000001261517770275000156310ustar00rootroot00000000000000#if (-(0x7fffffffffffffffLL) - 1) / -1 #endif int x; int main(void) { return 0; }chibicc-1.0.24/test/issue_asm_multiline.c000077500000000000000000000003211517770275000203710ustar00rootroot00000000000000 #include "test.h" int main(void) { int a = 10, b = 0; asm ("movl %eax, %ebx\n\t" "add $10, %ebx\n\t" ); printf("a=%d, b=%d\n", a, b); ASSERT(10, a); ASSERT(0, b); return 0; }chibicc-1.0.24/test/issue_cast.c000066400000000000000000000006131517770275000164620ustar00rootroot00000000000000#include "test.h" int test_return_cast(void) { return (int){42}; } float test_return_cast_float(void) { return (float){3.14f}; } int main(void) { int i = test_return_cast(); float f = test_return_cast_float(); printf("i = %d\n", i); printf("f = %f\n", f); ASSERT(42, i); ASSERT(3, (int)f); // simple cast to int for test return 0; } chibicc-1.0.24/test/issue_cmake.c000066400000000000000000000002551517770275000166120ustar00rootroot00000000000000 #if defined(__CLASSIC_C__) int main(argc, argv) int argc; char* argv[]; #else int main(int argc, char* argv[]) #endif { (void)argv; return argc-1;}chibicc-1.0.24/test/issue_cpython.c000066400000000000000000000015311517770275000172140ustar00rootroot00000000000000 #include "test.h" typedef struct { int dummy; } PyObject; static inline void hmacmodule_clear(PyObject *mod) { (void)mod; printf("hmacmodule_clear called\n"); } static inline void hmacmodule_free(void *mod) { // call clear but cast to PyObject* (void)hmacmodule_clear((PyObject *)mod); } struct PyModuleDef { const char *m_name; int m_size; void (*m_traverse)(void); void (*m_clear)(void *); void (*m_free)(void *); }; static struct PyModuleDef _hmacmodule = { .m_name = "_hmac", .m_size = sizeof(PyObject), .m_traverse = NULL, .m_clear = (void (*)(void *))hmacmodule_clear, .m_free = hmacmodule_free, // <-- inline function assigned directly }; int main() { PyObject obj; if (_hmacmodule.m_free) _hmacmodule.m_free(&obj); // will try to call hmacmodule_free return 0; } chibicc-1.0.24/test/issue_cvtss2si.c000066400000000000000000000007261517770275000173150ustar00rootroot00000000000000#include "test.h" #include typedef float float4 __attribute__((vector_size(16))) ; int main(void) { // Create a vector of 4 floats (matches __v4sf) float4 vec = { 42.5f, 2.0f, -3.0f, 99.0f }; // Convert the lowest element to int int result = __builtin_ia32_cvtss2si(vec); printf("Input[0] = %.2f -> int = %d\n", vec[0], result); ASSERT(42, vec[0]); ASSERT(42, result); printf("OK\n"); return 0; } chibicc-1.0.24/test/issue_deep_recursion.c000066400000000000000000000005501517770275000205360ustar00rootroot00000000000000#include int recursive(int n) { if (n == 0) { return 0; } // This expression will likely use temporary stack space int result = (n * 123 + 456) / 789; return recursive(n - 1) + result; } int main() { // A moderately deep recursion int result = recursive(1000); printf("Result: %d\n", result); return 0; }chibicc-1.0.24/test/issue_extended_asm.c000077500000000000000000000003571517770275000202000ustar00rootroot00000000000000 #include "test.h" int main(void) { int a = 10, b = 21; asm ("add %1, %0\n\t" : "+r" (a) : "r" (b) : "cc" ); printf("%d\n", a); printf("%d\n", b); ASSERT(31, a); ASSERT(21, b); return 0; }chibicc-1.0.24/test/issue_fork.c000066400000000000000000000012201517770275000164640ustar00rootroot00000000000000#include #include #include #include #include __thread int tls_counter = 7; void *thread_func(void *arg) { tls_counter++; return NULL; } int main() { pthread_t t; pthread_create(&t, NULL, thread_func, NULL); pthread_join(t, NULL); printf("Before fork: pid=%d, tls=%d\n", getpid(), tls_counter); pid_t pid = fork(); if (pid == 0) { // Child process printf("Child: pid=%d, tls=%d\n", getpid(), tls_counter); exit(0); } else { wait(NULL); printf("Parent: pid=%d, tls=%d\n", getpid(), tls_counter); } return 0; } chibicc-1.0.24/test/issue_frame_pointer_leak.c000066400000000000000000000007251517770275000213620ustar00rootroot00000000000000#include // This function needs a frame pointer to walk the stack. void func_needs_fp() { printf("Parent frame pointer: %p\n", __builtin_frame_address(1)); } // This function is simple and a good candidate for frame pointer omission. int simple_func(int x) { return x + 5; } int main() { printf("Calling func_needs_fp()\n"); func_needs_fp(); printf("Calling simple_func()\n"); simple_func(10); printf("Done.\n"); return 0; }chibicc-1.0.24/test/issue_postgres.c000066400000000000000000000013761517770275000174050ustar00rootroot00000000000000#include "test.h" #include typedef struct { int a; int b; } T; void test_struct_assignment_return_value(void) { T a = {0, 0}; T b = {1, 2}; a = b; a.a = 5; ASSERT(5, a.a); ASSERT(2, a.b); ASSERT(1, b.a); // b should remain 1 ASSERT(2, b.b); } void test_unnamed_bitfield(void) { struct { int a; int : 0; int b; } x; // If the unnamed bitfield bug exists (parse.c), 'b' is not in the member list. // This would fail to compile or runtime crash if offsets are wrong. x.a = 10; x.b = 20; ASSERT(10, x.a); ASSERT(20, x.b); } int main() { test_struct_assignment_return_value(); test_unnamed_bitfield(); printf("OK\n"); return 0; } chibicc-1.0.24/test/issue_prefetch.c000066400000000000000000000003471517770275000173340ustar00rootroot00000000000000// test/builtin_prefetch_fail.c #include "test.h" struct S { int *entries; }; #define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries) int main() { struct S s; PREFETCH_NEIGHBORHOOD(s); printf("Ok\n"); return 0; }chibicc-1.0.24/test/issue_pyexpat.c000066400000000000000000000025351517770275000172270ustar00rootroot00000000000000#include typedef void* XML_Parser; typedef void (*xmlhandler)(void); typedef void (*xmlhandlersetter)(XML_Parser, xmlhandler); // Dummy underlying "library" functions void XML_SetStartElementHandler(XML_Parser parser, xmlhandler h) { (void)parser; (void)h; printf("XML_SetStartElementHandler called\n"); } void my_StartElementHandler(void) { printf("my_StartElementHandler called\n"); } // Wrapper macro #define SETTER_WRAPPER(NAME, TYPE) \ static inline void \ pyexpat_Set##NAME(XML_Parser parser, xmlhandler handler) \ { \ (void)XML_Set##NAME(parser, (TYPE)handler); \ } // Expand one handler SETTER_WRAPPER(StartElementHandler, xmlhandler) // Struct holding handlers struct HandlerEntry { const char *name; xmlhandlersetter setter; xmlhandler handler; }; // Simulate CPython macro: assign inline function in struct #define HANDLER_INFO(name) \ {#name, (xmlhandlersetter)pyexpat_Set##name, (xmlhandler)my_##name}, struct HandlerEntry handlers[] = { HANDLER_INFO(StartElementHandler) }; int main(void) { XML_Parser parser = NULL; // Call via struct handlers[0].setter(parser, handlers[0].handler); handlers[0].handler(); return 0; } chibicc-1.0.24/test/issue_slimcc_14.c000066400000000000000000000023771517770275000173170ustar00rootroot00000000000000#include "test.h" // file scope int arr[2][2] = {{1,2},{3,4}}; int *p1 = arr[1]; int fcast = (float)16777217.0; int main(int argc, char**argv){ char arr[3] = {11, 22, 33}; int i; i = (&arr)[0][2], printf("%d\n", i); // 33 i = (*&arr)[1], printf("%d\n", i); // 22 i = (**&arr), printf("%d\n", i); // 11 ASSERT(33, (&arr)[0][2]); ASSERT(22, (*&arr)[1]); ASSERT(11, (**&arr)); struct { int i:5; _Bool b:1;} s = {.b = 1}; int j = s.b; printf("%d\n",j); // expect 1, got -1 ASSERT(1, j); switch(0x123456789) { case 0x123456789: printf("expected branch\n"); break; default: printf("wrong branch\n"); } struct { unsigned field :8; } bit = {0}; printf("%d\n", bit.field > -1 ); // expect true, got false ASSERT(1, bit.field > -1); int k = 0; int arr[(k++, 4)]; printf("%d\n", k); // expect 1, got 0 ASSERT(1, k); _Bool x,y,b; b = 1; printf("bb plus\n"); x = b; y = b++; printf("%d\n", x == y); //expect true, got false ASSERT(1, x == y); b = 0; printf("bb minus\n"); x = b; y = b--; printf("%d\n", x == y); //expect true, got false ASSERT(1, x == y); printf("%d\n", fcast); // expect 16777216, got 16777217 ASSERT(16777216, fcast); printf("OK\n"); return 0; }chibicc-1.0.24/test/issue_vlcasm2.c000066400000000000000000000002571517770275000171030ustar00rootroot00000000000000#include "test.h" int foo (int *dstp) { asm volatile ( "movntdq %%xmm1, 0(%[dst])" : : [dst] "r"(dstp) : "memory" ); } int main() { printf("OK\n"); return 0; }chibicc-1.0.24/test/issue_vlcparse.c000066400000000000000000000006201517770275000173450ustar00rootroot00000000000000//#include "sd-id128.h" #include #include #include typedef union sd_id128 sd_id128_t; union sd_id128 { uint8_t bytes[16]; uint64_t qwords[2]; }; int sd_id128_in_setv2(sd_id128_t a, va_list ap) { for (;;) { sd_id128_t b = va_arg(ap, sd_id128_t); } return 0; } int main() { return 0; }chibicc-1.0.24/test/issuephp.c000066400000000000000000000026011517770275000161570ustar00rootroot00000000000000#include "test.h" #include #include bool multiply_with_overflow(uint32_t a, uint32_t b, uint32_t *result) { uint32_t res, m_overflow; // Use GCC inline assembly to do: res = a * b, with overflow in m_overflow asm volatile ( "mull %3" // Multiply EAX by operand %3 → result in EDX:EAX : "=&a"(res), "=&d"(m_overflow) // outputs: EAX → res, EDX → m_overflow : "a"(a), "rm"(b) // inputs: a in EAX, b in reg/mem ); *result = res; return m_overflow != 0; } int main(void) { uint32_t a = 0xFFFFFFFF; uint32_t b = 2; uint32_t res; bool overflow = multiply_with_overflow(a, b, &res); printf("Result: %u (0x%08x)\n", res, res); printf("Overflow: %s\n", overflow ? "Yes" : "No"); ASSERT(1, overflow); ASSERT(0xfffffffe, res); uint32_t nmemb = 0xFFFFFFFE; uint32_t size = 2; uint32_t offset = 1; uint32_t resm = nmemb; uint32_t m_overflow; __asm__ volatile ( "mull %3\n\t" "add %4, %0\n\t" "adc $0, %1" : "=&a"(resm), "=&d"(m_overflow) : "%0"(resm), "rm"(size), "rm"(offset) : "cc" ); printf("Result: %u (0x%08x)\n", resm, resm); printf("Overflow: %u\n", m_overflow); ASSERT(1, m_overflow); ASSERT(0xfffffffd, resm); return 0; }chibicc-1.0.24/test/issuephp2.c000066400000000000000000000007201517770275000162410ustar00rootroot00000000000000#include "test.h" asm(".pushsection \".test_section\", \"a\"\n" ".ascii \"hello world\\n\"\n" ".popsection\n"); asm(".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n" ".byte 4\n" ".ascii \"gdb.inlined-script\\n\"\n" ".ascii \"gdb.execute('''\\n\"\n" ".ascii \"define set_ts\\n\"\n" ".ascii \" return orig_value\\n\"\n" ".byte 0\n" ".popsection\n" ); int main() { printf("OK\n"); return 0; }chibicc-1.0.24/test/issuephp3.c000066400000000000000000000004421517770275000162430ustar00rootroot00000000000000#include "test.h" int main(void) { unsigned int eax, edx; __asm__ __volatile__ ( ".byte 0x0f, 0x01, 0xd0" // xgetbv : "=a"(eax), "=d"(edx) : "c"(0) ); printf("xgetbv eax: %08x edx: %08x\n", eax, edx); ASSERT(7, eax); ASSERT(0, edx); return 0; }chibicc-1.0.24/test/issuephp4.c000066400000000000000000000015731517770275000162520ustar00rootroot00000000000000#include "test.h" #include #include #include int test(const char *ptr, size_t len, uintptr_t delta) { unsigned long ret; __asm__ ( "0:\n\t" "movq (%2,%3), %0\n\t" "xorq (%2), %0\n\t" "jne 1f\n\t" "addq $0x8, %2\n\t" "subq $0x8, %1\n\t" "ja 0b\n\t" "movq $0x1, %0\n\t" "jmp 3f\n\t" "1:\n\t" "cmpq $0x8,%1\n\t" "jb 2f\n\t" "xorq %0, %0\n\t" "jmp 3f\n\t" "2:\n\t" "negq %1\n\t" "lea 0x40(,%1,8), %1\n\t" "shlq %b1, %0\n\t" "sete %b0\n\t" "movzbq %b0, %0\n\t" "3:\n" : "=&a"(ret), "+c"(len), "+r"(ptr) : "r"(delta) : "cc"); return ret; } int main() { uint8_t data[8] = {0, 0, 0, 0, 0, 0, 0, 0}; int delta = 0; int len = 4; int result = test(data, len, delta); printf("Result: %d\n", result); ASSERT(1, result); return 0; }chibicc-1.0.24/test/issuephp5.c000066400000000000000000000045571517770275000162600ustar00rootroot00000000000000#include "test.h" typedef struct { int dummy; } HashTable; // Static global variable should not be visible externally static HashTable classes; /* {{{ prop handler tables */ static HashTable dom_document_prop_handlers; static HashTable dom_xml_document_prop_handlers; static HashTable dom_abstract_base_document_prop_handlers; static HashTable dom_documentfragment_prop_handlers; static HashTable dom_modern_documentfragment_prop_handlers; static HashTable dom_node_prop_handlers; static HashTable dom_modern_node_prop_handlers; static HashTable dom_entity_reference_prop_handlers; static HashTable dom_modern_entity_reference_prop_handlers; static HashTable dom_nodelist_prop_handlers; static HashTable dom_namednodemap_prop_handlers; static HashTable dom_characterdata_prop_handlers; static HashTable dom_modern_characterdata_prop_handlers; static HashTable dom_attr_prop_handlers; static HashTable dom_modern_attr_prop_handlers; static HashTable dom_element_prop_handlers; static HashTable dom_modern_element_prop_handlers; static HashTable dom_modern_element_prop_handlers; static HashTable dom_text_prop_handlers; static HashTable dom_modern_text_prop_handlers; static HashTable dom_documenttype_prop_handlers; static HashTable dom_modern_documenttype_prop_handlers; static HashTable dom_notation_prop_handlers; static HashTable dom_modern_notation_prop_handlers; static HashTable dom_entity_prop_handlers; static HashTable dom_modern_entity_prop_handlers; static HashTable dom_processinginstruction_prop_handlers; static HashTable dom_modern_processinginstruction_prop_handlers; static HashTable dom_namespace_node_prop_handlers; static HashTable dom_token_list_prop_handlers; // Make sure the variable is used so it doesn't get optimized out HashTable *get_dom_handlers(void) { return &dom_document_prop_handlers; } // Mock zend_extension struct, simplified typedef struct { const char *name; const char *version; const char *author; const char *url; const char *copyright; } zend_extension; // Tentative definition: no initializer static zend_extension opcache_extension_entry; // Full initialized definition static zend_extension opcache_extension_entry = { "OPcache", "8.0.0", "Zend Technologies", "http://www.zend.com/", "Copyright (c)" }; int main() { printf("Ok\n"); return 0; }chibicc-1.0.24/test/items.h000066400000000000000000000060231517770275000154470ustar00rootroot00000000000000#define HOT_LRU 0 #define WARM_LRU 64 #define COLD_LRU 128 #define TEMP_LRU 192 #define CLEAR_LRU(id) (id & ~(3<<6)) #define GET_LRU(id) (id & (3<<6)) /* See items.c */ uint64_t get_cas_id(void); void set_cas_id(uint64_t new_cas); /*@null@*/ item *do_item_alloc(const char *key, const size_t nkey, const unsigned int flags, const rel_time_t exptime, const int nbytes); item_chunk *do_item_alloc_chunk(item_chunk *ch, const size_t bytes_remain); item *do_item_alloc_pull(const size_t ntotal, const unsigned int id); void item_free(item *it); bool item_size_ok(const size_t nkey, const int flags, const int nbytes); int do_item_link(item *it, const uint32_t hv); /** may fail if transgresses limits */ void do_item_unlink(item *it, const uint32_t hv); void do_item_unlink_nolock(item *it, const uint32_t hv); void do_item_remove(item *it); void do_item_update(item *it); /** update LRU time to current and reposition */ void do_item_update_nolock(item *it); int do_item_replace(item *it, item *new_it, const uint32_t hv); void do_item_link_fixup(item *it); int item_is_flushed(item *it); unsigned int do_get_lru_size(uint32_t id); void do_item_linktail_q(item *it); void do_item_unlinktail_q(item *it); item *do_item_crawl_q(item *it); void *item_lru_bump_buf_create(void); #define LRU_PULL_EVICT 1 #define LRU_PULL_CRAWL_BLOCKS 2 #define LRU_PULL_RETURN_ITEM 4 /* fill info struct if available */ struct lru_pull_tail_return { item *it; uint32_t hv; }; int lru_pull_tail(const int orig_id, const int cur_lru, const uint64_t total_bytes, const uint8_t flags, const rel_time_t max_age, struct lru_pull_tail_return *ret_it); /*@null@*/ char *item_cachedump(const unsigned int slabs_clsid, const unsigned int limit, unsigned int *bytes); void item_stats(ADD_STAT add_stats, void *c); void do_item_stats_add_crawl(const int i, const uint64_t reclaimed, const uint64_t unfetched, const uint64_t checked); void item_stats_totals(ADD_STAT add_stats, void *c); /*@null@*/ void item_stats_sizes(ADD_STAT add_stats, void *c); void item_stats_sizes_init(void); void item_stats_sizes_enable(ADD_STAT add_stats, void *c); void item_stats_sizes_disable(ADD_STAT add_stats, void *c); void item_stats_sizes_add(item *it); void item_stats_sizes_remove(item *it); bool item_stats_sizes_status(void); /* stats getter for slab automover */ typedef struct { int64_t evicted; int64_t outofmemory; uint32_t age; } item_stats_automove; void fill_item_stats_automove(item_stats_automove *am); item *do_item_get(const char *key, const size_t nkey, const uint32_t hv, LIBEVENT_THREAD *t, const bool do_update); item *do_item_touch(const char *key, const size_t nkey, uint32_t exptime, const uint32_t hv, LIBEVENT_THREAD *t); void do_item_bump(LIBEVENT_THREAD *t, item *it, const uint32_t hv); void item_stats_reset(void); extern pthread_mutex_t lru_locks[POWER_LARGEST]; int start_lru_maintainer_thread(void *arg); int stop_lru_maintainer_thread(void); void lru_maintainer_pause(void); void lru_maintainer_resume(void); void *lru_bump_buf_create(void); chibicc-1.0.24/test/itoa_ljust.h000066400000000000000000000014661517770275000165110ustar00rootroot00000000000000#ifndef ITOA_LJUST_H #define ITOA_LJUST_H //=== itoa_ljust.h - Fast integer to ascii conversion // // Fast and simple integer to ASCII conversion: // // - 32 and 64-bit integers // - signed and unsigned // - user supplied buffer must be large enough for all decimal digits // in value plus minus sign if negative // - left-justified // - NUL terminated // - return value is pointer to NUL terminator // // Copyright (c) 2016 Arturo Martin-de-Nicolas // arturomdn@gmail.com // https://github.com/amdn/itoa_ljust/ //===----------------------------------------------------------------------===// #include char* itoa_u32(uint32_t u, char* buffer); char* itoa_32( int32_t i, char* buffer); char* itoa_u64(uint64_t u, char* buffer); char* itoa_64( int64_t i, char* buffer); #endif // ITOA_LJUST_H chibicc-1.0.24/test/limits.c000066400000000000000000000004561517770275000156260ustar00rootroot00000000000000 #include #include "test.h" int main() { printf("INT_MAX: %d\n", INT_MAX); printf("INT_MIN: %d\n", INT_MIN); printf("LONG_MAX: %ld\n", LONG_MAX); ASSERT(2147483647, INT_MAX); ASSERT(-2147483648, INT_MIN); ASSERT(9223372036854775807L, LONG_MAX); return 0; } chibicc-1.0.24/test/line.c000077500000000000000000000006461517770275000152600ustar00rootroot00000000000000#include "test.h" int main() { #line 500 "foo" ASSERT(500, __LINE__); ASSERT(0, strcmp(__FILE__, "foo")); #line 400 "test.h" ASSERT(400, __LINE__); ASSERT(0, strcmp(__FILE__, "test.h")); #line 800 "bar" ASSERT(800, __LINE__); ASSERT(0, strcmp(__FILE__, "bar")); #line 1 ASSERT(1, __LINE__); # 200 "xyz" 2 3 ASSERT(200, __LINE__); ASSERT(0, strcmp(__FILE__, "xyz")); printf("OK\n"); return 0; } chibicc-1.0.24/test/literal.c000077500000000000000000000047171517770275000157700ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(97, 'a'); ASSERT(10, '\n'); ASSERT(-128, '\x80'); ASSERT(511, 0777); ASSERT(0, 0x0); ASSERT(10, 0xa); ASSERT(10, 0XA); ASSERT(48879, 0xbeef); ASSERT(48879, 0xBEEF); ASSERT(48879, 0XBEEF); ASSERT(0, 0b0); ASSERT(1, 0b1); ASSERT(47, 0b101111); ASSERT(47, 0B101111); ASSERT(4, sizeof(0)); ASSERT(8, sizeof(0L)); ASSERT(8, sizeof(0LU)); ASSERT(8, sizeof(0UL)); ASSERT(8, sizeof(0LL)); ASSERT(8, sizeof(0LLU)); ASSERT(8, sizeof(0Ull)); ASSERT(8, sizeof(0l)); ASSERT(8, sizeof(0ll)); ASSERT(8, sizeof(0x0L)); ASSERT(8, sizeof(0b0L)); ASSERT(4, sizeof(2147483647)); ASSERT(8, sizeof(2147483648)); ASSERT(-1, 0xffffffffffffffff); ASSERT(8, sizeof(0xffffffffffffffff)); ASSERT(4, sizeof(4294967295U)); ASSERT(8, sizeof(4294967296U)); ASSERT(3, -1U>>30); ASSERT(3, -1Ul>>62); ASSERT(3, -1ull>>62); ASSERT(1, 0xffffffffffffffffl>>63); ASSERT(1, 0xffffffffffffffffll>>63); ASSERT(-1, 18446744073709551615); ASSERT(8, sizeof(18446744073709551615)); ASSERT(-1, 18446744073709551615>>63); ASSERT(-1, 0xffffffffffffffff); ASSERT(8, sizeof(0xffffffffffffffff)); ASSERT(1, 0xffffffffffffffff>>63); ASSERT(-1, 01777777777777777777777); ASSERT(8, sizeof(01777777777777777777777)); ASSERT(1, 01777777777777777777777>>63); ASSERT(-1, 0b1111111111111111111111111111111111111111111111111111111111111111); ASSERT(8, sizeof(0b1111111111111111111111111111111111111111111111111111111111111111)); ASSERT(1, 0b1111111111111111111111111111111111111111111111111111111111111111>>63); ASSERT(8, sizeof(2147483648)); ASSERT(4, sizeof(2147483647)); ASSERT(8, sizeof(0x1ffffffff)); ASSERT(4, sizeof(0xffffffff)); ASSERT(1, 0xffffffff>>31); ASSERT(8, sizeof(040000000000)); ASSERT(4, sizeof(037777777777)); ASSERT(1, 037777777777>>31); ASSERT(8, sizeof(0b111111111111111111111111111111111)); ASSERT(4, sizeof(0b11111111111111111111111111111111)); ASSERT(1, 0b11111111111111111111111111111111>>31); ASSERT(-1, 1 << 31 >> 31); ASSERT(-1, 01 << 31 >> 31); ASSERT(-1, 0x1 << 31 >> 31); ASSERT(-1, 0b1 << 31 >> 31); 0.0; 1.0; 3e+8; 0x10.1p0; .1E4f; float f1 = 8.00f; ASSERT(4, sizeof(f1)); ASSERT(4, sizeof(0.3F)); ASSERT(8, sizeof(0.)); ASSERT(8, sizeof(.0)); ASSERT(16, sizeof(5.l)); ASSERT(16, sizeof(2.0L)); assert(1, size\ of(char), \ "sizeof(char)"); ASSERT(4, sizeof(L'\0')); ASSERT(97, L'a'); printf("OK\n"); return 0; } chibicc-1.0.24/test/logger.h000066400000000000000000000141511517770275000156060ustar00rootroot00000000000000/* logging functions */ #ifndef LOGGER_H #define LOGGER_H #include "bipbuffer.h" /* TODO: starttime tunable */ #define LOGGER_BUF_SIZE 1024 * 64 #define LOGGER_WATCHER_BUF_SIZE 1024 * 256 #define LOGGER_ENTRY_MAX_SIZE 2048 #define GET_LOGGER() ((logger *) pthread_getspecific(logger_key)); /* Inlined from memcached.h - should go into sub header */ typedef unsigned int rel_time_t; enum log_entry_type { LOGGER_ASCII_CMD = 0, LOGGER_EVICTION, LOGGER_ITEM_GET, LOGGER_ITEM_STORE, LOGGER_CRAWLER_STATUS, LOGGER_SLAB_MOVE, LOGGER_CONNECTION_NEW, LOGGER_CONNECTION_CLOSE, LOGGER_DELETIONS, #ifdef EXTSTORE LOGGER_EXTSTORE_WRITE, LOGGER_COMPACT_START, LOGGER_COMPACT_ABORT, LOGGER_COMPACT_READ_START, LOGGER_COMPACT_READ_END, LOGGER_COMPACT_END, LOGGER_COMPACT_FRAGINFO, #endif #ifdef PROXY LOGGER_PROXY_CONFIG, LOGGER_PROXY_RAW, LOGGER_PROXY_ERROR, LOGGER_PROXY_USER, LOGGER_PROXY_REQ, LOGGER_PROXY_BE_ERROR, #endif }; enum logger_ret_type { LOGGER_RET_OK = 0, LOGGER_RET_NOSPACE, LOGGER_RET_ERR }; enum logger_parse_entry_ret { LOGGER_PARSE_ENTRY_OK = 0, LOGGER_PARSE_ENTRY_FULLBUF, LOGGER_PARSE_ENTRY_FAILED }; typedef struct _logentry logentry; typedef struct _entry_details entry_details; typedef void (*entry_log_cb)(logentry *e, const entry_details *d, const void *entry, va_list ap); typedef int (*entry_parse_cb)(logentry *e, char *scratch); struct _entry_details { int reqlen; uint16_t eflags; entry_log_cb log_cb; entry_parse_cb parse_cb; char *format; }; /* log entry intermediary structures */ struct logentry_eviction { long long int exptime; int nbytes; uint32_t latime; uint16_t it_flags; uint8_t nkey; uint8_t clsid; char key[]; }; #ifdef EXTSTORE struct logentry_ext_write { long long int exptime; uint32_t latime; uint16_t it_flags; uint8_t nkey; uint8_t clsid; uint8_t bucket; char key[]; }; #endif struct logentry_item_get { uint8_t was_found; uint8_t nkey; uint8_t clsid; int nbytes; int sfd; char key[]; }; struct logentry_item_store { int status; int cmd; rel_time_t ttl; uint8_t nkey; uint8_t clsid; int nbytes; int sfd; char key[]; }; struct logentry_deletion { int nbytes; int cmd; uint8_t nkey; uint8_t clsid; char key[]; }; struct logentry_conn_event { int transport; int reason; int sfd; struct sockaddr_in6 addr; }; #ifdef PROXY struct logentry_proxy_req { unsigned short type; unsigned short code; int status; uint32_t reqlen; size_t dlen; size_t be_namelen; size_t be_portlen; long elapsed; char data[]; }; struct logentry_proxy_errbe { size_t errlen; size_t be_namelen; size_t be_portlen; size_t be_rbuflen; int be_depth; char data[]; }; #endif /* end intermediary structures */ /* WARNING: cuddled items aren't compatible with warm restart. more code * necessary to ensure log streams are all flushed/processed before stopping */ struct _logentry { enum log_entry_type event; uint8_t pad; uint16_t eflags; uint64_t gid; struct timeval tv; /* not monotonic! */ int size; union { char end; } data[]; }; #define LOG_SYSEVENTS (1<<1) /* threads start/stop/working */ #define LOG_FETCHERS (1<<2) /* get/gets/etc */ #define LOG_MUTATIONS (1<<3) /* set/append/incr/etc */ #define LOG_SYSERRORS (1<<4) /* malloc/etc errors */ #define LOG_CONNEVENTS (1<<5) /* new client, closed, etc */ #define LOG_EVICTIONS (1<<6) /* details of evicted items */ #define LOG_STRICT (1<<7) /* block worker instead of drop */ #define LOG_RAWCMDS (1<<9) /* raw ascii commands */ #define LOG_PROXYREQS (1<<10) /* command logs from proxy */ #define LOG_PROXYEVENTS (1<<11) /* error log stream from proxy */ #define LOG_PROXYUSER (1<<12) /* user generated logs from proxy */ #define LOG_DELETIONS (1<<13) /* see whats deleted */ typedef struct _logger { struct _logger *prev; struct _logger *next; pthread_mutex_t mutex; /* guard for this + *buf */ uint64_t written; /* entries written to the buffer */ uint64_t dropped; /* entries dropped */ uint64_t blocked; /* times blocked instead of dropped */ uint16_t fetcher_ratio; /* log one out of every N fetches */ uint16_t mutation_ratio; /* log one out of every N mutations */ uint16_t eflags; /* flags this logger should log */ bipbuf_t *buf; const entry_details *entry_map; } logger; enum logger_watcher_type { LOGGER_WATCHER_STDERR = 0, LOGGER_WATCHER_CLIENT = 1 }; typedef struct { void *c; /* original connection structure. still with source thread attached */ int sfd; /* client fd */ int id; /* id number for watcher list */ uint64_t skipped; /* lines skipped since last successful print */ uint64_t min_gid; /* don't show log entries older than this GID */ bool failed_flush; /* recently failed to write out (EAGAIN), wait before retry */ enum logger_watcher_type t; /* stderr, client, syslog, etc */ uint16_t eflags; /* flags we are interested in */ bipbuf_t *buf; /* per-watcher output buffer */ } logger_watcher; struct logger_stats { uint64_t worker_dropped; uint64_t worker_written; uint64_t watcher_skipped; uint64_t watcher_sent; uint64_t watcher_count; }; extern pthread_key_t logger_key; /* public functions */ void logger_init(void); void logger_stop(void); logger *logger_create(void); #define LOGGER_LOG(l, flag, type, ...) \ do { \ logger *myl = l; \ if (l == NULL) \ myl = GET_LOGGER(); \ if (myl->eflags & flag) \ logger_log(myl, type, __VA_ARGS__); \ } while (0) enum logger_ret_type logger_log(logger *l, const enum log_entry_type event, const void *entry, ...); enum logger_add_watcher_ret { LOGGER_ADD_WATCHER_TOO_MANY = 0, LOGGER_ADD_WATCHER_OK, LOGGER_ADD_WATCHER_FAILED }; enum logger_add_watcher_ret logger_add_watcher(void *c, const int sfd, uint16_t f); /* functions used by restart system */ uint64_t logger_get_gid(void); void logger_set_gid(uint64_t gid); #endif chibicc-1.0.24/test/long_double.c000066400000000000000000000012511517770275000166100ustar00rootroot00000000000000// test-tanl.c #include "test.h" #include #define ASSERT(cond) \ do { if (!(cond)) __builtin_abort(); } while (0) int main(void) { static const double inputs[] = { -1.0, -0.5, -0.1, 0.0, 0.1, 0.5, 1.0 }; for (int i = 0; i < (int)(sizeof(inputs)/sizeof(*inputs)); i++) { double x = inputs[i]; long double ld = (long double)x; long double tld = tanl(ld); double td = tan(x); /* Compare in long double domain */ long double diff = fabsl((long double)td - tld); ASSERT(diff < 1e-12L); } double x1 = 0.5; ASSERT(fabs(tan(x1) - tanl((long double)x1)) < 1e-12); printf("Ok \n"); return 0; } chibicc-1.0.24/test/long_double_stack.c000066400000000000000000000016251517770275000200020ustar00rootroot00000000000000#include "test.h" long double clobber(void) { asm("fninit\n"); return 2.0L; } long double add(long double a) { return a + (a + (a + (a + (a + (a + (a + (a + a))))))); } long double sub(long double a, long double b) { return a - (b - (b - (b - (b - (b - (b - (b - a))))))); } int main(void) { ASSERT(1, 10.0L == (3.0L + clobber() + 5.0L)); ASSERT(1, 71.0L == (3.0L + add(7.0L) + 5.0L)); long double res_sub = sub(97.0L, 2.0L); printf("sub(97.0L, 2.0L) = %Lf\n", res_sub); ASSERT(1, 200.0L == (3.0L + res_sub + 5.0L)); ASSERT(1, 191.9L < res_sub); ASSERT(1, 9.0L == (3.0L + (1.0L, 1.0L, 1.0L, 1.0L, 1.0L, 1.0L, 1.0L, 1.0L) + 5.0L)); long double v = -1.0L; ASSERT(1, 7.0L == (3.0L + ({v; v; v; v; v; v; v; v;}) + 5.0L)); long double w,x,y,z; w = x = y = z = v; ASSERT(1, -1.0L == w); ASSERT(1, -1.0L == x); ASSERT(1, -1.0L == y); ASSERT(1, -1.0L == z); printf("OK\n"); }chibicc-1.0.24/test/lscpu.c000066400000000000000000000011621517770275000154460ustar00rootroot00000000000000 #include #include "test.h" void test_variadic(const char *fmt, ...) { va_list ap; va_start(ap, fmt); // Assume you expect two ints: cores_per_socket and sockets int cores_per_socket = va_arg(ap, int); ASSERT(2, cores_per_socket); int sockets = va_arg(ap, int); ASSERT(1, sockets); va_end(ap); printf("Read cores_per_socket = %d\n", cores_per_socket); printf("Read sockets = %d\n", sockets); } int main() { int cores = 2; int sockets = 1; printf("Passing cores=%d, sockets=%d\n", cores, sockets); test_variadic("%d%d", cores, sockets); return 0; } chibicc-1.0.24/test/lscpu2.c000066400000000000000000000032411517770275000155300ustar00rootroot00000000000000 #include "test.h" #if defined(__x86_64__) || defined(__i386__) #define HYPERVISOR_INFO_LEAF 0x40000000 static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { __asm__( #if defined(__PIC__) && defined(__i386__) /* x86 PIC cannot clobber ebx -- gcc bitches */ "xchg %%ebx, %%esi;" "cpuid;" "xchg %%esi, %%ebx;" : "=S" (*ebx), #else "cpuid;" : "=b" (*ebx), #endif "=a" (*eax), "=c" (*ecx), "=d" (*edx) : "1" (op), "c"(0)); } int main(void) { unsigned int eax, ebx, ecx, edx; cpuid(HYPERVISOR_INFO_LEAF, &eax, &ebx, &ecx, &edx); // Print max supported leaf printf("CPUID 0x%08X: max supported leaf = 0x%08X\n", HYPERVISOR_INFO_LEAF, eax); ASSERT(1073741835, eax); // Vendor ID string is EBX, ECX, EDX concatenated as ASCII char vendor[13]; vendor[0] = (char)(ebx & 0xFF); vendor[1] = (char)((ebx >> 8) & 0xFF); vendor[2] = (char)((ebx >> 16) & 0xFF); vendor[3] = (char)((ebx >> 24) & 0xFF); vendor[4] = (char)(ecx & 0xFF); vendor[5] = (char)((ecx >> 8) & 0xFF); vendor[6] = (char)((ecx >> 16) & 0xFF); vendor[7] = (char)((ecx >> 24) & 0xFF); vendor[8] = (char)(edx & 0xFF); vendor[9] = (char)((edx >> 8) & 0xFF); vendor[10] = (char)((edx >> 16) & 0xFF); vendor[11] = (char)((edx >> 24) & 0xFF); vendor[12] = '\0'; printf("Hypervisor vendor ID: '%s'\n", vendor); return 0; } #else int main(void) { printf("CPUID is only supported on x86/x86_64 architectures.\n"); return 0; } #endif chibicc-1.0.24/test/lxc1.c000066400000000000000000000013241517770275000151670ustar00rootroot00000000000000 #include #include "test.h" /* Container's specific file/directory names */ #define LXC_CONFIG_FNAME "config" #define LXC_PARTIAL_FNAME "partial" #define LXC_ROOTFS_DNAME "rootfs" #define LXC_TIMESTAMP_FNAME "ts" #define LXC_COMMENT_FNAME "comment" #define ARRAY_SIZE(x) \ (__builtin_choose_expr(!__builtin_types_compatible_p(typeof(x), \ typeof(&*(x))), \ sizeof(x) / sizeof((x)[0]), ((void)0))) int main(int argc, char *argv[]) { int std_fds[] = {STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO}; printf("ARRAY_SIZE(std_fds) = %ld\n", ARRAY_SIZE(std_fds)); ASSERT(3, ARRAY_SIZE(std_fds)); return 0; }chibicc-1.0.24/test/macro.c000077500000000000000000000157251517770275000154360ustar00rootroot00000000000000#include "test.h" #include "include1.h" char *main_filename1 = __FILE__; int main_line1 = __LINE__; #define LINE() __LINE__ int main_line2 = LINE(); # /* */ # int ret3(void) { return 3; } int dbl(int x) { return x*x; } int add2(int x, int y) { return x + y; } int add6(int a, int b, int c, int d, int e, int f) { return a + b + c + d + e + f; } int main() { ASSERT(5, include1); ASSERT(7, include2); #if 0 #include "/no/such/file" ASSERT(0, 1); #if nested #endif #endif int m = 0; #if 1 m = 5; #endif ASSERT(5, m); #if 1 # if 0 # if 1 foo bar # endif # endif m = 3; #endif ASSERT(3, m); #if 1-1 # if 1 # endif # if 1 # else # endif # if 0 # else # endif m = 2; #else # if 1 m = 3; # endif #endif ASSERT(3, m); #if 1 m = 2; #else m = 3; #endif ASSERT(2, m); #if 1 m = 2; #else m = 3; #endif ASSERT(2, m); #if 0 m = 1; #elif 0 m = 2; #elif 3+5 m = 3; #elif 1*5 m = 4; #endif ASSERT(3, m); #if 1+5 m = 1; #elif 1 m = 2; #elif 3 m = 2; #endif ASSERT(1, m); #if 0 m = 1; #elif 1 # if 1 m = 2; # else m = 3; # endif #else m = 5; #endif ASSERT(2, m); int M1 = 5; #define M1 3 ASSERT(3, M1); #define M1 4 ASSERT(4, M1); #define M1 3+4+ ASSERT(12, M1 5); #define M1 3+4 ASSERT(23, M1*5); #define ASSERT_ assert( #define if 5 #define five "5" #define END ) ASSERT_ 5, if, five END; #undef ASSERT_ #undef if #undef five #undef END if (0); #define M 5 #if M m = 5; #else m = 6; #endif ASSERT(5, m); #define M 5 #if M-5 m = 6; #elif M m = 5; #endif ASSERT(5, m); int M2 = 6; #define M2 M2 + 3 ASSERT(9, M2); #define M3 M2 + 3 ASSERT(12, M3); int M4 = 3; #define M4 M5 * 5 #define M5 M4 + 2 ASSERT(13, M4); #ifdef M6 m = 5; #else m = 3; #endif ASSERT(3, m); #define M6 #ifdef M6 m = 5; #else m = 3; #endif ASSERT(5, m); #ifndef M7 m = 3; #else m = 5; #endif ASSERT(3, m); #define M7 #ifndef M7 m = 3; #else m = 5; #endif ASSERT(5, m); #if 0 #ifdef NO_SUCH_MACRO #endif #ifndef NO_SUCH_MACRO #endif #else #endif #define M7() 1 int M7 = 5; ASSERT(1, M7()); ASSERT(5, M7); #define M7 () ASSERT(3, ret3 M7); #define M8(x,y) x+y ASSERT(7, M8(3, 4)); #define M8(x,y) x*y ASSERT(24, M8(3+4, 4+5)); #define M8(x,y) (x)*(y) ASSERT(63, M8(3+4, 4+5)); #define M8(x,y) x y ASSERT(9, M8(, 4+5)); #define M8(x,y) x*y ASSERT(20, M8((2+3), 4)); #define M8(x,y) x*y ASSERT(12, M8((2,3), 4)); #define dbl(x) M10(x) * x #define M10(x) dbl(x) + 3 ASSERT(10, dbl(2)); #define M11(x) #x ASSERT('a', M11( a!b `""c)[0]); ASSERT('!', M11( a!b `""c)[1]); ASSERT('b', M11( a!b `""c)[2]); ASSERT(' ', M11( a!b `""c)[3]); ASSERT('`', M11( a!b `""c)[4]); ASSERT('"', M11( a!b `""c)[5]); ASSERT('"', M11( a!b `""c)[6]); ASSERT('c', M11( a!b `""c)[7]); ASSERT(0, M11( a!b `""c)[8]); #define paste(x,y) x##y ASSERT(15, paste(1,5)); ASSERT(255, paste(0,xff)); ASSERT(3, ({ int foobar=3; paste(foo,bar); })); ASSERT(5, paste(5,)); ASSERT(5, paste(,5)); #define i 5 ASSERT(101, ({ int i3=100; paste(1+i,3); })); #undef i #define paste2(x) x##5 ASSERT(26, paste2(1+2)); #define paste3(x) 2##x ASSERT(23, paste3(1+2)); #define paste4(x, y, z) x##y##z ASSERT(123, paste4(1,2,3)); #define M12 #if defined(M12) m = 3; #else m = 4; #endif ASSERT(3, m); #define M12 #if defined M12 m = 3; #else m = 4; #endif ASSERT(3, m); #if defined(M12) - 1 m = 3; #else m = 4; #endif ASSERT(4, m); #if defined(NO_SUCH_MACRO) m = 3; #else m = 4; #endif ASSERT(4, m); #if no_such_symbol == 0 m = 5; #else m = 6; #endif ASSERT(5, m); #if __has_include("include1.h") m = 7; #else m = 8; #endif ASSERT(7, m); #if __has_include() m = 9; #else m = 10; #endif ASSERT(9, m); #if __has_include("definitely_missing_header_for_chibicc_tests.h") m = 11; #else m = 12; #endif ASSERT(12, m); #if __has_include_next("include1.h") m = 13; #else m = 14; #endif ASSERT(14, m); #if __has_include_next() m = 15; #else m = 16; #endif ASSERT(15, m); #define STR(x) #x #define M12(x) STR(x) #define M13(x) M12(foo.x) ASSERT(0, strcmp(M13(bar), "foo.bar")); #define M13(x) M12(foo. x) ASSERT(0, strcmp(M13(bar), "foo. bar")); #define M12 foo #define M13(x) STR(x) #define M14(x) M13(x.M12) ASSERT(0, strcmp(M14(bar), "bar.foo")); #define M14(x) M13(x. M12) ASSERT(0, strcmp(M14(bar), "bar. foo")); #include "include3.h" ASSERT(3, foo); #include "include4.h" ASSERT(4, foo); #define M13 "include3.h" #include M13 ASSERT(3, foo); #define M13 < include4.h #include M13 > ASSERT(4, foo); #undef foo ASSERT(1, __STDC__); ASSERT(0, strcmp(main_filename1, "test/macro.c")); ASSERT(5, main_line1); ASSERT(7, main_line2); ASSERT(0, strcmp(include1_filename, "test/include1.h")); ASSERT(4, include1_line); #define M14(...) 3 ASSERT(3, M14()); #define M14(...) __VA_ARGS__ ASSERT(2, M14() 2); ASSERT(5, M14(5)); #define M14(...) add2(__VA_ARGS__) ASSERT(8, M14(2, 6)); #define M14(...) add6(1,2,__VA_ARGS__,6) ASSERT(21, M14(3,4,5)); #define M14(x, ...) add6(1,2,x,__VA_ARGS__,6) ASSERT(21, M14(3,4,5)); #define M14(args...) 3 ASSERT(3, M14()); #define M14(x, ...) x ASSERT(5, M14(5)); #define M14(args...) args ASSERT(2, M14() 2); ASSERT(5, M14(5)); #define M14(args...) add2(args) ASSERT(8, M14(2, 6)); #define M14(args...) add6(1,2,args,6) ASSERT(21, M14(3,4,5)); #define M14(x, args...) add6(1,2,x,args,6) ASSERT(21, M14(3,4,5)); #define M14(x, args...) x ASSERT(5, M14(5)); #define CONCAT(x,y) x##y ASSERT(5, ({ int f0zz=5; CONCAT(f,0zz); })); ASSERT(5, ({ CONCAT(4,.57) + 0.5; })); ASSERT(11, strlen(__DATE__)); ASSERT(8, strlen(__TIME__)); ASSERT(0, __COUNTER__); ASSERT(1, __COUNTER__); ASSERT(2, __COUNTER__); ASSERT(24, strlen(__TIMESTAMP__)); ASSERT(0, strcmp(__BASE_FILE__, "test/macro.c")); #define M30(buf, fmt, ...) sprintf(buf, fmt __VA_OPT__(,) __VA_ARGS__) ASSERT(0, ({ char buf[100]; M30(buf, "foo"); strcmp(buf, "foo"); })); ASSERT(0, ({ char buf[100]; M30(buf, "foo%d", 3); strcmp(buf, "foo3"); })); ASSERT(0, ({ char buf[100]; M30(buf, "foo%d%d", 3, 5); strcmp(buf, "foo35"); })); #define M31(buf, fmt, ...) sprintf(buf, fmt, ## __VA_ARGS__) ASSERT(0, ({ char buf[100]; M31(buf, "foo"); strcmp(buf, "foo"); })); ASSERT(0, ({ char buf[100]; M31(buf, "foo%d", 3); strcmp(buf, "foo3"); })); ASSERT(0, ({ char buf[100]; M31(buf, "foo%d%d", 3, 5); strcmp(buf, "foo35"); })); #define M31(x, y) (1, ##x y) ASSERT(3, M31(, 3)); #define M32 3 ## 4 ## 5 ASSERT(345, M32); #define M33(...) # \ __VA_ARGS__ #define M34(x, ...) # \ __VA_ARGS__ ASSERT(0, strcmp(M33(1,2,3,4), "1,2,3,4")); ASSERT(0, strcmp(M34(1,2,3,4), "2,3,4")); #define M35(x, y, z) x ## y ## z ASSERT(123, M35(1,2,3)); ASSERT(45, M35(,4,5)); ASSERT(67, M35(6,,7)); ASSERT(89, M35(8,9,)); ASSERT(10, M35(10,,)); ASSERT(11, M35(,11,)); ASSERT(12, M35(,,12)); #define M36 - int p = 2; int q = p M36-p; ASSERT(4, q); printf("OK\n"); return 0; } chibicc-1.0.24/test/macro4.c000066400000000000000000000011221517770275000155010ustar00rootroot00000000000000#include "test.h" #define EMPTY() #define H(x) #x #define STR(x) H(x) int main (void) { ASSERT(0, strcmp("+( )", STR(+EMPTY()( )) )); ASSERT(0, strcmp("a ( )", STR(a EMPTY()( )) )); ASSERT(0, strcmp("+ ()", STR(+EMPTY() ()) )); ASSERT(0, strcmp("a ()", STR(a EMPTY() ()) )); ASSERT(0, strcmp("+()", STR(+EMPTY( )()) )); ASSERT(0, strcmp("a ()", STR(a EMPTY( )()) )); ASSERT(0, strcmp("+()", STR(+EMPTY ()()) )); ASSERT(0, strcmp("a ()", STR(a EMPTY ()()) )); ASSERT(0, strcmp("+ ()", STR(+ EMPTY()()) )); ASSERT(0, strcmp("a ()", STR(a EMPTY()()) )); printf("OK\n"); }chibicc-1.0.24/test/math.c000066400000000000000000000045701517770275000152570ustar00rootroot00000000000000// test/math.c #include #include #include static void test_trig(void) { double x = 0.5; assert(isunordered(NAN, 1.0)); assert(fabs(sin(x) - sinl((long double)x)) < 1e-12); assert(fabs(cos(x) - cosl((long double)x)) < 1e-12); assert(fabs(tan(x) - tanl((long double)x)) < 1e-12); assert(fabs(asin(sin(x)) - x) < 1e-12); assert(fabs(acos(cos(x)) - x) < 1e-12); assert(fabs(atan(tan(x)) - x) < 1e-12); assert(fabs(atan2(1.0, 1.0) - M_PI / 4) < 1e-12); } static void test_hyperbolic(void) { double x = 0.3; assert(fabs(tanh(x) - sinh(x) / cosh(x)) < 1e-12); assert(fabsl(tanhl((long double)x)) < 1.0); assert(fabsl(sinhl((long double)x)) > 0.0); } static void test_exp_log(void) { int e; double x = 8.0; assert(frexp(x, &e) == 0.5); assert(e == 4); assert(ldexp(0.5, 4) == x); double ip; assert(modf(3.25, &ip) == 0.25); assert(ip == 3.0); assert(fabs(log(exp(1.0)) - 1.0) < 1e-12); assert(fabs(log10(1000.0) - 3.0) < 1e-12); } static void test_power_abs(void) { assert(pow(2.0, 3.0) == 8.0); assert(sqrt(9.0) == 3.0); assert(fabs(-1.25) == 1.25); assert(fmod(5.5, 2.0) == 1.5); assert(cbrt(8.0) == 2.0); assert(asinh(0.0) == 0.0); assert(acosh(1.0) == 0.0); assert(atanh(0.0) == 0.0); } static void test_special(void) { assert(erf(0.0) == 0.0); assert(erfc(0.0) == 1.0); assert(tgamma(1.0) == 1.0); assert(lgamma(1.0) == 0.0); assert(log1p(0.0) == 0.0); assert(expm1(0.0) == 0.0); } static void test_rounding(void) { assert(floor(1.9) == 1.0); assert(ceil(1.1) == 2.0); assert(trunc(-1.9) == -1.0); assert(round(1.5) == 2.0); assert(rint(2.0) == 2.0); assert(lround(2.3) == 2); assert(llround(2.7) == 3); } static void test_minmax_next(void) { assert(fmax(1.0, 2.0) == 2.0); assert(fmin(1.0, 2.0) == 1.0); double x = 1.0; double y = nextafter(x, 2.0); assert(y > x); } static void test_classify(void) { assert(isnan(NAN)); assert(isinf(INFINITY)); assert(isfinite(1.0)); assert(fpclassify(0.0) == FP_ZERO); assert(signbit(-1.0)); assert(!signbit(1.0)); assert(isless(1.0, 2.0)); assert(isgreater(2.0, 1.0)); assert(islessequal(2.0, 2.0)); assert(isgreaterequal(2.0, 2.0)); } int main(void) { test_trig(); test_hyperbolic(); test_exp_log(); test_power_abs(); test_special(); test_rounding(); test_minmax_next(); test_classify(); return 0; } chibicc-1.0.24/test/math_issue.c000066400000000000000000000011461517770275000164630ustar00rootroot00000000000000#include "test.h" #include int main(void) { double x = 1.25; double y = -1.25; printf("isnormal(1.25) = %d\n", isnormal(x)); printf("issubnormal(1.25) = %d\n", fpclassify(x) == FP_SUBNORMAL); printf("signbit(-1.25) = %d\n", signbit(y)); printf("isnormal(1.25) = %d\n", isnormal(1.25)); printf("issubnormal(1.25) = %d\n", fpclassify(1.25) == FP_SUBNORMAL); ASSERT(1, isnormal(x)); ASSERT(0, fpclassify(x) == FP_SUBNORMAL); ASSERT(1, signbit(y)); ASSERT(1, isnormal(1.25)); ASSERT(0, fpclassify(1.25) == FP_SUBNORMAL); return 0; } chibicc-1.0.24/test/memcached.c000066400000000000000000000064671517770275000162430ustar00rootroot00000000000000#define _GNU_SOURCE #include #include #include #include #include #include #include #include /* --- Memcached binary protocol helpers --- */ struct mc_header { uint8_t magic; uint8_t opcode; uint16_t keylen; uint8_t extlen; uint8_t datatype; uint16_t status; uint32_t bodylen; uint32_t opaque; uint64_t cas; } __attribute__((packed)); static void send_binary_set(int fd, const char *key, const char *val, size_t vlen) { struct mc_header h; memset(&h, 0, sizeof(h)); h.magic = 0x80; // request h.opcode = 0x01; // SET h.keylen = htons(strlen(key)); h.extlen = 8; // flags + expiration h.bodylen = htonl(8 + strlen(key) + vlen); uint32_t flags = htonl(0); uint32_t exptime = htonl(0); write(fd, &h, sizeof(h)); write(fd, &flags, 4); write(fd, &exptime, 4); write(fd, key, strlen(key)); write(fd, val, vlen); struct mc_header resp; read(fd, &resp, sizeof(resp)); } static int send_binary_get(int fd, const char *key, char *buf, size_t buflen) { struct mc_header h; memset(&h, 0, sizeof(h)); h.magic = 0x80; h.opcode = 0x00; // GET h.keylen = htons(strlen(key)); h.bodylen = htonl(strlen(key)); write(fd, &h, sizeof(h)); write(fd, key, strlen(key)); struct mc_header resp; int r = read(fd, &resp, sizeof(resp)); if (r <= 0) return -1; uint32_t bl = ntohl(resp.bodylen); if (bl > buflen) bl = buflen; // extlen (flags) = 4 bytes if (bl > 4) { uint32_t tmp; read(fd, &tmp, 4); return read(fd, buf, bl - 4); } return 0; } /* ---- Worker thread: repeatedly set/get large values ---- */ static void worker(const char *host, int port, int worker_id) { int fd = socket(AF_INET, SOCK_STREAM, 0); if (fd < 0) _exit(1); struct sockaddr_in sa; memset(&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; sa.sin_port = htons(port); inet_pton(AF_INET, host, &sa.sin_addr); if (connect(fd, (struct sockaddr*)&sa, sizeof(sa)) < 0) _exit(2); printf("[worker %d] connected\n", worker_id); char *large = malloc(2 * 1024 * 1024); // 2MB payload -> triggers extstore memset(large, 'A' + (worker_id % 26), 2 * 1024 * 1024); char recvbuf[2 * 1024 * 1024]; for (int i = 0; i < 100; i++) { send_binary_set(fd, "ext_key", large, 2 * 1024 * 1024); int got = send_binary_get(fd, "ext_key", recvbuf, sizeof(recvbuf)); if (got <= 0) { printf("[worker %d] GET failed at iteration %d\n", worker_id, i); _exit(3); } } printf("[worker %d] done\n", worker_id); close(fd); _exit(0); } /* ---- Main ---- */ int main(int argc, char **argv) { const char *host = "127.0.0.1"; int port = 11211; int workers = 4; printf("Starting synthetic binary-extstore test\n"); for (int i = 0; i < workers; i++) { pid_t pid = fork(); if (pid == 0) worker(host, port, i); } int status; while (wait(&status) > 0) { if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) printf("Worker exited with failure\n"); } printf("All workers done\n"); return 0; } chibicc-1.0.24/test/memcached.h000066400000000000000000001152641517770275000162440ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /** \file * The main memcached header holding commonly used data * structures and function prototypes. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include /* need this to get IOV_MAX on some platforms. */ #ifndef __need_IOV_MAX #define __need_IOV_MAX #endif #include /* FreeBSD 4.x doesn't have IOV_MAX exposed. */ #ifndef IOV_MAX #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__GNU__) || defined(__GNUC__) # define IOV_MAX 1024 /* GNU/Hurd don't set MAXPATHLEN * http://www.gnu.org/software/hurd/hurd/porting/guidelines.html#PATH_MAX_tt_MAX_PATH_tt_MAXPATHL */ #ifndef MAXPATHLEN #define MAXPATHLEN 4096 #endif #endif #endif #if defined(__linux__) # define SOCK_COOKIE_ID SO_MARK #elif defined(__FreeBSD__) # define SOCK_COOKIE_ID SO_USER_COOKIE #elif defined(__OpenBSD__) # define SOCK_COOKIE_ID SO_RTABLE #endif #include "itoa_ljust.h" #include "protocol_binary.h" #include "cache.h" #include "logger.h" #ifdef EXTSTORE #include "crc32c.h" #endif #include "sasl_defs.h" #ifdef TLS #include #endif /* for NAPI pinning feature */ #ifndef SO_INCOMING_NAPI_ID #define SO_INCOMING_NAPI_ID 56 #endif /** Maximum length of a key. */ #define KEY_MAX_LENGTH 250 /** Maximum length of a uri encoded key. */ #define KEY_MAX_URI_ENCODED_LENGTH (KEY_MAX_LENGTH * 3 + 1) /** Size of an incr buf. */ #define INCR_MAX_STORAGE_LEN 24 #define WRITE_BUFFER_SIZE 1024 #define READ_BUFFER_SIZE 16384 #define READ_BUFFER_CACHED 0 #define UDP_READ_BUFFER_SIZE 65536 #define UDP_MAX_PAYLOAD_SIZE 1400 #define UDP_HEADER_SIZE 8 #define UDP_DATA_SIZE 1392 // UDP_MAX_PAYLOAD_SIZE - UDP_HEADER_SIZE #define MAX_SENDBUF_SIZE (256 * 1024 * 1024) /* Binary protocol stuff */ #define BIN_MAX_EXTLEN 20 // length of the _incr command is currently the longest. /* Initial power multiplier for the hash table */ #define HASHPOWER_DEFAULT 16 #define HASHPOWER_MAX 32 /* * We only reposition items in the LRU queue if they haven't been repositioned * in this many seconds. That saves us from churning on frequently-accessed * items. */ #define ITEM_UPDATE_INTERVAL 60 /* * Valid range of the maximum size of an item, in bytes. */ #define ITEM_SIZE_MAX_LOWER_LIMIT 1024 #define ITEM_SIZE_MAX_UPPER_LIMIT 1024 * 1024 * 1024 /* Slab sizing definitions. */ #define POWER_SMALLEST 1 #define POWER_LARGEST 256 /* actual cap is 255 */ #define SLAB_GLOBAL_PAGE_POOL 0 /* magic slab class for storing pages for reassignment */ #define CHUNK_ALIGN_BYTES 8 /* slab class max is a 6-bit number, -1. */ #define MAX_NUMBER_OF_SLAB_CLASSES (63 + 1) /** How long an object can reasonably be assumed to be locked before harvesting it on a low memory condition. Default: disabled. */ #define TAIL_REPAIR_TIME_DEFAULT 0 /* warning: don't use these macros with a function, as it evals its arg twice */ #define ITEM_get_cas(i) (((i)->it_flags & ITEM_CAS) ? \ (i)->data->cas : (uint64_t)0) #define ITEM_set_cas(i,v) { \ if ((i)->it_flags & ITEM_CAS) { \ (i)->data->cas = v; \ } \ } #define ITEM_key(item) (((char*)&((item)->data)) \ + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) #define ITEM_suffix(item) ((char*) &((item)->data) + (item)->nkey + 1 \ + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) #define ITEM_data(item) ((char*) &((item)->data) + (item)->nkey + 1 \ + (((item)->it_flags & ITEM_CFLAGS) ? sizeof(uint32_t) : 0) \ + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) #define ITEM_ntotal(item) (sizeof(struct _stritem) + (item)->nkey + 1 \ + (item)->nbytes \ + (((item)->it_flags & ITEM_CFLAGS) ? sizeof(uint32_t) : 0) \ + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) #define ITEM_clsid(item) ((item)->slabs_clsid & ~(3<<6)) #define ITEM_lruid(item) ((item)->slabs_clsid & (3<<6)) #define STAT_KEY_LEN 128 #define STAT_VAL_LEN 128 /** Append a simple stat with a stat name, value format and value */ #define APPEND_STAT(name, fmt, val) \ append_stat(name, add_stats, c, fmt, val); /** Append an indexed stat with a stat name (with format), value format and value */ #define APPEND_NUM_FMT_STAT(name_fmt, num, name, fmt, val) \ klen = snprintf(key_str, STAT_KEY_LEN, name_fmt, num, name); \ vlen = snprintf(val_str, STAT_VAL_LEN, fmt, val); \ add_stats(key_str, klen, val_str, vlen, c); /** Common APPEND_NUM_FMT_STAT format. */ #define APPEND_NUM_STAT(num, name, fmt, val) \ APPEND_NUM_FMT_STAT("%d:%s", num, name, fmt, val) /** Item client flag conversion */ #define FLAGS_CONV(it, flag) { \ if ((it)->it_flags & ITEM_CFLAGS) { \ flag = *((uint32_t *)ITEM_suffix((it))); \ } else { \ flag = 0; \ } \ } #define FLAGS_SIZE(item) (((item)->it_flags & ITEM_CFLAGS) ? sizeof(uint32_t) : 0) /** * Callback for any function producing stats. * * @param key the stat's key * @param klen length of the key * @param val the stat's value in an ascii form (e.g. text form of a number) * @param vlen length of the value * @parm cookie magic callback cookie */ typedef void (*ADD_STAT)(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, const void *cookie); /* * NOTE: If you modify this table you _MUST_ update the function state_text */ /** * Possible states of a connection. */ enum conn_states { conn_listening, /**< the socket which listens for connections */ conn_new_cmd, /**< Prepare connection for next command */ conn_waiting, /**< waiting for a readable socket */ conn_read, /**< reading in a command line */ conn_parse_cmd, /**< try to parse a command from the input buffer */ conn_write, /**< writing out a simple response */ conn_nread, /**< reading in a fixed number of bytes */ conn_swallow, /**< swallowing unnecessary bytes w/o storing */ conn_closing, /**< closing this connection */ conn_mwrite, /**< writing out many items sequentially */ conn_closed, /**< connection is closed */ conn_watch, /**< held by the logger thread as a watcher */ conn_io_queue, /**< wait on async. process to get response object */ conn_max_state /**< Max state value (used for assertion) */ }; enum bin_substates { bin_no_state, bin_reading_set_header, bin_reading_cas_header, bin_read_set_value, bin_reading_get_key, bin_reading_stat, bin_reading_del_header, bin_reading_incr_header, bin_read_flush_exptime, bin_reading_sasl_auth, bin_reading_sasl_auth_data, bin_reading_touch_key, }; enum protocol { ascii_prot = 3, /* arbitrary value. */ binary_prot, negotiating_prot, /* Discovering the protocol */ #ifdef PROXY proxy_prot, #endif }; enum network_transport { local_transport, /* Unix sockets*/ tcp_transport, udp_transport }; enum pause_thread_types { PAUSE_WORKER_THREADS = 0, PAUSE_ALL_THREADS, RESUME_ALL_THREADS, RESUME_WORKER_THREADS }; enum stop_reasons { NOT_STOP, GRACE_STOP, EXIT_NORMALLY }; enum close_reasons { ERROR_CLOSE, NORMAL_CLOSE, IDLE_TIMEOUT_CLOSE, SHUTDOWN_CLOSE, }; #define IS_TCP(x) (x == tcp_transport) #define IS_UDP(x) (x == udp_transport) #define NREAD_ADD 1 #define NREAD_SET 2 #define NREAD_REPLACE 3 #define NREAD_APPEND 4 #define NREAD_PREPEND 5 #define NREAD_CAS 6 #define NREAD_APPENDVIV 7 // specific to meta #define NREAD_PREPENDVIV 8 // specific to meta #define CAS_ALLOW_STALE true #define CAS_NO_STALE false #define LOG_TYPE_DELETE 1 #define LOG_TYPE_META_DELETE 2 enum store_item_type { NOT_STORED=0, STORED, EXISTS, NOT_FOUND, TOO_LARGE, NO_MEMORY }; enum delta_result_type { OK, NON_NUMERIC, EOM, DELTA_ITEM_NOT_FOUND, DELTA_ITEM_CAS_MISMATCH }; /** Time relative to server start. Smaller than time_t on 64-bit systems. */ // TODO: Move to sub-header. needed in logger.h //typedef unsigned int rel_time_t; /** Use X macros to avoid iterating over the stats fields during reset and * aggregation. No longer have to add new stats in 3+ places. */ #define SLAB_STATS_FIELDS \ X(set_cmds) \ X(get_hits) \ X(touch_hits) \ X(delete_hits) \ X(cas_hits) \ X(cas_badval) \ X(incr_hits) \ X(decr_hits) /** Stats stored per slab (and per thread). */ struct slab_stats { #define X(name) uint64_t name; SLAB_STATS_FIELDS #undef X }; #define THREAD_STATS_FIELDS \ X(get_cmds) \ X(get_misses) \ X(get_expired) \ X(get_flushed) \ X(touch_cmds) \ X(touch_misses) \ X(delete_misses) \ X(incr_misses) \ X(decr_misses) \ X(cas_misses) \ X(meta_cmds) \ X(bytes_read) \ X(bytes_written) \ X(flush_cmds) \ X(conn_yields) /* # of yields for connections (-R option)*/ \ X(auth_cmds) \ X(auth_errors) \ X(idle_kicks) /* idle connections killed */ \ X(response_obj_oom) \ X(response_obj_count) \ X(response_obj_bytes) \ X(read_buf_oom) \ X(store_too_large) \ X(store_no_memory) #ifdef EXTSTORE #define EXTSTORE_THREAD_STATS_FIELDS \ X(get_extstore) \ X(get_aborted_extstore) \ X(get_oom_extstore) \ X(recache_from_extstore) \ X(miss_from_extstore) \ X(badcrc_from_extstore) #endif #ifdef PROXY #define PROXY_THREAD_STATS_FIELDS \ X(proxy_conn_requests) \ X(proxy_conn_errors) \ X(proxy_conn_oom) \ X(proxy_req_active) \ X(proxy_await_active) #endif /** * Stats stored per-thread. */ struct thread_stats { pthread_mutex_t mutex; #define X(name) uint64_t name; THREAD_STATS_FIELDS #ifdef EXTSTORE EXTSTORE_THREAD_STATS_FIELDS #endif #ifdef PROXY PROXY_THREAD_STATS_FIELDS #endif #undef X struct slab_stats slab_stats[MAX_NUMBER_OF_SLAB_CLASSES]; uint64_t lru_hits[POWER_LARGEST]; uint64_t read_buf_count; uint64_t read_buf_bytes; uint64_t read_buf_bytes_free; }; /** * Global stats. Only resettable stats should go into this structure. */ struct stats { uint64_t total_items; uint64_t total_conns; uint64_t rejected_conns; uint64_t malloc_fails; uint64_t listen_disabled_num; uint64_t slabs_moved; /* times slabs were moved around */ uint64_t slab_reassign_rescues; /* items rescued during slab move */ uint64_t slab_reassign_evictions_nomem; /* valid items lost during slab move */ uint64_t slab_reassign_inline_reclaim; /* valid items lost during slab move */ uint64_t slab_reassign_chunk_rescues; /* chunked-item chunks recovered */ uint64_t slab_reassign_busy_items; /* valid temporarily unmovable */ uint64_t slab_reassign_busy_deletes; /* refcounted items killed */ uint64_t lru_crawler_starts; /* Number of item crawlers kicked off */ uint64_t lru_maintainer_juggles; /* number of LRU bg pokes */ uint64_t time_in_listen_disabled_us; /* elapsed time in microseconds while server unable to process new connections */ uint64_t log_worker_dropped; /* logs dropped by worker threads */ uint64_t log_worker_written; /* logs written by worker threads */ uint64_t log_watcher_skipped; /* logs watchers missed */ uint64_t log_watcher_sent; /* logs sent to watcher buffers */ #ifdef EXTSTORE uint64_t extstore_compact_lost; /* items lost because they were locked */ uint64_t extstore_compact_rescues; /* items re-written during compaction */ uint64_t extstore_compact_skipped; /* unhit items skipped during compaction */ #endif #ifdef TLS uint64_t ssl_handshake_errors; /* TLS failures at accept/handshake time */ uint64_t ssl_new_sessions; /* successfully negotiated new (non-reused) TLS sessions */ #endif struct timeval maxconns_entered; /* last time maxconns entered */ uint64_t unexpected_napi_ids; /* see doc/napi_ids.txt */ uint64_t round_robin_fallback; /* see doc/napi_ids.txt */ }; /** * Global "state" stats. Reflects state that shouldn't be wiped ever. * Ordered for some cache line locality for commonly updated counters. */ struct stats_state { uint64_t curr_items; uint64_t curr_bytes; uint64_t curr_conns; uint64_t hash_bytes; /* size used for hash tables */ unsigned int conn_structs; unsigned int reserved_fds; unsigned int hash_power_level; /* Better hope it's not over 9000 */ unsigned int log_watchers; /* number of currently active watchers */ bool hash_is_expanding; /* If the hash table is being expanded */ bool accepting_conns; /* whether we are currently accepting */ bool slab_reassign_running; /* slab reassign in progress */ bool lru_crawler_running; /* crawl in progress */ }; #define MAX_VERBOSITY_LEVEL 2 /* When adding a setting, be sure to update process_stat_settings */ /** * Globally accessible settings as derived from the commandline. */ struct settings { size_t maxbytes; int maxconns; int port; int udpport; char *inter; int verbose; rel_time_t oldest_live; /* ignore existing items older than this */ uint64_t oldest_cas; /* ignore existing items with CAS values lower than this */ int evict_to_free; char *socketpath; /* path to unix socket if using local socket */ char *auth_file; /* path to user authentication file */ int access; /* access mask (a la chmod) for unix domain socket */ double factor; /* chunk size growth factor */ int chunk_size; int num_threads; /* number of worker (without dispatcher) libevent threads to run */ int num_threads_per_udp; /* number of worker threads serving each udp socket */ char prefix_delimiter; /* character that marks a key prefix (for stats) */ int detail_enabled; /* nonzero if we're collecting detailed stats */ int reqs_per_event; /* Maximum number of io to process on each io-event. */ bool use_cas; enum protocol binding_protocol; int backlog; int item_size_max; /* Maximum item size */ int slab_chunk_size_max; /* Upper end for chunks within slab pages. */ int slab_page_size; /* Slab's page units. */ volatile sig_atomic_t sig_hup; /* a HUP signal was received but not yet handled */ bool sasl; /* SASL on/off */ bool maxconns_fast; /* Whether or not to early close connections */ bool lru_crawler; /* Whether or not to enable the autocrawler thread */ bool lru_maintainer_thread; /* LRU maintainer background thread */ bool lru_segmented; /* Use split or flat LRU's */ bool slab_reassign; /* Whether or not slab reassignment is allowed */ int slab_automove; /* Whether or not to automatically move slabs */ double slab_automove_ratio; /* youngest must be within pct of oldest */ unsigned int slab_automove_window; /* window mover for algorithm */ int hashpower_init; /* Starting hash power level */ bool shutdown_command; /* allow shutdown command */ int tail_repair_time; /* LRU tail refcount leak repair time */ bool flush_enabled; /* flush_all enabled */ bool dump_enabled; /* whether cachedump/metadump commands work */ char *hash_algorithm; /* Hash algorithm in use */ int lru_crawler_sleep; /* Microsecond sleep between items */ uint32_t lru_crawler_tocrawl; /* Number of items to crawl per run */ int hot_lru_pct; /* percentage of slab space for HOT_LRU */ int warm_lru_pct; /* percentage of slab space for WARM_LRU */ double hot_max_factor; /* HOT tail age relative to COLD tail */ double warm_max_factor; /* WARM tail age relative to COLD tail */ int crawls_persleep; /* Number of LRU crawls to run before sleeping */ bool temp_lru; /* TTL < temporary_ttl uses TEMP_LRU */ uint32_t temporary_ttl; /* temporary LRU threshold */ int idle_timeout; /* Number of seconds to let connections idle */ unsigned int logger_watcher_buf_size; /* size of logger's per-watcher buffer */ unsigned int logger_buf_size; /* size of per-thread logger buffer */ unsigned int read_buf_mem_limit; /* total megabytes allowable for net buffers */ bool drop_privileges; /* Whether or not to drop unnecessary process privileges */ bool watch_enabled; /* allows watch commands to be dropped */ bool relaxed_privileges; /* Relax process restrictions when running testapp */ #ifdef EXTSTORE unsigned int ext_io_threadcount; /* number of IO threads to run. */ unsigned int ext_page_size; /* size in megabytes of storage pages. */ unsigned int ext_item_size; /* minimum size of items to store externally */ unsigned int ext_item_age; /* max age of tail item before storing ext. */ unsigned int ext_low_ttl; /* remaining TTL below this uses own pages */ unsigned int ext_recache_rate; /* counter++ % recache_rate == 0 > recache */ unsigned int ext_wbuf_size; /* read only note for the engine */ unsigned int ext_compact_under; /* when fewer than this many pages, compact */ unsigned int ext_drop_under; /* when fewer than this many pages, drop COLD items */ unsigned int ext_max_sleep; /* maximum sleep time for extstore bg threads, in us */ double ext_max_frag; /* ideal maximum page fragmentation */ double slab_automove_freeratio; /* % of memory to hold free as buffer */ bool ext_drop_unread; /* skip unread items during compaction */ /* start flushing to extstore after memory below this */ unsigned int ext_global_pool_min; #endif #ifdef TLS bool ssl_enabled; /* indicates whether SSL is enabled */ SSL_CTX *ssl_ctx; /* holds the SSL server context which has the server certificate */ char *ssl_chain_cert; /* path to the server SSL chain certificate */ char *ssl_key; /* path to the server key */ int ssl_verify_mode; /* client certificate verify mode */ int ssl_keyformat; /* key format , default is PEM */ char *ssl_ciphers; /* list of SSL ciphers */ char *ssl_ca_cert; /* certificate with CAs. */ rel_time_t ssl_last_cert_refresh_time; /* time of the last server certificate refresh */ unsigned int ssl_wbuf_size; /* size of the write buffer used by ssl_sendmsg method */ bool ssl_session_cache; /* enable SSL server session caching */ bool ssl_kernel_tls; /* enable server kTLS */ int ssl_min_version; /* minimum SSL protocol version to accept */ #endif int num_napi_ids; /* maximum number of NAPI IDs */ char *memory_file; /* warm restart memory file path */ #ifdef PROXY bool proxy_enabled; bool proxy_uring; /* if the proxy should use io_uring */ char *proxy_startfile; /* lua file to run when workers start */ void *proxy_ctx; /* proxy's state context */ #endif #ifdef SOCK_COOKIE_ID uint32_t sock_cookie_id; #endif }; extern struct stats stats; extern struct stats_state stats_state; extern time_t process_started; extern struct settings settings; #define ITEM_LINKED 1 #define ITEM_CAS 2 /* temp */ #define ITEM_SLABBED 4 /* Item was fetched at least once in its lifetime */ #define ITEM_FETCHED 8 /* Appended on fetch, removed on LRU shuffling */ #define ITEM_ACTIVE 16 /* If an item's storage are chained chunks. */ #define ITEM_CHUNKED 32 #define ITEM_CHUNK 64 /* ITEM_data bulk is external to item */ #define ITEM_HDR 128 /* additional 4 bytes for item client flags */ #define ITEM_CFLAGS 256 /* item has sent out a token already */ #define ITEM_TOKEN_SENT 512 /* reserved, in case tokens should be a 2-bit count in future */ #define ITEM_TOKEN_RESERVED 1024 /* if item has been marked as a stale value */ #define ITEM_STALE 2048 /* if item key was sent in binary */ #define ITEM_KEY_BINARY 4096 /** * Structure for storing items within memcached. */ typedef struct _stritem { /* Protected by LRU locks */ struct _stritem *next; struct _stritem *prev; /* Rest are protected by an item lock */ struct _stritem *h_next; /* hash chain next */ rel_time_t time; /* least recent access */ rel_time_t exptime; /* expire time */ int nbytes; /* size of data */ unsigned short refcount; uint16_t it_flags; /* ITEM_* above */ uint8_t slabs_clsid;/* which slab class we're in */ uint8_t nkey; /* key length, w/terminating null and padding */ /* this odd type prevents type-punning issues when we do * the little shuffle to save space when not using CAS. */ union { uint64_t cas; char end; } data[]; /* if it_flags & ITEM_CAS we have 8 bytes CAS */ /* then null-terminated key */ /* then " flags length\r\n" (no terminating null) */ /* then data with terminating \r\n (no terminating null; it's binary!) */ } item; // TODO: If we eventually want user loaded modules, we can't use an enum :( enum crawler_run_type { CRAWLER_AUTOEXPIRE=0, CRAWLER_EXPIRED, CRAWLER_METADUMP, CRAWLER_MGDUMP }; typedef struct { struct _stritem *next; struct _stritem *prev; struct _stritem *h_next; /* hash chain next */ rel_time_t time; /* least recent access */ rel_time_t exptime; /* expire time */ int nbytes; /* size of data */ unsigned short refcount; uint16_t it_flags; /* ITEM_* above */ uint8_t slabs_clsid;/* which slab class we're in */ uint8_t nkey; /* key length, w/terminating null and padding */ uint32_t remaining; /* Max keys to crawl per slab per invocation */ uint64_t reclaimed; /* items reclaimed during this crawl. */ uint64_t unfetched; /* items reclaimed unfetched during this crawl. */ uint64_t checked; /* items examined during this crawl. */ } crawler; /* Header when an item is actually a chunk of another item. */ typedef struct _strchunk { struct _strchunk *next; /* points within its own chain. */ struct _strchunk *prev; /* can potentially point to the head. */ struct _stritem *head; /* always points to the owner chunk */ int size; /* available chunk space in bytes */ int used; /* chunk space used */ int nbytes; /* used. */ unsigned short refcount; /* used? */ uint16_t it_flags; /* ITEM_* above. */ uint8_t slabs_clsid; /* Same as above. */ uint8_t orig_clsid; /* For obj hdr chunks slabs_clsid is fake. */ char data[]; } item_chunk; #ifdef NEED_ALIGN static inline char *ITEM_schunk(item *it) { int offset = it->nkey + 1 + ((it->it_flags & ITEM_CFLAGS) ? sizeof(uint32_t) : 0) + ((it->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0); int remain = offset % 8; if (remain != 0) { offset += 8 - remain; } return ((char *) &(it->data)) + offset; } #else #define ITEM_schunk(item) ((char*) &((item)->data) + (item)->nkey + 1 \ + (((item)->it_flags & ITEM_CFLAGS) ? sizeof(uint32_t) : 0) \ + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) #endif #ifdef EXTSTORE typedef struct { unsigned int page_version; /* from IO header */ unsigned int offset; /* from IO header */ unsigned short page_id; /* from IO header */ } item_hdr; #endif #define IO_QUEUE_COUNT 3 #define IO_QUEUE_NONE 0 #define IO_QUEUE_EXTSTORE 1 #define IO_QUEUE_PROXY 2 typedef struct _io_pending_t io_pending_t; typedef struct io_queue_s io_queue_t; typedef void (*io_queue_stack_cb)(io_queue_t *q); typedef void (*io_queue_cb)(io_pending_t *pending); // This structure used to be passed between threads, but is now owned entirely // by the worker threads. // IO pending objects are created and stacked into this structure. They are // then sent off to remote threads. // The objects are returned one at a time to the worker threads, and this // structure is then consulted to see when to resume the worker. struct io_queue_s { void *ctx; // duplicated from io_queue_cb_t void *stack_ctx; // module-specific context to be batch-submitted int count; // ios to process before returning. only accessed by queue processor once submitted int type; // duplicated from io_queue_cb_t }; typedef struct io_queue_cb_s { void *ctx; // untouched ptr for specific context io_queue_stack_cb submit_cb; // callback given a full stack of pending IO's at once. int type; } io_queue_cb_t; typedef struct _mc_resp_bundle mc_resp_bundle; typedef struct { pthread_t thread_id; /* unique ID of this thread */ struct event_base *base; /* libevent handle this thread uses */ struct event notify_event; /* listen event for notify pipe */ #ifdef HAVE_EVENTFD int notify_event_fd; /* notify counter */ #else int notify_receive_fd; /* receiving end of notify pipe */ int notify_send_fd; /* sending end of notify pipe */ #endif int cur_sfd; /* client fd for logging commands */ int thread_baseid; /* which "number" thread this is for data offsets */ struct thread_stats stats; /* Stats generated by this thread */ io_queue_cb_t io_queues[IO_QUEUE_COUNT]; struct conn_queue *ev_queue; /* Worker/conn event queue */ cache_t *rbuf_cache; /* static-sized read buffers */ mc_resp_bundle *open_bundle; cache_t *io_cache; /* IO objects */ #ifdef EXTSTORE void *storage; /* data object for storage system */ #endif logger *l; /* logger buffer */ void *lru_bump_buf; /* async LRU bump buffer */ #ifdef TLS char *ssl_wbuf; #endif int napi_id; /* napi id associated with this thread */ #ifdef PROXY void *proxy_ctx; // proxy global context void *L; // lua VM void *proxy_hooks; void *proxy_user_stats; void *proxy_int_stats; void *proxy_event_thread; // worker threads can also be proxy IO threads pthread_mutex_t proxy_limit_lock; uint64_t proxy_active_req_limit; uint64_t proxy_buffer_memory_limit; // protected by limit_lock uint64_t proxy_buffer_memory_used; // protected by limit_lock uint32_t proxy_rng[4]; // fast per-thread rng for lua. // TODO: add ctx object so we can attach to queue. #endif } LIBEVENT_THREAD; /** * Response objects */ #define MC_RESP_IOVCOUNT 4 typedef struct _mc_resp { mc_resp_bundle *bundle; // ptr back to bundle struct _mc_resp *next; // choo choo. int wbytes; // bytes to write out of wbuf: might be able to nuke this. int tosend; // total bytes to send for this response void *write_and_free; /** free this memory after finishing writing */ io_pending_t *io_pending; /* pending IO descriptor for this response */ item *item; /* item associated with this response object, with reference held */ struct iovec iov[MC_RESP_IOVCOUNT]; /* built-in iovecs to simplify network code */ int chunked_total; /* total amount of chunked item data to send. */ uint8_t iovcnt; uint8_t chunked_data_iov; /* this iov is a pointer to chunked data header */ /* instruct transmit to skip this response object. used by storage engines * to asynchronously kill an object that was queued to write */ bool skip; bool free; // double free detection. // UDP bits. Copied in from the client. uint16_t request_id; /* Incoming UDP request ID, if this is a UDP "connection" */ uint16_t udp_sequence; /* packet counter when transmitting result */ uint16_t udp_total; /* total number of packets in sequence */ struct sockaddr_in6 request_addr; /* udp: Who sent this request */ socklen_t request_addr_size; char wbuf[WRITE_BUFFER_SIZE]; } mc_resp; #define MAX_RESP_PER_BUNDLE ((READ_BUFFER_SIZE - sizeof(mc_resp_bundle)) / sizeof(mc_resp)) struct _mc_resp_bundle { uint8_t refcount; uint8_t next_check; // next object to check on assignment. struct _mc_resp_bundle *next; struct _mc_resp_bundle *prev; mc_resp r[]; }; typedef struct conn conn; struct _io_pending_t { int io_queue_type; // matches one of IO_QUEUE_* LIBEVENT_THREAD *thread; conn *c; mc_resp *resp; // associated response object io_queue_cb return_cb; // called on worker thread. io_queue_cb finalize_cb; // called back on the worker thread. char data[120]; }; /** * The structure representing a connection into memcached. */ struct conn { sasl_conn_t *sasl_conn; int sfd; bool sasl_started; bool authenticated; bool set_stale; bool mset_res; /** uses mset format for return code */ bool close_after_write; /** flush write then move to close connection */ bool rbuf_malloced; /** read buffer was malloc'ed for ascii mget, needs free() */ bool item_malloced; /** item for conn_nread state is a temporary malloc */ #ifdef TLS SSL *ssl; char *ssl_wbuf; bool ssl_enabled; #endif enum conn_states state; enum bin_substates substate; rel_time_t last_cmd_time; struct event event; short ev_flags; short which; /** which events were just triggered */ char *rbuf; /** buffer to read commands into */ char *rcurr; /** but if we parsed some already, this is where we stopped */ int rsize; /** total allocated size of rbuf */ int rbytes; /** how much data, starting from rcur, do we have unparsed */ mc_resp *resp; // tail response. mc_resp *resp_head; // first response in current stack. char *ritem; /** when we read in an item's value, it goes here */ int rlbytes; /** * item is used to hold an item structure created after reading the command * line of set/add/replace commands, but before we finished reading the actual * data. The data is read into ITEM_data(item) to avoid extra copying. */ void *item; /* for commands set/add/replace */ /* data for the swallow state */ int sbytes; /* how many bytes to swallow */ int io_queues_submitted; /* see notes on io_queue_t */ io_queue_t io_queues[IO_QUEUE_COUNT]; /* set of deferred IO queues. */ #ifdef PROXY unsigned int proxy_coro_ref; /* lua reference for active coroutine */ #endif #ifdef EXTSTORE unsigned int recache_counter; #endif enum protocol protocol; /* which protocol this connection speaks */ enum network_transport transport; /* what transport is used by this connection */ enum close_reasons close_reason; /* reason for transition into conn_closing */ /* data for UDP clients */ int request_id; /* Incoming UDP request ID, if this is a UDP "connection" */ struct sockaddr_in6 request_addr; /* udp: Who sent the most recent request */ socklen_t request_addr_size; bool noreply; /* True if the reply should not be sent. */ /* current stats command */ struct { char *buffer; size_t size; size_t offset; } stats; /* Binary protocol stuff */ /* This is where the binary header goes */ protocol_binary_request_header binary_header; uint64_t cas; /* the cas to return */ uint64_t tag; /* listener stocket tag */ short cmd; /* current command being processed */ int opaque; int keylen; conn *next; /* Used for generating a list of conn structures */ LIBEVENT_THREAD *thread; /* Pointer to the thread object serving this connection */ int (*try_read_command)(conn *c); /* pointer for top level input parser */ ssize_t (*read)(conn *c, void *buf, size_t count); ssize_t (*sendmsg)(conn *c, struct msghdr *msg, int flags); ssize_t (*write)(conn *c, void *buf, size_t count); }; /* array of conn structures, indexed by file descriptor */ extern conn **conns; /* current time of day (updated periodically) */ extern volatile rel_time_t current_time; #ifdef MEMCACHED_DEBUG extern volatile bool is_paused; extern volatile int64_t delta; #endif /* TODO: Move to slabs.h? */ extern volatile int slab_rebalance_signal; struct slab_rebalance { void *slab_start; void *slab_end; void *slab_pos; int s_clsid; int d_clsid; uint32_t busy_items; uint32_t rescues; uint32_t evictions_nomem; uint32_t inline_reclaim; uint32_t chunk_rescues; uint32_t busy_deletes; uint32_t busy_loops; uint8_t done; uint8_t *completed; }; extern struct slab_rebalance slab_rebal; #ifdef EXTSTORE extern void *ext_storage; #endif /* * Functions */ void do_accept_new_conns(const bool do_accept); enum delta_result_type do_add_delta(LIBEVENT_THREAD *t, const char *key, const size_t nkey, const bool incr, const int64_t delta, char *buf, uint64_t *cas, const uint32_t hv, item **it_ret); enum store_item_type do_store_item(item *item, int comm, LIBEVENT_THREAD *t, const uint32_t hv, int *nbytes, uint64_t *cas, bool cas_stale); void thread_io_queue_add(LIBEVENT_THREAD *t, int type, void *ctx, io_queue_stack_cb cb); void conn_io_queue_setup(conn *c); io_queue_t *conn_io_queue_get(conn *c, int type); io_queue_cb_t *thread_io_queue_get(LIBEVENT_THREAD *t, int type); void conn_io_queue_return(io_pending_t *io); conn *conn_new(const int sfd, const enum conn_states init_state, const int event_flags, const int read_buffer_size, enum network_transport transport, struct event_base *base, void *ssl, uint64_t conntag, enum protocol bproto); void conn_worker_readd(conn *c); extern int daemonize(int nochdir, int noclose); #define mutex_lock(x) pthread_mutex_lock(x) #define mutex_unlock(x) pthread_mutex_unlock(x) #include "stats_prefix.h" #include "slabs.h" #include "assoc.h" #include "items.h" #include "crawler.h" #include "trace.h" #include "hash.h" #include "util.h" /* * Functions such as the libevent-related calls that need to do cross-thread * communication in multithreaded mode (rather than actually doing the work * in the current thread) are called via "dispatch_" frontends, which are * also #define-d to directly call the underlying code in singlethreaded mode. */ void memcached_thread_init(int nthreads, void *arg); void redispatch_conn(conn *c); void timeout_conn(conn *c); #ifdef PROXY void proxy_reload_notify(LIBEVENT_THREAD *t); #endif void return_io_pending(io_pending_t *io); void dispatch_conn_new(int sfd, enum conn_states init_state, int event_flags, int read_buffer_size, enum network_transport transport, void *ssl, uint64_t conntag, enum protocol bproto); void sidethread_conn_close(conn *c); /* Lock wrappers for cache functions that are called from main loop. */ enum delta_result_type add_delta(LIBEVENT_THREAD *t, const char *key, const size_t nkey, bool incr, const int64_t delta, char *buf, uint64_t *cas); void accept_new_conns(const bool do_accept); void conn_close_idle(conn *c); void conn_close_all(void); item *item_alloc(const char *key, size_t nkey, int flags, rel_time_t exptime, int nbytes); #define DO_UPDATE true #define DONT_UPDATE false item *item_get(const char *key, const size_t nkey, LIBEVENT_THREAD *t, const bool do_update); item *item_get_locked(const char *key, const size_t nkey, LIBEVENT_THREAD *t, const bool do_update, uint32_t *hv); item *item_touch(const char *key, const size_t nkey, uint32_t exptime, LIBEVENT_THREAD *t); int item_link(item *it); void item_remove(item *it); int item_replace(item *it, item *new_it, const uint32_t hv); void item_unlink(item *it); void item_lock(uint32_t hv); void *item_trylock(uint32_t hv); void item_trylock_unlock(void *arg); void item_unlock(uint32_t hv); void pause_threads(enum pause_thread_types type); void stop_threads(void); int stop_conn_timeout_thread(void); #define refcount_incr(it) ++(it->refcount) #define refcount_decr(it) --(it->refcount) void STATS_LOCK(void); void STATS_UNLOCK(void); #define THR_STATS_LOCK(t) pthread_mutex_lock(&t->stats.mutex) #define THR_STATS_UNLOCK(t) pthread_mutex_unlock(&t->stats.mutex) void threadlocal_stats_reset(void); void threadlocal_stats_aggregate(struct thread_stats *stats); void slab_stats_aggregate(struct thread_stats *stats, struct slab_stats *out); void thread_setname(pthread_t thread, const char *name); LIBEVENT_THREAD *get_worker_thread(int id); /* Stat processing functions */ void append_stat(const char *name, ADD_STAT add_stats, conn *c, const char *fmt, ...); enum store_item_type store_item(item *item, int comm, LIBEVENT_THREAD *t, int *nbytes, uint64_t *cas, bool cas_stale); /* Protocol related code */ void out_string(conn *c, const char *str); #define REALTIME_MAXDELTA 60*60*24*30 /* Negative exptimes can underflow and end up immortal. realtime() will immediately expire values that are greater than REALTIME_MAXDELTA, but less than process_started, so lets aim for that. */ #define EXPTIME_TO_POSITIVE_TIME(exptime) (exptime < 0) ? \ REALTIME_MAXDELTA + 1 : exptime rel_time_t realtime(const time_t exptime); item* limited_get(const char *key, size_t nkey, LIBEVENT_THREAD *t, uint32_t exptime, bool should_touch, bool do_update, bool *overflow); item* limited_get_locked(const char *key, size_t nkey, LIBEVENT_THREAD *t, bool do_update, uint32_t *hv, bool *overflow); // Read/Response object handlers. void resp_reset(mc_resp *resp); void resp_add_iov(mc_resp *resp, const void *buf, int len); void resp_add_chunked_iov(mc_resp *resp, const void *buf, int len); bool resp_start(conn *c); mc_resp *resp_start_unlinked(conn *c); mc_resp* resp_finish(conn *c, mc_resp *resp); void resp_free(LIBEVENT_THREAD *th, mc_resp *resp); bool resp_has_stack(conn *c); bool rbuf_switch_to_malloc(conn *c); void conn_release_items(conn *c); void conn_set_state(conn *c, enum conn_states state); void out_of_memory(conn *c, char *ascii_error); void out_errstring(conn *c, const char *str); void write_and_free(conn *c, char *buf, int bytes); void server_stats(ADD_STAT add_stats, conn *c); void append_stats(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, const void *cookie); /** Return a datum for stats in binary protocol */ bool get_stats(const char *stat_type, int nkey, ADD_STAT add_stats, void *c); void stats_reset(void); void process_stat_settings(ADD_STAT add_stats, void *c); void process_stats_conns(ADD_STAT add_stats, void *c); #if HAVE_DROP_PRIVILEGES extern void setup_privilege_violations_handler(void); extern void drop_privileges(void); #else #define setup_privilege_violations_handler() #define drop_privileges() #endif #if HAVE_DROP_WORKER_PRIVILEGES extern void drop_worker_privileges(void); #else #define drop_worker_privileges() #endif /* If supported, give compiler hints for branch prediction. */ #if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) #define __builtin_expect(x, expected_value) (x) #endif #define likely(x) __builtin_expect((x),1) #define unlikely(x) __builtin_expect((x),0) chibicc-1.0.24/test/memcpy_issue.c000066400000000000000000000014431517770275000170240ustar00rootroot00000000000000#include "test.h" #include // Function pointers void (*keycopy)(void *, const void *, size_t); void (*keymset)(void *, int, size_t); int main() { // Initialize function pointers keycopy = memcpy; keymset = memset; // Example data char src[50] = "This is a source string."; char dest[50]; char buffer[50]; // Use keycopy to copy data from src to dest keycopy(dest, src, strlen(src) + 1); // +1 to include the null terminator printf("After keycopy: dest = \"%s\"\n", dest); // Use keymset to set all elements in buffer to 'A' keymset(buffer, 'A', sizeof(buffer) - 1); buffer[sizeof(buffer) - 1] = '\0'; // Null-terminate the buffer printf("After keymset: buffer = \"%s\"\n", buffer); ASSERT(49, strlen(buffer)); return 0; } chibicc-1.0.24/test/memory_barrier.c000066400000000000000000000007341517770275000173420ustar00rootroot00000000000000 #include "test.h" static inline void pg_memory_barrier_impl(void) { #if defined(__i386__) || defined(__i386) __asm__ __volatile__("lock; addl $0,0(%%esp)" : : : "memory", "cc"); #elif defined(__x86_64__) __asm__ __volatile__("lock; addl $0,0(%%rsp)" : : : "memory", "cc"); #endif } int main() { int x = 0; pg_memory_barrier_impl(); x = 1; pg_memory_barrier_impl(); printf("Memory barrier applied. x = %d\n", x); ASSERT(1, x); return 0; } chibicc-1.0.24/test/memory_status.c000066400000000000000000000023231517770275000172330ustar00rootroot00000000000000 #include #include "test.h" #define MEM_SIZE 100 // Define the size of the memory block void printMemoryStatus(char *memory, int size); int main() { char *memory = (char *)malloc(MEM_SIZE * sizeof(char)); // Allocate memory block if (memory == NULL) { printf("Memory allocation failed. Exiting.\n"); return 1; } // Initially, mark all memory as free for (int i = 0; i < MEM_SIZE; ++i) { memory[i] = 'F'; } // Example usage: Allocating memory at address 10 to 20 for (int i = 10; i < 20; ++i) { memory[i] = '*'; } // Print the memory status printMemoryStatus(memory, MEM_SIZE); // Freeing memory at address 10 to 20 for (int i = 10; i < 20; ++i) { memory[i] = 'F'; } // Print the memory status after freeing memory printMemoryStatus(memory, MEM_SIZE); // Free dynamically allocated memory free(memory); return 0; } // Function to print memory status void printMemoryStatus(char *memory, int size) { printf("Memory Status:\n"); for (int i = 0; i < size; ++i) { printf("memory[%d]=%c ", i, memory[i]); if (i < 10 ) ASSERT(70, memory[i]); } printf("\n"); } chibicc-1.0.24/test/memorychunk.c000066400000000000000000000034771517770275000166740ustar00rootroot00000000000000#include #include #include #include typedef uint64_t Size; typedef uint8_t MemoryContextMethodID; typedef struct MemoryChunk { uint64_t hdrmask; } MemoryChunk; #define MEMORY_CONTEXT_METHODID_BITS 8 #define MEMORYCHUNK_EXTERNAL_BASEBIT MEMORY_CONTEXT_METHODID_BITS #define MEMORYCHUNK_VALUE_BASEBIT (MEMORYCHUNK_EXTERNAL_BASEBIT + 1) #define MEMORYCHUNK_BLOCKOFFSET_BASEBIT (MEMORYCHUNK_VALUE_BASEBIT + 30) #define UINT64CONST(x) (x##ULL) #define MEMORYCHUNK_MAGIC (UINT64CONST(0xB1A8DB858EB6EFBA) >> MEMORYCHUNK_VALUE_BASEBIT << MEMORYCHUNK_VALUE_BASEBIT) #define METHOD_ID 0x01 static inline void MemoryChunkSetHdrMask(MemoryChunk *chunk, void *block, Size value, MemoryContextMethodID methodid) { Size blockoffset = (char *)chunk - (char *)block; chunk->hdrmask = (((uint64_t)blockoffset) << 34) | (((uint64_t)value) << 4) | methodid; } static inline void MemoryChunkSetHdrMaskExternal(MemoryChunk *chunk, MemoryContextMethodID methodid) { chunk->hdrmask = MEMORYCHUNK_MAGIC | (((uint64_t)1) << MEMORYCHUNK_EXTERNAL_BASEBIT) | methodid; } int main() { void *block = malloc(1024); MemoryChunk *chunk = (MemoryChunk *)((char *)block + 64); // Example offset Size value = 0x12345; MemoryContextMethodID methodid = METHOD_ID; MemoryChunkSetHdrMask(chunk, block, value, methodid); printf("Internal hdrmask: 0x%016lx\n", chunk->hdrmask); // Check that hdrmask is not null assert(chunk->hdrmask != 0); MemoryChunkSetHdrMaskExternal(chunk, methodid); printf("External hdrmask: 0x%016lx\n", chunk->hdrmask); // Check that hdrmask is not null assert(chunk->hdrmask != 0); free(block); return 0; } chibicc-1.0.24/test/memorychunk2.c000066400000000000000000000201531517770275000167440ustar00rootroot00000000000000#include #include #include #include #include // Define the required constants and types typedef uint64_t Size; typedef uint8_t MemoryContextMethodID; typedef struct MemoryChunk { uint64_t hdrmask; } MemoryChunk; typedef struct AllocBlockData { struct AllocBlockData *prev; struct AllocBlockData *next; char *freeptr; char *endptr; void *aset; } AllocBlockData; typedef AllocBlockData *AllocBlock; typedef struct AllocSetData { struct AllocBlockData *blocks; Size allocChunkLimit; Size initBlockSize; Size maxBlockSize; Size nextBlockSize; Size mem_allocated; MemoryChunk **freelist; } AllocSetData; typedef AllocSetData *AllocSet; typedef AllocSet MemoryContext; #define MEMORY_CONTEXT_METHODID_BITS 8 #define MEMORYCHUNK_EXTERNAL_BASEBIT MEMORY_CONTEXT_METHODID_BITS #define MEMORYCHUNK_VALUE_BASEBIT (MEMORYCHUNK_EXTERNAL_BASEBIT + 1) #define MEMORYCHUNK_BLOCKOFFSET_BASEBIT (MEMORYCHUNK_VALUE_BASEBIT + 30) #define UINT64CONST(x) (x##ULL) #define MEMORYCHUNK_MAGIC (UINT64CONST(0xB1A8DB858EB6EFBA) >> MEMORYCHUNK_VALUE_BASEBIT << MEMORYCHUNK_VALUE_BASEBIT) #define METHOD_ID 0x01 #define ALLOC_BLOCKHDRSZ offsetof(AllocBlockData, freeptr) #define ALLOC_CHUNKHDRSZ sizeof(MemoryChunk) #define ALLOC_MINBITS 3 #define ALLOCSET_NUM_FREELISTS 11 #define MAXALIGN(x) (((x) + 7) & ~7) #define MCTX_ASET_ID 1 // Define dummy implementations of undefined functions/macros #define VALGRIND_MAKE_MEM_NOACCESS(addr, size) #define VALGRIND_MAKE_MEM_DEFINED(addr, size) #define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) static inline void *MemoryChunkGetPointer(MemoryChunk *chunk) { return (void *)(chunk + 1); } static inline int AllocSetFreeIndex(Size size) { int idx = 0; while ((1U << idx) < size) { idx++; } return idx; } static inline Size GetChunkSizeFromFreeListIdx(int idx) { return (1U << idx); } typedef struct AllocFreeListLink { struct MemoryChunk *next; } AllocFreeListLink; static inline AllocFreeListLink *GetFreeListLink(MemoryChunk *chunk) { return (AllocFreeListLink *) chunk; } static inline void MemoryChunkSetHdrMask(MemoryChunk *chunk, void *block, Size value, MemoryContextMethodID methodid) { Size blockoffset = (char *)chunk - (char *)block; chunk->hdrmask = (((uint64_t)blockoffset) << 34) | (((uint64_t)value) << 4) | methodid; } static inline void MemoryChunkSetHdrMaskExternal(MemoryChunk *chunk, MemoryContextMethodID methodid) { chunk->hdrmask = MEMORYCHUNK_MAGIC | (((uint64_t)1) << MEMORYCHUNK_EXTERNAL_BASEBIT) | methodid; } // Define AllocSetAlloc function void *AllocSetAlloc(MemoryContext context, Size size) { AllocSet set = (AllocSet)context; AllocBlock block; MemoryChunk *chunk; int fidx; Size chunk_size; Size blksize; if (size > set->allocChunkLimit) { chunk_size = MAXALIGN(size); blksize = chunk_size + ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ; block = (AllocBlock)malloc(blksize); if (block == NULL) return NULL; context->mem_allocated += blksize; block->aset = set; block->freeptr = block->endptr = ((char *)block) + blksize; chunk = (MemoryChunk *)(((char *)block) + ALLOC_BLOCKHDRSZ); MemoryChunkSetHdrMaskExternal(chunk, MCTX_ASET_ID); if (set->blocks != NULL) { block->prev = set->blocks; block->next = set->blocks->next; if (block->next) block->next->prev = block; set->blocks->next = block; } else { block->prev = NULL; block->next = NULL; set->blocks = block; } VALGRIND_MAKE_MEM_NOACCESS((char *)MemoryChunkGetPointer(chunk) + size, chunk_size - size); VALGRIND_MAKE_MEM_NOACCESS(chunk, ALLOC_CHUNKHDRSZ); return MemoryChunkGetPointer(chunk); } fidx = AllocSetFreeIndex(size); chunk = set->freelist[fidx]; if (chunk != NULL) { AllocFreeListLink *link = GetFreeListLink(chunk); VALGRIND_MAKE_MEM_DEFINED(chunk, ALLOC_CHUNKHDRSZ); VALGRIND_MAKE_MEM_DEFINED(link, sizeof(AllocFreeListLink)); set->freelist[fidx] = link->next; VALGRIND_MAKE_MEM_NOACCESS(link, sizeof(AllocFreeListLink)); VALGRIND_MAKE_MEM_NOACCESS((char *)MemoryChunkGetPointer(chunk) + size, GetChunkSizeFromFreeListIdx(fidx) - size); VALGRIND_MAKE_MEM_NOACCESS(chunk, ALLOC_CHUNKHDRSZ); return MemoryChunkGetPointer(chunk); } chunk_size = GetChunkSizeFromFreeListIdx(fidx); if ((block = set->blocks) != NULL) { Size availspace = block->endptr - block->freeptr; if (availspace < (chunk_size + ALLOC_CHUNKHDRSZ)) { while (availspace >= ((1 << ALLOC_MINBITS) + ALLOC_CHUNKHDRSZ)) { AllocFreeListLink *link; Size availchunk = availspace - ALLOC_CHUNKHDRSZ; int a_fidx = AllocSetFreeIndex(availchunk); if (availchunk != GetChunkSizeFromFreeListIdx(a_fidx)) { a_fidx--; availchunk = GetChunkSizeFromFreeListIdx(a_fidx); } chunk = (MemoryChunk *)(block->freeptr); VALGRIND_MAKE_MEM_UNDEFINED(chunk, ALLOC_CHUNKHDRSZ); block->freeptr += (availchunk + ALLOC_CHUNKHDRSZ); availspace -= (availchunk + ALLOC_CHUNKHDRSZ); MemoryChunkSetHdrMask(chunk, block, a_fidx, MCTX_ASET_ID); link = GetFreeListLink(chunk); VALGRIND_MAKE_MEM_DEFINED(link, sizeof(AllocFreeListLink)); link->next = set->freelist[a_fidx]; VALGRIND_MAKE_MEM_NOACCESS(link, sizeof(AllocFreeListLink)); set->freelist[a_fidx] = chunk; } block = NULL; } } if (block == NULL) { Size required_size; blksize = set->nextBlockSize; set->nextBlockSize <<= 1; if (set->nextBlockSize > set->maxBlockSize) set->nextBlockSize = set->maxBlockSize; required_size = chunk_size + ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ; while (blksize < required_size) blksize <<= 1; block = (AllocBlock)malloc(blksize); while (block == NULL && blksize > 1024 * 1024) { blksize >>= 1; if (blksize < required_size) break; block = (AllocBlock)malloc(blksize); } if (block == NULL) return NULL; context->mem_allocated += blksize; block->aset = set; block->freeptr = ((char *)block) + ALLOC_BLOCKHDRSZ; block->endptr = ((char *)block) + blksize; VALGRIND_MAKE_MEM_NOACCESS(block->freeptr, blksize - ALLOC_BLOCKHDRSZ); block->prev = NULL; block->next = set->blocks; if (block->next) block->next->prev = block; set->blocks = block; } chunk = (MemoryChunk *)(block->freeptr); VALGRIND_MAKE_MEM_UNDEFINED(chunk, ALLOC_CHUNKHDRSZ); block->freeptr += (chunk_size + ALLOC_CHUNKHDRSZ); MemoryChunkSetHdrMask(chunk, block, fidx, MCTX_ASET_ID); VALGRIND_MAKE_MEM_NOACCESS((char *)MemoryChunkGetPointer(chunk) + size, chunk_size - size); VALGRIND_MAKE_MEM_NOACCESS(chunk, ALLOC_CHUNKHDRSZ); return MemoryChunkGetPointer(chunk); } // Main function to test AllocSetAlloc int main() { void *block = malloc(1024); MemoryChunk *chunk = (MemoryChunk *)((char *)block + 64); // Example offset Size value = 0x12345; MemoryContextMethodID methodid = METHOD_ID; MemoryChunkSetHdrMask(chunk, block, value, methodid); printf("Internal hdrmask: 0x%016lx\n", chunk->hdrmask); // Check that hdrmask is not null assert(chunk->hdrmask != 0); MemoryChunkSetHdrMaskExternal(chunk, methodid); printf("External hdrmask: 0x%016lx\n", chunk->hdrmask); // Check that hdrmask is not null assert(chunk->hdrmask != 0); free(block); return 0; } chibicc-1.0.24/test/memset.c000066400000000000000000000014061517770275000156130ustar00rootroot00000000000000#include "test.h" #include int main(void) { char buf1[16]; char buf2[16]; // --- Direct call: should trigger ND_BUILTIN_MEMSET inline --- __builtin_memset(buf1, 'A', sizeof(buf1)); // Print to verify for (int i = 0; i < sizeof(buf1); i++) putchar(buf1[i]); putchar('\n'); // --- Indirect call via function pointer: should use alias to libc memset --- void *(*ptr)(void *, int, size_t) = memset; ptr(buf2, 'B', sizeof(buf2)); for (int i = 0; i < sizeof(buf2); i++) putchar(buf2[i]); putchar('\n'); // Verify return value if (ptr(buf2, 'C', 5) == buf2) printf("Return value correct!\n"); ASSERT(1, ptr(buf2, 'C', 5) == buf2); return 0; } chibicc-1.0.24/test/meson.c000066400000000000000000000005301517770275000154370ustar00rootroot00000000000000#include #include #include #include #include #include #include #include "test.h" #include int main(){ printf("sizeof struct clone_args=%ld\n", sizeof(struct clone_args)); ASSERT(88, sizeof(struct clone_args)); return 0; }chibicc-1.0.24/test/mm_set_ps.c000066400000000000000000000015161517770275000163110ustar00rootroot00000000000000#include "test.h" #include // __m128, _mm_add_ps, _mm_set_ps typedef __m128 v4; v4 add7(v4 a, v4 b, v4 c, v4 d, v4 e, v4 f, v4 g) { return _mm_add_ps(_mm_add_ps(_mm_add_ps(_mm_add_ps(_mm_add_ps(_mm_add_ps(a,b),c),d),e),f),g); } void print_v4(v4 x) { float f[4]; _mm_storeu_ps(f, x); printf("%f %f %f %f\n", f[0], f[1], f[2], f[3]); } int main(){ v4 a = _mm_set_ps(10,20,30,40); v4 b = _mm_set_ps(1,1,1,1); v4 c = _mm_set_ps(2,2,2,2); v4 d = _mm_set_ps(3,3,3,3); v4 e = _mm_set_ps(4,4,4,4); v4 f = _mm_set_ps(5,5,5,5); v4 g = _mm_set_ps(6,6,6,6); v4 r = add7(a,b,c,d,e,f,g); print_v4(r); // expect element-wise sums ASSERT(61, r[0]); ASSERT(51, r[1]); ASSERT(41, r[2]); ASSERT(31, r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/mul_overflow_return_width.c000066400000000000000000000006051517770275000216370ustar00rootroot00000000000000#include "test.h" int main() { // Regression: __builtin_mul_overflow() must return 0/1 in %eax, // not just in %ax/%al. Otherwise callers can see a non-zero "true" // even when no overflow happened (e.g. Postgres int2/int4 paths). short a = 1234; short b = 2; short out = 0; int of = __builtin_mul_overflow(a, b, &out); ASSERT(0, of); ASSERT(2468, out); return 0; } chibicc-1.0.24/test/mulq.c000066400000000000000000000463731517770275000153130ustar00rootroot00000000000000/* * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include #include "test.h" #if !(defined(__GNUC__) && __GNUC__>=2) # include "../bn_asm.c" /* kind of dirty hack for Sun Studio */ #else /*- * x86_64 BIGNUM accelerator version 0.1, December 2002. * * Implemented by Andy Polyakov for the OpenSSL * project. * * Rights for redistribution and usage in source and binary forms are * granted according to the License. Warranty of any kind is disclaimed. * * Q. Version 0.1? It doesn't sound like Andy, he used to assign real * versions, like 1.0... * A. Well, that's because this code is basically a quick-n-dirty * proof-of-concept hack. As you can see it's implemented with * inline assembler, which means that you're bound to GCC and that * there might be enough room for further improvement. * * Q. Why inline assembler? * A. x86_64 features own ABI which I'm not familiar with. This is * why I decided to let the compiler take care of subroutine * prologue/epilogue as well as register allocation. For reference. * Win64 implements different ABI for AMD64, different from Linux. * * Q. How much faster does it get? * A. 'apps/openssl speed rsa dsa' output with no-asm: * * sign verify sign/s verify/s * rsa 512 bits 0.0006s 0.0001s 1683.8 18456.2 * rsa 1024 bits 0.0028s 0.0002s 356.0 6407.0 * rsa 2048 bits 0.0172s 0.0005s 58.0 1957.8 * rsa 4096 bits 0.1155s 0.0018s 8.7 555.6 * sign verify sign/s verify/s * dsa 512 bits 0.0005s 0.0006s 2100.8 1768.3 * dsa 1024 bits 0.0014s 0.0018s 692.3 559.2 * dsa 2048 bits 0.0049s 0.0061s 204.7 165.0 * * 'apps/openssl speed rsa dsa' output with this module: * * sign verify sign/s verify/s * rsa 512 bits 0.0004s 0.0000s 2767.1 33297.9 * rsa 1024 bits 0.0012s 0.0001s 867.4 14674.7 * rsa 2048 bits 0.0061s 0.0002s 164.0 5270.0 * rsa 4096 bits 0.0384s 0.0006s 26.1 1650.8 * sign verify sign/s verify/s * dsa 512 bits 0.0002s 0.0003s 4442.2 3786.3 * dsa 1024 bits 0.0005s 0.0007s 1835.1 1497.4 * dsa 2048 bits 0.0016s 0.0020s 620.4 504.6 * * For the reference. IA-32 assembler implementation performs * very much like 64-bit code compiled with no-asm on the same * machine. */ # undef mul # undef mul_add /*- * "m"(a), "+m"(r) is the way to favor DirectPath µ-code; * "g"(0) let the compiler to decide where does it * want to keep the value of zero; */ # define mul_add(r,a,word,carry) do { \ register unsigned long high,low; \ asm ("mulq %3" \ : "=a"(low),"=d"(high) \ : "a"(word),"m"(a) \ : "cc"); \ asm ("addq %2,%0; adcq %3,%1" \ : "+r"(carry),"+d"(high)\ : "a"(low),"g"(0) \ : "cc"); \ asm ("addq %2,%0; adcq %3,%1" \ : "+m"(r),"+d"(high) \ : "r"(carry),"g"(0) \ : "cc"); \ carry=high; \ } while (0) # define mul(r,a,word,carry) do { \ register unsigned long high,low; \ asm ("mulq %3" \ : "=a"(low),"=d"(high) \ : "a"(word),"g"(a) \ : "cc"); \ asm ("addq %2,%0; adcq %3,%1" \ : "+r"(carry),"+d"(high)\ : "a"(low),"g"(0) \ : "cc"); \ (r)=carry, carry=high; \ } while (0) # undef sqr # define sqr(r0,r1,a) \ asm ("mulq %2" \ : "=a"(r0),"=d"(r1) \ : "a"(a) \ : "cc"); unsigned long bn_mul_add_words(unsigned long *rp, const unsigned long *ap, int num, unsigned long w) { unsigned long c1 = 0; if (num <= 0) return c1; while (num & ~3) { mul_add(rp[0], ap[0], w, c1); mul_add(rp[1], ap[1], w, c1); mul_add(rp[2], ap[2], w, c1); mul_add(rp[3], ap[3], w, c1); ap += 4; rp += 4; num -= 4; } if (num) { mul_add(rp[0], ap[0], w, c1); if (--num == 0) return c1; mul_add(rp[1], ap[1], w, c1); if (--num == 0) return c1; mul_add(rp[2], ap[2], w, c1); return c1; } return c1; } unsigned long bn_mul_words(unsigned long *rp, const unsigned long *ap, int num, unsigned long w) { unsigned long c1 = 0; if (num <= 0) return c1; while (num & ~3) { mul(rp[0], ap[0], w, c1); mul(rp[1], ap[1], w, c1); mul(rp[2], ap[2], w, c1); mul(rp[3], ap[3], w, c1); ap += 4; rp += 4; num -= 4; } if (num) { mul(rp[0], ap[0], w, c1); if (--num == 0) return c1; mul(rp[1], ap[1], w, c1); if (--num == 0) return c1; mul(rp[2], ap[2], w, c1); } return c1; } void bn_sqr_words(unsigned long *r, const unsigned long *a, int n) { if (n <= 0) return; while (n & ~3) { sqr(r[0], r[1], a[0]); sqr(r[2], r[3], a[1]); sqr(r[4], r[5], a[2]); sqr(r[6], r[7], a[3]); a += 4; r += 8; n -= 4; } if (n) { sqr(r[0], r[1], a[0]); if (--n == 0) return; sqr(r[2], r[3], a[1]); if (--n == 0) return; sqr(r[4], r[5], a[2]); } } unsigned long bn_div_words(unsigned long h, unsigned long l, unsigned long d) { unsigned long ret, waste; asm("divq %4":"=a"(ret), "=d"(waste) : "a"(l), "d"(h), "r"(d) : "cc"); return ret; } unsigned long bn_add_words(unsigned long *rp, const unsigned long *ap, const unsigned long *bp, int n) { unsigned long ret; size_t i = 0; if (n <= 0) return 0; asm volatile (" subq %0,%0 \n" /* clear carry */ " jmp 1f \n" ".p2align 4 \n" "1: movq (%4,%2,8),%0 \n" " adcq (%5,%2,8),%0 \n" " movq %0,(%3,%2,8) \n" " lea 1(%2),%2 \n" " dec %1 \n" " jnz 1b \n" " sbbq %0,%0 \n" :"=&r" (ret), "+c"(n), "+r"(i) :"r"(rp), "r"(ap), "r"(bp) :"cc", "memory"); return ret & 1; } # ifndef SIMICS unsigned long bn_sub_words(unsigned long *rp, const unsigned long *ap, const unsigned long *bp, int n) { unsigned long ret; size_t i = 0; if (n <= 0) return 0; asm volatile (" subq %0,%0 \n" /* clear borrow */ " jmp 1f \n" ".p2align 4 \n" "1: movq (%4,%2,8),%0 \n" " sbbq (%5,%2,8),%0 \n" " movq %0,(%3,%2,8) \n" " lea 1(%2),%2 \n" " dec %1 \n" " jnz 1b \n" " sbbq %0,%0 \n" :"=&r" (ret), "+c"(n), "+r"(i) :"r"(rp), "r"(ap), "r"(bp) :"cc", "memory"); return ret & 1; } # else /* Simics 1.4<7 has buggy sbbq:-( */ # define BN_MASK2 0xffffffffffffffffL unsigned long bn_sub_words(unsigned long *r, unsigned long *a, unsigned long *b, int n) { unsigned long t1, t2; int c = 0; if (n <= 0) return (unsigned long)0; for (;;) { t1 = a[0]; t2 = b[0]; r[0] = (t1 - t2 - c) & BN_MASK2; if (t1 != t2) c = (t1 < t2); if (--n <= 0) break; t1 = a[1]; t2 = b[1]; r[1] = (t1 - t2 - c) & BN_MASK2; if (t1 != t2) c = (t1 < t2); if (--n <= 0) break; t1 = a[2]; t2 = b[2]; r[2] = (t1 - t2 - c) & BN_MASK2; if (t1 != t2) c = (t1 < t2); if (--n <= 0) break; t1 = a[3]; t2 = b[3]; r[3] = (t1 - t2 - c) & BN_MASK2; if (t1 != t2) c = (t1 < t2); if (--n <= 0) break; a += 4; b += 4; r += 4; } return c; } # endif /* mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) */ /* mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) */ /* sqr_add_c(a,i,c0,c1,c2) -- c+=a[i]^2 for three word number c=(c2,c1,c0) */ /* * sqr_add_c2(a,i,c0,c1,c2) -- c+=2*a[i]*a[j] for three word number * c=(c2,c1,c0) */ /* * Keep in mind that carrying into high part of multiplication result * can not overflow, because it cannot be all-ones. */ # if 0 /* original macros are kept for reference purposes */ # define mul_add_c(a,b,c0,c1,c2) do { \ unsigned long ta = (a), tb = (b); \ unsigned long lo, hi; \ BN_UMULT_LOHI(lo,hi,ta,tb); \ c0 += lo; hi += (c0 %ld\n", res); ASSERT(20, res); printf("OK\n"); return 0; }chibicc-1.0.24/test/non_variadic.c000066400000000000000000000041661517770275000167630ustar00rootroot00000000000000 #include "test.h" void test_non_variadic( int a1, long double a2, double a3, long double a4, double a5, long double a6, double a7, int a8, double a9, long double a10, double a11, long double a12, double a13, long double a14, double a15, double a16 ) { printf("a1 (int) = %d\n", a1); ASSERT(1, a1); printf("a2 (long double) = %Lf\n", a2); ASSERT(2, a2); printf("a3 (double) = %f\n", a3); ASSERT(3, a3); printf("a4 (long double) = %Lf\n", a4); ASSERT(4, a4); printf("a5 (double) = %f\n", a5); ASSERT(5, a5); printf("a6 (long double) = %Lf\n", a6); ASSERT(6, a6); printf("a7 (double) = %f\n", a7); ASSERT(7, a7); printf("a8 (int) = %d\n", a8); ASSERT(8, a8); printf("a9 (double) = %f\n", a9); ASSERT(9, a9); printf("a10 (long double) = %Lf\n", a10); ASSERT(10, a10); printf("a11 (double) = %f\n", a11); ASSERT(11, a11); printf("a12 (long double) = %Lf\n", a12); ASSERT(12, a12); printf("a13 (double) = %f\n", a13); ASSERT(13, a13); printf("a14 (long double) = %Lf\n", a14); ASSERT(14, a14); printf("a15 (double) = %f\n", a15); ASSERT(15, a15); printf("a16 (double) = %f\n", a16); ASSERT(16, a16); } int main() { test_non_variadic( 1, // int 2.222222222222L, // long double 3.333333, // double 4.444444444444L, // long double 5.555555, // double 6.666666666666L, // long double 7.777777, // double 8, // int 9.999999, // double 10.101010101010L, // long double 11.111111, // double 12.121212121212L, // long double 13.131313, // double 14.141414141414L, // long double 15.151515, // double 16.161616 // double ); return 0; } chibicc-1.0.24/test/nonnull.c000066400000000000000000000014631517770275000160110ustar00rootroot00000000000000#include #include "test.h" // Declarations + definitions so linker can find them void foo(char *p, char *q) __attribute__((__nonnull__)); void foo(char *p, char *q) { } void bar(char *p, char *q, char *r) __attribute__((__nonnull__(1, 3))); void bar(char *p, char *q, char *r) { } void baz(char *p, char *q) __attribute__((__nonnull__)); void baz(char *p, char *q) { if (p) *p = 'A'; if (q) *q = 'B'; } typedef void (*nonnull_fn_t)(char *p, char *q) __attribute__((__nonnull__(2))); void use_typedef(nonnull_fn_t fn, char *a, char *b) { fn(a, b); } int main() { char x = 'x', y = 'y', z = 'z'; foo(&x, &y); bar(&x, NULL, &z); baz(&x, &y); use_typedef(baz, &x, &y); printf("x: %c, y: %c, z: %c\n", x, y, z); ASSERT(65, x); ASSERT(66, y); ASSERT(122, z); return 0; } chibicc-1.0.24/test/offset_flexible_array.c000066400000000000000000000006031517770275000206550ustar00rootroot00000000000000#include #include #include typedef struct { char header[32]; int arr[]; } Y; int main(void) { if (offsetof(Y, arr) != 32) return 1; if (sizeof(Y) != 32) return 2; size_t sz = offsetof(Y, arr) + 4 * sizeof(int); Y *p = malloc(sz); if (!p) return 3; p->arr[3] = 42; free(p); return 0; }chibicc-1.0.24/test/offsetof.c000077500000000000000000000004111517770275000161320ustar00rootroot00000000000000#include "test.h" #include typedef struct { int a; char b; int c; double d; } T; int main() { ASSERT(0, offsetof(T, a)); ASSERT(4, offsetof(T, b)); ASSERT(8, offsetof(T, c)); ASSERT(16, offsetof(T, d)); printf("OK\n"); return 0; } chibicc-1.0.24/test/offsetof1.c000066400000000000000000000016111517770275000162130ustar00rootroot00000000000000 #include #include "test.h" typedef void (*FuncPtr)(void); typedef struct { int a; FuncPtr func; double b; } MyStruct; void myFunction(void) { printf("Function called!\n"); } int main() { printf("Offset of a: %zu\n", offsetof(MyStruct, a)); // Should be 0 printf("Offset of func: %zu\n", offsetof(MyStruct, func)); // Should be sizeof(int) printf("Offset of b: %zu\n", offsetof(MyStruct, b)); // Should be sizeof(int) + sizeof(FuncPtr) printf("sizeof(int)= %zu\n", sizeof(int)); // Should be 4 ASSERT(4, sizeof(int)); ASSERT(8, sizeof(long)); ASSERT(4, SIZEOF_INT); ASSERT(8, SIZEOF_LONG); ASSERT(0, offsetof(MyStruct, a)); ASSERT(8, offsetof(MyStruct, func)); ASSERT(16, offsetof(MyStruct, b)); // Example usage MyStruct s; s.func = myFunction; s.func(); // Should print "Function called!" return 0; } chibicc-1.0.24/test/offsetof2.c000066400000000000000000000022621517770275000162170ustar00rootroot00000000000000 #include #include "test.h" typedef void (*Func1)(void); typedef void (*Func2)(int); typedef int (*Func3)(int); typedef struct { Func1 func1; Func2 func2; Func3 func3; } FunctionStruct; void myFunc1(void) { printf("Func1 called!\n"); } void myFunc2(int x) { printf("Func2 called with %d!\n", x); } int myFunc3(int x) { return x * 2; } int main() { printf("Offset of func1: %zu\n", offsetof(FunctionStruct, func1)); // Should be 0 ASSERT(0, offsetof(FunctionStruct, func1)); printf("Offset of func2: %zu\n", offsetof(FunctionStruct, func2)); // Should be sizeof(Func1) ASSERT(8, offsetof(FunctionStruct, func2) ); printf("Offset of func3: %zu\n", offsetof(FunctionStruct, func3)); // Should be sizeof(Func1) + sizeof(Func2) ASSERT(16, offsetof(FunctionStruct, func3)); // Example usage FunctionStruct fs; fs.func1 = myFunc1; fs.func2 = myFunc2; fs.func3 = myFunc3; fs.func1(); // Should print "Func1 called!" fs.func2(10); // Should print "Func2 called with 10!" printf("Func3 result: %d\n", fs.func3(5)); // Should print "Func3 result: 10" ASSERT(10, fs.func3(5)); return 0; } chibicc-1.0.24/test/offsetof3.c000066400000000000000000000020711517770275000162160ustar00rootroot00000000000000 #include #include "test.h" typedef void (*Callback)(int); typedef struct { int a; char b; Callback callback; double c; } ComplexStruct; void myCallback(int x) { printf("Callback called with %d\n", x); } int main() { printf("Offset of a: %zu\n", offsetof(ComplexStruct, a)); // Should be 0 printf("Offset of b: %zu\n", offsetof(ComplexStruct, b)); // Should be sizeof(int) printf("Offset of callback: %zu\n", offsetof(ComplexStruct, callback)); // Should be sizeof(int) + sizeof(char) printf("Offset of c: %zu\n", offsetof(ComplexStruct, c)); // Should be sizeof(int) + sizeof(char) + sizeof(Callback) ASSERT(0, offsetof(ComplexStruct, a)); ASSERT(4, offsetof(ComplexStruct, b)); // Assuming int is 4 bytes ASSERT(8, offsetof(ComplexStruct, callback)); // Assuming char is 1 byte ASSERT(16, offsetof(ComplexStruct, c)); // Assuming Callback is a pointer // Example usage ComplexStruct cs; cs.callback = myCallback; cs.callback(42); // Should print "Callback called with 42" return 0; } chibicc-1.0.24/test/oldc.c000066400000000000000000000014061517770275000152420ustar00rootroot00000000000000 //#include typedef unsigned char Byte; /* 8 bits */ typedef unsigned long uLong; /* 32 bits or more */ #define OF(args) args static char hello[] = "hello, hello!"; void test_compress OF((Byte * compr, uLong comprLen, Byte *uncompr, uLong uncomprLen)); /* =========================================================================== * Test compress() and uncompress() */ void test_compress(compr, comprLen, uncompr, uncomprLen) Byte *compr, *uncompr; uLong comprLen, uncomprLen; { int err; uLong len = 14; // if (strcmp((char *)uncompr, hello)) // { // return; // } // else // { // //printf("uncompress(): %s\n", (char *)uncompr); // } } int main() { return 0; }chibicc-1.0.24/test/openssl_alignment_repro.c000066400000000000000000000023431517770275000212520ustar00rootroot00000000000000/* * reproduction.c * * This test case reproduces a common source of runtime segfaults in OpenSSL * when compiled with chibicc. It targets a bug where the stack pointer * becomes misaligned during function calls when the frame pointer is omitted * (triggered by -O1 or higher). */ #include "test.h" #include #include /* * This function uses SSE instructions (__m128i). * The x86-64 ABI requires the stack to be aligned to 16 bytes upon entry. * If the caller provides an unaligned stack, instructions like _mm_set1_epi32 * (which may result in 'movdqa' or aligned stack spills) will trigger a SIGSEGV. */ void __attribute__((noinline)) target_function(int val) { __m128i x = _mm_set1_epi32(val); printf("SSE operation successful: %d\n", _mm_extract_epi32(x, 0)); } /* * In chibicc, compiling this with -O1 enables omit-frame-pointer. * If there's a bug in depth tracking or prologue/epilogue math, * the 'call' to target_function will be misaligned. */ void __attribute__((noinline)) caller(int val) { /* We pass several arguments to exercise the register/stack logic */ target_function(val); } int main() { printf("Starting alignment test...\n"); caller(42); return 0; } chibicc-1.0.24/test/openssl_asm.c000066400000000000000000000045561517770275000166550ustar00rootroot00000000000000#include "test.h" #include #include #include typedef unsigned __int128 uint128_t; typedef unsigned long BN_ULONG; #if (defined(__x86_64) || defined(__x86_64__)) #if defined(__GNUC__) && __GNUC__ >= 2 #define BN_UMULT_HIGH(a, b) ({ \ register BN_ULONG ret,discard; \ asm ("mulq %3" \ : "=a"(discard),"=d"(ret) \ : "a"(a), "g"(b) \ : "cc"); \ ret; }) #define BN_UMULT_LOHI(low, high, a, b) \ asm("mulq %3" \ : "=a"(low), "=d"(high) \ : "a"(a), "g"(b) \ : "cc"); #endif #endif /* one iteration like bn_mul_words */ static BN_ULONG step(BN_ULONG a, BN_ULONG w, BN_ULONG *carry) { BN_ULONG low, high; BN_UMULT_LOHI(low, high, w, a); BN_ULONG ret = low + *carry; BN_ULONG c = high + (ret < low); *carry = c; return ret; } /* full chain like bn_mul_words */ static void chain(BN_ULONG *r, BN_ULONG *a, BN_ULONG w, int n) { BN_ULONG carry = 0; for (int i = 0; i < n; i++) { r[i] = step(a[i], w, &carry); } r[n] = carry; } /* reference using __int128 */ static void ref(BN_ULONG *r, BN_ULONG *a, BN_ULONG w, int n) { __uint128_t carry = 0; for (int i = 0; i < n; i++) { __uint128_t t = (__uint128_t)a[i] * w + carry; r[i] = (BN_ULONG)t; carry = t >> 64; } r[n] = (BN_ULONG)carry; } static void test_once() { const int N = 8; BN_ULONG a[N]; BN_ULONG r1[N+1]; BN_ULONG r2[N+1]; for (int i = 0; i < N; i++) a[i] = ((BN_ULONG)rand() << 32) ^ rand(); BN_ULONG w = ((BN_ULONG)rand() << 32) ^ rand(); chain(r1, a, w, N); ref(r2, a, w, N); for (int i = 0; i < N+1; i++) { if (r1[i] != r2[i]) { printf("FAIL at %d\n", i); printf("w=%lx\n", w); for (int j = 0; j < N; j++) printf("a[%d]=%lx\n", j, a[j]); printf("got:\n"); for (int j = 0; j < N+1; j++) printf("%lx ", r1[j]); printf("\nwant:\n"); for (int j = 0; j < N+1; j++) printf("%lx ", r2[j]); printf("\n"); exit(1); } } } int main() { for (int i = 0; i < 100000; i++) test_once(); printf("OK\n"); return 0; } chibicc-1.0.24/test/openssl_crash.c000066400000000000000000000003071517770275000171630ustar00rootroot00000000000000#include "test.h" #include int main() { uint64_t x = 1; uint64_t y = x << 64; if (y != 0) { printf("FAIL: %lx\n", y); return 1; } printf("OK\n"); } chibicc-1.0.24/test/openssl_crash2.c000066400000000000000000000422531517770275000172530ustar00rootroot00000000000000/* * test_bignum_chibicc.c * Comprehensive BIGNUM test suite for validating chibicc compiler compatibility. * Covers: arithmetic, modular ops, bitwise ops, comparison, I/O, primes, * memory, edge cases (zero, one, negatives, overflow-prone values). * * Build: cc test_bignum_chibicc.c -o test_bignum -lssl -lcrypto * Run: ./test_bignum */ #include #include #include "test.h" #include /* ── helpers ───────────────────────────────────────────────────────────── */ static int tests_run = 0; static int tests_passed = 0; static int tests_failed = 0; #define PASS(label) do { \ printf("[PASS] %s\n", label); \ tests_passed++; tests_run++; \ } while (0) #define FAIL(label) do { \ printf("[FAIL] %s\n", label); \ tests_failed++; tests_run++; \ } while (0) #define CHECK(cond, label) do { \ if (cond) PASS(label); else FAIL(label); \ } while (0) /* ── 1. Memory / lifecycle ─────────────────────────────────────────────── */ static void test_memory(void) { puts("\n=== 1. Memory / Lifecycle ==="); /* BN_new / BN_free */ BIGNUM *a = BN_new(); CHECK(a != NULL, "BN_new returns non-NULL"); BN_free(a); /* BN_clear_free (secure wipe) */ BIGNUM *b = BN_new(); BN_set_word(b, 0xDEADBEEF); BN_clear_free(b); /* should not crash */ PASS("BN_clear_free does not crash"); /* BN_dup */ BIGNUM *src = BN_new(); BN_set_word(src, 123456789UL); BIGNUM *dup = BN_dup(src); CHECK(BN_cmp(src, dup) == 0, "BN_dup produces equal value"); BN_free(src); BN_free(dup); /* BN_copy */ BIGNUM *x = BN_new(); BIGNUM *y = BN_new(); BN_set_word(x, 42); BN_copy(y, x); CHECK(BN_cmp(x, y) == 0, "BN_copy produces equal value"); BN_free(x); BN_free(y); /* BN_CTX lifecycle */ BN_CTX *ctx = BN_CTX_new(); CHECK(ctx != NULL, "BN_CTX_new returns non-NULL"); BN_CTX_free(ctx); /* BN_CTX_start / BN_CTX_end scoping */ ctx = BN_CTX_new(); BN_CTX_start(ctx); BIGNUM *tmp = BN_CTX_get(ctx); CHECK(tmp != NULL, "BN_CTX_get inside start/end"); BN_CTX_end(ctx); BN_CTX_free(ctx); } /* ── 2. Initialisation & conversion ────────────────────────────────────── */ static void test_conversion(void) { puts("\n=== 2. Initialisation & Conversion ==="); BIGNUM *a = BN_new(); /* zero / one constants */ BN_zero(a); CHECK(BN_is_zero(a), "BN_zero / BN_is_zero"); BN_one(a); CHECK(BN_is_one(a), "BN_one / BN_is_one"); /* set_word / get_word round-trip */ BN_set_word(a, 0xCAFEBABEUL); CHECK(BN_get_word(a) == 0xCAFEBABEUL, "BN_set/get_word round-trip"); /* hex string round-trip */ BN_hex2bn(&a, "DEADBEEFCAFE1234"); char *hex = BN_bn2hex(a); CHECK(strcasecmp(hex, "DEADBEEFCAFE1234") == 0, "hex2bn / bn2hex round-trip"); OPENSSL_free(hex); /* decimal string round-trip */ BN_dec2bn(&a, "123456789012345678901234567890"); char *dec = BN_bn2dec(a); CHECK(strcmp(dec, "123456789012345678901234567890") == 0, "dec2bn / bn2dec round-trip"); OPENSSL_free(dec); /* binary round-trip */ BN_set_word(a, 0xABCD); int len = BN_num_bytes(a); unsigned char buf[64]; BN_bn2bin(a, buf); BIGNUM *b = BN_new(); BN_bin2bn(buf, len, b); CHECK(BN_cmp(a, b) == 0, "bn2bin / bin2bn round-trip"); BN_free(b); /* BN_num_bits */ BN_set_word(a, 8); /* 0b1000 → 4 bits */ CHECK(BN_num_bits(a) == 4, "BN_num_bits(8) == 4"); BN_free(a); } /* ── 3. Arithmetic ─────────────────────────────────────────────────────── */ static void test_arithmetic(BN_CTX *ctx) { puts("\n=== 3. Arithmetic ==="); BIGNUM *a = BN_new(), *b = BN_new(), *r = BN_new(); /* addition */ BN_set_word(a, 999999999UL); BN_set_word(b, 1UL); BN_add(r, a, b); CHECK(BN_get_word(r) == 1000000000UL, "BN_add: 999999999+1=1000000000"); /* subtraction */ BN_set_word(a, 100); BN_set_word(b, 37); BN_sub(r, a, b); CHECK(BN_get_word(r) == 63, "BN_sub: 100-37=63"); /* multiplication */ BN_set_word(a, 123456); BN_set_word(b, 789); BN_mul(r, a, b, ctx); CHECK(BN_get_word(r) == 123456UL * 789UL, "BN_mul: 123456*789"); /* squaring */ BN_set_word(a, 1234); BN_sqr(r, a, ctx); CHECK(BN_get_word(r) == 1234UL * 1234UL, "BN_sqr: 1234^2"); /* division + remainder */ BIGNUM *q = BN_new(), *rem = BN_new(); BN_set_word(a, 1000); BN_set_word(b, 7); BN_div(q, rem, a, b, ctx); CHECK(BN_get_word(q) == 142 && BN_get_word(rem) == 6, "BN_div: 1000/7 q=142 r=6"); BN_free(q); BN_free(rem); /* BN_add_word / BN_sub_word / BN_mul_word */ BN_set_word(a, 500); BN_add_word(a, 23); CHECK(BN_get_word(a) == 523, "BN_add_word"); BN_sub_word(a, 3); CHECK(BN_get_word(a) == 520, "BN_sub_word"); BN_mul_word(a, 2); CHECK(BN_get_word(a) == 1040, "BN_mul_word"); /* absolute value (negate then abs) */ BN_set_word(a, 42); BN_set_negative(a, 1); CHECK(BN_is_negative(a), "BN_set_negative makes number negative"); BN_set_negative(a, 0); CHECK(!BN_is_negative(a), "BN_set_negative(0) clears sign"); BN_free(a); BN_free(b); BN_free(r); } /* ── 4. Modular arithmetic ─────────────────────────────────────────────── */ static void test_modular(BN_CTX *ctx) { puts("\n=== 4. Modular Arithmetic ==="); BIGNUM *a = BN_new(), *m = BN_new(), *r = BN_new(); BIGNUM *e = BN_new(); /* BN_mod */ BN_set_word(a, 1234567); BN_set_word(m, 1000); BN_mod(r, a, m, ctx); CHECK(BN_get_word(r) == 567, "BN_mod: 1234567 mod 1000 = 567"); /* BN_mod_add */ BN_set_word(a, 999); BN_set_word(e, 5); BN_set_word(m, 1000); BN_mod_add(r, a, e, m, ctx); CHECK(BN_get_word(r) == 4, "BN_mod_add: (999+5) mod 1000 = 4"); /* BN_mod_sub */ BN_set_word(a, 3); BN_set_word(e, 7); BN_set_word(m, 10); BN_mod_sub(r, a, e, m, ctx); CHECK(BN_get_word(r) == 6, "BN_mod_sub: (3-7) mod 10 = 6"); /* BN_mod_mul */ BN_set_word(a, 17); BN_set_word(e, 13); BN_set_word(m, 100); BN_mod_mul(r, a, e, m, ctx); CHECK(BN_get_word(r) == 21, "BN_mod_mul: (17*13) mod 100 = 21"); /* BN_mod_sqr */ BN_set_word(a, 17); BN_set_word(m, 100); BN_mod_sqr(r, a, m, ctx); CHECK(BN_get_word(r) == 89, "BN_mod_sqr: 17^2 mod 100 = 89"); /* BN_mod_exp */ BN_set_word(a, 2); BN_set_word(e, 10); BN_set_word(m, 1000); BN_mod_exp(r, a, e, m, ctx); CHECK(BN_get_word(r) == 24, "BN_mod_exp: 2^10 mod 1000 = 24"); /* BN_mod_inverse — original example (a=17, n=3120) */ BN_set_word(a, 17); BN_set_word(m, 3120); BIGNUM *inv = BN_mod_inverse(NULL, a, m, ctx); CHECK(inv != NULL, "BN_mod_inverse(17, 3120) succeeds"); if (inv) { /* verify: a * inv ≡ 1 (mod n) */ BN_mod_mul(r, a, inv, m, ctx); CHECK(BN_is_one(r), "BN_mod_inverse verification: 17 * inv ≡ 1 (mod 3120)"); BN_free(inv); } /* BN_mod_inverse — no inverse (gcd != 1) */ BN_set_word(a, 6); BN_set_word(m, 9); BIGNUM *no_inv = BN_mod_inverse(NULL, a, m, ctx); CHECK(no_inv == NULL, "BN_mod_inverse(6,9) returns NULL (gcd=3≠1)"); /* BN_nnmod (non-negative modulo) */ BIGNUM *neg = BN_new(); BN_set_word(neg, 3); BN_set_negative(neg, 1); /* neg = -3 */ BN_set_word(m, 7); BN_nnmod(r, neg, m, ctx); CHECK(BN_get_word(r) == 4, "BN_nnmod: -3 mod 7 = 4"); BN_free(neg); /* Montgomery form round-trip */ BN_set_word(m, 97); /* prime modulus */ BN_MONT_CTX *mont = BN_MONT_CTX_new(); BN_MONT_CTX_set(mont, m, ctx); BN_set_word(a, 42); BIGNUM *am = BN_new(); BN_to_montgomery(am, a, mont, ctx); BN_from_montgomery(r, am, mont, ctx); CHECK(BN_cmp(r, a) == 0, "Montgomery round-trip: to→from gives original value"); BN_MONT_CTX_free(mont); BN_free(am); BN_free(a); BN_free(m); BN_free(r); BN_free(e); } /* ── 5. Bitwise & shift operations ─────────────────────────────────────── */ static void test_bitwise(void) { puts("\n=== 5. Bitwise & Shift ==="); BIGNUM *a = BN_new(), *r = BN_new(); /* left / right shift */ BN_set_word(a, 1); BN_lshift(r, a, 10); CHECK(BN_get_word(r) == 1024, "BN_lshift(1, 10) = 1024"); BN_rshift(r, r, 10); CHECK(BN_get_word(r) == 1, "BN_rshift(1024, 10) = 1"); /* lshift1 / rshift1 */ BN_set_word(a, 7); BN_lshift1(r, a); CHECK(BN_get_word(r) == 14, "BN_lshift1(7)=14"); BN_rshift1(r, r); CHECK(BN_get_word(r) == 7, "BN_rshift1(14)=7"); /* BN_set_bit / BN_clear_bit / BN_is_bit_set */ BN_zero(a); BN_set_bit(a, 5); CHECK(BN_is_bit_set(a, 5), "BN_set_bit / BN_is_bit_set(5)"); CHECK(!BN_is_bit_set(a, 4), "bit 4 not set"); BN_clear_bit(a, 5); CHECK(!BN_is_bit_set(a, 5), "BN_clear_bit(5)"); /* BN_mask_bits */ BN_set_word(a, 0xFF); BN_mask_bits(a, 4); /* keep only lowest 4 bits → 0x0F */ CHECK(BN_get_word(a) == 0x0F, "BN_mask_bits(0xFF, 4) = 0x0F"); BN_free(a); BN_free(r); } /* ── 6. Comparison ─────────────────────────────────────────────────────── */ static void test_comparison(void) { puts("\n=== 6. Comparison ==="); BIGNUM *a = BN_new(), *b = BN_new(); BN_set_word(a, 100); BN_set_word(b, 200); CHECK(BN_cmp(a, b) < 0, "BN_cmp: 100 < 200"); CHECK(BN_cmp(b, a) > 0, "BN_cmp: 200 > 100"); BN_set_word(b, 100); CHECK(BN_cmp(a, b) == 0, "BN_cmp: 100 == 100"); /* BN_ucmp ignores sign */ BN_set_negative(a, 1); CHECK(BN_ucmp(a, b) == 0, "BN_ucmp ignores sign: |-100| == 100"); /* BN_cmp_word (if available via macro) */ BN_set_word(a, 42); BN_set_negative(a, 0); CHECK(BN_is_zero(a) == 0, "BN_is_zero(42) == 0"); BN_zero(a); CHECK(BN_is_zero(a) == 1, "BN_is_zero(0) == 1"); CHECK(BN_is_one(b) == 0, "BN_is_one(100) == 0"); BN_one(b); CHECK(BN_is_one(b) == 1, "BN_is_one(1) == 1"); /* odd/even */ BN_set_word(a, 7); CHECK(BN_is_odd(a), "BN_is_odd(7)"); BN_set_word(a, 8); CHECK(!BN_is_odd(a), "!BN_is_odd(8)"); BN_free(a); BN_free(b); } /* ── 7. GCD & prime utilities ──────────────────────────────────────────── */ static void test_gcd_prime(BN_CTX *ctx) { puts("\n=== 7. GCD & Primes ==="); BIGNUM *a = BN_new(), *b = BN_new(), *g = BN_new(); /* GCD */ BN_set_word(a, 48); BN_set_word(b, 18); BN_gcd(g, a, b, ctx); CHECK(BN_get_word(g) == 6, "BN_gcd(48,18) = 6"); BN_set_word(a, 7); BN_set_word(b, 13); BN_gcd(g, a, b, ctx); CHECK(BN_get_word(g) == 1, "BN_gcd(7,13) = 1 (coprime)"); /* BN_is_prime_fasttest_ex */ BN_set_word(a, 104729); /* known prime */ int is_prime = BN_check_prime(a, ctx, NULL); CHECK(is_prime == 1, "BN_check_prime(104729) is prime"); BN_set_word(a, 104728); /* composite */ is_prime = BN_check_prime(a, ctx, NULL); CHECK(is_prime == 0, "BN_check_prime(104728) is NOT prime"); /* BN_generate_prime_ex — small 32-bit prime */ BIGNUM *p = BN_new(); int ok = BN_generate_prime_ex(p, 32, 0, NULL, NULL, NULL); CHECK(ok == 1, "BN_generate_prime_ex(32 bits) succeeds"); CHECK(BN_num_bits(p) <= 32, "generated prime fits in 32 bits"); int prime_check = BN_check_prime(p, ctx, NULL); CHECK(prime_check == 1, "generated prime passes primality test"); BN_free(p); /* safe prime (p, where (p-1)/2 is also prime) — small so fast */ BIGNUM *sp = BN_new(); ok = BN_generate_prime_ex(sp, 32, 1, NULL, NULL, NULL); CHECK(ok == 1, "BN_generate_prime_ex safe prime succeeds"); BN_free(sp); BN_free(a); BN_free(b); BN_free(g); } /* ── 8. Pseudo-random generation ───────────────────────────────────────── */ static void test_random(BN_CTX *ctx) { puts("\n=== 8. Pseudo-Random Generation ==="); (void)ctx; BIGNUM *r = BN_new(); /* BN_rand: exactly N bits, top bit set, odd */ int ok = BN_rand(r, 64, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD); CHECK(ok == 1, "BN_rand(64 bits) succeeds"); CHECK(BN_num_bits(r) == 64, "BN_rand produces exactly 64 bits"); CHECK(BN_is_odd(r), "BN_rand with BN_RAND_BOTTOM_ODD is odd"); /* BN_rand_range: result in [0, range) */ BIGNUM *range = BN_new(); BN_set_word(range, 1000); ok = BN_rand_range(r, range); CHECK(ok == 1, "BN_rand_range succeeds"); CHECK(BN_cmp(r, range) < 0, "BN_rand_range result < range"); /* BN_priv_rand_range (same semantics, uses private PRNG) */ ok = BN_priv_rand_range(r, range); CHECK(ok == 1, "BN_priv_rand_range succeeds"); BN_free(r); BN_free(range); } /* ── 9. Edge cases ─────────────────────────────────────────────────────── */ static void test_edge_cases(BN_CTX *ctx) { puts("\n=== 9. Edge Cases ==="); BIGNUM *a = BN_new(), *b = BN_new(), *r = BN_new(); /* zero arithmetic */ BN_zero(a); BN_set_word(b, 42); BN_add(r, a, b); CHECK(BN_get_word(r) == 42, "edge: 0 + 42 = 42"); BN_mul(r, a, b, ctx); CHECK(BN_is_zero(r), "edge: 0 * 42 = 0"); BN_sub(r, a, b); CHECK(BN_is_negative(r), "edge: 0 - 42 is negative"); /* multiply by one */ BN_set_word(a, 0x1234567890ABCDEFULL); BN_one(b); BN_mul(r, a, b, ctx); CHECK(BN_cmp(r, a) == 0, "edge: n * 1 = n"); /* very large value (256-bit) round-trip */ const char *big_hex = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; BN_hex2bn(&a, big_hex); char *out = BN_bn2hex(a); CHECK(strcasecmp(out, big_hex) == 0, "edge: 256-bit all-F round-trip"); OPENSSL_free(out); /* mod by one → always 0 */ BN_one(b); BN_mod(r, a, b, ctx); CHECK(BN_is_zero(r), "edge: n mod 1 = 0"); /* modular exponentiation with exponent 0 → 1 */ BN_set_word(a, 17); BN_zero(b); BN_set_word(r, 1000); BIGNUM *res = BN_new(); BN_mod_exp(res, a, b, r, ctx); CHECK(BN_is_one(res), "edge: 17^0 mod 1000 = 1"); BN_free(res); /* subtraction producing exactly zero */ BN_set_word(a, 999); BN_set_word(b, 999); BN_sub(r, a, b); CHECK(BN_is_zero(r), "edge: n - n = 0"); /* negative number comparison */ BN_set_word(a, 1); BN_set_negative(a, 1); /* a = -1 */ BN_set_word(b, 1); /* b = 1 */ CHECK(BN_cmp(a, b) < 0, "edge: -1 < 1"); /* number of bits in zero */ BN_zero(a); CHECK(BN_num_bits(a) == 0, "edge: BN_num_bits(0) = 0"); CHECK(BN_num_bytes(a) == 0, "edge: BN_num_bytes(0) = 0"); BN_free(a); BN_free(b); BN_free(r); } /* ── 10. Constant-time / secure ops ────────────────────────────────────── */ static void test_secure(BN_CTX *ctx) { puts("\n=== 10. Constant-Time / Secure Ops ==="); /* BN_mod_exp_mont_consttime */ BIGNUM *base = BN_new(), *exp = BN_new(), *mod = BN_new(), *r = BN_new(); BN_set_word(base, 2); BN_set_word(exp, 16); BN_set_word(mod, 65537); BN_mod_exp_mont_consttime(r, base, exp, mod, ctx, NULL); CHECK(BN_get_word(r) == 65536 % 65537, "BN_mod_exp_mont_consttime: 2^16 mod 65537"); /* BN_priv_rand — same API as BN_rand but from private DRBG */ BIGNUM *priv = BN_new(); int ok = BN_priv_rand(priv, 128, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY); CHECK(ok == 1, "BN_priv_rand(128 bits) succeeds"); CHECK(BN_num_bits(priv) <= 128, "BN_priv_rand fits in 128 bits"); BN_free(priv); BN_free(base); BN_free(exp); BN_free(mod); BN_free(r); (void)ctx; } /* ── main ──────────────────────────────────────────────────────────────── */ int main(void) { puts("========================================"); puts(" chibicc / OpenSSL BIGNUM test suite"); puts("========================================"); BN_CTX *ctx = BN_CTX_new(); if (!ctx) { fputs("BN_CTX_new failed\n", stderr); return 1; } test_memory(); test_conversion(); test_arithmetic(ctx); test_modular(ctx); test_bitwise(); test_comparison(); test_gcd_prime(ctx); test_random(ctx); test_edge_cases(ctx); test_secure(ctx); BN_CTX_free(ctx); puts("\n========================================"); printf(" Results: %d/%d passed", tests_passed, tests_run); if (tests_failed) printf(" (%d FAILED)", tests_failed); puts("\n========================================"); return tests_failed ? 1 : 0; } chibicc-1.0.24/test/openssl_crash3.c000066400000000000000000000422541517770275000172550ustar00rootroot00000000000000/* * test_bignum_chibicc.c * Comprehensive BIGNUM test suite for validating chibicc compiler compatibility. * Covers: arithmetic, modular ops, bitwise ops, comparison, I/O, primes, * memory, edge cases (zero, one, negatives, overflow-prone values). * * Build: cc test_bignum_chibicc.c -o test_bignum -lssl -lcrypto * Run: ./test_bignum */ #include #include #include "test.h" #include /* ── helpers ───────────────────────────────────────────────────────────── */ static int tests_run = 0; static int tests_passed = 0; static int tests_failed = 0; #define PASS(label) do { \ printf("[PASS] %s\n", label); \ tests_passed++; tests_run++; \ } while (0) #define FAIL(label) do { \ printf("[FAIL] %s\n", label); \ tests_failed++; tests_run++; \ } while (0) #define CHECK(cond, label) do { \ if (cond) PASS(label); else FAIL(label); \ } while (0) /* ── 1. Memory / lifecycle ─────────────────────────────────────────────── */ static void test_memory(void) { puts("\n=== 1. Memory / Lifecycle ==="); /* BN_new / BN_free */ BIGNUM *a = BN_new(); CHECK(a != NULL, "BN_new returns non-NULL"); BN_free(a); /* BN_clear_free (secure wipe) */ BIGNUM *b = BN_new(); BN_set_word(b, 0xDEADBEEF); BN_clear_free(b); /* should not crash */ PASS("BN_clear_free does not crash"); /* BN_dup */ BIGNUM *src = BN_new(); BN_set_word(src, 123456789UL); BIGNUM *dup = BN_dup(src); CHECK(BN_cmp(src, dup) == 0, "BN_dup produces equal value"); BN_free(src); BN_free(dup); /* BN_copy */ BIGNUM *x = BN_new(); BIGNUM *y = BN_new(); BN_set_word(x, 42); BN_copy(y, x); CHECK(BN_cmp(x, y) == 0, "BN_copy produces equal value"); BN_free(x); BN_free(y); /* BN_CTX lifecycle */ BN_CTX *ctx = BN_CTX_new(); CHECK(ctx != NULL, "BN_CTX_new returns non-NULL"); BN_CTX_free(ctx); /* BN_CTX_start / BN_CTX_end scoping */ ctx = BN_CTX_new(); BN_CTX_start(ctx); BIGNUM *tmp = BN_CTX_get(ctx); CHECK(tmp != NULL, "BN_CTX_get inside start/end"); BN_CTX_end(ctx); BN_CTX_free(ctx); } /* ── 2. Initialisation & conversion ────────────────────────────────────── */ static void test_conversion(void) { puts("\n=== 2. Initialisation & Conversion ==="); BIGNUM *a = BN_new(); /* zero / one constants */ BN_zero(a); CHECK(BN_is_zero(a), "BN_zero / BN_is_zero"); BN_one(a); CHECK(BN_is_one(a), "BN_one / BN_is_one"); /* set_word / get_word round-trip */ BN_set_word(a, 0xCAFEBABEUL); CHECK(BN_get_word(a) == 0xCAFEBABEUL, "BN_set/get_word round-trip"); /* hex string round-trip */ BN_hex2bn(&a, "DEADBEEFCAFE1234"); char *hex = BN_bn2hex(a); CHECK(strcasecmp(hex, "DEADBEEFCAFE1234") == 0, "hex2bn / bn2hex round-trip"); OPENSSL_free(hex); /* decimal string round-trip */ BN_dec2bn(&a, "123456789012345678901234567890"); char *dec = BN_bn2dec(a); CHECK(strcmp(dec, "123456789012345678901234567890") == 0, "dec2bn / bn2dec round-trip"); OPENSSL_free(dec); /* binary round-trip */ BN_set_word(a, 0xABCD); int len = BN_num_bytes(a); unsigned char buf[64]; BN_bn2bin(a, buf); BIGNUM *b = BN_new(); BN_bin2bn(buf, len, b); CHECK(BN_cmp(a, b) == 0, "bn2bin / bin2bn round-trip"); BN_free(b); /* BN_num_bits */ BN_set_word(a, 8); /* 0b1000 → 4 bits */ CHECK(BN_num_bits(a) == 4, "BN_num_bits(8) == 4"); BN_free(a); } /* ── 3. Arithmetic ─────────────────────────────────────────────────────── */ static void test_arithmetic(BN_CTX *ctx) { puts("\n=== 3. Arithmetic ==="); BIGNUM *a = BN_new(), *b = BN_new(), *r = BN_new(); /* addition */ BN_set_word(a, 999999999UL); BN_set_word(b, 1UL); BN_add(r, a, b); CHECK(BN_get_word(r) == 1000000000UL, "BN_add: 999999999+1=1000000000"); /* subtraction */ BN_set_word(a, 100); BN_set_word(b, 37); BN_sub(r, a, b); CHECK(BN_get_word(r) == 63, "BN_sub: 100-37=63"); /* multiplication */ BN_set_word(a, 123456); BN_set_word(b, 789); BN_mul(r, a, b, ctx); CHECK(BN_get_word(r) == 123456UL * 789UL, "BN_mul: 123456*789"); /* squaring */ BN_set_word(a, 1234); BN_sqr(r, a, ctx); CHECK(BN_get_word(r) == 1234UL * 1234UL, "BN_sqr: 1234^2"); /* division + remainder */ BIGNUM *q = BN_new(), *rem = BN_new(); BN_set_word(a, 1000); BN_set_word(b, 7); BN_div(q, rem, a, b, ctx); CHECK(BN_get_word(q) == 142 && BN_get_word(rem) == 6, "BN_div: 1000/7 q=142 r=6"); BN_free(q); BN_free(rem); /* BN_add_word / BN_sub_word / BN_mul_word */ BN_set_word(a, 500); BN_add_word(a, 23); CHECK(BN_get_word(a) == 523, "BN_add_word"); BN_sub_word(a, 3); CHECK(BN_get_word(a) == 520, "BN_sub_word"); BN_mul_word(a, 2); CHECK(BN_get_word(a) == 1040, "BN_mul_word"); /* absolute value (negate then abs) */ BN_set_word(a, 42); BN_set_negative(a, 1); CHECK(BN_is_negative(a), "BN_set_negative makes number negative"); BN_set_negative(a, 0); CHECK(!BN_is_negative(a), "BN_set_negative(0) clears sign"); BN_free(a); BN_free(b); BN_free(r); } /* ── 4. Modular arithmetic ─────────────────────────────────────────────── */ static void test_modular(BN_CTX *ctx) { puts("\n=== 4. Modular Arithmetic ==="); BIGNUM *a = BN_new(), *m = BN_new(), *r = BN_new(); BIGNUM *e = BN_new(); /* BN_mod */ BN_set_word(a, 1234567); BN_set_word(m, 1000); BN_mod(r, a, m, ctx); CHECK(BN_get_word(r) == 567, "BN_mod: 1234567 mod 1000 = 567"); /* BN_mod_add */ BN_set_word(a, 999); BN_set_word(e, 5); BN_set_word(m, 1000); BN_mod_add(r, a, e, m, ctx); CHECK(BN_get_word(r) == 4, "BN_mod_add: (999+5) mod 1000 = 4"); /* BN_mod_sub */ BN_set_word(a, 3); BN_set_word(e, 7); BN_set_word(m, 10); BN_mod_sub(r, a, e, m, ctx); CHECK(BN_get_word(r) == 6, "BN_mod_sub: (3-7) mod 10 = 6"); /* BN_mod_mul */ BN_set_word(a, 17); BN_set_word(e, 13); BN_set_word(m, 100); BN_mod_mul(r, a, e, m, ctx); CHECK(BN_get_word(r) == 21, "BN_mod_mul: (17*13) mod 100 = 21"); /* BN_mod_sqr */ BN_set_word(a, 17); BN_set_word(m, 100); BN_mod_sqr(r, a, m, ctx); CHECK(BN_get_word(r) == 89, "BN_mod_sqr: 17^2 mod 100 = 89"); /* BN_mod_exp */ BN_set_word(a, 2); BN_set_word(e, 10); BN_set_word(m, 1000); BN_mod_exp(r, a, e, m, ctx); CHECK(BN_get_word(r) == 24, "BN_mod_exp: 2^10 mod 1000 = 24"); /* BN_mod_inverse — original example (a=17, n=3120) */ BN_set_word(a, 17); BN_set_word(m, 3120); BIGNUM *inv = BN_mod_inverse(NULL, a, m, ctx); CHECK(inv != NULL, "BN_mod_inverse(17, 3120) succeeds"); if (inv) { /* verify: a * inv ≡ 1 (mod n) */ BN_mod_mul(r, a, inv, m, ctx); CHECK(BN_is_one(r), "BN_mod_inverse verification: 17 * inv ≡ 1 (mod 3120)"); BN_free(inv); } /* BN_mod_inverse — no inverse (gcd != 1) */ BN_set_word(a, 6); BN_set_word(m, 9); BIGNUM *no_inv = BN_mod_inverse(NULL, a, m, ctx); CHECK(no_inv == NULL, "BN_mod_inverse(6,9) returns NULL (gcd=3≠1)"); /* BN_nnmod (non-negative modulo) */ BIGNUM *neg = BN_new(); BN_set_word(neg, 3); BN_set_negative(neg, 1); /* neg = -3 */ BN_set_word(m, 7); BN_nnmod(r, neg, m, ctx); CHECK(BN_get_word(r) == 4, "BN_nnmod: -3 mod 7 = 4"); BN_free(neg); /* Montgomery form round-trip */ BN_set_word(m, 97); /* prime modulus */ BN_MONT_CTX *mont = BN_MONT_CTX_new(); BN_MONT_CTX_set(mont, m, ctx); BN_set_word(a, 42); BIGNUM *am = BN_new(); BN_to_montgomery(am, a, mont, ctx); BN_from_montgomery(r, am, mont, ctx); CHECK(BN_cmp(r, a) == 0, "Montgomery round-trip: to→from gives original value"); BN_MONT_CTX_free(mont); BN_free(am); BN_free(a); BN_free(m); BN_free(r); BN_free(e); } /* ── 5. Bitwise & shift operations ─────────────────────────────────────── */ static void test_bitwise(void) { puts("\n=== 5. Bitwise & Shift ==="); BIGNUM *a = BN_new(), *r = BN_new(); /* left / right shift */ BN_set_word(a, 1); BN_lshift(r, a, 10); CHECK(BN_get_word(r) == 1024, "BN_lshift(1, 10) = 1024"); BN_rshift(r, r, 10); CHECK(BN_get_word(r) == 1, "BN_rshift(1024, 10) = 1"); /* lshift1 / rshift1 */ BN_set_word(a, 7); BN_lshift1(r, a); CHECK(BN_get_word(r) == 14, "BN_lshift1(7)=14"); BN_rshift1(r, r); CHECK(BN_get_word(r) == 7, "BN_rshift1(14)=7"); /* BN_set_bit / BN_clear_bit / BN_is_bit_set */ BN_zero(a); BN_set_bit(a, 5); CHECK(BN_is_bit_set(a, 5), "BN_set_bit / BN_is_bit_set(5)"); CHECK(!BN_is_bit_set(a, 4), "bit 4 not set"); BN_clear_bit(a, 5); CHECK(!BN_is_bit_set(a, 5), "BN_clear_bit(5)"); /* BN_mask_bits */ BN_set_word(a, 0xFF); BN_mask_bits(a, 4); /* keep only lowest 4 bits → 0x0F */ CHECK(BN_get_word(a) == 0x0F, "BN_mask_bits(0xFF, 4) = 0x0F"); BN_free(a); BN_free(r); } /* ── 6. Comparison ─────────────────────────────────────────────────────── */ static void test_comparison(void) { puts("\n=== 6. Comparison ==="); BIGNUM *a = BN_new(), *b = BN_new(); BN_set_word(a, 100); BN_set_word(b, 200); CHECK(BN_cmp(a, b) < 0, "BN_cmp: 100 < 200"); CHECK(BN_cmp(b, a) > 0, "BN_cmp: 200 > 100"); BN_set_word(b, 100); CHECK(BN_cmp(a, b) == 0, "BN_cmp: 100 == 100"); /* BN_ucmp ignores sign */ BN_set_negative(a, 1); CHECK(BN_ucmp(a, b) == 0, "BN_ucmp ignores sign: |-100| == 100"); /* BN_cmp_word (if available via macro) */ BN_set_word(a, 42); BN_set_negative(a, 0); CHECK(BN_is_zero(a) == 0, "BN_is_zero(42) == 0"); BN_zero(a); CHECK(BN_is_zero(a) == 1, "BN_is_zero(0) == 1"); CHECK(BN_is_one(b) == 0, "BN_is_one(100) == 0"); BN_one(b); CHECK(BN_is_one(b) == 1, "BN_is_one(1) == 1"); /* odd/even */ BN_set_word(a, 7); CHECK(BN_is_odd(a), "BN_is_odd(7)"); BN_set_word(a, 8); CHECK(!BN_is_odd(a), "!BN_is_odd(8)"); BN_free(a); BN_free(b); } /* ── 7. GCD & prime utilities ──────────────────────────────────────────── */ static void test_gcd_prime(BN_CTX *ctx) { puts("\n=== 7. GCD & Primes ==="); BIGNUM *a = BN_new(), *b = BN_new(), *g = BN_new(); /* GCD */ BN_set_word(a, 48); BN_set_word(b, 18); BN_gcd(g, a, b, ctx); CHECK(BN_get_word(g) == 6, "BN_gcd(48,18) = 6"); BN_set_word(a, 7); BN_set_word(b, 13); BN_gcd(g, a, b, ctx); CHECK(BN_get_word(g) == 1, "BN_gcd(7,13) = 1 (coprime)"); /* BN_is_prime_fasttest_ex */ BN_set_word(a, 104729); /* known prime */ int is_prime = BN_check_prime(a, ctx, NULL); CHECK(is_prime == 1, "BN_check_prime(104729) is prime"); BN_set_word(a, 104728); /* composite */ is_prime = BN_check_prime(a, ctx, NULL); CHECK(is_prime == 0, "BN_check_prime(104728) is NOT prime"); /* BN_generate_prime_ex — small 32-bit prime */ BIGNUM *p = BN_new(); int ok = BN_generate_prime_ex(p, 32, 0, NULL, NULL, NULL); CHECK(ok == 1, "BN_generate_prime_ex(32 bits) succeeds"); CHECK(BN_num_bits(p) <= 32, "generated prime fits in 32 bits"); int prime_check = BN_check_prime(p, ctx, NULL); CHECK(prime_check == 1, "generated prime passes primality test"); BN_free(p); /* safe prime (p, where (p-1)/2 is also prime) — small so fast */ BIGNUM *sp = BN_new(); ok = BN_generate_prime_ex(sp, 32, 1, NULL, NULL, NULL); CHECK(ok == 1, "BN_generate_prime_ex safe prime succeeds"); BN_free(sp); BN_free(a); BN_free(b); BN_free(g); } /* ── 8. Pseudo-random generation ───────────────────────────────────────── */ static void test_random(BN_CTX *ctx) { puts("\n=== 8. Pseudo-Random Generation ==="); (void)ctx; BIGNUM *r = BN_new(); /* BN_rand: exactly N bits, top bit set, odd */ int ok = BN_rand(r, 64, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD); CHECK(ok == 1, "BN_rand(64 bits) succeeds"); CHECK(BN_num_bits(r) == 64, "BN_rand produces exactly 64 bits"); CHECK(BN_is_odd(r), "BN_rand with BN_RAND_BOTTOM_ODD is odd"); /* BN_rand_range: result in [0, range) */ BIGNUM *range = BN_new(); BN_set_word(range, 1000); ok = BN_rand_range(r, range); CHECK(ok == 1, "BN_rand_range succeeds"); CHECK(BN_cmp(r, range) < 0, "BN_rand_range result < range"); /* BN_priv_rand_range (same semantics, uses private PRNG) */ ok = BN_priv_rand_range(r, range); CHECK(ok == 1, "BN_priv_rand_range succeeds"); BN_free(r); BN_free(range); } /* ── 9. Edge cases ─────────────────────────────────────────────────────── */ static void test_edge_cases(BN_CTX *ctx) { puts("\n=== 9. Edge Cases ==="); BIGNUM *a = BN_new(), *b = BN_new(), *r = BN_new(); /* zero arithmetic */ BN_zero(a); BN_set_word(b, 42); BN_add(r, a, b); CHECK(BN_get_word(r) == 42, "edge: 0 + 42 = 42"); BN_mul(r, a, b, ctx); CHECK(BN_is_zero(r), "edge: 0 * 42 = 0"); BN_sub(r, a, b); CHECK(BN_is_negative(r), "edge: 0 - 42 is negative"); /* multiply by one */ BN_set_word(a, 0x1234567890ABCDEFULL); BN_one(b); BN_mul(r, a, b, ctx); CHECK(BN_cmp(r, a) == 0, "edge: n * 1 = n"); /* very large value (256-bit) round-trip */ const char *big_hex = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; BN_hex2bn(&a, big_hex); char *out = BN_bn2hex(a); CHECK(strcasecmp(out, big_hex) == 0, "edge: 256-bit all-F round-trip"); OPENSSL_free(out); /* mod by one → always 0 */ BN_one(b); BN_mod(r, a, b, ctx); CHECK(BN_is_zero(r), "edge: n mod 1 = 0"); /* modular exponentiation with exponent 0 → 1 */ BN_set_word(a, 17); BN_zero(b); BN_set_word(r, 1000); BIGNUM *res = BN_new(); BN_mod_exp(res, a, b, r, ctx); CHECK(BN_is_one(res), "edge: 17^0 mod 1000 = 1"); BN_free(res); /* subtraction producing exactly zero */ BN_set_word(a, 999); BN_set_word(b, 999); BN_sub(r, a, b); CHECK(BN_is_zero(r), "edge: n - n = 0"); /* negative number comparison */ BN_set_word(a, 1); BN_set_negative(a, 1); /* a = -1 */ BN_set_word(b, 1); /* b = 1 */ CHECK(BN_cmp(a, b) < 0, "edge: -1 < 1"); /* number of bits in zero */ BN_zero(a); CHECK(BN_num_bits(a) == 0, "edge: BN_num_bits(0) = 0"); CHECK(BN_num_bytes(a) == 0, "edge: BN_num_bytes(0) = 0"); BN_free(a); BN_free(b); BN_free(r); } /* ── 10. Constant-time / secure ops ────────────────────────────────────── */ static void test_secure(BN_CTX *ctx) { puts("\n=== 10. Constant-Time / Secure Ops ==="); /* BN_mod_exp_mont_consttime */ BIGNUM *base = BN_new(), *exp = BN_new(), *mod = BN_new(), *r = BN_new(); BN_set_word(base, 2); BN_set_word(exp, 16); BN_set_word(mod, 65537); BN_mod_exp_mont_consttime(r, base, exp, mod, ctx, NULL); CHECK(BN_get_word(r) == 65536 % 65537, "BN_mod_exp_mont_consttime: 2^16 mod 65537"); /* BN_priv_rand — same API as BN_rand but from private DRBG */ BIGNUM *priv = BN_new(); int ok = BN_priv_rand(priv, 128, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY); CHECK(ok == 1, "BN_priv_rand(128 bits) succeeds"); CHECK(BN_num_bits(priv) <= 128, "BN_priv_rand fits in 128 bits"); BN_free(priv); BN_free(base); BN_free(exp); BN_free(mod); BN_free(r); (void)ctx; } /* ── main ──────────────────────────────────────────────────────────────── */ int main(void) { puts("========================================"); puts(" chibicc / OpenSSL BIGNUM test suite"); puts("========================================"); BN_CTX *ctx = BN_CTX_new(); if (!ctx) { fputs("BN_CTX_new failed\n", stderr); return 1; } test_memory(); test_conversion(); test_arithmetic(ctx); test_modular(ctx); test_bitwise(); test_comparison(); test_gcd_prime(ctx); test_random(ctx); test_edge_cases(ctx); test_secure(ctx); BN_CTX_free(ctx); puts("\n========================================"); printf(" Results: %d/%d passed", tests_passed, tests_run); if (tests_failed) printf(" (%d FAILED)", tests_failed); puts("\n========================================"); return tests_failed ? 1 : 0; } chibicc-1.0.24/test/openssl_crash4.c000066400000000000000000000565411517770275000172620ustar00rootroot00000000000000/* * test_chibicc_miller_rabin.c * * Reproducer for the chibicc-compiled OpenSSL failure: * * ERROR: (bool) 'ossl_bn_miller_rabin_is_prime(bn, 10, ctx, NULL, 1, &status) == true' * failed @ test/bn_internal_test.c:57 * false * 409738ECBB790000:error:0180006C:bignum routines:BN_mod_inverse:no inverse: * crypto/bn/bn_gcd.c:532 * OPENSSL_TEST_RAND_SEED=1777212200 * * ── ROOT CAUSE ────────────────────────────────────────────────────────────── * * The call chain inside ossl_bn_miller_rabin_is_prime is: * * miller_rabin_is_prime(w, ...) * └─ BN_MONT_CTX_set(mont, w, ctx) ← step 1: Montgomery setup * └─ bn_mod_inverse_no_branch(Ri, R, w) ← computes R^-1 mod w * └─ FAILS: "no inverse" ← gcd(R, w) ≠ 1 * * BN_MONT_CTX_set uses R = 2^(BN_BITS2 × w->top). For gcd(R, w) ≠ 1 * the candidate w must be EVEN (share factor 2 with R = 2^k). * * The test feeds a known prime (hardcoded odd value) so w should be odd. * The bug is that chibicc's broken BN_ULONG width (32-bit on a 64-bit host) * corrupts BN_hex2bn / BN_bin2bn: * * - A 64-bit BN_ULONG write splits across two 32-bit slots. * - The least-significant slot (which determines odd/even) ends up ZERO. * - An odd prime now appears EVEN to Montgomery → "no inverse". * * The RAND_SEED=1777212200 just makes the test reproducible; it controls * the witness selection later, but the crash happens before any witness * is drawn (during Montgomery setup in step 1 above). * * ── WHAT THIS TEST DOES ───────────────────────────────────────────────────── * * 1. Platform guard – prints BN_ULONG width; warns if mismatched. * 2. LSB integrity – after BN_hex2bn, verifies BN_is_odd() is true * for known odd primes. A word-width bug zeros the * low word → BN_is_odd() returns false. * 3. Montgomery setup – BN_MONT_CTX_set() must succeed for every odd prime. * This is the exact call that throws "no inverse". * 4. Montgomery inverse – replicates the internal BN_mod_inverse(R^-1, R, w) * call explicitly so the error is directly visible. * 5. Miller-Rabin proxy – BN_check_prime() uses the same Miller-Rabin path * as ossl_bn_miller_rabin_is_prime; must return 1. * 6. Round-trip sanity – BN_bn2hex → BN_hex2bn round-trip; value must not * change (catches hex I/O corruption). * 7. Prime generation – BN_generate_prime_ex(); the result must be odd * and pass Montgomery setup (chibicc may generate * composites / even "primes"). * 8. Seed reproducibility– sets OPENSSL_TEST_RAND_SEED=1777212200 and repeats * the critical Montgomery setup check. * * Build: cc test_chibicc_miller_rabin.c -o test_chibicc_miller_rabin -lssl -lcrypto * Run: ./test_chibicc_miller_rabin * OPENSSL_TEST_RAND_SEED=1777212200 ./test_chibicc_miller_rabin */ #include #include #include #include #include "test.h" #include #include /* ── harness ───────────────────────────────────────────────────────────── */ static int g_run = 0, g_pass = 0, g_fail = 0; #define CHECK(cond, label) do { \ g_run++; \ if (cond) { printf("[PASS] %s\n", label); g_pass++; } \ else { printf("[FAIL] %s\n", label); g_fail++; } \ } while (0) static void clear_errors(void) { ERR_clear_error(); } /* Return the topmost OpenSSL error reason string, or "" if none. */ static const char *last_err(void) { unsigned long e = ERR_peek_last_error(); return e ? ERR_reason_error_string(e) : ""; } static void dump_bn(const char *tag, const BIGNUM *n) { char *h = BN_bn2hex(n); printf(" %-12s = %s (%d bits, %s)\n", tag, h, BN_num_bits(n), BN_is_odd(n) ? "odd" : "EVEN"); OPENSSL_free(h); } /* ── test primes ───────────────────────────────────────────────────────── */ /* * Primes chosen to straddle every critical BN_ULONG boundary: * - 32-bit: fits in one 32-bit word (should always work) * - 33-bit: FIRST prime crossing the 32-bit boundary ← first bug trigger * - 40-bit: the reported failure zone from bnexp.txt * - 48-bit: another multi-word region * - 63/64/65-bit: around the 64-bit boundary * - 128-bit: two 64-bit words * * All values are verified primes (sympy.isprime confirmed). */ static const struct { const char *label; const char *hex; } PRIMES[] = { { "8-bit (139)", "8B" }, { "16-bit (32771)", "8003" }, { "31-bit", "7FFFFFFF" }, /* composite, used for boundary */ { "32-bit", "8000000B" }, { "33-bit (boundary!)", "010000000F" }, { "40-bit (failure zone)", "8000000017" }, { "48-bit", "800000000005" }, { "63-bit", "4000000000000087" }, { "64-bit", "800000000000001D" }, { "65-bit (boundary!)", "01000000000000000D" }, { "128-bit", "8000000000000000000000000000001D" }, { NULL, NULL } }; /* A set of known composites — miller_rabin must NOT report these as prime. */ static const struct { const char *label; const char *hex; } COMPOSITES[] = { { "composite-32 (2^32)", "100000000" }, { "composite-40 (even)", "8000000016" }, { "composite-64 (9*p)", "7FFFFFFFFFFFE7" }, /* not prime */ { NULL, NULL } }; /* ── 1. platform guard ─────────────────────────────────────────────────── */ static void section_platform(void) { puts("\n=== 1. Platform / BN_ULONG Guard ==="); printf(" OpenSSL : %s\n", OPENSSL_VERSION_TEXT); printf(" sizeof(BN_ULONG) : %zu bytes (%zu bits)\n", sizeof(BN_ULONG), sizeof(BN_ULONG) * 8); printf(" BN_BITS2 : %d\n", BN_BITS2); printf(" sizeof(long) : %zu bytes\n", sizeof(long)); int ok = (sizeof(BN_ULONG) == 8 && BN_BITS2 == 64); printf(" Status : %s\n", ok ? "[OK] 64-bit BN_ULONG" : "[WARN] BN_ULONG is NOT 64-bit — expect Miller-Rabin failures!"); /* Functional probe: 2^32 must produce a 33-bit number */ BIGNUM *a = BN_new(); BN_set_word(a, 0xFFFFFFFFUL); BN_add_word(a, 1); CHECK(BN_num_bits(a) == 33, "platform: 0xFFFFFFFF + 1 == 33 bits (word overflow handled)"); BN_free(a); } /* ── 2. LSB integrity after BN_hex2bn ──────────────────────────────────── */ /* * THE core symptom: chibicc zeros the low BN_ULONG word during hex parsing, * turning every odd prime even. BN_is_odd() must return 1 for all of them. */ static void section_lsb_integrity(BN_CTX *ctx) { puts("\n=== 2. LSB Integrity After BN_hex2bn ==="); puts(" (Checks that the lowest bit survives parsing — chibicc may zero it)"); for (int i = 0; PRIMES[i].label; i++) { BIGNUM *n = NULL; BN_hex2bn(&n, PRIMES[i].hex); /* The expected parity of the original hex: last hex digit's bit 0 */ char last = PRIMES[i].hex[strlen(PRIMES[i].hex) - 1]; int expected_odd = (last == '1' || last == '3' || last == '5' || last == '7' || last == '9' || last == 'B' || last == 'D' || last == 'F' || last == 'b' || last == 'd' || last == 'f'); char label[128]; snprintf(label, sizeof(label), "lsb: %s is %s", PRIMES[i].label, expected_odd ? "odd" : "even"); CHECK(!!BN_is_odd(n) == expected_odd, label); if (!!BN_is_odd(n) != expected_odd) { printf(" [INFO] BN_hex2bn corrupted parity: expected %s, got %s\n", expected_odd ? "odd" : "even", BN_is_odd(n) ? "odd" : "even"); dump_bn("parsed", n); } BN_free(n); } (void)ctx; } /* ── 3. Montgomery setup (the exact failing call) ───────────────────────── */ /* * BN_MONT_CTX_set() is the first thing ossl_bn_miller_rabin_is_prime calls. * It runs: R^{-1} mod w via BN_mod_inverse. * If w is even (due to chibicc's word-width bug), this throws: * "BN_mod_inverse: no inverse" ← exact error from the bug report. */ static void section_montgomery_setup(BN_CTX *ctx) { puts("\n=== 3. Montgomery Setup (BN_MONT_CTX_set) ==="); puts(" (This is the exact call that throws 'no inverse' in the bug)"); for (int i = 0; PRIMES[i].label; i++) { BIGNUM *n = NULL; BN_hex2bn(&n, PRIMES[i].hex); /* Skip even numbers — we only test odd primes here */ if (!BN_is_odd(n)) { printf(" [SKIP] %s — appears EVEN after parsing (LSB bug!)\n", PRIMES[i].label); BN_free(n); g_run++; g_fail++; /* count as failure */ continue; } clear_errors(); BN_MONT_CTX *mont = BN_MONT_CTX_new(); int rc = BN_MONT_CTX_set(mont, n, ctx); char label[128]; snprintf(label, sizeof(label), "mont-setup: %s", PRIMES[i].label); CHECK(rc == 1, label); if (rc != 1) { printf(" [INFO] BN_MONT_CTX_set failed: %s\n", last_err()); printf(" [INFO] This is the 'no inverse' error from the bug report\n"); dump_bn("n", n); ERR_clear_error(); } BN_MONT_CTX_free(mont); BN_free(n); } } /* ── 4. Explicit Montgomery inverse (replicates bn_gcd.c:532 path) ──────── */ /* * BN_MONT_CTX_set internally computes: Ri = R^{-1} mod w * where R = 2^(BN_BITS2 * w->top). * We replicate this with a power-of-2 R just above the prime. * On chibicc: if w appears even, gcd(R, w) = 2 → BN_mod_inverse returns NULL. */ static void section_explicit_inverse(BN_CTX *ctx) { puts("\n=== 4. Explicit Montgomery Inverse (replicates bn_gcd.c:532) ==="); puts(" (Computes R^-1 mod w as BN_MONT_CTX_set does internally)"); for (int i = 0; PRIMES[i].label; i++) { BIGNUM *w = NULL; BN_hex2bn(&w, PRIMES[i].hex); /* R = 2^(ceil_to_BN_BITS2(w)) — smallest power of 2 >= 2*w */ int rbits = ((BN_num_bits(w) + BN_BITS2 - 1) / BN_BITS2) * BN_BITS2; BIGNUM *R = BN_new(); BN_set_bit(R, rbits); /* R = 2^rbits */ clear_errors(); BIGNUM *Ri = BN_mod_inverse(NULL, R, w, ctx); char label[128]; snprintf(label, sizeof(label), "mont-inverse: R=2^%d mod %s", rbits, PRIMES[i].label); CHECK(Ri != NULL, label); if (!Ri) { printf(" [INFO] BN_mod_inverse(R=2^%d, w) failed: %s\n", rbits, last_err()); printf(" [INFO] → This IS the 'no inverse' from bn_gcd.c:532\n"); dump_bn("w", w); /* verify our hypothesis: is w even? */ printf(" [INFO] w is %s (parity of low word)\n", BN_is_odd(w) ? "ODD — bug is elsewhere" : "EVEN — confirmed BN_hex2bn LSB corruption"); ERR_clear_error(); } else { BN_free(Ri); } BN_free(R); BN_free(w); } } /* ── 5. Miller-Rabin proxy via BN_check_prime ───────────────────────────── */ /* * BN_check_prime() calls the same Miller-Rabin path as * ossl_bn_miller_rabin_is_prime. It must return 1 for known primes. * On chibicc: either returns -1 (internal error) or 0 (false composite). */ static void section_miller_rabin(BN_CTX *ctx) { puts("\n=== 5. Miller-Rabin via BN_check_prime (known primes must pass) ==="); for (int i = 0; PRIMES[i].label; i++) { BIGNUM *n = NULL; BN_hex2bn(&n, PRIMES[i].hex); /* Only test numbers that are actually prime */ /* (31-bit "7FFFFFFF" is composite — skip primality check for it) */ if (strcmp(PRIMES[i].hex, "7FFFFFFF") == 0) { BN_free(n); continue; } clear_errors(); int rc = BN_check_prime(n, ctx, NULL); char label[128]; snprintf(label, sizeof(label), "miller-rabin: %s is prime", PRIMES[i].label); CHECK(rc == 1, label); if (rc != 1) { printf(" [INFO] BN_check_prime returned %d for known prime\n", rc); printf(" [INFO] Last error: %s\n", last_err()); printf(" [INFO] rc=0 → reported composite; rc=-1 → internal error\n"); printf(" [INFO] rc=-1 with 'no inverse' = exact bug from report\n"); dump_bn("n", n); ERR_clear_error(); } BN_free(n); } /* Known composites must NOT be reported as prime */ puts(" -- composites must fail --"); for (int i = 0; COMPOSITES[i].label; i++) { BIGNUM *n = NULL; BN_hex2bn(&n, COMPOSITES[i].hex); clear_errors(); int rc = BN_check_prime(n, ctx, NULL); char label[128]; snprintf(label, sizeof(label), "miller-rabin: %s is NOT prime", COMPOSITES[i].label); CHECK(rc == 0, label); if (rc == 1) { printf(" [INFO] BN_check_prime WRONGLY reported composite as prime!\n"); dump_bn("n", n); } ERR_clear_error(); BN_free(n); } } /* ── 6. Round-trip sanity ───────────────────────────────────────────────── */ /* * If BN_hex2bn/BN_bn2hex are broken, the round-trip changes the value. * A changed value changes parity → Montgomery fails. */ static void section_roundtrip(BN_CTX *ctx) { puts("\n=== 6. BN_hex2bn → BN_bn2hex Round-Trip ==="); for (int i = 0; PRIMES[i].label; i++) { BIGNUM *n = NULL; BN_hex2bn(&n, PRIMES[i].hex); char *back = BN_bn2hex(n); /* BN_bn2hex upper-cases and may strip leading zeros */ char label[128]; snprintf(label, sizeof(label), "roundtrip: %s", PRIMES[i].label); CHECK(strcasecmp(back, PRIMES[i].hex) == 0, label); if (strcasecmp(back, PRIMES[i].hex) != 0) { printf(" [INFO] expected: %s\n", PRIMES[i].hex); printf(" [INFO] got: %s\n", back); } OPENSSL_free(back); BN_free(n); } (void)ctx; } /* ── 7. Prime generation integrity ─────────────────────────────────────── */ /* * BN_generate_prime_ex() uses broken arithmetic on chibicc → may produce * even numbers or composites. Each generated prime must: * a) be odd * b) pass BN_MONT_CTX_set (the failing call in the bug) * c) pass BN_check_prime */ static void section_generated_primes(BN_CTX *ctx) { puts("\n=== 7. Generated Prime Integrity ==="); puts(" (BN_generate_prime_ex output must be odd, setup Montgomery, pass Miller-Rabin)"); int bit_sizes[] = { 32, 33, 40, 48, 64, 65, 128, 0 }; for (int i = 0; bit_sizes[i]; i++) { int bits = bit_sizes[i]; BIGNUM *p = BN_new(); clear_errors(); int ok = BN_generate_prime_ex(p, bits, 0, NULL, NULL, NULL); char la[64], lb[64], lc[64]; snprintf(la, sizeof(la), "gen-prime %d-bit: succeeds", bits); snprintf(lb, sizeof(lb), "gen-prime %d-bit: result is odd", bits); snprintf(lc, sizeof(lc), "gen-prime %d-bit: passes Miller-Rabin", bits); CHECK(ok == 1, la); if (ok) { CHECK(BN_is_odd(p), lb); if (!BN_is_odd(p)) { dump_bn("p", p); printf(" [INFO] Generated an EVEN 'prime' — word-width bug\n"); } /* Montgomery setup */ BN_MONT_CTX *mont = BN_MONT_CTX_new(); clear_errors(); int mrc = BN_MONT_CTX_set(mont, p, ctx); char lm[64]; snprintf(lm, sizeof(lm), "gen-prime %d-bit: BN_MONT_CTX_set succeeds", bits); CHECK(mrc == 1, lm); if (mrc != 1) { printf(" [INFO] BN_MONT_CTX_set failed: %s\n", last_err()); printf(" [INFO] This reproduces the 'no inverse' from the bug report\n"); dump_bn("p", p); ERR_clear_error(); } BN_MONT_CTX_free(mont); /* Miller-Rabin */ clear_errors(); int prc = BN_check_prime(p, ctx, NULL); CHECK(prc == 1, lc); if (prc != 1) { printf(" [INFO] Generated prime failed Miller-Rabin (rc=%d): %s\n", prc, last_err()); ERR_clear_error(); } } BN_free(p); } } /* ── 8. Seed-specific reproducibility ──────────────────────────────────── */ /* * OPENSSL_TEST_RAND_SEED=1777212200 is the exact seed from the bug report. * We seed the PRNG identically and re-run the Montgomery setup + Miller-Rabin * checks to reproduce the deterministic failure. * * The seed affects the witness selection inside Miller-Rabin, but the * Montgomery setup failure happens before any witness is drawn. * Still, pinning the seed ensures bit-for-bit reproducibility. */ static void section_seed_reproducibility(BN_CTX *ctx) { puts("\n=== 8. Seed Reproducibility (OPENSSL_TEST_RAND_SEED=1777212200) ==="); unsigned int seed_val = 1777212200U; RAND_seed(&seed_val, sizeof(seed_val)); printf(" Seeded PRNG with %u (0x%08X)\n", seed_val, seed_val); /* Re-run Montgomery setup for the primes most likely to fail on chibicc */ const char *critical[] = { "010000000F", /* 33-bit: first to cross 32-bit boundary */ "8000000017", /* 40-bit: reported failure zone */ "1000000000000000D", /* 65-bit: first to cross 64-bit boundary */ NULL }; const char *clabels[] = { "seed-repro: 33-bit prime (BN_MONT_CTX_set)", "seed-repro: 40-bit prime (BN_MONT_CTX_set)", "seed-repro: 65-bit prime (BN_MONT_CTX_set)", NULL }; for (int i = 0; critical[i]; i++) { BIGNUM *n = NULL; BN_hex2bn(&n, critical[i]); clear_errors(); BN_MONT_CTX *mont = BN_MONT_CTX_new(); int rc = BN_MONT_CTX_set(mont, n, ctx); CHECK(rc == 1, clabels[i]); if (rc != 1) { printf(" [INFO] 'no inverse' reproduced with seed %u: %s\n", seed_val, last_err()); dump_bn("n", n); ERR_clear_error(); } BN_MONT_CTX_free(mont); /* Also run BN_check_prime under this seed */ clear_errors(); int prc = BN_check_prime(n, ctx, NULL); char pl[128]; snprintf(pl, sizeof(pl), "seed-repro: %s is prime (Miller-Rabin)", critical[i]); CHECK(prc == 1, pl); if (prc != 1) { printf(" [INFO] Miller-Rabin returned %d under seed %u\n", prc, seed_val); printf(" [INFO] This matches: 'ossl_bn_miller_rabin_is_prime == true' FAILED\n"); ERR_clear_error(); } BN_free(n); } /* Also generate a prime under this seed and verify it */ puts(" -- generate prime under fixed seed --"); BIGNUM *gp = BN_new(); clear_errors(); BN_generate_prime_ex(gp, 40, 0, NULL, NULL, NULL); CHECK(BN_is_odd(gp), "seed-repro: generated 40-bit prime is odd"); BN_MONT_CTX *mont = BN_MONT_CTX_new(); clear_errors(); int mrc = BN_MONT_CTX_set(mont, gp, ctx); CHECK(mrc == 1, "seed-repro: generated 40-bit prime passes BN_MONT_CTX_set"); if (mrc != 1) { printf(" [INFO] BN_MONT_CTX_set failed under seed %u: %s\n", seed_val, last_err()); dump_bn("gp", gp); ERR_clear_error(); } BN_MONT_CTX_free(mont); BN_free(gp); } /* ── main ──────────────────────────────────────────────────────────────── */ int main(void) { puts("================================================================"); puts(" chibicc Miller-Rabin / BN_mod_inverse regression test"); puts(" Reproduces:"); puts(" ossl_bn_miller_rabin_is_prime == true FAILED"); puts(" BN_mod_inverse: no inverse (crypto/bn/bn_gcd.c:532)"); puts(" OPENSSL_TEST_RAND_SEED=1777212200"); puts("================================================================"); /* Check if the seed env-var is set (as in the original failure) */ const char *env_seed = getenv("OPENSSL_TEST_RAND_SEED"); if (env_seed) printf(" Note: OPENSSL_TEST_RAND_SEED=%s (from environment)\n", env_seed); BN_CTX *ctx = BN_CTX_new(); if (!ctx) { fputs("BN_CTX_new failed\n", stderr); return 1; } section_platform(); section_lsb_integrity(ctx); section_montgomery_setup(ctx); section_explicit_inverse(ctx); section_miller_rabin(ctx); section_roundtrip(ctx); section_generated_primes(ctx); section_seed_reproducibility(ctx); BN_CTX_free(ctx); puts("\n================================================================"); printf(" TOTAL: %d/%d passed", g_pass, g_run); if (g_fail) printf(" *** %d FAILED ***", g_fail); puts("\n================================================================"); /* * INTERPRETING FAILURES ON CHIBICC * ───────────────────────────────── * Section 2 (LSB integrity) FAILS: * → BN_hex2bn zeros the low word → makes odd primes appear even. * → This is the root cause of everything below. * * Section 3 (Montgomery setup) FAILS with "no inverse": * → This IS the error from bn_gcd.c:532 in the bug report. * → Caused by the even-parity corruption above. * * Section 4 (explicit inverse) FAILS: * → BN_mod_inverse(R, w) returns NULL because w is even. * * Section 5 (Miller-Rabin) FAILS or returns -1: * → BN_check_prime returns -1 (internal error) matching * 'ossl_bn_miller_rabin_is_prime == true' being false. * * Failures isolated to specific bit sizes (33, 65) pinpoint the * BN_ULONG word-width boundary that chibicc miscompiles. * * THE FIX: ensure chibicc emits 64-bit load/store for `unsigned long` * on 64-bit hosts, or compile OpenSSL with -DBN_ULONG='unsigned long long'. */ return g_fail ? 1 : 0; } chibicc-1.0.24/test/openssl_crash5.c000066400000000000000000000506431517770275000172600ustar00rootroot00000000000000/* * Standalone reproduction test for OpenSSL ML-KEM codec failures * when compiled with chibicc. * * ML-KEM (FIPS 203) covers three layers of bit-manipulation * that chibicc is known to mishandle: * * A. ByteEncode_d / ByteDecode_d – bit-packing across byte boundaries * B. Compress_d / Decompress_d – unsigned long multiply-shift (Barrett) * C. NTT polynomial arithmetic – int16_t/int32_t promotion * * Build: * cc -O2 -o test_ml_kem_codec test_ml_kem_codec.c * * Expected with a conforming compiler: ALL PASS (exit 0) * Observed with chibicc: multiple FAILures (exit 1) */ #include #include #include #include #include /* ------------------------------------------------------------------ */ /* Constants */ /* ------------------------------------------------------------------ */ #define MLKEM_Q 3329 /* prime modulus */ #define MLKEM_N 256 /* polynomial degree */ /* ------------------------------------------------------------------ */ /* Test accounting */ /* ------------------------------------------------------------------ */ static int g_tests = 0, g_failed = 0; static void check(const char *name, int ok) { ++g_tests; printf("%s %s\n", ok ? "pass" : "FAIL", name); if (!ok) ++g_failed; } /* ================================================================== */ /* SECTION 1 – ByteEncode_d / ByteDecode_d (FIPS 203 §4.2.1) */ /* */ /* Pack N d-bit integers into bytes LSB-first. */ /* The optimised streaming variant uses a uint32_t accumulator and */ /* multi-byte shifts that chibicc mishandles for d=10,11,12. */ /* ================================================================== */ /* Reference: unambiguous bit-by-bit implementation */ static void byte_encode_ref(const uint16_t *f, int d, uint8_t *out, size_t out_len) { memset(out, 0, out_len); int bit_pos = 0; for (int i = 0; i < MLKEM_N; i++) { uint32_t val = f[i] & ((1u << d) - 1); for (int b = 0; b < d; b++) { if (val & (1u << b)) out[bit_pos / 8] |= (uint8_t)(1u << (bit_pos % 8)); bit_pos++; } } } static void byte_decode_ref(const uint8_t *in, int d, uint16_t *f) { int bit_pos = 0; for (int i = 0; i < MLKEM_N; i++) { uint32_t val = 0; for (int b = 0; b < d; b++) { if (in[bit_pos / 8] & (1u << (bit_pos % 8))) val |= (1u << b); bit_pos++; } f[i] = (uint16_t)(val & ((1u << d) - 1)); } } /* * Optimised streaming encode — as generated by OpenSSL. * chibicc bug: the shift buf |= val << bits is computed in int (32-bit) * but for large 'bits' the result is silently truncated. */ static void byte_encode_opt(const uint16_t *f, int d, uint8_t *out, size_t out_len) { memset(out, 0, out_len); uint32_t buf = 0; int bits = 0; size_t o = 0; for (int i = 0; i < MLKEM_N; i++) { uint32_t val = (uint32_t)(f[i]) & ((1u << d) - 1); buf |= val << bits; bits += d; while (bits >= 8 && o < out_len) { out[o++] = (uint8_t)(buf & 0xFF); buf >>= 8; bits -= 8; } } if (bits > 0 && o < out_len) out[o] = (uint8_t)(buf & 0xFF); } static void byte_decode_opt(const uint8_t *in, int d, uint16_t *f) { uint32_t buf = 0; int bits = 0; int i_in = 0; uint32_t mask = (1u << d) - 1; for (int i = 0; i < MLKEM_N; i++) { while (bits < d) { buf |= (uint32_t)in[i_in++] << bits; bits += 8; } f[i] = (uint16_t)(buf & mask); buf >>= d; bits -= d; } } static void test_byte_encode_decode(int d) { char name[80]; size_t out_len = ((size_t)MLKEM_N * (size_t)d + 7) / 8; uint8_t enc_ref[512], enc_opt[512]; uint16_t dec_ref[MLKEM_N], dec_opt[MLKEM_N]; uint16_t poly[MLKEM_N]; uint32_t mask = (1u << d) - 1; for (int i = 0; i < MLKEM_N; i++) poly[i] = (uint16_t)((i * 7 + 13) & mask); byte_encode_ref(poly, d, enc_ref, out_len); byte_encode_opt(poly, d, enc_opt, out_len); snprintf(name, sizeof(name), "ByteEncode_%2d opt==ref", d); check(name, memcmp(enc_ref, enc_opt, out_len) == 0); byte_decode_ref(enc_ref, d, dec_ref); snprintf(name, sizeof(name), "ByteDecode_%2d ref roundtrip", d); check(name, memcmp(poly, dec_ref, MLKEM_N * 2) == 0); byte_decode_opt(enc_ref, d, dec_opt); snprintf(name, sizeof(name), "ByteDecode_%2d opt roundtrip", d); check(name, memcmp(poly, dec_opt, MLKEM_N * 2) == 0); /* cross: opt-encode → opt-decode */ uint16_t dec_cross[MLKEM_N]; byte_decode_opt(enc_opt, d, dec_cross); snprintf(name, sizeof(name), "ByteCodec_%2d cross", d); check(name, memcmp(poly, dec_cross, MLKEM_N * 2) == 0); } /* ================================================================== */ /* SECTION 2 – Compress_d / Decompress_d (FIPS 203 §4.2.1) */ /* */ /* compress(x, d) = round(2^d * x / q) mod 2^d */ /* decompress(y, d) = round(q * y / 2^d) */ /* */ /* The optimised path uses a unsigned long intermediate product. */ /* chibicc bug: (unsigned long)a * b may be silently computed as 32-bit. */ /* ================================================================== */ static uint16_t compress_ref(uint16_t x, int d) { uint32_t num = (uint32_t)x << d; uint32_t mask = (1u << d) - 1; return (uint16_t)(((num + MLKEM_Q / 2) / MLKEM_Q) & mask); } /* * Optimised compress using a unsigned long multiply. * The cast (unsigned long)t is the critical expression chibicc may drop. */ static uint16_t compress_opt(uint16_t x, int d) { /* * We want floor((x * 2^d + q/2) / q). * Compute as a 64-bit product to avoid overflow for large d. */ unsigned long num = ((unsigned long)x << d) + (MLKEM_Q / 2); return (uint16_t)((num / MLKEM_Q) & ((1u << d) - 1)); } static uint16_t decompress_ref(uint16_t y, int d) { uint32_t num = (uint32_t)MLKEM_Q * (uint32_t)y; return (uint16_t)((num + (1u << (d - 1))) >> d); } /* * Optimised decompress — also uses a 32→64 bit intermediate. * chibicc may mishandle the shift when d is large. */ static uint16_t decompress_opt(uint16_t y, int d) { unsigned long num = (unsigned long)MLKEM_Q * (unsigned long)y; return (uint16_t)((num + ((unsigned long)1 << (d - 1))) >> d); } static void test_compress_decompress(int d) { char name[80]; int errs_c = 0, errs_d = 0; for (int x = 0; x < MLKEM_Q; x++) { uint16_t cr = compress_ref((uint16_t)x, d); uint16_t co = compress_opt((uint16_t)x, d); if (cr != co) errs_c++; uint16_t dr = decompress_ref(cr, d); uint16_t doo = decompress_opt(cr, d); if (dr != doo) errs_d++; } snprintf(name, sizeof(name), "Compress_%2d opt==ref (over all x> d) + 1; for (int i = 0; i < MLKEM_N; i++) { int32_t diff = (int32_t)poly2[i] - (int32_t)poly[i]; if (diff > (int32_t)(MLKEM_Q / 2)) diff -= MLKEM_Q; if (diff < -(int32_t)(MLKEM_Q / 2)) diff += MLKEM_Q; if (diff < 0) diff = -diff; if ((uint32_t)diff > threshold) errs++; } snprintf(name, sizeof(name), "FullCodec_%2d error bound OK", d); check(name, errs == 0); } /* ================================================================== */ /* SECTION 4 – Bit-manipulation patterns from the actual codec code */ /* */ /* These isolate the exact expressions chibicc gets wrong. */ /* ================================================================== */ static void test_bit_patterns(void) { /* * 4a. 12-bit coefficient extraction (used in ByteDecode_12, * which encodes 256 NTT coefficients as 384 bytes). * * Given 3 bytes, extract two 12-bit values: * lo = buf[0] | ((buf[1] & 0x0F) << 8) * hi = (buf[1] >> 4) | (buf[2] << 4) ← chibicc truncates here */ { uint8_t buf[3] = { 0xAB, 0xCD, 0xEF }; /* lo: bits 0..11 */ uint16_t lo = (uint16_t)(buf[0]) | (uint16_t)((uint16_t)(buf[1] & 0x0F) << 8); /* hi: bits 12..23 — need (uint16_t) cast BEFORE shift to avoid truncation */ uint16_t hi = (uint16_t)(buf[1] >> 4) | (uint16_t)((uint16_t)buf[2] << 4); /* 0xAB | 0xD00 = 0xDAB */ check("BitPattern 12-bit lo == 0xDAB", lo == 0xDAB); /* 0x0C | 0xEF0 = 0xEFC */ check("BitPattern 12-bit hi == 0xEFC", hi == 0xEFC); } /* * 4b. 10-bit coefficient pack/unpack across all MLKEM_N=256 coefficients * (ML-KEM-512 ciphertext u, d=10 → 320 bytes). * All coefficients set to the max 10-bit value 0x3FF. */ { uint16_t src[MLKEM_N]; for (int i = 0; i < MLKEM_N; i++) src[i] = 0x3FF; uint8_t packed[320]; /* MLKEM_N * 10 / 8 = 320 */ memset(packed, 0, sizeof(packed)); byte_encode_ref(src, 10, packed, 320); uint16_t got[MLKEM_N]; byte_decode_ref(packed, 10, got); check("BitPattern 10-bit pack/unpack c0", got[0] == 0x3FF); check("BitPattern 10-bit pack/unpack c127", got[127] == 0x3FF); check("BitPattern 10-bit pack/unpack c128", got[128] == 0x3FF); check("BitPattern 10-bit pack/unpack c255", got[255] == 0x3FF); } /* * 4c. unsigned long multiply: chibicc may compute (unsigned long)a*b in 32 bits * when one operand is uint32_t. */ { uint32_t a = 0xFFFFFFFFu; uint32_t b = 2u; unsigned long p = (unsigned long)a * b; check("uint64 multiply 0xFFFFFFFF*2 == 0x1FFFFFFFE", p == 0x1FFFFFFFEull); } /* * 4d. Shift of unsigned long value: chibicc may truncate to 32 bits. */ { unsigned long v = (unsigned long)1 << 32; check("uint64 shift 1<<32 != 0", v != 0); check("uint64 shift 1<<32 == 0x100000000", v == 0x100000000ull); } /* * 4e. Multi-byte packing at non-zero bit offset. * Mirrors the ByteEncode_11 streaming encoder. */ { uint16_t coeff = 0x7FF; /* 11-bit maximum */ uint8_t out[3] = {0}; int bit_off = 5; /* Pack 11 bits at bit position 5 into out[0..2] */ out[0] |= (uint8_t)(coeff << bit_off); /* low 3 bits */ out[1] = (uint8_t)(coeff >> (8 - bit_off)); /* next 8 bits */ out[2] = (uint8_t)(coeff >> (16 - bit_off)); /* top bits */ /* Unpack */ uint16_t rec = (uint16_t)(out[0] >> bit_off) | (uint16_t)((uint16_t)out[1] << (8 - bit_off)) | (uint16_t)((uint16_t)out[2] << (16 - bit_off)); rec &= 0x7FF; check("MultiPack 11-bit at bit_off=5 round-trips", rec == 0x7FF); } /* * 4f. Signed arithmetic right shift — used in Barrett reduction and NTT. * C11 defines this as implementation-defined, but all real targets * (and chibicc's target x86-64 ABI) must sign-extend. */ { int32_t neg = -3329; int32_t shifted = neg >> 1; check("Signed right shift -3329>>1 == -1665", shifted == -1665); } } /* ================================================================== */ /* SECTION 5 – NTT Montgomery reduction */ /* */ /* Montgomery reduce: given t in [-q*2^15, q*2^15), return */ /* t * R^{-1} mod q, where R = 2^16. */ /* chibicc may mis-promote int16_t * int32_t to int32_t. */ /* ================================================================== */ /* q^{-1} mod 2^16 = 62209 (because 3329 * 62209 ≡ 1 mod 2^16) */ #define MLKEM_QINV 62209 static int16_t montgomery_reduce(int32_t t) { /* * u = (int16_t)(t mod 2^16) * (-q^{-1} mod 2^16) * The cast to int16_t followed by int32_t multiplication is the * expression chibicc mis-compiles (sign-extension missing). */ int16_t u = (int16_t)((uint16_t)t * (uint16_t)MLKEM_QINV); return (int16_t)((t - (int32_t)u * (int32_t)MLKEM_Q) >> 16); } static void test_montgomery_reduce(void) { /* Known values: montgomery_reduce(r*a mod q) == a for r=2^16 mod q=2285 */ int32_t R = 2285; /* R = 2^16 mod q */ /* reduce(0) == 0 */ check("MontReduce(0) == 0", montgomery_reduce(0) == 0); /* reduce(R * 1) ≡ 1 (mod q) */ int16_t mr1 = montgomery_reduce(R * 1); check("MontReduce(R*1) == 1", mr1 == 1); /* reduce(R * q) ≡ 0 (mod q) */ int16_t mrq = montgomery_reduce(R * MLKEM_Q); int32_t mrq_mod = ((int32_t)mrq % MLKEM_Q + MLKEM_Q) % MLKEM_Q; check("MontReduce(R*q) ≡ 0 (mod q)", mrq_mod == 0); /* reduce(R * 1337) ≡ 1337 (mod q) */ int16_t mr1337 = montgomery_reduce(R * 1337); int32_t mr1337_mod = ((int32_t)mr1337 % MLKEM_Q + MLKEM_Q) % MLKEM_Q; check("MontReduce(R*1337) ≡ 1337 (mod q)", mr1337_mod == 1337); } /* ================================================================== */ /* SECTION 6 – Struct layout (key / ciphertext encoding) */ /* */ /* OpenSSL serialises keys as flat byte arrays; any compiler-added */ /* padding would shift field offsets and break encode/decode. */ /* ================================================================== */ /* ML-KEM-512 expanded decapsulation key (dk) layout per FIPS 203 */ typedef struct { uint8_t z[32]; /* rejection-sampling seed */ uint8_t rho[32]; /* public matrix seed */ uint8_t H_ek[32]; /* H(ek) = SHA3-256(ek) */ uint8_t s_hat[768]; /* NTT of secret key (k=2 polys) */ uint8_t t_hat[768]; /* NTT of public key (k=2 polys) */ } MLKEM512_DK; /* expected total: 32+32+32+768+768 = 1632 */ typedef struct { uint8_t rho[32]; /* seed for matrix A */ uint8_t t_hat[768]; /* NTT of public key */ } MLKEM512_EK; /* expected: 800 */ static void test_struct_layout(void) { check("sizeof(MLKEM512_DK) == 1632", sizeof(MLKEM512_DK) == 1632); check("sizeof(MLKEM512_EK) == 800", sizeof(MLKEM512_EK) == 800); MLKEM512_DK dk; ptrdiff_t z_off = (uint8_t*)&dk.z - (uint8_t*)&dk; ptrdiff_t rho_off = (uint8_t*)&dk.rho - (uint8_t*)&dk; ptrdiff_t hek_off = (uint8_t*)&dk.H_ek - (uint8_t*)&dk; ptrdiff_t sh_off = (uint8_t*)&dk.s_hat - (uint8_t*)&dk; ptrdiff_t th_off = (uint8_t*)&dk.t_hat - (uint8_t*)&dk; check("MLKEM512_DK.z at offset 0", z_off == 0); check("MLKEM512_DK.rho at offset 32", rho_off == 32); check("MLKEM512_DK.H_ek at offset 64", hek_off == 64); check("MLKEM512_DK.s_hat at offset 96", sh_off == 96); check("MLKEM512_DK.t_hat at offset 864", th_off == 864); } /* ================================================================== */ /* SECTION 7 – Integer promotion edge cases */ /* */ /* These isolate the exact C promotion rules chibicc violates. */ /* ================================================================== */ static void test_integer_promotions(void) { /* * 7a. uint8_t shifted left by ≥8 must be zero (after promotion to int). * chibicc bug: may leave the high byte intact. */ { uint8_t b = 0xFF; int shifted = b << 8; check("(uint8_t)0xFF << 8 == 0xFF00", shifted == 0xFF00); int shifted16 = b << 16; check("(uint8_t)0xFF << 16 == 0xFF0000", shifted16 == 0xFF0000); } /* * 7b. uint16_t in arithmetic expression must be promoted to int (≥32-bit). * chibicc bug: may stay 16-bit, losing overflow. */ { uint16_t a = 0xFFFF, b = 0xFFFF; uint32_t product = (uint32_t)a * (uint32_t)b; check("(uint32_t)0xFFFF * 0xFFFF == 0xFFFE0001", product == 0xFFFE0001u); } /* * 7c. Signed/unsigned mix in compress: the expression * (int32_t)x - (int32_t)q must sign-extend correctly. */ { uint16_t x = 3328u; /* q - 1 */ int32_t diff = (int32_t)x - (int32_t)MLKEM_Q; /* = -1 */ check("(int32_t)(q-1) - (int32_t)q == -1", diff == -1); } /* * 7d. Barrett constant computation requires unsigned long numerator. * For d=11, max input to compress is (q-1)*2048 + 1664 ≈ 6.8M, * which overflows uint32_t when shifted. */ { uint32_t max_in = (uint32_t)(MLKEM_Q - 1) * 2048u + MLKEM_Q / 2; unsigned long num64 = (unsigned long)max_in; /* Ensure 64-bit path doesn't overflow */ check("Barrett d=11 numerator fits uint64", num64 < 0xFFFFFFFFFFFFFFFFull); /* Ensure it is much larger than MLKEM_Q (would overflow uint16_t) */ check("Barrett d=11 numerator > 0xFFFF", num64 > 0xFFFFull); } } /* ================================================================== */ /* main */ /* ================================================================== */ int main(void) { printf("=== ML-KEM Codec Reproduction Test (chibicc compat) ===\n"); printf(" (FIPS 203 / OpenSSL 15-test_ml_kem_codecs.t)\n\n"); printf("-- Section 1: ByteEncode/ByteDecode (d=1..12) --\n"); for (int d = 1; d <= 12; d++) test_byte_encode_decode(d); printf("\n-- Section 2: Compress/Decompress (d=1..11) --\n"); for (int d = 1; d <= 11; d++) test_compress_decompress(d); printf("\n-- Section 3: Full codec (compress+encode / decode+decompress) --\n"); int ds[] = { 1, 4, 5, 10, 11 }; for (int i = 0; i < 5; i++) test_full_codec(ds[i]); printf("\n-- Section 4: Bit-manipulation patterns --\n"); test_bit_patterns(); printf("\n-- Section 5: NTT Montgomery reduction --\n"); test_montgomery_reduce(); printf("\n-- Section 6: Struct layout / field offsets --\n"); test_struct_layout(); printf("\n-- Section 7: Integer promotion edge cases --\n"); test_integer_promotions(); printf("\n========================================\n"); printf("Results: %d/%d passed", g_tests - g_failed, g_tests); if (g_failed) printf(", %d FAILED ← chibicc codegen bug(s) detected\n", g_failed); else printf(" — ALL PASS\n"); printf("========================================\n"); return (g_failed > 0) ? 1 : 0; } chibicc-1.0.24/test/openssl_crash6_simple.c000066400000000000000000000301131517770275000206200ustar00rootroot00000000000000/* * test_constant_time.c * * Test suite for value_barrier / constant_time_cond_swap functions. * Designed to compile and run under chibicc (a small C11 compiler), * which means: * - No GCC inline-asm (__asm__) support → OPENSSL_NO_ASM path is taken. * - No _Bool / stdbool.h guaranteed, use int for booleans. * - Keep stdio.h + stdint.h as the only headers. * - Avoid VLAs, compound-literals, __builtin_*, and GNU extensions. * * Build (chibicc): * chibicc -o test_constant_time test_constant_time.c * * Build (GCC – will use the volatile fallback because of -DOPENSSL_NO_ASM): * gcc -DOPENSSL_NO_ASM -std=c11 -o test_constant_time test_constant_time.c * * Build (GCC – ASM path, tests that the asm variant also passes): * gcc -std=c11 -o test_constant_time test_constant_time.c */ #include #include "test.h" /* ------------------------------------------------------------------ */ /* Minimal compatibility shims */ /* ------------------------------------------------------------------ */ /* chibicc does not define ossl_inline; map it to nothing / static. */ #ifndef ossl_inline #define ossl_inline #endif /* ------------------------------------------------------------------ */ /* Functions under test (copied verbatim from the original header) */ /* ------------------------------------------------------------------ */ static ossl_inline unsigned int value_barrier(unsigned int a) { #if !defined(OPENSSL_NO_ASM) && defined(__GNUC__) unsigned int r; __asm__("" : "=r"(r) : "0"(a)); #else volatile unsigned int r = a; #endif return r; } static ossl_inline uint32_t value_barrier_32(uint32_t a) { #if !defined(OPENSSL_NO_ASM) && defined(__GNUC__) uint32_t r; __asm__("" : "=r"(r) : "0"(a)); #else volatile uint32_t r = a; #endif return r; } static ossl_inline uint64_t value_barrier_64(uint64_t a) { #if !defined(OPENSSL_NO_ASM) && defined(__GNUC__) uint64_t r; __asm__("" : "=r"(r) : "0"(a)); #else volatile uint64_t r = a; #endif return r; } /* * constant_time_cond_swap_32 * mask must be 0xFFFFFFFF (swap) or 0x00000000 (no-op). */ static ossl_inline void constant_time_cond_swap_32(uint32_t mask, uint32_t *a, uint32_t *b) { uint32_t xorval = *a ^ *b; xorval &= value_barrier_32(mask); *a ^= xorval; *b ^= xorval; } /* * constant_time_cond_swap_64 * mask must be 0xFFFFFFFFFFFFFFFF (swap) or 0x00000000 (no-op). */ static ossl_inline void constant_time_cond_swap_64(uint64_t mask, uint64_t *a, uint64_t *b) { uint64_t xorval = *a ^ *b; xorval &= value_barrier_64(mask); *a ^= xorval; *b ^= xorval; } /* ------------------------------------------------------------------ */ /* Tiny test framework (no external deps) */ /* ------------------------------------------------------------------ */ static int g_pass = 0; static int g_fail = 0; /* Integer equality check */ #define CHECK_EQ(label, got, expected) \ do { \ if ((got) == (expected)) { \ printf(" PASS %s\n", label); \ g_pass++; \ } else { \ printf(" FAIL %s : got 0x%llx, expected 0x%llx\n", \ label, \ (unsigned long long)(got), \ (unsigned long long)(expected)); \ g_fail++; \ } \ } while (0) /* ------------------------------------------------------------------ */ /* Test: value_barrier (unsigned int) */ /* ------------------------------------------------------------------ */ static void test_value_barrier_uint(void) { printf("\n[value_barrier – unsigned int]\n"); CHECK_EQ("zero passthrough", value_barrier(0u), 0u); CHECK_EQ("one passthrough", value_barrier(1u), 1u); CHECK_EQ("max passthrough", value_barrier(0xFFFFFFFFu), 0xFFFFFFFFu); CHECK_EQ("midrange passthrough", value_barrier(0xDEADBEEFu), 0xDEADBEEFu); CHECK_EQ("alternating bits hi", value_barrier(0xAAAAAAAAu), 0xAAAAAAAAu); CHECK_EQ("alternating bits lo", value_barrier(0x55555555u), 0x55555555u); } /* ------------------------------------------------------------------ */ /* Test: value_barrier_32 */ /* ------------------------------------------------------------------ */ static void test_value_barrier_32(void) { printf("\n[value_barrier_32 – uint32_t]\n"); CHECK_EQ("zero", value_barrier_32(0), (uint32_t)0); CHECK_EQ("one", value_barrier_32(1), (uint32_t)1); CHECK_EQ("all-ones", value_barrier_32(0xFFFFFFFFu), (uint32_t)0xFFFFFFFFu); CHECK_EQ("0xCAFEBABE", value_barrier_32(0xCAFEBABEu), (uint32_t)0xCAFEBABEu); CHECK_EQ("0x00000001", value_barrier_32(1u), (uint32_t)1u); CHECK_EQ("0x80000000", value_barrier_32(0x80000000u), (uint32_t)0x80000000u); } /* ------------------------------------------------------------------ */ /* Test: value_barrier_64 */ /* ------------------------------------------------------------------ */ static void test_value_barrier_64(void) { printf("\n[value_barrier_64 – uint64_t]\n"); CHECK_EQ("zero", value_barrier_64(0), (uint64_t)0); CHECK_EQ("one", value_barrier_64(1), (uint64_t)1); CHECK_EQ("all-ones", value_barrier_64(UINT64_C(0xFFFFFFFFFFFFFFFF)), UINT64_C(0xFFFFFFFFFFFFFFFF)); CHECK_EQ("high-word only", value_barrier_64(UINT64_C(0xDEADBEEF00000000)), UINT64_C(0xDEADBEEF00000000)); CHECK_EQ("low-word only", value_barrier_64(UINT64_C(0x00000000CAFEBABE)), UINT64_C(0x00000000CAFEBABE)); CHECK_EQ("alternating 64-bit", value_barrier_64(UINT64_C(0xAAAAAAAAAAAAAAAA)), UINT64_C(0xAAAAAAAAAAAAAAAA)); } /* ------------------------------------------------------------------ */ /* Test: constant_time_cond_swap_32 */ /* ------------------------------------------------------------------ */ static void test_cond_swap_32(void) { uint32_t a, b; printf("\n[constant_time_cond_swap_32]\n"); /* --- mask = 0xFFFFFFFF : must swap --- */ a = 0xAAAAAAAAu; b = 0x55555555u; constant_time_cond_swap_32(0xFFFFFFFFu, &a, &b); CHECK_EQ("swap mask=FF: a becomes 0x55555555", a, (uint32_t)0x55555555u); CHECK_EQ("swap mask=FF: b becomes 0xAAAAAAAA", b, (uint32_t)0xAAAAAAAAu); /* --- mask = 0x00000000 : must NOT swap --- */ a = 0xAAAAAAAAu; b = 0x55555555u; constant_time_cond_swap_32(0x00000000u, &a, &b); CHECK_EQ("noop mask=00: a unchanged", a, (uint32_t)0xAAAAAAAAu); CHECK_EQ("noop mask=00: b unchanged", b, (uint32_t)0x55555555u); /* --- both values equal, swap mask --- */ a = 0x12345678u; b = 0x12345678u; constant_time_cond_swap_32(0xFFFFFFFFu, &a, &b); CHECK_EQ("equal values swap: a unchanged", a, (uint32_t)0x12345678u); CHECK_EQ("equal values swap: b unchanged", b, (uint32_t)0x12345678u); /* --- both values equal, noop mask --- */ a = 0xDEADBEEFu; b = 0xDEADBEEFu; constant_time_cond_swap_32(0x00000000u, &a, &b); CHECK_EQ("equal values noop: a unchanged", a, (uint32_t)0xDEADBEEFu); CHECK_EQ("equal values noop: b unchanged", b, (uint32_t)0xDEADBEEFu); /* --- boundary: a=0 b=MAX, swap --- */ a = 0u; b = 0xFFFFFFFFu; constant_time_cond_swap_32(0xFFFFFFFFu, &a, &b); CHECK_EQ("0<->MAX swap: a becomes MAX", a, (uint32_t)0xFFFFFFFFu); CHECK_EQ("0<->MAX swap: b becomes 0", b, (uint32_t)0u); /* --- boundary: a=0 b=MAX, noop --- */ a = 0u; b = 0xFFFFFFFFu; constant_time_cond_swap_32(0x00000000u, &a, &b); CHECK_EQ("0<->MAX noop: a stays 0", a, (uint32_t)0u); CHECK_EQ("0<->MAX noop: b stays MAX", b, (uint32_t)0xFFFFFFFFu); /* --- idempotency: double swap restores originals --- */ a = 0xCAFEBABEu; b = 0x0FF1CE00u; constant_time_cond_swap_32(0xFFFFFFFFu, &a, &b); constant_time_cond_swap_32(0xFFFFFFFFu, &a, &b); CHECK_EQ("double swap: a restored", a, (uint32_t)0xCAFEBABEu); CHECK_EQ("double swap: b restored", b, (uint32_t)0x0FF1CE00u); } /* ------------------------------------------------------------------ */ /* Test: constant_time_cond_swap_64 */ /* ------------------------------------------------------------------ */ static void test_cond_swap_64(void) { uint64_t a, b; printf("\n[constant_time_cond_swap_64]\n"); /* --- mask = all-ones : must swap --- */ a = UINT64_C(0xAAAAAAAAAAAAAAAA); b = UINT64_C(0x5555555555555555); constant_time_cond_swap_64(UINT64_C(0xFFFFFFFFFFFFFFFF), &a, &b); CHECK_EQ("swap mask=FF: a becomes 0x5555...", a, UINT64_C(0x5555555555555555)); CHECK_EQ("swap mask=FF: b becomes 0xAAAA...", b, UINT64_C(0xAAAAAAAAAAAAAAAA)); /* --- mask = 0 : must NOT swap --- */ a = UINT64_C(0xAAAAAAAAAAAAAAAA); b = UINT64_C(0x5555555555555555); constant_time_cond_swap_64(UINT64_C(0), &a, &b); CHECK_EQ("noop mask=00: a unchanged", a, UINT64_C(0xAAAAAAAAAAAAAAAA)); CHECK_EQ("noop mask=00: b unchanged", b, UINT64_C(0x5555555555555555)); /* --- equal values, swap mask --- */ a = UINT64_C(0x0123456789ABCDEF); b = UINT64_C(0x0123456789ABCDEF); constant_time_cond_swap_64(UINT64_C(0xFFFFFFFFFFFFFFFF), &a, &b); CHECK_EQ("equal values swap: a unchanged", a, UINT64_C(0x0123456789ABCDEF)); CHECK_EQ("equal values swap: b unchanged", b, UINT64_C(0x0123456789ABCDEF)); /* --- boundary: a=0 b=MAX, swap --- */ a = UINT64_C(0); b = UINT64_C(0xFFFFFFFFFFFFFFFF); constant_time_cond_swap_64(UINT64_C(0xFFFFFFFFFFFFFFFF), &a, &b); CHECK_EQ("0<->MAX swap: a becomes MAX", a, UINT64_C(0xFFFFFFFFFFFFFFFF)); CHECK_EQ("0<->MAX swap: b becomes 0", b, UINT64_C(0)); /* --- boundary: a=0 b=MAX, noop --- */ a = UINT64_C(0); b = UINT64_C(0xFFFFFFFFFFFFFFFF); constant_time_cond_swap_64(UINT64_C(0), &a, &b); CHECK_EQ("0<->MAX noop: a stays 0", a, UINT64_C(0)); CHECK_EQ("0<->MAX noop: b stays MAX", b, UINT64_C(0xFFFFFFFFFFFFFFFF)); /* --- high-word only differs --- */ a = UINT64_C(0xDEADBEEF00000000); b = UINT64_C(0xCAFEBABE00000000); constant_time_cond_swap_64(UINT64_C(0xFFFFFFFFFFFFFFFF), &a, &b); CHECK_EQ("high-word swap: a", a, UINT64_C(0xCAFEBABE00000000)); CHECK_EQ("high-word swap: b", b, UINT64_C(0xDEADBEEF00000000)); /* --- idempotency: double swap restores originals --- */ a = UINT64_C(0x0000000100000002); b = UINT64_C(0xFFFFFFFEFFFFFFFD); constant_time_cond_swap_64(UINT64_C(0xFFFFFFFFFFFFFFFF), &a, &b); constant_time_cond_swap_64(UINT64_C(0xFFFFFFFFFFFFFFFF), &a, &b); CHECK_EQ("double swap: a restored", a, UINT64_C(0x0000000100000002)); CHECK_EQ("double swap: b restored", b, UINT64_C(0xFFFFFFFEFFFFFFFD)); } /* ------------------------------------------------------------------ */ /* main */ /* ------------------------------------------------------------------ */ int main(void) { printf("=== constant-time helpers – chibicc test suite ===\n"); test_value_barrier_uint(); test_value_barrier_32(); test_value_barrier_64(); test_cond_swap_32(); test_cond_swap_64(); printf("\n=== Results: %d passed, %d failed ===\n", g_pass, g_fail); return g_fail == 0 ? 0 : 1; } chibicc-1.0.24/test/openssl_div.c000066400000000000000000000001271517770275000166450ustar00rootroot00000000000000int main() { if ( ((unsigned int)-1 / 2) == 0x7fffffff ) return 0; return 1; } chibicc-1.0.24/test/openssl_linkage.c000066400000000000000000000017361517770275000175040ustar00rootroot00000000000000#include "test.h" // test_const_if.c extern int ossl_fips_intern_provider_init(void); int foo(void) { if (0) return ossl_fips_intern_provider_init(); return 1; } // test_pp_macro.c #define USE_FIPS 0 extern int ossl_fips_intern_provider_init3(void); int foo3(void) { #if USE_FIPS return ossl_fips_intern_provider_init3(); #else return 7; #endif } // test_pp_if0.c extern int ossl_fips_intern_provider_init2(void); int foo2(void) { #if 0 return ossl_fips_intern_provider_init2(); #else return 42; #endif } // test_pp_if1.c extern int ossl_fips_intern_provider_init4(void); int foo4(void) { #if 1 return 0; #else return ossl_fips_intern_provider_init4(); #endif } int main(void) { int x; x = foo(); printf("x = %d\n", x); ASSERT(1, x); x = foo2(); printf("x = %d\n", x); ASSERT(42, x); x = foo3(); printf("x = %d\n", x); ASSERT(7, x); x = foo4(); printf("x = %d\n", x); ASSERT(0, x); return 0; }chibicc-1.0.24/test/openssl_overflow.c000066400000000000000000000004241517770275000177260ustar00rootroot00000000000000#include int main() { unsigned int a = 0xFFFFFFFF; unsigned int b = 1; // If this is folded, it must be folded correctly (TRUE) if ( (0xFFFFFFFFU + 1U) < 0xFFFFFFFFU ) return 0; // Correct: overflowed return 1; // Incorrect: folding skipped overflow } chibicc-1.0.24/test/overflow.c000066400000000000000000000066361517770275000161760ustar00rootroot00000000000000#include "test.h" typedef unsigned __int128 uint128; int main() { // Add Overflow - Unsigned unsigned int ua = 4294967295u; // UINT_MAX unsigned int ub = 1; unsigned int ures; int ov = __builtin_add_overflow(ua, ub, &ures); ASSERT(1, ov); ASSERT(0, ures); ua = 10; ub = 20; ov = __builtin_add_overflow(ua, ub, &ures); ASSERT(0, ov); ASSERT(30, ures); // Add Overflow - Signed int sa = 2147483647; // INT_MAX int sb = 1; int sres; ov = __builtin_add_overflow(sa, sb, &sres); ASSERT(1, ov); ASSERT(-2147483648, sres); sa = 10; sb = 20; ov = __builtin_add_overflow(sa, sb, &sres); ASSERT(0, ov); ASSERT(30, sres); // Sub Overflow - Unsigned ua = 0; ub = 1; ov = __builtin_sub_overflow(ua, ub, &ures); ASSERT(1, ov); ASSERT(4294967295u, ures); ua = 30; ub = 20; ov = __builtin_sub_overflow(ua, ub, &ures); ASSERT(0, ov); ASSERT(10, ures); // Sub Overflow - Signed sa = -2147483648; // INT_MIN sb = 1; ov = __builtin_sub_overflow(sa, sb, &sres); ASSERT(1, ov); ASSERT(2147483647, sres); sa = 30; sb = 20; ov = __builtin_sub_overflow(sa, sb, &sres); ASSERT(0, ov); ASSERT(10, sres); // Mul Overflow - Unsigned ua = 4294967295u; // UINT_MAX ub = 2; ov = __builtin_mul_overflow(ua, ub, &ures); ASSERT(1, ov); ASSERT(4294967294u, ures); ua = 10; ub = 20; ov = __builtin_mul_overflow(ua, ub, &ures); ASSERT(0, ov); ASSERT(200, ures); // Mul Overflow - Signed sa = 2147483647; // INT_MAX sb = 2; ov = __builtin_mul_overflow(sa, sb, &sres); ASSERT(1, ov); ASSERT(-2, sres); sa = -10; sb = -10; ov = __builtin_mul_overflow(sa, sb, &sres); ASSERT(0, ov); ASSERT(100, sres); // Add Overflow - Unsigned __int128 uint128 u128a = (uint128)-1; // Max uint128 uint128 u128b = 1; uint128 u128res; ov = __builtin_add_overflow(u128a, u128b, &u128res); ASSERT(1, ov); ASSERT128(0, u128res); u128a = 10; u128b = 20; ov = __builtin_add_overflow(u128a, u128b, &u128res); ASSERT(0, ov); ASSERT128(30, u128res); // Add Overflow - Signed __int128 __int128 s128a = ((__int128)1 << 126); // Large positive __int128 s128b = ((__int128)1 << 126); // 2^126 + 2^126 = 2^127, which is larger than max int128 (2^127 - 1) -> overflow for signed? // Max signed int128 is 2^127 - 1. 2^126 + 2^126 = 2^127. So yes, overflow. // Wait, max int128 is 0x7fff... (127 bits). The sign bit is bit 128. // 1<<126 is positive. (1<<126) + (1<<126) = 1<<127 = 0x8000... which is negative. __int128 s128res; ov = __builtin_add_overflow(s128a, s128b, &s128res); ASSERT(1, ov); ASSERT128((__int128)1 << 127, s128res); s128a = 10; s128b = 20; ov = __builtin_add_overflow(s128a, s128b, &s128res); ASSERT(0, ov); ASSERT128(30, s128res); // Sub Overflow - Unsigned __int128 u128a = 0; u128b = 1; ov = __builtin_sub_overflow(u128a, u128b, &u128res); ASSERT(1, ov); ASSERT128((uint128)-1, u128res); u128a = 30; u128b = 10; ov = __builtin_sub_overflow(u128a, u128b, &u128res); ASSERT(0, ov); ASSERT128(20, u128res); // Sub Overflow - Signed __int128 s128a = ((__int128)1 << 127); // Min signed int128 (negative) s128b = 1; ov = __builtin_sub_overflow(s128a, s128b, &s128res); ASSERT(1, ov); ASSERT128(((__int128)1 << 127) - 1, s128res); s128a = 30; s128b = 10; ov = __builtin_sub_overflow(s128a, s128b, &s128res); ASSERT(0, ov); ASSERT128(20, s128res); printf("OK\n"); return 0; } chibicc-1.0.24/test/pass_many_test.c000066400000000000000000000035621517770275000173570ustar00rootroot00000000000000#include #include "test.h" #define CHECK_ALIGN(ptr, align) \ ASSERT(0, ((uintptr_t)(ptr)) & ((align) - 1)) /* 8-byte alignment */ typedef struct __attribute__((aligned(8))){ char c; int i; } S8; /* 16-byte alignment */ typedef struct __attribute__((aligned(16))){ double d; int i; } S16; /* 32-byte alignment */ typedef struct __attribute__((aligned(32))) { char data[17]; } S32; /* 64-byte alignment */ typedef struct __attribute__((aligned(64))) { long x; char buf[13]; } S64; /* Nested, mixed alignment */ typedef struct { char c; S32 a; int x; S16 b; } SNested; /* Vector + alignment */ typedef struct __attribute__((aligned(32))) { float v[8]; } SVec; /* Pass-by-stack stress - minimal test */ static void pass_many( S8 a, S16 b, S32 c, S64 d, SNested e, SVec f, S32 g, S64 h) { printf("Checking a at %p, align 8\n", (void*)&a); CHECK_ALIGN(&a, 8); printf("Checking b at %p, align 16\n", (void*)&b); CHECK_ALIGN(&b, 16); printf("Checking c at %p, align 32\n", (void*)&c); CHECK_ALIGN(&c, 32); printf("Checking d at %p, align 64\n", (void*)&d); CHECK_ALIGN(&d, 64); printf("Checking e.a at %p, align 32\n", (void*)&e.a); CHECK_ALIGN(&e.a, 32); printf("Checking f at %p, align 32\n", (void*)&f); CHECK_ALIGN(&f, 32); printf("Checking g at %p, align 32\n", (void*)&g); CHECK_ALIGN(&g, 32); printf("Checking h at %p, align 64\n", (void*)&h); CHECK_ALIGN(&h, 64); ASSERT(1, a.c); ASSERT(2, b.i); ASSERT(3, c.data[0]); ASSERT(4, d.buf[0]); ASSERT(5, e.a.data[0]); ASSERT(6, f.v[0]); ASSERT(7, g.data[0]); ASSERT(8, h.buf[0]); } int main(void) { S8 a = {1, 0}; S16 b = {0, 2}; S32 c = {{3}}; S64 d = {0, {4}}; SNested e = {'x', {{5}}, 0, {0, 6}}; SVec f = {{6.0f}}; S32 g = {{7}}; S64 h = {0, {8}}; pass_many(a, b, c, d, e, f, g, h); printf("OK\n"); return 0; } chibicc-1.0.24/test/php1.c000066400000000000000000000013051517770275000151670ustar00rootroot00000000000000#include #include typedef union _mm_align_test { void *ptr; double dbl; long lng; } mm_align_test; #if (defined (__GNUC__) && __GNUC__ >= 2) #define ZEND_MM_ALIGNMENT (__alignof__ (mm_align_test)) #else #define ZEND_MM_ALIGNMENT (sizeof(mm_align_test)) #endif int main(void) { size_t i = ZEND_MM_ALIGNMENT; int zeros = 0; FILE *fp; while (i & ~0x1) { zeros++; i = i >> 1; } fp = fopen("conftest.zend", "w"); fprintf(fp, "(size_t)%zu (size_t)%d %d\n", ZEND_MM_ALIGNMENT, zeros, ZEND_MM_ALIGNMENT < 4); fclose(fp); printf("=====%ld\n", __alignof__ (mm_align_test)); printf("=====%ld\n", sizeof(mm_align_test)); return 0; }chibicc-1.0.24/test/php2.c000066400000000000000000000032411517770275000151710ustar00rootroot00000000000000#include "test.h" #include typedef long zend_long; typedef double zend_double; /* Mock of PHP zval struct */ typedef struct { zend_long lval; zend_double dval; } zval; /* Mock access macros */ #define Z_LVAL_P(z) ((z)->lval) #define Z_DVAL_P(z) ((z)->dval) int main(void) { zval _op1 = {123456789, 0.0}; zval _op2 = {987654321, 0.0}; zval _result = {0, 0.0}; int overflow = 0; /* Pointers to simulate real PHP usage */ zval *op1 = &_op1; zval *op2 = &_op2; zval *result = &_result; /* x86-64 version of ZEND_SIGNED_MULTIPLY_LONG */ #define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ zend_long __tmpvar; \ __asm__ ("imul %3,%0\n" \ "adc $0,%1" \ : "=r"(__tmpvar), "=r"(usedval) \ : "0"(a), "r"(b), "1"(0)); \ if (usedval) (dval) = (double) (a) * (double) (b); \ else (lval) = __tmpvar; \ } while (0) /* Perform the multiplication as PHP does */ ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow); /* Print result */ if (overflow) printf("Overflow detected, double result: %f\n", Z_DVAL_P(result)); else printf("Result fits in long: %ld\n", Z_LVAL_P(result)); ASSERT(0, overflow); ASSERT(121932631112635269, Z_LVAL_P(result)); return 0; } chibicc-1.0.24/test/php_asm.c000066400000000000000000000002771517770275000157550ustar00rootroot00000000000000// test_asm_guard.c #include "test.h" #define XXH_COMPILER_GUARD(var) __asm__("" : "+r" (var)) int main(void) { int x = 42; XXH_COMPILER_GUARD(x); ASSERT(42, x); return 0; } chibicc-1.0.24/test/pointer.c000077500000000000000000000034751517770275000160140ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(3, ({ int x=3; *&x; })); ASSERT(3, ({ int x=3; int *y=&x; int **z=&y; **z; })); ASSERT(5, ({ int x=3; int y=5; *(&x+1); })); ASSERT(3, ({ int x=3; int y=5; *(&y-1); })); ASSERT(5, ({ int x=3; int y=5; *(&x-(-1)); })); ASSERT(5, ({ int x=3; int *y=&x; *y=5; x; })); ASSERT(7, ({ int x=3; int y=5; *(&x+1)=7; y; })); ASSERT(7, ({ int x=3; int y=5; *(&y-2+1)=7; x; })); ASSERT(5, ({ int x=3; (&x+2)-&x+3; })); ASSERT(8, ({ int x, y; x=3; y=5; x+y; })); ASSERT(8, ({ int x=3, y=5; x+y; })); ASSERT(3, ({ int x[2]; int *y=&x; *y=3; *x; })); ASSERT(3, ({ int x[3]; *x=3; *(x+1)=4; *(x+2)=5; *x; })); ASSERT(4, ({ int x[3]; *x=3; *(x+1)=4; *(x+2)=5; *(x+1); })); ASSERT(5, ({ int x[3]; *x=3; *(x+1)=4; *(x+2)=5; *(x+2); })); ASSERT(0, ({ int x[2][3]; int *y=x; *y=0; **x; })); ASSERT(1, ({ int x[2][3]; int *y=x; *(y+1)=1; *(*x+1); })); ASSERT(2, ({ int x[2][3]; int *y=x; *(y+2)=2; *(*x+2); })); ASSERT(3, ({ int x[2][3]; int *y=x; *(y+3)=3; **(x+1); })); ASSERT(4, ({ int x[2][3]; int *y=x; *(y+4)=4; *(*(x+1)+1); })); ASSERT(5, ({ int x[2][3]; int *y=x; *(y+5)=5; *(*(x+1)+2); })); ASSERT(3, ({ int x[3]; *x=3; x[1]=4; x[2]=5; *x; })); ASSERT(4, ({ int x[3]; *x=3; x[1]=4; x[2]=5; *(x+1); })); ASSERT(5, ({ int x[3]; *x=3; x[1]=4; x[2]=5; *(x+2); })); ASSERT(5, ({ int x[3]; *x=3; x[1]=4; x[2]=5; *(x+2); })); ASSERT(5, ({ int x[3]; *x=3; x[1]=4; 2[x]=5; *(x+2); })); ASSERT(0, ({ int x[2][3]; int *y=x; y[0]=0; x[0][0]; })); ASSERT(1, ({ int x[2][3]; int *y=x; y[1]=1; x[0][1]; })); ASSERT(2, ({ int x[2][3]; int *y=x; y[2]=2; x[0][2]; })); ASSERT(3, ({ int x[2][3]; int *y=x; y[3]=3; x[1][0]; })); ASSERT(4, ({ int x[2][3]; int *y=x; y[4]=4; x[1][1]; })); ASSERT(5, ({ int x[2][3]; int *y=x; y[5]=5; x[1][2]; })); printf("OK\n"); return 0; } chibicc-1.0.24/test/postgres_asm.c000066400000000000000000000431161517770275000170330ustar00rootroot00000000000000 #include #include #include "test.h" typedef uint64_t uint64; typedef uint32_t uint32; typedef uint16_t uint16; typedef int64_t int64; typedef int32_t int32; typedef int16_t int16; typedef uint8_t uint8; typedef int8_t int8; typedef uint8 bits8; /* >= 8 bits */ typedef uint16 bits16; /* >= 16 bits */ typedef uint32 bits32; /* >= 32 bits */ const uint8 pg_rightmost_one_pos[256] = { 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; const uint8 pg_leftmost_one_pos[256] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; const uint8 pg_number_of_ones[256] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 }; #define INT64CONST(x) (x##L) #define UINT64CONST(x) (x##UL) #define PG_INT8_MIN (-0x7F-1) #define PG_INT8_MAX (0x7F) #define PG_UINT8_MAX (0xFF) #define PG_INT16_MIN (-0x7FFF-1) #define PG_INT16_MAX (0x7FFF) #define PG_UINT16_MAX (0xFFFF) #define PG_INT32_MIN (-0x7FFFFFFF-1) #define PG_INT32_MAX (0x7FFFFFFF) #define PG_UINT32_MAX (0xFFFFFFFFU) #define PG_INT64_MIN (-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1) #define PG_INT64_MAX INT64CONST(0x7FFFFFFFFFFFFFFF) #define PG_UINT64_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF) #define TYPEALIGN(ALIGNVAL,LEN) \ (((uintptr_t) (LEN) + ((ALIGNVAL) - 1)) & ~((uintptr_t) ((ALIGNVAL) - 1))) #define SHORTALIGN(LEN) TYPEALIGN(ALIGNOF_SHORT, (LEN)) #define INTALIGN(LEN) TYPEALIGN(ALIGNOF_INT, (LEN)) #define LONGALIGN(LEN) TYPEALIGN(ALIGNOF_LONG, (LEN)) #define DOUBLEALIGN(LEN) TYPEALIGN(ALIGNOF_DOUBLE, (LEN)) #define MAXALIGN(LEN) TYPEALIGN(MAXIMUM_ALIGNOF, (LEN)) /* MAXALIGN covers only built-in types, not buffers */ #define BUFFERALIGN(LEN) TYPEALIGN(ALIGNOF_BUFFER, (LEN)) #define CACHELINEALIGN(LEN) TYPEALIGN(PG_CACHE_LINE_SIZE, (LEN)) #define TYPEALIGN_DOWN(ALIGNVAL,LEN) \ (((uintptr_t) (LEN)) & ~((uintptr_t) ((ALIGNVAL) - 1))) #define SHORTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_SHORT, (LEN)) #define INTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_INT, (LEN)) #define LONGALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_LONG, (LEN)) #define DOUBLEALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_DOUBLE, (LEN)) #define MAXALIGN_DOWN(LEN) TYPEALIGN_DOWN(MAXIMUM_ALIGNOF, (LEN)) #define BUFFERALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_BUFFER, (LEN)) /*------------------------------------------------------------------------- * * pg_bitutils.h * Miscellaneous functions for bit-wise operations. * * * Copyright (c) 2019-2024, PostgreSQL Global Development Group * * src/include/port/pg_bitutils.h * *------------------------------------------------------------------------- */ #ifndef PG_BITUTILS_H #define PG_BITUTILS_H #ifdef _MSC_VER #include #define HAVE_BITSCAN_FORWARD #define HAVE_BITSCAN_REVERSE #else #if defined(HAVE__BUILTIN_CTZ) #define HAVE_BITSCAN_FORWARD #endif #if defined(HAVE__BUILTIN_CLZ) #define HAVE_BITSCAN_REVERSE #endif #endif /* _MSC_VER */ /* * pg_leftmost_one_pos32 * Returns the position of the most significant set bit in "word", * measured from the least significant bit. word must not be 0. */ static inline int pg_leftmost_one_pos32(uint32 word) { #ifdef HAVE__BUILTIN_CLZ //Assert(word != 0); return 31 - __builtin_clz(word); #elif defined(_MSC_VER) unsigned long result; bool non_zero; //Assert(word != 0); non_zero = _BitScanReverse(&result, word); return (int) result; #else int shift = 32 - 8; //Assert(word != 0); while ((word >> shift) == 0) shift -= 8; return shift + pg_leftmost_one_pos[(word >> shift) & 255]; #endif /* HAVE__BUILTIN_CLZ */ } /* * pg_leftmost_one_pos64 * As above, but for a 64-bit word. */ static inline int pg_leftmost_one_pos64(uint64 word) { #ifdef HAVE__BUILTIN_CLZ //Assert(word != 0); #if defined(HAVE_LONG_INT_64) return 63 - __builtin_clzl(word); #elif defined(HAVE_LONG_LONG_INT_64) return 63 - __builtin_clzll(word); #else #error must have a working 64-bit integer datatype #endif /* HAVE_LONG_INT_64 */ #elif defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_ARM64)) unsigned long result; bool non_zero; //Assert(word != 0); non_zero = _BitScanReverse64(&result, word); return (int) result; #else int shift = 64 - 8; //Assert(word != 0); while ((word >> shift) == 0) shift -= 8; return shift + pg_leftmost_one_pos[(word >> shift) & 255]; #endif /* HAVE__BUILTIN_CLZ */ } /* * pg_rightmost_one_pos32 * Returns the position of the least significant set bit in "word", * measured from the least significant bit. word must not be 0. */ static inline int pg_rightmost_one_pos32(uint32 word) { #ifdef HAVE__BUILTIN_CTZ //Assert(word != 0); return __builtin_ctz(word); #elif defined(_MSC_VER) unsigned long result; bool non_zero; //Assert(word != 0); non_zero = _BitScanForward(&result, word); return (int) result; #else int result = 0; //Assert(word != 0); while ((word & 255) == 0) { word >>= 8; result += 8; } result += pg_rightmost_one_pos[word & 255]; return result; #endif /* HAVE__BUILTIN_CTZ */ } /* * pg_rightmost_one_pos64 * As above, but for a 64-bit word. */ static inline int pg_rightmost_one_pos64(uint64 word) { #ifdef HAVE__BUILTIN_CTZ //Assert(word != 0); #if defined(HAVE_LONG_INT_64) return __builtin_ctzl(word); #elif defined(HAVE_LONG_LONG_INT_64) return __builtin_ctzll(word); #else #error must have a working 64-bit integer datatype #endif /* HAVE_LONG_INT_64 */ #elif defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_ARM64)) unsigned long result; bool non_zero; //Assert(word != 0); non_zero = _BitScanForward64(&result, word); return (int) result; #else int result = 0; //Assert(word != 0); while ((word & 255) == 0) { word >>= 8; result += 8; } result += pg_rightmost_one_pos[word & 255]; return result; #endif /* HAVE__BUILTIN_CTZ */ } /* * pg_nextpower2_32 * Returns the next higher power of 2 above 'num', or 'num' if it's * already a power of 2. * * 'num' mustn't be 0 or be above PG_UINT32_MAX / 2 + 1. */ static inline uint32 pg_nextpower2_32(uint32 num) { //Assert(num > 0 && num <= PG_UINT32_MAX / 2 + 1); /* * A power 2 number has only 1 bit set. Subtracting 1 from such a number * will turn on all previous bits resulting in no common bits being set * between num and num-1. */ if ((num & (num - 1)) == 0) return num; /* already power 2 */ return ((uint32) 1) << (pg_leftmost_one_pos32(num) + 1); } /* * pg_nextpower2_64 * Returns the next higher power of 2 above 'num', or 'num' if it's * already a power of 2. * * 'num' mustn't be 0 or be above PG_UINT64_MAX / 2 + 1. */ static inline uint64 pg_nextpower2_64(uint64 num) { //Assert(num > 0 && num <= PG_UINT64_MAX / 2 + 1); /* * A power 2 number has only 1 bit set. Subtracting 1 from such a number * will turn on all previous bits resulting in no common bits being set * between num and num-1. */ if ((num & (num - 1)) == 0) return num; /* already power 2 */ return ((uint64) 1) << (pg_leftmost_one_pos64(num) + 1); } /* * pg_prevpower2_32 * Returns the next lower power of 2 below 'num', or 'num' if it's * already a power of 2. * * 'num' mustn't be 0. */ static inline uint32 pg_prevpower2_32(uint32 num) { return ((uint32) 1) << pg_leftmost_one_pos32(num); } /* * pg_prevpower2_64 * Returns the next lower power of 2 below 'num', or 'num' if it's * already a power of 2. * * 'num' mustn't be 0. */ static inline uint64 pg_prevpower2_64(uint64 num) { return ((uint64) 1) << pg_leftmost_one_pos64(num); } /* * pg_ceil_log2_32 * Returns equivalent of ceil(log2(num)) */ static inline uint32 pg_ceil_log2_32(uint32 num) { if (num < 2) return 0; else return pg_leftmost_one_pos32(num - 1) + 1; } /* * pg_ceil_log2_64 * Returns equivalent of ceil(log2(num)) */ static inline uint64 pg_ceil_log2_64(uint64 num) { if (num < 2) return 0; else return pg_leftmost_one_pos64(num - 1) + 1; } /* * With MSVC on x86_64 builds, try using native popcnt instructions via the * __popcnt and __popcnt64 intrinsics. These don't work the same as GCC's * __builtin_popcount* intrinsic functions as they always emit popcnt * instructions. */ #if defined(_MSC_VER) && defined(_M_AMD64) #define HAVE_X86_64_POPCNTQ #endif /* * On x86_64, we can use the hardware popcount instruction, but only if * we can verify that the CPU supports it via the cpuid instruction. * * Otherwise, we fall back to a hand-rolled implementation. */ #ifdef HAVE_X86_64_POPCNTQ #if defined(HAVE__GET_CPUID) || defined(HAVE__CPUID) #define TRY_POPCNT_FAST 1 #endif #endif #ifdef TRY_POPCNT_FAST /* Attempt to use the POPCNT instruction, but perform a runtime check first */ extern PGDLLIMPORT int (*pg_popcount32) (uint32 word); extern PGDLLIMPORT int (*pg_popcount64) (uint64 word); extern PGDLLIMPORT uint64 (*pg_popcount_optimized) (const char *buf, int bytes); extern PGDLLIMPORT uint64 (*pg_popcount_masked_optimized) (const char *buf, int bytes, bits8 mask); /* * We can also try to use the AVX-512 popcount instruction on some systems. * The implementation of that is located in its own file because it may * require special compiler flags that we don't want to apply to any other * files. */ #ifdef USE_AVX512_POPCNT_WITH_RUNTIME_CHECK extern bool pg_popcount_avx512_available(void); extern uint64 pg_popcount_avx512(const char *buf, int bytes); extern uint64 pg_popcount_masked_avx512(const char *buf, int bytes, bits8 mask); #endif #else /* Use a portable implementation -- no need for a function pointer. */ static inline int pg_popcount32_slow(uint32 word) { #ifdef HAVE__BUILTIN_POPCOUNT return __builtin_popcount(word); #else /* !HAVE__BUILTIN_POPCOUNT */ int result = 0; while (word != 0) { result += pg_number_of_ones[word & 255]; word >>= 8; } return result; #endif /* HAVE__BUILTIN_POPCOUNT */ } /* * pg_popcount64_slow * Return the number of 1 bits set in word */ static inline int pg_popcount64_slow(uint64 word) { #ifdef HAVE__BUILTIN_POPCOUNT #if defined(HAVE_LONG_INT_64) return __builtin_popcountl(word); #elif defined(HAVE_LONG_LONG_INT_64) return __builtin_popcountll(word); #else #error must have a working 64-bit integer datatype #endif #else /* !HAVE__BUILTIN_POPCOUNT */ int result = 0; while (word != 0) { result += pg_number_of_ones[word & 255]; word >>= 8; } return result; #endif /* HAVE__BUILTIN_POPCOUNT */ } /* * pg_popcount_slow * Returns the number of 1-bits in buf */ static uint64 pg_popcount_slow(const char *buf, int bytes) { uint64 popcnt = 0; #if SIZEOF_VOID_P >= 8 /* Process in 64-bit chunks if the buffer is aligned. */ if (buf == (const char *) TYPEALIGN(8, buf)) { const uint64 *words = (const uint64 *) buf; while (bytes >= 8) { popcnt += pg_popcount64_slow(*words++); bytes -= 8; } buf = (const char *) words; } #else /* Process in 32-bit chunks if the buffer is aligned. */ if (buf == (const char *) TYPEALIGN(4, buf)) { const uint32 *words = (const uint32 *) buf; while (bytes >= 4) { popcnt += pg_popcount32_slow(*words++); bytes -= 4; } buf = (const char *) words; } #endif /* Process any remaining bytes */ while (bytes--) popcnt += pg_number_of_ones[(unsigned char) *buf++]; return popcnt; } /* * pg_popcount_masked_slow * Returns the number of 1-bits in buf after applying the mask to each byte */ static uint64 pg_popcount_masked_slow(const char *buf, int bytes, bits8 mask) { uint64 popcnt = 0; #if SIZEOF_VOID_P >= 8 /* Process in 64-bit chunks if the buffer is aligned */ uint64 maskv = ~UINT64CONST(0) / 0xFF * mask; if (buf == (const char *) TYPEALIGN(8, buf)) { const uint64 *words = (const uint64 *) buf; while (bytes >= 8) { popcnt += pg_popcount64_slow(*words++ & maskv); bytes -= 8; } buf = (const char *) words; } #else /* Process in 32-bit chunks if the buffer is aligned. */ uint32 maskv = ~((uint32) 0) / 0xFF * mask; if (buf == (const char *) TYPEALIGN(4, buf)) { const uint32 *words = (const uint32 *) buf; while (bytes >= 4) { popcnt += pg_popcount32_slow(*words++ & maskv); bytes -= 4; } buf = (const char *) words; } #endif /* Process any remaining bytes */ while (bytes--) popcnt += pg_number_of_ones[(unsigned char) *buf++ & mask]; return popcnt; } int pg_popcount32(uint32 word) { return pg_popcount32_slow(word); } int pg_popcount64(uint64 word) { return pg_popcount64_slow(word); } /* * pg_popcount_optimized * Returns the number of 1-bits in buf */ uint64 pg_popcount_optimized(const char *buf, int bytes) { return pg_popcount_slow(buf, bytes); } /* * pg_popcount_masked_optimized * Returns the number of 1-bits in buf after applying the mask to each byte */ uint64 pg_popcount_masked_optimized(const char *buf, int bytes, bits8 mask) { return pg_popcount_masked_slow(buf, bytes, mask); } extern uint64 pg_popcount_optimized(const char *buf, int bytes); extern uint64 pg_popcount_masked_optimized(const char *buf, int bytes, bits8 mask); #endif /* TRY_POPCNT_FAST */ /* * Returns the number of 1-bits in buf. * * If there aren't many bytes to process, the function call overhead of the * optimized versions isn't worth taking, so we inline a loop that consults * pg_number_of_ones in that case. If there are many bytes to process, we * accept the function call overhead because the optimized versions are likely * to be faster. */ static inline uint64 pg_popcount(const char *buf, int bytes) { /* * We set the threshold to the point at which we'll first use special * instructions in the optimized version. */ #if SIZEOF_VOID_P >= 8 int threshold = 8; #else int threshold = 4; #endif if (bytes < threshold) { uint64 popcnt = 0; while (bytes--) popcnt += pg_number_of_ones[(unsigned char) *buf++]; return popcnt; } return pg_popcount_optimized(buf, bytes); } /* * Returns the number of 1-bits in buf after applying the mask to each byte. * * Similar to pg_popcount(), we only take on the function pointer overhead when * it's likely to be faster. */ static inline uint64 pg_popcount_masked(const char *buf, int bytes, bits8 mask) { /* * We set the threshold to the point at which we'll first use special * instructions in the optimized version. */ #if SIZEOF_VOID_P >= 8 int threshold = 8; #else int threshold = 4; #endif if (bytes < threshold) { uint64 popcnt = 0; while (bytes--) popcnt += pg_number_of_ones[(unsigned char) *buf++ & mask]; return popcnt; } return pg_popcount_masked_optimized(buf, bytes, mask); } /* * Rotate the bits of "word" to the right/left by n bits. */ static inline uint32 pg_rotate_right32(uint32 word, int n) { return (word >> n) | (word << (32 - n)); } static inline uint32 pg_rotate_left32(uint32 word, int n) { return (word << n) | (word >> (32 - n)); } /* size_t variants of the above, as required */ #if SIZEOF_SIZE_T == 4 #define pg_leftmost_one_pos_size_t pg_leftmost_one_pos32 #define pg_nextpower2_size_t pg_nextpower2_32 #define pg_prevpower2_size_t pg_prevpower2_32 #else #define pg_leftmost_one_pos_size_t pg_leftmost_one_pos64 #define pg_nextpower2_size_t pg_nextpower2_64 #define pg_prevpower2_size_t pg_prevpower2_64 #endif #endif /* PG_BITUTILS_H */ void test_pg_popcount32() { uint32_t test_value = 0b11010110; // binary: 11010110, expected popcount: 5 int expected = 5; int result = pg_popcount32(test_value); if (result == expected) { printf("Test passed: pg_popcount32(%u) = %d\n", test_value, result); Assert(5, result); } else { printf("Test failed: pg_popcount32(%u) = %d, expected %d\n", test_value, result, expected); } } int main() { test_pg_popcount32(); return 0; } chibicc-1.0.24/test/postgres_auth.c000066400000000000000000000054701517770275000172150ustar00rootroot00000000000000#include #include #include #include typedef uint32_t uint32; typedef struct { volatile uint32 value; } pg_atomic_uint32; #define AssertPointerAlignment(ptr, align) assert(((uintptr_t)(ptr) % (align)) == 0) #define LW_EXCLUSIVE 1 #define LW_SHARED 2 #define LW_LOCK_MASK 0xF #define LW_VAL_EXCLUSIVE 0x10 #define LW_VAL_SHARED 0x20 typedef struct { pg_atomic_uint32 state; #ifdef LOCK_DEBUG void* owner; #endif } LWLock; /* Atomic compare-and-exchange function */ static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 *expected, uint32 newval) { unsigned char ret; // Use unsigned char for setz result __asm__ __volatile__( "lock\n\t" "cmpxchgl %3, %2\n\t" "setz %1" : "=a" (*expected), "=q" (ret), "+m" (ptr->value) : "r" (newval), "a" (*expected) : "memory", "cc"); assert(1 == ret); return (bool) ret; } static inline bool pg_atomic_compare_exchange_u32(volatile pg_atomic_uint32 *ptr, uint32 *expected, uint32 newval) { AssertPointerAlignment(ptr, 4); AssertPointerAlignment(expected, 4); return pg_atomic_compare_exchange_u32_impl(ptr, expected, newval); } /* Attempt to lock function */ static bool LWLockAttemptLock(LWLock *lock, uint32 mode) { uint32 old_state; //Assert(mode == LW_EXCLUSIVE || mode == LW_SHARED); old_state = lock->state.value; while (true) { uint32 desired_state; bool lock_free; desired_state = old_state; if (mode == LW_EXCLUSIVE) { lock_free = (old_state & LW_LOCK_MASK) == 0; if (lock_free) desired_state += LW_VAL_EXCLUSIVE; } else { lock_free = (old_state & LW_VAL_EXCLUSIVE) == 0; if (lock_free) desired_state += LW_VAL_SHARED; } if (pg_atomic_compare_exchange_u32(&lock->state, &old_state, desired_state)) { if (lock_free) { #ifdef LOCK_DEBUG if (mode == LW_EXCLUSIVE) lock->owner = (void*)1; // Simulating a lock owner for debug #endif return false; } else return true; } } } int main() { LWLock lock = {{0}}; // Initialize the lock // Attempt to acquire an exclusive lock if (!LWLockAttemptLock(&lock, LW_EXCLUSIVE)) { printf("Acquired exclusive lock.\n"); } else { printf("Failed to acquire exclusive lock.\n"); } // Attempt to acquire a shared lock if (!LWLockAttemptLock(&lock, LW_SHARED)) { printf("Acquired shared lock.\n"); } else { printf("Failed to acquire shared lock.\n"); } return 0; } chibicc-1.0.24/test/postgres_callback.c000066400000000000000000000021561517770275000200060ustar00rootroot00000000000000#include "test.h" #include #include typedef uint64_t Datum; typedef void (*pg_on_exit_callback)(int code, Datum arg); struct ONEXIT { pg_on_exit_callback function; Datum arg; }; // Simulate Int32GetDatum macro from PostgreSQL static inline Datum Int32GetDatum(int32_t i) { return (Datum)(uint32_t)i; // cast to 32-bit first, then 64-bit Datum } // Dummy callback function void dummy_callback(int code, Datum arg) { printf("dummy_callback called with code=%d, arg=0x%lx\n", code, arg); } int main() { struct ONEXIT onexit; onexit.function = dummy_callback; onexit.arg = Int32GetDatum(123456789); printf("sizeof(ONEXIT) = %zu\n", sizeof(struct ONEXIT)); printf("offset function = %zu\n", offsetof(struct ONEXIT, function)); printf("offset arg = %zu\n", offsetof(struct ONEXIT, arg)); ASSERT(16, sizeof(struct ONEXIT)); ASSERT(0, offsetof(struct ONEXIT, function)); ASSERT(8, offsetof(struct ONEXIT, arg)); // Call the callback to see the stored value onexit.function(0, onexit.arg); return 0; } chibicc-1.0.24/test/postgres_compare.c000066400000000000000000000016651517770275000177040ustar00rootroot00000000000000 #include #include #include "test.h" typedef uint32_t uint32; typedef struct { volatile uint32_t value; } pg_atomic_uint32; static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 *expected, uint32 newval) { char ret; /* * Perform cmpxchg and use the zero flag which it implicitly sets when * equal to measure the success. */ __asm__ __volatile__( " lock \n" " cmpxchgl %4,%5 \n" " setz %2 \n" : "=a" (*expected), "=m"(ptr->value), "=q" (ret) : "a" (*expected), "r" (newval), "m"(ptr->value) : "memory", "cc"); ASSERT(1, ret); return (bool) ret; } int main() { pg_atomic_uint32 atomic_var = {0}; uint32_t expected = 0; uint32_t newval = 1; if (pg_atomic_compare_exchange_u32_impl(&atomic_var, &expected, newval)) { printf("Exchange succeeded\n"); } else { printf("Exchange failed\n"); } return 0; } chibicc-1.0.24/test/postgres_constptr.c000066400000000000000000000010541517770275000201220ustar00rootroot00000000000000#include "test.h" // Regression test: string literal pointers in const aggregates must remain // proper relocations, not raw bytes copied into pointer slots. static const char *const names[] = {"serializable", "read committed"}; struct NameRec { const char *name; }; static const struct NameRec recs[] = {{"foo"}, {"bar"}}; int main(void) { ASSERT(0, strcmp(names[0], "serializable")); ASSERT(0, strcmp(names[1], "read committed")); ASSERT(0, strcmp(recs[0].name, "foo")); ASSERT(0, strcmp(recs[1].name, "bar")); printf("OK\n"); return 0; } chibicc-1.0.24/test/postgres_controlfile.c000066400000000000000000000025211517770275000205660ustar00rootroot00000000000000#include "test.h" #include #include typedef struct { union { uint32_t x; uint64_t y; } u; uint32_t version; uint8_t flags[4]; } ControlFile; int main(void) { ControlFile cf; // Zero the whole struct (mimics memset in write_gvar_data) memset(&cf, 0, sizeof(cf)); // Initialize union member 'x' cf.u.x = 0x12345678; // Initialize version cf.version = 42; // Initialize flags array cf.flags[0] = 1; cf.flags[1] = 2; cf.flags[2] = 3; cf.flags[3] = 4; // "Write" the struct to a buffer uint8_t buf[sizeof(ControlFile)]; memcpy(buf, &cf, sizeof(cf)); // Print buffer contents in hex printf("Buffer bytes:\n"); for (size_t i = 0; i < sizeof(buf); i++) { printf("%02x ", buf[i]); if ((i + 1) % 8 == 0) printf("\n"); } ASSERT(0x78, buf[0]); ASSERT(0x56, buf[1]); ASSERT(0x34, buf[2]); ASSERT(0x12, buf[3]); ASSERT(0x00, buf[4]); ASSERT(0x00, buf[5]); ASSERT(0x00, buf[6]); ASSERT(0x00, buf[7]); ASSERT(0x2a, buf[8]); ASSERT(0x00, buf[9]); ASSERT(0x00, buf[10]); ASSERT(0x00, buf[11]); ASSERT(0x01, buf[12]); ASSERT(0x02, buf[13]); ASSERT(0x03, buf[14]); ASSERT(0x04, buf[15]); return 0; } chibicc-1.0.24/test/postgres_crc32_sb8.c000066400000000000000000000712121517770275000177410ustar00rootroot00000000000000#include #include "test.h" #include typedef uint32_t uint32; typedef uint8_t uint8; typedef uint32_t pg_crc32c; #define MOCK_AUTH_NONCE_LEN 32 /* Simplified ControlFileData structure */ typedef struct { uint32_t pg_control_version; uint32_t catalog_version_no; uint32_t maxAlign; uint32_t floatFormat; uint32_t blcksz; uint32_t relseg_size; uint32_t xlog_blcksz; uint32_t xlog_seg_size; uint32_t nameDataLen; uint32_t indexMaxKeys; uint32_t toast_max_chunk_size; uint32_t loblksize; uint32_t float8ByVal; uint8_t default_char_signedness; char mock_authentication_nonce[MOCK_AUTH_NONCE_LEN]; pg_crc32c crc; } ControlFileData; // Simulated CRC table (values don't matter for reproducing the bug) static const pg_crc32c pg_crc32c_table[8][256] __attribute__((aligned(16))) = { { 0x00000000, 0x03836BF2, 0xF7703BE1, 0xF4F35013, 0x1F979AC7, 0x1C14F135, 0xE8E7A126, 0xEB64CAD4, 0xCF58D98A, 0xCCDBB278, 0x3828E26B, 0x3BAB8999, 0xD0CF434D, 0xD34C28BF, 0x27BF78AC, 0x243C135E, 0x6FC75E10, 0x6C4435E2, 0x98B765F1, 0x9B340E03, 0x7050C4D7, 0x73D3AF25, 0x8720FF36, 0x84A394C4, 0xA09F879A, 0xA31CEC68, 0x57EFBC7B, 0x546CD789, 0xBF081D5D, 0xBC8B76AF, 0x487826BC, 0x4BFB4D4E, 0xDE8EBD20, 0xDD0DD6D2, 0x29FE86C1, 0x2A7DED33, 0xC11927E7, 0xC29A4C15, 0x36691C06, 0x35EA77F4, 0x11D664AA, 0x12550F58, 0xE6A65F4B, 0xE52534B9, 0x0E41FE6D, 0x0DC2959F, 0xF931C58C, 0xFAB2AE7E, 0xB149E330, 0xB2CA88C2, 0x4639D8D1, 0x45BAB323, 0xAEDE79F7, 0xAD5D1205, 0x59AE4216, 0x5A2D29E4, 0x7E113ABA, 0x7D925148, 0x8961015B, 0x8AE26AA9, 0x6186A07D, 0x6205CB8F, 0x96F69B9C, 0x9575F06E, 0xBC1D7B41, 0xBF9E10B3, 0x4B6D40A0, 0x48EE2B52, 0xA38AE186, 0xA0098A74, 0x54FADA67, 0x5779B195, 0x7345A2CB, 0x70C6C939, 0x8435992A, 0x87B6F2D8, 0x6CD2380C, 0x6F5153FE, 0x9BA203ED, 0x9821681F, 0xD3DA2551, 0xD0594EA3, 0x24AA1EB0, 0x27297542, 0xCC4DBF96, 0xCFCED464, 0x3B3D8477, 0x38BEEF85, 0x1C82FCDB, 0x1F019729, 0xEBF2C73A, 0xE871ACC8, 0x0315661C, 0x00960DEE, 0xF4655DFD, 0xF7E6360F, 0x6293C661, 0x6110AD93, 0x95E3FD80, 0x96609672, 0x7D045CA6, 0x7E873754, 0x8A746747, 0x89F70CB5, 0xADCB1FEB, 0xAE487419, 0x5ABB240A, 0x59384FF8, 0xB25C852C, 0xB1DFEEDE, 0x452CBECD, 0x46AFD53F, 0x0D549871, 0x0ED7F383, 0xFA24A390, 0xF9A7C862, 0x12C302B6, 0x11406944, 0xE5B33957, 0xE63052A5, 0xC20C41FB, 0xC18F2A09, 0x357C7A1A, 0x36FF11E8, 0xDD9BDB3C, 0xDE18B0CE, 0x2AEBE0DD, 0x29688B2F, 0x783BF682, 0x7BB89D70, 0x8F4BCD63, 0x8CC8A691, 0x67AC6C45, 0x642F07B7, 0x90DC57A4, 0x935F3C56, 0xB7632F08, 0xB4E044FA, 0x401314E9, 0x43907F1B, 0xA8F4B5CF, 0xAB77DE3D, 0x5F848E2E, 0x5C07E5DC, 0x17FCA892, 0x147FC360, 0xE08C9373, 0xE30FF881, 0x086B3255, 0x0BE859A7, 0xFF1B09B4, 0xFC986246, 0xD8A47118, 0xDB271AEA, 0x2FD44AF9, 0x2C57210B, 0xC733EBDF, 0xC4B0802D, 0x3043D03E, 0x33C0BBCC, 0xA6B54BA2, 0xA5362050, 0x51C57043, 0x52461BB1, 0xB922D165, 0xBAA1BA97, 0x4E52EA84, 0x4DD18176, 0x69ED9228, 0x6A6EF9DA, 0x9E9DA9C9, 0x9D1EC23B, 0x767A08EF, 0x75F9631D, 0x810A330E, 0x828958FC, 0xC97215B2, 0xCAF17E40, 0x3E022E53, 0x3D8145A1, 0xD6E58F75, 0xD566E487, 0x2195B494, 0x2216DF66, 0x062ACC38, 0x05A9A7CA, 0xF15AF7D9, 0xF2D99C2B, 0x19BD56FF, 0x1A3E3D0D, 0xEECD6D1E, 0xED4E06EC, 0xC4268DC3, 0xC7A5E631, 0x3356B622, 0x30D5DDD0, 0xDBB11704, 0xD8327CF6, 0x2CC12CE5, 0x2F424717, 0x0B7E5449, 0x08FD3FBB, 0xFC0E6FA8, 0xFF8D045A, 0x14E9CE8E, 0x176AA57C, 0xE399F56F, 0xE01A9E9D, 0xABE1D3D3, 0xA862B821, 0x5C91E832, 0x5F1283C0, 0xB4764914, 0xB7F522E6, 0x430672F5, 0x40851907, 0x64B90A59, 0x673A61AB, 0x93C931B8, 0x904A5A4A, 0x7B2E909E, 0x78ADFB6C, 0x8C5EAB7F, 0x8FDDC08D, 0x1AA830E3, 0x192B5B11, 0xEDD80B02, 0xEE5B60F0, 0x053FAA24, 0x06BCC1D6, 0xF24F91C5, 0xF1CCFA37, 0xD5F0E969, 0xD673829B, 0x2280D288, 0x2103B97A, 0xCA6773AE, 0xC9E4185C, 0x3D17484F, 0x3E9423BD, 0x756F6EF3, 0x76EC0501, 0x821F5512, 0x819C3EE0, 0x6AF8F434, 0x697B9FC6, 0x9D88CFD5, 0x9E0BA427, 0xBA37B779, 0xB9B4DC8B, 0x4D478C98, 0x4EC4E76A, 0xA5A02DBE, 0xA623464C, 0x52D0165F, 0x51537DAD, }, { 0x00000000, 0x7798A213, 0xEE304527, 0x99A8E734, 0xDC618A4E, 0xABF9285D, 0x3251CF69, 0x45C96D7A, 0xB8C3149D, 0xCF5BB68E, 0x56F351BA, 0x216BF3A9, 0x64A29ED3, 0x133A3CC0, 0x8A92DBF4, 0xFD0A79E7, 0x81F1C53F, 0xF669672C, 0x6FC18018, 0x1859220B, 0x5D904F71, 0x2A08ED62, 0xB3A00A56, 0xC438A845, 0x3932D1A2, 0x4EAA73B1, 0xD7029485, 0xA09A3696, 0xE5535BEC, 0x92CBF9FF, 0x0B631ECB, 0x7CFBBCD8, 0x02E38B7F, 0x757B296C, 0xECD3CE58, 0x9B4B6C4B, 0xDE820131, 0xA91AA322, 0x30B24416, 0x472AE605, 0xBA209FE2, 0xCDB83DF1, 0x5410DAC5, 0x238878D6, 0x664115AC, 0x11D9B7BF, 0x8871508B, 0xFFE9F298, 0x83124E40, 0xF48AEC53, 0x6D220B67, 0x1ABAA974, 0x5F73C40E, 0x28EB661D, 0xB1438129, 0xC6DB233A, 0x3BD15ADD, 0x4C49F8CE, 0xD5E11FFA, 0xA279BDE9, 0xE7B0D093, 0x90287280, 0x098095B4, 0x7E1837A7, 0x04C617FF, 0x735EB5EC, 0xEAF652D8, 0x9D6EF0CB, 0xD8A79DB1, 0xAF3F3FA2, 0x3697D896, 0x410F7A85, 0xBC050362, 0xCB9DA171, 0x52354645, 0x25ADE456, 0x6064892C, 0x17FC2B3F, 0x8E54CC0B, 0xF9CC6E18, 0x8537D2C0, 0xF2AF70D3, 0x6B0797E7, 0x1C9F35F4, 0x5956588E, 0x2ECEFA9D, 0xB7661DA9, 0xC0FEBFBA, 0x3DF4C65D, 0x4A6C644E, 0xD3C4837A, 0xA45C2169, 0xE1954C13, 0x960DEE00, 0x0FA50934, 0x783DAB27, 0x06259C80, 0x71BD3E93, 0xE815D9A7, 0x9F8D7BB4, 0xDA4416CE, 0xADDCB4DD, 0x347453E9, 0x43ECF1FA, 0xBEE6881D, 0xC97E2A0E, 0x50D6CD3A, 0x274E6F29, 0x62870253, 0x151FA040, 0x8CB74774, 0xFB2FE567, 0x87D459BF, 0xF04CFBAC, 0x69E41C98, 0x1E7CBE8B, 0x5BB5D3F1, 0x2C2D71E2, 0xB58596D6, 0xC21D34C5, 0x3F174D22, 0x488FEF31, 0xD1270805, 0xA6BFAA16, 0xE376C76C, 0x94EE657F, 0x0D46824B, 0x7ADE2058, 0xF9FAC3FB, 0x8E6261E8, 0x17CA86DC, 0x605224CF, 0x259B49B5, 0x5203EBA6, 0xCBAB0C92, 0xBC33AE81, 0x4139D766, 0x36A17575, 0xAF099241, 0xD8913052, 0x9D585D28, 0xEAC0FF3B, 0x7368180F, 0x04F0BA1C, 0x780B06C4, 0x0F93A4D7, 0x963B43E3, 0xE1A3E1F0, 0xA46A8C8A, 0xD3F22E99, 0x4A5AC9AD, 0x3DC26BBE, 0xC0C81259, 0xB750B04A, 0x2EF8577E, 0x5960F56D, 0x1CA99817, 0x6B313A04, 0xF299DD30, 0x85017F23, 0xFB194884, 0x8C81EA97, 0x15290DA3, 0x62B1AFB0, 0x2778C2CA, 0x50E060D9, 0xC94887ED, 0xBED025FE, 0x43DA5C19, 0x3442FE0A, 0xADEA193E, 0xDA72BB2D, 0x9FBBD657, 0xE8237444, 0x718B9370, 0x06133163, 0x7AE88DBB, 0x0D702FA8, 0x94D8C89C, 0xE3406A8F, 0xA68907F5, 0xD111A5E6, 0x48B942D2, 0x3F21E0C1, 0xC22B9926, 0xB5B33B35, 0x2C1BDC01, 0x5B837E12, 0x1E4A1368, 0x69D2B17B, 0xF07A564F, 0x87E2F45C, 0xFD3CD404, 0x8AA47617, 0x130C9123, 0x64943330, 0x215D5E4A, 0x56C5FC59, 0xCF6D1B6D, 0xB8F5B97E, 0x45FFC099, 0x3267628A, 0xABCF85BE, 0xDC5727AD, 0x999E4AD7, 0xEE06E8C4, 0x77AE0FF0, 0x0036ADE3, 0x7CCD113B, 0x0B55B328, 0x92FD541C, 0xE565F60F, 0xA0AC9B75, 0xD7343966, 0x4E9CDE52, 0x39047C41, 0xC40E05A6, 0xB396A7B5, 0x2A3E4081, 0x5DA6E292, 0x186F8FE8, 0x6FF72DFB, 0xF65FCACF, 0x81C768DC, 0xFFDF5F7B, 0x8847FD68, 0x11EF1A5C, 0x6677B84F, 0x23BED535, 0x54267726, 0xCD8E9012, 0xBA163201, 0x471C4BE6, 0x3084E9F5, 0xA92C0EC1, 0xDEB4ACD2, 0x9B7DC1A8, 0xECE563BB, 0x754D848F, 0x02D5269C, 0x7E2E9A44, 0x09B63857, 0x901EDF63, 0xE7867D70, 0xA24F100A, 0xD5D7B219, 0x4C7F552D, 0x3BE7F73E, 0xC6ED8ED9, 0xB1752CCA, 0x28DDCBFE, 0x5F4569ED, 0x1A8C0497, 0x6D14A684, 0xF4BC41B0, 0x8324E3A3, }, { 0x00000000, 0x7E9241A5, 0x0D526F4F, 0x73C02EEA, 0x1AA4DE9E, 0x64369F3B, 0x17F6B1D1, 0x6964F074, 0xC53E5138, 0xBBAC109D, 0xC86C3E77, 0xB6FE7FD2, 0xDF9A8FA6, 0xA108CE03, 0xD2C8E0E9, 0xAC5AA14C, 0x8A7DA270, 0xF4EFE3D5, 0x872FCD3F, 0xF9BD8C9A, 0x90D97CEE, 0xEE4B3D4B, 0x9D8B13A1, 0xE3195204, 0x4F43F348, 0x31D1B2ED, 0x42119C07, 0x3C83DDA2, 0x55E72DD6, 0x2B756C73, 0x58B54299, 0x2627033C, 0x14FB44E1, 0x6A690544, 0x19A92BAE, 0x673B6A0B, 0x0E5F9A7F, 0x70CDDBDA, 0x030DF530, 0x7D9FB495, 0xD1C515D9, 0xAF57547C, 0xDC977A96, 0xA2053B33, 0xCB61CB47, 0xB5F38AE2, 0xC633A408, 0xB8A1E5AD, 0x9E86E691, 0xE014A734, 0x93D489DE, 0xED46C87B, 0x8422380F, 0xFAB079AA, 0x89705740, 0xF7E216E5, 0x5BB8B7A9, 0x252AF60C, 0x56EAD8E6, 0x28789943, 0x411C6937, 0x3F8E2892, 0x4C4E0678, 0x32DC47DD, 0xD98065C7, 0xA7122462, 0xD4D20A88, 0xAA404B2D, 0xC324BB59, 0xBDB6FAFC, 0xCE76D416, 0xB0E495B3, 0x1CBE34FF, 0x622C755A, 0x11EC5BB0, 0x6F7E1A15, 0x061AEA61, 0x7888ABC4, 0x0B48852E, 0x75DAC48B, 0x53FDC7B7, 0x2D6F8612, 0x5EAFA8F8, 0x203DE95D, 0x49591929, 0x37CB588C, 0x440B7666, 0x3A9937C3, 0x96C3968F, 0xE851D72A, 0x9B91F9C0, 0xE503B865, 0x8C674811, 0xF2F509B4, 0x8135275E, 0xFFA766FB, 0xCD7B2126, 0xB3E96083, 0xC0294E69, 0xBEBB0FCC, 0xD7DFFFB8, 0xA94DBE1D, 0xDA8D90F7, 0xA41FD152, 0x0845701E, 0x76D731BB, 0x05171F51, 0x7B855EF4, 0x12E1AE80, 0x6C73EF25, 0x1FB3C1CF, 0x6121806A, 0x47068356, 0x3994C2F3, 0x4A54EC19, 0x34C6ADBC, 0x5DA25DC8, 0x23301C6D, 0x50F03287, 0x2E627322, 0x8238D26E, 0xFCAA93CB, 0x8F6ABD21, 0xF1F8FC84, 0x989C0CF0, 0xE60E4D55, 0x95CE63BF, 0xEB5C221A, 0x4377278B, 0x3DE5662E, 0x4E2548C4, 0x30B70961, 0x59D3F915, 0x2741B8B0, 0x5481965A, 0x2A13D7FF, 0x864976B3, 0xF8DB3716, 0x8B1B19FC, 0xF5895859, 0x9CEDA82D, 0xE27FE988, 0x91BFC762, 0xEF2D86C7, 0xC90A85FB, 0xB798C45E, 0xC458EAB4, 0xBACAAB11, 0xD3AE5B65, 0xAD3C1AC0, 0xDEFC342A, 0xA06E758F, 0x0C34D4C3, 0x72A69566, 0x0166BB8C, 0x7FF4FA29, 0x16900A5D, 0x68024BF8, 0x1BC26512, 0x655024B7, 0x578C636A, 0x291E22CF, 0x5ADE0C25, 0x244C4D80, 0x4D28BDF4, 0x33BAFC51, 0x407AD2BB, 0x3EE8931E, 0x92B23252, 0xEC2073F7, 0x9FE05D1D, 0xE1721CB8, 0x8816ECCC, 0xF684AD69, 0x85448383, 0xFBD6C226, 0xDDF1C11A, 0xA36380BF, 0xD0A3AE55, 0xAE31EFF0, 0xC7551F84, 0xB9C75E21, 0xCA0770CB, 0xB495316E, 0x18CF9022, 0x665DD187, 0x159DFF6D, 0x6B0FBEC8, 0x026B4EBC, 0x7CF90F19, 0x0F3921F3, 0x71AB6056, 0x9AF7424C, 0xE46503E9, 0x97A52D03, 0xE9376CA6, 0x80539CD2, 0xFEC1DD77, 0x8D01F39D, 0xF393B238, 0x5FC91374, 0x215B52D1, 0x529B7C3B, 0x2C093D9E, 0x456DCDEA, 0x3BFF8C4F, 0x483FA2A5, 0x36ADE300, 0x108AE03C, 0x6E18A199, 0x1DD88F73, 0x634ACED6, 0x0A2E3EA2, 0x74BC7F07, 0x077C51ED, 0x79EE1048, 0xD5B4B104, 0xAB26F0A1, 0xD8E6DE4B, 0xA6749FEE, 0xCF106F9A, 0xB1822E3F, 0xC24200D5, 0xBCD04170, 0x8E0C06AD, 0xF09E4708, 0x835E69E2, 0xFDCC2847, 0x94A8D833, 0xEA3A9996, 0x99FAB77C, 0xE768F6D9, 0x4B325795, 0x35A01630, 0x466038DA, 0x38F2797F, 0x5196890B, 0x2F04C8AE, 0x5CC4E644, 0x2256A7E1, 0x0471A4DD, 0x7AE3E578, 0x0923CB92, 0x77B18A37, 0x1ED57A43, 0x60473BE6, 0x1387150C, 0x6D1554A9, 0xC14FF5E5, 0xBFDDB440, 0xCC1D9AAA, 0xB28FDB0F, 0xDBEB2B7B, 0xA5796ADE, 0xD6B94434, 0xA82B0591, }, { 0x00000000, 0xB8AA45DD, 0x812367BF, 0x39892262, 0xF331227B, 0x4B9B67A6, 0x721245C4, 0xCAB80019, 0xE66344F6, 0x5EC9012B, 0x67402349, 0xDFEA6694, 0x1552668D, 0xADF82350, 0x94710132, 0x2CDB44EF, 0x3DB164E9, 0x851B2134, 0xBC920356, 0x0438468B, 0xCE804692, 0x762A034F, 0x4FA3212D, 0xF70964F0, 0xDBD2201F, 0x637865C2, 0x5AF147A0, 0xE25B027D, 0x28E30264, 0x904947B9, 0xA9C065DB, 0x116A2006, 0x8B1425D7, 0x33BE600A, 0x0A374268, 0xB29D07B5, 0x782507AC, 0xC08F4271, 0xF9066013, 0x41AC25CE, 0x6D776121, 0xD5DD24FC, 0xEC54069E, 0x54FE4343, 0x9E46435A, 0x26EC0687, 0x1F6524E5, 0xA7CF6138, 0xB6A5413E, 0x0E0F04E3, 0x37862681, 0x8F2C635C, 0x45946345, 0xFD3E2698, 0xC4B704FA, 0x7C1D4127, 0x50C605C8, 0xE86C4015, 0xD1E56277, 0x694F27AA, 0xA3F727B3, 0x1B5D626E, 0x22D4400C, 0x9A7E05D1, 0xE75FA6AB, 0x5FF5E376, 0x667CC114, 0xDED684C9, 0x146E84D0, 0xACC4C10D, 0x954DE36F, 0x2DE7A6B2, 0x013CE25D, 0xB996A780, 0x801F85E2, 0x38B5C03F, 0xF20DC026, 0x4AA785FB, 0x732EA799, 0xCB84E244, 0xDAEEC242, 0x6244879F, 0x5BCDA5FD, 0xE367E020, 0x29DFE039, 0x9175A5E4, 0xA8FC8786, 0x1056C25B, 0x3C8D86B4, 0x8427C369, 0xBDAEE10B, 0x0504A4D6, 0xCFBCA4CF, 0x7716E112, 0x4E9FC370, 0xF63586AD, 0x6C4B837C, 0xD4E1C6A1, 0xED68E4C3, 0x55C2A11E, 0x9F7AA107, 0x27D0E4DA, 0x1E59C6B8, 0xA6F38365, 0x8A28C78A, 0x32828257, 0x0B0BA035, 0xB3A1E5E8, 0x7919E5F1, 0xC1B3A02C, 0xF83A824E, 0x4090C793, 0x51FAE795, 0xE950A248, 0xD0D9802A, 0x6873C5F7, 0xA2CBC5EE, 0x1A618033, 0x23E8A251, 0x9B42E78C, 0xB799A363, 0x0F33E6BE, 0x36BAC4DC, 0x8E108101, 0x44A88118, 0xFC02C4C5, 0xC58BE6A7, 0x7D21A37A, 0x3FC9A052, 0x8763E58F, 0xBEEAC7ED, 0x06408230, 0xCCF88229, 0x7452C7F4, 0x4DDBE596, 0xF571A04B, 0xD9AAE4A4, 0x6100A179, 0x5889831B, 0xE023C6C6, 0x2A9BC6DF, 0x92318302, 0xABB8A160, 0x1312E4BD, 0x0278C4BB, 0xBAD28166, 0x835BA304, 0x3BF1E6D9, 0xF149E6C0, 0x49E3A31D, 0x706A817F, 0xC8C0C4A2, 0xE41B804D, 0x5CB1C590, 0x6538E7F2, 0xDD92A22F, 0x172AA236, 0xAF80E7EB, 0x9609C589, 0x2EA38054, 0xB4DD8585, 0x0C77C058, 0x35FEE23A, 0x8D54A7E7, 0x47ECA7FE, 0xFF46E223, 0xC6CFC041, 0x7E65859C, 0x52BEC173, 0xEA1484AE, 0xD39DA6CC, 0x6B37E311, 0xA18FE308, 0x1925A6D5, 0x20AC84B7, 0x9806C16A, 0x896CE16C, 0x31C6A4B1, 0x084F86D3, 0xB0E5C30E, 0x7A5DC317, 0xC2F786CA, 0xFB7EA4A8, 0x43D4E175, 0x6F0FA59A, 0xD7A5E047, 0xEE2CC225, 0x568687F8, 0x9C3E87E1, 0x2494C23C, 0x1D1DE05E, 0xA5B7A583, 0xD89606F9, 0x603C4324, 0x59B56146, 0xE11F249B, 0x2BA72482, 0x930D615F, 0xAA84433D, 0x122E06E0, 0x3EF5420F, 0x865F07D2, 0xBFD625B0, 0x077C606D, 0xCDC46074, 0x756E25A9, 0x4CE707CB, 0xF44D4216, 0xE5276210, 0x5D8D27CD, 0x640405AF, 0xDCAE4072, 0x1616406B, 0xAEBC05B6, 0x973527D4, 0x2F9F6209, 0x034426E6, 0xBBEE633B, 0x82674159, 0x3ACD0484, 0xF075049D, 0x48DF4140, 0x71566322, 0xC9FC26FF, 0x5382232E, 0xEB2866F3, 0xD2A14491, 0x6A0B014C, 0xA0B30155, 0x18194488, 0x219066EA, 0x993A2337, 0xB5E167D8, 0x0D4B2205, 0x34C20067, 0x8C6845BA, 0x46D045A3, 0xFE7A007E, 0xC7F3221C, 0x7F5967C1, 0x6E3347C7, 0xD699021A, 0xEF102078, 0x57BA65A5, 0x9D0265BC, 0x25A82061, 0x1C210203, 0xA48B47DE, 0x88500331, 0x30FA46EC, 0x0973648E, 0xB1D92153, 0x7B61214A, 0xC3CB6497, 0xFA4246F5, 0x42E80328, }, { 0x00000000, 0xAC6F1138, 0x58DF2270, 0xF4B03348, 0xB0BE45E0, 0x1CD154D8, 0xE8616790, 0x440E76A8, 0x910B67C5, 0x3D6476FD, 0xC9D445B5, 0x65BB548D, 0x21B52225, 0x8DDA331D, 0x796A0055, 0xD505116D, 0xD361228F, 0x7F0E33B7, 0x8BBE00FF, 0x27D111C7, 0x63DF676F, 0xCFB07657, 0x3B00451F, 0x976F5427, 0x426A454A, 0xEE055472, 0x1AB5673A, 0xB6DA7602, 0xF2D400AA, 0x5EBB1192, 0xAA0B22DA, 0x066433E2, 0x57B5A81B, 0xFBDAB923, 0x0F6A8A6B, 0xA3059B53, 0xE70BEDFB, 0x4B64FCC3, 0xBFD4CF8B, 0x13BBDEB3, 0xC6BECFDE, 0x6AD1DEE6, 0x9E61EDAE, 0x320EFC96, 0x76008A3E, 0xDA6F9B06, 0x2EDFA84E, 0x82B0B976, 0x84D48A94, 0x28BB9BAC, 0xDC0BA8E4, 0x7064B9DC, 0x346ACF74, 0x9805DE4C, 0x6CB5ED04, 0xC0DAFC3C, 0x15DFED51, 0xB9B0FC69, 0x4D00CF21, 0xE16FDE19, 0xA561A8B1, 0x090EB989, 0xFDBE8AC1, 0x51D19BF9, 0xAE6A5137, 0x0205400F, 0xF6B57347, 0x5ADA627F, 0x1ED414D7, 0xB2BB05EF, 0x460B36A7, 0xEA64279F, 0x3F6136F2, 0x930E27CA, 0x67BE1482, 0xCBD105BA, 0x8FDF7312, 0x23B0622A, 0xD7005162, 0x7B6F405A, 0x7D0B73B8, 0xD1646280, 0x25D451C8, 0x89BB40F0, 0xCDB53658, 0x61DA2760, 0x956A1428, 0x39050510, 0xEC00147D, 0x406F0545, 0xB4DF360D, 0x18B02735, 0x5CBE519D, 0xF0D140A5, 0x046173ED, 0xA80E62D5, 0xF9DFF92C, 0x55B0E814, 0xA100DB5C, 0x0D6FCA64, 0x4961BCCC, 0xE50EADF4, 0x11BE9EBC, 0xBDD18F84, 0x68D49EE9, 0xC4BB8FD1, 0x300BBC99, 0x9C64ADA1, 0xD86ADB09, 0x7405CA31, 0x80B5F979, 0x2CDAE841, 0x2ABEDBA3, 0x86D1CA9B, 0x7261F9D3, 0xDE0EE8EB, 0x9A009E43, 0x366F8F7B, 0xC2DFBC33, 0x6EB0AD0B, 0xBBB5BC66, 0x17DAAD5E, 0xE36A9E16, 0x4F058F2E, 0x0B0BF986, 0xA764E8BE, 0x53D4DBF6, 0xFFBBCACE, 0x5CD5A26E, 0xF0BAB356, 0x040A801E, 0xA8659126, 0xEC6BE78E, 0x4004F6B6, 0xB4B4C5FE, 0x18DBD4C6, 0xCDDEC5AB, 0x61B1D493, 0x9501E7DB, 0x396EF6E3, 0x7D60804B, 0xD10F9173, 0x25BFA23B, 0x89D0B303, 0x8FB480E1, 0x23DB91D9, 0xD76BA291, 0x7B04B3A9, 0x3F0AC501, 0x9365D439, 0x67D5E771, 0xCBBAF649, 0x1EBFE724, 0xB2D0F61C, 0x4660C554, 0xEA0FD46C, 0xAE01A2C4, 0x026EB3FC, 0xF6DE80B4, 0x5AB1918C, 0x0B600A75, 0xA70F1B4D, 0x53BF2805, 0xFFD0393D, 0xBBDE4F95, 0x17B15EAD, 0xE3016DE5, 0x4F6E7CDD, 0x9A6B6DB0, 0x36047C88, 0xC2B44FC0, 0x6EDB5EF8, 0x2AD52850, 0x86BA3968, 0x720A0A20, 0xDE651B18, 0xD80128FA, 0x746E39C2, 0x80DE0A8A, 0x2CB11BB2, 0x68BF6D1A, 0xC4D07C22, 0x30604F6A, 0x9C0F5E52, 0x490A4F3F, 0xE5655E07, 0x11D56D4F, 0xBDBA7C77, 0xF9B40ADF, 0x55DB1BE7, 0xA16B28AF, 0x0D043997, 0xF2BFF359, 0x5ED0E261, 0xAA60D129, 0x060FC011, 0x4201B6B9, 0xEE6EA781, 0x1ADE94C9, 0xB6B185F1, 0x63B4949C, 0xCFDB85A4, 0x3B6BB6EC, 0x9704A7D4, 0xD30AD17C, 0x7F65C044, 0x8BD5F30C, 0x27BAE234, 0x21DED1D6, 0x8DB1C0EE, 0x7901F3A6, 0xD56EE29E, 0x91609436, 0x3D0F850E, 0xC9BFB646, 0x65D0A77E, 0xB0D5B613, 0x1CBAA72B, 0xE80A9463, 0x4465855B, 0x006BF3F3, 0xAC04E2CB, 0x58B4D183, 0xF4DBC0BB, 0xA50A5B42, 0x09654A7A, 0xFDD57932, 0x51BA680A, 0x15B41EA2, 0xB9DB0F9A, 0x4D6B3CD2, 0xE1042DEA, 0x34013C87, 0x986E2DBF, 0x6CDE1EF7, 0xC0B10FCF, 0x84BF7967, 0x28D0685F, 0xDC605B17, 0x700F4A2F, 0x766B79CD, 0xDA0468F5, 0x2EB45BBD, 0x82DB4A85, 0xC6D53C2D, 0x6ABA2D15, 0x9E0A1E5D, 0x32650F65, 0xE7601E08, 0x4B0F0F30, 0xBFBF3C78, 0x13D02D40, 0x57DE5BE8, 0xFBB14AD0, 0x0F017998, 0xA36E68A0, }, { 0x00000000, 0x196B30EF, 0xC3A08CDB, 0xDACBBC34, 0x7737F5B2, 0x6E5CC55D, 0xB4977969, 0xADFC4986, 0x1F180660, 0x0673368F, 0xDCB88ABB, 0xC5D3BA54, 0x682FF3D2, 0x7144C33D, 0xAB8F7F09, 0xB2E44FE6, 0x3E300CC0, 0x275B3C2F, 0xFD90801B, 0xE4FBB0F4, 0x4907F972, 0x506CC99D, 0x8AA775A9, 0x93CC4546, 0x21280AA0, 0x38433A4F, 0xE288867B, 0xFBE3B694, 0x561FFF12, 0x4F74CFFD, 0x95BF73C9, 0x8CD44326, 0x8D16F485, 0x947DC46A, 0x4EB6785E, 0x57DD48B1, 0xFA210137, 0xE34A31D8, 0x39818DEC, 0x20EABD03, 0x920EF2E5, 0x8B65C20A, 0x51AE7E3E, 0x48C54ED1, 0xE5390757, 0xFC5237B8, 0x26998B8C, 0x3FF2BB63, 0xB326F845, 0xAA4DC8AA, 0x7086749E, 0x69ED4471, 0xC4110DF7, 0xDD7A3D18, 0x07B1812C, 0x1EDAB1C3, 0xAC3EFE25, 0xB555CECA, 0x6F9E72FE, 0x76F54211, 0xDB090B97, 0xC2623B78, 0x18A9874C, 0x01C2B7A3, 0xEB5B040E, 0xF23034E1, 0x28FB88D5, 0x3190B83A, 0x9C6CF1BC, 0x8507C153, 0x5FCC7D67, 0x46A74D88, 0xF443026E, 0xED283281, 0x37E38EB5, 0x2E88BE5A, 0x8374F7DC, 0x9A1FC733, 0x40D47B07, 0x59BF4BE8, 0xD56B08CE, 0xCC003821, 0x16CB8415, 0x0FA0B4FA, 0xA25CFD7C, 0xBB37CD93, 0x61FC71A7, 0x78974148, 0xCA730EAE, 0xD3183E41, 0x09D38275, 0x10B8B29A, 0xBD44FB1C, 0xA42FCBF3, 0x7EE477C7, 0x678F4728, 0x664DF08B, 0x7F26C064, 0xA5ED7C50, 0xBC864CBF, 0x117A0539, 0x081135D6, 0xD2DA89E2, 0xCBB1B90D, 0x7955F6EB, 0x603EC604, 0xBAF57A30, 0xA39E4ADF, 0x0E620359, 0x170933B6, 0xCDC28F82, 0xD4A9BF6D, 0x587DFC4B, 0x4116CCA4, 0x9BDD7090, 0x82B6407F, 0x2F4A09F9, 0x36213916, 0xECEA8522, 0xF581B5CD, 0x4765FA2B, 0x5E0ECAC4, 0x84C576F0, 0x9DAE461F, 0x30520F99, 0x29393F76, 0xF3F28342, 0xEA99B3AD, 0xD6B7081C, 0xCFDC38F3, 0x151784C7, 0x0C7CB428, 0xA180FDAE, 0xB8EBCD41, 0x62207175, 0x7B4B419A, 0xC9AF0E7C, 0xD0C43E93, 0x0A0F82A7, 0x1364B248, 0xBE98FBCE, 0xA7F3CB21, 0x7D387715, 0x645347FA, 0xE88704DC, 0xF1EC3433, 0x2B278807, 0x324CB8E8, 0x9FB0F16E, 0x86DBC181, 0x5C107DB5, 0x457B4D5A, 0xF79F02BC, 0xEEF43253, 0x343F8E67, 0x2D54BE88, 0x80A8F70E, 0x99C3C7E1, 0x43087BD5, 0x5A634B3A, 0x5BA1FC99, 0x42CACC76, 0x98017042, 0x816A40AD, 0x2C96092B, 0x35FD39C4, 0xEF3685F0, 0xF65DB51F, 0x44B9FAF9, 0x5DD2CA16, 0x87197622, 0x9E7246CD, 0x338E0F4B, 0x2AE53FA4, 0xF02E8390, 0xE945B37F, 0x6591F059, 0x7CFAC0B6, 0xA6317C82, 0xBF5A4C6D, 0x12A605EB, 0x0BCD3504, 0xD1068930, 0xC86DB9DF, 0x7A89F639, 0x63E2C6D6, 0xB9297AE2, 0xA0424A0D, 0x0DBE038B, 0x14D53364, 0xCE1E8F50, 0xD775BFBF, 0x3DEC0C12, 0x24873CFD, 0xFE4C80C9, 0xE727B026, 0x4ADBF9A0, 0x53B0C94F, 0x897B757B, 0x90104594, 0x22F40A72, 0x3B9F3A9D, 0xE15486A9, 0xF83FB646, 0x55C3FFC0, 0x4CA8CF2F, 0x9663731B, 0x8F0843F4, 0x03DC00D2, 0x1AB7303D, 0xC07C8C09, 0xD917BCE6, 0x74EBF560, 0x6D80C58F, 0xB74B79BB, 0xAE204954, 0x1CC406B2, 0x05AF365D, 0xDF648A69, 0xC60FBA86, 0x6BF3F300, 0x7298C3EF, 0xA8537FDB, 0xB1384F34, 0xB0FAF897, 0xA991C878, 0x735A744C, 0x6A3144A3, 0xC7CD0D25, 0xDEA63DCA, 0x046D81FE, 0x1D06B111, 0xAFE2FEF7, 0xB689CE18, 0x6C42722C, 0x752942C3, 0xD8D50B45, 0xC1BE3BAA, 0x1B75879E, 0x021EB771, 0x8ECAF457, 0x97A1C4B8, 0x4D6A788C, 0x54014863, 0xF9FD01E5, 0xE096310A, 0x3A5D8D3E, 0x2336BDD1, 0x91D2F237, 0x88B9C2D8, 0x52727EEC, 0x4B194E03, 0xE6E50785, 0xFF8E376A, 0x25458B5E, 0x3C2EBBB1, }, { 0x00000000, 0xC82C0368, 0x905906D0, 0x587505B8, 0xD1C5E0A5, 0x19E9E3CD, 0x419CE675, 0x89B0E51D, 0x53FD2D4E, 0x9BD12E26, 0xC3A42B9E, 0x0B8828F6, 0x8238CDEB, 0x4A14CE83, 0x1261CB3B, 0xDA4DC853, 0xA6FA5B9C, 0x6ED658F4, 0x36A35D4C, 0xFE8F5E24, 0x773FBB39, 0xBF13B851, 0xE766BDE9, 0x2F4ABE81, 0xF50776D2, 0x3D2B75BA, 0x655E7002, 0xAD72736A, 0x24C29677, 0xECEE951F, 0xB49B90A7, 0x7CB793CF, 0xBD835B3D, 0x75AF5855, 0x2DDA5DED, 0xE5F65E85, 0x6C46BB98, 0xA46AB8F0, 0xFC1FBD48, 0x3433BE20, 0xEE7E7673, 0x2652751B, 0x7E2770A3, 0xB60B73CB, 0x3FBB96D6, 0xF79795BE, 0xAFE29006, 0x67CE936E, 0x1B7900A1, 0xD35503C9, 0x8B200671, 0x430C0519, 0xCABCE004, 0x0290E36C, 0x5AE5E6D4, 0x92C9E5BC, 0x48842DEF, 0x80A82E87, 0xD8DD2B3F, 0x10F12857, 0x9941CD4A, 0x516DCE22, 0x0918CB9A, 0xC134C8F2, 0x7A07B77A, 0xB22BB412, 0xEA5EB1AA, 0x2272B2C2, 0xABC257DF, 0x63EE54B7, 0x3B9B510F, 0xF3B75267, 0x29FA9A34, 0xE1D6995C, 0xB9A39CE4, 0x718F9F8C, 0xF83F7A91, 0x301379F9, 0x68667C41, 0xA04A7F29, 0xDCFDECE6, 0x14D1EF8E, 0x4CA4EA36, 0x8488E95E, 0x0D380C43, 0xC5140F2B, 0x9D610A93, 0x554D09FB, 0x8F00C1A8, 0x472CC2C0, 0x1F59C778, 0xD775C410, 0x5EC5210D, 0x96E92265, 0xCE9C27DD, 0x06B024B5, 0xC784EC47, 0x0FA8EF2F, 0x57DDEA97, 0x9FF1E9FF, 0x16410CE2, 0xDE6D0F8A, 0x86180A32, 0x4E34095A, 0x9479C109, 0x5C55C261, 0x0420C7D9, 0xCC0CC4B1, 0x45BC21AC, 0x8D9022C4, 0xD5E5277C, 0x1DC92414, 0x617EB7DB, 0xA952B4B3, 0xF127B10B, 0x390BB263, 0xB0BB577E, 0x78975416, 0x20E251AE, 0xE8CE52C6, 0x32839A95, 0xFAAF99FD, 0xA2DA9C45, 0x6AF69F2D, 0xE3467A30, 0x2B6A7958, 0x731F7CE0, 0xBB337F88, 0xF40E6EF5, 0x3C226D9D, 0x64576825, 0xAC7B6B4D, 0x25CB8E50, 0xEDE78D38, 0xB5928880, 0x7DBE8BE8, 0xA7F343BB, 0x6FDF40D3, 0x37AA456B, 0xFF864603, 0x7636A31E, 0xBE1AA076, 0xE66FA5CE, 0x2E43A6A6, 0x52F43569, 0x9AD83601, 0xC2AD33B9, 0x0A8130D1, 0x8331D5CC, 0x4B1DD6A4, 0x1368D31C, 0xDB44D074, 0x01091827, 0xC9251B4F, 0x91501EF7, 0x597C1D9F, 0xD0CCF882, 0x18E0FBEA, 0x4095FE52, 0x88B9FD3A, 0x498D35C8, 0x81A136A0, 0xD9D43318, 0x11F83070, 0x9848D56D, 0x5064D605, 0x0811D3BD, 0xC03DD0D5, 0x1A701886, 0xD25C1BEE, 0x8A291E56, 0x42051D3E, 0xCBB5F823, 0x0399FB4B, 0x5BECFEF3, 0x93C0FD9B, 0xEF776E54, 0x275B6D3C, 0x7F2E6884, 0xB7026BEC, 0x3EB28EF1, 0xF69E8D99, 0xAEEB8821, 0x66C78B49, 0xBC8A431A, 0x74A64072, 0x2CD345CA, 0xE4FF46A2, 0x6D4FA3BF, 0xA563A0D7, 0xFD16A56F, 0x353AA607, 0x8E09D98F, 0x4625DAE7, 0x1E50DF5F, 0xD67CDC37, 0x5FCC392A, 0x97E03A42, 0xCF953FFA, 0x07B93C92, 0xDDF4F4C1, 0x15D8F7A9, 0x4DADF211, 0x8581F179, 0x0C311464, 0xC41D170C, 0x9C6812B4, 0x544411DC, 0x28F38213, 0xE0DF817B, 0xB8AA84C3, 0x708687AB, 0xF93662B6, 0x311A61DE, 0x696F6466, 0xA143670E, 0x7B0EAF5D, 0xB322AC35, 0xEB57A98D, 0x237BAAE5, 0xAACB4FF8, 0x62E74C90, 0x3A924928, 0xF2BE4A40, 0x338A82B2, 0xFBA681DA, 0xA3D38462, 0x6BFF870A, 0xE24F6217, 0x2A63617F, 0x721664C7, 0xBA3A67AF, 0x6077AFFC, 0xA85BAC94, 0xF02EA92C, 0x3802AA44, 0xB1B24F59, 0x799E4C31, 0x21EB4989, 0xE9C74AE1, 0x9570D92E, 0x5D5CDA46, 0x0529DFFE, 0xCD05DC96, 0x44B5398B, 0x8C993AE3, 0xD4EC3F5B, 0x1CC03C33, 0xC68DF460, 0x0EA1F708, 0x56D4F2B0, 0x9EF8F1D8, 0x174814C5, 0xDF6417AD, 0x87111215, 0x4F3D117D, }, { 0x00000000, 0x277D3C49, 0x4EFA7892, 0x698744DB, 0x6D821D21, 0x4AFF2168, 0x237865B3, 0x040559FA, 0xDA043B42, 0xFD79070B, 0x94FE43D0, 0xB3837F99, 0xB7862663, 0x90FB1A2A, 0xF97C5EF1, 0xDE0162B8, 0xB4097684, 0x93744ACD, 0xFAF30E16, 0xDD8E325F, 0xD98B6BA5, 0xFEF657EC, 0x97711337, 0xB00C2F7E, 0x6E0D4DC6, 0x4970718F, 0x20F73554, 0x078A091D, 0x038F50E7, 0x24F26CAE, 0x4D752875, 0x6A08143C, 0x9965000D, 0xBE183C44, 0xD79F789F, 0xF0E244D6, 0xF4E71D2C, 0xD39A2165, 0xBA1D65BE, 0x9D6059F7, 0x43613B4F, 0x641C0706, 0x0D9B43DD, 0x2AE67F94, 0x2EE3266E, 0x099E1A27, 0x60195EFC, 0x476462B5, 0x2D6C7689, 0x0A114AC0, 0x63960E1B, 0x44EB3252, 0x40EE6BA8, 0x679357E1, 0x0E14133A, 0x29692F73, 0xF7684DCB, 0xD0157182, 0xB9923559, 0x9EEF0910, 0x9AEA50EA, 0xBD976CA3, 0xD4102878, 0xF36D1431, 0x32CB001A, 0x15B63C53, 0x7C317888, 0x5B4C44C1, 0x5F491D3B, 0x78342172, 0x11B365A9, 0x36CE59E0, 0xE8CF3B58, 0xCFB20711, 0xA63543CA, 0x81487F83, 0x854D2679, 0xA2301A30, 0xCBB75EEB, 0xECCA62A2, 0x86C2769E, 0xA1BF4AD7, 0xC8380E0C, 0xEF453245, 0xEB406BBF, 0xCC3D57F6, 0xA5BA132D, 0x82C72F64, 0x5CC64DDC, 0x7BBB7195, 0x123C354E, 0x35410907, 0x314450FD, 0x16396CB4, 0x7FBE286F, 0x58C31426, 0xABAE0017, 0x8CD33C5E, 0xE5547885, 0xC22944CC, 0xC62C1D36, 0xE151217F, 0x88D665A4, 0xAFAB59ED, 0x71AA3B55, 0x56D7071C, 0x3F5043C7, 0x182D7F8E, 0x1C282674, 0x3B551A3D, 0x52D25EE6, 0x75AF62AF, 0x1FA77693, 0x38DA4ADA, 0x515D0E01, 0x76203248, 0x72256BB2, 0x555857FB, 0x3CDF1320, 0x1BA22F69, 0xC5A34DD1, 0xE2DE7198, 0x8B593543, 0xAC24090A, 0xA82150F0, 0x8F5C6CB9, 0xE6DB2862, 0xC1A6142B, 0x64960134, 0x43EB3D7D, 0x2A6C79A6, 0x0D1145EF, 0x09141C15, 0x2E69205C, 0x47EE6487, 0x609358CE, 0xBE923A76, 0x99EF063F, 0xF06842E4, 0xD7157EAD, 0xD3102757, 0xF46D1B1E, 0x9DEA5FC5, 0xBA97638C, 0xD09F77B0, 0xF7E24BF9, 0x9E650F22, 0xB918336B, 0xBD1D6A91, 0x9A6056D8, 0xF3E71203, 0xD49A2E4A, 0x0A9B4CF2, 0x2DE670BB, 0x44613460, 0x631C0829, 0x671951D3, 0x40646D9A, 0x29E32941, 0x0E9E1508, 0xFDF30139, 0xDA8E3D70, 0xB30979AB, 0x947445E2, 0x90711C18, 0xB70C2051, 0xDE8B648A, 0xF9F658C3, 0x27F73A7B, 0x008A0632, 0x690D42E9, 0x4E707EA0, 0x4A75275A, 0x6D081B13, 0x048F5FC8, 0x23F26381, 0x49FA77BD, 0x6E874BF4, 0x07000F2F, 0x207D3366, 0x24786A9C, 0x030556D5, 0x6A82120E, 0x4DFF2E47, 0x93FE4CFF, 0xB48370B6, 0xDD04346D, 0xFA790824, 0xFE7C51DE, 0xD9016D97, 0xB086294C, 0x97FB1505, 0x565D012E, 0x71203D67, 0x18A779BC, 0x3FDA45F5, 0x3BDF1C0F, 0x1CA22046, 0x7525649D, 0x525858D4, 0x8C593A6C, 0xAB240625, 0xC2A342FE, 0xE5DE7EB7, 0xE1DB274D, 0xC6A61B04, 0xAF215FDF, 0x885C6396, 0xE25477AA, 0xC5294BE3, 0xACAE0F38, 0x8BD33371, 0x8FD66A8B, 0xA8AB56C2, 0xC12C1219, 0xE6512E50, 0x38504CE8, 0x1F2D70A1, 0x76AA347A, 0x51D70833, 0x55D251C9, 0x72AF6D80, 0x1B28295B, 0x3C551512, 0xCF380123, 0xE8453D6A, 0x81C279B1, 0xA6BF45F8, 0xA2BA1C02, 0x85C7204B, 0xEC406490, 0xCB3D58D9, 0x153C3A61, 0x32410628, 0x5BC642F3, 0x7CBB7EBA, 0x78BE2740, 0x5FC31B09, 0x36445FD2, 0x1139639B, 0x7B3177A7, 0x5C4C4BEE, 0x35CB0F35, 0x12B6337C, 0x16B36A86, 0x31CE56CF, 0x58491214, 0x7F342E5D, 0xA1354CE5, 0x864870AC, 0xEFCF3477, 0xC8B2083E, 0xCCB751C4, 0xEBCA6D8D, 0x824D2956, 0xA530151F } }; // Simple CRC macro for testing #define CRC8(x) ((pg_crc32c)(x)) pg_crc32c pg_comp_crc32c_sb8(pg_crc32c crc, const void *data, size_t len) { const unsigned char *p = data; const uint32 *p4; // Handle 0-3 initial bytes one at a time while (len > 0 && ((uintptr_t)p & 3)) { crc = CRC8(*p++); len--; } // Process eight bytes at a time p4 = (const uint32 *)p; while (len >= 8) { uint32 a = *p4++ ^ crc; uint32 b = *p4++; // <-- can be uninitialized if len < 8 at end #ifdef WORDS_BIGENDIAN const uint8 c0 = b; const uint8 c1 = b >> 8; const uint8 c2 = b >> 16; const uint8 c3 = b >> 24; const uint8 c4 = a; const uint8 c5 = a >> 8; const uint8 c6 = a >> 16; const uint8 c7 = a >> 24; #else const uint8 c0 = b >> 24; const uint8 c1 = b >> 16; const uint8 c2 = b >> 8; const uint8 c3 = b; const uint8 c4 = a >> 24; const uint8 c5 = a >> 16; const uint8 c6 = a >> 8; const uint8 c7 = a; #endif crc = pg_crc32c_table[0][c0] ^ pg_crc32c_table[1][c1] ^ pg_crc32c_table[2][c2] ^ pg_crc32c_table[3][c3] ^ pg_crc32c_table[4][c4] ^ pg_crc32c_table[5][c5] ^ pg_crc32c_table[6][c6] ^ pg_crc32c_table[7][c7]; len -= 8; } return crc; } int main() { ControlFileData cf; /* Initialize some fields */ cf.pg_control_version = 1234; cf.catalog_version_no = 5678; cf.maxAlign = 16; cf.floatFormat = 1; cf.blcksz = 8192; cf.relseg_size = 1024; cf.xlog_blcksz = 8192; cf.xlog_seg_size = 16 * 1024 * 1024; cf.nameDataLen = 64; cf.indexMaxKeys = 32; cf.toast_max_chunk_size = 2048; cf.loblksize = 8192; cf.float8ByVal = 1; cf.default_char_signedness = 1; /* Compute CRC over the struct excluding the crc field */ pg_crc32c crc = 0; crc = pg_comp_crc32c_sb8(crc, (uint8_t*)&cf, sizeof(ControlFileData) - sizeof(cf.crc)); cf.crc = crc; printf("ControlFileData CRC: %u\n", cf.crc); ASSERT(3365522903, crc); return 0; } chibicc-1.0.24/test/postgres_crc32c2.c000066400000000000000000000015651517770275000174160ustar00rootroot00000000000000#include #include #include typedef uint32_t uint32; typedef uint8_t uint8; typedef uint32_t pg_crc32c; #define MOCK_AUTH_NONCE_LEN 32 typedef struct { uint32_t pg_control_version; uint32_t catalog_version_no; uint32_t maxAlign; uint32_t floatFormat; uint32_t blcksz; uint32_t relseg_size; uint32_t xlog_blcksz; uint32_t xlog_seg_size; uint32_t nameDataLen; uint32_t indexMaxKeys; uint32_t toast_max_chunk_size; uint32_t loblksize; uint32_t float8ByVal; uint8_t default_char_signedness; char mock_authentication_nonce[MOCK_AUTH_NONCE_LEN]; pg_crc32c crc; } ControlFileData; int main(void) { printf("offsetof(crc) = %zu\n", offsetof(ControlFileData, crc)); printf("sizeof(ControlFileData) = %zu\n", sizeof(ControlFileData)); return 0; } chibicc-1.0.24/test/postgres_datum_cast.c000066400000000000000000000014551517770275000203770ustar00rootroot00000000000000#include "test.h" #include typedef uintptr_t Datum; typedef struct TableAmRoutine { int type; } TableAmRoutine; static const TableAmRoutine heapam_methods = { .type = 400, }; // Simulate the handler function returning a pointer as Datum Datum heap_tableam_handler(void) { return (Datum)&heapam_methods; } // Simulate OidFunctionCall0 calling the handler Datum OidFunctionCall0(int oid) { if (oid == 3) return heap_tableam_handler(); return 0; } int main() { // Simulate GetTableAmRoutine Datum datum = OidFunctionCall0(3); const TableAmRoutine *routine = (const TableAmRoutine *)datum; if (routine->type != 400) { printf("FAIL: routine->type = %d, expected 400\n", routine->type); exit(1); } printf("OK\n"); return 0; }chibicc-1.0.24/test/postgres_exit.c000066400000000000000000000031661517770275000172250ustar00rootroot00000000000000#include "test.h" #include typedef unsigned long Datum; typedef void (*pg_on_exit_callback) (int code, Datum arg); struct on_proc_exit_list_element { pg_on_exit_callback function; Datum arg; }; static struct on_proc_exit_list_element *on_proc_exit_list; static int on_proc_exit_index; static int on_proc_exit_size; void on_proc_exit(pg_on_exit_callback function, Datum arg) { if (on_proc_exit_index >= on_proc_exit_size) { on_proc_exit_size = on_proc_exit_size ? on_proc_exit_size * 2 : 10; on_proc_exit_list = realloc(on_proc_exit_list, on_proc_exit_size * sizeof(struct on_proc_exit_list_element)); } on_proc_exit_list[on_proc_exit_index].function = function; on_proc_exit_list[on_proc_exit_index].arg = arg; on_proc_exit_index++; } void proc_exit_prepare(int code) { int i; for (i = on_proc_exit_index - 1; i >= 0; i--) on_proc_exit_list[i].function(code, on_proc_exit_list[i].arg); } static void my_callback(int code, Datum arg) { printf("Callback called with code=%d, arg=%ld\n", code, arg); ASSERT(0, code); ASSERT(12345, arg); } static void my_callback2(int code, Datum arg) { printf("Callback2 called with code=%d, arg=%ld\n", code, arg); ASSERT(0, code); ASSERT(67890, arg); } int main() { on_proc_exit(my_callback, 12345); on_proc_exit(my_callback2, 67890); // Verify values in the list before execution ASSERT(12345, on_proc_exit_list[0].arg); ASSERT(67890, on_proc_exit_list[1].arg); proc_exit_prepare(0); printf("OK\n"); return 0; } chibicc-1.0.24/test/postgres_extend.c000066400000000000000000000065161517770275000175450ustar00rootroot00000000000000#include #include #include #include /* ---- PostgreSQL-like typedefs ---- */ typedef uint32_t BlockNumber; typedef int ForkNumber; #define InvalidBlockNumber ((BlockNumber)107) /* ---- Interrupt macros (intentionally non-trivial) ---- */ static volatile int interrupt_hold_depth = 0; #define HOLD_INTERRUPTS() do { interrupt_hold_depth++; } while (0) #define RESUME_INTERRUPTS() do { interrupt_hold_depth--; } while (0) /* ---- SMgrRelation definition ---- */ typedef struct SMgrRelationData { int smgr_which; BlockNumber smgr_cached_nblocks[4]; } SMgrRelationData; typedef SMgrRelationData *SMgrRelation; /* ---- smgr switch table ---- */ typedef void (*smgr_zeroextend_fn)( SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks, bool skipFsync ); typedef struct { smgr_zeroextend_fn smgr_zeroextend; } smgrsw_entry; /* ---- Test instrumentation ---- */ static int last_seen_nblocks = -1; static BlockNumber last_seen_blocknum = 0; static ForkNumber last_seen_forknum = -1; /* ---- Backend implementation ---- */ static void test_zeroextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks, bool skipFsync) { (void)skipFsync; /* Capture arguments to detect corruption */ last_seen_nblocks = nblocks; last_seen_blocknum = blocknum; last_seen_forknum = forknum; /* Simulate extension */ reln->smgr_cached_nblocks[forknum] = blocknum + nblocks; } /* ---- Global switch table ---- */ static smgrsw_entry smgrsw[] = { { test_zeroextend } }; /* ---- Function under test (verbatim logic) ---- */ void smgrzeroextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks, bool skipFsync) { HOLD_INTERRUPTS(); smgrsw[reln->smgr_which].smgr_zeroextend( reln, forknum, blocknum, nblocks, skipFsync ); if (reln->smgr_cached_nblocks[forknum] == blocknum) reln->smgr_cached_nblocks[forknum] = blocknum + nblocks; else reln->smgr_cached_nblocks[forknum] = InvalidBlockNumber; RESUME_INTERRUPTS(); } /* ---- Test harness ---- */ int main(void) { SMgrRelationData reln; reln.smgr_which = 0; for (int i = 0; i < 4; i++) reln.smgr_cached_nblocks[i] = 0; BlockNumber blocknum = 100; int extend_by = 7; ForkNumber forknum = 1; smgrzeroextend(&reln, forknum, blocknum, extend_by, false); /* ---- Validation ---- */ if (last_seen_nblocks != extend_by) { fprintf(stderr, "FAIL: nblocks corrupted (expected %d, got %d)\n", extend_by, last_seen_nblocks); return 1; } if (last_seen_blocknum != blocknum) { fprintf(stderr, "FAIL: blocknum corrupted\n"); return 2; } if (reln.smgr_cached_nblocks[forknum] != blocknum + extend_by) { fprintf(stderr, "FAIL: cached_nblocks wrong (expected %u, got %u)\n", blocknum + extend_by, reln.smgr_cached_nblocks[forknum]); return 3; } if (interrupt_hold_depth != 0) { fprintf(stderr, "FAIL: interrupt depth mismatch (%d)\n", interrupt_hold_depth); return 4; } printf("PASS\n"); return 0; } chibicc-1.0.24/test/postgres_func_ptr.c000066400000000000000000000006501517770275000200670ustar00rootroot00000000000000#include "test.h" typedef void (*func_t)(void); void callback(void) { printf("Callback executed\n"); } struct S { func_t f; }; struct S global_s; void set_callback(func_t f) { global_s.f = f; } int main() { set_callback(callback); if (global_s.f != callback) { printf("Fail: global_s.f != callback\n"); exit(1); } global_s.f(); printf("OK\n"); return 0; } chibicc-1.0.24/test/postgres_guc_enum.c000066400000000000000000000025631517770275000200560ustar00rootroot00000000000000#include "test.h" #include struct config_generic { const char *name; }; struct config_enum_entry { const char *name; int val; bool hidden; }; struct config_enum { struct config_generic gen; int *variable; int boot_val; const struct config_enum_entry *options; void *check_hook; void *assign_hook; void *show_hook; int reset_val; void *reset_extra; }; static const struct config_enum_entry isolation_level_options[] = { {"serializable", 1, false}, {"repeatable read", 2, false}, {"read committed", 3, false}, {"read uncommitted", 4, false}, {NULL, 0, false} }; static int DefaultXactIsoLevel; static struct config_enum ConfigureNamesEnum[] = { { {"default_transaction_isolation"}, &DefaultXactIsoLevel, 3, isolation_level_options, NULL, NULL, NULL, 0, NULL }, {{NULL}, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL} }; static int config_enum_lookup_by_name(struct config_enum *record, const char *value) { const struct config_enum_entry *entry = record->options; for (; entry && entry->name; entry++) { if (!strcmp(entry->name, value)) return entry->val; } return -1; } int main(void) { ASSERT(1, config_enum_lookup_by_name(&ConfigureNamesEnum[0], "serializable") == 1); ASSERT(1, config_enum_lookup_by_name(&ConfigureNamesEnum[0], "read committed") == 3); printf("OK\n"); return 0; } chibicc-1.0.24/test/postgres_hash.c000066400000000000000000000176771517770275000172130ustar00rootroot00000000000000#include #include #include #include #include "test.h" #define NUM_FREELISTS 32 typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ const uint8 pg_leftmost_one_pos[256] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; typedef uint32_t uint32; typedef uint32_t Size; // Placeholder for actual size type // Define the HASHELEMENT structure typedef struct HASHELEMENT { struct HASHELEMENT *link; // link to next entry in same bucket uint32 hashvalue; // hash function result for this entry } HASHELEMENT; // Define hash bucket and segment typedef HASHELEMENT *HASHBUCKET; typedef HASHBUCKET *HASHSEGMENT; // Define the structure for the hash header struct hash_header { // Placeholder for actual header contents }; // Define the HTAB structure struct HTAB { struct hash_header *hctl; /* => shared control information */ HASHSEGMENT *dir; /* directory of segment starts */ Size keysize; /* hash key length in bytes */ long ssize; /* segment size --- must be power of 2 */ int sshift; /* segment shift = log2(ssize) */ }; typedef struct HASHHDR HASHHDR; typedef unsigned char slock_t; typedef struct { slock_t mutex; /* spinlock for this freelist */ long nentries; /* number of entries in associated buckets */ HASHELEMENT *freeList; /* chain of free elements */ } FreeListData; struct HASHHDR { FreeListData freeList[NUM_FREELISTS]; long dsize; /* directory size */ long nsegs; /* number of allocated segments (<= dsize) */ uint32 max_bucket; /* ID of maximum bucket in use */ uint32 high_mask; /* mask to modulo into entire table */ uint32 low_mask; /* mask to modulo into lower half of table */ Size keysize; /* hash key length in bytes */ Size entrysize; /* total user element size in bytes */ long num_partitions; /* # partitions (must be power of 2), or 0 */ long max_dsize; /* 'dsize' limit if directory is fixed size */ long ssize; /* segment size --- must be power of 2 */ int sshift; /* segment shift = log2(ssize) */ int nelem_alloc; /* number of entries to allocate at once */ #ifdef HASH_STATISTICS long accesses; long collisions; #endif }; // Simulate error handling void hash_corrupted(struct HTAB *hashp) { fprintf(stderr, "Hash table corrupted!\n"); exit(EXIT_FAILURE); } static inline int pg_leftmost_one_pos32(uint32 word) { #ifdef HAVE__BUILTIN_CLZ return 31 - __builtin_clz(word); #elif defined(_MSC_VER) unsigned long result; bool non_zero; non_zero = _BitScanReverse(&result, word); return (int) result; #else int shift = 32 - 8; while ((word >> shift) == 0) shift -= 8; return shift + pg_leftmost_one_pos[(word >> shift) & 255]; #endif } static inline uint32 pg_ceil_log2_32(uint32 num) { if (num < 2) return 0; else return pg_leftmost_one_pos32(num - 1) + 1; } /* calculate ceil(log base 2) of num */ int my_log2(long num) { /* guard against too-large input, which would be invalid for pg_ceil_log2_*() */ if (num > LONG_MAX / 2) num = LONG_MAX / 2; #if SIZEOF_LONG < 8 return pg_ceil_log2_32(num); #else // return pg_ceil_log2_64(num); #endif } /* calculate first power of 2 >= num, bounded to what will fit in an int */ static int next_pow2_int(long num) { if (num > INT_MAX / 2) num = INT_MAX / 2; return 1 << my_log2(num); } /* Convert a hash value to a bucket number */ static inline uint32 calc_bucket(HASHHDR *hctl, uint32 hash_val) { uint32 bucket; bucket = hash_val & hctl->high_mask; if (bucket > hctl->max_bucket) bucket = bucket & hctl->low_mask; return bucket; } // Define the MOD macro #define MOD(x, y) ((x) & ((y) - 1)) // The function to be tested static inline uint32_t hash_initial_lookup(struct HTAB *hashp, uint32_t hashvalue, HASHBUCKET **bucketptr) { if (!hashp || !hashp->dir) { fprintf(stderr, "Hash table or directory is NULL!\n"); exit(EXIT_FAILURE); } struct hash_header *hctl = hashp->hctl; HASHSEGMENT segp; long segment_num; long segment_ndx; uint32_t bucket; bucket = calc_bucket(hctl, hashvalue); segment_num = bucket >> hashp->sshift; segment_ndx = MOD(bucket, hashp->ssize); if (segment_num >= hashp->ssize) { fprintf(stderr, "Segment number %ld out of bounds (%ld)!\n", segment_num, hashp->ssize); exit(EXIT_FAILURE); } segp = hashp->dir[segment_num]; if (!segp) { fprintf(stderr, "Hash segment %ld is NULL!\n", segment_num); exit(EXIT_FAILURE); } *bucketptr = &segp[segment_ndx]; return bucket; } // Initialize the hash table (simplified version) void init_htab(struct HTAB *hashp, int nelem) { int ssize; int sshift; int max_bucket; int high_mask; int low_mask; int nbuckets; HASHHDR *hctl; // Calculate segment size and shift ssize = next_pow2_int(nelem / 256); if (ssize < 1) ssize = 1; sshift = 8; // Allocate memory for hctl hctl = (HASHHDR *) malloc(sizeof(HASHHDR)); if (!hctl) { fprintf(stderr, "Memory allocation failed!\n"); exit(EXIT_FAILURE); } // Initialize hctl hctl->dsize = 1; hctl->nsegs = 1; hctl->max_bucket = 0; hctl->high_mask = 1; hctl->low_mask = 0; hctl->keysize = sizeof(int); // Example key size hctl->entrysize = sizeof(HASHELEMENT); hctl->num_partitions = 1; hctl->max_dsize = 1; hctl->ssize = ssize; hctl->sshift = sshift; hctl->nelem_alloc = nelem; nbuckets = next_pow2_int(nelem); // Allocate memory for directory hashp->dir = (HASHSEGMENT *) malloc(hctl->dsize * sizeof(HASHSEGMENT)); if (!hashp->dir) { fprintf(stderr, "Memory allocation failed!\n"); free(hctl); exit(EXIT_FAILURE); } // Allocate memory for first segment hashp->dir[0] = (HASHBUCKET *) calloc(ssize, sizeof(HASHBUCKET)); if (!hashp->dir[0]) { fprintf(stderr, "Memory allocation failed!\n"); free(hashp->dir); free(hctl); exit(EXIT_FAILURE); } // Initialize the hash table structure hashp->hctl = hctl; hashp->keysize = sizeof(int); hashp->ssize = ssize; hashp->sshift = sshift; } // Test the hash_initial_lookup function int main() { struct HTAB hash_table; struct HASHELEMENT element; uint32_t hash_value = 3926571702; HASHBUCKET *bucketptr; // Initialize the hash table with an example size init_htab(&hash_table, 1000); // Perform the hash lookup uint32_t bucket = hash_initial_lookup(&hash_table, hash_value, &bucketptr); // Output the result printf("Hash value: %u\n", hash_value); ASSERT(3926571702, hash_value); printf("Bucket: %u\n", bucket); printf("Bucket pointer: %p\n", (void *)bucketptr); // Cleanup allocated memory free(hash_table.dir[0]); free(hash_table.dir); free(hash_table.hctl); return 0; } chibicc-1.0.24/test/postgres_hash2.c000066400000000000000000000122221517770275000172520ustar00rootroot00000000000000#include #include #include #include #include #include "test.h" // Define types typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ typedef uint32_t Size; // Placeholder for actual size type // Array for leftmost one position const uint8 pg_leftmost_one_pos[256] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; // Define the HASHELEMENT structure typedef struct HASHELEMENT { struct HASHELEMENT *link; // link to next entry in same bucket uint32 hashvalue; // hash function result for this entry } HASHELEMENT; // Define hash bucket and segment typedef HASHELEMENT *HASHBUCKET; typedef HASHBUCKET *HASHSEGMENT; // Define the structure for the hash header struct hash_header { // Placeholder for actual header contents }; // Define the HTAB structure struct HTAB { struct hash_header *hctl; /* => shared control information */ HASHSEGMENT *dir; /* directory of segment starts */ Size keysize; /* hash key length in bytes */ long ssize; /* segment size --- must be power of 2 */ int sshift; /* segment shift = log2(ssize) */ }; // Function to get the position of the leftmost one bit static inline int pg_leftmost_one_pos32(uint32 word) { if (word == 0) return -1; int shift = 24; if (word & 0xFFFF0000) { word >>= 16; shift += 16; } if (word & 0x0000FF00) { word >>= 8; shift += 8; } return shift + pg_leftmost_one_pos[word]; } // Function to calculate the ceiling of the log base 2 static inline uint32 pg_ceil_log2_32(uint32 num) { if (num < 2) return 0; else return pg_leftmost_one_pos32(num - 1) + 1; } // Simulate bucket calculation uint32_t calc_bucket(struct hash_header *hctl, uint32_t hashvalue) { return hashvalue % 16; // Simple hash function for simulation } // Define the MOD macro #define MOD(x, y) ((x) & ((y) - 1)) // Simulate error handling void hash_corrupted(struct HTAB *hashp) { fprintf(stderr, "Hash table corrupted!\n"); exit(EXIT_FAILURE); } // The function to be tested static inline uint32_t hash_initial_lookup(struct HTAB *hashp, uint32_t hashvalue, HASHBUCKET **bucketptr) { if (!hashp || !hashp->dir) { fprintf(stderr, "Hash table or directory is NULL!\n"); exit(EXIT_FAILURE); } struct hash_header *hctl = hashp->hctl; HASHSEGMENT segp; long segment_num; long segment_ndx; uint32_t bucket; bucket = calc_bucket(hctl, hashvalue); segment_num = bucket >> hashp->sshift; segment_ndx = MOD(bucket, hashp->ssize); if (segment_num >= hashp->ssize) { fprintf(stderr, "Segment number %ld out of bounds (%ld)!\n", segment_num, hashp->ssize); hash_corrupted(hashp); } segp = hashp->dir[segment_num]; if (segp == NULL) { hash_corrupted(hashp); } *bucketptr = &segp[segment_ndx]; return bucket; } // Main function to test the `hash_initial_lookup` function int main() { struct HTAB hashp; struct hash_header hctl; HASHBUCKET buckets[4]; // Array to hold bucket pointers HASHSEGMENT segments[2]; // Array to hold segment pointers // Initialize example data hashp.hctl = &hctl; hashp.ssize = 4; // Segment size (must be power of 2) hashp.sshift = 8; // Segment shift (log2 of ssize) hashp.dir = segments; hashp.ssize = 2; // Number of segments // Initialize segments for (int i = 0; i < 4; ++i) { buckets[i] = (HASHELEMENT *)malloc(sizeof(HASHELEMENT)); if (buckets[i] == NULL) { fprintf(stderr, "Memory allocation failed!\n"); exit(EXIT_FAILURE); } buckets[i]->link = NULL; buckets[i]->hashvalue = i; // Example hash value } segments[0] = &buckets[0]; segments[1] = &buckets[2]; HASHBUCKET *bucketptr; uint32_t bucket = hash_initial_lookup(&hashp, 3926571702, &bucketptr); printf("Bucket: %u\n", bucket); ASSERT(6, bucket); if (bucketptr != NULL) { HASHELEMENT *elem = (HASHELEMENT *)*bucketptr; printf("Bucket pointer value: %u\n", elem->hashvalue); ASSERT(0, elem->hashvalue); } else { printf("Bucket pointer is NULL\n"); } // Free allocated memory for (int i = 0; i < 4; ++i) { free(buckets[i]); } return 0; } chibicc-1.0.24/test/postgres_issues.c000066400000000000000000000173641517770275000175740ustar00rootroot00000000000000#include #include #include #include #include #include typedef int64_t int64; typedef uint64_t uint64; typedef int32_t int32; typedef uint32_t uint32; // Define macros for delays and logging #define MIN_DELAY_USEC 1000 #define MAX_DELAY_USEC 1000000 #define NUM_DELAYS 10 #define SPINS_PER_DELAY 1000 #define PANIC 1 #define S_LOCK_TEST #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define PG_HAVE_ATOMIC_FLAG_SUPPORT typedef struct pg_atomic_flag { volatile char value; } pg_atomic_flag; #define PG_HAVE_ATOMIC_U32_SUPPORT typedef struct pg_atomic_uint32 { volatile uint32 value; } pg_atomic_uint32; #endif #ifdef __x86_64__ #define PG_HAVE_ATOMIC_U64_SUPPORT typedef struct pg_atomic_uint64 { /* alignment guaranteed due to being on a 64bit platform */ volatile uint64 value; } pg_atomic_uint64; #endif /* __x86_64__ */ #ifdef __x86_64__ /* AMD Opteron, Intel EM64T */ #define HAS_TEST_AND_SET typedef unsigned char slock_t; #define TAS(lock) tas(lock) /* * On Intel EM64T, it's a win to use a non-locking test before the xchg proper, * but only when spinning. * * See also Implementing Scalable Atomic Locks for Multi-Core Intel(tm) EM64T * and IA32, by Michael Chynoweth and Mary R. Lee. As of this writing, it is * available at: * http://software.intel.com/en-us/articles/implementing-scalable-atomic-locks-for-multi-core-intel-em64t-and-ia32-architectures */ #define TAS_SPIN(lock) (*(lock) ? 1 : TAS(lock)) static __inline__ int tas(volatile slock_t *lock) { slock_t _res = 1; __asm__ __volatile__( " lock \n" " xchgb %0,%1 \n" : "+q"(_res), "+m"(*lock) : /* no inputs */ : "memory", "cc"); return (int) _res; } #define SPIN_DELAY() spin_delay() static __inline__ void spin_delay(void) { /* * Adding a PAUSE in the spin delay loop is demonstrably a no-op on * Opteron, but it may be of some use on EM64T, so we keep it. */ __asm__ __volatile__( " rep; nop \n"); } #endif /* __x86_64__ */ #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define PG_HAVE_ATOMIC_TEST_SET_FLAG static inline bool pg_atomic_test_set_flag_impl(volatile pg_atomic_flag *ptr) { char _res = 1; __asm__ __volatile__( " lock \n" " xchgb %0,%1 \n" : "+q"(_res), "+m"(ptr->value) : : "memory"); return _res == 0; } #define PG_HAVE_ATOMIC_CLEAR_FLAG static inline void pg_atomic_clear_flag_impl(volatile pg_atomic_flag *ptr) { /* * On a TSO architecture like x86 it's sufficient to use a compiler * barrier to achieve release semantics. */ __asm__ __volatile__("" ::: "memory"); ptr->value = 0; } #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32 static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 *expected, uint32 newval) { char ret; /* * Perform cmpxchg and use the zero flag which it implicitly sets when * equal to measure the success. */ __asm__ __volatile__( " lock \n" " cmpxchgl %4,%5 \n" " setz %2 \n" : "=a" (*expected), "=m"(ptr->value), "=q" (ret) : "a" (*expected), "r" (newval), "m"(ptr->value) : "memory", "cc"); return (bool) ret; } #define PG_HAVE_ATOMIC_FETCH_ADD_U32 static inline uint32 pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int32 add_) { uint32 res; __asm__ __volatile__( " lock \n" " xaddl %0,%1 \n" : "=q"(res), "=m"(ptr->value) : "0" (add_), "m"(ptr->value) : "memory", "cc"); return res; } #ifdef __x86_64__ #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64 static inline bool pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 *expected, uint64 newval) { char ret; //AssertPointerAlignment(expected, 8); /* * Perform cmpxchg and use the zero flag which it implicitly sets when * equal to measure the success. */ __asm__ __volatile__( " lock \n" " cmpxchgq %4,%5 \n" " setz %2 \n" : "=a" (*expected), "=m"(ptr->value), "=q" (ret) : "a" (*expected), "r" (newval), "m"(ptr->value) : "memory", "cc"); return (bool) ret; } #define PG_HAVE_ATOMIC_FETCH_ADD_U64 static inline uint64 pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_) { uint64 res; __asm__ __volatile__( " lock \n" " xaddq %0,%1 \n" : "=q"(res), "=m"(ptr->value) : "0" (add_), "m"(ptr->value) : "memory", "cc"); return res; } #endif /* __x86_64__ */ #endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */ // Struct to hold spin delay status typedef struct { int spins; int delays; int cur_delay; const char *file; int line; const char *func; } SpinDelayStatus; void s_unlock(volatile slock_t *lock) { *lock = 0; } // Dummy functions for simulation void pg_usleep(int usec) { usleep(usec); } void pgstat_report_wait_start(int event) { printf("Wait event started: %d\n", event); } void pgstat_report_wait_end() { printf("Wait event ended\n"); } void elog(int level, const char *fmt, ...) { // Simplified logging function va_list args; va_start(args, fmt); fprintf(stderr, "LOG [%d]: ", level); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); va_end(args); } double pg_prng_double(void *state) { // Simple random number generator for delay increase return (double)rand() / RAND_MAX; } static void s_lock_stuck(const char *file, int line, const char *func) { if (!func) func = "(unknown)"; #if defined(S_LOCK_TEST) fprintf(stderr, "\nStuck spinlock detected at %s, %s:%d.\n", func, file, line); exit(1); #else elog(PANIC, "stuck spinlock detected at %s, %s:%d", func, file, line); #endif } // Initialize spin delay status static void init_spin_delay(SpinDelayStatus *status, const char *file, int line, const char *func) { status->spins = 0; status->delays = 0; status->cur_delay = 0; status->file = file; status->line = line; status->func = func; } // Finish spin delay static void finish_spin_delay(SpinDelayStatus *status) { // Placeholder for additional cleanup if needed } // Perform spin delay void perform_spin_delay(SpinDelayStatus *status) { // CPU-specific delay each time through the loop for (int i = 0; i < SPINS_PER_DELAY; i++) { // Simulate spinning } // Block the process every spins_per_delay tries if (++(status->spins) >= SPINS_PER_DELAY) { if (++(status->delays) > NUM_DELAYS) s_lock_stuck(status->file, status->line, status->func); if (status->cur_delay == 0) // first time to delay? status->cur_delay = MIN_DELAY_USEC; // Report wait event and sleep pgstat_report_wait_start(0); pg_usleep(status->cur_delay); pgstat_report_wait_end(); // Increase delay by a random fraction between 1X and 2X status->cur_delay += (int)(status->cur_delay * pg_prng_double(NULL) + 0.5); // Wrap back to minimum delay when max is exceeded if (status->cur_delay > MAX_DELAY_USEC) status->cur_delay = MIN_DELAY_USEC; status->spins = 0; } } // Platform-independent portion of waiting for a spinlock int s_lock(volatile slock_t *lock, const char *file, int line, const char *func) { SpinDelayStatus delayStatus; init_spin_delay(&delayStatus, file, line, func); while (TAS_SPIN(lock)) { perform_spin_delay(&delayStatus); } finish_spin_delay(&delayStatus); return delayStatus.delays; } #ifdef USE_DEFAULT_S_UNLOCK void s_unlock(volatile slock_t *lock) { *lock = 0; // Release lock } #endif // Main function to test the spinlock functions int main() { slock_t lock = 0; SpinDelayStatus status = {0, 0, 0, __FILE__, __LINE__, __func__}; // Simulate acquiring and releasing the spinlock s_lock(&lock, __FILE__, __LINE__, __func__); printf("Lock acquired\n"); s_unlock(&lock); printf("Lock released\n"); return 0; } chibicc-1.0.24/test/postgres_log.c000066400000000000000000000044751517770275000170410ustar00rootroot00000000000000#include #include #include #include #include "test.h" const uint8_t pg_leftmost_one_pos[256] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; static inline int pg_leftmost_one_pos64(uint64_t word) { int shift = 64 - 8; while ((word >> shift) == 0) shift -= 8; return shift + pg_leftmost_one_pos[(word >> shift) & 255]; } static inline int pg_ceil_log2_64(uint64_t num) { if (num < 2) return 0; else return pg_leftmost_one_pos64(num - 1) + 1; } static int my_log2(long num) { if (num > LONG_MAX / 2) num = LONG_MAX / 2; #if SIZEOF_LONG < 8 return 2; #else return pg_ceil_log2_64(num); #endif } static int next_pow2_int(long num) { if (num > INT_MAX / 2) num = INT_MAX / 2; int log2 = my_log2(num); printf("pg_ceil_log2_64=%d\n", log2); return 1 << log2; } int main() { long test_values[] = {1, 2, 3, 536870912, LONG_MAX}; for (int i = 0; i < sizeof(test_values) / sizeof(test_values[0]); ++i) { printf("Input: %ld, next_pow2_int: %d\n", test_values[i], next_pow2_int(test_values[i])); if (i == 0) ASSERT(1, next_pow2_int(test_values[i]) ); else if (i == 1) ASSERT(2, next_pow2_int(test_values[i]) ); else if (i == 2) ASSERT(4, next_pow2_int(test_values[i]) ); else if (i == 3) ASSERT(536870912, next_pow2_int(test_values[i]) ); else if (i == 4) ASSERT(1073741824, next_pow2_int(test_values[i]) ); } return 0; } chibicc-1.0.24/test/postgres_log2.c000066400000000000000000000060161517770275000171140ustar00rootroot00000000000000#include #include #include #include #include "test.h" typedef uint32_t uint32; #define SIZEOF_LONG 8 const uint8_t pg_leftmost_one_pos[256] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; static inline int pg_leftmost_one_pos32(uint32 word) { #ifdef HAVE__BUILTIN_CLZ return 31 - __builtin_clz(word); #elif defined(_MSC_VER) unsigned long result; bool non_zero; non_zero = _BitScanReverse(&result, word); return (int) result; #else int shift = 32 - 8; while ((word >> shift) == 0) shift -= 8; return shift + pg_leftmost_one_pos[(word >> shift) & 255]; #endif /* HAVE__BUILTIN_CLZ */ } static inline uint32 pg_ceil_log2_32(uint32 num) { if (num < 2) return 0; else return pg_leftmost_one_pos32(num - 1) + 1; } static inline int pg_leftmost_one_pos64(uint64_t word) { int shift = 64 - 8; while ((word >> shift) == 0) { shift -= 8; } int pos = shift + pg_leftmost_one_pos[(word >> shift) & 255]; printf("======%u\n", pos); return pos; } static inline int pg_ceil_log2_64(uint64_t num) { if (num < 2) return 0; else return pg_leftmost_one_pos64(num - 1) + 1; } static int my_log2(long num) { if (num > LONG_MAX / 2) num = LONG_MAX / 2; #if SIZEOF_LONG < 8 return pg_ceil_log2_32(num); #else return pg_ceil_log2_64(num); #endif } static int next_pow2_int(long num) { if (num > INT_MAX / 2) num = INT_MAX / 2; int log2 = my_log2(num); return 1 << log2; } int main() { long test_values[] = {1, 2, 3, 536870912, LONG_MAX}; printf("Size of long: %zu SIZEOF_LONG: %zu \n", sizeof(long), SIZEOF_LONG); for (int i = 0; i < sizeof(test_values) / sizeof(test_values[0]); ++i) { printf("Input: %ld, next_pow2_int: %d\n", test_values[i], next_pow2_int(test_values[i])); if (i == 0) ASSERT(1, next_pow2_int(test_values[i]) ); else if (i == 1) ASSERT(2, next_pow2_int(test_values[i]) ); else if (i == 2) ASSERT(4, next_pow2_int(test_values[i]) ); else if (i == 3) ASSERT(536870912, next_pow2_int(test_values[i]) ); else if (i == 4) ASSERT(1073741824, next_pow2_int(test_values[i]) ); } return 0; } chibicc-1.0.24/test/postgres_prockill_pid_layout_repro.c000066400000000000000000000030071517770275000235250ustar00rootroot00000000000000// Reproducer for a PostgreSQL-like "pid field reads wrong value" failure mode. // // This focuses on struct member layout drift: if member offsets diverge from // the ABI layout, reading `pid` from shared memory can fetch unrelated data. #include #include #include #include struct ProcLike { int head; int pgprocno __attribute__((aligned(64))); int pid; int tail; }; int main(void) { size_t off_pgprocno = offsetof(struct ProcLike, pgprocno); size_t off_pid = offsetof(struct ProcLike, pid); printf("offsetof(pgprocno)=%zu\n", off_pgprocno); printf("offsetof(pid)=%zu\n", off_pid); printf("sizeof(ProcLike)=%zu align=%zu\n", sizeof(struct ProcLike), _Alignof(struct ProcLike)); // GCC x86_64 SysV layout for this shape: // pgprocno @ 64, pid @ 68 // Chibicc currently computes pid @ 128 on this tree. if (off_pgprocno != 64 || off_pid != 68) { printf("LAYOUT_MISMATCH: expected pgprocno=64 pid=68\n"); } _Alignas(64) unsigned char raw[256] = {0}; *(int *)(raw + 64) = 25; // e.g. slot index / pgprocno *(int *)(raw + 68) = (int)getpid(); // expected pid location in ABI layout struct ProcLike *p = (struct ProcLike *)raw; printf("raw[64]=%d raw[68]=%d\n", *(int *)(raw + 64), *(int *)(raw + 68)); printf("p->pgprocno=%d p->pid=%d getpid()=%d\n", p->pgprocno, p->pid, (int)getpid()); if (p->pid != (int)getpid()) { printf("REPRODUCED: pid field read does not match getpid()\n"); return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/postgres_prockill_suspects.c000066400000000000000000000054011517770275000220160ustar00rootroot00000000000000#include "test.h" #include #include #include #include #include typedef unsigned long Datum; typedef void (*pg_on_exit_callback)(int code, Datum arg); struct on_proc_exit_item { pg_on_exit_callback function; Datum arg; }; static struct on_proc_exit_item on_proc_exit_list[16]; static int on_proc_exit_count; static pid_t MyProcPid; static volatile int ProcKillCalls; static volatile int GuardWordA; static volatile int GuardWordB; static void reset_state(void) { on_proc_exit_count = 0; ProcKillCalls = 0; MyProcPid = getpid(); GuardWordA = 0x13579BDF; GuardWordB = 0x2468ACE0; } static void on_proc_exit(pg_on_exit_callback function, Datum arg) { on_proc_exit_list[on_proc_exit_count].function = function; on_proc_exit_list[on_proc_exit_count].arg = arg; on_proc_exit_count++; } static void shmem_exit(int code) { for (int i = on_proc_exit_count - 1; i >= 0; i--) on_proc_exit_list[i].function(code, on_proc_exit_list[i].arg); } static void ProcKill(int code, Datum arg) { (void)code; (void)arg; ProcKillCalls++; if (getpid() != MyProcPid) { /* Mirrors PostgreSQL PANIC path: ProcKill in child should abort. */ abort(); } } static void GuardCallback(int code, Datum arg) { (void)code; ASSERT(0xAAAA5555, (int)arg); ASSERT(0x13579BDF, (int)GuardWordA); ASSERT(0x2468ACE0, (int)GuardWordB); } static void test_child_running_proc_exit_panics(void) { reset_state(); on_proc_exit(ProcKill, 0); pid_t pid = fork(); if (pid == 0) { shmem_exit(0); _exit(0); } int status = 0; waitpid(pid, &status, 0); ASSERT(1, WIFSIGNALED(status)); ASSERT(SIGABRT, WTERMSIG(status)); } static void test_child_using__exit_avoids_panic(void) { reset_state(); on_proc_exit(ProcKill, 0); pid_t pid = fork(); if (pid == 0) _exit(0); int status = 0; waitpid(pid, &status, 0); ASSERT(1, WIFEXITED(status)); ASSERT(0, WEXITSTATUS(status)); } static void test_callback_integrity_in_parent(void) { reset_state(); on_proc_exit(ProcKill, 0); on_proc_exit(GuardCallback, 0xAAAA5555UL); shmem_exit(0); ASSERT(1, (int)ProcKillCalls); ASSERT(0x13579BDF, (int)GuardWordA); ASSERT(0x2468ACE0, (int)GuardWordB); } static void test_child_bounded_loop_finishes(void) { pid_t pid = fork(); if (pid == 0) { volatile int x = 0; for (int i = 0; i < 2000000; i++) x += (i & 1); if (x == 1000000) _exit(0); _exit(2); } int status = 0; waitpid(pid, &status, 0); ASSERT(1, WIFEXITED(status)); ASSERT(0, WEXITSTATUS(status)); } int main(void) { test_child_running_proc_exit_panics(); test_child_using__exit_avoids_panic(); test_callback_integrity_in_parent(); test_child_bounded_loop_finishes(); printf("OK\n"); return 0; } chibicc-1.0.24/test/postgres_realloc.c000066400000000000000000000035471517770275000177000ustar00rootroot00000000000000#include "test.h" #include typedef unsigned long Datum; typedef void (*pg_on_exit_callback) (int code, Datum arg); struct on_proc_exit_list_element { pg_on_exit_callback function; Datum arg; }; static struct on_proc_exit_list_element *on_proc_exit_list; static int on_proc_exit_index; static int on_proc_exit_size; void on_proc_exit(pg_on_exit_callback function, Datum arg) { if (on_proc_exit_index >= on_proc_exit_size) { on_proc_exit_size = on_proc_exit_size ? on_proc_exit_size * 2 : 10; on_proc_exit_list = realloc(on_proc_exit_list, on_proc_exit_size * sizeof(struct on_proc_exit_list_element)); } on_proc_exit_list[on_proc_exit_index].function = function; on_proc_exit_list[on_proc_exit_index].arg = arg; on_proc_exit_index++; } void proc_exit_prepare(int code) { int i; for (i = on_proc_exit_index - 1; i >= 0; i--) on_proc_exit_list[i].function(code, on_proc_exit_list[i].arg); } static void my_callback(int code, Datum arg) { ASSERT(0, code); // We can't easily assert arg here as it changes, but we verify it in main } int main() { // Force multiple reallocs to stress test memory management and pointer updates for (int i = 0; i < 100; i++) { on_proc_exit(my_callback, (Datum)i); } // Verify the list content to ensure no corruption occurred during realloc for (int i = 0; i < 100; i++) { if (on_proc_exit_list[i].function != my_callback) { printf("Function pointer mismatch at index %d\n", i); exit(1); } if (on_proc_exit_list[i].arg != (Datum)i) { printf("Arg mismatch at index %d: expected %d, got %ld\n", i, i, on_proc_exit_list[i].arg); exit(1); } } proc_exit_prepare(0); printf("OK\n"); return 0; } chibicc-1.0.24/test/postgres_static.c000066400000000000000000000060351517770275000175410ustar00rootroot00000000000000#include #include #ifndef __cplusplus #ifdef HAVE__STATIC_ASSERT #define StaticAssertDecl(condition, errmessage) \ _Static_assert(condition, errmessage) #define StaticAssertStmt(condition, errmessage) \ do { _Static_assert(condition, errmessage); } while(0) #define StaticAssertExpr(condition, errmessage) \ ((void) ({ StaticAssertStmt(condition, errmessage); true; })) #else /* !HAVE__STATIC_ASSERT */ #define StaticAssertDecl(condition, errmessage) \ extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1]) #define StaticAssertStmt(condition, errmessage) \ ((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; })) #define StaticAssertExpr(condition, errmessage) \ StaticAssertStmt(condition, errmessage) #endif /* HAVE__STATIC_ASSERT */ #else /* C++ */ #if defined(__cpp_static_assert) && __cpp_static_assert >= 200410 #define StaticAssertDecl(condition, errmessage) \ static_assert(condition, errmessage) #define StaticAssertStmt(condition, errmessage) \ static_assert(condition, errmessage) #define StaticAssertExpr(condition, errmessage) \ ({ static_assert(condition, errmessage); }) #else /* !__cpp_static_assert */ #define StaticAssertDecl(condition, errmessage) \ extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1]) #define StaticAssertStmt(condition, errmessage) \ do { struct static_assert_struct { int static_assert_failure : (condition) ? 1 : -1; }; } while(0) #define StaticAssertExpr(condition, errmessage) \ ((void) ({ StaticAssertStmt(condition, errmessage); })) #endif /* __cpp_static_assert */ #endif /* C++ */ // Simulate the StaticAssertExpr macro (usually provided by PostgreSQL or a similar project) //#define StaticAssertExpr(condition, message) _Static_assert(condition, message) // Forward declaration of the AllocSetContextCreateInternal function void* AllocSetContextCreateInternal(void* parent, const char* name, int size); #ifdef HAVE__BUILTIN_CONSTANT_P #define AllocSetContextCreate(parent, name, ...) \ (StaticAssertExpr(__builtin_constant_p(name), \ "memory context names must be constant strings"), \ AllocSetContextCreateInternal(parent, name, __VA_ARGS__)) #else #define AllocSetContextCreate \ AllocSetContextCreateInternal #endif // Implementation of AllocSetContextCreateInternal function void* AllocSetContextCreateInternal(void* parent, const char* name, int size) { printf("Context created: name = %s, size = %d\n", name, size); return NULL; } int main(void) { // Define some parent context (NULL in this example) void* parent_context = NULL; // Use the macro with a constant string name AllocSetContextCreate(parent_context, "MyConstantContext", 1024); // Use the macro with a non-constant name (will trigger a static assertion if HAVE__BUILTIN_CONSTANT_P is defined) const char* non_constant_name = "MyDynamicContext"; // AllocSetContextCreate(parent_context, non_constant_name, 2048); // Uncommenting this will cause a compile-time error return 0; } chibicc-1.0.24/test/postgres_struct_func1.c000066400000000000000000000010131517770275000206610ustar00rootroot00000000000000 #include #include "test.h" struct MyStruct { void (*myFunc)(void *, const void *, size_t); }; // Initialize the struct with memcpy assigned to the function pointer struct MyStruct myStruct = { .myFunc = memcpy }; int main() { // Use the function pointer char src[20] = "Hello, World!"; char dest[20]; myStruct.myFunc(dest, src, strlen(src) + 1); printf("Copied string: %s\n", dest); // Should print: "Copied string: Hello, World!" ASSERT(13, strlen(dest)); return 0; } chibicc-1.0.24/test/postgres_struct_func2.c000066400000000000000000000010131517770275000206620ustar00rootroot00000000000000 #include #include "test.h" struct MyStruct { void (*myFunc)(void *, const void *, size_t); }; // Initialize the struct with memcpy assigned to the function pointer struct MyStruct myStruct = { .myFunc = memcpy }; int main() { // Use the function pointer char src[20] = "Hello, World!"; char dest[20]; myStruct.myFunc(dest, src, strlen(src) + 1); printf("Copied string: %s\n", dest); // Should print: "Copied string: Hello, World!" ASSERT(13, strlen(dest)); return 0; } chibicc-1.0.24/test/postgres_struct_func3.c000066400000000000000000000032471517770275000206760ustar00rootroot00000000000000 #include #include "test.h" // Define the functions with the required signatures void pgstat_archiver_init_shmem_cb(void *stats) { printf("Archiver init_shmem_cb called with %p\n", stats); ASSERT(0x1234, stats); } // Define a struct with two function pointers struct MyStruct { void (*copy_func)(void *dest, const void *src, size_t n); // Function like memcpy void (*init_shmem_cb)(void *stats); // Function for initializing shared memory }; // Initialize a static const array of MyStruct with two elements static const struct MyStruct myArray[2] = { [0] = { .copy_func = memcpy, // Only initialize the first function // init_shmem_cb is not initialized }, [1] = { // copy_func is not initialized .init_shmem_cb = pgstat_archiver_init_shmem_cb, // Only initialize the second function } }; int main() { char src[] = "Hello, world!"; char dest[50]; void *dummyStats = (void *)0x1234; // Some dummy stats pointer // Loop through the array and call the appropriate function for (int i = 0; i < 2; i++) { if (myArray[i].copy_func) { // Call the first function if it's initialized myArray[i].copy_func(dest, src, sizeof(src)); printf("Array element %d - Copy result: %s\n", i + 1, dest); } else if (myArray[i].init_shmem_cb) { // Call the second function if it's initialized myArray[i].init_shmem_cb(dummyStats); printf("Array element %d - Called init_shmem_cb\n", i + 1); } else { printf("Array element %d - No function initialized\n", i + 1); } } return 0; } chibicc-1.0.24/test/postgres_struct_init.c000066400000000000000000000013571517770275000206230ustar00rootroot00000000000000#include "test.h" typedef enum NodeTag { T_TableAmRoutine = 400 } NodeTag; typedef struct Node { NodeTag type; } Node; typedef struct TableAmRoutine { NodeTag type; } TableAmRoutine; #define nodeTag(nodeptr) (((const Node*)(nodeptr))->type) #define IsA(nodeptr, _type_) (nodeTag(nodeptr) == T_##_type_) static const TableAmRoutine heapam_methods = { .type = T_TableAmRoutine, }; const TableAmRoutine *GetTableAmRoutine(void) { return &heapam_methods; } int main() { const TableAmRoutine *routine = GetTableAmRoutine(); if (!IsA(routine, TableAmRoutine)) { printf("FATAL: table access method handler 3 did not return a TableAmRoutine struct\n"); exit(1); } printf("OK\n"); return 0; }chibicc-1.0.24/test/pragma-once.c000077500000000000000000000001551517770275000165150ustar00rootroot00000000000000#include "test.h" #pragma once #include "test/pragma-once.c" int main() { printf("OK\n"); return 0; } chibicc-1.0.24/test/pragma_pack.c000066400000000000000000000037131517770275000165710ustar00rootroot00000000000000#include "test.h" // Simple offset helper that works in constant expressions. #define OFFSETOF(T, M) ((unsigned long)&(((T *)0)->M)) struct DefaultLayout { char c; int x; }; #pragma pack(push, 1) struct Pack1 { char c; int x; short y; }; // Regression shape from csmith seed 27522. struct S0Packed { const int f0; unsigned short f1; unsigned int f2; short f3; volatile unsigned char f4; signed char f5; }; union U2Packed { unsigned long long f0; struct S0Packed f4; }; #pragma pack(pop) #pragma pack(push, 1) struct NestPack1 { char c; int x; }; #pragma pack(push, 2) struct NestPack2 { char c; int x; short y; }; #pragma pack(pop) struct NestBackToPack1 { char c; int x; }; #pragma pack(pop) struct BackToDefault { char c; int x; }; static union U2Packed g_u2 = {.f0 = 0x1B57FCB2553E1D3EULL}; int main(void) { SASSERT(sizeof(int) == 4); SASSERT(sizeof(short) == 2); SASSERT(sizeof(unsigned int) == 4); ASSERT(8, sizeof(struct DefaultLayout)); ASSERT(4, _Alignof(struct DefaultLayout)); ASSERT(4, OFFSETOF(struct DefaultLayout, x)); ASSERT(7, sizeof(struct Pack1)); ASSERT(1, _Alignof(struct Pack1)); ASSERT(1, OFFSETOF(struct Pack1, x)); ASSERT(5, OFFSETOF(struct Pack1, y)); ASSERT(14, sizeof(struct S0Packed)); ASSERT(1, _Alignof(struct S0Packed)); ASSERT(6, OFFSETOF(struct S0Packed, f2)); ASSERT(6999, g_u2.f4.f2); ASSERT(5, sizeof(struct NestPack1)); ASSERT(1, _Alignof(struct NestPack1)); ASSERT(1, OFFSETOF(struct NestPack1, x)); ASSERT(8, sizeof(struct NestPack2)); ASSERT(2, _Alignof(struct NestPack2)); ASSERT(2, OFFSETOF(struct NestPack2, x)); ASSERT(6, OFFSETOF(struct NestPack2, y)); ASSERT(5, sizeof(struct NestBackToPack1)); ASSERT(1, _Alignof(struct NestBackToPack1)); ASSERT(1, OFFSETOF(struct NestBackToPack1, x)); ASSERT(8, sizeof(struct BackToDefault)); ASSERT(4, _Alignof(struct BackToDefault)); ASSERT(4, OFFSETOF(struct BackToDefault, x)); return 0; } chibicc-1.0.24/test/pragma_pack2.c000066400000000000000000000046511517770275000166550ustar00rootroot00000000000000 #include "test.h" int main(void) { #define CHK(_ALIGN) \ { struct S { char c; float f; }; SASSERT((_ALIGN + 4) == sizeof(struct S)); SASSERT((_ALIGN < 4 ? _ALIGN : 4) == _Alignof(struct S)); } #pragma pack(push) CHK(4) #pragma pack(pop) CHK(4) #pragma pack(2) CHK(2) #define PACK(_x) _Pragma("pack(push)") _Pragma("pack(1)") _x _Pragma("pack (pop)") { PACK( struct S { char c; float f; }; ) SASSERT(5 == sizeof(struct S)); SASSERT(1 == _Alignof(struct S)); } CHK(2) #pragma pack(push) CHK(2) #pragma pack() CHK(4) #pragma pack(1) CHK(1) #pragma pack(8) CHK(4) #pragma pack(pop) CHK(2) #pragma pack(push, 1) CHK(1) #pragma pack(pop) CHK(2) #pragma pack(0) { struct S { char a : 5, b : 5, c : 5; }; SASSERT(sizeof(struct S) == 3); SASSERT(_Alignof(struct S) == 1); } #pragma pack(1) { struct S { char a : 5, b : 5, c : 5; }; SASSERT(sizeof(struct S) == 2); SASSERT(_Alignof(struct S) == 1); } #pragma pack(2) { struct S { char a : 5, b : 5, c : 5; }; SASSERT(sizeof(struct S) == 2); SASSERT(_Alignof(struct S) == 1); } #pragma pack(0) { struct S { short a : 10, b : 10, c : 10; }; SASSERT(sizeof(struct S) == 6); SASSERT(_Alignof(struct S) == 2); } #pragma pack(1) { struct S { short a : 10, b : 10, c : 10; }; SASSERT(sizeof(struct S) == 4); SASSERT(_Alignof(struct S) == 1); } #pragma pack(2) { struct S { short a : 10, b : 10, c : 10; }; SASSERT(sizeof(struct S) == 4); SASSERT(_Alignof(struct S) == 2); } #pragma pack(4) { struct S { short a : 10, b : 10, c : 10; }; SASSERT(sizeof(struct S) == 4); SASSERT(_Alignof(struct S) == 2); } #pragma pack(0) { struct S { int a : 21, b : 21, c : 21; }; SASSERT(sizeof(struct S) == 12); SASSERT(_Alignof(struct S) == 4); } #pragma pack(1) { struct S { int a : 21, b : 21, c : 21; }; SASSERT(sizeof(struct S) == 8); SASSERT(_Alignof(struct S) == 1); } #pragma pack(2) { struct S { int a : 21, b : 21, c : 21; }; SASSERT(sizeof(struct S) == 8); SASSERT(_Alignof(struct S) == 2); } #pragma pack(4) { struct S { int a : 21, b : 21, c : 21; }; SASSERT(sizeof(struct S) == 8); SASSERT(_Alignof(struct S) == 4); } #pragma pack(8) { struct S { int a : 21, b : 21, c : 21; }; SASSERT(sizeof(struct S) == 8); SASSERT(_Alignof(struct S) == 4); } #if defined(__slimcc__) || defined(_MSC_VER) #pragma pack(1) struct S { char a; _Alignas(1024) char b; }; static_assert(2048 == sizeof(struct S)); #endif printf("OK\n"); return 0; } chibicc-1.0.24/test/promote.c000066400000000000000000000026461517770275000160150ustar00rootroot00000000000000#include #include #include // Your storebuffer function as provided static int storebuffer(int output, FILE *data) { char **buffer = (char **)data; unsigned char outc = (unsigned char)output; **buffer = outc; (*buffer)++; return outc; // act like fputc() } // Dummy dprintf_formatf replacement for testing (just calls vsnprintf internally) int dprintf_formatf(char **buffer_ptr, int (*output_func)(int, FILE *), const char *fmt, va_list ap) { // We'll just format into a temp buffer, then call output_func per char: char tmp[1024]; int len = vsnprintf(tmp, sizeof(tmp), fmt, ap); if (len < 0) return len; for (int i = 0; i < len; i++) { output_func(tmp[i], (FILE *)buffer_ptr); } return len; } int curl_msprintf(char *buffer, const char *format, ...) { va_list ap_save; int retcode; va_start(ap_save, format); retcode = dprintf_formatf(&buffer, storebuffer, format, ap_save); va_end(ap_save); *buffer = 0; // Null-terminate the string return retcode; } int main(void) { char buf[256]; unsigned short val = 65535; int len = curl_msprintf(buf, "Value: %hu", val); printf("Formatted length: %d\n", len); printf("Formatted string: '%s'\n", buf); if (len > 0 && strcmp(buf, "Value: 65535") == 0) { printf("Test passed!\n"); } else { printf("Test failed!\n"); } return 0; } chibicc-1.0.24/test/protocol_binary.h000066400000000000000000000402151517770275000175340ustar00rootroot00000000000000/* * Copyright (c) <2008>, Sun Microsystems, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 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. * * Neither the name of the nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY SUN MICROSYSTEMS, INC. ``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 SUN MICROSYSTEMS, INC. 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. */ /* * Summary: Constants used by to implement the binary protocol. * * Copy: See Copyright for the status of this software. * * Author: Trond Norbye */ #ifndef PROTOCOL_BINARY_H #define PROTOCOL_BINARY_H /** * This file contains definitions of the constants and packet formats * defined in the binary specification. Please note that you _MUST_ remember * to convert each multibyte field to / from network byte order to / from * host order. */ #ifdef __cplusplus extern "C" { #endif /** * Definition of the legal "magic" values used in a packet. * See section 3.1 Magic byte */ typedef enum { PROTOCOL_BINARY_REQ = 0x80, PROTOCOL_BINARY_RES = 0x81 } protocol_binary_magic; /** * Definition of the valid response status numbers. * See section 3.2 Response Status */ typedef enum { PROTOCOL_BINARY_RESPONSE_SUCCESS = 0x00, PROTOCOL_BINARY_RESPONSE_KEY_ENOENT = 0x01, PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS = 0x02, PROTOCOL_BINARY_RESPONSE_E2BIG = 0x03, PROTOCOL_BINARY_RESPONSE_EINVAL = 0x04, PROTOCOL_BINARY_RESPONSE_NOT_STORED = 0x05, PROTOCOL_BINARY_RESPONSE_DELTA_BADVAL = 0x06, PROTOCOL_BINARY_RESPONSE_AUTH_ERROR = 0x20, PROTOCOL_BINARY_RESPONSE_AUTH_CONTINUE = 0x21, PROTOCOL_BINARY_RESPONSE_UNKNOWN_COMMAND = 0x81, PROTOCOL_BINARY_RESPONSE_ENOMEM = 0x82 } protocol_binary_response_status; /** * Definition of the different command opcodes. * See section 3.3 Command Opcodes */ typedef enum { PROTOCOL_BINARY_CMD_GET = 0x00, PROTOCOL_BINARY_CMD_SET = 0x01, PROTOCOL_BINARY_CMD_ADD = 0x02, PROTOCOL_BINARY_CMD_REPLACE = 0x03, PROTOCOL_BINARY_CMD_DELETE = 0x04, PROTOCOL_BINARY_CMD_INCREMENT = 0x05, PROTOCOL_BINARY_CMD_DECREMENT = 0x06, PROTOCOL_BINARY_CMD_QUIT = 0x07, PROTOCOL_BINARY_CMD_FLUSH = 0x08, PROTOCOL_BINARY_CMD_GETQ = 0x09, PROTOCOL_BINARY_CMD_NOOP = 0x0a, PROTOCOL_BINARY_CMD_VERSION = 0x0b, PROTOCOL_BINARY_CMD_GETK = 0x0c, PROTOCOL_BINARY_CMD_GETKQ = 0x0d, PROTOCOL_BINARY_CMD_APPEND = 0x0e, PROTOCOL_BINARY_CMD_PREPEND = 0x0f, PROTOCOL_BINARY_CMD_STAT = 0x10, PROTOCOL_BINARY_CMD_SETQ = 0x11, PROTOCOL_BINARY_CMD_ADDQ = 0x12, PROTOCOL_BINARY_CMD_REPLACEQ = 0x13, PROTOCOL_BINARY_CMD_DELETEQ = 0x14, PROTOCOL_BINARY_CMD_INCREMENTQ = 0x15, PROTOCOL_BINARY_CMD_DECREMENTQ = 0x16, PROTOCOL_BINARY_CMD_QUITQ = 0x17, PROTOCOL_BINARY_CMD_FLUSHQ = 0x18, PROTOCOL_BINARY_CMD_APPENDQ = 0x19, PROTOCOL_BINARY_CMD_PREPENDQ = 0x1a, PROTOCOL_BINARY_CMD_TOUCH = 0x1c, PROTOCOL_BINARY_CMD_GAT = 0x1d, PROTOCOL_BINARY_CMD_GATQ = 0x1e, PROTOCOL_BINARY_CMD_GATK = 0x23, PROTOCOL_BINARY_CMD_GATKQ = 0x24, PROTOCOL_BINARY_CMD_SASL_LIST_MECHS = 0x20, PROTOCOL_BINARY_CMD_SASL_AUTH = 0x21, PROTOCOL_BINARY_CMD_SASL_STEP = 0x22, /* These commands are used for range operations and exist within * this header for use in other projects. Range operations are * not expected to be implemented in the memcached server itself. */ PROTOCOL_BINARY_CMD_RGET = 0x30, PROTOCOL_BINARY_CMD_RSET = 0x31, PROTOCOL_BINARY_CMD_RSETQ = 0x32, PROTOCOL_BINARY_CMD_RAPPEND = 0x33, PROTOCOL_BINARY_CMD_RAPPENDQ = 0x34, PROTOCOL_BINARY_CMD_RPREPEND = 0x35, PROTOCOL_BINARY_CMD_RPREPENDQ = 0x36, PROTOCOL_BINARY_CMD_RDELETE = 0x37, PROTOCOL_BINARY_CMD_RDELETEQ = 0x38, PROTOCOL_BINARY_CMD_RINCR = 0x39, PROTOCOL_BINARY_CMD_RINCRQ = 0x3a, PROTOCOL_BINARY_CMD_RDECR = 0x3b, PROTOCOL_BINARY_CMD_RDECRQ = 0x3c /* End Range operations */ } protocol_binary_command; /** * Definition of the data types in the packet * See section 3.4 Data Types */ typedef enum { PROTOCOL_BINARY_RAW_BYTES = 0x00 } protocol_binary_datatypes; /** * Definition of the header structure for a request packet. * See section 2 */ typedef union { struct { uint8_t magic; uint8_t opcode; uint16_t keylen; uint8_t extlen; uint8_t datatype; uint16_t reserved; uint32_t bodylen; uint32_t opaque; uint64_t cas; } request; uint8_t bytes[24]; } protocol_binary_request_header; /** * Definition of the header structure for a response packet. * See section 2 */ typedef union { struct { uint8_t magic; uint8_t opcode; uint16_t keylen; uint8_t extlen; uint8_t datatype; uint16_t status; uint32_t bodylen; uint32_t opaque; uint64_t cas; } response; uint8_t bytes[24]; } protocol_binary_response_header; /** * Definition of a request-packet containing no extras */ typedef union { struct { protocol_binary_request_header header; } message; uint8_t bytes[sizeof(protocol_binary_request_header)]; } protocol_binary_request_no_extras; /** * Definition of a response-packet containing no extras */ typedef union { struct { protocol_binary_response_header header; } message; uint8_t bytes[sizeof(protocol_binary_response_header)]; } protocol_binary_response_no_extras; /** * Definition of the packet used by the get, getq, getk and getkq command. * See section 4 */ typedef protocol_binary_request_no_extras protocol_binary_request_get; typedef protocol_binary_request_no_extras protocol_binary_request_getq; typedef protocol_binary_request_no_extras protocol_binary_request_getk; typedef protocol_binary_request_no_extras protocol_binary_request_getkq; /** * Definition of the packet returned from a successful get, getq, getk and * getkq. * See section 4 */ typedef union { struct { protocol_binary_response_header header; struct { uint32_t flags; } body; } message; uint8_t bytes[sizeof(protocol_binary_response_header) + 4]; } protocol_binary_response_get; typedef protocol_binary_response_get protocol_binary_response_getq; typedef protocol_binary_response_get protocol_binary_response_getk; typedef protocol_binary_response_get protocol_binary_response_getkq; /** * Definition of the packet used by the delete command * See section 4 */ typedef protocol_binary_request_no_extras protocol_binary_request_delete; /** * Definition of the packet returned by the delete command * See section 4 */ typedef protocol_binary_response_no_extras protocol_binary_response_delete; /** * Definition of the packet used by the flush command * See section 4 * Please note that the expiration field is optional, so remember to see * check the header.bodysize to see if it is present. */ typedef union { struct { protocol_binary_request_header header; struct { uint32_t expiration; } body; } message; uint8_t bytes[sizeof(protocol_binary_request_header) + 4]; } protocol_binary_request_flush; /** * Definition of the packet returned by the flush command * See section 4 */ typedef protocol_binary_response_no_extras protocol_binary_response_flush; /** * Definition of the packet used by set, add and replace * See section 4 */ typedef union { struct { protocol_binary_request_header header; struct { uint32_t flags; uint32_t expiration; } body; } message; uint8_t bytes[sizeof(protocol_binary_request_header) + 8]; } protocol_binary_request_set; typedef protocol_binary_request_set protocol_binary_request_add; typedef protocol_binary_request_set protocol_binary_request_replace; /** * Definition of the packet returned by set, add and replace * See section 4 */ typedef protocol_binary_response_no_extras protocol_binary_response_set; typedef protocol_binary_response_no_extras protocol_binary_response_add; typedef protocol_binary_response_no_extras protocol_binary_response_replace; /** * Definition of the noop packet * See section 4 */ typedef protocol_binary_request_no_extras protocol_binary_request_noop; /** * Definition of the packet returned by the noop command * See section 4 */ typedef protocol_binary_response_no_extras protocol_binary_response_noop; /** * Definition of the structure used by the increment and decrement * command. * See section 4 */ typedef union { struct { protocol_binary_request_header header; struct { uint64_t delta; uint64_t initial; uint32_t expiration; } body; } message; uint8_t bytes[sizeof(protocol_binary_request_header) + 20]; } protocol_binary_request_incr; typedef protocol_binary_request_incr protocol_binary_request_decr; /** * Definition of the response from an incr or decr command * command. * See section 4 */ typedef union { struct { protocol_binary_response_header header; struct { uint64_t value; } body; } message; uint8_t bytes[sizeof(protocol_binary_response_header) + 8]; } protocol_binary_response_incr; typedef protocol_binary_response_incr protocol_binary_response_decr; /** * Definition of the quit * See section 4 */ typedef protocol_binary_request_no_extras protocol_binary_request_quit; /** * Definition of the packet returned by the quit command * See section 4 */ typedef protocol_binary_response_no_extras protocol_binary_response_quit; /** * Definition of the packet used by append and prepend command * See section 4 */ typedef protocol_binary_request_no_extras protocol_binary_request_append; typedef protocol_binary_request_no_extras protocol_binary_request_prepend; /** * Definition of the packet returned from a successful append or prepend * See section 4 */ typedef protocol_binary_response_no_extras protocol_binary_response_append; typedef protocol_binary_response_no_extras protocol_binary_response_prepend; /** * Definition of the packet used by the version command * See section 4 */ typedef protocol_binary_request_no_extras protocol_binary_request_version; /** * Definition of the packet returned from a successful version command * See section 4 */ typedef protocol_binary_response_no_extras protocol_binary_response_version; /** * Definition of the packet used by the stats command. * See section 4 */ typedef protocol_binary_request_no_extras protocol_binary_request_stats; /** * Definition of the packet returned from a successful stats command * See section 4 */ typedef protocol_binary_response_no_extras protocol_binary_response_stats; /** * Definition of the packet used by the touch command. */ typedef union { struct { protocol_binary_request_header header; struct { uint32_t expiration; } body; } message; uint8_t bytes[sizeof(protocol_binary_request_header) + 4]; } protocol_binary_request_touch; /** * Definition of the packet returned from the touch command */ typedef protocol_binary_response_no_extras protocol_binary_response_touch; /** * Definition of the packet used by the GAT(Q) command. */ typedef union { struct { protocol_binary_request_header header; struct { uint32_t expiration; } body; } message; uint8_t bytes[sizeof(protocol_binary_request_header) + 4]; } protocol_binary_request_gat; typedef protocol_binary_request_gat protocol_binary_request_gatq; typedef protocol_binary_request_gat protocol_binary_request_gatk; typedef protocol_binary_request_gat protocol_binary_request_gatkq; /** * Definition of the packet returned from the GAT(Q) */ typedef protocol_binary_response_get protocol_binary_response_gat; typedef protocol_binary_response_get protocol_binary_response_gatq; typedef protocol_binary_response_get protocol_binary_response_gatk; typedef protocol_binary_response_get protocol_binary_response_gatkq; /** * Definition of a request for a range operation. * See http://code.google.com/p/memcached/wiki/RangeOps * * These types are used for range operations and exist within * this header for use in other projects. Range operations are * not expected to be implemented in the memcached server itself. */ typedef union { struct { protocol_binary_response_header header; struct { uint16_t size; uint8_t reserved; uint8_t flags; uint32_t max_results; } body; } message; uint8_t bytes[sizeof(protocol_binary_request_header) + 4]; } protocol_binary_request_rangeop; typedef protocol_binary_request_rangeop protocol_binary_request_rget; typedef protocol_binary_request_rangeop protocol_binary_request_rset; typedef protocol_binary_request_rangeop protocol_binary_request_rsetq; typedef protocol_binary_request_rangeop protocol_binary_request_rappend; typedef protocol_binary_request_rangeop protocol_binary_request_rappendq; typedef protocol_binary_request_rangeop protocol_binary_request_rprepend; typedef protocol_binary_request_rangeop protocol_binary_request_rprependq; typedef protocol_binary_request_rangeop protocol_binary_request_rdelete; typedef protocol_binary_request_rangeop protocol_binary_request_rdeleteq; typedef protocol_binary_request_rangeop protocol_binary_request_rincr; typedef protocol_binary_request_rangeop protocol_binary_request_rincrq; typedef protocol_binary_request_rangeop protocol_binary_request_rdecr; typedef protocol_binary_request_rangeop protocol_binary_request_rdecrq; #ifdef __cplusplus } #endif #endif /* PROTOCOL_BINARY_H */ chibicc-1.0.24/test/pthread_cond_shutdown.c000066400000000000000000000033711517770275000207110ustar00rootroot00000000000000#include "test.h" #include #include typedef struct { pthread_mutex_t lock; pthread_cond_t cond; int stop; int pending; int processed; int wakeups; } logger_state_t; static void *logger_thread(void *arg) { logger_state_t *s = arg; pthread_mutex_lock(&s->lock); for (;;) { while (s->pending == 0 && !s->stop) { s->wakeups++; pthread_cond_wait(&s->cond, &s->lock); } if (s->stop && s->pending == 0) break; if (s->pending > 0) { s->pending--; s->processed++; } } pthread_mutex_unlock(&s->lock); return 0; } int main(void) { logger_state_t s; pthread_t tid; int rc; int jobs = 20000; s.stop = 0; s.pending = 0; s.processed = 0; s.wakeups = 0; rc = pthread_mutex_init(&s.lock, 0); ASSERT(0, rc); rc = pthread_cond_init(&s.cond, 0); ASSERT(0, rc); rc = pthread_create(&tid, 0, logger_thread, &s); ASSERT(0, rc); // Generate a lot of wakeups/work to stress mutex+cond codegen paths. for (int i = 0; i < jobs; i++) { pthread_mutex_lock(&s.lock); s.pending++; pthread_cond_signal(&s.cond); pthread_mutex_unlock(&s.lock); } // Wait until all jobs are consumed. for (;;) { int done; pthread_mutex_lock(&s.lock); done = (s.processed == jobs); pthread_mutex_unlock(&s.lock); if (done) break; sched_yield(); } // Memcached-like shutdown: set stop flag under lock, signal, then join. pthread_mutex_lock(&s.lock); s.stop = 1; pthread_cond_signal(&s.cond); pthread_mutex_unlock(&s.lock); rc = pthread_join(tid, 0); ASSERT(0, rc); ASSERT(jobs, s.processed); ASSERT(0, s.pending); ASSERT(1, s.wakeups > 0); pthread_cond_destroy(&s.cond); pthread_mutex_destroy(&s.lock); return 0; } chibicc-1.0.24/test/python1.c000066400000000000000000000005401517770275000157210ustar00rootroot00000000000000// noinline_stack_init.c #include #include __attribute__((noinline)) uintptr_t f(int cond) { uintptr_t p; if (cond) { p = 0x12345678; } return p; } int main(void) { uintptr_t v = f(1); if (v != 0x12345678) { puts("BUG: uninitialized or clobbered"); return 1; } return 0; } chibicc-1.0.24/test/qualified_struct_conditional.c000066400000000000000000000015731517770275000222600ustar00rootroot00000000000000#include "test.h" typedef struct { int a; } S; int main() { S s = {1}; const S cs = {2}; volatile S vs = {3}; const volatile S cvs = {4}; // Check types of conditional expressions using __builtin_types_compatible_p // 1 ? s : s -> S ASSERT(1, __builtin_types_compatible_p(typeof(1 ? s : s), S)); // 1 ? s : cs -> const S ASSERT(1, __builtin_types_compatible_p(typeof(1 ? s : cs), const S)); // 1 ? cs : s -> const S ASSERT(1, __builtin_types_compatible_p(typeof(1 ? cs : s), const S)); // 1 ? s : vs -> volatile S ASSERT(1, __builtin_types_compatible_p(typeof(1 ? s : vs), volatile S)); // 1 ? cs : vs -> const volatile S ASSERT(1, __builtin_types_compatible_p(typeof(1 ? cs : vs), const volatile S)); // Check values are preserved S res; res = 1 ? s : cs; ASSERT(1, res.a); res = 0 ? s : cs; ASSERT(2, res.a); printf("OK\n"); return 0; }chibicc-1.0.24/test/qualifiers.c000066400000000000000000000044261517770275000164720ustar00rootroot00000000000000#include "test.h" void cv_qualified_member(int i) { const int a1[4]; SASSERT(__builtin_types_compatible_p(typeof(&(*a1)), const int*)); SASSERT(!__builtin_types_compatible_p(typeof(&(*a1)), int*)); SASSERT(__builtin_types_compatible_p(typeof(&a1[0]), const int*)); SASSERT(!__builtin_types_compatible_p(typeof(&a1[0]), int*)); volatile int vla[i]; SASSERT(__builtin_types_compatible_p(typeof(&(*vla)), volatile int*)); SASSERT(!__builtin_types_compatible_p(typeof(&(*vla)), int*)); SASSERT(__builtin_types_compatible_p(typeof(&vla[0]), volatile int*)); SASSERT(!__builtin_types_compatible_p(typeof(&vla[0]), int*)); struct S1 { int i; }; struct S2 { int const i; }; struct S3 { const struct S1 s1; }; struct S4 { struct S1 s[4]; }; struct S1 const s1; SASSERT(__builtin_types_compatible_p(typeof(&s1.i), const int*)); SASSERT(!__builtin_types_compatible_p(typeof(&s1.i), int*)); struct S1 *p1; SASSERT(__builtin_types_compatible_p(typeof(&p1->i), int*)); SASSERT(!__builtin_types_compatible_p(typeof(&p1->i), int const*)); struct S1 const* p1c; SASSERT(!__builtin_types_compatible_p(typeof(&p1c->i), int*)); SASSERT(__builtin_types_compatible_p(typeof(&p1c->i), int const*)); struct S2 *p2; SASSERT(!__builtin_types_compatible_p(typeof(&p2->i), int*)); SASSERT(__builtin_types_compatible_p(typeof(&p2->i), int const*)); struct S3 *p3; SASSERT(!__builtin_types_compatible_p(typeof(&p3->s1.i), int*)); SASSERT(__builtin_types_compatible_p(typeof(&p3->s1.i), int const*)); struct S4 const *p4; SASSERT(!__builtin_types_compatible_p(typeof(&p4->s[3].i), int*)); SASSERT(__builtin_types_compatible_p(typeof(&p4->s[3].i), int const*)); SASSERT(!__builtin_types_compatible_p(typeof(&p4->s->i), int*)); SASSERT(__builtin_types_compatible_p(typeof(&p4->s->i), int const*)); SASSERT(!__builtin_types_compatible_p(typeof(&(*p4->s).i), int*)); SASSERT(__builtin_types_compatible_p(typeof(&(*p4->s).i), int const*)); } struct B { int i; }; typedef struct { struct B b1; struct B b2; } A; int regress1(const A* a, int i) { return (((i) ? &((a)->b1) : &((a)->b2)))->i; } int main(int argc, char** argv) { ASSERT(17, regress1(&(A){31,17}, 0)); ASSERT(31, regress1(&(A){31,17}, 1)); printf("OK\n"); return 0; } chibicc-1.0.24/test/queue.h000066400000000000000000000713131517770275000154560ustar00rootroot00000000000000// grabbed from https://raw.githubusercontent.com/freebsd/freebsd-src/master/sys/sys/queue.h // on jan 17th, 2021. /*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1991, 1993 * The Regents of the University of California. 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. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. * * @(#)queue.h 8.5 (Berkeley) 8/20/94 * $FreeBSD$ */ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ /* * This file defines four types of data structures: singly-linked lists, * singly-linked tail queues, lists and tail queues. * * A singly-linked list is headed by a single forward pointer. The elements * are singly linked for minimum space and pointer manipulation overhead at * the expense of O(n) removal for arbitrary elements. New elements can be * added to the list after an existing element or at the head of the list. * Elements being removed from the head of the list should use the explicit * macro for this purpose for optimum efficiency. A singly-linked list may * only be traversed in the forward direction. Singly-linked lists are ideal * for applications with large datasets and few or no removals or for * implementing a LIFO queue. * * A singly-linked tail queue is headed by a pair of pointers, one to the * head of the list and the other to the tail of the list. The elements are * singly linked for minimum space and pointer manipulation overhead at the * expense of O(n) removal for arbitrary elements. New elements can be added * to the list after an existing element, at the head of the list, or at the * end of the list. Elements being removed from the head of the tail queue * should use the explicit macro for this purpose for optimum efficiency. * A singly-linked tail queue may only be traversed in the forward direction. * Singly-linked tail queues are ideal for applications with large datasets * and few or no removals or for implementing a FIFO queue. * * A list is headed by a single forward pointer (or an array of forward * pointers for a hash table header). The elements are doubly linked * so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before * or after an existing element or at the head of the list. A list * may be traversed in either direction. * * A tail queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or * after an existing element, at the head of the list, or at the end of * the list. A tail queue may be traversed in either direction. * * For details on the use of these macros, see the queue(3) manual page. * * Below is a summary of implemented functions where: * + means the macro is available * - means the macro is not available * s means the macro is available but is slow (runs in O(n) time) * * SLIST LIST STAILQ TAILQ * _HEAD + + + + * _CLASS_HEAD + + + + * _HEAD_INITIALIZER + + + + * _ENTRY + + + + * _CLASS_ENTRY + + + + * _INIT + + + + * _EMPTY + + + + * _FIRST + + + + * _NEXT + + + + * _PREV - + - + * _LAST - - + + * _LAST_FAST - - - + * _FOREACH + + + + * _FOREACH_FROM + + + + * _FOREACH_SAFE + + + + * _FOREACH_FROM_SAFE + + + + * _FOREACH_REVERSE - - - + * _FOREACH_REVERSE_FROM - - - + * _FOREACH_REVERSE_SAFE - - - + * _FOREACH_REVERSE_FROM_SAFE - - - + * _INSERT_HEAD + + + + * _INSERT_BEFORE - + - + * _INSERT_AFTER + + + + * _INSERT_TAIL - - + + * _CONCAT s s + + * _REMOVE_AFTER + - + - * _REMOVE_HEAD + - + - * _REMOVE s + s + * _SWAP + + + + * */ #ifdef QUEUE_MACRO_DEBUG #warn Use QUEUE_MACRO_DEBUG_TRACE and/or QUEUE_MACRO_DEBUG_TRASH #define QUEUE_MACRO_DEBUG_TRACE #define QUEUE_MACRO_DEBUG_TRASH #endif #ifdef QUEUE_MACRO_DEBUG_TRACE /* Store the last 2 places the queue element or head was altered */ struct qm_trace { unsigned long lastline; unsigned long prevline; const char *lastfile; const char *prevfile; }; #define TRACEBUF struct qm_trace trace; #define TRACEBUF_INITIALIZER { __LINE__, 0, __FILE__, NULL } , #define QMD_TRACE_HEAD(head) do { \ (head)->trace.prevline = (head)->trace.lastline; \ (head)->trace.prevfile = (head)->trace.lastfile; \ (head)->trace.lastline = __LINE__; \ (head)->trace.lastfile = __FILE__; \ } while (0) #define QMD_TRACE_ELEM(elem) do { \ (elem)->trace.prevline = (elem)->trace.lastline; \ (elem)->trace.prevfile = (elem)->trace.lastfile; \ (elem)->trace.lastline = __LINE__; \ (elem)->trace.lastfile = __FILE__; \ } while (0) #else /* !QUEUE_MACRO_DEBUG_TRACE */ #define QMD_TRACE_ELEM(elem) #define QMD_TRACE_HEAD(head) #define TRACEBUF #define TRACEBUF_INITIALIZER #endif /* QUEUE_MACRO_DEBUG_TRACE */ #ifdef QUEUE_MACRO_DEBUG_TRASH #define QMD_SAVELINK(name, link) void **name = (void *)&(link) #define TRASHIT(x) do {(x) = (void *)-1;} while (0) #define QMD_IS_TRASHED(x) ((x) == (void *)(intptr_t)-1) #else /* !QUEUE_MACRO_DEBUG_TRASH */ #define QMD_SAVELINK(name, link) #define TRASHIT(x) #define QMD_IS_TRASHED(x) 0 #endif /* QUEUE_MACRO_DEBUG_TRASH */ #ifdef __cplusplus /* * In C++ there can be structure lists and class lists: */ #define QUEUE_TYPEOF(type) type #else #define QUEUE_TYPEOF(type) struct type #endif /* * Singly-linked List declarations. */ #define SLIST_HEAD(name, type) \ struct name { \ struct type *slh_first; /* first element */ \ } #define SLIST_CLASS_HEAD(name, type) \ struct name { \ class type *slh_first; /* first element */ \ } #define SLIST_HEAD_INITIALIZER(head) \ { NULL } #define SLIST_ENTRY(type) \ struct { \ struct type *sle_next; /* next element */ \ } #define SLIST_CLASS_ENTRY(type) \ struct { \ class type *sle_next; /* next element */ \ } /* * Singly-linked List functions. */ #if (defined(_KERNEL) && defined(INVARIANTS)) #define QMD_SLIST_CHECK_PREVPTR(prevp, elm) do { \ if (*(prevp) != (elm)) \ panic("Bad prevptr *(%p) == %p != %p", \ (prevp), *(prevp), (elm)); \ } while (0) #else #define QMD_SLIST_CHECK_PREVPTR(prevp, elm) #endif #define SLIST_CONCAT(head1, head2, type, field) do { \ QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head1); \ if (curelm == NULL) { \ if ((SLIST_FIRST(head1) = SLIST_FIRST(head2)) != NULL) \ SLIST_INIT(head2); \ } else if (SLIST_FIRST(head2) != NULL) { \ while (SLIST_NEXT(curelm, field) != NULL) \ curelm = SLIST_NEXT(curelm, field); \ SLIST_NEXT(curelm, field) = SLIST_FIRST(head2); \ SLIST_INIT(head2); \ } \ } while (0) #define SLIST_EMPTY(head) ((head)->slh_first == NULL) #define SLIST_FIRST(head) ((head)->slh_first) #define SLIST_FOREACH(var, head, field) \ for ((var) = SLIST_FIRST((head)); \ (var); \ (var) = SLIST_NEXT((var), field)) #define SLIST_FOREACH_FROM(var, head, field) \ for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \ (var); \ (var) = SLIST_NEXT((var), field)) #define SLIST_FOREACH_SAFE(var, head, field, tvar) \ for ((var) = SLIST_FIRST((head)); \ (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ (var) = (tvar)) #define SLIST_FOREACH_FROM_SAFE(var, head, field, tvar) \ for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \ (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ (var) = (tvar)) #define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ for ((varp) = &SLIST_FIRST((head)); \ ((var) = *(varp)) != NULL; \ (varp) = &SLIST_NEXT((var), field)) #define SLIST_INIT(head) do { \ SLIST_FIRST((head)) = NULL; \ } while (0) #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ SLIST_NEXT((slistelm), field) = (elm); \ } while (0) #define SLIST_INSERT_HEAD(head, elm, field) do { \ SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ SLIST_FIRST((head)) = (elm); \ } while (0) #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) #define SLIST_REMOVE(head, elm, type, field) do { \ QMD_SAVELINK(oldnext, (elm)->field.sle_next); \ if (SLIST_FIRST((head)) == (elm)) { \ SLIST_REMOVE_HEAD((head), field); \ } \ else { \ QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head); \ while (SLIST_NEXT(curelm, field) != (elm)) \ curelm = SLIST_NEXT(curelm, field); \ SLIST_REMOVE_AFTER(curelm, field); \ } \ TRASHIT(*oldnext); \ } while (0) #define SLIST_REMOVE_AFTER(elm, field) do { \ SLIST_NEXT(elm, field) = \ SLIST_NEXT(SLIST_NEXT(elm, field), field); \ } while (0) #define SLIST_REMOVE_HEAD(head, field) do { \ SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ } while (0) #define SLIST_REMOVE_PREVPTR(prevp, elm, field) do { \ QMD_SLIST_CHECK_PREVPTR(prevp, elm); \ *(prevp) = SLIST_NEXT(elm, field); \ TRASHIT((elm)->field.sle_next); \ } while (0) #define SLIST_SWAP(head1, head2, type) do { \ QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1); \ SLIST_FIRST(head1) = SLIST_FIRST(head2); \ SLIST_FIRST(head2) = swap_first; \ } while (0) /* * Singly-linked Tail queue declarations. */ #define STAILQ_HEAD(name, type) \ struct name { \ struct type *stqh_first;/* first element */ \ struct type **stqh_last;/* addr of last next element */ \ } #define STAILQ_CLASS_HEAD(name, type) \ struct name { \ class type *stqh_first; /* first element */ \ class type **stqh_last; /* addr of last next element */ \ } #define STAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).stqh_first } #define STAILQ_ENTRY(type) \ struct { \ struct type *stqe_next; /* next element */ \ } #define STAILQ_CLASS_ENTRY(type) \ struct { \ class type *stqe_next; /* next element */ \ } /* * Singly-linked Tail queue functions. */ #define STAILQ_CONCAT(head1, head2) do { \ if (!STAILQ_EMPTY((head2))) { \ *(head1)->stqh_last = (head2)->stqh_first; \ (head1)->stqh_last = (head2)->stqh_last; \ STAILQ_INIT((head2)); \ } \ } while (0) #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) #define STAILQ_FIRST(head) ((head)->stqh_first) #define STAILQ_FOREACH(var, head, field) \ for((var) = STAILQ_FIRST((head)); \ (var); \ (var) = STAILQ_NEXT((var), field)) #define STAILQ_FOREACH_FROM(var, head, field) \ for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \ (var); \ (var) = STAILQ_NEXT((var), field)) #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ for ((var) = STAILQ_FIRST((head)); \ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ (var) = (tvar)) #define STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \ for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ (var) = (tvar)) #define STAILQ_INIT(head) do { \ STAILQ_FIRST((head)) = NULL; \ (head)->stqh_last = &STAILQ_FIRST((head)); \ } while (0) #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ STAILQ_NEXT((tqelm), field) = (elm); \ } while (0) #define STAILQ_INSERT_HEAD(head, elm, field) do { \ if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ STAILQ_FIRST((head)) = (elm); \ } while (0) #define STAILQ_INSERT_TAIL(head, elm, field) do { \ STAILQ_NEXT((elm), field) = NULL; \ *(head)->stqh_last = (elm); \ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ } while (0) #define STAILQ_LAST(head, type, field) \ (STAILQ_EMPTY((head)) ? NULL : \ __containerof((head)->stqh_last, \ QUEUE_TYPEOF(type), field.stqe_next)) #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) #define STAILQ_REMOVE(head, elm, type, field) do { \ QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \ if (STAILQ_FIRST((head)) == (elm)) { \ STAILQ_REMOVE_HEAD((head), field); \ } \ else { \ QUEUE_TYPEOF(type) *curelm = STAILQ_FIRST(head); \ while (STAILQ_NEXT(curelm, field) != (elm)) \ curelm = STAILQ_NEXT(curelm, field); \ STAILQ_REMOVE_AFTER(head, curelm, field); \ } \ TRASHIT(*oldnext); \ } while (0) #define STAILQ_REMOVE_AFTER(head, elm, field) do { \ if ((STAILQ_NEXT(elm, field) = \ STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ } while (0) #define STAILQ_REMOVE_HEAD(head, field) do { \ if ((STAILQ_FIRST((head)) = \ STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ (head)->stqh_last = &STAILQ_FIRST((head)); \ } while (0) #define STAILQ_SWAP(head1, head2, type) do { \ QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1); \ QUEUE_TYPEOF(type) **swap_last = (head1)->stqh_last; \ STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ (head1)->stqh_last = (head2)->stqh_last; \ STAILQ_FIRST(head2) = swap_first; \ (head2)->stqh_last = swap_last; \ if (STAILQ_EMPTY(head1)) \ (head1)->stqh_last = &STAILQ_FIRST(head1); \ if (STAILQ_EMPTY(head2)) \ (head2)->stqh_last = &STAILQ_FIRST(head2); \ } while (0) /* * List declarations. */ #define LIST_HEAD(name, type) \ struct name { \ struct type *lh_first; /* first element */ \ } #define LIST_CLASS_HEAD(name, type) \ struct name { \ class type *lh_first; /* first element */ \ } #define LIST_HEAD_INITIALIZER(head) \ { NULL } #define LIST_ENTRY(type) \ struct { \ struct type *le_next; /* next element */ \ struct type **le_prev; /* address of previous next element */ \ } #define LIST_CLASS_ENTRY(type) \ struct { \ class type *le_next; /* next element */ \ class type **le_prev; /* address of previous next element */ \ } /* * List functions. */ #if (defined(_KERNEL) && defined(INVARIANTS)) /* * QMD_LIST_CHECK_HEAD(LIST_HEAD *head, LIST_ENTRY NAME) * * If the list is non-empty, validates that the first element of the list * points back at 'head.' */ #define QMD_LIST_CHECK_HEAD(head, field) do { \ if (LIST_FIRST((head)) != NULL && \ LIST_FIRST((head))->field.le_prev != \ &LIST_FIRST((head))) \ panic("Bad list head %p first->prev != head", (head)); \ } while (0) /* * QMD_LIST_CHECK_NEXT(TYPE *elm, LIST_ENTRY NAME) * * If an element follows 'elm' in the list, validates that the next element * points back at 'elm.' */ #define QMD_LIST_CHECK_NEXT(elm, field) do { \ if (LIST_NEXT((elm), field) != NULL && \ LIST_NEXT((elm), field)->field.le_prev != \ &((elm)->field.le_next)) \ panic("Bad link elm %p next->prev != elm", (elm)); \ } while (0) /* * QMD_LIST_CHECK_PREV(TYPE *elm, LIST_ENTRY NAME) * * Validates that the previous element (or head of the list) points to 'elm.' */ #define QMD_LIST_CHECK_PREV(elm, field) do { \ if (*(elm)->field.le_prev != (elm)) \ panic("Bad link elm %p prev->next != elm", (elm)); \ } while (0) #else #define QMD_LIST_CHECK_HEAD(head, field) #define QMD_LIST_CHECK_NEXT(elm, field) #define QMD_LIST_CHECK_PREV(elm, field) #endif /* (_KERNEL && INVARIANTS) */ #define LIST_CONCAT(head1, head2, type, field) do { \ QUEUE_TYPEOF(type) *curelm = LIST_FIRST(head1); \ if (curelm == NULL) { \ if ((LIST_FIRST(head1) = LIST_FIRST(head2)) != NULL) { \ LIST_FIRST(head2)->field.le_prev = \ &LIST_FIRST((head1)); \ LIST_INIT(head2); \ } \ } else if (LIST_FIRST(head2) != NULL) { \ while (LIST_NEXT(curelm, field) != NULL) \ curelm = LIST_NEXT(curelm, field); \ LIST_NEXT(curelm, field) = LIST_FIRST(head2); \ LIST_FIRST(head2)->field.le_prev = &LIST_NEXT(curelm, field); \ LIST_INIT(head2); \ } \ } while (0) #define LIST_EMPTY(head) ((head)->lh_first == NULL) #define LIST_FIRST(head) ((head)->lh_first) #define LIST_FOREACH(var, head, field) \ for ((var) = LIST_FIRST((head)); \ (var); \ (var) = LIST_NEXT((var), field)) #define LIST_FOREACH_FROM(var, head, field) \ for ((var) = ((var) ? (var) : LIST_FIRST((head))); \ (var); \ (var) = LIST_NEXT((var), field)) #define LIST_FOREACH_SAFE(var, head, field, tvar) \ for ((var) = LIST_FIRST((head)); \ (var) && ((tvar) = LIST_NEXT((var), field), 1); \ (var) = (tvar)) #define LIST_FOREACH_FROM_SAFE(var, head, field, tvar) \ for ((var) = ((var) ? (var) : LIST_FIRST((head))); \ (var) && ((tvar) = LIST_NEXT((var), field), 1); \ (var) = (tvar)) #define LIST_INIT(head) do { \ LIST_FIRST((head)) = NULL; \ } while (0) #define LIST_INSERT_AFTER(listelm, elm, field) do { \ QMD_LIST_CHECK_NEXT(listelm, field); \ if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ LIST_NEXT((listelm), field)->field.le_prev = \ &LIST_NEXT((elm), field); \ LIST_NEXT((listelm), field) = (elm); \ (elm)->field.le_prev = &LIST_NEXT((listelm), field); \ } while (0) #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ QMD_LIST_CHECK_PREV(listelm, field); \ (elm)->field.le_prev = (listelm)->field.le_prev; \ LIST_NEXT((elm), field) = (listelm); \ *(listelm)->field.le_prev = (elm); \ (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ } while (0) #define LIST_INSERT_HEAD(head, elm, field) do { \ QMD_LIST_CHECK_HEAD((head), field); \ if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ LIST_FIRST((head)) = (elm); \ (elm)->field.le_prev = &LIST_FIRST((head)); \ } while (0) #define LIST_NEXT(elm, field) ((elm)->field.le_next) #define LIST_PREV(elm, head, type, field) \ ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ __containerof((elm)->field.le_prev, \ QUEUE_TYPEOF(type), field.le_next)) #define LIST_REMOVE(elm, field) do { \ QMD_SAVELINK(oldnext, (elm)->field.le_next); \ QMD_SAVELINK(oldprev, (elm)->field.le_prev); \ QMD_LIST_CHECK_NEXT(elm, field); \ QMD_LIST_CHECK_PREV(elm, field); \ if (LIST_NEXT((elm), field) != NULL) \ LIST_NEXT((elm), field)->field.le_prev = \ (elm)->field.le_prev; \ *(elm)->field.le_prev = LIST_NEXT((elm), field); \ TRASHIT(*oldnext); \ TRASHIT(*oldprev); \ } while (0) #define LIST_SWAP(head1, head2, type, field) do { \ QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \ LIST_FIRST((head1)) = LIST_FIRST((head2)); \ LIST_FIRST((head2)) = swap_tmp; \ if ((swap_tmp = LIST_FIRST((head1))) != NULL) \ swap_tmp->field.le_prev = &LIST_FIRST((head1)); \ if ((swap_tmp = LIST_FIRST((head2))) != NULL) \ swap_tmp->field.le_prev = &LIST_FIRST((head2)); \ } while (0) /* * Tail queue declarations. */ #define TAILQ_HEAD(name, type) \ struct name { \ struct type *tqh_first; /* first element */ \ struct type **tqh_last; /* addr of last next element */ \ TRACEBUF \ } #define TAILQ_CLASS_HEAD(name, type) \ struct name { \ class type *tqh_first; /* first element */ \ class type **tqh_last; /* addr of last next element */ \ TRACEBUF \ } #define TAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER } #define TAILQ_ENTRY(type) \ struct { \ struct type *tqe_next; /* next element */ \ struct type **tqe_prev; /* address of previous next element */ \ TRACEBUF \ } #define TAILQ_CLASS_ENTRY(type) \ struct { \ class type *tqe_next; /* next element */ \ class type **tqe_prev; /* address of previous next element */ \ TRACEBUF \ } /* * Tail queue functions. */ #if (defined(_KERNEL) && defined(INVARIANTS)) /* * QMD_TAILQ_CHECK_HEAD(TAILQ_HEAD *head, TAILQ_ENTRY NAME) * * If the tailq is non-empty, validates that the first element of the tailq * points back at 'head.' */ #define QMD_TAILQ_CHECK_HEAD(head, field) do { \ if (!TAILQ_EMPTY(head) && \ TAILQ_FIRST((head))->field.tqe_prev != \ &TAILQ_FIRST((head))) \ panic("Bad tailq head %p first->prev != head", (head)); \ } while (0) /* * QMD_TAILQ_CHECK_TAIL(TAILQ_HEAD *head, TAILQ_ENTRY NAME) * * Validates that the tail of the tailq is a pointer to pointer to NULL. */ #define QMD_TAILQ_CHECK_TAIL(head, field) do { \ if (*(head)->tqh_last != NULL) \ panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); \ } while (0) /* * QMD_TAILQ_CHECK_NEXT(TYPE *elm, TAILQ_ENTRY NAME) * * If an element follows 'elm' in the tailq, validates that the next element * points back at 'elm.' */ #define QMD_TAILQ_CHECK_NEXT(elm, field) do { \ if (TAILQ_NEXT((elm), field) != NULL && \ TAILQ_NEXT((elm), field)->field.tqe_prev != \ &((elm)->field.tqe_next)) \ panic("Bad link elm %p next->prev != elm", (elm)); \ } while (0) /* * QMD_TAILQ_CHECK_PREV(TYPE *elm, TAILQ_ENTRY NAME) * * Validates that the previous element (or head of the tailq) points to 'elm.' */ #define QMD_TAILQ_CHECK_PREV(elm, field) do { \ if (*(elm)->field.tqe_prev != (elm)) \ panic("Bad link elm %p prev->next != elm", (elm)); \ } while (0) #else #define QMD_TAILQ_CHECK_HEAD(head, field) #define QMD_TAILQ_CHECK_TAIL(head, headname) #define QMD_TAILQ_CHECK_NEXT(elm, field) #define QMD_TAILQ_CHECK_PREV(elm, field) #endif /* (_KERNEL && INVARIANTS) */ #define TAILQ_CONCAT(head1, head2, field) do { \ if (!TAILQ_EMPTY(head2)) { \ *(head1)->tqh_last = (head2)->tqh_first; \ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ (head1)->tqh_last = (head2)->tqh_last; \ TAILQ_INIT((head2)); \ QMD_TRACE_HEAD(head1); \ QMD_TRACE_HEAD(head2); \ } \ } while (0) #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_FOREACH(var, head, field) \ for ((var) = TAILQ_FIRST((head)); \ (var); \ (var) = TAILQ_NEXT((var), field)) #define TAILQ_FOREACH_FROM(var, head, field) \ for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \ (var); \ (var) = TAILQ_NEXT((var), field)) #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ for ((var) = TAILQ_FIRST((head)); \ (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ (var) = (tvar)) #define TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \ for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \ (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ (var) = (tvar)) #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ for ((var) = TAILQ_LAST((head), headname); \ (var); \ (var) = TAILQ_PREV((var), headname, field)) #define TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field) \ for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \ (var); \ (var) = TAILQ_PREV((var), headname, field)) #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ for ((var) = TAILQ_LAST((head), headname); \ (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ (var) = (tvar)) #define TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar) \ for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \ (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ (var) = (tvar)) #define TAILQ_INIT(head) do { \ TAILQ_FIRST((head)) = NULL; \ (head)->tqh_last = &TAILQ_FIRST((head)); \ QMD_TRACE_HEAD(head); \ } while (0) #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ QMD_TAILQ_CHECK_NEXT(listelm, field); \ if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ TAILQ_NEXT((elm), field)->field.tqe_prev = \ &TAILQ_NEXT((elm), field); \ else { \ (head)->tqh_last = &TAILQ_NEXT((elm), field); \ QMD_TRACE_HEAD(head); \ } \ TAILQ_NEXT((listelm), field) = (elm); \ (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ QMD_TRACE_ELEM(&(elm)->field); \ QMD_TRACE_ELEM(&(listelm)->field); \ } while (0) #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ QMD_TAILQ_CHECK_PREV(listelm, field); \ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ TAILQ_NEXT((elm), field) = (listelm); \ *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ QMD_TRACE_ELEM(&(elm)->field); \ QMD_TRACE_ELEM(&(listelm)->field); \ } while (0) #define TAILQ_INSERT_HEAD(head, elm, field) do { \ QMD_TAILQ_CHECK_HEAD(head, field); \ if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ TAILQ_FIRST((head))->field.tqe_prev = \ &TAILQ_NEXT((elm), field); \ else \ (head)->tqh_last = &TAILQ_NEXT((elm), field); \ TAILQ_FIRST((head)) = (elm); \ (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ QMD_TRACE_HEAD(head); \ QMD_TRACE_ELEM(&(elm)->field); \ } while (0) #define TAILQ_INSERT_TAIL(head, elm, field) do { \ QMD_TAILQ_CHECK_TAIL(head, field); \ TAILQ_NEXT((elm), field) = NULL; \ (elm)->field.tqe_prev = (head)->tqh_last; \ *(head)->tqh_last = (elm); \ (head)->tqh_last = &TAILQ_NEXT((elm), field); \ QMD_TRACE_HEAD(head); \ QMD_TRACE_ELEM(&(elm)->field); \ } while (0) #define TAILQ_LAST(head, headname) \ (*(((struct headname *)((head)->tqh_last))->tqh_last)) /* * The FAST function is fast in that it causes no data access other * then the access to the head. The standard LAST function above * will cause a data access of both the element you want and * the previous element. FAST is very useful for instances when * you may want to prefetch the last data element. */ #define TAILQ_LAST_FAST(head, type, field) \ (TAILQ_EMPTY(head) ? NULL : __containerof((head)->tqh_last, QUEUE_TYPEOF(type), field.tqe_next)) #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) #define TAILQ_PREV(elm, headname, field) \ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) #define TAILQ_PREV_FAST(elm, head, type, field) \ ((elm)->field.tqe_prev == &(head)->tqh_first ? NULL : \ __containerof((elm)->field.tqe_prev, QUEUE_TYPEOF(type), field.tqe_next)) #define TAILQ_REMOVE(head, elm, field) do { \ QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \ QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \ QMD_TAILQ_CHECK_NEXT(elm, field); \ QMD_TAILQ_CHECK_PREV(elm, field); \ if ((TAILQ_NEXT((elm), field)) != NULL) \ TAILQ_NEXT((elm), field)->field.tqe_prev = \ (elm)->field.tqe_prev; \ else { \ (head)->tqh_last = (elm)->field.tqe_prev; \ QMD_TRACE_HEAD(head); \ } \ *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ TRASHIT(*oldnext); \ TRASHIT(*oldprev); \ QMD_TRACE_ELEM(&(elm)->field); \ } while (0) #define TAILQ_SWAP(head1, head2, type, field) do { \ QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \ QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last; \ (head1)->tqh_first = (head2)->tqh_first; \ (head1)->tqh_last = (head2)->tqh_last; \ (head2)->tqh_first = swap_first; \ (head2)->tqh_last = swap_last; \ if ((swap_first = (head1)->tqh_first) != NULL) \ swap_first->field.tqe_prev = &(head1)->tqh_first; \ else \ (head1)->tqh_last = &(head1)->tqh_first; \ if ((swap_first = (head2)->tqh_first) != NULL) \ swap_first->field.tqe_prev = &(head2)->tqh_first; \ else \ (head2)->tqh_last = &(head2)->tqh_first; \ } while (0) #endif /* !_SYS_QUEUE_H_ */ chibicc-1.0.24/test/redirect.c000066400000000000000000000012351517770275000161220ustar00rootroot00000000000000#include #include # define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) # define __ASMNAME2(prefix, cname) __STRING (prefix) cname #define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) // extern int __REDIRECT (fscanf, (FILE *__restrict __stream, // const char *__restrict __format, ...), // __isoc99_fscanf) __wur; #define TEST 10 #define TEST2 10 int toto(int a, int b) { return a + b; } // main function - // where the execution of program begins int main() { static_assert(TEST == 10, "TEST is not 10"); // prints hello world //printf("Hello World\n"); return 0; }chibicc-1.0.24/test/redzone_clobber.c000066400000000000000000000040201517770275000174520ustar00rootroot00000000000000#include "test.h" #include #include #include #include /* * This test stresses expression-temp handling around dynamic stack growth. * It is intentionally "freeze_module-like": many small helper calls, lots of * stack traffic, and alloca in hot paths. */ static uint64_t clobber_with_alloca(int n) { int sz = 256 + (n & 127); unsigned char *p = (unsigned char *)alloca(sz); uint64_t s = 0; for (int i = 0; i < sz; i++) { p[i] = (unsigned char)(i ^ n); s += p[i]; } char fmt[64]; sprintf(fmt, "alloca:%d:%d", n, sz); s += fmt[0]; return s; } static uint64_t clobber_with_malloc(int n) { int sz = 256 + (n & 127); unsigned char *p = (unsigned char *)malloc((size_t)sz); uint64_t s = 0; for (int i = 0; i < sz; i++) { p[i] = (unsigned char)(i ^ n); s += p[i]; } free(p); return s + (uint64_t)'a'; } static uint64_t nested_expr(int a, int b, int c, uint64_t (*fn)(int)) { uint64_t t1 = fn(a); uint64_t t2 = fn(b); uint64_t t3 = fn(c); // Force multiple temporaries and calls in one expression. return (t1 ^ ((uint64_t)b * 3ULL)) + (t2 & 0x7fffULL) - (t3 % 97ULL); } static uint64_t stress_loop(uint64_t (*fn)(int)) { uint64_t acc = 0; for (int i = 1; i <= 200; i++) { int a = i * 13 + 7; int b = i * 17 + 11; int c = i * 19 + 3; // The expression shape here is deliberate. acc += nested_expr(a, b, c, fn) + fn(i + 5) - (uint64_t)(a ^ c); } return acc; } int main() { uint64_t v_alloca_1 = stress_loop(clobber_with_alloca); uint64_t v_alloca_2 = stress_loop(clobber_with_alloca); uint64_t v_ref = stress_loop(clobber_with_malloc); // Deterministic behavior check: same program path must match exactly. LASSERT((long long)v_alloca_1, (long long)v_alloca_2); LASSERT((long long)v_ref, (long long)v_alloca_1); printf("OK redzone/alloca stress: %llu\n", (unsigned long long)v_alloca_1); return 0; } chibicc-1.0.24/test/refcount.c000066400000000000000000000006201517770275000161430ustar00rootroot00000000000000// macro_refcount_test.c #include "test.h" #include struct O { long ref; }; void dealloc(struct O *o) { printf("dealloc\n"); free(o); } #define DECREF(o) do { \ if (--((o)->ref) == 0) \ dealloc(o); \ } while (0) int main(void) { struct O *o = malloc(sizeof(*o)); o->ref = 2; DECREF(o); DECREF(o); // must dealloc exactly once return 0; } chibicc-1.0.24/test/reference2.c000066400000000000000000000002211517770275000163330ustar00rootroot00000000000000#include "test.h" static inline void fn(void); void (*ptr)(void) = fn; int main(void) { ptr(); return 0; } static inline void fn(void) {}chibicc-1.0.24/test/reference3.c000066400000000000000000000003231517770275000163370ustar00rootroot00000000000000#include "test.h" extern int ossl_fips_intern_provider_init(void); int foo(void) { return 0 ? ossl_fips_intern_provider_init() : 1; } int main() { int x = foo(); printf("%d\n", x); return 0; } chibicc-1.0.24/test/regex.c000066400000000000000000000001061517770275000154270ustar00rootroot00000000000000#include #include "test.h" int main(void) { return 0; }chibicc-1.0.24/test/repro_align.c000066400000000000000000000025151517770275000166240ustar00rootroot00000000000000#include #include struct S1 { int x __attribute__((aligned)); int y; }; struct __attribute__((aligned(8))) S2 { int a; int b __attribute__((aligned(64))); }; int main() { printf("alignof(S1.x) = %zu (expected 16 on x86_64)\n", _Alignof(((struct S1*)0)->x)); printf("offsetof(S1.y) = %zu (expected 16 or 32 depending on x alignment)\n", offsetof(struct S1, y)); printf("alignof(struct S2) = %zu (expected 64)\n", _Alignof(struct S2)); printf("offsetof(struct S2, b) = %zu (expected 64)\n", offsetof(struct S2, b)); int fail = 0; if (_Alignof(struct S2) != 64) { printf("BUG: struct S2 alignment is %zu, expected 64\n", _Alignof(struct S2)); fail = 1; } if (offsetof(struct S2, b) != 64) { printf("BUG: struct S2.b offset is %zu, expected 64\n", offsetof(struct S2, b)); fail = 1; } // S1 tests // Note: GCC default alignment for __attribute__((aligned)) is 16 on x86_64 (max alignment for long double or SSE) // Actually GCC docs say: "default alignment for the largest numeric type". if (_Alignof(((struct S1*)0)->x) < 16) { printf("POTENTIAL BUG: S1.x alignment is %zu, expected >= 16\n", _Alignof(((struct S1*)0)->x)); // Not necessarily a failure if chibicc has different defaults, but worth checking. } if (fail) return 1; printf("OK\n"); return 0; } chibicc-1.0.24/test/repro_align3.c000066400000000000000000000006171517770275000167100ustar00rootroot00000000000000#include #include typedef int aligned_int __attribute__((aligned(64))); struct Foo { int x; aligned_int y; }; int main() { printf("offsetof(y) = %zu\n", offsetof(struct Foo, y)); if (offsetof(struct Foo, y) != 64) { printf("BUG: offsetof(y) is %zu, expected 64\n", offsetof(struct Foo, y)); return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/repro_asm.c000066400000000000000000000003331517770275000163060ustar00rootroot00000000000000// repro_asm_ptr_input.c #include "test.h" int main() { int x = 5; int y = 0; __asm__( "movl %1, (%0)" : : "r"(&y), "r"(x) : "memory" ); printf("y = %d\n", y); ASSERT(5, y); return 0; } chibicc-1.0.24/test/repro_asm_named.c000066400000000000000000000003431517770275000174530ustar00rootroot00000000000000#include "test.h" int main() { int x = 42; int y = 0; __asm__ ( "movl %[src], (%[dst])" : : [src]"r"(x), [dst]"r"(&y) : "memory" ); printf("y = %d\n", y); ASSERT(42, y); return 0; } chibicc-1.0.24/test/repro_bitfield64.c000066400000000000000000000005271517770275000174670ustar00rootroot00000000000000#include #include struct S { uint64_t x : 64; }; int main() { struct S s = {0}; s.x = 0x123456789ABCDEF0; printf("s.x = %lx (expected 123456789abcdef0)\n", s.x); if (s.x != 0x123456789ABCDEF0) { printf("BUG: s.x is %lx, expected 123456789abcdef0\n", s.x); return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/repro_byte_inc.c000066400000000000000000000007021517770275000173220ustar00rootroot00000000000000#include #include #include struct S { uint8_t a; uint8_t b; uint32_t c; }; int main() { struct S s = {0, 0, 0x12345678}; s.a++; printf("s.a = %d, s.b = %d, s.c = 0x%x\n", s.a, s.b, s.c); assert(s.a == 1); assert(s.b == 0); assert(s.c == 0x12345678); s.b = 255; s.b++; printf("s.b = %d\n", s.b); assert(s.b == 0); printf("SUCCESS\n"); return 0; } chibicc-1.0.24/test/repro_evp_test20.c000066400000000000000000000012471517770275000175260ustar00rootroot00000000000000#include "test.h" #include /* * Reproducer for 30-test_evp.t test 20 failure. * Exercises __int128 multiplication critical for X25519/Ed25519. */ int main() { uint64_t a = 0xFFFFFFFFFFFFFFFFULL; uint64_t b = 0xFFFFFFFFFFFFFFFFULL; unsigned __int128 res = (unsigned __int128)a * b; uint64_t high = (uint64_t)(res >> 64); uint64_t low = (uint64_t)res; /* (2^64-1)^2 = 2^128 - 2^65 + 1 => high: 2^64-2, low: 1 */ if (high != 0xFFFFFFFFFFFFFFFEULL || low != 0x0000000000000001ULL) { printf("FAIL: __int128 multiplication error: got %lx %lx\n", high, low); return 1; } printf("PASS\n"); return 0; }chibicc-1.0.24/test/repro_issue.c000066400000000000000000000011611517770275000166560ustar00rootroot00000000000000#include typedef int v4si __attribute__((vector_size(16))), myint; int x __attribute__((aligned(64))), y; int main() { setbuf(stdout, NULL); v4si v = {1, 2, 3, 4}; myint i = 5; printf("i = %d\n", i); printf("sizeof(v) = %ld\n", sizeof(v)); printf("sizeof(i) = %ld\n", sizeof(i)); if (sizeof(i) == sizeof(v)) { printf("BUG: myint is treated as vector!\n"); } printf("alignof(x) = %ld\n", __alignof__(x)); printf("alignof(y) = %ld\n", __alignof__(y)); if (__alignof__(y) == 64) { printf("BUG: y is treated as aligned(64)!\n"); } return 0; } chibicc-1.0.24/test/repro_knr.c000066400000000000000000000002131517770275000163150ustar00rootroot00000000000000#include "test.h" static int byte_swap(word) int word; { return word; } int main() { ASSERT(0x1234, byte_swap(0x1234)); return 0; } chibicc-1.0.24/test/repro_leak.c000066400000000000000000000002431517770275000164420ustar00rootroot00000000000000#include "test.h" int main() { enum { A = 5 }; if (sizeof(enum { A = 7 })) ; ASSERT(5, A); void proto(enum { A = 9 }); ASSERT(5, A); return 0; } chibicc-1.0.24/test/repro_locktag_size.c000066400000000000000000000051041517770275000202050ustar00rootroot00000000000000#include #include #include #include #include typedef uint16_t uint16; typedef uint32_t uint32; typedef uint8_t uint8; typedef enum LockTagType { LOCKTAG_RELATION, LOCKTAG_RELATION_EXTEND, LOCKTAG_DATABASE_FROZEN_IDS, LOCKTAG_PAGE, LOCKTAG_TUPLE, LOCKTAG_TRANSACTION, LOCKTAG_VIRTUALTRANSACTION, LOCKTAG_SPECULATIVE_TOKEN, LOCKTAG_OBJECT, LOCKTAG_USERLOCK, LOCKTAG_ADVISORY, LOCKTAG_APPLY_TRANSACTION } LockTagType; typedef struct LOCKTAG { uint32 locktag_field1; /* a 32-bit ID field */ uint32 locktag_field2; /* a 32-bit ID field */ uint32 locktag_field3; /* a 32-bit ID field */ uint16 locktag_field4; /* a 16-bit ID field */ uint8 locktag_type; /* see enum LockTagType */ uint8 locktag_lockmethodid; /* lockmethod indicator */ } LOCKTAG; typedef int LOCKMODE; typedef struct LOCALLOCKTAG { LOCKTAG lock; /* identifies the lockable object */ LOCKMODE mode; /* lock mode for this table entry */ } LOCALLOCKTAG; struct T { char a; long b; char c; }; struct Big { char buf[128]; long x; int y; }; int main() { printf("LOCKTAG:\n"); printf(" size: %zu\n", sizeof(LOCKTAG)); printf(" field1 offset: %zu\n", offsetof(LOCKTAG, locktag_field1)); printf(" field2 offset: %zu\n", offsetof(LOCKTAG, locktag_field2)); printf(" field3 offset: %zu\n", offsetof(LOCKTAG, locktag_field3)); printf(" field4 offset: %zu\n", offsetof(LOCKTAG, locktag_field4)); printf(" type offset: %zu\n", offsetof(LOCKTAG, locktag_type)); printf(" methodid offset: %zu\n", offsetof(LOCKTAG, locktag_lockmethodid)); printf("LOCALLOCKTAG:\n"); printf(" size: %zu\n", sizeof(LOCALLOCKTAG)); printf(" lock offset: %zu\n", offsetof(LOCALLOCKTAG, lock)); printf(" mode offset: %zu\n", offsetof(LOCALLOCKTAG, mode)); char buf[64]; size_t n = 64; memset(buf, 0x11, n); for (int i = 0; i < 64; i++) assert((unsigned char)buf[i] == 0x11); puts("OK"); memset(buf, 0, sizeof(buf)); memcpy(buf + 4, "abcd", 4); assert(buf[4] == 'a'); assert(buf[7] == 'd'); puts("OK"); struct T x; memset(&x, 0xAB, sizeof(x)); struct T y = x; unsigned char *p = (unsigned char *)&y; for (size_t i = 0; i < sizeof(y); i++) assert(p[i] == 0xAB); puts("OK"); struct Big a; struct Big b; memset(&a, 0xCD, sizeof(a)); memcpy(&b, &a, sizeof(a)); unsigned char *p2 = (unsigned char *)&b; for (size_t i = 0; i < sizeof(b); i++) assert(p2[i] == 0xCD); puts("OK"); return 0; } chibicc-1.0.24/test/repro_memset_padding.c000066400000000000000000000020701517770275000205060ustar00rootroot00000000000000#include #include #include #include typedef struct { uint32_t f1; uint32_t f2; uint32_t f3; uint16_t f4; uint8_t f5; uint8_t f6; } LOCKTAG; typedef struct { LOCKTAG lock; int mode; } LOCALLOCKTAG; // Mock MemSet similar to PostgreSQL's #define MemSet(start, val, len) memset(start, val, len) int main() { printf("sizeof(LOCKTAG) = %zu\n", sizeof(LOCKTAG)); printf("sizeof(LOCALLOCKTAG) = %zu\n", sizeof(LOCALLOCKTAG)); assert(sizeof(LOCKTAG) == 16); // On 64-bit, we expect 8-byte alignment, so 20 -> 24 // assert(sizeof(LOCALLOCKTAG) == 24); LOCALLOCKTAG tag; // Fill with garbage memset(&tag, 0x5a, sizeof(tag)); // Clear with MemSet MemSet(&tag, 0, sizeof(tag)); uint8_t *p = (uint8_t *)&tag; for (size_t i = 0; i < sizeof(tag); i++) { if (p[i] != 0) { printf("ERROR: byte %zu is not zero: 0x%02x\n", i, p[i]); return 1; } } printf("SUCCESS: all bytes cleared\n"); return 0; } chibicc-1.0.24/test/repro_mulq.c000066400000000000000000000005741517770275000165130ustar00rootroot00000000000000#include "test.h" int main() { unsigned long a[2] = {10, 20}; unsigned long res; // Test (a)[i] case which fails in mulq.c __asm__ ("movq %1, %0" : "=r"(res) : "a"((a)[1])); if (res != 20) { printf("FAILED: expected 20, got %ld\n", res); return 1; } printf("res => %ld\n", res); ASSERT(20, res); printf("OK\n"); return 0; } chibicc-1.0.24/test/repro_offset.c000066400000000000000000000006751517770275000170250ustar00rootroot00000000000000#include #include #include typedef struct { uint32_t padding[252]; // 1008 bytes uint32_t offset[20]; } ShmemControl; int main() { ShmemControl ctrl; printf("Base: %p\n", (void *)&ctrl); for (int i = 0; i < 15; i++) { printf("Kind %d - Offset: %zu, Pointer: %p\n", i, (size_t)((char *)&ctrl.offset[i] - (char *)&ctrl), (void *)&ctrl.offset[i]); } return 0; } chibicc-1.0.24/test/repro_offsetof_init.c000066400000000000000000000012141517770275000203630ustar00rootroot00000000000000#include #include struct Foo { int a; int b; int c; int data[100]; int io; }; struct Info { size_t off; }; #define KIND_IO 10 #define SIZE 15 static const struct Info infos[SIZE] = { [1] = { offsetof(struct Foo, a) }, [7] = { offsetof(struct Foo, b) }, [9] = { offsetof(struct Foo, c) }, [KIND_IO] = { offsetof(struct Foo, io) }, }; int main() { for (int i = 0; i < SIZE; i++) { printf("off[%d] = %zu\n", i, infos[i].off); } if (infos[KIND_IO].off == 0) { printf("BUG: off[%d] is 0!\n", KIND_IO); return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/repro_openssl.c000066400000000000000000000113361517770275000172160ustar00rootroot00000000000000#include #include #include typedef unsigned long BN_ULONG; #undef mul #undef mul_add /*- * "m"(a), "+m"(r) is the way to favor DirectPath µ-code; * "g"(0) let the compiler to decide where does it * want to keep the value of zero; */ #define mul_add(r, a, word, carry) \ do { \ register BN_ULONG high, low; \ asm("mulq %3" \ : "=a"(low), "=d"(high) \ : "a"(word), "m"(a) \ : "cc"); \ asm("addq %2,%0; adcq %3,%1" \ : "+r"(carry), "+d"(high) \ : "a"(low), "g"(0) \ : "cc"); \ asm("addq %2,%0; adcq %3,%1" \ : "+m"(r), "+d"(high) \ : "r"(carry), "g"(0) \ : "cc"); \ carry = high; \ } while (0) #define mul(r, a, word, carry) \ do { \ register BN_ULONG high, low; \ asm("mulq %3" \ : "=a"(low), "=d"(high) \ : "a"(word), "g"(a) \ : "cc"); \ asm("addq %2,%0; adcq %3,%1" \ : "+r"(carry), "+d"(high) \ : "a"(low), "g"(0) \ : "cc"); \ (r) = carry, carry = high; \ } while (0) #undef sqr #define sqr(r0, r1, a) \ asm("mulq %2" \ : "=a"(r0), "=d"(r1) \ : "a"(a) \ : "cc"); /* ----------------------------- * Reference multiplication * ----------------------------- */ void ref_mul(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) { memset(r, 0, sizeof(BN_ULONG) * (na + nb)); for (int i = 0; i < na; i++) { BN_ULONG carry = 0; for (int j = 0; j < nb; j++) { unsigned long long prod = (unsigned long long)a[i] * b[j] + r[i + j] + carry; r[i + j] = (BN_ULONG)prod; carry = prod >> 32; } r[i + nb] += carry; } } /* ----------------------------- * Fallback word operations * ----------------------------- */ BN_ULONG bn_mul_words(BN_ULONG *r, BN_ULONG *a, int n, BN_ULONG w) { BN_ULONG carry = 0; for (int i = 0; i < n; i++) { unsigned long long prod = (unsigned long long)a[i] * w + carry; r[i] = (BN_ULONG)prod; carry = prod >> 32; } return carry; } BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w) { BN_ULONG c1 = 0; if (num <= 0) return c1; while (num & ~3) { mul_add(rp[0], ap[0], w, c1); mul_add(rp[1], ap[1], w, c1); mul_add(rp[2], ap[2], w, c1); mul_add(rp[3], ap[3], w, c1); ap += 4; rp += 4; num -= 4; } if (num) { mul_add(rp[0], ap[0], w, c1); if (--num == 0) return c1; mul_add(rp[1], ap[1], w, c1); if (--num == 0) return c1; mul_add(rp[2], ap[2], w, c1); return c1; } return c1; } /* ----------------------------- * YOUR FUNCTION (unchanged) * ----------------------------- */ void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) { BN_ULONG *rr; if (na < nb) { int itmp; BN_ULONG *ltmp; itmp = na; na = nb; nb = itmp; ltmp = a; a = b; b = ltmp; } rr = &(r[na]); if (nb <= 0) { (void)bn_mul_words(r, a, na, 0); return; } else { rr[0] = bn_mul_words(r, a, na, b[0]); } for (;;) { if (--nb <= 0) return; rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]); if (--nb <= 0) return; rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]); if (--nb <= 0) return; rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]); if (--nb <= 0) return; rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]); rr += 4; r += 4; b += 4; } } /* ----------------------------- * Test * ----------------------------- */ #define MAX 32 int main() { BN_ULONG a[MAX], b[MAX], r1[MAX*2], r2[MAX*2]; for (int i = 0; i < MAX; i++) { a[i] = i + 1; b[i] = (i % 7) + 1; } memset(r1, 0, sizeof(r1)); memset(r2, 0, sizeof(r2)); bn_mul_normal(r1, a, 16, b, 16); ref_mul(r2, a, 16, b, 16); for (int i = 0; i < 32; i++) { if (r1[i] != r2[i]) { printf("FAIL at %d: %lu != %lu\n", i, r1[i], r2[i]); return 1; } } printf("OK\n"); return 0; }chibicc-1.0.24/test/repro_php2.c000066400000000000000000000007201517770275000163770ustar00rootroot00000000000000#include "test.h" struct op { long lval; }; #define Z_LVAL_P(z) ((z)->lval) int main() { struct op o = {123456789}; struct op *op1 = &o; long res; // Test nested parentheses __asm__ ("movq %1, %0" : "=r"(res) : "r"(((op1)->lval))); if (res != 123456789) { printf("FAILED: expected 123456789, got %ld\n", res); return 1; } printf("res => %ld\n", res); ASSERT(123456789, res); printf("OK\n"); return 0; } chibicc-1.0.24/test/repro_quic_multistream.c000066400000000000000000000270461517770275000211270ustar00rootroot00000000000000/* * quic_txp_timeout_repro.c * * Minimal reproducer for: * ERROR: 'ossl_time_compare(ossl_time_now(), op_deadline) <= 0' failed * "internal error (txp generate)" * @ test/quic_multistream_test.c:1104 * * Root cause hypothesis: * chibicc miscompiles one or more of: * (a) uint64_t arithmetic used in OSSL_TIME comparison * (b) struct bitfield access in QUIC_TXPIM_PKT / OSSL_QUIC_FRAME_STREAM * (c) multi-return / out-pointer pattern in ossl_quic_tx_packetiser_generate() * (d) __attribute__((packed)) struct layout affecting frame serialization * * Build with chibicc: * chibicc -o quic_txp_timeout_repro quic_txp_timeout_repro.c * * Build with gcc/clang for reference: * gcc -o quic_txp_timeout_repro_ref quic_txp_timeout_repro.c && ./quic_txp_timeout_repro_ref * * Expected: all assertions pass, exit 0 * Failure: any assertion fails or the "txp generate" simulation returns an error */ #include #include #include #include #include /* ----------------------------------------------------------------------- * 1. OSSL_TIME emulation * OpenSSL represents time as a uint64_t nanosecond count. * ossl_time_compare() must return negative/zero/positive correctly. * chibicc bug vector: uint64_t subtraction used as signed comparison. * ----------------------------------------------------------------------- */ typedef uint64_t OSSL_TIME; #define OSSL_TIME_NS UINT64_C(1) #define OSSL_TIME_US UINT64_C(1000) #define OSSL_TIME_MS UINT64_C(1000000) #define OSSL_TIME_SEC UINT64_C(1000000000) /* Mirrors the real ossl_time_compare(): * returns -1 if a < b, 0 if a == b, +1 if a > b * Potential chibicc issue: if the compiler sign-extends or truncates the * uint64_t difference when storing into an int, the compare is wrong. */ static int ossl_time_compare(OSSL_TIME a, OSSL_TIME b) { if (a < b) return -1; if (a > b) return 1; return 0; } static OSSL_TIME ossl_time_now(void) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return (OSSL_TIME)ts.tv_sec * OSSL_TIME_SEC + (OSSL_TIME)ts.tv_nsec * OSSL_TIME_NS; } static OSSL_TIME ossl_time_add(OSSL_TIME t, OSSL_TIME d) { return t + d; } /* ----------------------------------------------------------------------- * 2. QUIC frame structs with bitfields * chibicc bug vector: bitfield read/write order or width truncation. * OSSL_QUIC_FRAME_STREAM uses fin:1 and has_explicit_len:1 bitfields. * ----------------------------------------------------------------------- */ typedef struct { uint64_t stream_id; uint64_t offset; uint64_t len; unsigned int is_fin : 1; /* FIN bit */ unsigned int has_data : 1; /* whether data pointer is valid */ unsigned int _pad : 6; const unsigned char *data; } OSSL_QUIC_FRAME_STREAM; /* Verify bitfield layout is not corrupted by chibicc */ static int test_stream_frame_bitfields(void) { OSSL_QUIC_FRAME_STREAM f; memset(&f, 0, sizeof(f)); f.stream_id = 0xDEADBEEF01020304ULL; f.offset = 0x0000000000001000ULL; f.len = 512; f.is_fin = 1; f.has_data = 0; f.data = NULL; if (f.stream_id != 0xDEADBEEF01020304ULL) { fprintf(stderr, "FAIL: stream_id corrupted: got 0x%llx\n", (unsigned long long)f.stream_id); return 0; } if (f.is_fin != 1) { fprintf(stderr, "FAIL: is_fin bitfield wrong: got %u\n", f.is_fin); return 0; } if (f.has_data != 0) { fprintf(stderr, "FAIL: has_data bitfield wrong: got %u\n", f.has_data); return 0; } /* Toggle — chibicc sometimes fails to isolate adjacent bitfields */ f.is_fin = 0; f.has_data = 1; if (f.is_fin != 0 || f.has_data != 1) { fprintf(stderr, "FAIL: bitfield toggle corrupted neighbours: " "is_fin=%u has_data=%u\n", f.is_fin, f.has_data); return 0; } printf("PASS: stream frame bitfields\n"); return 1; } /* ----------------------------------------------------------------------- * 3. TXP generate simulation * The real ossl_quic_tx_packetiser_generate() returns a status code AND * sets an output flag via a pointer. chibicc bug vector: out-pointer * write being optimised away or the return value path being wrong. * ----------------------------------------------------------------------- */ #define TXP_ERR_OK 0 #define TXP_ERR_INTERNAL 1 /* "internal error (txp generate)" */ typedef struct { int have_ack_eliciting; /* would produce ACK-eliciting packet */ int generated; /* a packet was actually generated */ } TXP_STATUS; /* * Simulate the TXP generate path. * Returns TXP_ERR_OK on success, TXP_ERR_INTERNAL on failure. * Writes result into *status. * * chibicc risk: if the compiler doesn't properly follow the pointer write * back to the caller, *status stays zero-initialised and the caller sees * generated=0, then sits in a spin-loop until the op_deadline expires. */ static int txp_generate(int should_succeed, TXP_STATUS *status) { status->have_ack_eliciting = 1; if (!should_succeed) { /* This path corresponds to the "internal error (txp generate)" */ status->generated = 0; return TXP_ERR_INTERNAL; } status->generated = 1; return TXP_ERR_OK; } static int test_txp_out_pointer(void) { TXP_STATUS st; int rc; /* --- success path --- */ memset(&st, 0, sizeof(st)); rc = txp_generate(1, &st); if (rc != TXP_ERR_OK) { fprintf(stderr, "FAIL: txp_generate success path returned error %d\n", rc); return 0; } if (!st.generated) { fprintf(stderr, "FAIL: txp out-pointer 'generated' not set (chibicc write-back bug?)\n"); return 0; } /* --- failure path --- */ memset(&st, 0xFF, sizeof(st)); /* pre-poison */ rc = txp_generate(0, &st); if (rc != TXP_ERR_INTERNAL) { fprintf(stderr, "FAIL: txp_generate failure path returned %d, want %d\n", rc, TXP_ERR_INTERNAL); return 0; } if (st.generated != 0) { fprintf(stderr, "FAIL: txp out-pointer 'generated' should be 0 on error, got %d\n", st.generated); return 0; } printf("PASS: txp out-pointer write-back\n"); return 1; } /* ----------------------------------------------------------------------- * 4. Deadline / spin-loop simulation * Mirrors the multistream test op-runner at quic_multistream_test.c:1104. * If ossl_time_compare() or ossl_time_now() are miscompiled the loop * either never exits or exits immediately even when deadline hasn't passed. * ----------------------------------------------------------------------- */ #define OP_DEADLINE_MS 500 /* 500 ms — generous for CI */ static int test_deadline_compare(void) { OSSL_TIME start = ossl_time_now(); OSSL_TIME deadline = ossl_time_add(start, 200 * OSSL_TIME_MS); /* Condition from quic_multistream_test.c:1104: * ossl_time_compare(ossl_time_now(), op_deadline) <= 0 * means: now <= deadline, i.e. we are still within the window. */ int within = (ossl_time_compare(ossl_time_now(), deadline) <= 0); if (!within) { fprintf(stderr, "FAIL: deadline compare wrong immediately after creation " "(time arithmetic or compare bug)\n"); return 0; } /* A deadline far in the past must be expired */ OSSL_TIME past = ossl_time_add(start, 0) - 1000 * OSSL_TIME_SEC; /* Guard: only test if subtraction didn't underflow to a huge value */ if (past < start) { int expired = (ossl_time_compare(ossl_time_now(), past) > 0); if (!expired) { fprintf(stderr, "FAIL: past deadline not detected as expired\n"); return 0; } } printf("PASS: deadline time comparison\n"); return 1; } /* ----------------------------------------------------------------------- * 5. uint64_t wrap-around / large-value arithmetic * chibicc bug vector: 64-bit immediate constants or 64-bit multiply * being silently truncated to 32 bits. * ----------------------------------------------------------------------- */ static int test_u64_arithmetic(void) { /* 5 seconds in nanoseconds — requires 64-bit representation */ uint64_t five_sec = 5ULL * 1000000000ULL; if (five_sec != UINT64_C(5000000000)) { fprintf(stderr, "FAIL: uint64 5sec constant wrong: got %llu\n", (unsigned long long)five_sec); return 0; } /* Subtraction that would underflow in 32-bit */ uint64_t a = UINT64_C(0x100000001); uint64_t b = UINT64_C(0x000000002); uint64_t diff = a - b; if (diff != UINT64_C(0x0FFFFFFFF)) { fprintf(stderr, "FAIL: uint64 subtraction wrong: got 0x%llx\n", (unsigned long long)diff); return 0; } /* Comparison that looks equal in 32-bit but differs in 64-bit */ uint64_t x = UINT64_C(0x100000000); uint64_t y = UINT64_C(0x000000000); if (x == y) { fprintf(stderr, "FAIL: uint64 comparison truncated to 32 bits\n"); return 0; } printf("PASS: uint64 arithmetic\n"); return 1; } /* ----------------------------------------------------------------------- * 6. __attribute__((packed)) struct — affects wire-format serialization * chibicc bug vector: ignoring packed, producing wrong sizeof/offsets. * ----------------------------------------------------------------------- */ typedef struct __attribute__((packed)) { uint8_t first_byte; /* QUIC packet type + flags */ uint32_t version; /* QUIC version (big-endian on wire) */ uint8_t dcil; /* destination connection ID length */ uint8_t scil; /* source connection ID length */ } QuicLongHeader; static int test_packed_struct(void) { /* Without packed: sizeof would be 8 (padding after first_byte) */ /* With packed: sizeof must be exactly 7 */ if (sizeof(QuicLongHeader) != 7) { fprintf(stderr, "FAIL: packed struct sizeof wrong: got %zu, want 7 " "(chibicc ignoring __attribute__((packed))?)\n", sizeof(QuicLongHeader)); return 0; } QuicLongHeader hdr; memset(&hdr, 0, sizeof(hdr)); hdr.first_byte = 0xC0; hdr.version = 0x00000001; hdr.dcil = 8; hdr.scil = 0; /* Check offsets via memcpy-based read (avoids UB on unaligned) */ uint32_t v; memcpy(&v, (char *)&hdr + 1, sizeof(v)); if (v != 0x00000001) { fprintf(stderr, "FAIL: packed struct field offset wrong: version at wrong offset\n"); return 0; } printf("PASS: packed struct layout\n"); return 1; } /* ----------------------------------------------------------------------- * main * ----------------------------------------------------------------------- */ int main(void) { int pass = 1; printf("=== quic_txp_timeout reproducer ===\n\n"); printf("Checking constructs that chibicc may miscompile,\n"); printf("leading to 'internal error (txp generate)' / op deadline expiry.\n\n"); pass &= test_u64_arithmetic(); pass &= test_deadline_compare(); pass &= test_stream_frame_bitfields(); pass &= test_txp_out_pointer(); pass &= test_packed_struct(); printf("\n"); if (pass) { printf("ALL TESTS PASSED\n"); printf("(If this passes under gcc but fails under chibicc, the bug\n"); printf(" is confirmed in chibicc's code generation for the failing test.)\n"); return 0; } else { printf("ONE OR MORE TESTS FAILED — likely chibicc miscompilation\n"); return 1; } } chibicc-1.0.24/test/repro_quic_radix.c000066400000000000000000000011711517770275000176570ustar00rootroot00000000000000#include "test.h" #include /* * Reproducer for 70-test_quic_radix.t failure. * Focuses on 64-bit bitwise operations and builtins used by OpenSSL's QUIC_RATREE. */ int main() { uint64_t key = 0x8000000000000000ULL; int leading_zeros = __builtin_clzll(key); if (leading_zeros != 0) { printf("FAIL: __builtin_clzll(0x8000000000000000) = %d (expected 0)\n", leading_zeros); return 1; } uint64_t val = 1ULL << 35; if (val == 0) { printf("FAIL: 1ULL << 35 resulted in 0 (promotion or shift width issue)\n"); return 1; } printf("PASS\n"); return 0; }chibicc-1.0.24/test/repro_scope.c000066400000000000000000000001351517770275000166370ustar00rootroot00000000000000#include "test.h" int main() { void proto(enum { A = 7 }); printf("Ok\n"); return 0; } chibicc-1.0.24/test/repro_stack.c000066400000000000000000000007401517770275000166350ustar00rootroot00000000000000#include void recursive(int depth, char *start_addr) { char local; if (depth == 0) { start_addr = &local; } if (depth < 120000) { recursive(depth + 1, start_addr); } else { printf("Stack usage for 120000 calls: %ld bytes\n", start_addr - &local); printf("Average stack usage per call: %ld bytes\n", (start_addr - &local) / 120000); } } int main() { char local; recursive(0, &local); return 0; } chibicc-1.0.24/test/repro_string_init.c000066400000000000000000000006651517770275000200670ustar00rootroot00000000000000#include "test.h" #include struct S { char *p; char a[4]; int i; }; int main() { struct S sarr[] = { "foobar", "baz", 11, "foobaz", "bar", 22, }; printf("sarr[0].p = %s\n", sarr[0].p); printf("sarr[0].a = %s\n", sarr[0].a); printf("sarr[0].i = %d\n", sarr[0].i); printf("sarr[1].p = %s\n", sarr[1].p); printf("sarr[1].a = %s\n", sarr[1].a); printf("sarr[1].i = %d\n", sarr[1].i); return 0; } chibicc-1.0.24/test/repro_tupdesc.c000066400000000000000000000033311517770275000171760ustar00rootroot00000000000000#include #include #include #include typedef uint32_t Oid; typedef int32_t int32; typedef int16_t int16; typedef uint8_t uint8; typedef struct CompactAttribute { int32 attcacheoff; int16 attlen; bool attbyval; bool attispackable; bool atthasmissing; bool attisdropped; bool attgenerated; char attnullability; uint8 attalignby; } CompactAttribute; typedef char NameData[64]; typedef struct FormData_pg_attribute { Oid attrelid; NameData attname; Oid atttypid; int16 attlen; int16 attnum; int32 atttypmod; int16 attndims; bool attbyval; char attalign; char attstorage; char attcompression; bool attnotnull; bool atthasdef; bool atthasmissing; char attidentity; char attgenerated; bool attisdropped; bool attislocal; int16 attinhcount; Oid attcollation; } FormData_pg_attribute; typedef struct TupleDescData { int natts; Oid tdtypeid; int32 tdtypmod; int tdrefcount; void *constr; CompactAttribute compact_attrs[]; } TupleDescData; int main() { printf("sizeof(CompactAttribute) = %zu\n", sizeof(CompactAttribute)); printf("alignof(CompactAttribute) = %zu\n", __alignof__(CompactAttribute)); printf("sizeof(FormData_pg_attribute) = %zu\n", sizeof(FormData_pg_attribute)); printf("alignof(FormData_pg_attribute) = %zu\n", __alignof__(FormData_pg_attribute)); printf("offsetof(TupleDescData, compact_attrs) = %zu\n", offsetof(TupleDescData, compact_attrs)); printf("offsetof(FormData_pg_attribute, atttypid) = %zu\n", offsetof(FormData_pg_attribute, atttypid)); printf("offsetof(FormData_pg_attribute, attcollation) = %zu\n", offsetof(FormData_pg_attribute, attcollation)); return 0; } chibicc-1.0.24/test/repro_typedef_struct.c000066400000000000000000000002071517770275000205720ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(4, ({ typedef struct T T; struct T { int x; }; sizeof(T); })); printf("OK\n"); return 0; } chibicc-1.0.24/test/repro_uint_promote.c000066400000000000000000000004771517770275000202630ustar00rootroot00000000000000#include "test.h" int main() { unsigned int u = 0x80000000; long l = u; printf("u: %u\n", u); printf("l: %ld\n", l); if (l < 0) { printf("FAILED: promoted to negative\n"); return 1; } ASSERT(2147483648, u); ASSERT(2147483648, l); printf("PASSED\n"); return 0; } chibicc-1.0.24/test/repro_unsigned.c000066400000000000000000000004511517770275000173430ustar00rootroot00000000000000#include int main() { unsigned int x = 0x80000000; unsigned long y = x; printf("x = 0x%x, y = 0x%lx\n", x, y); if (y != 0x80000000UL) { printf("BUG: y is incorrectly extended!\n"); } else { printf("y is correctly extended.\n"); } return 0; } chibicc-1.0.24/test/repro_va_start.c000066400000000000000000000004011517770275000173450ustar00rootroot00000000000000#include #include "test.h" void test_va(int i, ...) { va_list ap; int actual = (va_start(ap, i), 123); printf("actual = %d\n", actual); ASSERT(123, actual); } int main() { test_va(0, 1); printf("Ok\n"); return 0; } chibicc-1.0.24/test/repro_valgrind_empty_asm.c000066400000000000000000000012151517770275000214120ustar00rootroot00000000000000#include "test.h" #include // This mimics OpenSSL's value_barrier pattern. // In chibicc 1.0.24, an empty template string causes the compiler // to skip operand processing, leaving 'r' uninitialized. static inline uint32_t value_barrier_32(uint32_t a) { uint32_t r; __asm__("" : "=r"(r) : "0"(a)); return r; } int main(void) { uint32_t x = 0x12345678; uint32_t y = value_barrier_32(x); // This conditional jump triggers the valgrind error if 'y' is uninitialized. if (y != x) { printf("Fail: %08x != %08x (Value was not preserved)\n", y, x); return 1; } printf("OK\n"); return 0; }chibicc-1.0.24/test/run_tests.sh000077500000000000000000000032431517770275000165430ustar00rootroot00000000000000#!/bin/bash set -eu if [ "$#" -lt 1 ]; then echo "usage: $0 [exe...]" >&2 exit 2 fi if [ -n "${TEST_JOBS:-}" ]; then jobs="$TEST_JOBS" else jobs="$(nproc 2>/dev/null || echo 4)" fi # Optional per-test timeout in seconds (0 disables timeout). timeout_secs="${TEST_TIMEOUT:-0}" tmpdir="$(mktemp -d /tmp/chibicc-run-XXXXXX)" trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP failfile="$tmpdir/fails" touch "$failfile" run_one() { exe="$1" mkdir -p "$tmpdir" touch "$failfile" log="$tmpdir/$(echo "$exe" | tr '/ ' '__').log" echo "$exe" status=0 if [ "$timeout_secs" -gt 0 ] && command -v timeout >/dev/null 2>&1; then timeout "${timeout_secs}s" "$exe" >"$log" 2>&1 || status=$? else "$exe" >"$log" 2>&1 || status=$? fi if [ "$status" -ne 0 ]; then mkdir -p "$tmpdir" touch "$failfile" if [ "$status" -eq 124 ] || [ "$status" -eq 137 ]; then echo "[TIMEOUT ${timeout_secs}s] $exe" >> "$log" fi echo "$exe" >> "$failfile" return 1 fi return 0 } export -f run_one export tmpdir failfile timeout_secs # Let all tests run and summarize failures ourselves below. # With "set -e", xargs would otherwise stop the script before summary printing. if ! printf '%s\n' "$@" | xargs -P"$jobs" -I{} bash -c 'run_one "$1"' _ {}; then : fi if [ -s "$failfile" ]; then mapfile -t failed_exes < <(sort -u "$failfile") echo "FAILED TESTS (${#failed_exes[@]}):" >&2 printf ' %s\n' "${failed_exes[@]}" >&2 echo >&2 while IFS= read -r exe; do log="$tmpdir/$(echo "$exe" | tr '/ ' '__').log" echo "FAILED: $exe" >&2 [ -f "$log" ] && cat "$log" >&2 echo >&2 done < <(printf '%s\n' "${failed_exes[@]}") exit 1 fi chibicc-1.0.24/test/sanitize.c000066400000000000000000000004151517770275000161460ustar00rootroot00000000000000#include "test.h" #define NO_SANITIZE(x) __attribute__((__no_sanitize__(x))) NO_SANITIZE("address") int f1(int x) { return x; } NO_SANITIZE(undef) int f2(int x) { return x; } int main(void) { ASSERT(1, f1(1)); ASSERT(-1, f2(-1)); printf("OK\n"); return 0; }chibicc-1.0.24/test/sasl_defs.h000066400000000000000000000012651517770275000162740ustar00rootroot00000000000000#ifndef SASL_DEFS_H #define SASL_DEFS_H 1 // Longest one I could find was ``9798-U-RSA-SHA1-ENC'' #define MAX_SASL_MECH_LEN 32 #if defined(HAVE_SASL_SASL_H) && defined(ENABLE_SASL) #include void init_sasl(void); extern char my_sasl_hostname[1025]; #else /* End of SASL support */ typedef void* sasl_conn_t; #define init_sasl() {} #define sasl_dispose(x) {} #define sasl_server_new(a, b, c, d, e, f, g, h) 1 #define sasl_listmech(a, b, c, d, e, f, g, h) 1 #define sasl_server_start(a, b, c, d, e, f) 1 #define sasl_server_step(a, b, c, d, e) 1 #define sasl_getprop(a, b, c) {} #define SASL_OK 0 #define SASL_CONTINUE -1 #endif /* sasl compat */ #endif /* SASL_DEFS_H */ chibicc-1.0.24/test/scalar.c000066400000000000000000000013461517770275000155710ustar00rootroot00000000000000#include "test.h" typedef int myint; typedef int myarr[5]; float add_many(float a, float b, float c, float d, float e) { return a + b + c + d + e; } myarr myarrfunc() { myarr m = {1, 2, 3, 4, 5}; return m; } myint add_many_int(myint a, myint b, myint c, myint d, myint e) { return a + b + c + d + e; } int main() { float x = add_many(1, 2, 3, 4, 5); printf("x = %f\n", x); ASSERT(15, x); myint a = 10; myint b = 5; myint c = 3; myint d = 7; myint e = 8; myint z = a + b + c + d + e; printf("z=%d\n", z); ASSERT(33, z); z = add_many_int(a, b, c, d, e); printf("z=%d\n", z); ASSERT(33, z); myarr t = myarrfunc(); return 0; } chibicc-1.0.24/test/scope.c000066400000000000000000000046001517770275000154310ustar00rootroot00000000000000#include "test.h" #include typedef struct { long i[4]; } S1; S1 gen_S1(int i) { S1 s = {i,i+1,i+2,i+3}; return s; } void *pass(void *ptr){ return ptr; } typedef struct { long i[1]; double d[1]; } M; void va_fn(int i, ...) { va_list ap; ASSERT(55, ( va_start(ap,i), va_arg(ap, M).i[ ({ S1 s = {}; 0; }) ] )); ASSERT(66, ( va_start(ap,i), va_arg(ap, M).d[ ({ S1 s = {}; 0; }) ] )); } int decl_scope(void) { { enum { A = 5 }; struct S { char arr[9]; }; { if (sizeof(enum {A = 7})) (void)sizeof(struct S { char arr[3]; }); ASSERT(5, A); ASSERT(9, sizeof(struct S)); } ASSERT(5, A); ASSERT(9, sizeof(struct S)); { void proto(enum { A = 7 }); void proto2(struct S { char arr[7]; }*); ASSERT(5, A); ASSERT(9, sizeof(struct S)); } } { struct S *p; pass(&(struct S { char arr[7]; }){(enum { A = 6 })0}); ASSERT(7, sizeof(struct S)); ASSERT(7, sizeof(*p)); ASSERT(6, A); } return 1; } int main(void) { ASSERT(1, ({ S1 s = {1,2,3,4}; s; }).i[ ({ S1 s = {}; 0;}) ] ); ASSERT(2, ({ S1 s = {1,2,3,4}; s; }).i[ ({ S1 s = {}; 1;}) ] ); ASSERT(3, ({ S1 s = {1,2,3,4}; s; }).i[ ({ S1 s = {}; 2;}) ] ); ASSERT(4, ({ S1 s = {1,2,3,4}; s; }).i[ ({ S1 s = {}; 3;}) ] ); ASSERT(1, gen_S1(1).i[ ({ S1 s = {}; 0;}) ] ); ASSERT(2, gen_S1(1).i[ ({ S1 s = {}; 1;}) ] ); ASSERT(3, gen_S1(1).i[ ({ S1 s = {}; 2;}) ] ); ASSERT(4, gen_S1(1).i[ ({ S1 s = {}; 3;}) ] ); ASSERT(5, gen_S1(5).i[ gen_S1(0).i[0] ] ); ASSERT(6, gen_S1(5).i[ gen_S1(0).i[1] ] ); ASSERT(7, gen_S1(5).i[ gen_S1(0).i[2] ] ); ASSERT(8, gen_S1(5).i[ gen_S1(0).i[3] ] ); ASSERT(5, ({ S1 s = {5,6,7,8}; s; }).i[ gen_S1(0).i[0] ] ); ASSERT(6, ({ S1 s = {5,6,7,8}; s; }).i[ gen_S1(0).i[1] ] ); ASSERT(7, ({ S1 s = {5,6,7,8}; s; }).i[ gen_S1(0).i[2] ] ); ASSERT(8, ({ S1 s = {5,6,7,8}; s; }).i[ gen_S1(0).i[3] ] ); unsigned long long complit_p1 = (unsigned long long) pass(&(S1[]){0}); unsigned long long complit_p2 = (unsigned long long) pass(&(S1[]){0}); unsigned long long complit_p3 = (unsigned long long) pass(pass(&(S1[]){0})); unsigned long long complit_p4 = (unsigned long long) pass(pass(&(S1[]){0})); ASSERT(1, complit_p1 != complit_p2); ASSERT(1, complit_p2 != complit_p3); ASSERT(1, complit_p3 != complit_p4); va_fn(0, (M){55,66}); ASSERT(1, decl_scope()); printf("OK\n"); return 0; } chibicc-1.0.24/test/segfault.c000066400000000000000000000035641517770275000161420ustar00rootroot00000000000000#include #include #include #include #include #include #include void enable_core_dump() { struct rlimit rl; rl.rlim_cur = RLIM_INFINITY; rl.rlim_max = RLIM_INFINITY; if (setrlimit(RLIMIT_CORE, &rl) == -1) { perror("setrlimit"); exit(EXIT_FAILURE); } } void segfault_handler(int signum) { printf("Segmentation fault (signal %d)\n", signum); abort(); // Generate a core dump } void setup_signal_handlers() { signal(SIGSEGV, segfault_handler); } int main() { enable_core_dump(); setup_signal_handlers(); pid_t pid = fork(); if (pid == -1) { perror("fork"); exit(EXIT_FAILURE); } if (pid == 0) { // Child process code char *path = "~/postgres/tmp_install/usr/local/pgsql/bin:~/postgres:$PATH"; char *ld_library_path = "~/postgres/tmp_install/usr/local/pgsql/lib:$LD_LIBRARY_PATH"; char *initdb_template = "~/postgres/tmp_install/initdb-template"; char *argv[] = { "initdb", "-A", "trust", "-N", "--no-instructions", "--no-locale", initdb_template, NULL }; char *envp[] = { path, ld_library_path, NULL }; execvp(argv[0], argv); perror("execvp"); // execvp only returns on error exit(EXIT_FAILURE); } else { waitpid(pid, NULL, 0); // Wait for the child process to stop // Attach gdb to the child process char cmd[256]; snprintf(cmd, sizeof(cmd), "gdb -ex 'attach %d' -ex 'set pagination off'-ex 'set confirm off' -ex 'continue' -ex 'detach' -ex 'quit'", pid); system(cmd); waitpid(pid, NULL, 0); // Wait for the child process to finish } return 0; } chibicc-1.0.24/test/sem_timedwait_timeout.c000066400000000000000000000026461517770275000207310ustar00rootroot00000000000000#include #include #include #include #include #include #include #include static sem_t sema; static void *late_post(void *arg) { (void)arg; usleep(1000 * 1000); // 1s sem_post(&sema); return NULL; } int main(void) { if (sem_init(&sema, 0, 0) != 0) { perror("sem_init"); return 1; } pthread_t th; if (pthread_create(&th, NULL, late_post, NULL) != 0) { perror("pthread_create"); return 1; } // Mirror CPython _multiprocessing/semaphore.c deadline math. struct timeval now; if (gettimeofday(&now, NULL) != 0) { perror("gettimeofday"); return 1; } double timeout = 0.5; // 500ms long sec = (long)timeout; long nsec = (long)(1e9 * (timeout - sec) + 0.5); struct timespec deadline; deadline.tv_sec = now.tv_sec + sec; deadline.tv_nsec = now.tv_usec * 1000 + nsec; deadline.tv_sec += (deadline.tv_nsec / 1000000000); deadline.tv_nsec %= 1000000000; errno = 0; int rc = sem_timedwait(&sema, &deadline); int err = errno; pthread_join(th, NULL); sem_destroy(&sema); if (rc == 0) { // This means timeout was effectively ignored: bug scenario. printf("FAIL: sem_timedwait succeeded (should timeout)\n"); return 1; } if (err != ETIMEDOUT) { printf("FAIL: sem_timedwait errno=%d expected=%d\n", err, ETIMEDOUT); return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/semaphore.c000066400000000000000000000016321517770275000163050ustar00rootroot00000000000000#include #include #include #include #include "test.h" /* * Note: On modern Linux, `union semun` is typically not declared in headers * due to historical POSIX issues, so we declare it ourselves. */ union semun { int val; struct semid_ds *buf; unsigned short *array; struct seminfo *__buf; }; int main() { struct seminfo seminfo; union semun arg; printf("sizeof(struct seminfo) = %zu\n", sizeof(struct seminfo)); ASSERT(40, sizeof(struct seminfo)); arg.__buf = &seminfo; // For SEM_INFO, .__buf should point to seminfo int ret = semctl(0, 0, SEM_INFO, arg); if (ret < 0) { printf("semctl SEM_INFO failed: %s\n", strerror(errno)); return 1; } printf("semctl SEM_INFO succeeded\n"); printf("seminfo.semusz (used arrays): %d\n", seminfo.semusz); printf("seminfo.semaem (allocated semaphores): %d\n", seminfo.semaem); return 0; } chibicc-1.0.24/test/setjmp.c000066400000000000000000000006751517770275000156320ustar00rootroot00000000000000#include "test.h" #include #include jmp_buf my_jump_buffer; noreturn void foo(int status) { printf("foo(%d) called\n", status); longjmp(my_jump_buffer, status + 1); // will return status+1 out of setjmp } int main(void) { volatile int count = 0; // modified local vars in setjmp scope must be volatile if (setjmp(my_jump_buffer) != 5) // compare against constant in an if foo(++count); }chibicc-1.0.24/test/setjmp2.c000066400000000000000000000032661517770275000157130ustar00rootroot00000000000000#define _GNU_SOURCE #include #include #include #include #include /* * In PostgreSQL this is: PG_exception_stack (thread-local). * We simplify to a global pointer to a jmp_buf. */ static jmp_buf *exception_stack = NULL; static void child_action_with_error(void) { printf("[child] simulating an error -> longjmp\n"); longjmp(*exception_stack, 1); } int main(void) { jmp_buf local_env; /* * Register our jump environment exactly like PG_TRY does. * PG_exception_stack = &local_env; */ exception_stack = &local_env; int jmp_rc = setjmp(local_env); if (jmp_rc != 0) { /* This is the PG_CATCH equivalent */ printf("[parent or child] caught longjmp (rc=%d)\n", jmp_rc); return 0; } /* == PG_TRY block == */ pid_t pid = fork(); if (pid < 0) { perror("fork"); exit(1); } if (pid == 0) { /* ---- CHILD ---- */ printf("[child] running inside forked process\n"); /* * The child inherited the global exception_stack pointer. * PostgreSQL relies on this to still work after fork(). */ child_action_with_error(); /* Should never reach */ printf("[child] ERROR: longjmp failed\n"); _exit(2); } /* ---- PARENT ---- */ printf("[parent] waiting for child\n"); int status; waitpid(pid, &status, 0); if (WIFEXITED(status)) printf("[parent] child exited %d\n", WEXITSTATUS(status)); else if (WIFSIGNALED(status)) printf("[parent] child killed by signal %d\n", WTERMSIG(status)); printf("[parent] normal exit\n"); return 0; } chibicc-1.0.24/test/setjmp3.c000066400000000000000000000004541517770275000157100ustar00rootroot00000000000000// jmp_test.c #include "test.h" #include jmp_buf jb; int f(int x) { if (x == 0) longjmp(jb, 42); return f(x - 1) + 1; } int main(void) { int v = setjmp(jb); if (v == 0) f(100); printf("v=%d\n", v); // must print 42 ASSERT(v, 42); return 0; } chibicc-1.0.24/test/setjmp_opt.c000066400000000000000000000007441517770275000165110ustar00rootroot00000000000000#include "test.h" #include static jmp_buf env; void recurse(int n) { // Use some temporaries to stress stack usage int a = n * 10; int b = n * 20; if (n == 0) { longjmp(env, 1); } recurse(n - 1); // This part is unreachable due to longjmp, but ensures temporaries are live across call ASSERT(0, a + b); } int main() { if (setjmp(env) == 0) { recurse(100); } printf("OK\n"); return 0; }chibicc-1.0.24/test/signbit.c000066400000000000000000000041121517770275000157550ustar00rootroot00000000000000// test-signbit.c #include #include #include "test.h" // #define signbitf(x) __builtin_signbit(x) // #define signbitl(x) __builtin_signbit(x) int main(void) { /* ---------- float ---------- */ { volatile float pz = 0.0f; volatile float nz = -0.0f; volatile float pn = 1.0f; volatile float nn = -1.0f; volatile float pinf = 1.0f / 0.0f; volatile float ninf = -1.0f / 0.0f; volatile float pnan = 0.0f / 0.0f; volatile float nnan = -(0.0f / 0.0f); ASSERT(0, !!signbitf(pz)); ASSERT(1, !!signbitf(nz)); ASSERT(0, !!signbitf(pn)); ASSERT(1, !!signbitf(nn)); ASSERT(0, !!signbitf(pinf)); ASSERT(1, !!signbitf(ninf)); ASSERT(1, !!signbitf(pnan)); ASSERT(0, !!signbitf(nnan)); } /* ---------- double ---------- */ { volatile double pz = 0.0; volatile double nz = -0.0; volatile double pn = 1.0; volatile double nn = -1.0; volatile double pinf = 1.0 / 0.0; volatile double ninf = -1.0 / 0.0; volatile double pnan = 0.0 / 0.0; volatile double nnan = -(0.0 / 0.0); ASSERT(0, !!signbit(pz)); ASSERT(1, !!signbit(nz)); ASSERT(0, !!signbit(pn)); ASSERT(1, !!signbit(nn)); ASSERT(0, !!signbit(pinf)); ASSERT(1, !!signbit(ninf)); ASSERT(1, !!signbit(pnan)); ASSERT(0, !!signbit(nnan)); } /* ---------- long double ---------- */ { volatile long double pz = 0.0L; volatile long double nz = -0.0L; volatile long double pn = 1.0L; volatile long double nn = -1.0L; volatile long double pinf = 1.0L / 0.0L; volatile long double ninf = -1.0L / 0.0L; volatile long double pnan = 0.0L / 0.0L; volatile long double nnan = -(0.0L / 0.0L); ASSERT(0, !!signbitl(pz)); ASSERT(1, !!signbitl(nz)); ASSERT(0, !!signbitl(pn)); ASSERT(1, !!signbitl(nn)); ASSERT(0, !!signbitl(pinf)); ASSERT(1, !!signbitl(ninf)); ASSERT(1, !!signbitl(pnan)); ASSERT(0, !!signbitl(nnan)); } /* ---------- builtin directly ---------- */ { volatile long double x = -0.0L; ASSERT(1, !!__builtin_signbit(x)); } return 0; }chibicc-1.0.24/test/simple_omit.c000066400000000000000000000001501517770275000166350ustar00rootroot00000000000000#include void f(int n) { if (n > 0) f(n - 1); } int main() { f(10); return 0; } chibicc-1.0.24/test/size_t.c000066400000000000000000000007621517770275000156220ustar00rootroot00000000000000 #include #include "test.h" #define SIZEOF_SIZE_T 8 /* Mask to quickly check whether a C 'size_t' contains a non-ASCII, UTF8-encoded char. */ #if (SIZEOF_SIZE_T == 8) # define UCS1_ASCII_CHAR_MASK 0x8080808080808080ULL #elif (SIZEOF_SIZE_T == 4) # define UCS1_ASCII_CHAR_MASK 0x80808080U #else # error C 'size_t' size should be either 4 or 8! #endif int main() { printf("%zu %zu\n", sizeof(size_t), sizeof(void *)); ASSERT(8, sizeof(size_t)); int x = 'abcdef'; return 0; } chibicc-1.0.24/test/sizeof.c000077500000000000000000000057051517770275000156310ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(1, sizeof(char)); ASSERT(2, sizeof(short)); ASSERT(2, sizeof(short int)); ASSERT(2, sizeof(int short)); ASSERT(4, sizeof(int)); ASSERT(8, sizeof(long)); ASSERT(8, sizeof(long int)); ASSERT(8, sizeof(long int)); ASSERT(8, sizeof(char *)); ASSERT(8, sizeof(int *)); ASSERT(8, sizeof(long *)); ASSERT(8, sizeof(int **)); ASSERT(8, sizeof(int(*)[4])); ASSERT(32, sizeof(int*[4])); ASSERT(16, sizeof(int[4])); ASSERT(48, sizeof(int[3][4])); ASSERT(8, sizeof(struct {int a; int b;})); ASSERT(8, sizeof(-10 + (long)5)); ASSERT(8, sizeof(-10 - (long)5)); ASSERT(8, sizeof(-10 * (long)5)); ASSERT(8, sizeof(-10 / (long)5)); ASSERT(8, sizeof((long)-10 + 5)); ASSERT(8, sizeof((long)-10 - 5)); ASSERT(8, sizeof((long)-10 * 5)); ASSERT(8, sizeof((long)-10 / 5)); ASSERT(1, ({ char i; sizeof(++i); })); ASSERT(1, ({ char i; sizeof(i++); })); ASSERT(8, sizeof(int(*)[10])); ASSERT(8, sizeof(int(*)[][10])); ASSERT(4, sizeof(struct { int x, y[]; })); ASSERT(1, sizeof(char)); ASSERT(1, sizeof(signed char)); ASSERT(1, sizeof(signed char signed)); ASSERT(1, sizeof(unsigned char)); ASSERT(1, sizeof(unsigned char unsigned)); ASSERT(2, sizeof(short)); ASSERT(2, sizeof(int short)); ASSERT(2, sizeof(short int)); ASSERT(2, sizeof(signed short)); ASSERT(2, sizeof(int short signed)); ASSERT(2, sizeof(unsigned short)); ASSERT(2, sizeof(int short unsigned)); ASSERT(4, sizeof(int)); ASSERT(4, sizeof(signed int)); ASSERT(4, sizeof(signed)); ASSERT(4, sizeof(signed signed)); ASSERT(4, sizeof(unsigned int)); ASSERT(4, sizeof(unsigned)); ASSERT(4, sizeof(unsigned unsigned)); ASSERT(8, sizeof(long)); ASSERT(8, sizeof(signed long)); ASSERT(8, sizeof(signed long int)); ASSERT(8, sizeof(unsigned long)); ASSERT(8, sizeof(unsigned long int)); ASSERT(8, sizeof(long long)); ASSERT(8, sizeof(signed long long)); ASSERT(8, sizeof(signed long long int)); ASSERT(8, sizeof(unsigned long long)); ASSERT(8, sizeof(unsigned long long int)); ASSERT(1, sizeof((char)1)); ASSERT(2, sizeof((short)1)); ASSERT(4, sizeof((int)1)); ASSERT(8, sizeof((long)1)); ASSERT(4, sizeof((char)1 + (char)1)); ASSERT(4, sizeof((short)1 + (short)1)); ASSERT(4, sizeof(1?2:3)); ASSERT(4, sizeof(1?(short)2:(char)3)); ASSERT(8, sizeof(1?(long)2:(char)3)); ASSERT(1, sizeof(char) << 31 >> 31); ASSERT(1, sizeof(char) << 63 >> 63); ASSERT(4, sizeof(float)); ASSERT(8, sizeof(double)); ASSERT(4, sizeof(1f+2)); ASSERT(8, sizeof(1.0+2)); ASSERT(4, sizeof(1f-2)); ASSERT(8, sizeof(1.0-2)); ASSERT(4, sizeof(1f*2)); ASSERT(8, sizeof(1.0*2)); ASSERT(4, sizeof(1f/2)); ASSERT(8, sizeof(1.0/2)); ASSERT(16, sizeof(long double)); ASSERT(1, sizeof(main)); ASSERT(2147483647,0x7FFFFFFF); ASSERT(2147483646,0x7FFFFFFE); ASSERT(18446744073709551615,0xFFFFFFFFFFFFFFFFUL); ASSERT(4294967295,0x00000000FFFFFFFFUL); printf("OK\n"); return 0; } chibicc-1.0.24/test/sizeof_param.c000066400000000000000000000004531517770275000170010ustar00rootroot00000000000000#include "test.h" void fn1(int z, int a[z], int b1[sizeof(a)]) { ASSERT(8, sizeof(a)); ASSERT(8, sizeof(b1)); } void fn2(int z, int (*a)[z], int b1[sizeof(*a)]) { ASSERT(28, sizeof(*a)); ASSERT(8, sizeof(b1)); } int main() { fn1(7, 0, 0); fn2(7, 0, 0); printf("OK\n"); return 0; }chibicc-1.0.24/test/sizeof_param_simple.c000066400000000000000000000004631517770275000203530ustar00rootroot00000000000000#include "test.h" void fn(int z, int a[z], int b[sizeof(a)]) { ASSERT(8, sizeof(a)); // pointer size ASSERT(8, sizeof(b)); // pointer size (array decays to pointer in parameter) ASSERT(4, sizeof(*a)); ASSERT(4, sizeof(*b)); } int main() { fn(5, 0, 0); printf("OK\n"); return 0; }chibicc-1.0.24/test/sizeof_struct.c000066400000000000000000000002531517770275000172230ustar00rootroot00000000000000 #include "test.h" struct { char c; char arr[]; } s = {1,2,3}; int main(void) { printf("%zu\n",sizeof(s)); // expected 1 ASSERT(1, sizeof(s)); return 0; }chibicc-1.0.24/test/sizeof_tests.c000066400000000000000000000121051517770275000170400ustar00rootroot00000000000000 #include #include "test.h" int main() { printf("sizeof(char) = %ld\n", sizeof(char)); ASSERT(1, sizeof(char)); printf("sizeof(short) = %ld\n", sizeof(short)); ASSERT(2, sizeof(short)); printf("sizeof(int) = %ld\n", sizeof(int)); ASSERT(4, sizeof(int)); printf("sizeof(long) = %ld\n", sizeof(long)); ASSERT(8, sizeof(long)); printf("sizeof(long long) = %ld\n", sizeof(long long)); ASSERT(8, sizeof(long long)); printf("sizeof(float) = %ld\n", sizeof(float)); ASSERT(4, sizeof(float)); printf("sizeof(double) = %ld\n", sizeof(double)); ASSERT(8, sizeof(double)); printf("sizeof(long double) = %ld\n", sizeof(long double)); ASSERT(16, sizeof(long double)); printf("sizeof(void *) = %ld\n", sizeof(void *)); ASSERT(8, sizeof(void *)); printf("sizeof(char *) = %ld\n", sizeof(char *)); ASSERT(8, sizeof(char *)); printf("sizeof(int *) = %ld\n", sizeof(int *)); ASSERT(8, sizeof(int *)); printf("sizeof(long *) = %ld\n", sizeof(long *)); ASSERT(8, sizeof(long *)); printf("sizeof(float *) = %ld\n", sizeof(long *)); ASSERT(8, sizeof(long *)); printf("sizeof(double *) = %ld\n", sizeof(double *)); ASSERT(8, sizeof(double *)); printf("sizeof(long double *) = %ld\n", sizeof(long double *)); ASSERT(8, sizeof(long double *)); printf("sizeof(char[10]) = %ld\n", sizeof(char[10])); ASSERT(10, sizeof(char[10])); printf("sizeof(int[10]) = %ld\n", sizeof(int[10])); ASSERT(40, sizeof(int[10])); printf("sizeof(long[10]) = %ld\n", sizeof(long[10])); ASSERT(80, sizeof(long[10])); printf("sizeof(float[10]) = %ld\n", sizeof(float[10])); ASSERT(40, sizeof(float[10])); printf("sizeof(double[10]) = %ld\n", sizeof(double[10])); ASSERT(80, sizeof(double[10])); printf("sizeof(long double[10]) = %ld\n", sizeof(long double[10])); ASSERT(160, sizeof(long double[10])); printf("sizeof(struct {int a; int b;}) = %ld\n", sizeof(struct {int a; int b;})); ASSERT(8, sizeof(struct {int a; int b;})); printf("sizeof(struct {int a; int b; int c;}) = %ld\n", sizeof(struct {int a; int b; int c;})); ASSERT(12, sizeof(struct {int a; int b; int c;})); printf("sizeof(struct {int a; int b; int c; int d;}) = %ld\n", sizeof(struct {int a; int b; int c; int d;})); ASSERT(16, sizeof(struct {int a; int b; int c; int d;})); printf("sizeof(struct {int a; int b; int c; int d; int e;}) = %ld\n", sizeof(struct {int a; int b; int c; int d; int e;})); ASSERT(20, sizeof(struct {int a; int b; int c; int d; int e;})); printf("sizeof(struct {int a; int b; int c; int d; int e; int f;}) = %ld\n", sizeof(struct {int a; int b; int c; int d; int e; int f;})); ASSERT(24, sizeof(struct {int a; int b; int c; int d; int e; int f;})); printf("sizeof(struct {int a; int b; int c; int d; int e; int f; int g;}) = %ld\n", sizeof(struct {int a; int b; int c; int d; int e; int f; int g;})); ASSERT(28, sizeof(struct {int a; int b; int c; int d; int e; int f; int g;})); printf("sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h;}) = %ld\n", sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h;})); ASSERT(32, sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h;})); printf("sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i;}) = %ld\n", sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i;})); ASSERT(36, sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i;})); printf("sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j;}) = %ld\n", sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j;})); ASSERT(40, sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j;})); printf("sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k;}) = %ld\n", sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k;})); ASSERT(44, sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k;})); printf("sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l;}) = %ld\n", sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l;})); ASSERT(48, sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l;})); printf("sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l; int m;}) = %ld\n", sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l; int m;})); ASSERT(52, sizeof(struct {int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l; int m;})); printf("expected = 18446744073709551615 %lld\n", 0xFFFFFFFFFFFFFFFFULL); printf("__WORDSIZE = %d\n", __WORDSIZE); ASSERT(64, __WORDSIZE); // __uint128_t u128 = 12345678900987654321; printf("%lld\n", (unsigned long long) LONG_MAX); // printf("%llx\n", (unsigned long long)(u128 & 0xFFFFFFFFFFFFFFFF)); printf("%lld\n", (unsigned long long) ULONG_MAX); return(0); }chibicc-1.0.24/test/sizeof_vla.c000066400000000000000000000002431517770275000164600ustar00rootroot00000000000000 #include "test.h" struct { char c; char arr[]; } s = {1,2,3}; int main(void) { printf("%zu\n", sizeof(s)); ASSERT(1, sizeof(s)); return 0; }chibicc-1.0.24/test/sizeof_vla_ptr000077500000000000000000001463501517770275000171410ustar00rootroot00000000000000ELF> @@@8 @! @@@@@@@@@((@@bb@@||@@(((@(@88@8@ XX@X@ @@Std88@8@ QtdRtd@@/lib64/ld-linux-x86-64.so.2GNUGNU@ exit__libc_start_mainprintflibc.so.6GLIBC_2.2.5GLIBC_2.34__gmon_start__ui )5ȟ@П@؟@@HHɏHtH1I^HHPTE11H @f.f.8@H=8@tHt 8@fff.@8@H8@HH?HHHtHt8@ff.@=YuUHzG]Ðff.@UHHHDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEHEHEHEHEHEHEDž0Dž40H8H8H@H@HHHHPHXH`LhLpxMU]emu}HHcPHPH?_^I°AHHdPH_I°AHHHH]UHH0}HuHHEHEHcH}HcHEHEH}H8HH$PHEHPHHEHEHcH}PH.n@_^ZI°AHH]UHH0H}uUHEHHHcHEHH}9Ht5HEHcPHEHcPHEHPH_^ZI°AHHEHHEHEHHHcH}HHEHEHHHH}HHEHEH}H8HHEHHEHEH}H8HHHEHEHHHcH}HEHEHHH}؉8HHEHH]UHH0H}uUHEHHHcHEH0H}9Ht5HEHcPHEHcPHEHPH_^ZI°AHHEHHEHEHHHcH}HHEHEHHHH}HHEHEH}H8HHEHHEHEH}H8HHHEHEHHHcH}HEHEHHH}؉8HHEHH]UHH@H}uUHEHEHHHHEHEH}H8HHEHcHEHH}9HtnHHEHEHcH})HHcHEHHcHEHEHcHcHEHEHH}HH}H)H}H!HEHEH}H8HHHcHEHHcHEHHcHEHEHcHcHEHEHH}HH}HH}HHH}HHEHEHHH}H8HHEHH]UHH HEHEHEHDžHDžHDžHDžHDž HDž(HDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEDžDž0HHHHHH H(H0L8L@HXhxemu}HHEHHHLLL@LGL@LGHHHEHEHHHLLHHEHHEHH8HHEHHHEHHHEH8HHHHEHcH9Ht0HPHPHEPHNV_^ZI°AHHHHEHcH9Ht-HPHPHEPHT_^ZI°AH+HPHPHEPHV_^ZI°AHHEHHXHHEHHHGHGHGHGHGHGHGHH]UHHpHEHEHEHEHEHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDž HDž(HDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEDžDž0HHHHHHHHLL(8HXhx}HHHEHHHLLL@LGL@LGHHHEHEHEHHHLLL@LGHHHHHcHHHHEHHHHHEHH8HHEHHHHEHH(H<$HHHHcHHHHHHHcHHHEHHHEH8HHEHHHHEHcH9Ht0HPHPHEPHQ_^ZI°AHHHHEHcH9Ht-HPHPHEPHP_^ZI°AH+HPHPHEPH1R_^ZI°AHHLLL@LGHHHHHHH(,$HH?HEHHHGHGHGHGHGHGHGHHHWHWHW HW HW HW HW HWH]UHHpHEHEHEHEHEHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDž HDž(HDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEDžDž0HHHHHHHHLL(8HXhxHEHHHLLL@LGL@LGHHHEHEHH*HEHHHEH8HHHcHHEHcH9HHEHEHEHEHHHEH8HHEHHHHEHcH9Ht0HPHPHEPHL_^ZI°AHHHHEHcH9Ht-HPHPHEPHXK_^ZI°AH+HPHPHEPHM_^ZI°AHHLLL@LGHHLLL@LGHHEHHEHH8HHEHHHEHHH*HEHXHEHXHHEHHEHH8HHEHHcHHEH8HHEHHHEHH8HHHHEHHcHHHEHH8HHEHc?HE,H]UHHpHEHEHEHEHEHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDž HDž(HDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEDžDž0HHHHHHHHLL(8HXhxHEHHHLLL@LGL@LGHHHEHEHH*HEHHHEH8HHHcHHEHcH9HHEHEHEHEHHHEH8HHEHHHHEHcH9Ht0HPHPHEPHG_^ZI°AHHHHEHcH9Ht-HPHPHEPHF_^ZI°AH+HPHPHEPHNH_^ZI°AHHLLL@LGHHLLL@LGHHEHHEHH8HHEHHHEHHEHXHEHXHHEHHEHH8HHEHHcHHEH8HHEHHHEHH8HHHHEHHcHHHEHH8HHEHcCHE,H]UHHpHEHEHEHEHEHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDž HDž(HDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEDžDž0HHHHHHHHLL(8HXhxHEHHHLLL@LGL@LGHHHEHHcHHEHH8HEHHHEH8HHHcHHEHcH9HHEHEHEHEHHHEH8HHEHHHHEHcH9Ht0HPHPHEPHwB_^ZI°AHHHHEHcH9Ht-HPHPHEPH@_^ZI°AH+HPHPHEPHC_^ZI°AHHLLL@LGHHLLL@LGHHEHHEHH8HHEHHHHEHHHHHHEHHHHHHEHHH8HHEHHEHH8HHEHHcHHEH8HHEHHHEHH8HHHHEHHcHHHEHH8HHEHcJHEHH]UHHHDž@HDžHHDžPHDžpHDžxHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDžHDž HDž(HDž0Džp0DžtHxHxHHHHHHLL(@o@nmlDkd`\XTPDLH@H8HpH8LLL@LGL@LGHHHDž`HDžhH`H8HEHcH0HLHcH0D$D$H8?H`H8HxH8H8HHxHH8HxH(H<$DžtHH0HtH08HHH0HtHcH09Ht3HPHPH@PH<_^ZI°AHHH0HtHcH09Ht0HPHPH@PH\;_^ZI°AH.HPHPH@PH=_^ZI°AH(,$HH8?H`H8HEH8H8HHEHH8HEH(H<$EHH0HEH08HHH0HEHcH09Ht3HPHPH@PH;_^ZI°AHHH0HEHcH09Ht0HPHPH@PH9_^ZI°AH.HPHPH@PH<_^ZI°AHHcD$D$,$HH8?H`H8HEH8H8HHEHH8HEH(H<$EHH0HEH08HHH0HEHcH09Ht3HPHPH@PH:_^ZI°AHHH0HEHcH09Ht0HPHPH@PHq8_^ZI°AH.HPHPH@PH:_^ZI°AHHcD$D$,$HH8?H`H8HEH8H8HHEHH8HEH(H<$EHH0HEH08HHH0HEHcH09Ht3HPHPH@PH8_^ZI°AHHH0HEHcH09Ht0HPHPH@PH6_^ZI°AH.HPHPH@PH%9_^ZI°AHD$D$,$HH8?H`H8HEH8H8HHEHH8HEH(H<$EHH0HEH08HHH0HEHcH09Ht3HPHPH@PH7_^ZI°AHHH0HEHcH09Ht0HPHPH@PHz5_^ZI°AH.HPHPH@PH7_^ZI°AHD$D$,$HH8?H`H8HEH8H8HHEHH8HEH(H<$EHH0HEH08HHH0HEHcH09Ht3HPHPH@PH5_^ZI°AHHH0HEHcH09Ht0HPHPH@PH3_^ZI°AH.HPHPH@PH+6_^ZI°AHD$D$,$HH8?H`H8HEH8H8HHEHH8HEH(H<$EHH0HEH08HHH0HEHcH09Ht3HPHPH@PH4_^ZI°AHHH0HEHcH09Ht0HPHPH@PH2_^ZI°AH.HPHPH@PH4_^ZI°AHD$D$,$HH8?H`H8HEH8H8HHEHH8HEH(H<$EHH0HEH08HHH0HEHcH09Ht3HPHPH@PH2_^ZI°AHHH0HEHcH09Ht0HPHPH@PH1_^ZI°AH.HPHPH@PH13_^ZI°AHHcD$D$,$HH8?H`H8HEH8H8HHEHH8HEH(H<$EHH0HEH08HHH0HEHcH09Ht3HPHPH@PH1_^ZI°AHHH0HEHcH09Ht0HPHPH@PH/_^ZI°AH.HPHPH@PH1_^ZI°AH(,$HH8?H`(|$D$ fD$l$\$l$D$H]UHHH}HuHUHMLELMEMHEHEHEHEHEHEHEH*EHEHEHEH*EHEHEHEH*EHEHxHEH*pHEHhHEH*`HEHXHEH*PHEHHHEH*@HEH8HEH*8X@XHXPXXX`XhXpXxXMXMXMXMXMXMXMXMXH]UHHEMU]emu}@}@uވU݈MDEDMHE(HEHEHEHE H*EHEH*EHEHEHEHEHEHEHEHEHEHEHEHEHEHxHEHpHEHHhHEHH`HEHHXHEHHPHEHHHHEHHHHPHXH`Hh*pXxXMXMXMXMXMXMXMXMXMXMXH]UHH@}@uUMDEDMEMU]emu}HE(HEHEHEHE H*EHEH*EHEHEHEHEHEHEHEHEHEHEHEHEHEHxHEHpHEHHhHEHH`HEHHXHEHHPHEHHHHEHHHHPHXH`Hh*pXxXMXMXMXMXMXMXMXMXMXMXH]UHH0H}HEHEEHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HH HEHHEHHcH}HHEHEHH}HH}@8HH HEHHEH HcH}HHEHEHH}HH}@8HH HEHHEH HcH}HHEHEHH}HH}@8HH HEHHEH HcH}HHEHEHH}HH}@8HH HEHHEH HcH}HHEHEHH}HH}@8HHHEHHEH HcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHEH}LLL@LGD@DGHH]UHH HEfEH HEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HH(HEHHEHHcH}HHEHEHH}HH}@8HH2HEHHEHHcH}HHEHEHH}HH}@8HH<HEHHEHHcH}HHEHEHH}HH}@8HHFHEHHEHHcH}HHEHEHH}HH}@8HHPHEHHEHHcH}HHEHEHH}HH}@8HHZHEHHEHHcH}HHEHEHH}HH}@8HHdHEHHEH HcH}HHEHEHH}HH}@8HHEHHHGHGHGHGHGHGHGHHHW HWH]UHH fEEH HEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHHEHHEHHcH}HHEHEHH}HH}@8HHEHHHGHGHH]UHH HEHEH HEHEHH}8HHEHHEH*H}HEHHEH*H}HEHHHGHGHGHGHGHGHGHGH]UHH HEEH HEHEHH}8HHHEHEHH}8HHHEHEHH}f8HH(HEHEH H}@8HHEHHHGHGHGHGHGHGHGHHHW HW HW HWH]UHH}HEHc9t9t'HEHHHEHH HEHHH]UHH @}H@}H@}HuHHEHEHcHcH}HHEHEHH}HH]UHH H}EuHEHc9t9t!1HEHHc$HEH,HEH,H]UHHH}uUHEHc9t09t9t)4HEHHc'HEHHcHEH HEH H]UHHEMU]emu}HEEHEEHEEHEEHEEHEEHEEHEEHExHExXMXMXMXMXMXMXMXMXH]UHHpEMU]emu}HEEHEEHEEHEEHEEHEEHEEHEEHEEHEMXMXMXMXMXMXMXMXMXH]UHHp}uUMDEDMHE(HcHEHE HcHEHEHcHEHEHcHEHEHcHEHEHcHEHEHcHEHEHcHEHEHcHEHEHcH}H}H}H}H}H}H}H}H}H]UHH EMHEEHEMXH]UHH EMHEEHEMXH]UHH@HEHEHEHDžHDžHDžHDžHDžHDžHDžHDžHDž HDž(HDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEDžDž0HHHHHHHHLL (8HXhxu}HEHHHLLL@LGL@LGHHEHHHEH8HEHHHEH8HHHcHHEHcH9H HEHHEHH8HEHHHEH8HHHHEHcH9Ht0HPHPHEPH_^ZI°AHHHHEHcH9Ht-HPHPHEPH!_^ZI°AH+HPHPHEPHR_^ZI°AHHcHHEHHcHHHEHH8HHEHHEHH8HHEHHcHHEH8HHEHHHEHH8HHHHEHHcHHHEHH8HHEHcHEHcH]UHHHDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEHEHEHEHEHEHEDž0Dž40H8H8H@H@HHHHPHXH`LhLpxMU]emu}HH(HH HHHHHH )H()H]UHHHDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEHEHEHEHEHEHEDž0Dž40H8H8H@H@HHHHPHXH`LhLpxMU]emu}HH(HH H HHHHH )H()H]UHHHDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEHEHEHEHEHEHEDž0Dž40H8H8H@H@HHHHPHXH`LhLpxMU]emu}HH(HH HHHHHH )H()H]UHHHDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEHEHEHEHEHEHEDž0Dž40H8H8H@H@HHHHPHXH`LhLpxMU]emu}HH(HH H HHHHH )H()H]UHHHDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEHEHEHEHEHEHEDž0Dž40H8H8H@H@HHHHPHXH`LhLpxMU]emu}HH(HH HH HH(H]UHHHDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEHEHEHEHEHEHEDž0Dž40H8H8H@H@HHHHPHXH`LhLpxMU]emu}HH(HH HH HH(H]UHHHDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEHEHEHEHEHEHEDž0Dž40H8H8H@H@HHHHPHXH`LhLpxMU]emu}HH]UHHHDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEHEHEHEHEHEHEDž0Dž40H8H8H@H@HHHHPHXH`LhLpxMU]emu}HH]UHH}HEHcH]UHH}HEHcH]UHHHDž0HDž8HDž@HDžHHDžPHDžXHDž`HDžhHDžpHDžxHEHEHEHEHEHEHEHEHEHEHEHEHEHEHEDž0Dž40H8H8H@H@HHHHPHXH`LhLpxMU]emu}HH]UHH@H}HuHUHMLELMHEHPHHUHEHEHPHH}HuH1H1H HHEHPHEHcPHEHPHT@PH 4_^ZYI°AHHEHPHRPH_^I°AHH?PH3_I°AHHEHPHRPHM_^I°AHH?PH3_I°AHHPH3_I°AHH]UHH@H}HuHEHEHEHEHEHPHH}HHWHEHEHPHHEHEH}H8HHEH@HUHEHEHPHH}HuHH@s HH H@HHH1HEHEH}H8HHEHPHEHPH%?PH2_^ZI°AHH]UHH0H}HuHUHEHHEHEHH}H9Ht0HEHPHEHPHQ?PH 2_^ZI°AHSHEHPHEHPHEHPH>PH1_^ZYI°AHHPH1_I°AHH]UHH }uHUHEHcHEHEHcH}9Ht0HEHcPHEHPH?PHD1_^ZI°AHSHEHcPHEHcPHEHPH>PH 1_^ZYI°AHHPH0_I°AHH]UHH0H}uUHEHHHcHEHH}9Ht5HEHcPHEHcPHEHPH_^ZI°AHHEHHEHEHHHcH}HHEHEHHHH}HHEHEH}H8HHEHHEHEH}H8HHHEHEHHHcH}HEHEHHH}؉8HHEHH]UHH0H}uUHEHHHcHEH0H}9Ht5HEHcPHEHcPHEHPH_^ZI°AHHEHHEHEHHHcH}HHEHEHHHH}HHEHEH}H8HHEHHEHEH}H8HHHEHEHHHcH}HEHEHHH}؉8HHEHH]UHH@H}uUHEHEHHHHEHEH}H8HHEHcHEHH}9HtnHHEHEHcH})HHcHEHHcHEHEHcHcHEHEHH}HH}H)H}H!HEHEH}H8HHHcHEHHcHEHHcHEHEHcHcHEHEHH}HH}HH}HHH}HHEHEHHH}H8HHEHH]HHzRx &D0zRx  C  <OC } X.C * tȓ.C * ۔^C Z -C  C  ٞ:C 6 6C 2 +C ' 8#MC I TUGC C p/C + /C + C  xFC B C  C  AC  4#SC O P[\C X lfC b pC l < C   .C  C  6C r 6C r (C  DiC  `C  |C  pC  C  C  IC | C | $C T <C T TC | pz=C 9 C  qC  C  .C * .C * ^C Z @@ @ r@@ @x@o@8@@ O @` o@oo@(@OK mainmainmainsizeof(*a)fnfnfn__va_arg_fp__va_arg_fp__va_arg_fp__va_arg_gp__va_arg_gp__va_arg_gp__va_arg_mem__va_arg_mem__va_arg_memstruct_test181struct_test181struct_test181struct_test171struct_test171struct_test171struct_test161struct_test161struct_test161struct_test151struct_test151struct_test151struct_test141struct_test141struct_test141struct_test131struct_test131struct_test131struct_test121struct_test121struct_test121struct_test111struct_test111struct_test111struct_test101struct_test101struct_test101struct_test28struct_test28struct_test28struct_test27struct_test27struct_test27struct_test26struct_test26struct_test26struct_test25struct_test25struct_test25struct_test24struct_test24struct_test24struct_test7struct_test7struct_test7struct_test6struct_test6struct_test6struct_test5struct_test5struct_test5struct_test4struct_test4struct_test4add10_doubleadd10_doubleadd10_doubleadd10_floatadd10_floatadd10_floatadd10_intadd10_intadd10_intadd_doubleadd_doubleadd_doubleadd_floatadd_floatadd_floatadd_alladd_alladd_allsshort_fnsshort_fnsshort_fnschar_fnschar_fnschar_fnushort_fnushort_fnushort_fnuchar_fnuchar_fnuchar_fnshort_fnshort_fnshort_fnchar_fnchar_fnchar_fntrue_fntrue_fntrue_fnfalse_fnfalse_fnfalse_fnext_fn2ext_fn2ext_fn2ext_fn1ext_fn1ext_fn1@static_fnstatic_fnstatic_fn but got %s:%d: %s => want assert128assert128assert128(%lld, %llu)print_i128print_i128print_i128%s => %lld expected but got %lld %s => %lld assert64assert64assert64%s => %d expected but got %d %s => %d assertassertassert__uint64_identity__uint64_identity__uint64_identity__uint32_identity__uint32_identity__uint32_identity__uint16_identity__uint16_identity__uint16_identity__bswap_64__bswap_64__bswap_64__bswap_32__bswap_32__bswap_32__bswap_16__bswap_16__bswap_16__va_arg_fp__va_arg_fp__va_arg_fp__va_arg_gp__va_arg_gp__va_arg_gp__va_arg_mem__va_arg_mem__va_arg_memGCC: (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0,@,@[@@-9 @@@X@>X@@J@@W@@($@r@c-o$@@W$p@Sq@>n@$p@JSq@r@~@ @ @C%@C%@z*@z*@/@/@?@?@V@>V@W@W@8W@8W@oW@oW@[@[@]@]@_@_@Sa@Sa@c@c@d@d@f@f@h@h@i@i@i@i@i@i@5k@5k@sl@ sl@dm@dm@.n@.n@n@%.? I;%.? I;  test/usr/include/usr/include/x86_64-linux-gnu/bits/usr/include/x86_64-linux-gnu/sys/usr/include/x86_64-linux-gnu/gnu./include/usr/include/x86_64-linux-gnu/bits/typessizeof_vla_ptr.ctest.hstdio.hlibc-header-start.hfeatures.hfeatures-time64.hwordsize.htimesize.hwordsize.hstdc-predef.hcdefs.hwordsize.hlong-double.hstubs.hstubs-64.hstddef.hstdarg.htypes.hwordsize.htimesize.hwordsize.htypesizes.htime64.h__fpos_t.h__mbstate_t.h__fpos64_t.h__FILE.hFILE.hstruct_FILE.hcookie_io_functions_t.hstdio_lim.hfloatn.hfloatn-common.hlong-double.h }@ (w$#)-45VPr45VPo(-n|`  test./include/usr/include/usr/include/x86_64-linux-gnu/bits/usr/include/x86_64-linux-gnu/sys/usr/include/x86_64-linux-gnu/gnu/usr/include/x86_64-linux-gnu/bits/typescommonstdarg.hstdio.hlibc-header-start.hfeatures.hfeatures-time64.hwordsize.htimesize.hwordsize.hstdc-predef.hcdefs.hwordsize.hlong-double.hstubs.hstubs-64.hstddef.htypes.hwordsize.htimesize.hwordsize.htypesizes.htime64.h__fpos_t.h__mbstate_t.h__fpos64_t.h__FILE.hFILE.hstruct_FILE.hcookie_io_functions_t.hstdio_lim.hfloatn.hfloatn-common.hlong-double.hstdlib.hlibc-header-start.hwaitflags.hwaitstatus.hlocale_t.h__locale_t.htypes.hclock_t.hclockid_t.htime_t.htimer_t.hstdint-intn.hendian.hendian.hendianness.hbyteswap.huintn-identity.hselect.hselect.hsigset_t.h__sigset_t.hstruct_timeval.hstruct_timespec.hpthreadtypes.hthread-shared-types.hpthreadtypes-arch.hwordsize.hatomic_wide_counter.hstruct_mutex.hstruct_rwlock.halloca.hstdlib-float.h @}}.*~.h~X^~X(~X"&g}}.:~s~X^~X(~Xbf~~.)V~~X^~X(~XFh~~.)V~~X^~X(~XFh~~.*V~~X^~X(~XFy`~~.Z~Fq~a~(~.~=h~^~(~7~=h~^~(~7~=h~^~(~:~=h~^~(~:~=h~^~(~:~=h~^~(~:~=h~^~(~7~=h~^~(~.c^X;der6;z;u6;z;j yxy5xN!t)&sE7vL5K7.%VmhmX^mX(mX-w}u.H7""r3.%[qG.07s3-07#345VPr45VPo(-n|test/sizeof_vla_ptr.c/home/stormalf/chibiccGNU AS 2.42main__va_arg_fp__va_arg_mem__va_arg_gptest/commonstruct_test181struct_test171struct_test161struct_test151struct_test141struct_test131struct_test121struct_test111struct_test101struct_test28struct_test27struct_test26struct_test25struct_test24struct_test7struct_test6struct_test5struct_test4add10_doubleadd10_floatadd10_intadd_doubleadd_floatadd_allsshort_fnschar_fnushort_fnuchar_fntrue_fnfalse_fnext_fn2ext_fn1static_fnassert128print_i128assert64assertX@  `@ @2 @H4@T @{ @@ X@/ @_ @/8@ $p@/ n@/ Sq@_ i@x@(@@- z*@,< i@D oW@L Sa@Uu @r f@ @z @1@ sl@ r@ 9U@ 5k@>@` d@ ?@H h@@ R@] S@q @ Q@  [@* O@8 F@F C%@7U >V@_ ]@hs@ 8W@7 .n@ @@ lD@0 $@ i@ W@7@@ P@y @& 4@ /@N% @! c@* dm@3  @;B _@@L R@TY SS@gf P@t8@ L@G #include __attribute__((noinline)) void recursive(int depth, char **base) { volatile char local; // Capture the deepest stack address (first call) if (depth == 0) *base = (char *)&local; // Prevent tail-call elimination if (depth < 100000) { recursive(depth + 1, base); } else { char *end = (char *)&local; long total = *base - end; printf("Stack usage for %d calls: %ld bytes\n", depth, total); printf("Average stack usage per call: %.2f bytes\n", (double)total / depth); } } int main(void) { char *base = 0; recursive(0, &base); return 0; } chibicc-1.0.24/test/stack_usage.c000066400000000000000000000002541517770275000166120ustar00rootroot00000000000000#include void f(int depth) { char buf[64]; // stack allocation printf("%p\n", (void*)&buf); if (depth < 10) f(depth+1); } int main() { f(0); } chibicc-1.0.24/test/static_assert_1.c000066400000000000000000000001071517770275000174060ustar00rootroot00000000000000#include int main() { static_assert(3 < 4, "hello"); } chibicc-1.0.24/test/static_assertion.c000066400000000000000000000004631517770275000177010ustar00rootroot00000000000000#include "test.h" #include struct S { int : 3; struct Inner{ int :3; } i; _Static_assert(sizeof(struct Inner) == 1); }; _Static_assert(offsetof(struct S, i) == 1); int main(void) { for (_Static_assert(1); 0;) { _Static_assert(1, "msg"); } printf("OK\n"); return 0; }chibicc-1.0.24/test/stats_prefix.h000066400000000000000000000034731517770275000170470ustar00rootroot00000000000000#ifndef STATS_PREFIX_H #define STATS_PREFIX_H /* The stats prefix subsystem stores detailed statistics for each key prefix. * Simple statistics like total number of GETS are stored by the Stats * subsystem defined elsewhere. * * Suppose the prefix delimiter is ":", then "user:123" and "user:456" both * have the same prefix "user". */ /* Initialize the stats prefix subsystem. Should be called once before other * functions are called. The global hash initialization should be done before * using this subsystem. */ void stats_prefix_init(char prefix_delimiter); /* Clear previously collected stats. Requires you to have the acquired * the STATS_LOCK() first. */ void stats_prefix_clear(void); /* Record a GET for a key */ void stats_prefix_record_get(const char *key, const size_t nkey, const bool is_hit); /* Record a DELETE for a key */ void stats_prefix_record_delete(const char *key, const size_t nkey); /* Record a SET for a key */ void stats_prefix_record_set(const char *key, const size_t nkey); /* Return the collected stats in a textual for suitable for writing to a client. * The size of the output text is stored in the length parameter. * Returns NULL on error */ char *stats_prefix_dump(int *length); /* Visible for testing */ #define PREFIX_HASH_SIZE 256 typedef struct _prefix_stats PREFIX_STATS; struct _prefix_stats { char *prefix; size_t prefix_len; uint64_t num_gets; uint64_t num_sets; uint64_t num_deletes; uint64_t num_hits; PREFIX_STATS *next; }; /* Return the PREFIX_STATS structure for the specified key, creating it if * it does not already exist. Returns NULL if the key does not contain * prefix delimiter, or if there was an error. Requires you to have acquired * STATS_LOCK() first. */ PREFIX_STATS *stats_prefix_find(const char *key, const size_t nkey); #endif chibicc-1.0.24/test/stdhdr.c000077500000000000000000000002771517770275000156210ustar00rootroot00000000000000#include "test.h" #include #include #include #include #include #include int main() { printf("OK\n"); return 0; } chibicc-1.0.24/test/stmtexpr2.c000066400000000000000000000010001517770275000162570ustar00rootroot00000000000000#include "test.h" struct S { int a, b; }; int main() { struct S s1 = {11,-22 }; ASSERT(11, ({ ({ s1; }).a; })); ASSERT(-22, ({ ({ s1; }); }).b ); ASSERT(11, ({ ({ struct S s2 = s1; s2; }).a; })); ASSERT(-22, ({ ({ struct S s2 = s1; s2; }); }).b ); ASSERT(11, ({ ({(struct S){11,22}; }).a; })); ASSERT(22, ({ ({(struct S){11,22}; }); }).b ); ASSERT(sizeof(void*), sizeof ({ int arr[17]; arr; }) ); ASSERT(sizeof(void*), sizeof ({ int arr[s1.a]; arr; }) ); printf("OK\n"); return 0; }chibicc-1.0.24/test/string.c000077500000000000000000000032341517770275000156330ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(0, ""[0]); ASSERT(1, sizeof("")); ASSERT(97, "abc"[0]); ASSERT(98, "abc"[1]); ASSERT(99, "abc"[2]); ASSERT(0, "abc"[3]); ASSERT(4, sizeof("abc")); ASSERT(7, "\a"[0]); ASSERT(8, "\b"[0]); ASSERT(9, "\t"[0]); ASSERT(10, "\n"[0]); ASSERT(11, "\v"[0]); ASSERT(12, "\f"[0]); ASSERT(13, "\r"[0]); ASSERT(27, "\e"[0]); ASSERT(106, "\j"[0]); ASSERT(107, "\k"[0]); ASSERT(108, "\l"[0]); ASSERT(7, "\ax\ny"[0]); ASSERT(120, "\ax\ny"[1]); ASSERT(10, "\ax\ny"[2]); ASSERT(121, "\ax\ny"[3]); ASSERT(0, "\0"[0]); ASSERT(16, "\20"[0]); ASSERT(65, "\101"[0]); ASSERT(104, "\1500"[0]); ASSERT(0, "\x00"[0]); ASSERT(119, "\x77"[0]); ASSERT(7, sizeof("abc" "def")); ASSERT(9, sizeof("abc" "d" "efgh")); ASSERT(0, strcmp("abc" "d" "\nefgh", "abcd\nefgh")); ASSERT(0, !strcmp("abc" "d", "abcd\nefgh")); ASSERT(0, strcmp("\x9" "0", "\t0")); ASSERT(16, sizeof(L"abc" "")); ASSERT(28, sizeof(L"abc" "def")); ASSERT(28, sizeof(L"abc" L"def")); ASSERT(14, sizeof(u"abc" "def")); ASSERT(14, sizeof(u"abc" u"def")); ASSERT(L'a', (L"abc" "def")[0]); ASSERT(L'd', (L"abc" "def")[3]); ASSERT(L'\0', (L"abc" "def")[6]); ASSERT(u'a', (u"abc" "def")[0]); ASSERT(u'd', (u"abc" "def")[3]); ASSERT(u'\0', (u"abc" "def")[6]); ASSERT(L'あ', ("あ" L"")[0]); ASSERT(0343, ("\343\201\202" L"")[0]); ASSERT(0201, ("\343\201\202" L"")[1]); ASSERT(0202, ("\343\201\202" L"")[2]); ASSERT(0, ("\343\201\202" L"")[3]); ASSERT(L'a', ("a" "b" L"c")[0]); ASSERT(L'b', ("a" "b" L"c")[1]); ASSERT(L'c', ("a" "b" L"c")[2]); ASSERT(0, ("a" "b" L"c")[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/string2.c000066400000000000000000000041501517770275000157100ustar00rootroot00000000000000#include "test.h" #include #include char str[] = {"foobar"}; char16_t str16[] = (u"foobar"); char32_t str32[] = ((U"foobar")); wchar_t strw[] = {((L"foobar"))}; int main(void){ ASSERT(1, _Generic( str, char *: 1)); ASSERT(1, _Generic( str16, char16_t *: 1)); ASSERT(1, _Generic( str32, char32_t *: 1)); ASSERT(1, _Generic( strw, wchar_t *: 1)); ASSERT(7 * sizeof(char), sizeof(str)); ASSERT(7 * sizeof(char16_t), sizeof(str16)); ASSERT(7 * sizeof(char32_t), sizeof(str32)); ASSERT(7 * sizeof(wchar_t), sizeof(strw)); ASSERT('f', str[0]); ASSERT('o', str[1]); ASSERT('o', str16[2]); ASSERT('b', str32[3]); ASSERT('a', strw[4]); char *arr[] = { "fo", {"oba"}, ("rfoob"), {(("ar"))} }; ASSERT(1, !strcmp("fo", arr[0]) ); ASSERT(1, !strcmp("oba", arr[1]) ); ASSERT(1, !strcmp("rfoob", arr[2]) ); ASSERT(1, !strcmp("ar", arr[3]) ); struct S { char *p; char a[4]; int i; }; struct S sarr[] = { "foobar", "baz", 11, ("xxx","foobaz"), (("bar")), 22, }; ASSERT(1, !strcmp("foobar", sarr[0].p) ); ASSERT(1, !strcmp("baz", sarr[0].a) ); ASSERT(1, !strcmp("foobaz", sarr[1].p) ); ASSERT(1, !strcmp("bar", sarr[1].a) ); { struct Flex { int i; char arr[]; }; static struct Flex gflex = {12, "345"}; ASSERT(12, gflex.i); ASSERT('3', gflex.arr[0]); ASSERT('4', gflex.arr[1]); ASSERT('5', gflex.arr[2]); ASSERT('\0', gflex.arr[3]); #if defined(__slimcc__) || defined(__widcc__) || defined(__chibicc__) struct Flex lflex = {6, "789"}; ASSERT(6, lflex.i); ASSERT('7', lflex.arr[0]); ASSERT('8', lflex.arr[1]); ASSERT('9', lflex.arr[2]); ASSERT('\0', lflex.arr[3]); #endif } { char c1 = "foobar"[4]; char c2 = { "foobar"[4] }; char a1[] = { "foobar"[4] }; static char sc1 = "foobar"[4]; static char sc2 = { "foobar"[4] }; static char sa1[] = { "foobar"[4] }; ASSERT('a', c1); ASSERT('a', c2); ASSERT('a', sc1); ASSERT('a', sc1); ASSERT('a', a1[0]); ASSERT('a', sa1[0]); ASSERT(1, sizeof(a1)); ASSERT(1, sizeof(sa1)); } printf("OK\n"); return 0; } chibicc-1.0.24/test/struct.c000077500000000000000000000064561517770275000156620ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(1, ({ struct {int a; int b;} x; x.a=1; x.b=2; x.a; })); ASSERT(2, ({ struct {int a; int b;} x; x.a=1; x.b=2; x.b; })); ASSERT(1, ({ struct {char a; int b; char c;} x; x.a=1; x.b=2; x.c=3; x.a; })); ASSERT(2, ({ struct {char a; int b; char c;} x; x.b=1; x.b=2; x.c=3; x.b; })); ASSERT(3, ({ struct {char a; int b; char c;} x; x.a=1; x.b=2; x.c=3; x.c; })); ASSERT(0, ({ struct {char a; char b;} x[3]; char *p=x; p[0]=0; x[0].a; })); ASSERT(1, ({ struct {char a; char b;} x[3]; char *p=x; p[1]=1; x[0].b; })); ASSERT(2, ({ struct {char a; char b;} x[3]; char *p=x; p[2]=2; x[1].a; })); ASSERT(3, ({ struct {char a; char b;} x[3]; char *p=x; p[3]=3; x[1].b; })); ASSERT(6, ({ struct {char a[3]; char b[5];} x; char *p=&x; x.a[0]=6; p[0]; })); ASSERT(7, ({ struct {char a[3]; char b[5];} x; char *p=&x; x.b[0]=7; p[3]; })); ASSERT(6, ({ struct { struct { char b; } a; } x; x.a.b=6; x.a.b; })); ASSERT(4, ({ struct {int a;} x; sizeof(x); })); ASSERT(8, ({ struct {int a; int b;} x; sizeof(x); })); ASSERT(8, ({ struct {int a, b;} x; sizeof(x); })); ASSERT(12, ({ struct {int a[3];} x; sizeof(x); })); ASSERT(16, ({ struct {int a;} x[4]; sizeof(x); })); ASSERT(24, ({ struct {int a[3];} x[2]; sizeof(x); })); ASSERT(2, ({ struct {char a; char b;} x; sizeof(x); })); ASSERT(0, ({ struct {} x; sizeof(x); })); ASSERT(8, ({ struct {char a; int b;} x; sizeof(x); })); ASSERT(8, ({ struct {int a; char b;} x; sizeof(x); })); ASSERT(8, ({ struct t {int a; int b;} x; struct t y; sizeof(y); })); ASSERT(8, ({ struct t {int a; int b;}; struct t y; sizeof(y); })); ASSERT(2, ({ struct t {char a[2];}; { struct t {char a[4];}; } struct t y; sizeof(y); })); ASSERT(3, ({ struct t {int x;}; int t=1; struct t y; y.x=2; t+y.x; })); ASSERT(3, ({ struct t {char a;} x; struct t *y = &x; x.a=3; y->a; })); ASSERT(3, ({ struct t {char a;} x; struct t *y = &x; y->a=3; x.a; })); ASSERT(3, ({ struct {int a,b;} x,y; x.a=3; y=x; y.a; })); ASSERT(7, ({ struct t {int a,b;}; struct t x; x.a=7; struct t y; struct t *z=&y; *z=x; y.a; })); ASSERT(7, ({ struct t {int a,b;}; struct t x; x.a=7; struct t y, *p=&x, *q=&y; *q=*p; y.a; })); ASSERT(5, ({ struct t {char a, b;} x, y; x.a=5; y=x; y.a; })); ASSERT(3, ({ struct {int a,b;} x,y; x.a=3; y=x; y.a; })); ASSERT(7, ({ struct t {int a,b;}; struct t x; x.a=7; struct t y; struct t *z=&y; *z=x; y.a; })); ASSERT(7, ({ struct t {int a,b;}; struct t x; x.a=7; struct t y, *p=&x, *q=&y; *q=*p; y.a; })); ASSERT(5, ({ struct t {char a, b;} x, y; x.a=5; y=x; y.a; })); ASSERT(8, ({ struct t {int a; int b;} x; struct t y; sizeof(y); })); ASSERT(8, ({ struct t {int a; int b;}; struct t y; sizeof(y); })); ASSERT(16, ({ struct {char a; long b;} x; sizeof(x); })); ASSERT(4, ({ struct {char a; short b;} x; sizeof(x); })); ASSERT(8, ({ struct foo *bar; sizeof(bar); })); ASSERT(4, ({ struct T *foo; struct T {int x;}; sizeof(struct T); })); ASSERT(1, ({ struct T { struct T *next; int x; } a; struct T b; b.x=1; a.next=&b; a.next->x; })); ASSERT(4, ({ typedef struct T T; struct T { int x; }; sizeof(T); })); ASSERT(2, ({ struct {int a;} x={1}, y={2}; (x=y).a; })); ASSERT(1, ({ struct {int a;} x={1}, y={2}; (1?x:y).a; })); ASSERT(2, ({ struct {int a;} x={1}, y={2}; (0?x:y).a; })); printf("OK\n"); return 0; } chibicc-1.0.24/test/struct4.c000066400000000000000000000006401517770275000157300ustar00rootroot00000000000000#include #include "test.h" typedef unsigned char u8; struct S { u8 a,b; u8 c[2]; }; struct U { u8 a; struct S s; u8 b; }; struct U gu = {3, 5,6,7,8, 4}; int main() { printf("%ld\n", sizeof(struct U)); ASSERT(6, sizeof(struct U)); printf("%ld\n", sizeof(gu)); ASSERT(6, sizeof(gu)); ({ struct { struct { int a; struct { int b; }; }; int c; } x={1,2,3,.b=4,5}; x.c; }); return 0; } chibicc-1.0.24/test/struct5.c000066400000000000000000000055471517770275000157440ustar00rootroot00000000000000// This program is designed to test some arm64-specific things, such as the // calling convention, but should give the same results on any architecture. #include #include #include #include "test.h" struct hfa21 { double a; } hfa21 = { 21.1 }; struct hfa22 { double a, b; } hfa22 = { 22.1, 22.2 }; struct hfa23 { double a, b, c; } hfa23 = { 23.1, 23.2, 23.3 }; struct hfa24 { double a, b, c, d; } hfa24 = { 24.1, 24.2, 24.3, 24.4 }; struct hfa31 { long double a; } hfa31 = { 31.1 }; struct hfa32 { long double a, b; } hfa32 = { 32.1, 32.2 }; struct hfa33 { long double a, b, c; } hfa33 = { 33.1, 33.2, 33.3 }; struct hfa34 { long double a, b, c, d; } hfa34 = { 34.1, 34.2, 34.3, 34.4 }; int match(const char **s, const char *f) { const char *p = *s; for (p = *s; *f && *f == *p; f++, p++) ; if (!*f) { *s = p - 1; return 1; } return 0; } void myprintf(const char *format, ...) { const char *s; va_list ap; va_start(ap, format); for (s = format; *s; s++) { if (match(&s, "%hfa21")) { struct hfa21 x = va_arg(ap, struct hfa21); printf("%.1f,%.1f", x.a, x.a); ASSERT(21.1, x.a); } else if (match(&s, "%hfa22")) { struct hfa22 x = va_arg(ap, struct hfa22); printf("%.1f,%.1f", x.a, x.b); ASSERT(22.1, x.a); ASSERT(22.2, x.b); } else if (match(&s, "%hfa23")) { struct hfa23 x = va_arg(ap, struct hfa23); printf("%.1f,%.1f", x.a, x.c); ASSERT(23.1, x.a); ASSERT(23.3, x.c); } else if (match(&s, "%hfa24")) { struct hfa24 x = va_arg(ap, struct hfa24); printf("%.1f,%.1f", x.a, x.d); ASSERT(24.1, x.a); ASSERT(24.4, x.d); } else if (match(&s, "%hfa31")) { struct hfa31 x = va_arg(ap, struct hfa31); printf("%.1Lf,%.1Lf", x.a, x.a); ASSERT(31.1L, x.a); } else if (match(&s, "%hfa32")) { struct hfa32 x = va_arg(ap, struct hfa32); printf("%.1Lf,%.1Lf", x.a, x.b); ASSERT(32.1L, x.a); ASSERT(32.2L, x.b); } else if (match(&s, "%hfa33")) { struct hfa33 x = va_arg(ap, struct hfa33); printf("%.1Lf,%.1Lf", x.a, x.c); ASSERT(33.1L, x.a); ASSERT(33.3L, x.c); } else if (match(&s, "%hfa34")) { struct hfa34 x = va_arg(ap, struct hfa34); printf("%.1Lf,%.1Lf", x.a, x.d); ASSERT(34.1L, x.a); ASSERT(34.4L, x.d); } else putchar(*s); } putchar('\n'); } int main() { printf("stdarg:\n"); myprintf("%hfa24 %hfa22 %hfa21 %hfa21 %hfa21 %hfa21", hfa24, hfa22, hfa21, hfa21, hfa21, hfa21); return 0; }chibicc-1.0.24/test/struct6.c000066400000000000000000000014141517770275000157320ustar00rootroot00000000000000#include #include "test.h" typedef struct S { __attribute__((aligned(32))) char data[32]; } S; void print7(S a, S b, S c, S d, S e, S f, S g) { printf("%d %d %d %d %d %d %d\n", a.data[0], b.data[0], c.data[0], d.data[0], e.data[0], f.data[0], g.data[0]); ASSERT(1, a.data[0]); ASSERT(2, b.data[0]); ASSERT(3, c.data[0]); ASSERT(4, d.data[0]); ASSERT(5, e.data[0]); ASSERT(6, f.data[0]); ASSERT(7, g.data[0]); } int main() { S s1 = {.data = {1}}; S s2 = {.data = {2}}; S s3 = {.data = {3}}; S s4 = {.data = {4}}; S s5 = {.data = {5}}; S s6 = {.data = {6}}; S s7 = {.data = {7}}; print7(s1, s2, s3, s4, s5, s6, s7); return 0; } chibicc-1.0.24/test/struct7.c000066400000000000000000000007651517770275000157430ustar00rootroot00000000000000#include "test.h" #include struct S { long i, j; }; void fn(int cnt, ... ) { va_list ap; va_start(ap, cnt); for (int i = 0; i < cnt; i++) { struct S s = va_arg(ap, struct S); printf("%ld,%ld,", s.i, s.j); // expected 1,2,3,4,5,6 ASSERT(i*2+1, s.i); ASSERT(i*2+2, s.j); } printf("\n"); va_end(ap); } int main(void) { struct S s0 = {1,2}; struct S s1 = {3,4}; struct S s2 = {5,6}; fn(3, s0, s1, s2); return 0; }chibicc-1.0.24/test/struct8.c000066400000000000000000000007221517770275000157350ustar00rootroot00000000000000#include "test.h" int main(void) { struct Sub { int i; }; struct S { struct Sub b; int j; }; struct Sub b = {3}; int junk = 2; struct S s[] = {b, 6, 7}; printf("%d ", s[0].b.i); printf("%d ", s[0].j); printf("%d ", s[1].b.i); printf("%d\n", s[1].j); // expected {3 6 7 0}, got {3 *junk* 6 7} ASSERT(3, s[0].b.i); ASSERT(6, s[0].j); ASSERT(7, s[1].b.i); ASSERT(0, s[1].j); return 0; }chibicc-1.0.24/test/struct9.c000066400000000000000000000015041517770275000157350ustar00rootroot00000000000000#include #include "test.h" typedef struct { float f; } S1; double test_s1(int tag, ...) { va_list ap; va_start(ap, tag); S1 s = va_arg(ap, S1); va_end(ap); return s.f; } typedef struct { int i; float f; } S3; double test_s3(int tag, ...) { va_list ap; va_start(ap, tag); S3 s = va_arg(ap, S3); va_end(ap); return s.f; } typedef struct { char c; } S4; int test_s4(int tag, ...) { va_list ap; va_start(ap, tag); S4 s = va_arg(ap, S4); va_end(ap); return s.c; } int main(void) { S1 s = { 3.25f }; double r = test_s1(0, s); printf("r = %.2f\n", r); ASSERT(3.25, r); S3 s = { 1, 2.75f }; double r = test_s3(0, s); printf("r = %.2f\n", r); ASSERT(2.75, r); S4 s = { 7 }; int r = test_s4(0, s); printf("r = %d\n", r); ASSERT(7, r); return 0; } chibicc-1.0.24/test/struct_align.c000066400000000000000000000045121517770275000170200ustar00rootroot00000000000000#include #include "test.h" #define CHECK_ALIGN(ptr, align) \ ASSERT(0, ((uintptr_t)(ptr)) & ((align) - 1)) /* 8-byte alignment */ typedef struct __attribute__((aligned(8))){ char c; int i; } S8; /* 16-byte alignment */ typedef struct __attribute__((aligned(16))){ double d; int i; } S16; /* 32-byte alignment */ typedef struct __attribute__((aligned(32))) { char data[17]; } S32; /* 64-byte alignment */ typedef struct __attribute__((aligned(64))) { long x; char buf[13]; } S64; /* Nested, mixed alignment */ typedef struct { char c; S32 a; int x; S16 b; } SNested; /* Vector + alignment */ typedef struct __attribute__((aligned(32))) { float v[8]; } SVec; /* Recursive pass-by-value */ static void check_recursive( int depth, S8 a, S16 b, S32 c, S64 d, SNested e, SVec f) { CHECK_ALIGN(&a, 8); CHECK_ALIGN(&b, 16); CHECK_ALIGN(&c, 32); CHECK_ALIGN(&d, 64); CHECK_ALIGN(&e.a, 32); CHECK_ALIGN(&e.b, 16); CHECK_ALIGN(&f, 32); ASSERT(1, a.c); ASSERT(2, b.i); ASSERT(3, c.data[0]); ASSERT(4, d.buf[0]); ASSERT(5, e.a.data[0]); ASSERT(6, f.v[0]); if (depth) check_recursive(depth - 1, a, b, c, d, e, f); } /* Stack locals + copies */ static void check_locals(void) { S8 a = {1, 10}; S16 b = {2.0, 2}; S32 c = {{3}}; S64 d = {4, {4}}; SNested e = {'x', {{5}}, 99, {6.0, 6}}; SVec f = {{6.0f}}; CHECK_ALIGN(&a, 8); CHECK_ALIGN(&b, 16); CHECK_ALIGN(&c, 32); CHECK_ALIGN(&d, 64); CHECK_ALIGN(&e.a, 32); CHECK_ALIGN(&e.b, 16); CHECK_ALIGN(&f, 32); check_recursive(3, a, b, c, d, e, f); } /* Pass-by-stack stress */ static void pass_many( S8 a, S16 b, S32 c, S64 d, SNested e, SVec f, S32 g, S64 h) { CHECK_ALIGN(&a, 8); CHECK_ALIGN(&b, 16); CHECK_ALIGN(&c, 32); CHECK_ALIGN(&d, 64); CHECK_ALIGN(&e.a, 32); CHECK_ALIGN(&f, 32); CHECK_ALIGN(&g, 32); CHECK_ALIGN(&h, 64); ASSERT(1, a.c); ASSERT(2, b.i); ASSERT(3, c.data[0]); ASSERT(4, d.buf[0]); ASSERT(5, e.a.data[0]); ASSERT(6, f.v[0]); ASSERT(7, g.data[0]); ASSERT(8, h.buf[0]); } int main(void) { check_locals(); S8 a = {1, 0}; S16 b = {0, 2}; S32 c = {{3}}; S64 d = {0, {4}}; SNested e = {'x', {{5}}, 0, {0, 6}}; SVec f = {{6.0f}}; S32 g = {{7}}; S64 h = {0, {8}}; pass_many(a, b, c, d, e, f, g, h); printf("OK\n"); return 0; } chibicc-1.0.24/test/struct_align_4096.c000066400000000000000000000016061517770275000175030ustar00rootroot00000000000000#include "test.h" #include typedef struct __attribute__((aligned(4096))) S4096 { char data[127]; } S4096; #define CHECK_ALIGN(ptr, n) \ ASSERT(0, ((uintptr_t)(ptr)) & ((n) - 1)) static void local_struct(int n) { if (n == 0) return; S4096 s; CHECK_ALIGN(&s, 4096); CHECK_ALIGN(&s.data[0], 4096); local_struct(n - 1); } static void pass_by_value(int n, S4096 s) { if (n == 0) return; CHECK_ALIGN(&s, 4096); CHECK_ALIGN(&s.data[0], 4096); pass_by_value(n - 1, s); } static void mixed(int n, S4096 s) { if (n == 0) return; CHECK_ALIGN(&s, 4096); int x = 1; (void)x; S4096 local; CHECK_ALIGN(&local, 4096); mixed(n - 1, local); } int main(void) { S4096 s; CHECK_ALIGN(&s, 4096); local_struct(4); pass_by_value(4, s); mixed(4, s); printf("OK\n"); return 0; } chibicc-1.0.24/test/struct_array.c000066400000000000000000000017161517770275000170470ustar00rootroot00000000000000 #include "test.h" // Define the struct with float, double, and int types struct Data { float a; double b; int c; }; // Define a typedef for an array of struct Data typedef struct Data ARR[]; typedef float F; ARR arr = { {(F)1.1f, (F)2.2, (F)3}, {(F)4.4f, (F)5.5, (F)6}, {(F)7.7f, (F)8.8, (F)9} }; // Function to process an array of structs void process_array(ARR arr, int size) { for (int i = 0; i < size; i++) { printf("Struct %d:\n", i); printf(" a = %.2f\n", arr[i].a); printf(" b = %.2lf\n", arr[i].b); printf(" c = %d\n", arr[i].c); if (i == 0) { ASSERT(1, arr[i].a); ASSERT(2, arr[i].b); ASSERT(3, arr[i].c); } } } int main() { // Define and initialize an array of structs using the typedef int size = sizeof(arr) / sizeof(arr[0]); // Pass the array to the function process_array(arr, size); return 0; } chibicc-1.0.24/test/struct_attribute.c000066400000000000000000000004121517770275000177240ustar00rootroot00000000000000#include "test.h" struct S { int x; }; struct S s __attribute__((aligned(16))); int main(void) { /* Check that alignment is applied */ if (((unsigned long)&s % 16) != 0) { printf("alignment failed\n"); return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/struct_pack.c000066400000000000000000000034211517770275000166420ustar00rootroot00000000000000 #include "test.h" struct Fields { _Bool a :1; long long :3; unsigned b :4; _Bool c :1; unsigned d :3; unsigned e :2; long :2; } __attribute__((packed)); struct WithPadding { char a; // 1 byte unsigned b : 3; // 3 bits unsigned c : 5; // 5 bits int d; // 4 bytes }; struct ZeroWidth { unsigned a : 5; // 5 bits unsigned : 0; // Forces alignment to next int unsigned b : 3; // 3 bits }; struct Complex { _Bool a : 1; // 1 bit unsigned b : 3; // 3 bits unsigned c : 5; // 5 bits int d : 4; // 4 bits unsigned long long e : 10; // 10 bits }; struct MaxAlign { unsigned long long a : 64; // 64 bits unsigned long long b : 64; // 64 bits }; int main() { { struct { char a; int b; } __attribute__((packed)) x; printf("%d\n", sizeof(x)); ASSERT(5, sizeof(x)); } { union { int a; char b[4]; } x={0x01020304}; printf("%d\n", x.b[0]); ASSERT(4, x.b[0]); } struct Fields s1 = {11,22,33,44,55,66,77}; struct Fields s2 = {77,66,55,44,33,22,11}; printf("%d\n", sizeof(struct Fields)); ASSERT(2, sizeof(struct Fields)); printf("%d\n", _Alignof(struct Fields)); ASSERT(1, _Alignof(struct Fields)); printf("Size of WithPadding struct: %lu\n", sizeof(struct WithPadding)); // Expected: 8 ASSERT(8, sizeof(struct WithPadding)); printf("Size of ZeroWidth struct: %lu\n", sizeof(struct ZeroWidth)); // Expected: 8 ASSERT(8, sizeof(struct ZeroWidth)); printf("Size of Complex struct: %lu\n", sizeof(struct Complex)); // Expected: 8 ASSERT(8, sizeof(struct Complex)); printf("Size of MaxAlign struct: %lu\n", sizeof(struct MaxAlign)); // Expected: 16 ASSERT(16, sizeof(struct MaxAlign)); return 0; }chibicc-1.0.24/test/struct_sizeof.c000066400000000000000000000031721517770275000172260ustar00rootroot00000000000000#include "test.h" #include // For offsetof #include // For bool type typedef struct PgStatShared_Archiver { int stats; } PgStatShared_Archiver; // Define a struct with boolean bitfields and other fields typedef struct { bool fixed_amount : 1; // Bitfield for fixed amount bool accessed_across_databases : 1; // Bitfield for access across databases int id; // Integer ID char name[20]; // Name field size_t shared_size; // This will be initialized using sizeof } Item; // Define a struct to hold an array of items typedef struct { Item items[5]; // Array of 5 Items } ItemCollection; int main(void) { ItemCollection collection = { .items[0] = {0}, .items[1] = { .shared_size = sizeof(PgStatShared_Archiver), .fixed_amount = false, .accessed_across_databases = true, .id = 2, .name = "Item2" }, // shared_size will be uninitialized .items[2] = { .id = 3, .name = "Item3" }, // Only id and name initialized, shared_size uninitialized }; // Print the details of the collection for (int i = 0; i < 3; i++) { if (!collection.items[i].name) continue; printf("Item %d:\n", collection.items[i].id); printf(" Name: %s\n", collection.items[i].name); printf(" Fixed Amount: %d\n", collection.items[i].fixed_amount); printf(" Accessed Across Databases: %d\n", collection.items[i].accessed_across_databases); printf(" Shared Size: %zu\n", collection.items[i].shared_size); // May be uninitialized for some items } return 0; } chibicc-1.0.24/test/stub.c000066400000000000000000000004411517770275000152740ustar00rootroot00000000000000#include "test.h" // Declare a stub function void my_function() __attribute__((__stub__)); void my_function() { // Function implementation could be added later printf("This function is a stub.\n"); } int main() { my_function(); // Calling the stub function return 0; } chibicc-1.0.24/test/suite0095.c000066400000000000000000000002211517770275000157620ustar00rootroot00000000000000int x; int x = 3; //int x = 2; int x; int main(); void * foo() { return &main; } int main() { if (x != 3) return 0; x = 0; return x; }chibicc-1.0.24/test/suite152.c000066400000000000000000000003541517770275000157030ustar00rootroot00000000000000 #include "test.h" #undef line #define line 1000 #line line #if 1000 != __LINE__ #error" # line line" not work as expected #endif #undef line #define line 8 int main() { printf("line=%d\n", line); ASSERT(8, line); return 0; }chibicc-1.0.24/test/suite162.c000066400000000000000000000013451517770275000157050ustar00rootroot00000000000000 #include "test.h" void foo(int [5]); void fooc(int x[const 5]); void foos(int x[static 5]); void foov(int x[volatile 5]); void foor(int x[restrict 5]); void fooc(int [const 5]); void foos(int [static 5]); void foov(int [volatile 5]); void foor(int [restrict 5]); void fooc(int (* const x)); void foos(int *x); void foov(int * volatile x); void foor(int * restrict x); void fooc(int x[volatile 5]) { x[3] = 42; #ifdef INVALID x = 0; #endif } void foovm(int x[const *]); void foovm(int * const x); #ifdef INVALID void wrongc(int x[3][const 4]); void wrongvm(int x[static *]); void foovm(int x[const *]) { x[2] = 1; } #endif int main() { printf("sizeof(const *) = %ld\n", sizeof(const *)); ASSERT(8, sizeof(const *) ); return 0; }chibicc-1.0.24/test/suite170.c000066400000000000000000000027471517770275000157130ustar00rootroot00000000000000 #include "test.h" enum fred { a, b, c, d, e = 54, f = 73, g, h }; /* All following uses of enum efoo should compile without warning. While forward enums aren't ISO C, it's accepted by GCC also in strict mode, and only warned about with -pedantic. This happens in the real world. */ /* Strict ISO C doesn't allow this kind of forward declaration of enums, but GCC accepts it (and gives only pedantic warning), and it occurs in the wild. */ enum efoo; struct Sforward_use { int (*fmember) (enum efoo x); }; extern enum efoo it_real_fn(void); enum efoo { ONE, TWO, }; struct S2 { enum efoo (*f2) (void); }; void should_compile(struct S2 *s) { s->f2 = it_real_fn; } enum efoo it_real_fn(void) { return TWO; } static unsigned int deref_uintptr(unsigned int *p) { return *p; } enum Epositive { epos_one, epos_two }; int main() { enum fred frod; enum Epositive epos = epos_two; printf("%d %d %d %d %d %d %d %d\n", a, b, c, d, e, f, g, h); ASSERT(0, a); ASSERT(1, b); ASSERT(2, c); ASSERT(3, d); ASSERT(54, e); ASSERT(73, f); ASSERT(74, g); ASSERT(75, h); /* printf("%d\n", frod); */ frod = 12; printf("%d\n", frod); ASSERT(12, frod); frod = e; printf("%d\n", frod); ASSERT(54, frod); /* Following should compile without warning. */ printf ("enum to int: %u\n", deref_uintptr(&epos)); ASSERT(1, deref_uintptr(&epos)); return 0; } /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/chibicc-1.0.24/test/suite174.c000066400000000000000000000022501517770275000157040ustar00rootroot00000000000000 #include #include "test.h" int main() { // variables float a = 12.34 + 56.78; printf("%f\n", a); ASSERT(69, a); // infix operators printf("%f\n", 12.34 + 56.78); printf("%f\n", 12.34 - 56.78); printf("%f\n", 12.34 * 56.78); printf("%f\n", 12.34 / 56.78); // comparison operators printf("%d %d %d %d %d %d\n", 12.34 < 56.78, 12.34 <= 56.78, 12.34 == 56.78, 12.34 >= 56.78, 12.34 > 56.78, 12.34 != 56.78); printf("%d %d %d %d %d %d\n", 12.34 < 12.34, 12.34 <= 12.34, 12.34 == 12.34, 12.34 >= 12.34, 12.34 > 12.34, 12.34 != 12.34); printf("%d %d %d %d %d %d\n", 56.78 < 12.34, 56.78 <= 12.34, 56.78 == 12.34, 56.78 >= 12.34, 56.78 > 12.34, 56.78 != 12.34); // assignment operators a = 12.34; a += 56.78; printf("%f\n", a); ASSERT(69, a); a = 12.34; a -= 56.78; printf("%f\n", a); ASSERT(-44, a); a = 12.34; a *= 56.78; printf("%f\n", a); ASSERT(700, a); a = 12.34; a /= 56.78; printf("%f\n", a); ASSERT(0, a); // prefix operators printf("%f\n", +12.34); printf("%f\n", -12.34); // type coercion a = 2; printf("%f\n", a); printf("%f\n", sin(2)); return 0; } chibicc-1.0.24/test/suite204.c000066400000000000000000000414411517770275000157030ustar00rootroot00000000000000// This program is designed to test some arm64-specific things, such as the // calling convention, but should give the same results on any architecture. #include #include #include "test.h" struct s1 { char x[1]; } s1 = { "0" }; struct s2 { char x[2]; } s2 = { "12" }; struct s3 { char x[3]; } s3 = { "345" }; struct s4 { char x[4]; } s4 = { "6789" }; struct s5 { char x[5]; } s5 = { "abcde" }; struct s6 { char x[6]; } s6 = { "fghijk" }; struct s7 { char x[7]; } s7 = { "lmnopqr" }; struct s8 { char x[8]; } s8 = { "stuvwxyz" }; struct s9 { char x[9]; } s9 = { "ABCDEFGHI" }; struct s10 { char x[10]; } s10 = { "JKLMNOPQRS" }; struct s11 { char x[11]; } s11 = { "TUVWXYZ0123" }; struct s12 { char x[12]; } s12 = { "456789abcdef" }; struct s13 { char x[13]; } s13 = { "ghijklmnopqrs" }; struct s14 { char x[14]; } s14 = { "tuvwxyzABCDEFG" }; struct s15 { char x[15]; } s15 = { "HIJKLMNOPQRSTUV" }; struct s16 { char x[16]; } s16 = { "WXYZ0123456789ab" }; struct s17 { char x[17]; } s17 = { "cdefghijklmnopqrs" }; struct hfa11 { float a; } hfa11 = { 11.1 }; struct hfa12 { float a, b; } hfa12 = { 12.1, 12.2 }; struct hfa13 { float a, b, c; } hfa13 = { 13.1, 13.2, 13.3 }; struct hfa14 { float a, b, c, d; } hfa14 = { 14.1, 14.2, 14.3, 14.4 }; struct hfa21 { double a; } hfa21 = { 21.1 }; struct hfa22 { double a, b; } hfa22 = { 22.1, 22.2 }; struct hfa23 { double a, b, c; } hfa23 = { 23.1, 23.2, 23.3 }; struct hfa24 { double a, b, c, d; } hfa24 = { 24.1, 24.2, 24.3, 24.4 }; struct hfa31 { long double a; } hfa31 = { 31.1 }; struct hfa32 { long double a, b; } hfa32 = { 32.1, 32.2 }; struct hfa33 { long double a, b, c; } hfa33 = { 33.1, 33.2, 33.3 }; struct hfa34 { long double a, b, c, d; } hfa34 = { 34.1, 34.2, 34.3, 34.4 }; void fa_s1(struct s1 a) { printf("%.1s\n", a.x); } void fa_s2(struct s2 a) { printf("%.2s\n", a.x); } void fa_s3(struct s3 a) { printf("%.3s\n", a.x); } void fa_s4(struct s4 a) { printf("%.4s\n", a.x); } void fa_s5(struct s5 a) { printf("%.5s\n", a.x); } void fa_s6(struct s6 a) { printf("%.6s\n", a.x); } void fa_s7(struct s7 a) { printf("%.7s\n", a.x); } void fa_s8(struct s8 a) { printf("%.8s\n", a.x); } void fa_s9(struct s9 a) { printf("%.9s\n", a.x); } void fa_s10(struct s10 a) { printf("%.10s\n", a.x); } void fa_s11(struct s11 a) { printf("%.11s\n", a.x); } void fa_s12(struct s12 a) { printf("%.12s\n", a.x); } void fa_s13(struct s13 a) { printf("%.13s\n", a.x); } void fa_s14(struct s14 a) { printf("%.14s\n", a.x); } void fa_s15(struct s15 a) { printf("%.15s\n", a.x); } void fa_s16(struct s16 a) { printf("%.16s\n", a.x); } void fa_s17(struct s17 a) { printf("%.17s\n", a.x); } void fa_hfa11(struct hfa11 a) { printf("%.1f\n", a.a); } void fa_hfa12(struct hfa12 a) { printf("%.1f %.1f\n", a.a, a.a); } void fa_hfa13(struct hfa13 a) { printf("%.1f %.1f %.1f\n", a.a, a.b, a.c); } void fa_hfa14(struct hfa14 a) { printf("%.1f %.1f %.1f %.1f\n", a.a, a.b, a.c, a.d); } void fa_hfa21(struct hfa21 a) { printf("%.1f\n", a.a); } void fa_hfa22(struct hfa22 a) { printf("%.1f %.1f\n", a.a, a.a); } void fa_hfa23(struct hfa23 a) { printf("%.1f %.1f %.1f\n", a.a, a.b, a.c); } void fa_hfa24(struct hfa24 a) { printf("%.1f %.1f %.1f %.1f\n", a.a, a.b, a.c, a.d); } void fa_hfa31(struct hfa31 a) { printf("%.1Lf\n", a.a); } void fa_hfa32(struct hfa32 a) { printf("%.1Lf %.1Lf\n", a.a, a.a); } void fa_hfa33(struct hfa33 a) { printf("%.1Lf %.1Lf %.1Lf\n", a.a, a.b, a.c); } void fa_hfa34(struct hfa34 a) { printf("%.1Lf %.1Lf %.1Lf %.1Lf\n", a.a, a.b, a.c, a.d); } void fa1(struct s8 a, struct s9 b, struct s10 c, struct s11 d, struct s12 e, struct s13 f) { printf("%.3s %.3s %.3s %.3s %.3s %.3s\n", a.x, b.x, c.x, d.x, e.x, f.x); } void fa2(struct s9 a, struct s10 b, struct s11 c, struct s12 d, struct s13 e, struct s14 f) { printf("%.3s %.3s %.3s %.3s %.3s %.3s\n", a.x, b.x, c.x, d.x, e.x, f.x); } void fa3(struct hfa14 a, struct hfa23 b, struct hfa32 c) { printf("%.1f %.1f %.1f %.1f %.1Lf %.1Lf\n", a.a, a.d, b.a, b.c, c.a, c.b); } void fa4(struct s1 a, struct hfa14 b, struct s2 c, struct hfa24 d, struct s3 e, struct hfa34 f) { printf("%.1s %.1f %.1f %.2s %.1f %.1f %.3s %.1Lf %.1Lf\n", a.x, b.a, b.d, c.x, d.a, d.d, e.x, f.a, f.d); } void arg(void) { printf("Arguments:\n"); fa_s1(s1); fa_s2(s2); fa_s3(s3); fa_s4(s4); fa_s5(s5); fa_s6(s6); fa_s7(s7); fa_s8(s8); fa_s9(s9); fa_s10(s10); fa_s11(s11); fa_s12(s12); fa_s13(s13); fa_s14(s14); fa_s15(s15); fa_s16(s16); fa_s17(s17); fa_hfa11(hfa11); fa_hfa12(hfa12); fa_hfa13(hfa13); fa_hfa14(hfa14); fa_hfa21(hfa21); fa_hfa22(hfa22); fa_hfa23(hfa23); fa_hfa24(hfa24); fa_hfa31(hfa31); fa_hfa32(hfa32); fa_hfa33(hfa33); fa_hfa34(hfa34); fa1(s8, s9, s10, s11, s12, s13); fa2(s9, s10, s11, s12, s13, s14); fa3(hfa14, hfa23, hfa32); fa4(s1, hfa14, s2, hfa24, s3, hfa34); } struct s1 fr_s1(void) { return s1; } struct s2 fr_s2(void) { return s2; } struct s3 fr_s3(void) { return s3; } struct s4 fr_s4(void) { return s4; } struct s5 fr_s5(void) { return s5; } struct s6 fr_s6(void) { return s6; } struct s7 fr_s7(void) { return s7; } struct s8 fr_s8(void) { return s8; } struct s9 fr_s9(void) { return s9; } struct s10 fr_s10(void) { return s10; } struct s11 fr_s11(void) { return s11; } struct s12 fr_s12(void) { return s12; } struct s13 fr_s13(void) { return s13; } struct s14 fr_s14(void) { return s14; } struct s15 fr_s15(void) { return s15; } struct s16 fr_s16(void) { return s16; } struct s17 fr_s17(void) { return s17; } struct hfa11 fr_hfa11(void) { return hfa11; } struct hfa12 fr_hfa12(void) { return hfa12; } struct hfa13 fr_hfa13(void) { return hfa13; } struct hfa14 fr_hfa14(void) { return hfa14; } struct hfa21 fr_hfa21(void) { return hfa21; } struct hfa22 fr_hfa22(void) { return hfa22; } struct hfa23 fr_hfa23(void) { return hfa23; } struct hfa24 fr_hfa24(void) { return hfa24; } struct hfa31 fr_hfa31(void) { return hfa31; } struct hfa32 fr_hfa32(void) { return hfa32; } struct hfa33 fr_hfa33(void) { return hfa33; } struct hfa34 fr_hfa34(void) { return hfa34; } void ret(void) { struct s1 t1 = fr_s1(); struct s2 t2 = fr_s2(); struct s3 t3 = fr_s3(); struct s4 t4 = fr_s4(); struct s5 t5 = fr_s5(); struct s6 t6 = fr_s6(); struct s7 t7 = fr_s7(); struct s8 t8 = fr_s8(); struct s9 t9 = fr_s9(); struct s10 t10 = fr_s10(); struct s11 t11 = fr_s11(); struct s12 t12 = fr_s12(); struct s13 t13 = fr_s13(); struct s14 t14 = fr_s14(); struct s15 t15 = fr_s15(); struct s16 t16 = fr_s16(); struct s17 t17 = fr_s17(); printf("Return values:\n"); printf("%.1s\n", t1.x); printf("%.2s\n", t2.x); printf("%.3s\n", t3.x); printf("%.4s\n", t4.x); printf("%.5s\n", t5.x); printf("%.6s\n", t6.x); printf("%.7s\n", t7.x); printf("%.8s\n", t8.x); printf("%.9s\n", t9.x); printf("%.10s\n", t10.x); printf("%.11s\n", t11.x); printf("%.12s\n", t12.x); printf("%.13s\n", t13.x); printf("%.14s\n", t14.x); printf("%.15s\n", t15.x); printf("%.16s\n", t16.x); printf("%.17s\n", t17.x); printf("%.1f\n", fr_hfa11().a); printf("%.1f %.1f\n", fr_hfa12().a, fr_hfa12().b); printf("%.1f %.1f\n", fr_hfa13().a, fr_hfa13().c); printf("%.1f %.1f\n", fr_hfa14().a, fr_hfa14().d); printf("%.1f\n", fr_hfa21().a); printf("%.1f %.1f\n", fr_hfa22().a, fr_hfa22().b); printf("%.1f %.1f\n", fr_hfa23().a, fr_hfa23().c); printf("%.1f %.1f\n", fr_hfa24().a, fr_hfa24().d); printf("%.1Lf\n", fr_hfa31().a); printf("%.1Lf %.1Lf\n", fr_hfa32().a, fr_hfa32().b); printf("%.1Lf %.1Lf\n", fr_hfa33().a, fr_hfa33().c); printf("%.1Lf %.1Lf\n", fr_hfa34().a, fr_hfa34().d); } int match(const char **s, const char *f) { const char *p = *s; for (p = *s; *f && *f == *p; f++, p++) ; if (!*f) { *s = p - 1; return 1; } return 0; } void myprintf(const char *format, ...) { const char *s; va_list ap; va_start(ap, format); for (s = format; *s; s++) { if (match(&s, "%7s")) { struct s7 t7 = va_arg(ap, struct s7); printf("%.7s", t7.x); } else if (match(&s, "%9s")) { struct s9 t9 = va_arg(ap, struct s9); printf("%.9s", t9.x); } else if (match(&s, "%hfa11")) { struct hfa11 x = va_arg(ap, struct hfa11); printf("%.1f,%.1f", x.a, x.a); } else if (match(&s, "%hfa12")) { struct hfa12 x = va_arg(ap, struct hfa12); printf("%.1f,%.1f", x.a, x.b); } else if (match(&s, "%hfa13")) { struct hfa13 x = va_arg(ap, struct hfa13); printf("%.1f,%.1f", x.a, x.c); } else if (match(&s, "%hfa14")) { struct hfa14 x = va_arg(ap, struct hfa14); printf("%.1f,%.1f", x.a, x.d); } else if (match(&s, "%hfa21")) { struct hfa21 x = va_arg(ap, struct hfa21); printf("%.1f,%.1f", x.a, x.a); } else if (match(&s, "%hfa22")) { struct hfa22 x = va_arg(ap, struct hfa22); printf("%.1f,%.1f", x.a, x.b); } else if (match(&s, "%hfa23")) { struct hfa23 x = va_arg(ap, struct hfa23); printf("%.1f,%.1f", x.a, x.c); } else if (match(&s, "%hfa24")) { struct hfa24 x = va_arg(ap, struct hfa24); printf("%.1f,%.1f", x.a, x.d); } else if (match(&s, "%hfa31")) { struct hfa31 x = va_arg(ap, struct hfa31); printf("%.1Lf,%.1Lf", x.a, x.a); } else if (match(&s, "%hfa32")) { struct hfa32 x = va_arg(ap, struct hfa32); printf("%.1Lf,%.1Lf", x.a, x.b); } else if (match(&s, "%hfa33")) { struct hfa33 x = va_arg(ap, struct hfa33); printf("%.1Lf,%.1Lf", x.a, x.c); } else if (match(&s, "%hfa34")) { struct hfa34 x = va_arg(ap, struct hfa34); printf("%.1Lf,%.1Lf", x.a, x.d); } else putchar(*s); } putchar('\n'); } void stdarg(void) { printf("stdarg:\n"); myprintf("%9s %9s %9s %9s %9s %9s", s9, s9, s9, s9, s9, s9); myprintf("%7s %9s %9s %9s %9s %9s", s7, s9, s9, s9, s9, s9); myprintf("HFA long double:"); myprintf("%hfa34 %hfa34 %hfa34 %hfa34", hfa34, hfa34, hfa34, hfa34); myprintf("%hfa33 %hfa34 %hfa34 %hfa34", hfa33, hfa34, hfa34, hfa34); myprintf("%hfa32 %hfa34 %hfa34 %hfa34", hfa32, hfa34, hfa34, hfa34); myprintf("%hfa31 %hfa34 %hfa34 %hfa34", hfa31, hfa34, hfa34, hfa34); myprintf("%hfa32 %hfa33 %hfa33 %hfa33 %hfa33", hfa32, hfa33, hfa33, hfa33, hfa33); myprintf("%hfa31 %hfa33 %hfa33 %hfa33 %hfa33", hfa31, hfa33, hfa33, hfa33, hfa33); myprintf("%hfa33 %hfa33 %hfa33 %hfa33", hfa33, hfa33, hfa33, hfa33); myprintf("%hfa34 %hfa32 %hfa32 %hfa32 %hfa32", hfa34, hfa32, hfa32, hfa32, hfa32); myprintf("%hfa33 %hfa32 %hfa32 %hfa32 %hfa32", hfa33, hfa32, hfa32, hfa32, hfa32); myprintf("%hfa34 %hfa32 %hfa31 %hfa31 %hfa31 %hfa31", hfa34, hfa32, hfa31, hfa31, hfa31, hfa31); myprintf("HFA double:"); myprintf("%hfa24 %hfa24 %hfa24 %hfa24", hfa24, hfa24, hfa24, hfa24); myprintf("%hfa23 %hfa24 %hfa24 %hfa24", hfa23, hfa24, hfa24, hfa24); myprintf("%hfa22 %hfa24 %hfa24 %hfa24", hfa22, hfa24, hfa24, hfa24); myprintf("%hfa21 %hfa24 %hfa24 %hfa24", hfa21, hfa24, hfa24, hfa24); myprintf("%hfa22 %hfa23 %hfa23 %hfa23 %hfa23", hfa22, hfa23, hfa23, hfa23, hfa23); myprintf("%hfa21 %hfa23 %hfa23 %hfa23 %hfa23", hfa21, hfa23, hfa23, hfa23, hfa23); myprintf("%hfa23 %hfa23 %hfa23 %hfa23", hfa23, hfa23, hfa23, hfa23); myprintf("%hfa24 %hfa22 %hfa22 %hfa22 %hfa22", hfa24, hfa22, hfa22, hfa22, hfa22); myprintf("%hfa23 %hfa22 %hfa22 %hfa22 %hfa22", hfa23, hfa22, hfa22, hfa22, hfa22); myprintf("%hfa24 %hfa22 %hfa21 %hfa21 %hfa21 %hfa21", hfa24, hfa22, hfa21, hfa21, hfa21, hfa21); myprintf("HFA float:"); myprintf("%hfa14 %hfa14 %hfa14 %hfa14", hfa14, hfa14, hfa14, hfa14); myprintf("%hfa13 %hfa14 %hfa14 %hfa14", hfa13, hfa14, hfa14, hfa14); myprintf("%hfa12 %hfa14 %hfa14 %hfa14", hfa12, hfa14, hfa14, hfa14); myprintf("%hfa11 %hfa14 %hfa14 %hfa14", hfa11, hfa14, hfa14, hfa14); myprintf("%hfa12 %hfa13 %hfa13 %hfa13 %hfa13", hfa12, hfa13, hfa13, hfa13, hfa13); myprintf("%hfa11 %hfa13 %hfa13 %hfa13 %hfa13", hfa11, hfa13, hfa13, hfa13, hfa13); myprintf("%hfa13 %hfa13 %hfa13 %hfa13", hfa13, hfa13, hfa13, hfa13); myprintf("%hfa14 %hfa12 %hfa12 %hfa12 %hfa12", hfa14, hfa12, hfa12, hfa12, hfa12); myprintf("%hfa13 %hfa12 %hfa12 %hfa12 %hfa12", hfa13, hfa12, hfa12, hfa12, hfa12); myprintf("%hfa14 %hfa12 %hfa11 %hfa11 %hfa11 %hfa11", hfa14, hfa12, hfa11, hfa11, hfa11, hfa11); } void pll(unsigned long long x) { printf("%llx\n", x); } void movi(void) { printf("MOVI:\n"); pll(0); pll(0xabcd); pll(0xabcd0000); pll(0xabcd00000000); pll(0xabcd000000000000); pll(0xffffabcd); pll(0xabcdffff); pll(0xffffffffffffabcd); pll(0xffffffffabcdffff); pll(0xffffabcdffffffff); pll(0xabcdffffffffffff); pll(0xaaaaaaaa); pll(0x5555555555555555); pll(0x77777777); pll(0x3333333333333333); pll(0xf8f8f8f8); pll(0x1e1e1e1e1e1e1e1e); pll(0x3f803f80); pll(0x01ff01ff01ff01ff); pll(0x007fffc0); pll(0x03fff80003fff800); pll(0x0007fffffffffe00); pll(0xabcd1234); pll(0xabcd00001234); pll(0xabcd000000001234); pll(0xabcd12340000); pll(0xabcd000012340000); pll(0xabcd123400000000); pll(0xffffffffabcd1234); pll(0xffffabcdffff1234); pll(0xabcdffffffff1234); pll(0xffffabcd1234ffff); pll(0xabcdffff1234ffff); pll(0xabcd1234ffffffff); pll(0xffffef0123456789); pll(0xabcdef012345ffff); pll(0xabcdef0123456789); } static uint32_t addip0(uint32_t x) { return x + 0; } static uint64_t sublp0(uint64_t x) { return x - 0; } static uint32_t addip123(uint32_t x) { return x + 123; } static uint64_t addlm123(uint64_t x) { return x + -123; } static uint64_t sublp4095(uint64_t x) { return x - 4095; } static uint32_t subim503808(uint32_t x) { return x - -503808; } static uint64_t addp12345(uint64_t x) { return x + 12345; } static uint32_t subp12345(uint32_t x) { return x - 12345; } static uint32_t mvni(uint32_t x) { return 0xffffffff - x; } static uint64_t negl(uint64_t x) { return 0 - x; } static uint32_t rsbi123(uint32_t x) { return 123 - x; } static uint64_t rsbl123(uint64_t x) { return 123 - x; } static uint32_t andi0(uint32_t x) { return x & 0; } static uint64_t andlm1(uint64_t x) { return x & -1; } static uint64_t orrl0(uint64_t x) { return x | 0; } static uint32_t orrim1(uint32_t x) { return x | -1; } static uint32_t eori0(uint32_t x) { return x ^ 0; } static uint64_t eorlm1(uint64_t x) { return x ^ -1; } static uint32_t and0xf0(uint32_t x) { return x & 0xf0; } static uint64_t orr0xf0(uint64_t x) { return x | 0xf0; } static uint64_t eor0xf0(uint64_t x) { return x ^ 0xf0; } static uint32_t lsli0(uint32_t x) { return x << 0; } static uint32_t lsri0(uint32_t x) { return x >> 0; } static int64_t asrl0(int64_t x) { return x >> 0; } static uint32_t lsli1(uint32_t x) { return x << 1; } static uint32_t lsli31(uint32_t x) { return x << 31; } static uint64_t lsll1(uint64_t x) { return x << 1; } static uint64_t lsll63(uint64_t x) { return x << 63; } static uint32_t lsri1(uint32_t x) { return x >> 1; } static uint32_t lsri31(uint32_t x) { return x >> 31; } static uint64_t lsrl1(uint64_t x) { return x >> 1; } static uint64_t lsrl63(uint64_t x) { return x >> 63; } static int32_t asri1(int32_t x) { return x >> 1; } static int32_t asri31(int32_t x) { return x >> 31; } static int64_t asrl1(int64_t x) { return x >> 1; } static int64_t asrl63(int64_t x) { return x >> 63; } void opi(void) { int x = 1000; pll(addip0(x)); pll(sublp0(x)); pll(addip123(x)); pll(addlm123(x)); pll(sublp4095(x)); pll(subim503808(x)); pll(addp12345(x)); pll(subp12345(x)); pll(mvni(x)); pll(negl(x)); pll(rsbi123(x)); pll(rsbl123(x)); pll(andi0(x)); pll(andlm1(x)); pll(orrl0(x)); pll(orrim1(x)); pll(eori0(x)); pll(eorlm1(x)); pll(and0xf0(x)); pll(orr0xf0(x)); pll(eor0xf0(x)); pll(lsli0(x)); pll(lsri0(x)); pll(asrl0(x)); pll(lsli1(x)); pll(lsli31(x)); pll(lsll1(x)); pll(lsll63(x)); pll(lsri1(x)); pll(lsri31(x)); pll(lsrl1(x)); pll(lsrl63(x)); pll(asri1(x)); pll(asri31(x)); pll(asrl1(x)); pll(asrl63(x)); } void pcs(void) { //arg(); //ret(); stdarg(); //movi(); //opi(); } int main() { pcs(); return 0; }chibicc-1.0.24/test/suite204b.c000066400000000000000000000222741517770275000160500ustar00rootroot00000000000000// This program is designed to test some arm64-specific things, such as the // calling convention, but should give the same results on any architecture. #include #include #include "test.h" #include struct s1 { char x[1]; } s1 = { "0" }; struct s2 { char x[2]; } s2 = { "12" }; struct s3 { char x[3]; } s3 = { "345" }; struct s4 { char x[4]; } s4 = { "6789" }; struct s5 { char x[5]; } s5 = { "abcde" }; struct s6 { char x[6]; } s6 = { "fghijk" }; struct s7 { char x[7]; } s7 = { "lmnopqr" }; struct s8 { char x[8]; } s8 = { "stuvwxyz" }; struct s9 { char x[9]; } s9 = { "ABCDEFGHI" }; struct s10 { char x[10]; } s10 = { "JKLMNOPQRS" }; struct s11 { char x[11]; } s11 = { "TUVWXYZ0123" }; struct s12 { char x[12]; } s12 = { "456789abcdef" }; struct s13 { char x[13]; } s13 = { "ghijklmnopqrs" }; struct s14 { char x[14]; } s14 = { "tuvwxyzABCDEFG" }; struct s15 { char x[15]; } s15 = { "HIJKLMNOPQRSTUV" }; struct s16 { char x[16]; } s16 = { "WXYZ0123456789ab" }; struct s17 { char x[17]; } s17 = { "cdefghijklmnopqrs" }; struct hfa11 { float a; } hfa11 = { 11.1 }; struct hfa12 { float a, b; } hfa12 = { 12.1, 12.2 }; struct hfa13 { float a, b, c; } hfa13 = { 13.1, 13.2, 13.3 }; struct hfa14 { float a, b, c, d; } hfa14 = { 14.1, 14.2, 14.3, 14.4 }; struct hfa21 { double a; } hfa21 = { 21.1 }; struct hfa22 { double a, b; } hfa22 = { 22.1, 22.2 }; struct hfa23 { double a, b, c; } hfa23 = { 23.1, 23.2, 23.3 }; struct hfa24 { double a, b, c, d; } hfa24 = { 24.1, 24.2, 24.3, 24.4 }; struct hfa31 { long double a; } hfa31 = { 31.1 }; struct hfa32 { long double a, b; } hfa32 = { 32.1, 32.2 }; struct hfa33 { long double a, b, c; } hfa33 = { 33.1, 33.2, 33.3 }; struct hfa34 { long double a, b, c, d; } hfa34 = { 34.1, 34.2, 34.3, 34.4 }; void fa_s1(struct s1 a) { printf("%.1s\n", a.x); } void fa_s2(struct s2 a) { printf("%.2s\n", a.x); } void fa_s3(struct s3 a) { printf("%.3s\n", a.x); } void fa_s4(struct s4 a) { printf("%.4s\n", a.x); } void fa_s5(struct s5 a) { printf("%.5s\n", a.x); } void fa_s6(struct s6 a) { printf("%.6s\n", a.x); } void fa_s7(struct s7 a) { printf("%.7s\n", a.x); } void fa_s8(struct s8 a) { printf("%.8s\n", a.x); } void fa_s9(struct s9 a) { printf("%.9s\n", a.x); } void fa_s10(struct s10 a) { printf("%.10s\n", a.x); } void fa_s11(struct s11 a) { printf("%.11s\n", a.x); } void fa_s12(struct s12 a) { printf("%.12s\n", a.x); } void fa_s13(struct s13 a) { printf("%.13s\n", a.x); } void fa_s14(struct s14 a) { printf("%.14s\n", a.x); } void fa_s15(struct s15 a) { printf("%.15s\n", a.x); } void fa_s16(struct s16 a) { printf("%.16s\n", a.x); } void fa_s17(struct s17 a) { printf("%.17s\n", a.x); } void fa_hfa11(struct hfa11 a) { printf("%.1f\n", a.a); } void fa_hfa12(struct hfa12 a) { printf("%.1f %.1f\n", a.a, a.a); } void fa_hfa13(struct hfa13 a) { printf("%.1f %.1f %.1f\n", a.a, a.b, a.c); } void fa_hfa14(struct hfa14 a) { printf("%.1f %.1f %.1f %.1f\n", a.a, a.b, a.c, a.d); } void fa_hfa21(struct hfa21 a) { printf("%.1f\n", a.a); } void fa_hfa22(struct hfa22 a) { printf("%.1f %.1f\n", a.a, a.a); } void fa_hfa23(struct hfa23 a) { printf("%.1f %.1f %.1f\n", a.a, a.b, a.c); } void fa_hfa24(struct hfa24 a) { printf("%.1f %.1f %.1f %.1f\n", a.a, a.b, a.c, a.d); } void fa_hfa31(struct hfa31 a) { printf("%.1Lf\n", a.a); } void fa_hfa32(struct hfa32 a) { printf("%.1Lf %.1Lf\n", a.a, a.a); } void fa_hfa33(struct hfa33 a) { printf("%.1Lf %.1Lf %.1Lf\n", a.a, a.b, a.c); } void fa_hfa34(struct hfa34 a) { printf("%.1Lf %.1Lf %.1Lf %.1Lf\n", a.a, a.b, a.c, a.d); } void fa1(struct s8 a, struct s9 b, struct s10 c, struct s11 d, struct s12 e, struct s13 f) { printf("%.3s %.3s %.3s %.3s %.3s %.3s\n", a.x, b.x, c.x, d.x, e.x, f.x); } void fa2(struct s9 a, struct s10 b, struct s11 c, struct s12 d, struct s13 e, struct s14 f) { printf("%.3s %.3s %.3s %.3s %.3s %.3s\n", a.x, b.x, c.x, d.x, e.x, f.x); } void fa3(struct hfa14 a, struct hfa23 b, struct hfa32 c) { printf("%.1f %.1f %.1f %.1f %.1Lf %.1Lf\n", a.a, a.d, b.a, b.c, c.a, c.b); } void fa4(struct s1 a, struct hfa14 b, struct s2 c, struct hfa24 d, struct s3 e, struct hfa34 f) { printf("%.1s %.1f %.1f %.2s %.1f %.1f %.3s %.1Lf %.1Lf\n", a.x, b.a, b.d, c.x, d.a, d.d, e.x, f.a, f.d); } struct s1 fr_s1(void) { return s1; } struct s2 fr_s2(void) { return s2; } struct s3 fr_s3(void) { return s3; } struct s4 fr_s4(void) { return s4; } struct s5 fr_s5(void) { return s5; } struct s6 fr_s6(void) { return s6; } struct s7 fr_s7(void) { return s7; } struct s8 fr_s8(void) { return s8; } struct s9 fr_s9(void) { return s9; } struct s10 fr_s10(void) { return s10; } struct s11 fr_s11(void) { return s11; } struct s12 fr_s12(void) { return s12; } struct s13 fr_s13(void) { return s13; } struct s14 fr_s14(void) { return s14; } struct s15 fr_s15(void) { return s15; } struct s16 fr_s16(void) { return s16; } struct s17 fr_s17(void) { return s17; } struct hfa11 fr_hfa11(void) { return hfa11; } struct hfa12 fr_hfa12(void) { return hfa12; } struct hfa13 fr_hfa13(void) { return hfa13; } struct hfa14 fr_hfa14(void) { return hfa14; } struct hfa21 fr_hfa21(void) { return hfa21; } struct hfa22 fr_hfa22(void) { return hfa22; } struct hfa23 fr_hfa23(void) { return hfa23; } struct hfa24 fr_hfa24(void) { return hfa24; } struct hfa31 fr_hfa31(void) { return hfa31; } struct hfa32 fr_hfa32(void) { return hfa32; } struct hfa33 fr_hfa33(void) { return hfa33; } struct hfa34 fr_hfa34(void) { return hfa34; } int match(const char **s, const char *f) { const char *p = *s; for (p = *s; *f && *f == *p; f++, p++) ; if (!*f) { *s = p - 1; return 1; } return 0; } void myprintf(const char *format, ...) { const char *s; va_list ap; va_start(ap, format); for (s = format; *s; s++) { if (match(&s, "%7s")) { struct s7 t7 = va_arg(ap, struct s7); printf("%.7s", t7.x); } else if (match(&s, "%9s")) { struct s9 t9 = va_arg(ap, struct s9); printf("%.9s", t9.x); } else if (match(&s, "%hfa11")) { struct hfa11 x = va_arg(ap, struct hfa11); printf("%.1f,%.1f", x.a, x.a); } else if (match(&s, "%hfa12")) { struct hfa12 x = va_arg(ap, struct hfa12); printf("%.1f,%.1f", x.a, x.b); } else if (match(&s, "%hfa13")) { struct hfa13 x = va_arg(ap, struct hfa13); printf("%.1f,%.1f", x.a, x.c); } else if (match(&s, "%hfa14")) { struct hfa14 x = va_arg(ap, struct hfa14); printf("%.1f,%.1f", x.a, x.d); } else if (match(&s, "%hfa21")) { struct hfa21 x = va_arg(ap, struct hfa21); printf("%.1f,%.1f", x.a, x.a); } else if (match(&s, "%hfa22")) { struct hfa22 x = va_arg(ap, struct hfa22); printf("%.1f,%.1f", x.a, x.b); } else if (match(&s, "%hfa23")) { struct hfa23 x = va_arg(ap, struct hfa23); printf("%.1f,%.1f", x.a, x.c); } else if (match(&s, "%hfa24")) { struct hfa24 x = va_arg(ap, struct hfa24); printf("%.1f,%.1f", x.a, x.d); } else if (match(&s, "%hfa31")) { struct hfa31 x = va_arg(ap, struct hfa31); printf("%.1Lf,%.1Lf", x.a, x.a); } else if (match(&s, "%hfa32")) { struct hfa32 x = va_arg(ap, struct hfa32); printf("%.1Lf,%.1Lf", x.a, x.b); } else if (match(&s, "%hfa33")) { struct hfa33 x = va_arg(ap, struct hfa33); printf("%.1Lf,%.1Lf", x.a, x.c); } else if (match(&s, "%hfa34")) { struct hfa34 x = va_arg(ap, struct hfa34); printf("%.1Lf,%.1Lf", x.a, x.d); } else putchar(*s); } putchar('\n'); } void stdarg(void) { printf("stdarg:\n"); myprintf("%9s %9s %9s %9s %9s %9s", s9, s9, s9, s9, s9, s9); myprintf("%7s %9s %9s %9s %9s %9s", s7, s9, s9, s9, s9, s9); myprintf("HFA long double:"); myprintf("%hfa34 ", hfa34); //myprintf("%hfa34 %hfa34 %hfa34 %hfa34", hfa34, hfa34, hfa34, hfa34); } void pll(unsigned long long x) { printf("%llx\n", x); } void movi(void) { printf("MOVI:\n"); pll(0); pll(0xabcd); pll(0xabcd0000); pll(0xabcd00000000); pll(0xabcd000000000000); pll(0xffffabcd); pll(0xabcdffff); pll(0xffffffffffffabcd); pll(0xffffffffabcdffff); pll(0xffffabcdffffffff); pll(0xabcdffffffffffff); pll(0xaaaaaaaa); pll(0x5555555555555555); pll(0x77777777); pll(0x3333333333333333); pll(0xf8f8f8f8); pll(0x1e1e1e1e1e1e1e1e); pll(0x3f803f80); pll(0x01ff01ff01ff01ff); pll(0x007fffc0); pll(0x03fff80003fff800); pll(0x0007fffffffffe00); pll(0xabcd1234); pll(0xabcd00001234); pll(0xabcd000000001234); pll(0xabcd12340000); pll(0xabcd000012340000); pll(0xabcd123400000000); pll(0xffffffffabcd1234); pll(0xffffabcdffff1234); pll(0xabcdffffffff1234); pll(0xffffabcd1234ffff); pll(0xabcdffff1234ffff); pll(0xabcd1234ffffffff); pll(0xffffef0123456789); pll(0xabcdef012345ffff); pll(0xabcdef0123456789); } void pcs(void) { stdarg(); } int main() { pcs(); return 0; }chibicc-1.0.24/test/suite205.c000066400000000000000000000114761517770275000157110ustar00rootroot00000000000000#include "test.h" /* This test is a snippet from the J interpreter */ typedef long I; typedef struct{I c[4];I b,e,k;} PT; PT cases[] = { ((I)4194304L +(I)2097152L +(I)67108864L), (I)262144L, (((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), -1L, 1,2,1, ((I)+4194304L +(I)2097152L +(I)67108864L)+( (I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (I)262144L, (I)262144L, (((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), 2,3,2, ((I)4194304L +(I)2097152L +(I)67108864L)+( (I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), (I)262144L, (((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), 1,3,2, ((I)4194304L +(I)2097152L +(I)67108864L)+( (I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), (I)524288L, -1L, 1,2,1, ((I)4194304L +(I)2097152L +(I)67108864L)+( (I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), (I)1048576L, (I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), 1,3,1, ((I)4194304L +(I)2097152L +(I)67108864L)+( (I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), (I)262144L, (I)262144L, 1,3,1, ((I)4194304L +(I)2097152L +(I)67108864L), ((I)1048576L +(I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), ((I)1048576L +(I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), -1L, 1,2,1, (I)33554432L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), (I)2097152L, ((I)1048576L +(I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), -1L, 0,2,1, (I)67108864L, ((I)1048576L +(I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (I)134217728L, -1L, 0,2,0, }; int main() { int i, j; for(j=0; j < sizeof(cases)/sizeof(cases[0]); j++) { for(i=0; i < sizeof(cases->c)/sizeof(cases->c[0]); i++) { printf("cases[%d].c[%d]=%ld\n", j, i, cases[j].c[i]); if (j ==0 && i == 0) ASSERT( 73400320,cases[j].c[i]); else if (j == 0 && i == 1) ASSERT( 262144,cases[j].c[i]); } printf("cases[%d].b=%ld\n", j, cases[j].b); printf("cases[%d].e=%ld\n", j, cases[j].e); printf("cases[%d].k=%ld\n", j, cases[j].k); printf("\n"); } return 0; } chibicc-1.0.24/test/suite210.c000066400000000000000000000016551517770275000157030ustar00rootroot00000000000000#include "test.h" typedef unsigned short uint16_t; typedef unsigned char uint8_t; typedef union Unaligned16a { uint16_t u; uint8_t b[2]; } __attribute__((packed)) Unaligned16a; typedef union __attribute__((packed)) Unaligned16b { uint16_t u; uint8_t b[2]; } Unaligned16b; extern void foo (void) __attribute__((stdcall)); void __attribute__((stdcall)) foo (void) { } /* The actual attribute isn't important, must just be parsable. */ #define ATTR __attribute__((__noinline__)) int ATTR actual_function() { return 42; } extern int printf (const char *, ...); int main() { void *function_pointer = &actual_function; int a = ((ATTR int(*) (void)) function_pointer)(); printf("%i\n", a); /* In the following we once misparsed 'ATTR *' is a btype and hence the whole type was garbled. */ int b = ( (int(ATTR *)(void)) function_pointer)(); printf("%i\n", b); ASSERT(42, b); return 0; }chibicc-1.0.24/test/suite213.c000066400000000000000000000062471517770275000157100ustar00rootroot00000000000000#include "test.h" /* This checks various ways of dead code inside if statements where there are non-obvious ways of how the code is actually not dead due to reachable by labels. */ extern int printf (const char *, ...); static void kb_wait_1(void) { unsigned long timeout = 2; do { /* Here the else arm is a statement expression that's supposed to be suppressed. The label inside the while would unsuppress code generation again if not handled correctly. And that would wreak havoc to the cond-expression because there's no jump-around emitted, the whole statement expression really needs to not generate code (perhaps except useless forward jumps). */ (1 ? printf("timeout=%ld\n", timeout) : ({ int i = 1; while (1) while (i--) some_label: printf("error\n"); goto some_label; }) ); timeout--; } while (timeout); } static int global; static void foo(int i) { global+=i; printf ("g=%d\n", global); } static int check(void) { printf ("check %d\n", global); return 1; } static void dowhile(void) { do { foo(1); if (global == 1) { continue; } else if (global == 2) { continue; } /* The following break shouldn't disable the check() call, as it's reachable by the continues above. */ break; } while (check()); } int main (void) { int i = 1; kb_wait_1(); /* Simple test of dead code at first sight which isn't actually dead. */ if (0) { yeah: printf ("yeah\n"); } else { printf ("boo\n"); } if (i--) goto yeah; /* Some more non-obvious uses where the problems are loops, so that even the first loop statements aren't actually dead. */ i = 1; if (0) { while (i--) { printf ("once\n"); enterloop: printf ("twice\n"); } } if (i >= 0) goto enterloop; /* The same with statement expressions. One might be tempted to handle them specially by counting if inside statement exprs and not unsuppressing code at loops at all then. See kb_wait_1 for the other side of the medal where that wouldn't work. */ i = ({ int j = 1; if (0) { while (j--) { printf ("SEonce\n"); enterexprloop: printf ("SEtwice\n"); } } if (j >= 0) goto enterexprloop; j; }); /* The other two loop forms: */ i = 1; if (0) { for (i = 1; i--;) { printf ("once2\n"); enterloop2: printf ("twice2\n"); } } if (i > 0) goto enterloop2; i = 1; if (0) { do { printf ("once3\n"); enterloop3: printf ("twice3\n"); } while (i--); } if (i > 0) goto enterloop3; /* And check that case and default labels have the same effect of disabling code suppression. */ i = 41; switch (i) { if (0) { printf ("error\n"); ASSERT(0, i); case 42: printf ("error2\n"); ASSERT(42, i); case 41: printf ("caseok\n"); ASSERT(41, i); } } i = 41; switch (i) { if (0) { printf ("error3\n"); ASSERT(0, i); default: printf ("caseok2\n"); ASSERT(41, i); break; case 42: printf ("error4\n"); ASSERT(42, i); } } dowhile(); return 0; }chibicc-1.0.24/test/suite216.c000066400000000000000000000150241517770275000157040ustar00rootroot00000000000000#include "test.h" typedef unsigned char u8; typedef struct {} empty_s; struct contains_empty { u8 a; empty_s empty; u8 b; }; struct contains_empty ce = { { (1) }, (empty_s){}, 022, }; /* The following decl of 'q' would demonstrate the TCC bug in init_putv when handling copying compound literals. (Compound literals aren't acceptable constant initializers in isoc99, but we accept them like gcc, except for this case) //char *q = (char *){ "trara" }; */ struct SS {u8 a[3], b; }; struct SS sinit16[] = { { 1 }, 2 }; struct S { u8 a,b; u8 c[2]; }; struct T { u8 s[16]; u8 a; }; struct U { u8 a; struct S s; u8 b; struct T t; }; struct V { struct S s; struct T t; u8 a; }; struct W { struct V t; struct S s[]; }; struct S gs = ((struct S){1, 2, 3, 4}); struct S gs2 = {1, 2, {3, 4}}; struct T gt = {"hello", 42}; struct U gu = {3, 5,6,7,8, 4, "huhu", 43}; struct U gu2 = {3, {5,6,7,8}, 4, {"huhu", 43}}; /* Optional braces around scalar initializers. Accepted, but with a warning. */ struct U gu3 = { {3}, {5,6,7,8,}, 4, {"huhu", 43}}; /* Many superfluous braces and leaving out one initializer for U.s.c[1] */ struct U gu4 = { 3, {5,6,7,}, 5, { "bla", {44}} }; /* Superfluous braces and useless parens around values */ struct S gs3 = { (1), {(2)}, {(((3))), {4}}}; /* Superfluous braces, and leaving out braces for V.t, plus cast */ struct V gv = {{{3},4,{5,6}}, "haha", (u8)45, 46}; /* Compound literal */ struct V gv2 = {(struct S){7,8,{9,10}}, {"hihi", 47}, 48}; /* Parens around compound literal */ struct V gv3 = {((struct S){7,8,{9,10}}), {"hoho", 49}, 50}; /* Initialization of a flex array member (warns in GCC) */ struct W gw = {{1,2,3,4}, {1,2,3,4,5}}; union UU { u8 a; u8 b; }; struct SU { union UU u; u8 c; }; struct SU gsu = {5,6}; /* Unnamed struct/union members aren't ISO C, but it's a widely accepted extension. See below for further extensions to that under -fms-extension.*/ union UV { struct {u8 a,b;}; struct S s; }; union UV guv = {{6,5}}; union UV guv2 = {{.b = 7, .a = 8}}; union UV guv3 = {.b = 8, .a = 7}; /* Under -fms-extensions also the following is valid: union UV2 { struct Anon {u8 a,b;}; // unnamed member, but tagged struct, ... struct S s; }; struct Anon gan = { 10, 11 }; // ... which makes it available here. union UV2 guv4 = {{4,3}}; // and the other inits from above as well */ struct in6_addr { union { u8 u6_addr8[16]; unsigned short u6_addr16[8]; } u; }; struct flowi6 { struct in6_addr saddr, daddr; }; struct pkthdr { struct in6_addr daddr, saddr; }; struct pkthdr phdr = { { { 6,5,4,3 } }, { { 9,8,7,6 } } }; struct Wrap { void *func; }; int global; void inc_global (void) { global++; } struct Wrap global_wrap[] = { ((struct Wrap) {inc_global}), inc_global, }; #include void print_ (const char *name, const u8 *p, long size) { printf ("%s:", name); while (size--) { printf (" %x", *p++); } printf ("\n"); } #define print(x) print_(#x, (u8*)&x, sizeof (x)) #if 1 void foo (struct W *w, struct pkthdr *phdr_) { struct S ls = {1, 2, 3, 4}; struct S ls2 = {1, 2, {3, 4}}; struct T lt = {"hello", 42}; struct U lu = {3, 5,6,7,8, 4, "huhu", 43}; struct U lu1 = {3, ls, 4, {"huhu", 43}}; struct U lu2 = {3, (ls), 4, {"huhu", 43}}; const struct S *pls = &ls; struct S ls21 = *pls; struct U lu22 = {3, *pls, 4, {"huhu", 43}}; /* Incomplete bracing. */ struct U lu21 = {3, ls, 4, "huhu", 43}; /* Optional braces around scalar initializers. Accepted, but with a warning. */ struct U lu3 = { 3, {5,6,7,8,}, 4, {"huhu", 43}}; /* Many superfluous braces and leaving out one initializer for U.s.c[1] */ struct U lu4 = { 3, {5,6,7,}, 5, { "bla", 44} }; /* Superfluous braces and useless parens around values */ struct S ls3 = { (1), (2), {(((3))), 4}}; /* Superfluous braces, and leaving out braces for V.t, plus cast */ struct V lv = {{3,4,{5,6}}, "haha", (u8)45, 46}; /* Compound literal */ struct V lv2 = {(struct S)w->t.s, {"hihi", 47}, 48}; /* Parens around compound literal */ struct V lv3 = {((struct S){7,8,{9,10}}), ((const struct W *)w)->t.t, 50}; const struct pkthdr *phdr = phdr_; struct flowi6 flow = { .daddr = phdr->daddr, .saddr = phdr->saddr }; int elt = 0x42; /* Range init, overlapping */ struct T lt2 = { { [1 ... 5] = 9, [6 ... 10] = elt, [4 ... 7] = elt+1 }, 1 }; print(ls); print(ls2); print(lt); print(lu); print(lu1); print(lu2); print(ls21); print(lu21); print(lu22); print(lu3); print(lu4); print(ls3); print(lv); print(lv2); print(lv3); print(lt2); print(flow); } #endif void test_compound_with_relocs (void) { struct Wrap local_wrap[] = { ((struct Wrap) {inc_global}), inc_global, }; void (*p)(void); p = global_wrap[0].func; p(); p = global_wrap[1].func; p(); p = local_wrap[0].func; p(); p = local_wrap[1].func; p(); } void sys_ni(void) { printf("ni\n"); } void sys_one(void) { printf("one\n"); } void sys_two(void) { printf("two\n"); } void sys_three(void) { printf("three\n"); } typedef void (*fptr)(void); const fptr table[3] = { [0 ... 2] = &sys_ni, [0] = sys_one, [1] = sys_two, [2] = sys_three, }; void test_multi_relocs(void) { int i; for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) table[i](); } /* Following is from GCC gcc.c-torture/execute/20050613-1.c. */ struct SEA { int i; int j; int k; int l; }; struct SEB { struct SEA a; int r[1]; }; struct SEC { struct SEA a; int r[0]; }; struct SED { struct SEA a; int r[]; }; static void test_correct_filling (struct SEA *x) { static int i; if (x->i != 0 || x->j != 5 || x->k != 0 || x->l != 0) printf("sea_fill%d: wrong\n", i); else printf("sea_fill%d: okay\n", i); i++; } int test_zero_init (void) { /* The peculiarity here is that only a.j is initialized. That means that all other members must be zero initialized. TCC once didn't do that for sub-level designators. */ struct SEB b = { .a.j = 5 }; struct SEC c = { .a.j = 5 }; struct SED d = { .a.j = 5 }; test_correct_filling (&b.a); test_correct_filling (&c.a); test_correct_filling (&d.a); return 0; } int main() { print(ce); print(gs); print(gs2); print(gt); print(gu); print(gu2); print(gu3); print(gu4); print(gs3); print(gv); print(gv2); print(gv3); print(sinit16); print(gw); print(gsu); print(guv); print(guv.b); print(guv2); print(guv3); print(phdr); foo(&gw, &phdr); //printf("q: %s\n", q); test_compound_with_relocs(); test_multi_relocs(); test_zero_init(); return 0; }chibicc-1.0.24/test/suite218.c000066400000000000000000000025751517770275000157150ustar00rootroot00000000000000#include "test.h" /* This checks if enums needing 8 bit but only having positive values are correctly zero extended (instead of sign extended) when stored into/loaded from a 8 bit bit-field of enum type (which itself is implementation defined, so isn't necessarily supported by all other compilers). */ enum tree_code { SOME_CODE = 148, /* has bit 7 set, and hence all further enum values as well */ LAST_AND_UNUSED_TREE_CODE }; typedef union tree_node *tree; struct tree_common { union tree_node *chain; union tree_node *type; enum tree_code code : 8; unsigned side_effects_flag : 1; }; union tree_node { struct tree_common common; }; enum c_tree_code { C_DUMMY_TREE_CODE = LAST_AND_UNUSED_TREE_CODE, STMT_EXPR, LAST_C_TREE_CODE }; enum cplus_tree_code { CP_DUMMY_TREE_CODE = LAST_C_TREE_CODE, AMBIG_CONV, LAST_CPLUS_TREE_CODE }; extern int printf(const char *, ...); int blah(){return 0;} int convert_like_real (tree convs) { switch (((enum tree_code) (convs)->common.code)) { case AMBIG_CONV: /* This has bit 7 set, which must not be the sign bit in tree_common.code, i.e. the bitfield must be somehow marked unsigned. */ return blah(); default: break; }; printf("unsigned enum bit-fields broken\n"); } int main() { union tree_node convs; convs.common.code = AMBIG_CONV; convert_like_real (&convs); return 0; }chibicc-1.0.24/test/switch_signedness.c000066400000000000000000000015101517770275000200400ustar00rootroot00000000000000/* Test range switch behavior for signed and unsigned switch expressions */ #include "test.h" #include int main(void) { int r; /* Signed range: negative start should match when value is negative */ int s = -1; r = 0; switch (s) { case -3 ... -2: r = -1; break; case -1 ... 1: r = 1; break; default: r = 0; } ASSERT(1, r); /* Unsigned range: large unsigned values must match correctly */ unsigned int u = 0x80000000u; /* 2147483648 */ r = 0; switch (u) { case 0x80000000u ... 0x80000010u: r = 2; break; default: r = 0; } ASSERT(2, r); /* Signed single-case check (equality path) */ s = -1; r = 0; switch (s) { case -1: r = 3; break; default: r = 0; } ASSERT(3, r); puts("OK"); return 0; } chibicc-1.0.24/test/syscalls1.c000066400000000000000000000056001517770275000162370ustar00rootroot00000000000000 #include #include #include #include #include #include #include #include #include #include #include "test.h" int main() { // Write to standard output const char *msg = "Hello, world!\n"; syscall(SYS_write, STDOUT_FILENO, msg, 14); // Read from standard input // char buffer[128]; // ssize_t bytesRead = syscall(SYS_read, STDIN_FILENO, buffer, sizeof(buffer) - 1); // if (bytesRead >= 0) { // buffer[bytesRead] = '\0'; // printf("Read: %s\n", buffer); // } // Open a file and read from it int fd = syscall(SYS_open, "test.txt", O_RDONLY); if (fd >= 0) { char buffer[128]; ssize_t bytesRead = syscall(SYS_read, fd, buffer, sizeof(buffer) - 1); if (bytesRead >= 0) { buffer[bytesRead] = '\0'; printf("Read from file: %s\n", buffer); } syscall(SYS_close, fd); } // Get the process ID pid_t pid = syscall(SYS_getpid); printf("Process ID: %d\n", pid); // Fork a child process pid = syscall(SYS_fork); if (pid == 0) { printf("This is the child process\n"); } else if (pid > 0) { printf("This is the parent process, child PID: %d\n", pid); } else { printf("Fork failed\n"); } //Execute a program // char *argv[] = { "/bin/ls", "-l", NULL }; // char *envp[] = { NULL }; // syscall(SYS_execve, "/bin/ls", argv, envp); // Map a file into memory fd = syscall(SYS_open, "test.txt", O_RDONLY); if (fd >= 0) { char *data = syscall(SYS_mmap, NULL, 4096, PROT_READ, MAP_PRIVATE, fd, 0); if (data != MAP_FAILED) { printf("Mapped data: %s\n", data); syscall(SYS_munmap, data, 4096); } syscall(SYS_close, fd); } // Kill a process // pid = syscall(SYS_getpid); // syscall(SYS_kill, pid, SIGTERM); // Get the current time struct timeval tv; syscall(SYS_gettimeofday, &tv, NULL); printf("Seconds: %ld\nMicroseconds: %ld\n", tv.tv_sec, tv.tv_usec); // Get system information struct utsname bufferinfo; if (syscall(SYS_uname, &bufferinfo) == 0) { printf("System name: %s\n", bufferinfo.sysname); printf("Node name: %s\n", bufferinfo.nodename); printf("Release: %s\n", bufferinfo.release); printf("Version: %s\n", bufferinfo.version); printf("Machine: %s\n", bufferinfo.machine); Assert("x86_64", bufferinfo.machine); Assert("Linux", bufferinfo.sysname); } else { perror("syscall(SYS_uname) failed"); } // Get the current user and group IDs uid_t uid = syscall(SYS_getuid); printf("User ID: %d\n", uid); gid_t gid = syscall(SYS_getgid); printf("Group ID: %d\n", gid); // Exit the process syscall(SYS_exit, 0); } chibicc-1.0.24/test/tag_compat.c000066400000000000000000000106151517770275000164410ustar00rootroot00000000000000#include "test.h" #include #define static_assert(...) _Static_assert(__VA_ARGS__) #define TAG_COMPAT_CHK(_res, ...) \ static_assert(_res == _Generic( __VA_ARGS__ :1, default:0)) struct tag {int i;} tagged; struct {int i;} nontag; TAG_COMPAT_CHK(1, tagged, struct tag {int i;} ); TAG_COMPAT_CHK(0, tagged, struct {int i;} ); TAG_COMPAT_CHK(0, nontag, struct tag {int i;} ); TAG_COMPAT_CHK(0, nontag, struct {int i;} ); TAG_COMPAT_CHK(1, struct tag {int i;}, typeof(tagged) ); TAG_COMPAT_CHK(0, struct {int i;}, typeof(tagged) ); TAG_COMPAT_CHK(0, struct tag {int i;}, typeof(nontag) ); TAG_COMPAT_CHK(0, struct {int i;}, typeof(nontag) ); typedef struct tag {int i;} tagged_def; typedef struct {int i;} nontag_def; TAG_COMPAT_CHK(1, struct tag {int i;}, tagged_def ); TAG_COMPAT_CHK(0, struct {int i;}, tagged_def ); TAG_COMPAT_CHK(0, struct tag {int i;}, nontag_def ); TAG_COMPAT_CHK(0, struct {int i;}, nontag_def ); struct { struct tag {int i;} tagged; } inner_tagged; struct { struct {int i;} nontag; } inner_nontag; TAG_COMPAT_CHK(1, inner_tagged.tagged, struct tag {int i;} ); TAG_COMPAT_CHK(0, inner_tagged.tagged, struct {int i;} ); TAG_COMPAT_CHK(0, inner_nontag.nontag, struct tag {int i;} ); TAG_COMPAT_CHK(0, inner_nontag.nontag, struct {int i;} ); TAG_COMPAT_CHK(1, struct tag {int i;}, struct tag {int i;} ); TAG_COMPAT_CHK(1, struct t2 {int :3, i;}, struct t2 {int :3, i;} ); TAG_COMPAT_CHK(1, struct t3 {struct{int i;};}, struct t3 {struct{int i;};} ); TAG_COMPAT_CHK(1, struct t4 {struct t5{int i;} s;}, struct t4 {struct t5{int i;} s;} ); struct t6 {int i;} *p1; TAG_COMPAT_CHK(1, *p1, struct t6 {int i;} ); typedef struct t7 {int i;} t8; TAG_COMPAT_CHK(1, struct t7 {int i;}, struct t7 {int i;} ); typedef struct t7 {int i;} t8; TAG_COMPAT_CHK(1, t8, struct t7 {int i;} ); TAG_COMPAT_CHK(1, struct t7 {int i;}, t8 ); t8 s0; int assign(struct t7 {int i;} s1, t8 s2, struct t7 {int i;} s3) { s0 = s1; s1 = s2; s2 = s3; s3 = s0; return 1; } typedef const struct t7 {int i;} t9; TAG_COMPAT_CHK(0, struct t7 {int i;}, t9 ); TAG_COMPAT_CHK(1, const struct t7 {int i;}, t9 ); TAG_COMPAT_CHK(1, const t8, t9 ); TAG_COMPAT_CHK(1, t8, typeof_unqual(t9) ); int flexible(void) { typedef struct t10 {int i; int b[];} t11; t11 *flex = malloc(sizeof(t11) + 137 * sizeof(int)); struct t10 {int i; int b[];}* flex2 = malloc(sizeof(t11) + 321 * sizeof(int)); TAG_COMPAT_CHK(1, *flex, struct t10 {int i; int b[];} ); TAG_COMPAT_CHK(1, flex, typeof(flex2) ); free(flex), free(flex2); { struct S { char c; char arr[]; }; const struct S s0; static struct S { char c; char arr[]; } s = {1,{2,3,4}}; typedef struct S ST; static_assert(_Generic(s0, typeof(s):1)); static_assert(_Generic(s0, ST:1)); { static const struct S s2 = {1,{1,2,3,4,5}}; static_assert(_Generic(s2, ST:1)); static_assert(_Generic(s2, typeof(s):1)); static_assert(_Generic(typeof(s2), typeof(s0):1)); } } return 1; } int incomplete_ptr(void) { struct list { struct list *next; }; TAG_COMPAT_CHK(1, struct lists { struct list lst; }, struct lists { struct list lst; } ); struct S *p; { typedef struct S {} T; static_assert(_Generic(*p, T:0, default:1)); } struct S { int i; }; { static_assert(_Generic(struct S { int i;}, typeof(*p): 1)); } { static_assert(_Generic(struct S { int j;}, typeof(*p): 0, default: 1)); } return 1; } void param1(struct S *) { typedef const int I; struct S { I i; }; } void param2(struct S *) { struct S { int i; }; } void param3(struct S { int i; } *) { } void param4(struct S *) { struct S { const int i; }; } int incomplete_param(void) { SASSERT(0 == _Generic(param1, typeof(¶m2): 1, default: 0)); SASSERT(0 == _Generic(param1, typeof(¶m3): 1, default: 0)); SASSERT(1 == _Generic(param1, typeof(¶m4): 1, default: 0)); SASSERT(1 == _Generic(param2, typeof(¶m3): 1, default: 0)); SASSERT(0 == _Generic(param2, typeof(¶m4): 1, default: 0)); SASSERT(0 == _Generic(param3, typeof(¶m4): 1, default: 0)); return 1; } void ext_enum1(void) { { enum A { J, K, L=0 }; extern enum A ext_enum; } }; void ext_enum2(void) { enum A { K=1, L=0, J=0 }; extern enum A ext_enum; }; int main(void) { ASSERT(1, assign((t8){},(t8){},(t8){})); ASSERT(1, flexible()); ASSERT(1, incomplete_ptr()); ASSERT(1, incomplete_param()); printf("OK\n"); return 0; }chibicc-1.0.24/test/tco_recursive.c000066400000000000000000000013351517770275000171760ustar00rootroot00000000000000#include "test.h" int factorial(int n, int acc) { if (n == 0) return acc; return factorial(n - 1, acc * n); } int sum_many(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int acc) { if (a1 == 0) return acc; return sum_many(a1 - 1, a2, a3, a4, a5, a6, a7, a8, acc + a1); } int main() { printf("Test: factorial(10, 1)\n"); ASSERT(3628800, factorial(10, 1)); printf("Test: sum_many(10, 2, 3, 4, 5, 6, 7, 8, 0)\n"); ASSERT(55, sum_many(10, 2, 3, 4, 5, 6, 7, 8, 0)); // Test deep recursion to ensure TCO is working (stack overflow > 60000 ) printf("Test: deep recursion sum_many(50000, ...)\n"); ASSERT(1250025000, sum_many(50000, 2, 3, 4, 5, 6, 7, 8, 0)); printf("OK\n"); return 0; } chibicc-1.0.24/test/tco_stack_struct_align.c000066400000000000000000000006631517770275000210550ustar00rootroot00000000000000#include #include "test.h" typedef struct __attribute__((aligned(32))) { char data[17]; } S32; #define CHECK_ALIGN(ptr, align) \ ASSERT(0, ((uintptr_t)(ptr)) & ((align) - 1)) static int recur(int depth, S32 s) { CHECK_ALIGN(&s, 32); ASSERT(3, s.data[0]); if (depth == 0) return 0; return recur(depth - 1, s); } int main(void) { S32 s = {{3}}; ASSERT(0, recur(5, s)); printf("OK\n"); return 0; } chibicc-1.0.24/test/test.h000077500000000000000000000027221517770275000153120ustar00rootroot00000000000000#if defined(__slimcc__) || defined(__chibicc__) #include #undef assert #define ASSERT(x, y) assert(x, y, #y) #define DASSERT(x) _Static_assert((x), ""); ASSERT(1, x) #define EASSERT(x, y) _Static_assert((x) == (y), ""); ASSERT(x, y) #define LASSERT(x, y) assert64(x, y, #y) #define SASSERT(x) _Static_assert(x,"") #define RASSERT(x) assert(1, x, #x) #define ASSERT128(x, y) assert128(x, y, #y, __FILE__, __LINE__) void assert128(__int128, __int128, char *, char *, int); void assert(int expected, int actual, char *code); void assert64(long long expected, long long actual, char *code); int printf(char *fmt, ...); int sprintf(char *buf, char *fmt, ...); int vsprintf(char *buf, char *fmt, void *ap); int strcmp(char *p, char *q); int strncmp(char *p, char *q, long n); int memcmp(char *p, char *q, long n); void exit(int n); int vsprintf(); long strlen(char *s); void *memcpy(void *dest, void *src, long n); void *memset(void *s, int c, long n); #else #include #include #undef assert extern void assert(int expected, int actual, char *code); extern void assert128(__int128, __int128, char *, char *, int); #define ASSERT(x, y) assert(x, y, #y) #define LASSERT(x, y) assert(x, y, #y) #define DASSERT(x) _Static_assert((x), ""); ASSERT(1, x) #define EASSERT(x, y) _Static_assert((x) == (y), ""); ASSERT(x, y) #define SASSERT(x) _Static_assert(x,"") #define ASSERT128(x, y) assert128(x, y, #y, __FILE__, __LINE__) #define RASSERT(x) assert(1, x, #x) #endif chibicc-1.0.24/test/test.txt000066400000000000000000000000341517770275000156710ustar00rootroot00000000000000this is a test file for mmapchibicc-1.0.24/test/test1.c000066400000000000000000000000401517770275000153520ustar00rootroot00000000000000int main(void) { return 0; }chibicc-1.0.24/test/test_abi_mixed.c000066400000000000000000000016221517770275000173010ustar00rootroot00000000000000#include #include struct T { char data[40]; }; void callee(void *it, struct T t, const char *ls, void *line, int lc, long ln, long eln, long *co, long *eco) { printf("callee: it=%p, ls=%p, line=%p, lc=%d, ln=%ld, eln=%ld, co=%p, eco=%p\n", it, ls, line, lc, ln, eln, co, eco); if (co == NULL || eco == NULL) { printf("FAIL: NULL pointers detected!\n"); exit(1); } *co = 123; *eco = 456; } int main() { struct T t; for (int i = 0; i < 40; i++) t.data[i] = i; long co = 0, eco = 0; void *dummy_it = (void*)0x1111; const char *dummy_ls = (void*)0x2222; void *dummy_line = (void*)0x3333; callee(dummy_it, t, dummy_ls, dummy_line, 5, 10, 20, &co, &eco); if (co == 123 && eco == 456) { printf("SUCCESS\n"); return 0; } printf("FAIL: co=%ld, eco=%ld\n", co, eco); return 1; } chibicc-1.0.24/test/test_align.c000066400000000000000000000005061517770275000164520ustar00rootroot00000000000000#include #include int x __attribute__((aligned(64))); int y; int main() { printf("alignof(x) = %zu\n", _Alignof(x)); printf("alignof(y) = %zu\n", _Alignof(y)); if (_Alignof(y) == 64) { printf("BUG: y is aligned to 64!\n"); return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/test_array.c000066400000000000000000000006661517770275000165050ustar00rootroot00000000000000#include #include "test.h" int main(int argc, char** argv) { char _Alignas(1024) arr1[11]; char _Alignas(1024) arr2[argc]; printf("%d\n", _Alignof arr1); // gcc/clang: 1024 chibicc: 1024 ASSERT(1024, _Alignof arr1); printf("%d\n", _Alignof arr2); // gcc/clang: 1024 ASSERT(1024, _Alignof arr2); printf("%d\n", _Alignof *&arr1); // gcc:1024 clang:1 ASSERT(1024, _Alignof *&arr1); return 0; } chibicc-1.0.24/test/test_array_vla.c000066400000000000000000000004631517770275000173420ustar00rootroot00000000000000#include #include "test.h" int main() { int arr[10]; int *ptr = arr; printf("sizeof(arr) = %zu\n", sizeof(arr)); // Should print 40 (for int[10]) ASSERT(40, sizeof(arr)); printf("sizeof(ptr) = %zu\n", sizeof(ptr)); // Should print 8 (assuming 64-bit system) ASSERT(8, sizeof(ptr)); return 0; }chibicc-1.0.24/test/test_atomic_add.c000066400000000000000000000016121517770275000174430ustar00rootroot00000000000000#include #include #include "test.h" typedef uint32_t uint32; typedef int32_t int32; typedef struct { volatile uint32_t value; } pg_atomic_uint32; #define PG_HAVE_ATOMIC_FETCH_ADD_U32 static inline uint32_t pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int32 add_) { uint32 res; __asm__ __volatile__( " lock \n" " xaddl %0,%1 \n" : "=q"(res), "=m"(ptr->value) : "0" (add_), "m"(ptr->value) : "memory", "cc"); return res; } int main() { pg_atomic_uint32 atomic_var = {10}; // Initialize the atomic variable with 10 int32_t add_value = 5; printf("Initial value: %u\n", atomic_var.value); uint32_t old_value = pg_atomic_fetch_add_u32_impl(&atomic_var, add_value); printf("Old value: %u\n", old_value); printf("New value: %u\n", atomic_var.value); ASSERT(10, old_value); ASSERT(15, atomic_var.value); return 0; } chibicc-1.0.24/test/test_avx2_alignment.c000066400000000000000000000032061517770275000202760ustar00rootroot00000000000000#include #include #include int main() { // Test AVX2 intrinsics with different alignments __m256 vec = _mm256_set_ps(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); // Allocate memory with different alignments float *aligned_32 = (float*)_mm_malloc(32, 32); float *aligned_64 = (float*)_mm_malloc(64, 64); float *unaligned = (float*)malloc(32); if (!aligned_32 || !aligned_64 || !unaligned) { fprintf(stderr, "Memory allocation failed\n"); return 1; } // Test unaligned load/store _mm256_storeu_ps(unaligned, vec); __m256 loaded_unaligned = _mm256_loadu_ps(unaligned); printf("Unaligned: %f\n", _mm256_cvtss_f32(loaded_unaligned)); assert(_mm256_cvtss_f32(loaded_unaligned) == 8.0f); // Test aligned load/store _mm256_store_ps(aligned_32, vec); __m256 loaded_aligned = _mm256_load_ps(aligned_32); printf("Aligned (32): %f\n", _mm256_cvtss_f32(loaded_aligned)); assert(_mm256_cvtss_f32(loaded_aligned) == 8.0f); // Test aligned load/store with 64-byte alignment _mm256_store_ps(aligned_64, vec); __m256 loaded_aligned_64 = _mm256_load_ps(aligned_64); printf("Aligned (64): %f\n", _mm256_cvtss_f32(loaded_aligned_64)); assert(_mm256_cvtss_f32(loaded_aligned_64) == 8.0f); // Test with misaligned data float *misaligned = unaligned + 1; _mm256_storeu_ps(misaligned, vec); __m256 loaded_misaligned = _mm256_loadu_ps(misaligned); printf("Misaligned: %f\n", _mm256_cvtss_f32(loaded_misaligned)); assert(_mm256_cvtss_f32(loaded_misaligned) == 8.0f); // Free memory _mm_free(aligned_32); _mm_free(aligned_64); free(unaligned); return 0; }chibicc-1.0.24/test/test_char_array_2.c000066400000000000000000000002021517770275000177050ustar00rootroot00000000000000#include "test.h" int main() { char c = "foobar"[4]; printf("c = %d ('%c')\n", c, c); ASSERT('a', c); return 0; } chibicc-1.0.24/test/test_char_init.c000066400000000000000000000001521517770275000173150ustar00rootroot00000000000000#include "test.h" char c = -1; int main() { printf("c = %d\n", c); ASSERT(-1, c); return 0; } chibicc-1.0.24/test/test_char_init_2.c000066400000000000000000000001531517770275000175370ustar00rootroot00000000000000#include "test.h" char c = 255; int main() { printf("c = %d\n", c); ASSERT(-1, c); return 0; } chibicc-1.0.24/test/test_destructive.c000066400000000000000000000005301517770275000177160ustar00rootroot00000000000000#include typedef int v4si __attribute__((vector_size(16))); typedef v4si myint; v4si global_v; int main() { printf("sizeof(global_v) = %zu\n", sizeof(global_v)); if (sizeof(global_v) != 16) { printf("BUG: v4si size is %zu, expected 16\n", sizeof(global_v)); return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/test_eval_2.c000066400000000000000000000002671517770275000165340ustar00rootroot00000000000000#include "test.h" char sc1 = "foobar"[4]; int main() { // If it's a char, why is the assembly '.quad .L..9+4'? // That's 8 bytes. A char should be '.byte 97'. return 0; } chibicc-1.0.24/test/test_hash.c000066400000000000000000000012151517770275000163010ustar00rootroot00000000000000#include #include "test.h" #define HASHMAP_SIZE 10 unsigned int hash(const char *key) { unsigned int hash = 5381; int c; while ((c = *key++)) hash = ((hash << 5) + hash) + c; // hash * 33 + c return hash % HASHMAP_SIZE; } int main() { char *keys[] = {"float4", "float4a1", "float4a16"}; for (int i = 0; i < 3; i++) { printf("Key: %s, Hash: %u\n", keys[i], hash(keys[i])); if (i == 0) { ASSERT(5, hash(keys[i])); } else if (i == 1) { ASSERT(1, hash(keys[i])); } else if (i == 2) { ASSERT(3, hash(keys[i])); } } return 0; } chibicc-1.0.24/test/test_intrin.c000066400000000000000000000000721517770275000166610ustar00rootroot00000000000000 #include int main(void) { return 0; }chibicc-1.0.24/test/test_large_fn.c000066400000000000000000000022751517770275000171420ustar00rootroot00000000000000void func() { int a = 0; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; a = a + 1; } int main() { func(); return 0; } chibicc-1.0.24/test/test_pg_attr.c000066400000000000000000000052161517770275000170230ustar00rootroot00000000000000#include #include #include // Mimic PostgreSQL types typedef unsigned int Oid; typedef int16_t int16; typedef int32_t int32; typedef char bool; #define NAMEDATALEN 64 typedef struct nameData { char data[NAMEDATALEN]; } NameData; // Mimic FormData_pg_attribute typedef struct FormData_pg_attribute { Oid attrelid; NameData attname; Oid atttypid; int16 attlen; int16 attnum; int32 atttypmod; int16 attndims; bool attbyval; char attalign; char attstorage; char attcompression; bool attnotnull; bool atthasdef; bool atthasmissing; char attidentity; char attgenerated; bool attisdropped; bool attislocal; int16 attinhcount; Oid attcollation; } FormData_pg_attribute; int main(void) { printf("sizeof(FormData_pg_attribute) = %zu\n", sizeof(FormData_pg_attribute)); printf("sizeof(NameData) = %zu\n", sizeof(NameData)); printf("offsetof attrelid = %zu\n", offsetof(FormData_pg_attribute, attrelid)); printf("offsetof attname = %zu\n", offsetof(FormData_pg_attribute, attname)); printf("offsetof atttypid = %zu\n", offsetof(FormData_pg_attribute, atttypid)); printf("offsetof attlen = %zu\n", offsetof(FormData_pg_attribute, attlen)); printf("offsetof attnum = %zu\n", offsetof(FormData_pg_attribute, attnum)); printf("offsetof atttypmod = %zu\n", offsetof(FormData_pg_attribute, atttypmod)); printf("offsetof attndims = %zu\n", offsetof(FormData_pg_attribute, attndims)); printf("offsetof attbyval = %zu\n", offsetof(FormData_pg_attribute, attbyval)); printf("offsetof attalign = %zu\n", offsetof(FormData_pg_attribute, attalign)); printf("offsetof attstorage = %zu\n", offsetof(FormData_pg_attribute, attstorage)); printf("offsetof attcompression = %zu\n", offsetof(FormData_pg_attribute, attcompression)); printf("offsetof attnotnull = %zu\n", offsetof(FormData_pg_attribute, attnotnull)); printf("offsetof atthasdef = %zu\n", offsetof(FormData_pg_attribute, atthasdef)); printf("offsetof atthasmissing = %zu\n", offsetof(FormData_pg_attribute, atthasmissing)); printf("offsetof attidentity = %zu\n", offsetof(FormData_pg_attribute, attidentity)); printf("offsetof attgenerated = %zu\n", offsetof(FormData_pg_attribute, attgenerated)); printf("offsetof attisdropped = %zu\n", offsetof(FormData_pg_attribute, attisdropped)); printf("offsetof attislocal = %zu\n", offsetof(FormData_pg_attribute, attislocal)); printf("offsetof attinhcount = %zu\n", offsetof(FormData_pg_attribute, attinhcount)); printf("offsetof attcollation = %zu\n", offsetof(FormData_pg_attribute, attcollation)); return 0; } chibicc-1.0.24/test/test_postgres_struct.c000066400000000000000000000014631517770275000206350ustar00rootroot00000000000000#include #include struct ProcLike { int head; int pgprocno __attribute__((aligned(64))); int pid; int tail; }; int main() { printf("offsetof(head) = %zu\n", offsetof(struct ProcLike, head)); printf("offsetof(pgprocno) = %zu\n", offsetof(struct ProcLike, pgprocno)); printf("offsetof(pid) = %zu\n", offsetof(struct ProcLike, pid)); printf("offsetof(tail) = %zu\n", offsetof(struct ProcLike, tail)); if (offsetof(struct ProcLike, pgprocno) != 64) { printf("BUG: pgprocno offset is %zu, expected 64\n", offsetof(struct ProcLike, pgprocno)); return 1; } if (offsetof(struct ProcLike, pid) != 68) { printf("BUG: pid offset is %zu, expected 68\n", offsetof(struct ProcLike, pid)); return 1; } printf("OK\n"); return 0; } chibicc-1.0.24/test/test_sc1_type.c000066400000000000000000000001671517770275000171120ustar00rootroot00000000000000#include "test.h" char sc1 = "foobar"[4]; int main() { printf("sizeof(sc1) = %zu\n", sizeof(sc1)); return 0; } chibicc-1.0.24/test/test_stdint.c000066400000000000000000000007001517770275000166610ustar00rootroot00000000000000#include #include #include #include #include "test.h" uint16_t swap_bytes(uint16_t x) { return (x >> 8) | (x << 8); } int main() { uint16_t x = 0x1234; uint16_t y = swap_bytes(x); printf("Original: 0x%x, Swapped: 0x%x\n", x, y); ASSERT(0x3412, y); __uint16_t a = 0x3456; __uint16_t b = swap_bytes(a); printf("Original: 0x%x, Swapped: 0x%x\n", a, b); ASSERT(0x5634, b); return 0; } chibicc-1.0.24/test/test_struct_init.c000066400000000000000000000005171517770275000177310ustar00rootroot00000000000000#include "test.h" int g1 = 77; int g2 = 4; const struct { int *a, *b, *c; } relo = {.a = &g1, .c = &g2}; int main() { printf("relo.a = %p, &g1 = %p, relo.c = %p, &g2 = %p\n", relo.a, &g1, relo.c, &g2); ASSERT(1, relo.a == &g1); ASSERT(1, relo.c == &g2); ASSERT(77, *relo.a); ASSERT(4, *relo.c); return 0; } chibicc-1.0.24/test/test_switch.c000066400000000000000000000044511517770275000166640ustar00rootroot00000000000000#include #include typedef unsigned int Oid; // Match PostgreSQL OID definitions #define BOOLOID 16 #define CHAROID 18 #define NAMEOID 19 #define INT8OID 20 #define INT2OID 21 #define INT4OID 23 #define TEXTOID 25 #define OIDOID 26 #define REGPROCOID 24 #define REGPROCEDUREOID 2202 #define REGOPEROID 2203 #define REGOPERATOROID 2204 #define REGCLASSOID 2205 #define REGTYPEOID 2206 #define REGCOLLATIONOID 4191 #define REGCONFIGOID 3734 #define REGDICTIONARYOID 3769 #define REGROLEOID 4096 #define REGNAMESPACEOID 4089 #define REGDATABASEOID 6456 #define OIDVECTOROID 30 static const char *GetTypeName(Oid keytype) { switch (keytype) { case BOOLOID: return "BOOL"; case CHAROID: return "CHAR"; case NAMEOID: return "NAME"; case INT2OID: return "INT2"; case INT4OID: return "INT4"; case TEXTOID: return "TEXT"; case OIDOID: case REGPROCOID: case REGPROCEDUREOID: case REGOPEROID: case REGOPERATOROID: case REGCLASSOID: case REGTYPEOID: case REGCOLLATIONOID: case REGCONFIGOID: case REGDICTIONARYOID: case REGROLEOID: case REGNAMESPACEOID: case REGDATABASEOID: return "OID variant"; case OIDVECTOROID: return "OIDVECTOR"; default: return "UNSUPPORTED"; } } int main(void) { // Test all the expected types Oid test_types[] = {16, 18, 19, 20, 21, 23, 25, 26, 24, 30}; const char *expected[] = {"BOOL", "CHAR", "NAME", "UNSUPPORTED", "INT2", "INT4", "TEXT", "OID variant", "OID variant", "OIDVECTOR"}; int failures = 0; for (int i = 0; i < 10; i++) { const char *result = GetTypeName(test_types[i]); printf("Type %u: %s (expected: %s) %s\n", test_types[i], result, expected[i], (result == expected[i] || (result[0] == expected[i][0] && result[1] == expected[i][1])) ? "OK" : "FAIL"); } // Also test that type 20 (INT8OID) falls to default printf("\nCritical test: type 20 (INT8OID) = %s (should be UNSUPPORTED)\n", GetTypeName(20)); printf("Critical test: type 23 (INT4OID) = %s (should be INT4)\n", GetTypeName(23)); printf("Critical test: type 26 (OIDOID) = %s (should be OID variant)\n", GetTypeName(26)); return 0; } chibicc-1.0.24/test/test_tco_align.c000066400000000000000000000003731517770275000173210ustar00rootroot00000000000000#include #include void callee(int n) { if (n > 0) callee(n - 1); } void caller(int n) { alignas(32) int x; (void)x; if (n > 0) callee(n - 1); } int main() { caller(10); printf("OK\n"); return 0; } chibicc-1.0.24/test/test_tco_safety.c000066400000000000000000000003711517770275000175200ustar00rootroot00000000000000#include #include void callee(int *p) { if (p) *p = 42; } void caller(int n) { int x; callee(&x); // Address taken! if (n > 0) caller(n - 1); } int main() { caller(10); printf("OK\n"); return 0; } chibicc-1.0.24/test/test_unsigned.c000066400000000000000000000010421517770275000171700ustar00rootroot00000000000000#include "test.h" #include #include void write_buf(char *buf, uint64_t val, int sz) { if (sz == 1) *buf = (char)val; else if (sz == 2) *(uint16_t *)buf = (uint16_t)val; else if (sz == 4) *(uint32_t *)buf = (uint32_t)val; else if (sz == 8) *(uint64_t *)buf = val; else exit(1); } int main() { char buf[8]; unsigned char val = 0xff; write_buf(buf, val, 1); unsigned char read = (unsigned char)buf[0]; printf("read: %d\n", read); ASSERT(255, read); printf("OK\n"); } chibicc-1.0.24/test/thirdparty/000077500000000000000000000000001517770275000163465ustar00rootroot00000000000000chibicc-1.0.24/test/thirdparty/common000077500000000000000000000002411517770275000175610ustar00rootroot00000000000000make="make -j$(nproc)" chibicc=`pwd`/chibicc dir=$(basename -s .git $repo) set -e -x mkdir -p thirdparty cd thirdparty [ -d $dir ] || git clone $repo cd $dir chibicc-1.0.24/test/thirdparty/cpython.sh000077500000000000000000000006231517770275000203720ustar00rootroot00000000000000#!/bin/bash repo='git@github.com:python/cpython.git' . test/thirdparty/common git reset --hard c75330605d4795850ec74fdc4d69aa5d92f76c00 # Python's './configure' command misidentifies chibicc as icc # (Intel C Compiler) because icc is a substring of chibicc. # Modify the configure file as a workaround. sed -i -e 1996,2011d configure.ac autoreconf CC=$chibicc ./configure $make clean $make $make test chibicc-1.0.24/test/thirdparty/git.sh000077500000000000000000000002511517770275000174660ustar00rootroot00000000000000#!/bin/bash repo='git@github.com:git/git.git' . test/thirdparty/common git reset --hard 54e85e7af1ac9e9a92888060d6811ae767fea1bc $make clean $make V=1 CC=$chibicc test chibicc-1.0.24/test/thirdparty/libpng.sh000077500000000000000000000004001517770275000201520ustar00rootroot00000000000000#!/bin/bash repo='git@github.com:rui314/libpng.git' . test/thirdparty/common git reset --hard dbe3e0c43e549a1602286144d94b0666549b18e6 CC=$chibicc ./configure sed -i 's/^wl=.*/wl=-Wl,/; s/^pic_flag=.*/pic_flag=-fPIC/' libtool $make clean $make $make test chibicc-1.0.24/test/thirdparty/sqlite.sh000077500000000000000000000004251517770275000202070ustar00rootroot00000000000000#!/bin/bash repo='git@github.com:sqlite/sqlite.git' . test/thirdparty/common git reset --hard 86f477edaa17767b39c7bae5b67cac8580f7a8c1 CC=$chibicc CFLAGS=-D_GNU_SOURCE ./configure sed -i 's/^wl=.*/wl=-Wl,/; s/^pic_flag=.*/pic_flag=-fPIC/' libtool $make clean $make $make test chibicc-1.0.24/test/thirdparty/tinycc.sh000077500000000000000000000003051517770275000201740ustar00rootroot00000000000000#!/bin/bash repo='git@github.com:TinyCC/tinycc.git' . test/thirdparty/common git reset --hard df67d8617b7d1d03a480a28f9f901848ffbfb7ec ./configure --cc=$chibicc $make clean $make $make CC=cc test chibicc-1.0.24/test/tls.c000077500000000000000000000010711517770275000151240ustar00rootroot00000000000000#include "test.h" #include #include _Thread_local int v1; _Thread_local int v2 = 5; int v3 = 7; int thread_main(void *unused) { ASSERT(0, v1); ASSERT(5, v2); ASSERT(7, v3); v1 = 1; v2 = 2; v3 = 3; ASSERT(1, v1); ASSERT(2, v2); ASSERT(3, v3); return 0; } int main() { pthread_t thr; ASSERT(0, v1); ASSERT(5, v2); ASSERT(7, v3); ASSERT(0, pthread_create(&thr, NULL, thread_main, NULL)); ASSERT(0, pthread_join(thr, NULL)); ASSERT(0, v1); ASSERT(5, v2); ASSERT(3, v3); printf("OK\n"); return 0; } chibicc-1.0.24/test/tls2.c000066400000000000000000000015161517770275000152070ustar00rootroot00000000000000#include "test.h" #include #include static _Thread_local int tentative_tls; static _Thread_local int tentative_tls = 3; extern _Thread_local int extern_tls; void *thread_main(void *unused) { static _Thread_local int v1; static _Thread_local int v2 = 5; ASSERT(0, v1); ASSERT(5, v2); ASSERT(3, tentative_tls); ASSERT(0, extern_tls); v1 = 1; v2 = 2; tentative_tls = 9; extern_tls = 7; ASSERT(1, v1); ASSERT(2, v2); ASSERT(9, tentative_tls); ASSERT(7, extern_tls); return NULL; } int main() { pthread_t thr1; pthread_t thr2; ASSERT(0, pthread_create(&thr1, NULL, thread_main, NULL)); thread_main(NULL); ASSERT(0, pthread_create(&thr2, NULL, thread_main, NULL)); ASSERT(0, pthread_join(thr1, NULL)); ASSERT(0, pthread_join(thr2, NULL)); printf("OK\n"); return 0; }chibicc-1.0.24/test/tls3.c000066400000000000000000000002231517770275000152020ustar00rootroot00000000000000// tls_test.c #include "test.h" __thread int tls; int main(void) { tls = 123; printf("%d\n", tls); ASSERT(tls, 123); return 0; } chibicc-1.0.24/test/trace.h000066400000000000000000000061371517770275000154320ustar00rootroot00000000000000#ifndef TRACE_H #define TRACE_H #ifdef ENABLE_DTRACE #include "memcached_dtrace.h" #else #define MEMCACHED_ASSOC_DELETE(arg0, arg1) #define MEMCACHED_ASSOC_DELETE_ENABLED() (0) #define MEMCACHED_ASSOC_FIND(arg0, arg1, arg2) #define MEMCACHED_ASSOC_FIND_ENABLED() (0) #define MEMCACHED_ASSOC_INSERT(arg0, arg1) #define MEMCACHED_ASSOC_INSERT_ENABLED() (0) #define MEMCACHED_COMMAND_ADD(arg0, arg1, arg2, arg3, arg4) #define MEMCACHED_COMMAND_ADD_ENABLED() (0) #define MEMCACHED_COMMAND_APPEND(arg0, arg1, arg2, arg3, arg4) #define MEMCACHED_COMMAND_APPEND_ENABLED() (0) #define MEMCACHED_COMMAND_CAS(arg0, arg1, arg2, arg3, arg4) #define MEMCACHED_COMMAND_CAS_ENABLED() (0) #define MEMCACHED_COMMAND_DECR(arg0, arg1, arg2, arg3) #define MEMCACHED_COMMAND_DECR_ENABLED() (0) #define MEMCACHED_COMMAND_DELETE(arg0, arg1, arg2) #define MEMCACHED_COMMAND_DELETE_ENABLED() (0) #define MEMCACHED_COMMAND_GET(arg0, arg1, arg2, arg3, arg4) #define MEMCACHED_COMMAND_GET_ENABLED() (0) #define MEMCACHED_COMMAND_TOUCH(arg0, arg1, arg2, arg3, arg4) #define MEMCACHED_COMMAND_TOUCH_ENABLED() (0) #define MEMCACHED_COMMAND_INCR(arg0, arg1, arg2, arg3) #define MEMCACHED_COMMAND_INCR_ENABLED() (0) #define MEMCACHED_COMMAND_PREPEND(arg0, arg1, arg2, arg3, arg4) #define MEMCACHED_COMMAND_PREPEND_ENABLED() (0) #define MEMCACHED_COMMAND_REPLACE(arg0, arg1, arg2, arg3, arg4) #define MEMCACHED_COMMAND_REPLACE_ENABLED() (0) #define MEMCACHED_COMMAND_SET(arg0, arg1, arg2, arg3, arg4) #define MEMCACHED_COMMAND_SET_ENABLED() (0) #define MEMCACHED_CONN_ALLOCATE(arg0) #define MEMCACHED_CONN_ALLOCATE_ENABLED() (0) #define MEMCACHED_CONN_CREATE(arg0) #define MEMCACHED_CONN_CREATE_ENABLED() (0) #define MEMCACHED_CONN_DESTROY(arg0) #define MEMCACHED_CONN_DESTROY_ENABLED() (0) #define MEMCACHED_CONN_DISPATCH(arg0, arg1) #define MEMCACHED_CONN_DISPATCH_ENABLED() (0) #define MEMCACHED_CONN_RELEASE(arg0) #define MEMCACHED_CONN_RELEASE_ENABLED() (0) #define MEMCACHED_ITEM_LINK(arg0, arg1, arg2) #define MEMCACHED_ITEM_LINK_ENABLED() (0) #define MEMCACHED_ITEM_REMOVE(arg0, arg1, arg2) #define MEMCACHED_ITEM_REMOVE_ENABLED() (0) #define MEMCACHED_ITEM_REPLACE(arg0, arg1, arg2, arg3, arg4, arg5) #define MEMCACHED_ITEM_REPLACE_ENABLED() (0) #define MEMCACHED_ITEM_UNLINK(arg0, arg1, arg2) #define MEMCACHED_ITEM_UNLINK_ENABLED() (0) #define MEMCACHED_ITEM_UPDATE(arg0, arg1, arg2) #define MEMCACHED_ITEM_UPDATE_ENABLED() (0) #define MEMCACHED_PROCESS_COMMAND_END(arg0, arg1, arg2) #define MEMCACHED_PROCESS_COMMAND_END_ENABLED() (0) #define MEMCACHED_PROCESS_COMMAND_START(arg0, arg1, arg2) #define MEMCACHED_PROCESS_COMMAND_START_ENABLED() (0) #define MEMCACHED_SLABS_ALLOCATE(arg0, arg1, arg2, arg3) #define MEMCACHED_SLABS_ALLOCATE_ENABLED() (0) #define MEMCACHED_SLABS_ALLOCATE_FAILED(arg0, arg1) #define MEMCACHED_SLABS_ALLOCATE_FAILED_ENABLED() (0) #define MEMCACHED_SLABS_FREE(arg0, arg1, arg2) #define MEMCACHED_SLABS_FREE_ENABLED() (0) #define MEMCACHED_SLABS_SLABCLASS_ALLOCATE(arg0) #define MEMCACHED_SLABS_SLABCLASS_ALLOCATE_ENABLED() (0) #define MEMCACHED_SLABS_SLABCLASS_ALLOCATE_FAILED(arg0) #define MEMCACHED_SLABS_SLABCLASS_ALLOCATE_FAILED_ENABLED() (0) #endif #endif chibicc-1.0.24/test/typedef.c000077500000000000000000000007251517770275000157670ustar00rootroot00000000000000#include "test.h" typedef int MyInt, MyInt2[4]; typedef int; int main() { ASSERT(1, ({ typedef int t; t x=1; x; })); ASSERT(1, ({ typedef struct {int a;} t; t x; x.a=1; x.a; })); ASSERT(1, ({ typedef int t; t t=1; t; })); ASSERT(2, ({ typedef struct {int a;} t; { typedef int t; } t x; x.a=2; x.a; })); ASSERT(4, ({ typedef t; t x; sizeof(x); })); ASSERT(3, ({ MyInt x=3; x; })); ASSERT(16, ({ MyInt2 x; sizeof(x); })); printf("OK\n"); return 0; } chibicc-1.0.24/test/typedef_align_check.c000066400000000000000000000003331517770275000202660ustar00rootroot00000000000000#include #include typedef __attribute__((aligned(32))) int A; int main(){ A z; printf("alignof(A)=%zu alignof(z)=%zu addrmod=%zu\n", _Alignof(A), _Alignof(z), ((uintptr_t)&z)%32); return 0; } chibicc-1.0.24/test/typeof.c000077500000000000000000000005331517770275000156320ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(3, ({ typeof(int) x=3; x; })); ASSERT(3, ({ typeof(1) x=3; x; })); ASSERT(4, ({ int x; typeof(x) y; sizeof(y); })); ASSERT(8, ({ int x; typeof(&x) y; sizeof(y); })); ASSERT(4, ({ typeof("foo") x; sizeof(x); })); ASSERT(12, sizeof(typeof(struct { int a,b,c; }))); printf("OK\n"); return 0; } chibicc-1.0.24/test/ucn_null.c000066400000000000000000000003031517770275000161330ustar00rootroot00000000000000#include "test.h" #include int main() { char *s = "x\u0000y"; if (s[0] == 'x' && s[1] == '\0' && s[2] == 'y') { printf("OK\n"); return 0; } return 1; }chibicc-1.0.24/test/umul.c000066400000000000000000000045511517770275000153070ustar00rootroot00000000000000#include "test.h" #include #include #include typedef unsigned __int128 u128_t; bool umul_overflow_u8(uint8_t a, uint8_t b, uint8_t *res) { uint16_t r = (uint16_t)a * (uint16_t)b; *res = (uint8_t)r; return r > UINT8_MAX; } bool umul_overflow_u16(uint16_t a, uint16_t b, uint16_t *res) { uint32_t r = (uint32_t)a * (uint32_t)b; *res = (uint16_t)r; return r > UINT16_MAX; } bool umul_overflow_u32(uint32_t a, uint32_t b, uint32_t *res) { uint64_t r = (uint64_t)a * (uint64_t)b; *res = (uint32_t)r; return r > UINT32_MAX; } bool umul_overflow_u64(uint64_t a, uint64_t b, uint64_t *res) { u128_t r = (u128_t)a * (u128_t)b; *res = (uint64_t)r; return r > UINT64_MAX; } void test_umul_overflow() { uint8_t r8; uint16_t r16; uint32_t r32; uint64_t r64; __int128 r128; // 8-bit printf("8-bit: %d %d -> %d, overflow=%d\n", 10, 20, r8, umul_overflow_u8(10, 20, &r8)); printf("8-bit overflow: %d %d -> %d, overflow=%d\n", 200, 2, r8, umul_overflow_u8(200, 2, &r8)); ASSERT(0, umul_overflow_u8(10, 20, &r8)); ASSERT(1, umul_overflow_u8(200, 2, &r8)); // 16-bit printf("16-bit: %d %d -> %d, overflow=%d\n", 300, 100, r16, umul_overflow_u16(300, 100, &r16)); printf("16-bit overflow: %d %d -> %d, overflow=%d\n", 40000, 2, r16, umul_overflow_u16(40000, 2, &r16)); ASSERT(0, umul_overflow_u16(300, 100, &r16)); ASSERT(1, umul_overflow_u16(40000, 2, &r16)); // 32-bit printf("32-bit: %u %u -> %u, overflow=%d\n", 100000, 1000, r32, umul_overflow_u32(100000, 1000, &r32)); printf("32-bit overflow: %u %u -> %u, overflow=%d\n", 3000000000U, 2U, r32, umul_overflow_u32(3000000000U, 2U, &r32)); ASSERT(0, umul_overflow_u32(100000, 1000, &r32)); ASSERT(1, umul_overflow_u32(3000000000U, 2U, &r32)); // 64-bit printf("64-bit: %llu %llu -> %llu, overflow=%d\n", 10000000000ULL, 1000ULL, r64, umul_overflow_u64(10000000000ULL, 1000ULL, &r64)); printf("64-bit overflow: %llu %llu -> %llu, overflow=%d\n", 0xFFFFFFFFFFFFFFF0ULL, 2ULL, r64, umul_overflow_u64(0xFFFFFFFFFFFFFFF0ULL, 2ULL, &r64)); ASSERT(0, umul_overflow_u64(10000000000ULL, 1000ULL, &r64)); ASSERT(1, umul_overflow_u64(0xFFFFFFFFFFFFFFF0ULL, 2ULL, &r64)); } int main() { test_umul_overflow(); return 0; } chibicc-1.0.24/test/unicode.c000077500000000000000000000056231517770275000157570ustar00rootroot00000000000000#include "test.h" #define STR(x) #x typedef unsigned short char16_t; typedef unsigned int char32_t; typedef int wchar_t; int π = 3; int main() { ASSERT(4, sizeof(L'\0')); ASSERT(97, L'a'); ASSERT(0, strcmp("αβγ", "\u03B1\u03B2\u03B3")); ASSERT(0, strcmp("日本語", "\u65E5\u672C\u8A9E")); ASSERT(0, strcmp("日本語", "\U000065E5\U0000672C\U00008A9E")); ASSERT(0, strcmp("🌮", "\U0001F32E")); ASSERT(-1, L'\xffffffff'>>31); ASSERT(946, L'β'); ASSERT(12354, L'あ'); ASSERT(127843, L'🍣'); ASSERT(2, sizeof(u'\0')); ASSERT(1, u'\xffff'>>15); ASSERT(97, u'a'); ASSERT(946, u'β'); ASSERT(12354, u'あ'); ASSERT(62307, u'🍣'); ASSERT(0, strcmp(STR(u'a'), "u'a'")); ASSERT(4, sizeof(U'\0')); ASSERT(1, U'\xffffffff'>>31); ASSERT(97, U'a'); ASSERT(946, U'β'); ASSERT(12354, U'あ'); ASSERT(127843, U'🍣'); ASSERT(0, strcmp(STR(U'a'), "U'a'")); ASSERT(4, sizeof(u8"abc")); ASSERT(0, strcmp(u8"abc", "abc")); ASSERT(0, strcmp(STR(u8"a"), "u8\"a\"")); ASSERT(2, sizeof(u"")); ASSERT(10, sizeof(u"\xffzzz")); ASSERT(0, memcmp(u"", "\0\0", 2)); ASSERT(0, memcmp(u"abc", "a\0b\0c\0\0\0", 8)); ASSERT(0, memcmp(u"日本語", "\345e,g\236\212\0\0", 8)); ASSERT(0, memcmp(u"🍣", "<\330c\337\0\0", 6)); ASSERT(u'β', u"βb"[0]); ASSERT(u'b', u"βb"[1]); ASSERT(0, u"βb"[2]); ASSERT(0, strcmp(STR(u"a"), "u\"a\"")); ASSERT(4, sizeof(U"")); ASSERT(20, sizeof(U"\xffzzz")); ASSERT(0, memcmp(U"", "\0\0\0\0", 4)); ASSERT(0, memcmp(U"abc", "a\0\0\0b\0\0\0c\0\0\0\0\0\0\0", 16)); ASSERT(0, memcmp(U"日本語", "\345e\0\0,g\0\0\236\212\0\0\0\0\0\0", 16)); ASSERT(0, memcmp(U"🍣", "c\363\001\0\0\0\0\0", 8)); ASSERT(u'β', U"βb"[0]); ASSERT(u'b', U"βb"[1]); ASSERT(0, U"βb"[2]); ASSERT(1, U"\xffffffff"[0] >> 31); ASSERT(0, strcmp(STR(U"a"), "U\"a\"")); ASSERT(4, sizeof(L"")); ASSERT(20, sizeof(L"\xffzzz")); ASSERT(0, memcmp(L"", "\0\0\0\0", 4)); ASSERT(0, memcmp(L"abc", "a\0\0\0b\0\0\0c\0\0\0\0\0\0\0", 16)); ASSERT(0, memcmp(L"日本語", "\345e\0\0,g\0\0\236\212\0\0\0\0\0\0", 16)); ASSERT(0, memcmp(L"🍣", "c\363\001\0\0\0\0\0", 8)); ASSERT(u'β', L"βb"[0]); ASSERT(u'b', L"βb"[1]); ASSERT(0, L"βb"[2]); ASSERT(-1, L"\xffffffff"[0] >> 31); ASSERT(0, strcmp(STR(L"a"), "L\"a\"")); ASSERT(u'α', ({ char16_t x[] = u"αβ"; x[0]; })); ASSERT(u'β', ({ char16_t x[] = u"αβ"; x[1]; })); ASSERT(6, ({ char16_t x[] = u"αβ"; sizeof(x); })); ASSERT(U'🤔', ({ char32_t x[] = U"🤔x"; x[0]; })); ASSERT(U'x', ({ char32_t x[] = U"🤔x"; x[1]; })); ASSERT(12, ({ char32_t x[] = U"🤔x"; sizeof(x); })); ASSERT(L'🤔', ({ wchar_t x[] = L"🤔x"; x[0]; })); ASSERT(L'x', ({ wchar_t x[] = L"🤔x"; x[1]; })); ASSERT(12, ({ wchar_t x[] = L"🤔x"; sizeof(x); })); ASSERT(3, π); ASSERT(3, ({ int あβ0¾=3; あβ0¾; })); ASSERT(5, ({ int $$$=5; $$$; })); printf("OK\n"); return 0; } chibicc-1.0.24/test/unicode2.c000077500000000000000000000004171517770275000160350ustar00rootroot00000000000000#include #include #include "test.h" int main(void) { printf("\xE2\x98\xA0 \n"); printf("\U0001F602\n"); printf("\u2620\n"); printf("\x09\x65\n"); printf("\u0965\n"); printf("%d\n", '\\'); ASSERT(92, '\\'); return 0; }chibicc-1.0.24/test/unicode3.c000066400000000000000000000070621517770275000160360ustar00rootroot00000000000000// unicode_torture.c #define _GNU_SOURCE #include "test.h" #include #include #include #include #include #include #include #include /* ------------------------------ * 1. UTF-8 byte sequences * ------------------------------ */ static void test_utf8_bytes(void) { const char *utf8[] = { "é", // 2 bytes "漢", // 3 bytes "𝄞", // 4 bytes (U+1D11E) "🙂", // 4 bytes "a̐éö̲", // combining characters NULL }; puts("[UTF-8 byte lengths]"); for (int i = 0; utf8[i]; i++) { printf(" \"%s\" -> %zu bytes\n", utf8[i], strlen(utf8[i])); } } /* ------------------------------ * 2. wchar_t (UTF-32 on Linux) * ------------------------------ */ static void test_wchar(void) { wchar_t w[] = L"é漢𝄞🙂"; puts("\n[wchar_t]"); printf(" sizeof(wchar_t) = %zu\n", sizeof(wchar_t)); printf(" length = %zu\n", wcslen(w)); for (size_t i = 0; w[i]; i++) { printf(" U+%08X\n", (unsigned)w[i]); } } /* ------------------------------ * 3. char16_t / char32_t * ------------------------------ */ static void test_char_types(void) { char16_t u16[] = u"é漢"; char32_t u32[] = U"𝄞🙂"; puts("\n[char16_t]"); for (size_t i = 0; u16[i]; i++) { printf(" U+%04X\n", u16[i]); } puts("\n[char32_t]"); for (size_t i = 0; u32[i]; i++) { printf(" U+%08X\n", u32[i]); } } /* ------------------------------ * 4. Struct alignment stress * ------------------------------ */ struct unicode_struct { char c; wchar_t w; char32_t u32; int64_t x; }; static void test_struct_layout(void) { struct unicode_struct s = { 'A', L'漢', U'🙂', 0x1122334455667788 }; puts("\n[struct layout]"); printf(" sizeof(struct) = %zu\n", sizeof(s)); printf(" offsetof(w) = %zu\n", offsetof(struct unicode_struct, w)); printf(" offsetof(u32) = %zu\n", offsetof(struct unicode_struct, u32)); printf(" offsetof(x) = %zu\n", offsetof(struct unicode_struct, x)); ASSERT(24, sizeof(s)); ASSERT(4, offsetof(struct unicode_struct, w)); ASSERT(8, offsetof(struct unicode_struct, u32)); ASSERT(16, offsetof(struct unicode_struct, x)); } /* ------------------------------ * 5. Varargs with Unicode * ------------------------------ */ static void vtest(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); } static void test_varargs(void) { puts("\n[varargs]"); vtest(" %s %lc %d %f\n", "漢", L'🙂', 42, 3.14159); } /* ------------------------------ * 6. malloc + Unicode lifetime * ------------------------------ */ static void test_heap(void) { puts("\n[heap]"); char *p = strdup("é漢𝄞🙂"); printf(" %s\n", p); free(p); } /* ------------------------------ * 7. Mixed calls (stack stress) * ------------------------------ */ static int recurse(int n, const wchar_t *w) { if (n == 0) return w[0]; return recurse(n - 1, w) + (int)w[n % wcslen(w)]; } static void test_stack(void) { puts("\n[stack]"); wchar_t w[] = L"é漢𝄞🙂"; printf(" result = %d\n", recurse(32, w)); } /* ------------------------------ * main * ------------------------------ */ int main(void) { setlocale(LC_ALL, ""); test_utf8_bytes(); test_wchar(); test_char_types(); test_struct_layout(); test_varargs(); test_heap(); test_stack(); puts("\n[OK]"); return 0; } chibicc-1.0.24/test/unicode4.c000066400000000000000000000040631517770275000160350ustar00rootroot00000000000000#include "test.h" #include #include #define STR(x) #x int main(void) { ASSERT(u8'a', 'a'); SASSERT(_Generic(u8'b', unsigned char:1)); #define CAT(x,y) x##y int CAT(b, 6_) = 7; int CAT(b, 8µ) = 9; ASSERT(7, b6_); ASSERT(9, b8µ); ASSERT(181, u'\u00b5'); ASSERT(129437, U'\U0001F99D'); ASSERT(0x7777, 'w\u0077'); ASSERT(0x777777, '\u0077\U00000077w'); ASSERT(0x77777777, '\x77\u0077w\U00000077'); { long v = '\x80\x80\x80\x80'; ASSERT(1, v < 0); } static const char str1[] = STR('\U0001F99D'); static const char ref1[] = {0x27, 0x5c, 0x55, 0x30, 0x30, 0x30, 0x31, 0x46, 0x39, 0x39, 0x44, 0x27, 0}; static const char str2[] = STR("\u00b5\u28e1\U0001f0a1"); static const char ref2[] = {0x22, 0x5c, 0x75, 0x30, 0x30, 0x62, 0x35, 0x5c, 0x75, 0x32, 0x38, 0x65, 0x31, 0x5c, 0x55, 0x30, 0x30, 0x30, 0x31, 0x66, 0x30, 0x61, 0x31, 0x22, 0}; static const char str3[] = STR(\U0001F99D); static const char ref3[] = {0xf0, 0x9f, 0xa6, 0x9d, 0}; ASSERT(1, sizeof(str1) == sizeof(ref1) && !memcmp(&str1, &ref1, sizeof(ref1))); ASSERT(1, sizeof(str2) == sizeof(ref2) && !memcmp(&str2, &ref2, sizeof(ref2))); ASSERT(1, sizeof(str3) == sizeof(ref3) && !memcmp(&str3, &ref3, sizeof(ref3))); static const char tst8[] = "\u00b5\u28e1\U0001f0a1"; static const char chk8[] = {0xc2, 0xb5, 0xe2, 0xa3, 0xa1, 0xf0, 0x9f, 0x82, 0xa1, 0}; static const char16_t tst16[] = u"\u00b5\u28e1\U0001f0a1"; static const char16_t chk16[] = {0xb5, 0x28e1, 0xd83c, 0xdca1, 0}; static const char32_t tst32[] = U"\u00b5\u28e1\U0001f0a1"; static const char32_t chk32[] = {0xb5, 0x28e1, 0x1f0a1, 0}; ASSERT(1, sizeof(tst8) == sizeof(chk8) && !memcmp(&tst8, &chk8, sizeof(chk8))); ASSERT(1, sizeof(tst16) == sizeof(chk16) && !memcmp(&tst16, &chk16, sizeof(chk16))); ASSERT(1, sizeof(tst32) == sizeof(chk32) && !memcmp(&tst32, &chk32, sizeof(chk32))); int µ42µ = 33; \U000000b542\u00b5 += 6; ASSERT(39, \u00b542\U000000b5); int CAT(\U000000b5, \u00b5) = 44; #ifdef NOTCLANG ASSERT(44, µµ); #endif printf("OK\n"); return 0; }chibicc-1.0.24/test/union.c000077500000000000000000000021521517770275000154530ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(8, ({ union { int a; char b[6]; } x; sizeof(x); })); ASSERT(3, ({ union { int a; char b[4]; } x; x.a = 515; x.b[0]; })); ASSERT(2, ({ union { int a; char b[4]; } x; x.a = 515; x.b[1]; })); ASSERT(0, ({ union { int a; char b[4]; } x; x.a = 515; x.b[2]; })); ASSERT(0, ({ union { int a; char b[4]; } x; x.a = 515; x.b[3]; })); ASSERT(3, ({ union {int a,b;} x,y; x.a=3; y.a=5; y=x; y.a; })); ASSERT(3, ({ union {struct {int a,b;} c;} x,y; x.c.b=3; y.c.b=5; y=x; y.c.b; })); ASSERT(0xef, ({ union { struct { unsigned char a,b,c,d; }; long e; } x; x.e=0xdeadbeef; x.a; })); ASSERT(0xbe, ({ union { struct { unsigned char a,b,c,d; }; long e; } x; x.e=0xdeadbeef; x.b; })); ASSERT(0xad, ({ union { struct { unsigned char a,b,c,d; }; long e; } x; x.e=0xdeadbeef; x.c; })); ASSERT(0xde, ({ union { struct { unsigned char a,b,c,d; }; long e; } x; x.e=0xdeadbeef; x.d; })); ASSERT(3, ({struct { union { int a,b; }; union { int c,d; }; } x; x.a=3; x.b; })); ASSERT(5, ({struct { union { int a,b; }; union { int c,d; }; } x; x.d=5; x.c; })); printf("OK\n"); return 0; } chibicc-1.0.24/test/union2.c000066400000000000000000000160631517770275000155400ustar00rootroot00000000000000#include "test.h" #include union {char a; int b;} g11[2] = {{1}, {3}}; union {int a[2];} g12[2] = {{{1, 2}}}; int *g28 = &g11[1].a; union { struct { int a[3]; } a; } g30 = {{{1,2,3}}}; int *g31=g30.a.a; union {int a[2];} g40[2] = {{1, 2}, 3, 4}; union {int a[2];} g41[2] = {1, 2, 3, 4}; int main() { ASSERT(1, ({ union {int i;} u = {.i=1,}; u.i; })); ASSERT(1, ({ union { int i,j; } u[] = {1,2,3,4}; u[0].i; })); ASSERT(1, ({ union { int i,j; } u[] = {1,2,3,4}; u[0].j; })); ASSERT(2, ({ union { int i,j; } u[] = {1,2,3,4}; u[1].i; })); ASSERT(2, ({ union { int i,j; } u[] = {1,2,3,4}; u[1].j; })); ASSERT(1, ({ typedef union { struct {int i,j;};} U; U u1={1,2}; U u2=u1; u2.i; })); ASSERT(2, ({ typedef union { struct {int i,j;};} U; U u1={1,2}; U u2=u1; u2.j; })); ASSERT(0, ({ typedef union { struct {int a,b;}; struct {int c,d;};} U; U u1={.d=1,}; U u2=u1; u2.a; })); ASSERT(1, ({ typedef union { struct {int a,b;}; struct {int c,d;};} U; U u1={.d=1,}; U u2=u1; u2.b; })); ASSERT(0, ({ typedef union { struct {int a,b;}; struct {int c,d;};} U; U u1={.b=1,}; U u2=u1; u2.c; })); ASSERT(1, ({ typedef union { struct {int a,b;}; struct {int c,d;};} U; U u1={.b=1,}; U u2=u1; u2.d; })); ASSERT(2, ({ union { struct {int i; int j;} t; int k;} s = {.t.i=1, .k=2,}; s.t.i; })); ASSERT(0, ({ union { struct {int i; int j;} t; int k;} s = {.t.i=1, .k=2,}; s.t.j; })); ASSERT(2, ({ union { struct {int i; int j;} t; int k;} s = {.t.i=1, .k=2,}; s.k; })); ASSERT(1, ({ union { struct {int a, b;} c;} s = {.c.a = 1,.c.b = 2,}; s.c.a; })); ASSERT(2, ({ union { struct {int a, b;} c;} s = {.c.a = 1,.c.b = 2,}; s.c.b; })); ASSERT(7, ({ union { struct {int a,b,c;};} s = {.a=7,5,3}; s.a; })); ASSERT(5, ({ union { struct {int a,b,c;};} s = {.a=7,5,3}; s.b; })); ASSERT(3, ({ union { struct {int a,b,c;};} s = {.a=7,5,3}; s.c; })); ASSERT(0, ({ union { struct {char a,b,c;};} s = {.b=7,5}; s.a; })); ASSERT(7, ({ union { struct {char a,b,c;};} s = {.b=7,5}; s.b; })); ASSERT(5, ({ union { struct {char a,b,c;};} s = {.b=7,5}; s.c; })); ASSERT(3, ({ union { struct {char a,b,c;};} s = {.b=7,5,.a=3,1}; s.a; })); ASSERT(1, ({ union { struct {char a,b,c;};} s = {.b=7,5,.a=3,1}; s.b; })); ASSERT(5, ({ union { struct {char a,b,c;};} s = {.b=7,5,.a=3,1}; s.c; })); ASSERT(3, ({ union { struct {int a,b,c;};} s = {3,.b=5,7}; s.a; })); ASSERT(5, ({ union { struct {int a,b,c;};} s = {3,.b=5,7}; s.b; })); ASSERT(7, ({ union { struct {int a,b,c;};} s = {3,.b=5,7}; s.c; })); ASSERT(3, ({ union { struct {int a,b,c;};} s = {3,5,.c=7}; s.a; })); ASSERT(5, ({ union { struct {int a,b,c;};} s = {3,5,.c=7}; s.b; })); ASSERT(7, ({ union { struct {int a,b,c;};} s = {3,5,.c=7}; s.c; })); ASSERT(1, ({ union {int a; int b; int c;} x={1,2,3}; x.a; })); ASSERT(1, ({ union {int a; int b; int c;} x={1,2,3}; x.b; })); ASSERT(1, ({ union {int a; int b; int c;} x={1,2,3}; x.c; })); ASSERT(1, ({ union {int a; int b; int c;} x={1}; x.a; })); ASSERT(1, ({ union {int a; int b; int c;} x={1}; x.b; })); ASSERT(1, ({ union {int a; int b; int c;} x={1}; x.c; })); ASSERT(1, ({ union {int a; int b;} x[2]={{1,2},{3,4}}; x[0].a; })); ASSERT(1, ({ union {int a; int b;} x[2]={{1,2},{3,4}}; x[0].b; })); ASSERT(3, ({ union {int a; int b;} x[2]={{1,2},{3,4}}; x[1].a; })); ASSERT(3, ({ union {int a; int b;} x[2]={{1,2},{3,4}}; x[1].b; })); ASSERT(2, ({ union {int a; int b;} x[2]={{1},{2}}; x[1].b; })); ASSERT(0, ({ union {int a; int b;} x={}; x.a; })); ASSERT(0, ({ union {int a; int b;} x={}; x.b; })); ASSERT(1, ({ typedef union {int a,b,c,d,e,f;} T; T x={1,2,3,4,5,6}; T y; y=x; y.e; })); ASSERT(1, ({ typedef union {int a,b;} T; T x={1,2}; T y, z; z=y=x; z.b; })); ASSERT(1, ({ typedef union {int a,b;} T; T x={1,2}; T y=x; y.a; })); ASSERT(1, g11[0].a); ASSERT(1, g11[0].b); ASSERT(3, g11[1].a); ASSERT(3, g11[1].b); ASSERT(1, g12[0].a[0]); ASSERT(2, g12[0].a[1]); ASSERT(0, g12[1].a[0]); ASSERT(0, g12[1].a[1]); ASSERT(3, *g28); ASSERT(1, g31[0]); ASSERT(2, g31[1]); ASSERT(3, g31[2]); ASSERT(1, g40[0].a[0]); ASSERT(2, g40[0].a[1]); ASSERT(3, g40[1].a[0]); ASSERT(4, g40[1].a[1]); ASSERT(1, g41[0].a[0]); ASSERT(2, g41[0].a[1]); ASSERT(3, g41[1].a[0]); ASSERT(4, g41[1].a[1]); ASSERT(0, ({ union {int a; int b;} x[2]={0,1,2,3}; x[0].a; })); ASSERT(1, ({ union {int a; int b;} x[2]={0,1,2,3}; x[1].a; })); ASSERT(1, ({ union {int a,b,c;} x={1,2,3,}; x.a; })); ASSERT(1, ({ union {int a; char b;} x={1,}; x.a; })); ASSERT(4, ({ union { int a,b; } x={1,.a=4}; x.a; })); ASSERT(4, ({ union { int a,b; } x={1,2,.b=3,.a=4}; x.b; })); ASSERT(1, ({ union { struct { int a,b; } c; } x={.c=1,2}; x.c.a; })); ASSERT(2, ({ union { struct { int a,b; } c; } x={.c=1,2}; x.c.b; })); ASSERT(0, ({ union { struct { int a,b; } c; } x={.c.b=1}; x.c.a; })); ASSERT(1, ({ union { struct { int a,b; } c; } x={.c.b=1}; x.c.b; })); ASSERT(1, ({ union { int a[2]; } x={.a=1,2}; x.a[0]; })); ASSERT(2, ({ union { int a[2]; } x={.a=1,2}; x.a[1]; })); ASSERT(0, ({ union { int a[2]; } x={.a[1]=1}; x.a[0]; })); ASSERT(1, ({ union { int a[2]; } x={.a[1]=1}; x.a[1]; })); ASSERT(3, ({ union { int a,b; } x[]={[1].b=1,2,[0]=3,}; x[0].a; })); ASSERT(3, ({ union { int a,b; } x[]={[1].b=1,2,[0]=3,}; x[0].b; })); ASSERT(1, ({ union { int a,b; } x[]={[1].b=1,2,[0]=3,}; x[1].a; })); ASSERT(1, ({ union { int a,b; } x[]={[1].b=1,2,[0]=3,}; x[1].b; })); ASSERT(2, ({ union { int a,b; } x[]={[1].b=1,2,[0]=3,}; x[2].a; })); ASSERT(2, ({ union { int a,b; } x[]={[1].b=1,2,[0]=3,}; x[2].b; })); ASSERT(3, ({ union { int a; struct {int b,c;}; } x[]={[1].c=1,2,[0]=3,}; x[0].a; })); ASSERT(0, ({ union { int a; struct {int b,c;}; } x[]={[1].c=1,2,[0]=3,}; x[0].c; })); ASSERT(0, ({ union { int a; struct {int b,c;}; } x[]={[1].c=1,2,[0]=3,}; x[1].a; })); ASSERT(1, ({ union { int a; struct {int b,c;}; } x[]={[1].c=1,2,[0]=3,}; x[1].c; })); ASSERT(2, ({ union { int a; struct {int b,c;}; } x[]={[1].c=1,2,[0]=3,}; x[2].a; })); ASSERT(0, ({ union { int a; struct {int b,c;}; } x[]={[1].c=1,2,[0]=3,}; x[2].c; })); ASSERT(1, ({ typedef union { int a,b; } T; T x={1,2}; T y[]={x}; y[0].a; })); ASSERT(1, ({ typedef union { int a,b; } T; T x={1,2}; T y[]={x}; y[0].b; })); ASSERT(1, ({ typedef union { int a,b; } T; T x={1}; T y[]={x, [2].b=3}; y[0].a; })); ASSERT(3, ({ typedef union { int a,b; } T; T x={1}; T y[]={x, [2].b=3}; y[2].b; })); ASSERT(5, ((union { int a,b,c; }){ .c=5 }).c); ASSERT(5, ((union { int a,b,c; }){ .c=5 }).a); ASSERT(3, ({ union { struct { int a; struct { int b, c; }; }; } x={.b=1,2,.a=3}; x.a; })); ASSERT(1, ({ union { struct { int a; struct { int b, c; }; }; } x={.b=1,2,.a=3}; x.b; })); ASSERT(2, ({ union { struct { int a; struct { int b, c; }; }; } x={.b=1,2,.a=3}; x.c; })); ASSERT(5, ({ union U { int8_t a; int64_t :37; }; sizeof(union U); })); ASSERT(1, ({ union U { int8_t a; int64_t :37; }; _Alignof(union U); })); ASSERT(6, ({ union U { int16_t a; int64_t :47; }; sizeof(union U); })); ASSERT(2, ({ union U { int16_t a; int64_t :47; }; _Alignof(union U); })); printf("OK\n"); return 0; }chibicc-1.0.24/test/unsigned_load.c000066400000000000000000000027751517770275000171460ustar00rootroot00000000000000#include "test.h" #include typedef unsigned int Oid; struct T { int a; long b; int c; }; int main() { // Test 1: Unsigned int with high bit set (0x80000000) // When loaded into a 64-bit register, it should be zero-extended. unsigned int u = 0x80000000; unsigned long long lu = u; // If sign-extended (movsxd), 0x80000000 becomes 0xFFFFFFFF80000000 // If zero-extended (mov), 0x80000000 becomes 0x0000000080000000 ASSERT(2147483648, lu); // Test 2: Signed int with high bit set (negative) // Should be sign-extended. int s = -2147483648; long long ls = s; ASSERT(-2147483648, ls); // Test 3: Oid type (unsigned int) Oid oid = 0xF0000000; unsigned long datum = (unsigned long)oid; // 0xF0000000 = 4026531840 ASSERT(4026531840, datum); // Test 4: Explicit cast behavior unsigned int u2 = 0xFFFFFFFF; long long l2 = (long long)u2; ASSERT(4294967295, l2); printf("sizeof(int)=%zu\n", sizeof(int)); printf("sizeof(unsigned int)=%zu\n", sizeof(unsigned int)); printf("sizeof(long)=%zu\n", sizeof(long)); printf("sizeof(void*)=%zu\n", sizeof(void*)); printf("sizeof(enum { A })=%zu\n", sizeof(enum { A })); printf("offsetof(a)=%zu\n", offsetof(struct T, a)); printf("offsetof(b)=%zu\n", offsetof(struct T, b)); printf("offsetof(c)=%zu\n", offsetof(struct T, c)); printf("sizeof=%zu\n", sizeof(struct T)); unsigned int x = 0xffffffffu; printf("%u\n", x); if (x > 0) puts("ok"); else printf("KO\n"); printf("OK\n"); return 0; }chibicc-1.0.24/test/unused_decl.c000066400000000000000000000003051517770275000166100ustar00rootroot00000000000000typedef int (f_t)(int); f_t a, b; // Testing comma list (CPython) int main() { if (0) b(42); // Should compile now return 0; } // 'a' and 'b' are unreferenced, should not appear in nm as 'U' chibicc-1.0.24/test/usualconv.c000077500000000000000000000014611517770275000163440ustar00rootroot00000000000000#include "test.h" static int ret10(void) { return 10; } int main() { ASSERT((long)-5, -10 + (long)5); ASSERT((long)-15, -10 - (long)5); ASSERT((long)-50, -10 * (long)5); ASSERT((long)-2, -10 / (long)5); ASSERT(1, -2 < (long)-1); ASSERT(1, -2 <= (long)-1); ASSERT(0, -2 > (long)-1); ASSERT(0, -2 >= (long)-1); ASSERT(1, (long)-2 < -1); ASSERT(1, (long)-2 <= -1); ASSERT(0, (long)-2 > -1); ASSERT(0, (long)-2 >= -1); ASSERT(0, 2147483647 + 2147483647 + 2); ASSERT((long)-1, ({ long x; x=-1; x; })); ASSERT(1, ({ char x[3]; x[0]=0; x[1]=1; x[2]=2; char *y=x+1; y[0]; })); ASSERT(0, ({ char x[3]; x[0]=0; x[1]=1; x[2]=2; char *y=x+1; y[-1]; })); ASSERT(5, ({ struct t {char a;} x, y; x.a=5; y=x; y.a; })); ASSERT(10, (1 ? ret10 : (void *)0)()); printf("OK\n"); return 0; } chibicc-1.0.24/test/util.h000066400000000000000000000024631517770275000153070ustar00rootroot00000000000000#include "config.h" /* fast-enough functions for uriencoding strings. */ void uriencode_init(void); bool uriencode(const char *src, char *dst, const size_t srclen, const size_t dstlen); /* * Wrappers around strtoull/strtoll that are safer and easier to * use. For tests and assumptions, see internal_tests.c. * * str a NULL-terminated base decimal 10 unsigned integer * out out parameter, if conversion succeeded * * returns true if conversion succeeded. */ bool safe_strtoull(const char *str, uint64_t *out); bool safe_strtoull_hex(const char *str, uint64_t *out); bool safe_strtoll(const char *str, int64_t *out); bool safe_strtoul(const char *str, uint32_t *out); bool safe_strtol(const char *str, int32_t *out); bool safe_strtod(const char *str, double *out); bool safe_strcpy(char *dst, const char *src, const size_t dstmax); bool safe_memcmp(const void *a, const void *b, size_t len); #ifndef HAVE_HTONLL extern uint64_t htonll(uint64_t); extern uint64_t ntohll(uint64_t); #endif #ifdef __GCC # define __gcc_attribute__ __attribute__ #else # define __gcc_attribute__(x) #endif /** * Vararg variant of perror that makes for more useful error messages * when reporting with parameters. * * @param fmt a printf format */ void vperror(const char *fmt, ...) __gcc_attribute__ ((format (printf, 1, 2))); chibicc-1.0.24/test/uuid.c000066400000000000000000000053401517770275000152700ustar00rootroot00000000000000#define _GNU_SOURCE #include "test.h" #include #include #include typedef unsigned char uuid_t[16]; // If is not found struct uuid { uint32_t time_low; uint16_t time_mid; uint16_t time_hi_and_version; uint8_t clock_seq_hi_and_reserved; uint8_t clock_seq_low; uint8_t node[6]; }; // Weak alias extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv) __attribute__((weak, alias("__uuid_time"))); // Simulate the type decoder int __uuid_type(const struct uuid *uu) { return (uu->time_hi_and_version >> 12); } #define UUID_TYPE_DCE_TIME 1 #define UUID_TYPE_DCE_TIME_V6 6 #define UUID_TYPE_DCE_TIME_V7 7 void uuid_unpack(const uuid_t in, struct uuid *uu) { // Very naive unpacking; only for test/demo purposes uu->time_low = (in[0] << 24) | (in[1] << 16) | (in[2] << 8) | in[3]; uu->time_mid = (in[4] << 8) | in[5]; uu->time_hi_and_version = (in[6] << 8) | in[7]; uu->clock_seq_hi_and_reserved = in[8]; uu->clock_seq_low = in[9]; for (int i = 0; i < 6; i++) { uu->node[i] = in[10 + i]; } } void uuid_time_v1(const struct uuid *uu, struct timeval *tv) { tv->tv_sec = 111111; tv->tv_usec = 222; } void uuid_time_v6(const struct uuid *uu, struct timeval *tv) { tv->tv_sec = 666666; tv->tv_usec = 666; } void uuid_time_v7(const struct uuid *uu, struct timeval *tv) { tv->tv_sec = 777777; tv->tv_usec = 777; } // Real implementation time_t __uuid_time(const uuid_t uu, struct timeval *ret_tv) { struct timeval tv; struct uuid uuid; uint8_t type; uuid_unpack(uu, &uuid); type = __uuid_type(&uuid); switch (type) { case UUID_TYPE_DCE_TIME: uuid_time_v1(&uuid, &tv); break; case UUID_TYPE_DCE_TIME_V6: uuid_time_v6(&uuid, &tv); break; case UUID_TYPE_DCE_TIME_V7: uuid_time_v7(&uuid, &tv); break; default: tv.tv_sec = -1; tv.tv_usec = -1; break; } if (ret_tv) *ret_tv = tv; return tv.tv_sec; } int main(void) { uuid_t test_uuid = { 0x12, 0x34, 0x56, 0x78, // time_low 0x9a, 0xbc, // time_mid 0x10, 0x00, // version = 1 (UUID_TYPE_DCE_TIME) 0xde, 0xad, // clock seq 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe // node }; struct timeval tv; time_t t = uuid_time(test_uuid, &tv); printf("uuid_time result: %ld.%06ld\n", (long)t, (long)tv.tv_usec); ASSERT(111111, (long)t); ASSERT(222, (long)tv.tv_usec); return 0; }chibicc-1.0.24/test/va_copy.c000066400000000000000000000006621517770275000157640ustar00rootroot00000000000000// va_copy_test.c #include #include static int sum(int n, ...) { va_list ap, ap2; va_start(ap, n); va_copy(ap2, ap); int s1 = 0, s2 = 0; for (int i = 0; i < n; i++) s1 += va_arg(ap, int); for (int i = 0; i < n; i++) s2 += va_arg(ap2, int); va_end(ap); va_end(ap2); return s1 + s2; } int main(void) { printf("%d\n", sum(4, 1, 2, 3, 4)); // expected 20 } chibicc-1.0.24/test/varargs.c000077500000000000000000000017011517770275000157670ustar00rootroot00000000000000#include "test.h" #include int sum1(int x, ...) { va_list ap; va_start(ap, x); for (;;) { int y = va_arg(ap, int); if (y == 0) return x; x += y; } } int sum2(int x, ...) { va_list ap; va_start(ap, x); for (;;) { double y = va_arg(ap, double); x += y; int z = va_arg(ap, int); if (z == 0) return x; x += z; } } void fmt(char *buf, char *fmt, ...) { va_list ap; va_start(ap, fmt); va_list ap2; va_copy(ap2, ap); vsprintf(buf, fmt, ap2); va_end(buf); } int main() { ASSERT(6, sum1(1, 2, 3, 0)); ASSERT(55, sum1(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0)); ASSERT(21, sum2(1, 2.0, 3, 4.0, 5, 6.0, 0)); ASSERT(21, sum2(1, 2.0, 3, 4.0, 5, 6.0, 0)); ASSERT(210, sum2(1, 2.0, 3, 4.0, 5, 6.0, 7, 8.0, 9, 10.0, 11, 12.0, 13, 14.0, 15, 16.0, 17, 18.0, 19, 20.0, 0)); ASSERT(0, ({ char buf[100]; fmt(buf, "%d %d", 2, 3); strcmp(buf, "2 3"); })); printf("OK\n"); return 0; } chibicc-1.0.24/test/variable.c000077500000000000000000000044101517770275000161070ustar00rootroot00000000000000#include "test.h" int g1, g2[4]; static int g3 = 3; int main() { ASSERT(3, ({ int a; a=3; a; })); ASSERT(3, ({ int a=3; a; })); ASSERT(8, ({ int a=3; int z=5; a+z; })); ASSERT(3, ({ int a=3; a; })); ASSERT(8, ({ int a=3; int z=5; a+z; })); ASSERT(6, ({ int a; int b; a=b=3; a+b; })); ASSERT(3, ({ int foo=3; foo; })); ASSERT(8, ({ int foo123=3; int bar=5; foo123+bar; })); ASSERT(4, ({ int x; sizeof(x); })); ASSERT(4, ({ int x; sizeof x; })); ASSERT(8, ({ int *x; sizeof(x); })); ASSERT(16, ({ int x[4]; sizeof(x); })); ASSERT(48, ({ int x[3][4]; sizeof(x); })); ASSERT(16, ({ int x[3][4]; sizeof(*x); })); ASSERT(4, ({ int x[3][4]; sizeof(**x); })); ASSERT(5, ({ int x[3][4]; sizeof(**x) + 1; })); ASSERT(5, ({ int x[3][4]; sizeof **x + 1; })); ASSERT(4, ({ int x[3][4]; sizeof(**x + 1); })); ASSERT(4, ({ int x=1; sizeof(x=2); })); ASSERT(1, ({ int x=1; sizeof(x=2); x; })); ASSERT(0, g1); ASSERT(3, ({ g1=3; g1; })); ASSERT(0, ({ g2[0]=0; g2[1]=1; g2[2]=2; g2[3]=3; g2[0]; })); ASSERT(1, ({ g2[0]=0; g2[1]=1; g2[2]=2; g2[3]=3; g2[1]; })); ASSERT(2, ({ g2[0]=0; g2[1]=1; g2[2]=2; g2[3]=3; g2[2]; })); ASSERT(3, ({ g2[0]=0; g2[1]=1; g2[2]=2; g2[3]=3; g2[3]; })); ASSERT(4, sizeof(g1)); ASSERT(16, sizeof(g2)); ASSERT(1, ({ char x=1; x; })); ASSERT(1, ({ char x=1; char y=2; x; })); ASSERT(2, ({ char x=1; char y=2; y; })); ASSERT(1, ({ char x; sizeof(x); })); ASSERT(10, ({ char x[10]; sizeof(x); })); ASSERT(2, ({ int x=2; { int x=3; } x; })); ASSERT(2, ({ int x=2; { int x=3; } int y=4; x; })); ASSERT(3, ({ int x=2; { x=3; } x; })); ASSERT(7, ({ int x; int y; char z; char *a=&y; char *b=&z; b-a; })); ASSERT(1, ({ int x; char y; int z; char *a=&y; char *b=&z; b-a; })); ASSERT(8, ({ long x; sizeof(x); })); ASSERT(2, ({ short x; sizeof(x); })); ASSERT(24, ({ char *x[3]; sizeof(x); })); ASSERT(8, ({ char (*x)[3]; sizeof(x); })); ASSERT(1, ({ char (x); sizeof(x); })); ASSERT(3, ({ char (x)[3]; sizeof(x); })); ASSERT(12, ({ char (x[3])[4]; sizeof(x); })); ASSERT(4, ({ char (x[3])[4]; sizeof(x[0]); })); ASSERT(3, ({ char *x[3]; char y; x[0]=&y; y=3; x[0][0]; })); ASSERT(4, ({ char x[3]; char (*y)[3]=x; y[0][0]=4; y[0][0]; })); { void *x; } ASSERT(3, g3); printf("OK\n"); return 0; } chibicc-1.0.24/test/variable_test.c000066400000000000000000000101721517770275000171450ustar00rootroot00000000000000#include "test.h" int g1, g2[4]; static int g3 = 3; int main() { ASSERT(3, ({ int a; a = 3; a; })); ASSERT(3, ({ int a = 3; a; })); ASSERT(8, ({ int a = 3; int z = 5; a + z; })); ASSERT(3, ({ int a = 3; a; })); ASSERT(8, ({ int a = 3; int z = 5; a + z; })); ASSERT(6, ({ int a; int b; a = b = 3; a + b; })); ASSERT(3, ({ int foo = 3; foo; })); ASSERT(8, ({ int foo123 = 3; int bar = 5; foo123 + bar; })); ASSERT(4, ({ int x; sizeof(x); })); ASSERT(4, ({ int x; sizeof x; })); ASSERT(8, ({ int *x; sizeof(x); })); ASSERT(16, ({ int x[4]; sizeof(x); })); ASSERT(48, ({ int x[3][4]; sizeof(x); })); ASSERT(16, ({ int x[3][4]; sizeof(*x); })); ASSERT(4, ({ int x[3][4]; sizeof(**x); })); ASSERT(5, ({ int x[3][4]; sizeof(**x) + 1; })); ASSERT(5, ({ int x[3][4]; sizeof **x + 1; })); ASSERT(4, ({ int x[3][4]; sizeof(**x + 1); })); ASSERT(4, ({ int x = 1; sizeof(x = 2); })); ASSERT(1, ({ int x = 1; sizeof(x = 2); x; })); ASSERT(0, g1); ASSERT(3, ({ g1 = 3; g1; })); ASSERT(0, ({ g2[0] = 0; g2[1] = 1; g2[2] = 2; g2[3] = 3; g2[0]; })); ASSERT(1, ({ g2[0] = 0; g2[1] = 1; g2[2] = 2; g2[3] = 3; g2[1]; })); ASSERT(2, ({ g2[0] = 0; g2[1] = 1; g2[2] = 2; g2[3] = 3; g2[2]; })); ASSERT(3, ({ g2[0] = 0; g2[1] = 1; g2[2] = 2; g2[3] = 3; g2[3]; })); ASSERT(4, sizeof(g1)); ASSERT(16, sizeof(g2)); ASSERT(1, ({ char x = 1; x; })); ASSERT(1, ({ char x = 1; char y = 2; x; })); ASSERT(2, ({ char x = 1; char y = 2; y; })); ASSERT(1, ({ char x; sizeof(x); })); ASSERT(10, ({ char x[10]; sizeof(x); })); ASSERT(2, ({ int x = 2; { int x = 3; } x; })); ASSERT(2, ({ int x = 2; { int x = 3; } int y = 4; x; })); ASSERT(3, ({ int x = 2; { x = 3; } x; })); ASSERT(7, ({ int x; int y; char z; char *a = &y; char *b = &z; b - a; })); ASSERT(1, ({ int x; char y; int z; char *a = &y; char *b = &z; b - a; })); ASSERT(8, ({ long x; sizeof(x); })); ASSERT(2, ({ short x; sizeof(x); })); ASSERT(24, ({ char *x[3]; sizeof(x); })); ASSERT(8, ({ char(*x)[3]; sizeof(x); })); ASSERT(1, ({ char(x); sizeof(x); })); ASSERT(3, ({ char(x)[3]; sizeof(x); })); ASSERT(12, ({ char(x[3])[4]; sizeof(x); })); ASSERT(4, ({ char(x[3])[4]; sizeof(x[0]); })); ASSERT(3, ({ char *x[3]; char y; x[0] = &y; y = 3; x[0][0]; })); ASSERT(4, ({ char x[3]; char(*y)[3] = x; y[0][0] = 4; y[0][0]; })); { void *x; } ASSERT(3, g3); return 0; }chibicc-1.0.24/test/variadic.c000066400000000000000000000003511517770275000161010ustar00rootroot00000000000000#include #include #include "test.h" void test(const char *fmt, ...) { va_list ap; va_start(ap, fmt); int x = va_arg(ap, int); printf("x = %d\n", x); ASSERT(42, x); } int main() { test("int", 42); } chibicc-1.0.24/test/variadic2.c000066400000000000000000000005301517770275000161620ustar00rootroot00000000000000#include #include #include "test.h" typedef struct { char c; } SmallStruct; void test(const char *fmt, ...) { va_list ap; va_start(ap, fmt); SmallStruct s = va_arg(ap, SmallStruct); printf("s.c = %d\n", s.c); ASSERT(42, s.c); } int main() { SmallStruct s = {42}; test("struct", s); ASSERT(42, s.c); } chibicc-1.0.24/test/variadic2b.c000066400000000000000000000005501517770275000163260ustar00rootroot00000000000000#include #include #include void test(const char *fmt, ...) { va_list ap; va_start(ap, fmt); // char is promoted to int in variadic arguments int c = va_arg(ap, int); printf("c = %d\n", c); assert(c == 42); va_end(ap); } int main() { char x = 42; test("char", x); printf("Test passed.\n"); return 0; } chibicc-1.0.24/test/variadic3.c000066400000000000000000000011261517770275000161650ustar00rootroot00000000000000#include #include #include "test.h" typedef struct { long double ld; } MyStruct; void print_variadic(int count, ...) { va_list ap; va_start(ap, count); for (int i = 0; i < count; i++) { MyStruct s = va_arg(ap, MyStruct); printf("MyStruct[%d].ld = %Lf\n", i, s.ld); if (i == 0) ASSERT(1, s.ld); else if (i == 1) ASSERT(9, s.ld); } va_end(ap); } int main(void) { MyStruct a = {1.234567890123456789L}; MyStruct b = {9.876543210987654321L}; print_variadic(2, a, b); return 0; } chibicc-1.0.24/test/variadic4.c000066400000000000000000000032001517770275000161610ustar00rootroot00000000000000#include #include #include #include "test.h" void test_variadic(int count, ...) { va_list ap; va_start(ap, count); char c = va_arg(ap, int); // promoted unsigned char uc = va_arg(ap, int); // promoted short s = va_arg(ap, int); // promoted unsigned short us = va_arg(ap, int); // promoted int i = va_arg(ap, int); unsigned int ui = va_arg(ap, unsigned int); long l = va_arg(ap, long); unsigned long ul = va_arg(ap, unsigned long); long long ll = va_arg(ap, long long); unsigned long long ull = va_arg(ap, unsigned long long); float f = (float)va_arg(ap, double); // promoted to double double d = va_arg(ap, double); printf("char: %d\n", c); printf("unsigned char: %u\n", uc); printf("short: %d\n", s); printf("unsigned short: %u\n", us); printf("int: %d\n", i); printf("unsigned int: %u\n", ui); printf("long: %ld\n", l); printf("unsigned long: %lu\n", ul); printf("long long: %lld\n", ll); printf("unsigned long long: %llu\n", ull); printf("float: %f\n", f); printf("double: %f\n", d); ASSERT(-1, c); ASSERT(255, uc); ASSERT(-12345, s); ASSERT(54321, us); ASSERT(-123456, i); ASSERT(123456u, ui); ASSERT(-123456789L, l); ASSERT(123456789UL, ul); ASSERT(-123456789012345LL, ll); ASSERT(123456789012345ULL, ull); ASSERT(1.25f, f); ASSERT(3.14159, d); va_end(ap); } int main() { test_variadic(12, (char)-1, (unsigned char)255, (short)-12345, (unsigned short)54321, -123456, 123456u, -123456789L, 123456789UL, -123456789012345LL, 123456789012345ULL, 1.25f, 3.14159 ); } chibicc-1.0.24/test/variadic5.c000066400000000000000000000006171517770275000161730ustar00rootroot00000000000000#include #include #include "test.h" typedef struct { char _Alignas(1024) pad; } BigAlign; void test(int count, ...) { va_list ap; va_start(ap, count); for (int i = 0; i < count; i++) printf("arg[%d] = %p\n", i, va_arg(ap, void *)); va_end(ap); } int main() { BigAlign a, b; test(2, &a, &b); // If va_area isn't big enough or not aligned, crash likely } chibicc-1.0.24/test/variadic6.c000066400000000000000000000011531517770275000161700ustar00rootroot00000000000000#include #include #include "test.h" typedef struct S { char data[32]; } S; void print7(int count, ...) { va_list ap; va_start(ap, count); for (int i = 0; i < count; i++) { S s = va_arg(ap, S); printf("%d ", s.data[0]); ASSERT(i + 1, s.data[0]); } va_end(ap); printf("\n"); } int main() { S s1 = {.data = {1}}; S s2 = {.data = {2}}; S s3 = {.data = {3}}; S s4 = {.data = {4}}; S s5 = {.data = {5}}; S s6 = {.data = {6}}; S s7 = {.data = {7}}; print7(7, s1, s2, s3, s4, s5, s6, s7); return 0; } chibicc-1.0.24/test/variadic6b.c000066400000000000000000000025531517770275000163370ustar00rootroot00000000000000#include #include "test.h" typedef struct { int x; int y; } Point; int sum_point_array(int count, ...) { va_list ap; va_start(ap, count); Point *arr = va_arg(ap, Point *); va_end(ap); int sum = 0; for (int i = 0; i < count; i++) sum += arr[i].x + arr[i].y; return sum; } int sum_array(int count, ...) { va_list ap; va_start(ap, count); int *arr = va_arg(ap, int *); va_end(ap); int sum = 0; for (int i = 0; i < count; i++) sum += arr[i]; return sum; } int sum_float_array(int count, ...) { va_list ap; va_start(ap, count); float *arr = va_arg(ap, float *); va_end(ap); float sum = 0; for (int i = 0; i < count; i++) sum += arr[i]; return (int)sum; } int mix_array_scalar(int count, ...) { va_list ap; va_start(ap, count); int *arr = va_arg(ap, int *); int extra = va_arg(ap, int); va_end(ap); int sum = extra; for (int i = 0; i < count; i++) sum += arr[i]; return sum; } int main() { ASSERT(10, ({ int a[] = {1,2,3,4}; sum_array(4, a); })); ASSERT(6, ({ float a[] = {1.5, 2.5, 2.0}; sum_float_array(3, a); })); ASSERT(20, ({ int a[] = {3,4,5,6}; mix_array_scalar(4, a, 2); // 2 + 3+4+5+6 = 20 })); ASSERT(21, ({ Point pts[] = {{1,2},{3,4},{5,6}}; sum_point_array(3, pts); })); return 0; } chibicc-1.0.24/test/variadic6c.c000066400000000000000000000012151517770275000163320ustar00rootroot00000000000000#include #include #include "test.h" typedef struct S { char data[32] __attribute__((aligned(32))); } S; void print7(int count, ...) { va_list ap; va_start(ap, count); for (int i = 0; i < count; i++) { S s = va_arg(ap, S); printf("%d ", s.data[0]); ASSERT(i + 1, s.data[0]); } va_end(ap); printf("\n"); } int main() { S s1 = {.data = {1}}; S s2 = {.data = {2}}; S s3 = {.data = {3}}; S s4 = {.data = {4}}; S s5 = {.data = {5}}; S s6 = {.data = {6}}; S s7 = {.data = {7}}; print7(7, s1, s2, s3, s4, s5, s6, s7); return 0; } chibicc-1.0.24/test/variadic6d.c000066400000000000000000000012201517770275000163270ustar00rootroot00000000000000#include #include #include "test.h" typedef struct S { _Alignas(32) char data[32]; } S; void print7(int count, ...) { va_list ap; va_start(ap, count); for (int i = 0; i < count; i++) { S s = va_arg(ap, S); printf("%d ", s.data[0]); ASSERT(i + 1, s.data[0]); } va_end(ap); printf("\n"); } int main() { S s1 = {.data = {1}}; S s2 = {.data = {2}}; S s3 = {.data = {3}}; S s4 = {.data = {4}}; S s5 = {.data = {5}}; S s6 = {.data = {6}}; S s7 = {.data = {7}}; S s8 = {.data = {8}}; print7(8, s1, s2, s3, s4, s5, s6, s7, s8); return 0; } chibicc-1.0.24/test/variadic6e.c000066400000000000000000000022501517770275000163340ustar00rootroot00000000000000#include #include #include "test.h" typedef struct S { _Alignas(32) char data[32]; } S; void print7(int count, ...) { va_list ap; va_start(ap, count); int a = va_arg(ap, int); printf("a=%d\n", a); ASSERT(17, a); int b = va_arg(ap, int); printf("b=%d\n", b); ASSERT(23, b); int c = va_arg(ap, int); printf("c=%d\n", b); ASSERT(19, c); double f = va_arg(ap, double); printf("f=%lf\n", f); ASSERT(10, f); long double ld = va_arg(ap, long double); printf("ld=%Ld\n", ld); ASSERT(25, ld); for (int i = 0; i < count - 5 ; i++) { S s = va_arg(ap, S); printf("%d ", s.data[0]); ASSERT(i + 1, s.data[0]); } va_end(ap); printf("\n"); } int main() { S s1 = {.data = {1}}; S s2 = {.data = {2}}; S s3 = {.data = {3}}; S s4 = {.data = {4}}; S s5 = {.data = {5}}; S s6 = {.data = {6}}; S s7 = {.data = {7}}; S s8 = {.data = {8}}; int a = 17; int b = 23; int c = 19; float f = 10.50; long double ld = 25.50L; print7(13, a, b, c, f, ld, s1, s2, s3, s4, s5, s6, s7, s8); return 0; } chibicc-1.0.24/test/variadic6f.c000066400000000000000000000012151517770275000163350ustar00rootroot00000000000000#include #include #include "test.h" typedef struct S { __attribute__((aligned(32))) char data[32] ; } S; void print7(int count, ...) { va_list ap; va_start(ap, count); for (int i = 0; i < count; i++) { S s = va_arg(ap, S); printf("%d ", s.data[0]); ASSERT(i + 1, s.data[0]); } va_end(ap); printf("\n"); } int main() { S s1 = {.data = {1}}; S s2 = {.data = {2}}; S s3 = {.data = {3}}; S s4 = {.data = {4}}; S s5 = {.data = {5}}; S s6 = {.data = {6}}; S s7 = {.data = {7}}; print7(7, s1, s2, s3, s4, s5, s6, s7); return 0; } chibicc-1.0.24/test/variadic_struct.c000066400000000000000000000026401517770275000175100ustar00rootroot00000000000000#include #include "test.h" typedef struct { int x; int y; } Point; typedef struct { int i; double d; } Mixed; typedef union { int i; float f; } IntOrFloat; typedef struct { long a; long b; } Pair; typedef struct { int a, b, c, d, e; } BigStruct; int test_big_struct(int count, ...) { va_list ap; va_start(ap, count); BigStruct bs = va_arg(ap, BigStruct); va_end(ap); return bs.a + bs.b + bs.c + bs.d + bs.e; } long test_multi(int count, ...) { va_list ap; va_start(ap, count); int x = va_arg(ap, int); Pair p = va_arg(ap, Pair); double d = va_arg(ap, double); va_end(ap); return x + p.a + p.b + (long)d; } int test_union_int(int count, ...) { va_list ap; va_start(ap, count); IntOrFloat u = va_arg(ap, IntOrFloat); va_end(ap); return u.i; } int test_mixed_struct(int count, ...) { va_list ap; va_start(ap, count); Mixed m = va_arg(ap, Mixed); va_end(ap); return m.i + (int)m.d; } int test_struct_sum(int count, ...) { va_list ap; va_start(ap, count); Point p = va_arg(ap, Point); va_end(ap); return p.x + p.y; } int main() { ASSERT(30, test_struct_sum(1, (Point){10, 20})); ASSERT(15, test_mixed_struct(1, (Mixed){5, 10.5})); ASSERT(42, test_union_int(1, (IntOrFloat){42})); ASSERT(1 + 2 + 3 + 4, test_multi(3, 1, (Pair){2,3}, 4.0)); ASSERT(15, test_big_struct(1, (BigStruct){1,2,3,4,5})); return 0; } chibicc-1.0.24/test/variadic_struct2.c000066400000000000000000000110521517770275000175670ustar00rootroot00000000000000#include #include #include "test.h" typedef struct { int a; // 4 bytes } SmallStruct; typedef struct { int a; // 4 bytes double b; // 8 bytes } MediumStruct; typedef struct { double a; // 8 bytes double b; // 8 bytes double c; // 8 bytes } LargeStruct; void print_large(int n, ...) { va_list ap; va_start(ap, n); for (int i = 0; i < n; i++) { LargeStruct s = va_arg(ap, LargeStruct); printf("LargeStruct %d: a = %f, b = %f, c = %f\n", i, s.a, s.b, s.c); if (i == 0) { ASSERT(1, s.a); ASSERT(1, s.b); ASSERT(1, s.c); } } va_end(ap); } void print_medium(int n, ...) { va_list ap; va_start(ap, n); for (int i = 0; i < n; i++) { MediumStruct s = va_arg(ap, MediumStruct); printf("MediumStruct %d: a = %d, b = %f\n", i, s.a, s.b); if (i == 0) { ASSERT(1, s.a); ASSERT(1, s.b); } } va_end(ap); } void print_small(int n, ...) { va_list ap; va_start(ap, n); for (int i = 0; i < n; i++) { SmallStruct s = va_arg(ap, SmallStruct); printf("SmallStruct %d: a = %d\n", i, s.a); if (i == 0) { ASSERT(1, s.a); } } va_end(ap); } void print_small_ptr(int n, ...) { va_list ap; va_start(ap, n); for (int i = 0; i < n; i++) { SmallStruct *s = va_arg(ap, SmallStruct *); printf("SmallStruct %d: a = %d\n", i, s->a); if (i == 0) { ASSERT(1, s->a); } } va_end(ap); } void print_medium_ptr(int n, ...) { va_list ap; va_start(ap, n); for (int i = 0; i < n; i++) { MediumStruct *s = va_arg(ap, MediumStruct *); printf("MediumStruct %d: a = %d, b = %f\n", i, s->a, s->b); if (i == 0) { ASSERT(1, s->a); ASSERT(1, s->b); } } va_end(ap); } void print_large_ptr(int n, ...) { va_list ap; va_start(ap, n); for (int i = 0; i < n; i++) { LargeStruct *s = va_arg(ap, LargeStruct *); printf("LargeStruct %d: a = %f, b = %f, c = %f\n", i, s->a, s->b, s->c); if (i == 0) { ASSERT(1, s->a); ASSERT(1, s->b); ASSERT(1, s->c); } else if (i == 1) { ASSERT(2, s->a); ASSERT(2, s->b); ASSERT(2, s->c); } else if (i == 2) { ASSERT(3, s->a); ASSERT(3, s->b); ASSERT(3, s->c); } } va_end(ap); } void test_mixed1(int n, ...) { va_list ap; va_start(ap, n); for (int i = 0; i < n; i++) { int x = va_arg(ap, int); double y = va_arg(ap, double); SmallStruct s = va_arg(ap, SmallStruct); if (i == 0) { ASSERT(1, x); ASSERT(1, y); ASSERT(1, s.a); } printf("int: %d, double: %f, SmallStruct.a: %d\n", x, y, s.a); } va_end(ap); } void test_mixed2(int n, ...) { va_list ap; va_start(ap, n); for (int i = 0; i < n; i++) { char *str = va_arg(ap, char *); MediumStruct s = va_arg(ap, MediumStruct); MediumStruct *ps = va_arg(ap, MediumStruct *); printf("str: %s, MediumStruct.a: %d, b: %f, Pointer MediumStruct.a: %d, b: %f\n", str, s.a, s.b, ps->a, ps->b); if (i == 0) { ASSERT(2, ps->a); ASSERT(2, ps->b); ASSERT(1, s.a); ASSERT(1, s.b); } } va_end(ap); } void test_mixed3(int n, ...) { va_list ap; va_start(ap, n); for (int i = 0; i < n; i++) { int x = va_arg(ap, int); LargeStruct *p = va_arg(ap, LargeStruct *); double y = va_arg(ap, double); printf("int: %d, LargeStruct.a: %f, b: %f, c: %f, double: %f\n", x, p->a, p->b, p->c, y); } va_end(ap); } int main() { SmallStruct s1 = {1}, s2 = {2}, s3 = {3}; print_small(3, s1, s2, s3); print_small_ptr(3, &s1, &s2, &s3); test_mixed1(2, 1, 1.1, s1, 2, 2.2, s2); MediumStruct s1 = {1, 1.1}, s2 = {2, 2.2}, s3 = {3, 3.3}; print_medium(3, s1, s2, s3); print_medium_ptr(3, &s1, &s2, &s3); test_mixed2(1, "hello", s1, &s2); LargeStruct s1 = {1.1, 1.2, 1.3}; LargeStruct s2 = {2.1, 2.2, 2.3}; LargeStruct s3 = {3.1, 3.2, 3.3}; print_large(3, s1, s2, s3); print_large_ptr(3, &s1, &s2, &s3); LargeStruct ls = {1.1, 2.2, 3.3}; test_mixed3(1, 42, &ls, 4.4); return 0; } chibicc-1.0.24/test/varscope.c000077500000000000000000000003651517770275000161510ustar00rootroot00000000000000#include "test.h" void Increment(int a) { a = a + 1; printf("Address of a inside the function %d\n", &a ); } int main(int argc, char **argv) { int a = 10; Increment(a); printf("Address of a inside the function %d\n", &a ); return 0; }chibicc-1.0.24/test/vec_mul_ushort256.c000066400000000000000000000006371517770275000176210ustar00rootroot00000000000000#include "test.h" #include #include int main() { __v16hu a = (__v16hu){1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; __v16hu b = (__v16hu){2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}; __v16hu c = a * b; uint16_t out[16]; memcpy(out, &c, sizeof(out)); for (int i = 0; i < 16; i++) ASSERT((i + 1) * (i + 2), out[i]); printf("OK\n"); return 0; } chibicc-1.0.24/test/vector1.c000066400000000000000000000016731517770275000157120ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); float4 a = {1.0, 2.0, 3.0, 4.0}; float4 b = {10.0, 20.0, 30.0, 40.0}; float4 c; typedef int myint; int main() { float4 vec = {1.0, 2.0, 3.0, 4.0}; printf("vec[0]=%f\n", vec[0]); printf("vec[1]=%f\n", vec[1]); printf("vec[2]=%f\n", vec[2]); printf("vec[3]=%f\n", vec[3]); ASSERT(1, vec[0]); ASSERT(2, vec[1]); ASSERT(3, vec[2]); ASSERT(4, vec[3]); c = a + b; printf("after %f %f %f %f\n", c[0], c[1], c[2], c[3]); ASSERT(11, c[0]); ASSERT(22, c[1]); ASSERT(33, c[2]); ASSERT(44, c[3]); myint x = 42; printf("x = %d\n", x); ASSERT(42, x); int a[4] = {1, 2, 3, 4}; int b[4] = {10, 20, 30, 40}; int c[4]; for (int i = 0; i < 4; i++) c[i] = a[i] + b[i]; for (int i = 0; i < 4; i++) printf("c[%d] = %d\n", i, c[i]); return 0; }chibicc-1.0.24/test/vector2.c000066400000000000000000000011451517770275000157050ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); int main() { float4 a = {1.0f, 2.0f, 3.0f, 4.0f}; float4 b = {10.0f, 20.0f, 30.0f, 40.0f}; float4 c; c = a + b; for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, c[i]); } ASSERT(11, c[0]); ASSERT(22, c[1]); ASSERT(33, c[2]); ASSERT(44, c[3]); // test 1: expression float4 a, b, c; a = (float4){1, 2, 3, 4}; b = (float4){10, 20, 30, 40}; c = a + b; // test 2: brace init float4 d = {100, 200, 300, 400}; return 0; } chibicc-1.0.24/test/vector_basic.c000066400000000000000000000027041517770275000167660ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); float4 make_vec() { return (float4){1.0f, 2.0f, 3.0f, 4.0f}; // compound literal for vector } float make_float() { return (float){1.0f}; // compound literal for vector } int main() { float4 v = make_vec(); float4 z; float4 a = {1.0f, 11.0f, 111.0f, 1111.0f }; float4 b = {2.0f, 22.0f, 222.0f, 2222.0f}; float4 d = {1.1f, 2.2f, 3.3f, 4.4f}; float f= 12.0f; float g = 7.0f; float h = make_float(); float i; i = f + g + h; float4 c; c = a + b + d ; float4 j = a + b + d; z = make_vec(); printf("v=%f %f %f %f\n", v[0], v[1], v[2], v[3]); ASSERT(1, v[0]); ASSERT(2, v[1]); ASSERT(3, v[2]); ASSERT(4, v[3]); printf("c= %f %f %f %f\n", c[0], c[1], c[2], c[3]); ASSERT(4, c[0]); ASSERT(35, c[1]); ASSERT(336, c[2]); ASSERT(3337, c[3]); printf("i=%f\n", i); ASSERT(20, i); printf("z=%f %f %f %f\n", z[0], z[1], z[2], z[3]); ASSERT(1, z[0]); ASSERT(2, z[1]); ASSERT(3, z[2]); ASSERT(4, z[3]); printf("a=%f %f %f %f\n", a[0], a[1], a[2], a[3]); ASSERT(1, a[0]); ASSERT(11, a[1]); ASSERT(111, a[2]); ASSERT(1111, a[3]); printf("j=%f %f %f %f\n", j[0], j[1], j[2], j[3]); ASSERT(4, j[0]); ASSERT(35, j[1]); ASSERT(336, j[2]); ASSERT(3337, j[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/vector_bitwise.c000066400000000000000000000026351517770275000173560ustar00rootroot00000000000000#include "test.h" #include typedef int int4 __attribute__((vector_size(16))); // 4×32-bit integers int main(void) { int4 a = {0x0f0f0f0f, 0x00ff00ff, 0x12345678, 0xffffffff}; int4 b = {0x00ff00ff, 0x0f0f0f0f, 0x87654321, 0x00000000}; // Bitwise AND int4 and_res = a & b; printf("AND: 0x%x 0x%x 0x%x 0x%x\n", and_res[0], and_res[1], and_res[2], and_res[3]); ASSERT(0xf000f, and_res[0]); ASSERT(0xf000f, and_res[1]); ASSERT(0x2244220, and_res[2]); ASSERT(0x0, and_res[3]); // Bitwise OR int4 or_res = a | b; printf("OR: 0x%x 0x%x 0x%x 0x%x\n", or_res[0], or_res[1], or_res[2], or_res[3]); ASSERT(0xfff0fff, or_res[0]); ASSERT(0xfff0fff, or_res[1]); ASSERT(0x97755779, or_res[2]); ASSERT(0xffffffff, or_res[3]); // Bitwise XOR int4 xor_res = a ^ b; printf("XOR: 0x%x 0x%x 0x%x 0x%x\n", xor_res[0], xor_res[1], xor_res[2], xor_res[3]); ASSERT(0xff00ff0, xor_res[0]); ASSERT(0xff00ff0, xor_res[1]); ASSERT( 0x95511559, xor_res[2]); ASSERT(0xffffffff, xor_res[3]); // Bitwise NOT int4 not_a = ~a; printf("NOT a: 0x%x 0x%x 0x%x 0x%x\n", not_a[0], not_a[1], not_a[2], not_a[3]); ASSERT(0xf0f0f0f0, not_a[0]); ASSERT(0xff00ff00, not_a[1]); ASSERT(0xedcba987, not_a[2]); ASSERT(0x00000000, not_a[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/vector_complit.c000066400000000000000000000116361517770275000173600ustar00rootroot00000000000000// test_vectors_compound.c #include "test.h" typedef float float4 __attribute__((vector_size(16))); typedef double double2 __attribute__((vector_size(16))); typedef int int4 __attribute__((vector_size(16))); int main(void) { // ---- FLOAT ---- float4 a = {1.0, 2.0, 3.0, 4.0}; float4 b = (float4){5.0, 6.0, 7.0, 8.0}; float4 r1 = a + (float4){10.0, 10.0, 10.0, 10.0}; float4 r2 = (float4){1.0, 1.0, 1.0, 1.0} + b; float4 r3 = a - (float4){1.0, 1.0, 1.0, 1.0}; float4 r4 = (float4){2.0, 2.0, 2.0, 2.0} * b; float4 r5 = b / (float4){2.0, 2.0, 2.0, 2.0}; float4 r6 = -(float4){1.0, 2.0, 3.0, 4.0}; float4 r7 = -b; printf("float4 results:\n"); for (int i = 0; i < 4; i++) printf("r1[%d]=%f ", i, r1[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("r2[%d]=%f ", i, r2[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("r3[%d]=%f ", i, r3[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("r4[%d]=%f ", i, r4[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("r5[%d]=%f ", i, r5[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("r6[%d]=%f ", i, r6[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("r7[%d]=%f ", i, r7[i]); printf("\n"); ASSERT(11, r1[0]); ASSERT(12, r1[1]); ASSERT(13, r1[2]); ASSERT(14, r1[3]); ASSERT(6, r2[0]); ASSERT(7, r2[1]); ASSERT(8, r2[2]); ASSERT(9, r2[3]); ASSERT(0, r3[0]); ASSERT(1, r3[1]); ASSERT(2, r3[2]); ASSERT(3, r3[3]); ASSERT(10, r4[0]); ASSERT(12, r4[1]); ASSERT(14, r4[2]); ASSERT(16, r4[3]); ASSERT(2, r5[0]); ASSERT(3, r5[1]); ASSERT(3, r5[2]); ASSERT(4, r5[3]); ASSERT(-1, r6[0]); ASSERT(-2, r6[1]); ASSERT(-3, r6[2]); ASSERT(-4, r6[3]); ASSERT(-5, r7[0]); ASSERT(-6, r7[1]); ASSERT(-7, r7[2]); ASSERT(-8, r7[3]); // ---- DOUBLE ---- double2 d1 = {1.0, 2.0}; double2 d2 = (double2){3.0, 4.0}; double2 dr1 = d1 + (double2){10.0, 20.0}; double2 dr2 = (double2){2.0, 2.0} * d2; double2 dr3 = -(double2){5.0, 6.0}; printf("\ndouble2 results:\n"); for (int i = 0; i < 2; i++) printf("dr1[%d]=%lf ", i, dr1[i]); printf("\n"); for (int i = 0; i < 2; i++) printf("dr2[%d]=%lf ", i, dr2[i]); printf("\n"); for (int i = 0; i < 2; i++) printf("dr3[%d]=%lf ", i, dr3[i]); printf("\n"); ASSERT(11, dr1[0]); ASSERT(22, dr1[1]); ASSERT(6, dr2[0]); ASSERT(8, dr2[1]); ASSERT(-5, dr3[0]); ASSERT(-6, dr3[1]); // ---- INT ---- int4 i1 = {1, 2, 3, 4}; int4 i2 = (int4){5, 6, 7, 8}; int4 ir1 = i1 + (int4){10, 10, 10, 10}; int4 ir2 = (int4){1, 1, 1, 1} + i2; int4 ir3 = i2 - (int4){1, 2, 3, 4}; int4 ir4 = i1 * (int4){2, 2, 2, 2}; int4 ir5 = -(int4){1, 2, 3, 4}; int4 ir6 = i1 ^ (int4){1, 0, 1, 0}; int4 ir7 = i2 & (int4){0xffffffff, 0, 0xffffffff, 0}; int4 ir8 = i1 | (int4){0, 0, 0, 0xffffffff}; printf("\nint4 results:\n"); for (int i = 0; i < 4; i++) printf("ir1[%d]=%d ", i, ir1[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("ir2[%d]=%d ", i, ir2[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("ir3[%d]=%d ", i, ir3[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("ir4[%d]=%d ", i, ir4[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("ir5[%d]=%d ", i, ir5[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("ir6[%d]=%d ", i, ir6[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("ir7[%d]=%d ", i, ir7[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("ir8[%d]=%d ", i, ir8[i]); printf("\n"); ASSERT(11, ir1[0]); ASSERT(12, ir1[1]); ASSERT(13, ir1[2]); ASSERT(14, ir1[3]); ASSERT(6, ir2[0]); ASSERT(7, ir2[1]); ASSERT(8, ir2[2]); ASSERT(9, ir2[3]); ASSERT(4, ir3[0]); ASSERT(4, ir3[1]); ASSERT(4, ir3[2]); ASSERT(4, ir3[3]); ASSERT(2, ir4[0]); ASSERT(4, ir4[1]); ASSERT(6, ir4[2]); ASSERT(8, ir4[3]); ASSERT(-1, ir5[0]); ASSERT(-2, ir5[1]); ASSERT(-3, ir5[2]); ASSERT(-4, ir5[3]); ASSERT(0, ir6[0]); ASSERT(2, ir6[1]); ASSERT(2, ir6[2]); ASSERT(4, ir6[3]); ASSERT(5, ir7[0]); ASSERT(0, ir7[1]); ASSERT(7, ir7[2]); ASSERT(0, ir7[3]); ASSERT(1, ir8[0]); ASSERT(2, ir8[1]); ASSERT(3, ir8[2]); ASSERT(-1, ir8[3]); // ---- INT (extra tests) ---- int4 ir9 = ~(int4){0, -1, 0xffffffff, 1234}; // bitnot int4 ir10 = (int4){1, 2, 3, 4} + (int4){10, 20, 30, 40}; // compound + compound printf("\nint4 extra results:\n"); for (int i = 0; i < 4; i++) printf("ir9[%d]=%d ", i, ir9[i]); printf("\n"); for (int i = 0; i < 4; i++) printf("ir10[%d]=%d ", i, ir10[i]); printf("\n"); ASSERT(-1, ir9[0]); // ~0 ASSERT(0, ir9[1]); // ~(-1) == 0 ASSERT(0, ir9[2]); // ~0xffffffff == 0 ASSERT(-1235, ir9[3]); // ~(1234) == -1235 ASSERT(11, ir10[0]); ASSERT(22, ir10[1]); ASSERT(33, ir10[2]); ASSERT(44, ir10[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/vector_div.c000066400000000000000000000013571517770275000164720ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); float4 div_vectors(float4 a, float4 b) { return a / b; } int main() { float4 a = {10.0f, 20.0f, 30.0f, 40.0f}; float4 b = {2.0f, 4.0f, 5.0f, 8.0f}; float4 c; c = div_vectors(a, b); float4 d = {5.0f, 5.0f, 5.0f, 5.0f}; float4 e = div_vectors(a, d); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, c[i]); } ASSERT(5, (int)c[0]); ASSERT(5, (int)c[1]); ASSERT(6, (int)c[2]); ASSERT(5, (int)c[3]); for (int i = 0; i < 4; i++) { printf("e[%d] = %f\n", i, e[i]); } ASSERT(2, e[0]); ASSERT(4, e[1]); ASSERT(6, e[2]); ASSERT(8, e[3]); return 0; } chibicc-1.0.24/test/vector_double.c000066400000000000000000000007631517770275000171620ustar00rootroot00000000000000#include "test.h" typedef double double2 __attribute__((vector_size(16))); double2 add_double2(double2 a, double2 b) { return a + b; } int main() { double2 a = {1.1, 2.2}; double2 b = {3.3, 4.4}; double2 c ; c = add_double2(a, b); double2 d = add_double2(a, c); printf("c = %f %f\n", c[0], c[1]); ASSERT(4, (int)c[0]); ASSERT(6, (int)c[1]); printf("d = %f %f\n", d[0], d[1]); ASSERT(5, d[0]); ASSERT(8, d[1]); return 0; } chibicc-1.0.24/test/vector_filled.c000066400000000000000000000027531517770275000171500ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); float4 add_some(float4 a, float4 b, float4 c, float4 d, float4 e) { return a + b + c + d + e ; } float4 add_all2(float4 a, float4 b, float4 c, float4 d, float4 e, float4 f, float4 g, float4 h) { return a + b + c + d + e + f + g + h; //return a + b + c; } int main() { float4 a = {1, 2, 3, 4}; float4 b = {10, 20, 30, 40}; float4 c = {5, 6, 7, 8}; float4 d = {9, 10, 11, 12}; float4 e = {13, 14, 14, 16}; float4 v = add_some(a, b, c, d, e); float4 g = a + b + c + d + e; printf("v = %f %f %f %f\n", v[0], v[1], v[2], v[3]); printf("g = %f %f %f %f\n", g[0], g[1], g[2], g[3]); v = add_some( (float4){1,2,3,4}, (float4){10,20,30,40}, (float4){5,6,7,8}, (float4){9,10,11,12}, (float4){13,14,15,16} ); printf("v = %f %f %f %f\n", v[0], v[1], v[2], v[3]); ASSERT(38, (int)v[0]); ASSERT(52, (int)v[1]); ASSERT(66, (int)v[2]); ASSERT(80, (int)v[3]); v = add_all2( (float4){1,2,3,4}, (float4){10,20,30,40}, (float4){5,6,7,8}, (float4){9,10,11,12}, (float4){13,14,15,16}, (float4){17,18,19,20}, (float4){21,22,23,24}, (float4){25,26,27,28} ); printf("v = %f %f %f %f\n", v[0], v[1], v[2], v[3]); ASSERT(101, (int)v[0]); ASSERT(118, (int)v[1]); ASSERT(135, (int)v[2]); ASSERT(152, (int)v[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/vector_init.c000066400000000000000000000010101517770275000166350ustar00rootroot00000000000000#include "test.h" #define SCALAR 500 typedef int int4 __attribute__((vector_size(16))); int main() { // This will trigger Chibicc error: int4 v = SCALAR; // vector initializer must be an initializer list // Workaround: use braces int4 v2 = {SCALAR}; // Print v2 to verify for (int i = 0; i < 4; i++) { printf("%d ", v2[i]); } printf("\n"); ASSERT(500, v2[0]); ASSERT(0, v2[1]); ASSERT(0, v2[2]); ASSERT(0, v2[3]); return 0; } chibicc-1.0.24/test/vector_int.c000066400000000000000000000011201517770275000164660ustar00rootroot00000000000000#include "test.h" typedef int int4 __attribute__((vector_size(16))); int4 add_int4(int4 a, int4 b) { return a + b; } int main() { int4 a = {1, 2, 3, 4}; int4 b = {10, 20, 30, 40}; int4 c; c = add_int4(a, b); int4 d = add_int4(a, c); printf("c = %d %d %d %d\n", c[0], c[1], c[2], c[3]); ASSERT(11, c[0]); ASSERT(22, c[1]); ASSERT(33, c[2]); ASSERT(44, c[3]); printf("d = %d %d %d %d\n", d[0], d[1], d[2], d[3]); ASSERT(12, d[0]); ASSERT(24, d[1]); ASSERT(36, d[2]); ASSERT(48, d[3]); return 0; } chibicc-1.0.24/test/vector_long.c000066400000000000000000000004301517770275000166360ustar00rootroot00000000000000#include "test.h" typedef long long4 __attribute__((vector_size(16))); int main() { long4 lv = {1, 2}; long4 res; res = lv + 1; // scalar promotion printf("%ld %ld\n", res[0], res[1]); ASSERT(2, res[0]); ASSERT(3, res[1]); return 0; } chibicc-1.0.24/test/vector_m128.c000066400000000000000000000005271517770275000163750ustar00rootroot00000000000000#include #include "test.h" int main() { __m128 a = _mm_set_ps(4, 3, 2, 1); __m128 b = _mm_add_ps(a, a); float *f = (float *)&b; printf("%f %f %f %f\n", f[0], f[1], f[2], f[3]); ASSERT(2, f[0]); ASSERT(4, f[1]); ASSERT(6, f[2]); ASSERT(8, f[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/vector_mixed.c000066400000000000000000000007061517770275000170130ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); float4 mix_params(float a, float4 v, float b) { return (float4){a, b, a, b} + v; } int main() { float4 res = mix_params(1.0f, (float4){2,4,6,8}, 3.0f); for (int i = 0; i < 4; i++) printf("res[%d] = %f\n", i, res[i]); ASSERT(3, (int)res[0]); ASSERT(7, (int)res[1]); ASSERT(7, (int)res[2]); ASSERT(11, (int)res[3]); } chibicc-1.0.24/test/vector_mixed2.c000066400000000000000000000027161517770275000171000ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); float4 mix_params(float a, float4 v, float b) { return v + (float4){a, b, a, b}; } float4 sub_mix_params(float a, float4 v, float b) { return (float4){a, b, a, b} - v; } float4 sub_mix_params2(float a, float4 v, float b) { return v - (float4){a, b, a, b} ; } int main() { float4 res = mix_params(1.0f, (float4){2,4,6,8}, 3.0f); for (int i = 0; i < 4; i++) printf("res[%d] = %f\n", i, res[i]); ASSERT(3, (int)res[0]); ASSERT(7, (int)res[1]); ASSERT(7, (int)res[2]); ASSERT(11, (int)res[3]); res = sub_mix_params(1.0f, (float4){2,4,6,8}, 3.0f); for (int i = 0; i < 4; i++) printf("res[%d] = %f\n", i, res[i]); ASSERT(-1, (int)res[0]); ASSERT(-1, (int)res[1]); ASSERT(-5, (int)res[2]); ASSERT(-5, (int)res[3]); res = sub_mix_params2(1.0f, (float4){2,4,6,8}, 3.0f); for (int i = 0; i < 4; i++) printf("res[%d] = %f\n", i, res[i]); ASSERT(1, (int)res[0]); ASSERT(1, (int)res[1]); ASSERT(5, (int)res[2]); ASSERT(5, (int)res[3]); float4 x = {1.0, -2.0, 3.0, -4.0}; float4 r = -x; // negate the vector printf("%f %f %f %f\n", r[0], r[1], r[2], r[3]); ASSERT(-1, (int)r[0]); ASSERT(2, (int)r[1]); ASSERT(-3, (int)r[2]); ASSERT(4, (int)r[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/vector_mult.c000066400000000000000000000013201517770275000166570ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); float4 mul_vectors(float4 a, float4 b) { return a * b; } int main() { float4 a = {1.0f, 2.0f, 3.0f, 4.0f}; float4 b = {10.0f, 20.0f, 30.0f, 40.0f}; float4 c; c = mul_vectors(a, b); float4 d = mul_vectors(a, c); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, c[i]); } ASSERT(10, (int)c[0]); ASSERT(40, (int)c[1]); ASSERT(90, (int)c[2]); ASSERT(160, (int)c[3]); for (int i = 0; i < 4; i++) { printf("d[%d] = %f\n", i, d[i]); } ASSERT(10, d[0]); ASSERT(80, d[1]); ASSERT(270, d[2]); ASSERT(640, d[3]); return 0; } chibicc-1.0.24/test/vector_mult2.c000066400000000000000000000012471517770275000167510ustar00rootroot00000000000000#include "test.h" typedef int int4 __attribute__((vector_size(16))); int4 mul_int_vectors(int4 a, int4 b) { return a * b; } int main() { int4 a = {1, 2, 3, 4}; int4 b = {10, 20, 30, 40}; int4 c ; c = mul_int_vectors(a, b); int4 d = mul_int_vectors(a, c); for (int i = 0; i < 4; i++) { printf("c[%d] = %d\n", i, c[i]); } ASSERT(10, c[0]); ASSERT(40, c[1]); ASSERT(90, c[2]); ASSERT(160, c[3]); for (int i = 0; i < 4; i++) { printf("d[%d] = %d\n", i, d[i]); } ASSERT(10, d[0]); ASSERT(80, d[1]); ASSERT(270, d[2]); ASSERT(640, d[3]); return 0; } chibicc-1.0.24/test/vector_param.c000066400000000000000000000016511517770275000170050ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); void print_vector(float4 v) { for (int i = 0; i < 4; i++) { printf("v[%d] = %f\n", i, v[i]); } ASSERT(11, v[0]); ASSERT(22, v[1]); ASSERT(33, v[2]); ASSERT(44, v[3]); } float4 add_vectors(float4 a, float4 b) { return a + b; } int main() { float4 a = {1.0f, 2.0f, 3.0f, 4.0f}; float4 b = {10.0f, 20.0f, 30.0f, 40.0f}; float4 c; c = add_vectors(a, b); for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, c[i]); } ASSERT(11, c[0]); ASSERT(22, c[1]); ASSERT(33, c[2]); ASSERT(44, c[3]); print_vector(c); float4 d = add_vectors(a, c); for (int i = 0; i < 4; i++) { printf("d[%d] = %f\n", i, d[i]); } ASSERT(12, d[0]); ASSERT(24, d[1]); ASSERT(36, d[2]); ASSERT(48, d[3]); return 0; } chibicc-1.0.24/test/vector_pointer.c000066400000000000000000000007531517770275000173670ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); void add_vectors_ptr(const float4 *a, const float4 *b, float4 *res) { *res = *a + *b; } int main() { float4 a = {1, 2, 3, 4}; float4 b = {10, 20, 30, 40}; float4 c; add_vectors_ptr(&a, &b, &c); printf("c = %f %f %f %f\n", c[0], c[1], c[2], c[3]); ASSERT(11, (int)c[0]); ASSERT(22, (int)c[1]); ASSERT(33, (int)c[2]); ASSERT(44, (int)c[3]); return 0; } chibicc-1.0.24/test/vector_promotion.c000066400000000000000000000034551517770275000177370ustar00rootroot00000000000000#include "test.h" #include typedef int int4 __attribute__((vector_size(16))); // 4×int typedef float float4 __attribute__((vector_size(16))); // 4×float typedef double double2 __attribute__((vector_size(16))); // 2×double int main(void) { // int vector + scalar int4 vi = {1, 2, 3, 4}; int4 res_i = vi + 5; // scalar 5 promoted to {5,5,5,5} for (int i =0; i < 4 ; i++) printf("res[%d]=%d ", i, res_i[i]); printf("\n"); ASSERT(6, res_i[0]); ASSERT(7, res_i[1]); ASSERT(8, res_i[2]); ASSERT(9, res_i[3]); // chained: scalar + vector int4 res_i2 = 10 + vi; // scalar promoted to {10,10,10,10} ASSERT(11, res_i2[0]); ASSERT(12, res_i2[1]); ASSERT(13, res_i2[2]); ASSERT(14, res_i2[3]); for (int i =0; i < 4 ; i++) printf("res[%d]=%d ", i, res_i2[i]); printf("\n"); // float vector + scalar float4 vf = {1.0f, 2.0f, 3.0f, 4.0f}; float4 res_f = vf + 1.5f; // scalar promoted to {1.5,1.5,1.5,1.5} for (int i =0; i < 4 ; i++) printf("res[%d]=%f ", i, res_f[i]); printf("\n"); ASSERT(2.5f, res_f[0]); ASSERT(3.5f, res_f[1]); ASSERT(4.5f, res_f[2]); ASSERT(5.5f, res_f[3]); res_f = 1.5f + vf; ASSERT(2.5f, res_f[0]); ASSERT(3.5f, res_f[1]); ASSERT(4.5f, res_f[2]); ASSERT(5.5f, res_f[3]); // double vector + scalar double2 vd = {1.0, 2.0}; double2 res_d = vd + 3.0; // scalar promoted to {3.0,3.0} ASSERT(4.0, res_d[0]); ASSERT(5.0, res_d[1]); for (int i =0; i < 2 ; i++) printf("res[%d]=%f ", i, res_d[i]); printf("\n"); res_d = 3.0 + vd; ASSERT(4.0, res_d[0]); ASSERT(5.0, res_d[1]); printf("Scalar to vector promotion OK\n"); return 0; } chibicc-1.0.24/test/vector_ptr.c000066400000000000000000000012151517770275000165060ustar00rootroot00000000000000 #include "test.h" typedef float float4 __attribute__((vector_size(16))); void add_vecs(float4 *a, float4 *b, float4 *result) { for (int i = 0; i < 4; i++) { (*result)[i] = (*a)[i] + (*b)[i]; } } int main() { float4 a = {1.0, 2.0, 3.0, 4.0}; float4 b = {10.0, 20.0, 30.0, 40.0}; float4 result = {0}; add_vecs(&a, &b, &result); printf("result[0]=%f\n", result[0]); printf("result[1]=%f\n", result[1]); printf("result[2]=%f\n", result[2]); printf("result[3]=%f\n", result[3]); ASSERT(11, result[0]); ASSERT(22, result[1]); ASSERT(33, result[2]); ASSERT(44, result[3]); return 0; } chibicc-1.0.24/test/vector_scalar.c000066400000000000000000000107561517770275000171600ustar00rootroot00000000000000#include "test.h" #include typedef float float4 __attribute__((vector_size(16))); typedef double double2 __attribute__((vector_size(16))); typedef int int4 __attribute__((vector_size(16))); void print_float4(float4 v) { for (int i = 0; i < 4; i++) printf("%f ", v[i]); printf("\n"); } void print_double2(double2 v) { for (int i = 0; i < 2; i++) printf("%f ", v[i]); printf("\n"); } void print_int4(int4 v) { for (int i = 0; i < 4; i++) printf("%d ", v[i]); printf("\n"); } int main() { float4 fv = {1,2,3,4}; float4 fr; double2 dv = {1.5, 2.5}; double2 dr; int4 iv = {10,20,30,40}; int4 ir; // Float4 operations with scalar fr = fv + 2.0f; // scalar rhs print_float4(fr); ASSERT(3, fr[0]); ASSERT(4, fr[1]); ASSERT(5, fr[2]); ASSERT(6, fr[3]); fr = 3.0f + fv; // scalar lhs print_float4(fr); ASSERT(4, fr[0]); ASSERT(5, fr[1]); ASSERT(6, fr[2]); ASSERT(7, fr[3]); fr = fv - 1.0f; print_float4(fr); ASSERT(0, fr[0]); ASSERT(1, fr[1]); ASSERT(2, fr[2]); ASSERT(3, fr[3]); fr = 2.0f - fv; print_float4(fr); ASSERT(1, fr[0]); ASSERT(0, fr[1]); ASSERT(-1, fr[2]); ASSERT(-2, fr[3]); fr = fv * 2.0f; print_float4(fr); ASSERT(2, fr[0]); ASSERT(4, fr[1]); ASSERT(6, fr[2]); ASSERT(8, fr[3]); fr = 0.5f * fv; print_float4(fr); ASSERT(0, fr[0]); ASSERT(1, fr[1]); ASSERT(1, fr[2]); ASSERT(2, fr[3]); fr = fv / 2.0f; print_float4(fr); ASSERT(0, fr[0]); ASSERT(1, fr[1]); ASSERT(1, fr[2]); ASSERT(2, fr[3]); fr = 8.0f / fv; print_float4(fr); ASSERT(8, fr[0]); ASSERT(4, fr[1]); ASSERT(2, fr[2]); ASSERT(2, fr[3]); fr = -fv; print_float4(fr); ASSERT(-1, fr[0]); ASSERT(-2, fr[1]); ASSERT(-3, fr[2]); ASSERT(-4, fr[3]); // Double2 operations with scalar dr = dv + 1.0; print_double2(dr); ASSERT(2, dr[0]); ASSERT(3, dr[1]); dr = 2.0 + dv; print_double2(dr); ASSERT(3, dr[0]); ASSERT(4, dr[1]); dr = dv - 1.0; print_double2(dr); ASSERT(0, dr[0]); ASSERT(1, dr[1]); dr = 5.0 - dv; print_double2(dr); ASSERT(3, dr[0]); ASSERT(2, dr[1]); dr = dv * 2.0; print_double2(dr); ASSERT(3, dr[0]); ASSERT(5, dr[1]); dr = 0.5 * dv; print_double2(dr); ASSERT(0, dr[0]); ASSERT(1, dr[1]); dr = dv / 2.0; print_double2(dr); ASSERT(0, dr[0]); ASSERT(1, dr[1]); dr = 4.0 / dv; print_double2(dr); ASSERT(2, dr[0]); ASSERT(1, dr[1]); dr = -dv; print_double2(dr); ASSERT(-1, dr[0]); ASSERT(-2, dr[1]); // Int4 operations with scalar ir = iv + 5; print_int4(ir); ASSERT(15, ir[0]); ASSERT(25, ir[1]); ASSERT(35, ir[2]); ASSERT(45, ir[3]); ir = 10 + iv; print_int4(ir); ASSERT(20, ir[0]); ASSERT(30, ir[1]); ASSERT(40, ir[2]); ASSERT(50, ir[3]); ir = iv - 3; print_int4(ir); ASSERT(7, ir[0]); ASSERT(17, ir[1]); ASSERT(27, ir[2]); ASSERT(37, ir[3]); ir = 50 - iv; print_int4(ir); ASSERT(40, ir[0]); ASSERT(30, ir[1]); ASSERT(20, ir[2]); ASSERT(10, ir[3]); ir = iv * 2; print_int4(ir); ASSERT(20, ir[0]); ASSERT(40, ir[1]); ASSERT(60, ir[2]); ASSERT(80, ir[3]); ir = 3 * iv; print_int4(ir); ASSERT(30, ir[0]); ASSERT(60, ir[1]); ASSERT(90, ir[2]); ASSERT(120, ir[3]); ir = ~iv; print_int4(ir); ASSERT(-11, ir[0]); ASSERT(-21, ir[1]); ASSERT(-31, ir[2]); ASSERT(-41, ir[3]); ir = -iv; print_int4(ir); ASSERT(-10, ir[0]); ASSERT(-20, ir[1]); ASSERT(-30, ir[2]); ASSERT(-40, ir[3]); ir = iv & 0x0F; print_int4(ir); ASSERT(10, ir[0]); ASSERT(4, ir[1]); ASSERT(14, ir[2]); ASSERT(8, ir[3]); ir = iv | 0x0F; print_int4(ir); ASSERT(15, ir[0]); ASSERT(31, ir[1]); ASSERT(31, ir[2]); ASSERT(47, ir[3]); ir = iv ^ 0x0F; print_int4(ir); ASSERT(5, ir[0]); ASSERT(27, ir[1]); ASSERT(17, ir[2]); ASSERT(39, ir[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/vector_scalar2.c000066400000000000000000000050401517770275000172300ustar00rootroot00000000000000#include "test.h" #include typedef float float4 __attribute__((vector_size(16))); typedef double double2 __attribute__((vector_size(16))); typedef int int4 __attribute__((vector_size(16))); void print_float4(float4 v) { for (int i = 0; i < 4; i++) printf("%f ", v[i]); printf("\n"); } void print_double2(double2 v) { for (int i = 0; i < 2; i++) printf("%f ", v[i]); printf("\n"); } void print_int4(int4 v) { for (int i = 0; i < 4; i++) printf("%d ", v[i]); printf("\n"); } int main() { float4 fv1 = {1, 2, 3, 4}; float4 fv2 = {5, 6, 7, 8}; float4 fr; double2 dv1 = {1.5, 2.5}; double2 dv2 = {3.5, 4.5}; double2 dr; int4 iv1 = {10, 20, 30, 40}; int4 iv2 = {1, 2, 3, 4}; int4 ir; // Compound float4 expression fr = fv1 + 2.0f * fv2 - 1.0f; // vector + scalar*vector - scalar print_float4(fr); ASSERT(10, fr[0]); ASSERT(13, fr[1]); ASSERT(16, fr[2]); ASSERT(19, fr[3]); fr = (3.0f + fv1) * (fv2 - 1.0f); // scalar + vector multiplied by (vector - scalar) print_float4(fr); ASSERT(16, fr[0]); ASSERT(25, fr[1]); ASSERT(36, fr[2]); ASSERT(49, fr[3]); fr = -fv1 + fv2 / 2.0f; // unary negation + vector / scalar print_float4(fr); ASSERT(1, fr[0]); ASSERT(1, fr[1]); ASSERT(0, fr[2]); ASSERT(0, fr[3]); // Compound double2 expression dr = dv1 + 1.0 * dv2 - 0.5; // vector + scalar*vector - scalar print_double2(dr); ASSERT(4, dr[0]); ASSERT(6, dr[1]); dr = (2.0 + dv1) / (dv2 - 1.0); // scalar + vector divided by (vector - scalar) print_double2(dr); ASSERT(1, dr[0]); ASSERT(1, dr[1]); dr = -dv1 + dv2 * 0.5; // unary negation + vector * scalar print_double2(dr); ASSERT(0, dr[0]); ASSERT(-0, dr[1]); // Compound int4 expression ir = iv1 + 3 * iv2 - 5; // vector + scalar*vector - scalar print_int4(ir); ASSERT(8, ir[0]); ASSERT(21, ir[1]); ASSERT(34, ir[2]); ASSERT(47, ir[3]); ir = (10 + iv1) * (iv2 - 2); // scalar + vector multiplied by (vector - scalar) print_int4(ir); ASSERT(-20, ir[0]); ASSERT(0, ir[1]); ASSERT(40, ir[2]); ASSERT(100, ir[3]); ir = ~iv1 ^ iv2 + 1; // bitwise NOT, XOR, addition print_int4(ir); ASSERT(-9, ir[0]); ASSERT(-24, ir[1]); ASSERT(-27, ir[2]); ASSERT(-46, ir[3]); printf("OK\n"); return 0; } chibicc-1.0.24/test/vector_segfault.c000066400000000000000000000015031517770275000175130ustar00rootroot00000000000000#include "test.h" typedef double __m128d __attribute__ ((__vector_size__ (16))); void test_case(__m128d a, __m128d b, const char *desc) { int result = __builtin_ia32_comisdeq(a, b); printf("%-30s -> %d\n", desc, result); ASSERT(result, __builtin_ia32_comisdeq(a, b)); } int main(void) { __m128d v1 = {2.0, 1.0}; // [2.0, 1.0] __m128d v2 = {3.0, 1.0}; // [3.0, 1.0] __m128d v3 = {4.0, 2.0}; // [4.0, 2.0] __m128d vnan = {9.0, 0.0/0.0}; // NaN in low element // Only low element (index 0) is compared! test_case(v1, v2, "Equal low elements (1.0 == 1.0)"); test_case(v1, v3, "Unequal low elements (1.0 != 2.0)"); test_case(vnan, v1, "NaN vs normal"); test_case(v1, vnan, "Normal vs NaN"); test_case(vnan, vnan, "NaN vs NaN"); return 0; } chibicc-1.0.24/test/vector_sub.c000066400000000000000000000011331517770275000164710ustar00rootroot00000000000000#include "test.h" typedef float float4 __attribute__((vector_size(16))); float4 sub_vectors(float4 a, float4 b) { return a - b; } int main() { float4 a = {10.0f, 20.0f, 30.0f, 40.0f}; float4 b = {1.0f, 2.0f, 3.0f, 4.0f}; float4 c; c = a - b; for (int i = 0; i < 4; i++) { printf("c[%d] = %f\n", i, c[i]); } ASSERT(9, c[0]); ASSERT(18, c[1]); ASSERT(27, c[2]); ASSERT(36, c[3]); float4 d = sub_vectors(a, b); ASSERT(9, d[0]); ASSERT(18, d[1]); ASSERT(27, d[2]); ASSERT(36, d[3]); return 0; } chibicc-1.0.24/test/vector_sub2.c000066400000000000000000000012551517770275000165600ustar00rootroot00000000000000#include "test.h" typedef int int4 __attribute__((vector_size(16))); int4 sub_int_vectors(int4 a, int4 b) { return a - b; } int main() { int4 a = {100, 200, 300, 400}; int4 b = {10, 20, 30, 40}; int4 c; c = sub_int_vectors(a, b); for (int i = 0; i < 4; i++) { printf("c[%d] = %d\n", i, c[i]); } ASSERT(90, c[0]); ASSERT(180, c[1]); ASSERT(270, c[2]); ASSERT(360, c[3]); int4 d = sub_int_vectors(c, b); for (int i = 0; i < 4; i++) { printf("d[%d] = %d\n", i, d[i]); } ASSERT(80, d[0]); ASSERT(160, d[1]); ASSERT(240, d[2]); ASSERT(320, d[3]); return 0; } chibicc-1.0.24/test/vector_test.c000066400000000000000000000100621517770275000166600ustar00rootroot00000000000000/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ │ vi: set et ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi │ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright 2020 Justine Alexandra Roberts Tunney │ │ │ │ Permission to use, copy, modify, and/or distribute this software for │ │ any purpose with or without fee is hereby granted, provided that the │ │ above copyright notice and this permission notice appear in all copies. │ │ │ │ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ │ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ │ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ │ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ │ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ │ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "test.h" #include #include typedef char byte16 __attribute__((__vector_size__(16))); typedef float float4 __attribute__((__vector_size__(16))); typedef float float4a1 __attribute__((__vector_size__(16), __aligned__(1))); typedef float float4a16 __attribute__((__vector_size__(16), __aligned__(16))); typedef double double2 __attribute__((__vector_size__(16))); typedef double double2a1 __attribute__((__vector_size__(16), __aligned__(1))); typedef double double2a16 __attribute__((__vector_size__(16), __aligned__(16))); int main(void) { printf("sizeof(float4) = %ld\n", sizeof(float4)); printf("sizeof(float4a1) = %ld\n", sizeof(float4a1)); printf("sizeof(float4a16) = %ld\n", sizeof(float4a16)); printf("sizeof(double2) = %ld\n", sizeof(double2)); printf("sizeof(double2) = %ld\n", sizeof(double2a1)); printf("sizeof(double2) = %ld\n", sizeof(double2a16)); printf(" _Alignof(float4) = %ld\n", _Alignof(float4)); printf(" _Alignof(float4a1) = %ld\n", _Alignof(float4a1)); printf(" _Alignof(float4a16) = %ld\n", _Alignof(float4a16)); printf(" _Alignof(double2) = %ld\n", _Alignof(double2)); printf(" _Alignof(double2a1) = %ld\n", _Alignof(double2a1)); printf(" _Alignof(double2a16) = %ld\n", _Alignof(double2a16)); printf(" _Alignof(double2) = %ld\n", _Alignof(double2)); ASSERT(16, sizeof(float4)); ASSERT(16, sizeof(float4a1)); ASSERT(16, sizeof(float4a16)); ASSERT(16, sizeof(double2)); ASSERT(16, sizeof(double2a1)); ASSERT(16, sizeof(double2a16)); ASSERT(16, _Alignof(float4)); ASSERT(1, _Alignof(float4a1)); ASSERT(16, _Alignof(float4a16)); ASSERT(16, _Alignof(double2)); ASSERT(1, _Alignof(double2a1)); ASSERT(16, _Alignof(double2a16)); { float4 v1; float4 v2; float x[4] = {1, 2, 3, 4}; float y[4] = {1, 1, 1, 1}; memcpy(&v1, x, 16); memcpy(&v2, y, 16); v1 = v1 + v2; memcpy(x, &v1, 16); ASSERT(2, x[0]); // TODO(jart): fix me ASSERT(3, x[1]); ASSERT(4, x[2]); ASSERT(5, x[3]); } { byte16 v; float x1[4] = {1, 2, 3, 4}; float x2[4]; memcpy(&v, x1, 16); //__builtin_ia32_movntdq(x1, &v); memcpy(x2, &v, 16); ASSERT(1, x2[0]); //TODO(jart): fix me ASSERT(2, x1[1]); } return 0; }chibicc-1.0.24/test/vector_test2.c000066400000000000000000000102011517770275000167350ustar00rootroot00000000000000/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ │ vi: set et ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi │ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright 2020 Justine Alexandra Roberts Tunney │ │ │ │ Permission to use, copy, modify, and/or distribute this software for │ │ any purpose with or without fee is hereby granted, provided that the │ │ above copyright notice and this permission notice appear in all copies. │ │ │ │ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ │ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ │ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ │ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ │ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ │ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "test.h" #include typedef char byte16 __attribute__((__vector_size__(16))); typedef float float4 __attribute__((__vector_size__(16))); typedef float float5a1 __attribute__((__vector_size__(16), __aligned__(1))); typedef float float6a16 __attribute__((__vector_size__(16), __aligned__(16))); typedef double double2 __attribute__((__vector_size__(16))); typedef double double3a1 __attribute__((__vector_size__(16), __aligned__(1))); typedef double double4a16 __attribute__((__vector_size__(16), __aligned__(16))); int main(void) { printf("sizeof(float4) = %ld\n", sizeof(float4)); printf("sizeof(float4a1) = %ld\n", sizeof(float5a1)); printf("sizeof(float4a16) = %ld\n", sizeof(float6a16)); printf("sizeof(double2) = %ld\n", sizeof(double2)); printf("sizeof(double2) = %ld\n", sizeof(double3a1)); printf("sizeof(double2) = %ld\n", sizeof(double4a16)); printf(" _Alignof(float4) = %ld\n", _Alignof(float4)); printf(" _Alignof(float4a1) = %ld\n", _Alignof(float5a1)); printf(" _Alignof(float4a16) = %ld\n", _Alignof(float6a16)); printf(" _Alignof(double2) = %ld\n", _Alignof(double2)); printf(" _Alignof(double2a1) = %ld\n", _Alignof(double3a1)); printf(" _Alignof(double2a16) = %ld\n", _Alignof(double4a16)); printf(" _Alignof(double2) = %ld\n", _Alignof(double2)); ASSERT(16, sizeof(float4)); ASSERT(16, sizeof(float5a1)); ASSERT(16, sizeof(float6a16)); ASSERT(16, sizeof(double2)); ASSERT(16, sizeof(double3a1)); ASSERT(16, sizeof(double4a16)); ASSERT(16, _Alignof(float4)); ASSERT(1, _Alignof(float5a1)); ASSERT(16, _Alignof(float6a16)); ASSERT(16, _Alignof(double2)); ASSERT(1, _Alignof(double3a1)); ASSERT(16, _Alignof(double4a16)); { float4 v1; float4 v2; float x[4] = {1, 2, 3, 4}; float y[4] = {1, 1, 1, 1}; memcpy(&v1, x, 16); memcpy(&v2, y, 16); v1 = v1 + v2; memcpy(x, &v1, 16); ASSERT(2, x[0]); // TODO(jart): fix me ASSERT(3, x[1]); ASSERT(4, x[2]); ASSERT(5, x[3]); } { byte16 v; float x1[4] = {1, 2, 3, 4}; float x2[4]; // memcpy(&v, x1, 16); // __builtin_ia32_movntdq(x1, &v); // memcpy(x2, &v, 16); // ASSERT(1, x2[0]); // TODO(jart): fix me // ASSERT(2, x[1]); } return 0; }chibicc-1.0.24/test/vector_test2b.c000066400000000000000000000023451517770275000171110ustar00rootroot00000000000000 #include "test.h" #include #include typedef float float4a1 __attribute__((__vector_size__(16), __aligned__(1))); typedef double __v2df __attribute__ ((__vector_size__ (16))); typedef long long __v2di __attribute__ ((__vector_size__ (16))); typedef unsigned int __v4su __attribute__ ((__vector_size__ (16))); typedef short __v8hi __attribute__ ((__vector_size__ (16))); typedef unsigned short __v8hu __attribute__ ((__vector_size__ (16))); typedef char __v16qi __attribute__ ((__vector_size__ (16))); typedef signed char __v16qs __attribute__ ((__vector_size__ (16))); typedef unsigned char __v16qu __attribute__ ((__vector_size__ (16))); void process_vector(float4a1 vec) { for (int i = 0; i < 4; i++) { printf("vec[%d] = %f\n", i, vec[i]); if (i == 0) { ASSERT(12.000000, vec[0]); } else if (i == 1) { ASSERT(2.000000, vec[1]); } else if (i == 2) { ASSERT(3.000000, vec[2]); } else if (i == 3) { ASSERT(14.000000, vec[3]); } } } int main(void) { float4a1 v3 = {12, 2, 3, 14}; for (int i = 0; i < 4; i++) { printf("v3[%d] = %f\n", i, v3[i]); } process_vector(v3); printf("ok\n"); return 0; }chibicc-1.0.24/test/vector_test3.c000066400000000000000000000032061517770275000167450ustar00rootroot00000000000000#include #include #include #include #include "test.h" uint32_t pg_comp_crc32c_sse42(uint32_t crc, const void *data, size_t len) { const unsigned char *p = data; const unsigned char *pend = p + len; /* * Process eight bytes of data at a time. * * NB: We do unaligned accesses here. The Intel architecture allows that, * and performance testing didn't show any performance gain from aligning * the begin address. */ #ifdef __x86_64__ while (p + 8 <= pend) { crc = (uint32_t) _mm_crc32_u64(crc, *((const uint64_t *) p)); p += 8; } /* Process remaining full four bytes if any */ if (p + 4 <= pend) { crc = _mm_crc32_u32(crc, *((const unsigned int *) p)); p += 4; } #else /* * Process four bytes at a time. (The eight byte instruction is not * available on the 32-bit x86 architecture). */ while (p + 4 <= pend) { crc = _mm_crc32_u32(crc, *((const unsigned int *) p)); p += 4; } #endif /* __x86_64__ */ /* Process any remaining bytes one at a time. */ while (p < pend) { crc = _mm_crc32_u8(crc, *p); p++; } return crc; } int main() { // Example data const char data[] = "This is a test string for CRC32C!"; size_t tmplength = sizeof(data); size_t length = sizeof(data) - 1; // Exclude the null terminator printf("length = %ld templength=%ld\n", length, tmplength); ASSERT(33, length); ASSERT(34, tmplength); // Initial CRC value uint32_t crc = 0; // Compute CRC crc = pg_comp_crc32c_sse42(crc, data, length); // Print the result printf("CRC32C: %08X\n", crc); ASSERT(0x2393B78F, crc); return 0; }chibicc-1.0.24/test/vector_variadic.c000066400000000000000000000007131517770275000174650ustar00rootroot00000000000000#include "test.h" #include typedef float float4 __attribute__((vector_size(16))); void print_vectors(int count, ...) { va_list ap; va_start(ap, count); for (int i = 0; i < count; i++) { float4 v = va_arg(ap, float4); printf("vec %d = %f %f %f %f\n", i, v[0], v[1], v[2], v[3]); } va_end(ap); } int main() { float4 a = {1,2,3,4}; float4 b = {5,6,7,8}; print_vectors(2, a, b); } chibicc-1.0.24/test/vfork.c000066400000000000000000000011321517770275000154440ustar00rootroot00000000000000#include "test.h" #include #include #include int main(void) { pid_t pid = 0; int errpipe = 0; // simulate parent stack variable for error reporting pid = vfork(); if (pid < 0) { perror("vfork"); return 1; } if (pid == 0) { // child // // safe write to parent stack variable errpipe = 123; _exit(0); // child exits safely } // parent reads updated value printf("errpipe = %d\n", errpipe); ASSERT(123, errpipe); printf("OK\n"); return 0; } chibicc-1.0.24/test/vfork2.c000066400000000000000000000031661517770275000155370ustar00rootroot00000000000000// vfork_test.c #define _GNU_SOURCE #include #include #include #include #include #include "test.h" /* * This test checks that: * - vfork() does not corrupt parent stack * - child does not run parent epilogue * - execve() path works * - _exit() path works */ static int global_flag = 0; static int run_vfork_exec(void) { pid_t pid; int status = -1; pid = vfork(); if (pid < 0) { _exit(100); // must not return } if (pid == 0) { // CHILD // CPython-style constraints: // - no malloc // - no stdio // - no stack-heavy logic char *argv[] = { (char *)"/bin/true", NULL }; char *envp[] = { NULL }; execve("/bin/true", argv, envp); // If execve fails, must _exit() _exit(127); } // PARENT if (waitpid(pid, &status, 0) < 0) return -1; if (!WIFEXITED(status)) return -2; return WEXITSTATUS(status); } static int run_vfork_exit(void) { pid_t pid; pid = vfork(); if (pid < 0) return -1; if (pid == 0) { // CHILD global_flag = 42; // should be visible to parent printf("In child before _exit global_flag=%d\n", global_flag); ASSERT(42, global_flag); printf("OK\n"); _exit(0); } // PARENT if (global_flag != 42) return -2; return 0; } int main(void) { int r1 = run_vfork_exec(); int r2 = run_vfork_exit(); if (r1 != 0) return 1; if (r2 != 0) return 2; return 0; } chibicc-1.0.24/test/vfprintf.c000066400000000000000000000042501517770275000161570ustar00rootroot00000000000000#define _GNU_SOURCE #include "test.h" #include #include #include #include #include /* Core vfprintf wrapper */ static void test_vfprintf(const char *fmt, ...) { va_list ap; char buf[512]; va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); puts(buf); } /* Stress multiple argument types */ int main(void) { puts("==== BASIC TYPES ===="); test_vfprintf("int: %d\n", 42); test_vfprintf("unsigned: %u\n", 42u); test_vfprintf("hex: %x\n", 0xdeadbeef); test_vfprintf("octal: %o\n", 0777); test_vfprintf("char: %c\n", 'A'); test_vfprintf("string: %s\n", "hello"); puts("\n==== SIZE VARIANTS ===="); test_vfprintf("short: %hd\n", (short)123); test_vfprintf("long: %ld\n", 1234567890L); test_vfprintf("long long: %lld\n", 1234567890123LL); test_vfprintf("size_t: %zu\n", (size_t)123456); test_vfprintf("ptrdiff_t: %td\n", (ptrdiff_t)-42); test_vfprintf("intptr_t: %jd\n", (intmax_t)9223372036854775807LL); puts("\n==== FLOATING POINT ===="); test_vfprintf("float: %f\n", 3.1415926f); test_vfprintf("double: %lf\n", 2.718281828); test_vfprintf("scientific: %e\n", 1.23e+10); test_vfprintf("compact: %g\n", 12345.6789); puts("\n==== LONG DOUBLE ===="); long double ld = 1.234567890123456789L; test_vfprintf("long double: %Lf\n", ld); puts("\n==== WIDTH / PRECISION ===="); test_vfprintf("width: [%10d]\n", 123); test_vfprintf("left: [%-10d]\n", 123); test_vfprintf("prec: [%.5d]\n", 123); test_vfprintf("mix: [%10.5d]\n", 123); puts("\n==== STAR WIDTH / PRECISION ===="); test_vfprintf("star width: [%*d]\n", 8, 42); test_vfprintf("star prec: [%.*f]\n", 3, 3.1415926); test_vfprintf("both: [%*.*f]\n", 8, 3, 3.1415926); puts("\n==== POINTERS ===="); int x = 123; test_vfprintf("pointer: %p\n", (void *)&x); puts("\n==== MIXED ARGUMENT ORDER ===="); test_vfprintf("mix: %d %f %s %ld %c\n", 7, 1.5, "txt", 9999999L, 'Z'); puts("\n==== REPEATED VARARGS ===="); test_vfprintf("%d %d %d %d %d\n", 1, 2, 3, 4, 5); puts("\n==== DONE ===="); return 0; } chibicc-1.0.24/test/vim.c000066400000000000000000000002311517770275000151070ustar00rootroot00000000000000#include "test.h" int main() { int x = (0 < 2 || 0) ? -1 : 42; printf("%d\n", x); // Should print -1 ASSERT(-1, x); return 0; } chibicc-1.0.24/test/vim2.c000066400000000000000000000002611517770275000151740ustar00rootroot00000000000000#include #include "test.h" int main() { int r = system("XXXX"); // Command doesn't exist printf("Returned: %d\n", r); ASSERT(32512, r); return 0; } chibicc-1.0.24/test/vim3.c000066400000000000000000000005421517770275000151770ustar00rootroot00000000000000#include #include "test.h" int main() { FILE *fp = popen("XXXX", "r"); if (fp == NULL) { perror("popen"); return 1; } char buf[128]; while (fgets(buf, sizeof(buf), fp)) { printf("Output: %s", buf); } int status = pclose(fp); printf("Status: %d\n", status); ASSERT(32512, status); return 0; } chibicc-1.0.24/test/vim5.c000066400000000000000000000013441517770275000152020ustar00rootroot00000000000000#include "test.h" #include #include // For WEXITSTATUS and related macros int main(void) { int ret = system("XXXX"); // Intentionally invalid command if (ret == -1) { perror("system"); return 1; } // Check if the command terminated normally if (WIFEXITED(ret)) { int exit_status = WEXITSTATUS(ret); printf("Command exited with status: %d\n", exit_status); if (exit_status == 127) printf("As expected: command not found\n"); else printf("Unexpected exit status\n"); ASSERT(127, exit_status); } else { printf("Command did not exit normally\n"); } return 0; } chibicc-1.0.24/test/vim_asm.c000066400000000000000000000005501517770275000157530ustar00rootroot00000000000000#include #define REASSOC_FENCE(x, y) __asm__("" : "+r"(x), "+r"(y)) int main() { int a = 5; int b = 10; printf("Before fence: a=%d, b=%d\n", a, b); // Use the macro to prevent reassociation (GCC only) REASSOC_FENCE(a, b); // Perform a calculation int c = a + b; printf("After fence: c=%d\n", c); return 0; } chibicc-1.0.24/test/vim_segfault.c000066400000000000000000000017061517770275000170110ustar00rootroot00000000000000#include #include typedef struct State { int val; struct State *prev; } State; // Recursive function that mimics addstate() in Vim's regex engine void addstate(State **cur, int depth, int limit) { if (depth > limit) { return; } // Allocate state on heap to simulate Vim's match state State *s = malloc(sizeof(State)); s->val = depth; s->prev = *cur; *cur = s; // Recursive call addstate(cur, depth + 1, limit); } // Traverse the list without freeing (to mimic crash potential) void traverse(State *s) { while (s) { // Dereference state printf("state depth=%d\n", s->val); s = s->prev; } } int main() { State *cur = NULL; // Simulate deep recursion like Vim regex pattern //addstate(&cur, 1, 100000); // increase if no crash addstate(&cur, 1, 87249); // it works fine with 87248 and crashes with 87249 traverse(cur); return 0; } chibicc-1.0.24/test/vla.c000077500000000000000000000022401517770275000151030ustar00rootroot00000000000000#include "test.h" int main() { ASSERT(20, ({ int n=5; int x[n]; sizeof(x); })); ASSERT((5+1)*(8*2)*4, ({ int m=5, n=8; int x[m+1][n*2]; sizeof(x); })); ASSERT(8, ({ char n=10; int (*x)[n][n+2]; sizeof(x); })); ASSERT(480, ({ char n=10; int (*x)[n][n+2]; sizeof(*x); })); ASSERT(48, ({ char n=10; int (*x)[n][n+2]; sizeof(**x); })); ASSERT(4, ({ char n=10; int (*x)[n][n+2]; sizeof(***x); })); ASSERT(60, ({ char n=3; int x[5][n]; sizeof(x); })); ASSERT(12, ({ char n=3; int x[5][n]; sizeof(*x); })); ASSERT(60, ({ char n=3; int x[n][5]; sizeof(x); })); ASSERT(20, ({ char n=3; int x[n][5]; sizeof(*x); })); ASSERT(0, ({ int n=10; int x[n+1][n+6]; int *p=x; for (int i = 0; i void array_cast_to_bool(int j) { char vla[j]; RASSERT((_Bool)vla); } int main(void) { array_cast_to_bool(11); // Test regular arrays { char arr[3]; RASSERT(8 == sizeof((0 ? arr:arr))); RASSERT(8 == sizeof((0 ? 0: (char*)arr))); RASSERT(8 == sizeof((0 ? (char*)arr:0))); RASSERT(8 == sizeof(({(char*)arr;}))); RASSERT(8 == sizeof((0, (char*)arr))); RASSERT(8 == sizeof((0 ? 0: arr))); RASSERT(8 == sizeof((0 ? arr:0))); RASSERT(8 == sizeof(({arr;}))); RASSERT(8 == sizeof((0, arr))); RASSERT(3 == sizeof((arr))); } // Test VLAs { int n = 5; char vla[n]; char *pvla = vla; RASSERT(8 == sizeof((0 ? vla : vla))); // ternary decay to pointer RASSERT(8 == sizeof((0 ? 0 : (char*)vla))); // explicit cast RASSERT(8 == sizeof((0 ? (char*)vla : 0))); // explicit cast RASSERT(8 == sizeof(({(char*)vla;}))); // statement expression RASSERT(8 == sizeof((0, (char*)vla))); // comma expression RASSERT(8 == sizeof((0 ? 0 : vla))); // ternary decay RASSERT(8 == sizeof((0 ? vla : 0))); // ternary decay RASSERT(8 == sizeof(({vla;}))); // statement expression RASSERT(8 == sizeof((0, vla))); // comma expression RASSERT(n == sizeof(vla)); // actual VLA size } printf("OK\n"); return 0; } chibicc-1.0.24/test/vla4.c000066400000000000000000000033751517770275000151760ustar00rootroot00000000000000// vla_tail_struct_test.c #include "test.h" #include #include #include #include /* * Struct with VLA as last member. * This is NOT a flexible array member. * Size depends on runtime value. */ struct VLA { uint32_t magic; size_t len; __attribute__((aligned(16))) unsigned char data[]; /* ensure alignment stress */ }; /* Allocate a VLA-sized object */ static struct VLA *vla_new(size_t len) { size_t size = sizeof(struct VLA) + len; struct VLA *p = malloc(size); p->magic = 0xDEADBEEF; p->len = len; memset(p->data, 0xAA, len); ASSERT(1, p != NULL); return p; } /* Validate layout and contents */ static void vla_check(struct VLA *p) { ASSERT(0xDEADBEEF, p->magic); ASSERT(0, p->len == 0); // Ensure len is not zero for (size_t i = 0; i < p->len; i++) { if (p->data[i] != 0xAA) { fprintf(stderr, "data corruption at %zu\n", i); abort(); } } } /* Force pointer arithmetic and alignment checks */ static uint64_t vla_checksum(struct VLA *p) { uint64_t sum = 0; for (size_t i = 0; i < p->len; i++) { sum = (sum << 1) ^ p->data[i]; } return sum; } /* Stress nested usage (CPython-like) */ static void stress(void) { for (size_t i = 1; i <= 256; i++) { struct VLA *p = vla_new(i * 7); vla_check(p); uint64_t c = vla_checksum(p); if (c == 0) { fprintf(stderr, "impossible checksum\n"); abort(); } free(p); } } int main(void) { puts("[VLA tail struct test]"); printf("sizeof(struct VLA) = %zu\n", sizeof(struct VLA)); ASSERT(16, sizeof(struct VLA)); // aligned to 16 bytes stress(); puts("OK"); return 0; } chibicc-1.0.24/test/vla_params2.c000066400000000000000000000044101517770275000165260ustar00rootroot00000000000000#include "test.h" #include typedef int32_t i32; typedef uint8_t u8; void fn1(i32 z, i32 a[z], i32 b1[sizeof(a)], i32 (*b2)[sizeof(a)]){ ASSERT(8, sizeof(a)); ASSERT(8, sizeof(b1)); ASSERT(32, sizeof(*b2)); } void fn1b(i32 z, i32 (*a)[z], i32 (*b2)[sizeof(*a)]){ ASSERT(28, sizeof(*a)); ASSERT(112, sizeof(*b2)); } void fn2(i32 z, i32 (*a)[z], i32 b1[sizeof(*a)], i32 (*b2)[sizeof(*a)]){ ASSERT(28, sizeof(*a)); ASSERT(8, sizeof(b1)); ASSERT(112, sizeof(*b2)); } void fn3(i32 x, i32 y, u8 arr[++y][(x+=2,x)]){ ASSERT(9, x); ASSERT(12, y); ASSERT(8, sizeof arr); ASSERT(9, sizeof *arr); } void fn4(i32 x,i32,i32 y,i32,i32,i32 z,i32 a[x+y][y+z][z+x]) { ASSERT(8, sizeof(a)); ASSERT(1008, sizeof(a[0])); ASSERT(56, sizeof(a[0][0])); } int max(i32 a, i32 b) { return a > b ? a : b; } int fn5(i32 x, i32 y, i32 (*z) [max(x, y)]) { return sizeof *z; } int g; void fn6(i32 x, i32 (*a)[g += x], i32 y, i32(*b)[sizeof(*a) + y], i32 (*c)[sizeof(*b) + g], i32 as, i32 bs, i32 cs){ ASSERT(as, sizeof(*a)); ASSERT(bs, sizeof(*b)); ASSERT(cs, sizeof(*c)); } void fn7(i32 *x, i32(*a)[*(++x)], i32(*b)[*(++x)] ) { ASSERT(88, sizeof(*a)); ASSERT(132, sizeof(*b)); } void fn8(i32 x, i32 (*a)[sizeof(u8[x])], i32 (*b)[sizeof(*a)+sizeof(u8[sizeof(*a)+sizeof(u8[x])])]) { ASSERT(468, sizeof(*b)); ASSERT(52, sizeof(*a)); } void fn9(char* str, int b, i32 (*arr)[b == strcmp(str, "FOOBAR")]) { ASSERT(4, sizeof *arr); } _Bool z = 1; // void // fn_oldstyle(a, b, c, d, z) // float c; // register uint8_t b,d; // int16_t (*a)[++b][(__typeof__(b))c][d++]; // { // #ifdef NOTGCC // ASSERT(5, b); // ASSERT(9, d); // #endif // ASSERT(720, sizeof(*a)); // ASSERT(144, sizeof((*a)[0])); // ASSERT(16, sizeof((*a)[1][2])); // ASSERT(2, sizeof((*a)[1][2][3])); // z = c; // ASSERT(5, b); // ASSERT(9, d); // ASSERT(777, z); // } int main(void){ fn1(7,0,0,0); fn1b(7,0,0); fn2(7,0,0,0); fn3(7,11,0); fn4(3,0,7,0,0,11,0); ASSERT(28, fn5(3, 7, 0)); ASSERT(44, fn5(11, 5, 0)); g = 13; fn6(11,0,7,0,0,96,412,1744); g = 3; fn6(11,0,7,0,0,56,252,1064); i32 arr[3] = {11,22,33}; fn7((void*)&arr, 0, 0); fn8(13, 0, 0); fn9("FOOBAR", 0, 0); double f = 777.0; //fn_oldstyle(0,260,f,264); printf("OK\n"); return 0; } chibicc-1.0.24/test/vla_params3.c000066400000000000000000000003141517770275000165260ustar00rootroot00000000000000#include "test.h" #include typedef int32_t i32; typedef uint8_t u8; void fn2(i32 z, i32 (*a)[z]){ ASSERT(28, sizeof(*a)); } int main(void){ fn2(7,0); printf("OK\n"); return 0; } chibicc-1.0.24/test/vla_params4.c000066400000000000000000000004601517770275000165310ustar00rootroot00000000000000#include "test.h" #include typedef int32_t i32; typedef uint8_t u8; void fn4(i32 x,i32,i32 y,i32,i32,i32 z,i32 a[x+y][y+z][z+x]) { ASSERT(8, sizeof(a)); ASSERT(1008, sizeof(a[0])); ASSERT(56, sizeof(a[0][0])); } int main(void){ fn4(3,0,7,0,0,11,0); printf("OK\n"); return 0; } chibicc-1.0.24/test/vla_params4_2d.c000066400000000000000000000015231517770275000171170ustar00rootroot00000000000000#include "test.h" #include typedef int32_t i32; void fn0(i32 x, i32 y, i32 a[x][5]) { ASSERT(8, sizeof(a)); ASSERT(20, sizeof(a[0])); } void fn0_1(i32 x, i32 a[x][5]) { ASSERT(8, sizeof(a)); ASSERT(20, sizeof(a[0])); } void fn0_2(i32 x, i32 a[x][x]) { ASSERT(8, sizeof(a)); ASSERT(28, sizeof(a[0])); } void fn1(i32 x, i32 y, i32 z, i32 a[x][y][z]) { ASSERT(8, sizeof(a)); ASSERT(32, sizeof(a[0])); } void fn2(i32 y, i32 x, i32 a[x][y]) { ASSERT(8, sizeof(a)); ASSERT(28, sizeof(a[0])); } // 2D VLA - accessing first dimension void fn_2d(i32 x, i32 y, i32 a[x][y]) { ASSERT(8, sizeof(a)); ASSERT(16, sizeof(a[0])); // y * sizeof(int) = 4 * 4 = 16 } int main(void){ fn0(7, 4, 0); fn0_1(7, 0); fn0_2(7, 0); fn1(7, 4, 2, 0); fn2(7, 4, 0); fn_2d(7, 4, 0); printf("OK\n"); return 0; } chibicc-1.0.24/test/vla_params4_simple.c000066400000000000000000000003561517770275000201060ustar00rootroot00000000000000#include "test.h" #include typedef int32_t i32; // Simplified test - only one dimension parameter void fn_simple(i32 z, i32 a[z]) { ASSERT(8, sizeof(a)); } int main(void){ fn_simple(7, 0); printf("OK\n"); return 0; } chibicc-1.0.24/test/vla_params5.c000066400000000000000000000007641517770275000165410ustar00rootroot00000000000000#include "test.h" #include typedef int32_t i32; typedef uint8_t u8; void fn1(i32 z, i32 b1[sizeof(z)]){ ASSERT(4, sizeof(*b1)); ASSERT(8, sizeof(b1)); } void fn1b(i32 *z, i32 b1[sizeof(*z)]){ ASSERT(4, sizeof(*b1)); ASSERT(8, sizeof(b1)); } void fn2(i32 z, i32 (*a)[z], i32 b1[sizeof(*a)]){ ASSERT(28, sizeof(*a)); ASSERT(8, sizeof(b1)); // ASSERT(112, sizeof(*b2)); } int main() { fn1(7, 0); fn1b(7, 0); fn2(7, 0, 0); printf("OK\n"); return 0; }chibicc-1.0.24/test/vla_recursion.c000066400000000000000000000012151517770275000171720ustar00rootroot00000000000000#include "test.h" static long recurse_vla(int depth, int limit) { int n = depth + 3; int vla[n]; for (int i = 0; i < n; i++) vla[i] = depth * 100 + i; long local_sum = 0; for (int i = 0; i < n; i++) local_sum += vla[i]; if (depth == limit) return local_sum; return local_sum + recurse_vla(depth + 1, limit); } int main(void) { // Sum over depth d=1..5, each with VLA length d+3 and values d*100+i. // Per-depth sums: 406, 1010, 1815, 2821, 4028 => total 10080. ASSERT(10080, recurse_vla(1, 5)); // Slightly deeper recursion to exercise repeated VLA allocation. ASSERT(22155, recurse_vla(2, 7)); return 0; } chibicc-1.0.24/test/vla_test_simple_param.c000066400000000000000000000004611517770275000206730ustar00rootroot00000000000000#include "test.h" #include typedef int32_t i32; // Test if parameters are accessible for simple variable refs void fn_test(i32 x, i32 y) { i32 result = x + y; ASSERT(10, result); // 7 + 4 = 11... wait let me use actual values from calls } int main(void){ printf("OK\n"); return 0; } chibicc-1.0.24/test/vla_typedef.c000066400000000000000000000011001517770275000166120ustar00rootroot00000000000000#include "test.h" void fn(int x){ typedef int A[++x], B[++x]; A a1, *a2; ASSERT(24, sizeof(a1)); ASSERT(24, sizeof(*a2)); x = 17; B b1[x++], *b2; ASSERT(476, sizeof(b1)); ASSERT(28, sizeof(*b1)); ASSERT(28, sizeof(*b2)); typedef int (*C)[++x]; C c1[++x], c2; ASSERT(160, sizeof(c1)); ASSERT(8, sizeof(*c1)); ASSERT(76, sizeof(**c1)); ASSERT(76, sizeof(*c2)); typedef char D[x = 177]; D a; x = 7; D b; D c; ASSERT(192, (&a[0] - &b[0])); ASSERT(192, (&b[0] - &c[0])); } int main(void){ fn(5); printf("OK\n"); return 0; } chibicc-1.0.24/test/vlc_generic.c000066400000000000000000000024711517770275000166040ustar00rootroot00000000000000#include "test.h" #include #include #include #include #define VLC_USED __attribute__((unused)) #define VLC_MALLOC __attribute__((malloc)) // Generic macro using builtins #define mul_overflow(a,b,r) \ _Generic(*(r), \ unsigned: __builtin_umul_overflow(a, b, (unsigned *)(r)), \ unsigned long: __builtin_umull_overflow(a, b, (unsigned long *)(r)), \ unsigned long long: __builtin_umulll_overflow(a, b, (unsigned long long *)(r))) // VLC-like allocation using builtins VLC_USED VLC_MALLOC static inline void *vlc_alloc(size_t count, size_t size) { size_t total = 0; if (mul_overflow(count, size, &total)) return NULL; return malloc(total); } int main(void) { size_t n = 10, sz = sizeof(int); int *arr = vlc_alloc(n, sz); if (!arr) { printf("Allocation failed (overflow?)\n"); return 1; } printf("=======n=%d, sz=%d, arr=%p\n"); for (size_t i = 0; i < n; i++) arr[i] = (int)i; for (size_t i = 0; i < n; i++) printf("%d ", arr[i]); printf("\n"); free(arr); // Test overflow int *overflow_test = vlc_alloc(SIZE_MAX, SIZE_MAX); if (!overflow_test) printf("Overflow detected correctly!\n"); return 0; } chibicc-1.0.24/test/vlc_undefine.c000066400000000000000000000030321517770275000167570ustar00rootroot00000000000000#include "test.h" typedef int vlc_action_id_t; typedef struct { int dummy; } intf_thread_t; // Normal function that the action_handler will call void player_navigate(intf_thread_t *player, int nav) { printf("player_navigate called with %d\n", nav); ASSERT(42, nav); } // Macro defining static inline action handlers #define PLAYER_ACTION_HANDLER(name) \ static inline void action_handler_##name(intf_thread_t *player, vlc_action_id_t action_id) PLAYER_ACTION_HANDLER(Navigate) { enum { NAV_UP = 1, NAV_DOWN = 2, NAV_LEFT = 3, NAV_RIGHT = 4, NAV_ACTIVATE = 42 }; int nav; switch (action_id) { #define PLAYER_NAV_FROM_ACTION(navval) \ case NAV_##navval: \ nav = NAV_##navval; \ break; PLAYER_NAV_FROM_ACTION(ACTIVATE) PLAYER_NAV_FROM_ACTION(UP) PLAYER_NAV_FROM_ACTION(DOWN) PLAYER_NAV_FROM_ACTION(LEFT) PLAYER_NAV_FROM_ACTION(RIGHT) #undef PLAYER_NAV_FROM_ACTION default: ASSERT(0, action_id); // simulate vlc_assert_unreachable } // Call a normal function player_navigate(player, nav); } typedef void (*handler_t)(intf_thread_t*, vlc_action_id_t); struct vlc_action { handler_t fptr; }; // Array of pointers to inline action handlers static struct vlc_action actions[] = { { .fptr = action_handler_Navigate } }; int main() { intf_thread_t i; vlc_action_id_t act = 42; // NAV_ACTIVATE actions[0].fptr(&i, act); printf("OK\n"); return 0; } chibicc-1.0.24/test/vlc_undefine2.c000066400000000000000000000017361517770275000170520ustar00rootroot00000000000000// test3.c #include #include #include // external function (not defined in this TU) void extfn(void) { return; } static inline void playlist_bookmark_Set(const char *name) { extfn(); // reference to an external symbol } static inline void playlist_bookmark_Play(const char *name) { puts(name); // reference to libc } // simulate VLC macro calling inline functions #define INTF_ACTION_HANDLER(name) \ void action_handler_##name(int action_id) { \ char bookmark_name[32]; \ snprintf(bookmark_name, sizeof(bookmark_name), "bookmark%i", action_id); \ if (action_id % 2) \ playlist_bookmark_Set(bookmark_name); \ else \ playlist_bookmark_Play(bookmark_name); \ } // instantiate the macro INTF_ACTION_HANDLER(PlaylistBookmark) int main(void) { // action_handler_PlaylistBookmark(1); //action_handler_PlaylistBookmark(2); return 0; } chibicc-1.0.24/test/volatile.c000066400000000000000000000014611517770275000161410ustar00rootroot00000000000000// math_abi_torture.c #include "test.h" #include #include #include #pragma STDC FENV_ACCESS ON static double chain(double x) { return sin(cos(tan(log(exp(x))))); } long double f(long double x) { return sqrtl(x) + sinl(x); } int main(void) { feclearexcept(FE_ALL_EXCEPT); errno = 0; volatile double x = 0.1; volatile double y = 0.0; for (int i = 0; i < 100000; i++) { y += chain(x + i * 1e-6); } int raised = fetestexcept(FE_ALL_EXCEPT); printf("y=%f errno=%d fpex=%x\n", y, errno, raised); ASSERT(83500, y); ASSERT(0, errno); ASSERT(32, raised); volatile long double x1 = 1.234567890123456789L; volatile long double y1 = f(x1); printf("%.18Lf\n", y1); ASSERT(2.718281828459045091L, y1); return 0; } chibicc-1.0.24/test/weak.c000066400000000000000000000004711517770275000152510ustar00rootroot00000000000000#include "test.h" // Define the original function `lxc_attach_main`. int lxc_attach_main(int argc, char *argv[]) { printf("This is lxc_attach_main.\n"); return 0; } // Declare `main` as a weak alias of `lxc_attach_main`. int __attribute__((weak, alias("lxc_attach_main"))) main(int argc, char *argv[]); chibicc-1.0.24/test/weak2.c000066400000000000000000000015001517770275000153250ustar00rootroot00000000000000// weak2.c #include "test.h" typedef void (*vlc_plugin_cb)(void); // Simulate VLC_WEAK macro #define VLC_WEAK __attribute__((weak)) // Weak symbol declaration VLC_WEAK extern const vlc_plugin_cb vlc_static_modules[]; // Function using the weak symbol void init_plugins(void) { if (!vlc_static_modules) { printf("vlc_static_modules not defined\n"); return; } for (unsigned i = 0; vlc_static_modules[i]; i++) { printf("Plugin %u initialized\n", i); vlc_static_modules[i](); } } // Dummy plugin void plugin1(void) { printf("Plugin1 executed\n"); } // Uncomment to define the weak array for testing const vlc_plugin_cb vlc_static_modules[] = { plugin1, NULL }; int main() { init_plugins(); printf("Test completed\n"); return 0; }chibicc-1.0.24/test/xgetbv.c000066400000000000000000000015571517770275000156270ustar00rootroot00000000000000#include "test.h" #include // direct wrapper for xgetbv static inline uint64_t xgetbv(uint32_t xcr) { uint32_t eax, edx; __asm__ volatile ( ".byte 0x0f, 0x01, 0xd0" // xgetbv opcode : "=a"(eax), "=d"(edx) // outputs in eax, edx : "c"(xcr) // input: xcr in ecx ); return ((uint64_t)edx << 32) | eax; } static inline void cpuid(uint32_t leaf, uint32_t subleaf, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d) { __asm__ volatile("cpuid" : "=a"(*a), "=b"(*b), "=c"(*c), "=d"(*d) : "a"(leaf), "c"(subleaf)); } int main(void) { printf("Calling xgetbv(0)...\n"); uint64_t val = xgetbv(0); printf("xgetbv(0) = 0x%llx\n", (unsigned long long)val); return 0; } chibicc-1.0.24/test/zconf.h000066400000000000000000000414021517770275000154450ustar00rootroot00000000000000/* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #ifndef ZCONF_H #define ZCONF_H /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ # define Z_PREFIX_SET /* all linked symbols and init macros */ # define _dist_code z__dist_code # define _length_code z__length_code # define _tr_align z__tr_align # define _tr_flush_bits z__tr_flush_bits # define _tr_flush_block z__tr_flush_block # define _tr_init z__tr_init # define _tr_stored_block z__tr_stored_block # define _tr_tally z__tr_tally # define adler32 z_adler32 # define adler32_combine z_adler32_combine # define adler32_combine64 z_adler32_combine64 # define adler32_z z_adler32_z # ifndef Z_SOLO # define compress z_compress # define compress2 z_compress2 # define compressBound z_compressBound # endif # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 # define crc32_combine_gen z_crc32_combine_gen # define crc32_combine_gen64 z_crc32_combine_gen64 # define crc32_combine_op z_crc32_combine_op # define crc32_z z_crc32_z # define deflate z_deflate # define deflateBound z_deflateBound # define deflateCopy z_deflateCopy # define deflateEnd z_deflateEnd # define deflateGetDictionary z_deflateGetDictionary # define deflateInit z_deflateInit # define deflateInit2 z_deflateInit2 # define deflateInit2_ z_deflateInit2_ # define deflateInit_ z_deflateInit_ # define deflateParams z_deflateParams # define deflatePending z_deflatePending # define deflatePrime z_deflatePrime # define deflateReset z_deflateReset # define deflateResetKeep z_deflateResetKeep # define deflateSetDictionary z_deflateSetDictionary # define deflateSetHeader z_deflateSetHeader # define deflateTune z_deflateTune # define deflateUsed z_deflateUsed # define deflate_copyright z_deflate_copyright # define get_crc_table z_get_crc_table # ifndef Z_SOLO # define gz_error z_gz_error # define gz_intmax z_gz_intmax # define gz_strwinerror z_gz_strwinerror # define gzbuffer z_gzbuffer # define gzclearerr z_gzclearerr # define gzclose z_gzclose # define gzclose_r z_gzclose_r # define gzclose_w z_gzclose_w # define gzdirect z_gzdirect # define gzdopen z_gzdopen # define gzeof z_gzeof # define gzerror z_gzerror # define gzflush z_gzflush # define gzfread z_gzfread # define gzfwrite z_gzfwrite # define gzgetc z_gzgetc # define gzgetc_ z_gzgetc_ # define gzgets z_gzgets # define gzoffset z_gzoffset # define gzoffset64 z_gzoffset64 # define gzopen z_gzopen # define gzopen64 z_gzopen64 # ifdef _WIN32 # define gzopen_w z_gzopen_w # endif # define gzprintf z_gzprintf # define gzputc z_gzputc # define gzputs z_gzputs # define gzread z_gzread # define gzrewind z_gzrewind # define gzseek z_gzseek # define gzseek64 z_gzseek64 # define gzsetparams z_gzsetparams # define gztell z_gztell # define gztell64 z_gztell64 # define gzungetc z_gzungetc # define gzvprintf z_gzvprintf # define gzwrite z_gzwrite # endif # define inflate z_inflate # define inflateBack z_inflateBack # define inflateBackEnd z_inflateBackEnd # define inflateBackInit z_inflateBackInit # define inflateBackInit_ z_inflateBackInit_ # define inflateCodesUsed z_inflateCodesUsed # define inflateCopy z_inflateCopy # define inflateEnd z_inflateEnd # define inflateGetDictionary z_inflateGetDictionary # define inflateGetHeader z_inflateGetHeader # define inflateInit z_inflateInit # define inflateInit2 z_inflateInit2 # define inflateInit2_ z_inflateInit2_ # define inflateInit_ z_inflateInit_ # define inflateMark z_inflateMark # define inflatePrime z_inflatePrime # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 # define inflateResetKeep z_inflateResetKeep # define inflateSetDictionary z_inflateSetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine # define inflateValidate z_inflateValidate # define inflate_copyright z_inflate_copyright # define inflate_fast z_inflate_fast # define inflate_table z_inflate_table # ifndef Z_SOLO # define uncompress z_uncompress # define uncompress2 z_uncompress2 # endif # define zError z_zError # ifndef Z_SOLO # define zcalloc z_zcalloc # define zcfree z_zcfree # endif # define zlibCompileFlags z_zlibCompileFlags # define zlibVersion z_zlibVersion /* all zlib typedefs in zlib.h and zconf.h */ # define Byte z_Byte # define Bytef z_Bytef # define alloc_func z_alloc_func # define charf z_charf # define free_func z_free_func # ifndef Z_SOLO # define gzFile z_gzFile # endif # define gz_header z_gz_header # define gz_headerp z_gz_headerp # define in_func z_in_func # define intf z_intf # define out_func z_out_func # define uInt z_uInt # define uIntf z_uIntf # define uLong z_uLong # define uLongf z_uLongf # define voidp z_voidp # define voidpc z_voidpc # define voidpf z_voidpf /* all zlib structs in zlib.h and zconf.h */ # define gz_header_s z_gz_header_s # define internal_state z_internal_state #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS #endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) # define OS2 #endif #if defined(_WINDOWS) && !defined(WINDOWS) # define WINDOWS #endif #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) # ifndef WIN32 # define WIN32 # endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) # ifndef SYS16BIT # define SYS16BIT # endif # endif #endif /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). */ #ifdef SYS16BIT # define MAXSEG_64K #endif #ifdef MSDOS # define UNALIGNED_OK #endif #ifdef __STDC_VERSION__ # ifndef STDC # define STDC # endif # if __STDC_VERSION__ >= 199901L # ifndef STDC99 # define STDC99 # endif # endif #endif #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) # define STDC #endif #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) # define STDC #endif #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) # define STDC #endif #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) # define STDC #endif #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ # define STDC #endif #ifndef STDC # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ # define const /* note: need a more gentle solution here */ # endif #endif #ifndef z_const # ifdef ZLIB_CONST # define z_const const # else # define z_const # endif #endif #ifdef Z_SOLO # ifdef _WIN64 typedef unsigned long long z_size_t; # else typedef unsigned long z_size_t; # endif #else # define z_longlong long long # if defined(NO_SIZE_T) typedef unsigned NO_SIZE_T z_size_t; # elif defined(STDC) # include typedef size_t z_size_t; # else typedef unsigned long z_size_t; # endif # undef z_longlong #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # ifdef MAXSEG_64K # define MAX_MEM_LEVEL 8 # else # define MAX_MEM_LEVEL 9 # endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus about 7 kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, * just define FAR to be empty. */ #ifdef SYS16BIT # if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */ # define SMALL_MEDIUM # ifdef _MSC_VER # define FAR _far # else # define FAR far # endif # endif # if (defined(__SMALL__) || defined(__MEDIUM__)) /* Turbo C small or medium model */ # define SMALL_MEDIUM # ifdef __BORLANDC__ # define FAR _far # else # define FAR far # endif # endif #endif #if defined(WINDOWS) || defined(WIN32) /* If building or using zlib as a DLL, define ZLIB_DLL. * This is not mandatory, but it offers a little performance increase. */ # ifdef ZLIB_DLL # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) # ifdef ZLIB_INTERNAL # define ZEXTERN extern __declspec(dllexport) # else # define ZEXTERN extern __declspec(dllimport) # endif # endif # endif /* ZLIB_DLL */ /* If building or using zlib with the WINAPI/WINAPIV calling convention, * define ZLIB_WINAPI. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. */ # ifdef ZLIB_WINAPI # ifdef FAR # undef FAR # endif # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif # include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI # ifdef WIN32 # define ZEXPORTVA WINAPIV # else # define ZEXPORTVA FAR CDECL # endif # endif #endif #if defined (__BEOS__) # ifdef ZLIB_DLL # ifdef ZLIB_INTERNAL # define ZEXPORT __declspec(dllexport) # define ZEXPORTVA __declspec(dllexport) # else # define ZEXPORT __declspec(dllimport) # define ZEXPORTVA __declspec(dllimport) # endif # endif #endif #ifndef ZEXTERN # define ZEXTERN extern #endif #ifndef ZEXPORT # define ZEXPORT #endif #ifndef ZEXPORTVA # define ZEXPORTVA #endif #ifndef FAR # define FAR #endif #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ # define Bytef Byte FAR #else typedef Byte FAR Bytef; #endif typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void const *voidpc; typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; typedef Byte FAR *voidpf; typedef Byte *voidp; #endif #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) # include # if (UINT_MAX == 0xffffffffUL) # define Z_U4 unsigned # elif (ULONG_MAX == 0xffffffffUL) # define Z_U4 unsigned long # elif (USHRT_MAX == 0xffffffffUL) # define Z_U4 unsigned short # endif #endif #ifdef Z_U4 typedef Z_U4 z_crc_t; #else typedef unsigned long z_crc_t; #endif #if HAVE_UNISTD_H-0 /* may be set to #if 1 by ./configure */ # define Z_HAVE_UNISTD_H #endif #if HAVE_STDARG_H-0 /* may be set to #if 1 by ./configure */ # define Z_HAVE_STDARG_H #endif #ifdef STDC # ifndef Z_SOLO # include /* for off_t */ # endif #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO # include /* for va_list */ # endif #endif #ifdef _WIN32 # ifndef Z_SOLO # include /* for wchar_t */ # endif #endif /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even * though the former does not conform to the LFS document), but considering * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as * equivalently requesting no 64-bit operations */ #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 # undef _LARGEFILE64_SOURCE #endif #ifndef Z_HAVE_UNISTD_H # if defined(__WATCOMC__) || defined(__GO32__) || \ (defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)) # define Z_HAVE_UNISTD_H # endif #endif #ifndef Z_SOLO # if defined(Z_HAVE_UNISTD_H) # include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ # ifdef VMS # include /* for off_t */ # endif # ifndef z_off_t # define z_off_t off_t # endif # endif #endif #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 # define Z_LFS64 #endif #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) # define Z_LARGE64 #endif #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) # define Z_WANT64 #endif #if !defined(SEEK_SET) && !defined(Z_SOLO) # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t # define z_off_t long long #endif #if !defined(_WIN32) && defined(Z_LARGE64) # define z_off64_t off64_t #elif defined(__MINGW32__) # define z_off64_t long long #elif defined(_WIN32) && !defined(__GNUC__) # define z_off64_t __int64 #elif defined(__GO32__) # define z_off64_t offset_t #else # define z_off64_t z_off_t #endif /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) #pragma map(deflateInit_,"DEIN") #pragma map(deflateInit2_,"DEIN2") #pragma map(deflateEnd,"DEEND") #pragma map(deflateBound,"DEBND") #pragma map(inflateInit_,"ININ") #pragma map(inflateInit2_,"ININ2") #pragma map(inflateEnd,"INEND") #pragma map(inflateSync,"INSY") #pragma map(inflateSetDictionary,"INSEDI") #pragma map(compressBound,"CMBND") #pragma map(inflate_table,"INTABL") #pragma map(inflate_fast,"INFA") #pragma map(inflate_copyright,"INCOPY") #endif #endif /* ZCONF_H */chibicc-1.0.24/test/zlib.h000077500000000000000000002765071517770275000153110ustar00rootroot00000000000000 /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.3.1.1, January xxth, 2024 Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). */ #ifndef ZLIB_H #define ZLIB_H #ifdef ZLIB_BUILD # include #else # include "zconf.h" #endif #ifdef __cplusplus extern "C" { #endif #define ZLIB_VERSION "1.3.1.1-motley" #define ZLIB_VERNUM 0x1311 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 3 #define ZLIB_VER_REVISION 1 #define ZLIB_VER_SUBREVISION 1 /* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms will be added later and will have the same stream interface. Compression can be done in a single step if the buffers are large enough, or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call. The compressed data format used by default by the in-memory functions is the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped around a deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. This library can optionally read and write gzip and raw deflate streams in memory as well. The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- file compression on file systems, has a larger header than zlib to maintain directory information, and uses a different, slower check method than zlib. The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in the case of corrupted input. */ typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size); typedef void (*free_func)(voidpf opaque, voidpf address); struct internal_state; typedef struct z_stream_s { z_const Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total number of input bytes read so far */ Bytef *next_out; /* next output byte will go here */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total number of bytes output so far */ z_const char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: binary or text for deflate, or the decoding state for inflate */ uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; /* gzip header information passed to and from zlib routines. See RFC 1952 for more details on the meanings of these fields. */ typedef struct gz_header_s { int text; /* true if compressed data believed to be text */ uLong time; /* modification time */ int xflags; /* extra flags (not used when writing a gzip file) */ int os; /* operating system */ Bytef *extra; /* pointer to extra field or Z_NULL if none */ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ uInt extra_max; /* space at extra (only when reading header) */ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ uInt name_max; /* space at name (only when reading header) */ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ uInt comm_max; /* space at comment (only when reading header) */ int hcrc; /* true if there was or will be a header crc */ int done; /* true when done reading gzip header (not used when writing a gzip file) */ } gz_header; typedef gz_header FAR *gz_headerp; /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application. The opaque value provided by the application will be passed as the first parameter for calls of zalloc and zfree. This can be useful for custom memory management. The compression library attaches no meaning to the opaque value. zalloc must return Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be thread safe. In that case, zlib is thread-safe. When zalloc and zfree are Z_NULL on entry to the initialization function, they are set to internal routines that use the standard library functions malloc() and free(). On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers returned by zalloc for objects of exactly 65536 bytes *must* have their offset normalized to zero. The default allocation function provided by this library ensures this (see zutil.c). To reduce memory requirements and avoid any allocation of 64K objects, at the expense of compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use by the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ /* constants */ #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 #define Z_SYNC_FLUSH 2 #define Z_FULL_FLUSH 3 #define Z_FINISH 4 #define Z_BLOCK 5 #define Z_TREES 6 /* Allowed flush values; see deflate() and inflate() below for details */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_RLE 3 #define Z_FIXED 4 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 #define Z_TEXT 1 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 /* Possible values of the data_type field for deflate() */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ /* basic functions */ ZEXTERN const char * ZEXPORT zlibVersion(void); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. */ /* ZEXTERN int ZEXPORT deflateInit(z_streamp strm, int level); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default allocation functions. total_in, total_out, adler, and msg are initialized. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6). deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if level is not a valid compression level, or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. deflate performs one or both of the following actions: - Compress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - Generate more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter should be set only when necessary. Some output may be provided even if flush is zero. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating avail_in or avail_out accordingly; avail_out should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. See deflatePending(), which can be used if desired to determine whether or not there is more output in that case. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to decide how much data to accumulate before producing output, in order to maximize compression. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block that is three bits plus filler bits to the next byte, followed by four bytes (00 00 ff ff). If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the output buffer, but the output is not aligned to a byte boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output in order for the decompressor to finish the block before the empty fixed codes block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to seven bits of the current block are held to be written as the next byte after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next block to be emitted. This is for advanced applications that need to control the emission of deflate blocks. If flush is set to Z_FULL_FLUSH, all output is flushed as with Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade compression. If deflate returns with avail_out == 0, this function must be called again with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that avail_out is greater than six when the flush marker begins, in order to avoid repeated flush markers upon calling deflate() again when avail_out == 0. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After deflate has returned Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. Z_FINISH can be used in the first deflate call after deflateInit if all the compression is to be done in a single step. In order to complete in one call, avail_out must be at least the value returned by deflateBound (see below). Then deflate is guaranteed to return Z_STREAM_END. If not enough output space is provided, deflate will not return Z_STREAM_END, and it must be called again as described above. deflate() sets strm->adler to the Adler-32 checksum of all input read so far (that is, total_in bytes). If a gzip stream is being generated, then strm->adler will be the CRC-32 checksum of the input read so far. (See deflateInit2 below.) deflate() may update strm->data_type if it can make a good guess about the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example if next_in or next_out was Z_NULL or the state was inadvertently written over by the application), or Z_BUF_ERROR if no progress is possible (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and deflate() can be called again with more input and more output space to continue compressing. */ ZEXTERN int ZEXPORT deflateEnd(z_streamp strm); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent, Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded). In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* ZEXTERN int ZEXPORT inflateInit(z_streamp strm); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. In the current version of inflate, the provided input is not read or consumed. The allocation of a sliding window will be deferred to the first call of inflate (if the decompression does not complete on the first call). If zalloc and zfree are set to Z_NULL, inflateInit updates them to use default allocation functions. total_in, total_out, adler, and msg are initialized. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit does not perform any decompression. Actual decompression will be done by inflate(). So next_in, and avail_in, next_out, and avail_out are unused and unchanged. The current implementation of inflateInit() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflate(z_streamp strm, int flush); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. inflate performs one or both of the following actions: - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), then next_in and avail_in are updated accordingly, and processing will resume at this point for the next call of inflate(). - Generate more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. If the caller of inflate() does not provide both available input and available output space, it is possible that there will be no progress made. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much output as possible to the output buffer. Z_BLOCK requests that inflate() stop if and when it gets to the next deflate block boundary. When decoding the zlib or gzip format, this will cause inflate() to return immediately after the header and before the first block. When doing a raw inflate, inflate() will go ahead and process the first block, and will return when it gets to the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. To assist in this, on return inflate() always sets strm->data_type to the number of unused bits in the last byte taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or decoding the complete header up to just before the first byte of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of data_type is set, in which case the number of unused bits will be less than eight. data_type is set as noted here every time inflate() returns for all flush options, and so can be used to determine the amount of currently consumed input in bits. The Z_TREES option behaves as Z_BLOCK does, but it also returns when the end of each deflate block header is reached, before any actual data in that block is decoded. This allows the caller to determine the length of the deflate block header for later use in random access within a deflate block. 256 is added to the value of strm->data_type when inflate() returns immediately after reaching the end of the deflate block header. inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all of the uncompressed data for the operation to complete. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The use of Z_FINISH is not required to perform an inflation in one step. However it may be used to inform inflate that a faster approach can be used for the single inflate() call. Z_FINISH also informs inflate to not maintain a sliding window if the stream completes, which reduces inflate's memory footprint. If the stream does not complete, either because not all of the stream is provided or not enough output space is provided, then a sliding window will be allocated and inflate() can be called again to continue the operation as if Z_NO_FLUSH had been used. In this implementation, inflate() always flushes as much output as possible to the output buffer, and always uses the faster approach on the first call. So the effects of the flush parameter in this implementation are on the return value of inflate() as noted below, when inflate() returns early when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of memory for a sliding window when Z_FINISH is used. If a preset dictionary is needed after this call (see inflateSetDictionary below), inflate sets strm->adler to the Adler-32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the Adler-32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described below. At the end of the stream, inflate() checks that its computed Adler-32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() can decompress and check either zlib-wrapped or gzip-wrapped deflate data. The header type is detected automatically, if requested when initializing with inflateInit2(). Any information contained in the gzip header is not retained unless inflateGetHeader() is used. When processing gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output produced so far. The CRC-32 is checked against the gzip trailer, as is the uncompressed length, modulo 2^32. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect check value, in which case strm->msg points to a string with a more specific error), Z_STREAM_ERROR if the stream structure was inconsistent (for example next_in or next_out was Z_NULL, or the state was inadvertently written over by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress was possible or if there was not enough room in the output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and inflate() can be called again with more input and more output space to continue decompressing. If Z_DATA_ERROR is returned, the application may then call inflateSync() to look for a good compression block if a partial recovery of the data is to be attempted. */ ZEXTERN int ZEXPORT inflateEnd(z_streamp strm); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state was inconsistent. */ /* Advanced functions */ /* The following functions are needed only in some special applications. */ /* ZEXTERN int ZEXPORT deflateInit2(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy); This is another version of deflateInit with more compression options. The fields zalloc, zfree and opaque must be initialized before by the caller. The method parameter is the compression method. It must be Z_DEFLATED in this version of the library. The windowBits parameter is the base two logarithm of the window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. Larger values of this parameter result in better compression at the expense of memory usage. The default value is 15 if deflateInit is used instead. For the current implementation of deflate(), a windowBits value of 8 (a window size of 256 bytes) is not supported. As a result, a request for 8 will result in 9 (a 512-byte window). In that case, providing 8 to inflateInit2() will result in an error when the zlib header with 9 is checked against the initialization of inflate(). The remedy is to not use 8 with deflateInit2() with this initialization, or at least in that case use 9 with inflateInit2(). windowBits can also be -8..-15 for raw deflate. In this case, -windowBits determines the window size. deflate() will then generate raw deflate data with no zlib header or trailer, and will not compute a check value. windowBits can also be greater than 15 for optional gzip encoding. Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), no header crc, and the operating system will be set to the appropriate value, if the operating system was determined at compile time. If a gzip stream is being written, strm->adler is a CRC-32 instead of an Adler-32. For raw deflate or gzip encoding, a request for a 256-byte window is rejected as invalid, since only the zlib header provides a means of transmitting the window size to the decompressor. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but is slow and reduces compression ratio; memLevel=9 uses maximum memory for optimal speed. The default value is 8. See zconf.h for total memory usage as a function of windowBits and memLevel. The strategy parameter is used to tune the compression algorithm. Use the value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a filter (or predictor), Z_RLE to limit match distances to one (run-length encoding), or Z_HUFFMAN_ONLY to force Huffman encoding only (no string matching). Filtered data consists mostly of small values with a somewhat random distribution, as produced by the PNG filters. In this case, the compression algorithm is tuned to compress them better. The effect of Z_FILTERED is to force more Huffman coding and less string matching than the default; it is intermediate between Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is almost as fast as Z_HUFFMAN_ONLY, but should give better compression for PNG image data than Huffman only. The degree of string matching from most to none is: Z_DEFAULT_STRATEGY, Z_FILTERED, Z_RLE, then Z_HUFFMAN_ONLY. The strategy parameter affects the compression ratio but never the correctness of the compressed output, even if it is not set optimally for the given data. Z_FIXED uses the default string matching, but prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit2 does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. When using the zlib format, this function must be called immediately after deflateInit, deflateInit2 or deflateReset, and before any call of deflate. When doing raw deflate, this function must be called either before any call of deflate, or immediately after the completion of a deflate block, i.e. after all input has been consumed and all output has been delivered when using any of the flush options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). The dictionary should consist of strings (byte sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be predicted with good accuracy; the data can then be compressed better than with the default empty dictionary. Depending on the size of the compression data structures selected by deflateInit or deflateInit2, a part of the dictionary may in effect be discarded, for example if the dictionary is larger than the window size provided in deflateInit or deflateInit2. Thus the strings most likely to be useful should be put at the end of the dictionary, not at the front. In addition, the current implementation of deflate will use at most the window size minus 262 bytes of the provided dictionary. Upon return of this function, strm->adler is set to the Adler-32 value of the dictionary; the decompressor may later use this value to determine which dictionary has been used by the compressor. (The Adler-32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) If a raw deflate was requested, then the Adler-32 value is not computed and strm->adler is not set. deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent (for example if deflate has already been called for this stream or if not at a block boundary for raw deflate). deflateSetDictionary does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm, Bytef *dictionary, uInt *dictLength); /* Returns the sliding dictionary being maintained by deflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If deflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. Similarly, if dictLength is Z_NULL, then it is not set. deflateGetDictionary() may return a length less than the window size, even when more than the window size in input has been provided. It may return up to 258 bytes less in that case, due to how zlib's implementation of deflate manages the sliding window and lookahead for matches, where matches can be up to 258 bytes long. If the application needs the last window-size bytes of input, then that would need to be saved by the application outside of zlib. deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the stream state is inconsistent. */ ZEXTERN int ZEXPORT deflateCopy(z_streamp dest, z_streamp source); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when several compression strategies will be tried, for example when there are several ways of pre-processing the input data with a filter. The streams that will be discarded should then be freed by calling deflateEnd. Note that deflateCopy duplicates the internal compression state which can be quite large, so this strategy is slow and can consume lots of memory. deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT deflateReset(z_streamp strm); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate the internal compression state. The stream will leave the compression level and any other attributes that may have been set unchanged. total_in, total_out, adler, and msg are initialized. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT deflateParams(z_streamp strm, int level, int strategy); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2(). This can be 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 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(), and it does not have enough output space to complete, then the parameter change will not take effect. In this case, deflateParams() can be called again with the same parameters and more output space to try again. In order to assure a change in the parameters on the first try, the deflate stream should be flushed using deflate() with Z_BLOCK or other flush request until strm.avail_out is not zero, before calling deflateParams(). Then no more input data should be provided before the deflateParams() call. If this is done, the old level and strategy will be applied to the data compressed before deflateParams(), and the new level and strategy will be applied to the data compressed after deflateParams(). deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if there was not enough output space to complete the compression of the available input data before a change in the strategy or approach. Note that in the case of a Z_BUF_ERROR, the parameters are not changed. A return value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be retried with more output space. */ ZEXTERN int ZEXPORT deflateTune(z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for searching for the best matching string, and even then only by the most fanatic optimizer trying to squeeze out the last compressed bit for their specific input data. Read the deflate.c source code for the meaning of the max_lazy, good_length, nice_length, and max_chain parameters. deflateTune() can be called after deflateInit() or deflateInit2(), and returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or deflateInit2(), and after deflateSetHeader(), if used. This would be used to allocate an output buffer for deflation in a single pass, and so would be called before deflate(). If that first deflate() call is provided the sourceLen input bytes, an output buffer allocated to the size returned by deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed to return Z_STREAM_END. Note that it is possible for the compressed size to be larger than the value returned by deflateBound() if flush options other than Z_FINISH or Z_NO_FLUSH are used. */ ZEXTERN int ZEXPORT deflatePending(z_streamp strm, unsigned *pending, int *bits); /* deflatePending() returns the number of bytes and bits of output that have been generated, but not yet provided in the available output. The bytes not provided would be due to the available output space having being consumed. The number of bits of output not provided are between 0 and 7, where they await more bits to join them in order to fill out a full byte. If pending or bits are Z_NULL, then those values are not set. deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflateUsed(z_streamp strm, int *bits); /* deflateUsed() returns in *bits the most recent number of deflate bits used in the last byte when flushing to a byte boundary. The result is in 1..8, or 0 if there has not yet been a flush. This helps determine the location of the last bit of a deflate stream. deflateUsed returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflatePrime(z_streamp strm, int bits, int value); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits leftover from a previous deflate stream when appending to it. As such, this function can only be used for raw deflate, and must be used before the first deflate() call after a deflateInit2() or deflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the output. deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflateSetHeader(z_streamp strm, gz_headerp head); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called after deflateInit2() or deflateReset() and before the first call of deflate(). The text, time, os, extra field, name, and comment information in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with a zero byte, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, the time set to zero, and os set to the current operating system, with no extra, name, or comment fields. The gzip header is returned to the default state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateInit2(z_streamp strm, int windowBits); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. The windowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The default value is 15 if inflateInit is used instead. windowBits must be greater than or equal to the windowBits value provided to deflateInit2() while compressing, or it must be equal to 15 if deflateInit2() was not used. If a compressed stream with a larger window size is given as input, inflate() will return with the error code Z_DATA_ERROR instead of trying to allocate a larger window. windowBits can also be zero to request that inflate use the window size in the zlib header of the compressed stream. windowBits can also be -8..-15 for raw inflate. In this case, -windowBits determines the window size. inflate() will then process raw deflate data, not looking for a zlib or gzip header, not generating a check value, and not looking for any check values for comparison at the end of the stream. This is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. If a custom format is developed using the raw deflate format for compressed data, it is recommended that a check value such as an Adler-32 or a CRC-32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits. windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see below), inflate() will *not* automatically decode concatenated gzip members. inflate() will return Z_STREAM_END at the end of the gzip member. The state would need to be reset to continue decoding a subsequent gzip member. This *must* be done if there is more data after a gzip member, in order for the decompression to be compliant with the gzip standard (RFC 1952). inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit2 does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit2() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the Adler-32 value returned by that call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). For raw inflate, this function can be called at any time to set the dictionary. If the provided dictionary is smaller than the window and there is already data in the window, then the provided dictionary will amend what's there. The application must insure that the dictionary that was used for compression is provided. inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the expected one (incorrect Adler-32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ ZEXTERN int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary, uInt *dictLength); /* Returns the sliding dictionary being maintained by inflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If inflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. Similarly, if dictLength is Z_NULL, then it is not set. inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the stream state is inconsistent. */ ZEXTERN int ZEXPORT inflateSync(z_streamp strm); /* Skips invalid compressed data until a possible full flush point (see above for the description of deflate with Z_FULL_FLUSH) can be found, or until all available input is skipped. No output is provided. inflateSync searches for a 00 00 FF FF pattern in the compressed data. All full flush points have this pattern, but not all occurrences of this pattern are full flush points. inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the success case, the application may save the current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, z_streamp source); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when randomly accessing a large stream. The first pass through the stream can periodically record the inflate state, allowing restarting inflate at those points when randomly accessing the stream. inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT inflateReset(z_streamp strm); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. total_in, total_out, adler, and msg are initialized. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT inflateReset2(z_streamp strm, int windowBits); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted the same as it is for inflateInit2. If the window size is changed, then the memory allocated for the window is freed, and the window will be reallocated by inflate() if needed. inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL), or if the windowBits parameter is invalid. */ ZEXTERN int ZEXPORT inflatePrime(z_streamp strm, int bits, int value); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the middle of a byte. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the input. If bits is negative, then the input stream bit buffer is emptied. Then inflatePrime() can be called again to put bits in the buffer. This is used to clear out bits leftover after feeding inflate a block description prior to feeding inflate codes. inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN long ZEXPORT inflateMark(z_streamp strm); /* This function returns two values, one in the lower 16 bits of the return value, and the other in the remaining upper bits, obtained by shifting the return value down 16 bits. If the upper value is -1 and the lower value is zero, then inflate() is currently decoding information outside of a block. If the upper value is -1 and the lower value is non-zero, then inflate is in the middle of a stored block, with the lower value equaling the number of bytes from the input remaining to copy. If the upper value is not -1, then it is the number of bits back from the current bit position in the input of the code (literal or length/distance pair) currently being processed. In that case the lower value is the number of bytes already emitted for that code. A code is being processed if inflate is waiting for more input to complete decoding of the code, or if it has completed decoding but is waiting for more output space to write the literal or match data. inflateMark() is used to mark locations in the input data for random access, which may be at bit positions, and to note those cases where the output of a code may span boundaries of random access blocks. The current location in the input stream can be determined from avail_in and data_type as noted in the description for the Z_BLOCK flush parameter for inflate. inflateMark returns the value noted above, or -65536 if the provided source stream state was inconsistent. */ ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after inflateInit2() or inflateReset(), and before the first call of inflate(). As inflate() processes the gzip stream, head->done is zero until the header is completed, at which time head->done is set to one. If a zlib stream is being decoded, then head->done is set to -1 to indicate that there will be no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be used to force inflate() to return immediately after header processing is complete and before any actual data is decompressed. The text, time, xflags, and os fields are filled in with the gzip header contents. hcrc is set to true if there is a header CRC. (The header CRC was valid if done is set to one.) If extra is not Z_NULL, then extra_max contains the maximum number of bytes to write to extra. Once done is true, extra_len contains the actual extra field length, and extra contains the extra field, or that field truncated if extra_max is less than extra_len. If name is not Z_NULL, then up to name_max characters are written there, terminated with a zero unless the length is greater than name_max. If comment is not Z_NULL, then up to comm_max characters are written there, terminated with a zero unless the length is greater than comm_max. When any of extra, name, or comment are not Z_NULL and the respective field is not present in the header, then that field is set to Z_NULL to signal its absence. This allows the use of deflateSetHeader() with the returned structure to duplicate the header. However if those fields are set to allocated memory, then the application will need to save those pointers elsewhere so that they can be eventually freed. If inflateGetHeader is not used, then the header information is simply discarded. The header is always checked for validity, including the header CRC if present. inflateReset() will reset the process to discard the header information. The application would need to call inflateGetHeader() again to retrieve the header from the next gzip stream. inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateBackInit(z_streamp strm, int windowBits, unsigned char FAR *window); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized before the call. If zalloc and zfree are Z_NULL, then the default library- derived memory allocation routines are used. windowBits is the base two logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 and a 32K byte window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of the parameters are invalid, Z_MEM_ERROR if the internal state could not be allocated, or Z_VERSION_ERROR if the version of the library does not match the version of the header file. */ typedef unsigned (*in_func)(void FAR *, z_const unsigned char FAR * FAR *); typedef int (*out_func)(void FAR *, unsigned char FAR *, unsigned); ZEXTERN int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is potentially more efficient than inflate() for file i/o applications, in that it avoids copying between the output and the sliding window by simply making the window itself the output buffer. inflate() can be faster on modern CPUs when used with large buffers. inflateBack() trusts the application to not change the output buffer passed by the output function, at least until inflateBack() returns. inflateBackInit() must be called first to allocate the internal state and to initialize the state with the user-provided window buffer. inflateBack() may then be used multiple times to inflate a complete, raw deflate stream with each call. inflateBackEnd() is then called to free the allocated state. A raw deflate stream is one with no zlib or gzip header or trailer. This routine would normally be used in a utility that reads zip or gzip files and writes out uncompressed files. The utility would decode the header and process the trailer on its own, hence this routine expects only the raw deflate stream to decompress. This is different from the default behavior of inflate(), which expects a zlib header and trailer around the deflate stream. inflateBack() uses two subroutines supplied by the caller that are then called by inflateBack() for input and output. inflateBack() calls those routines until it reads a complete deflate stream and writes out all of the uncompressed data, or until it encounters an error. The function's parameters and return types are defined above in the in_func and out_func typedefs. inflateBack() will call in(in_desc, &buf) which should return the number of bytes of provided input, and a pointer to that input in buf. If there is no input available, in() must return zero -- buf is ignored in that case -- and inflateBack() will return a buffer error. inflateBack() will call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() should return zero on success, or non-zero on failure. If out() returns non-zero, inflateBack() will return with an error. Neither in() nor out() are permitted to change the contents of the window provided to inflateBackInit(), which is also the buffer that out() uses to write from. The length written by out() will be at most the window size. Any non-zero amount of input may be provided by in(). For convenience, inflateBack() can be provided input on the first call by setting strm->next_in and strm->avail_in. If that input is exhausted, then in() will be called. Therefore strm->next_in must be initialized before calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in must also be initialized, and then if strm->avail_in is not zero, input will initially be taken from strm->next_in[0 .. strm->avail_in - 1]. The in_desc and out_desc parameters of inflateBack() is passed as the first parameter of in() and out() respectively when they are called. These descriptors can be optionally used to pass any information that the caller- supplied in() and out() functions need to do their job. On return, inflateBack() will set strm->next_in and strm->avail_in to pass back any unused input that was provided by the last in() call. The return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR if in() or out() returned an error, Z_DATA_ERROR if there was a format error in the deflate stream (in which case strm->msg is set to indicate the nature of the error), or Z_STREAM_ERROR if the stream was not properly initialized. In the case of Z_BUF_ERROR, an input or output error can be distinguished using strm->next_in which will be Z_NULL only if in() returned an error. If strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning non-zero. (in() will always be called before out(), so strm->next_in is assured to be defined if out() returns non-zero.) Note that inflateBack() cannot return Z_OK. */ ZEXTERN int ZEXPORT inflateBackEnd(z_streamp strm); /* All memory allocated by inflateBackInit() is freed. inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream state was inconsistent. */ ZEXTERN uLong ZEXPORT zlibCompileFlags(void); /* Return flags indicating compile-time options. Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: 1.0: size of uInt 3.2: size of uLong 5.4: size of voidpf (pointer) 7.6: size of z_off_t Compiler, assembler, and debug options: 8: ZLIB_DEBUG 9: ASMV or ASMINF -- use ASM code 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention 11: 0 (reserved) One-time table building (smaller code, but not thread-safe if true): 12: BUILDFIXED -- build static block decoding tables when needed 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed 14,15: 0 (reserved) Library content (indicates missing functionality): 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking deflate code when not needed) 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect and decode gzip streams (to avoid linking crc code) 18-19: 0 (reserved) Operation variations (changes in library functionality): 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate 21: FASTEST -- deflate algorithm with only one, lowest compression level 22,23: 0 (reserved) The sprintf variant used by gzprintf (zero is best): 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! 26: 0 = returns value, 1 = void -- 1 means inferred string length returned Remainder: 27-31: 0 (reserved) */ #ifndef Z_SOLO /* utility functions */ /* The following utility functions are implemented on top of the basic stream-oriented functions. To simplify the interface, some default options are assumed (compression level and memory usage, standard memory allocation functions). The source code of these utility functions can be modified if you need special options. */ ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed data. compress() is equivalent to compress2() with a level parameter of Z_DEFAULT_COMPRESSION. compress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer. */ ZEXTERN int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed data. compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ ZEXTERN uLong ZEXPORT compressBound(uLong sourceLen); /* compressBound() returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes. It would be used before a compress() or compress2() call to allocate the destination buffer. */ ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library.) Upon exit, destLen is the actual size of the uncompressed data. uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In the case where there is not enough room, uncompress() will fill the output buffer with the uncompressed data up to that point. */ ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong *sourceLen); /* Same as uncompress, except that sourceLen is a pointer, where the length of the source is *sourceLen. On return, *sourceLen is the number of source bytes consumed. */ /* gzip file access functions */ /* This library supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio, using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. */ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ /* ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode); Open the gzip (.gz) file at path for reading and decompressing, or compressing and writing. The mode parameter is as in fopen ("rb" or "wb") but can also include a compression level ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression as in "wb9F". (See the description of deflateInit2 for more information about the strategy parameter.) 'T' will request transparent writing or appending with no compression and not using the gzip format. "a" can be used instead of "w" to request that the gzip stream that will be written be appended to the file. "+" will result in an error, since reading and writing to the same gzip file is not supported. The addition of "x" when writing will create the file exclusively, which fails if the file already exists. On systems that support it, the addition of "e" when reading or writing will set the flag to close the file on an execve() call. These functions, as well as gzip, will read and decode a sequence of gzip streams in a file. The append function of gzopen() can be used to create such a file. (Also see gzflush() for another way to do this.) When appending, gzopen does not test whether the file begins with a gzip stream, nor does it look for the end of the gzip streams to begin appending. gzopen will simply append a gzip stream to the existing file. gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. When reading, this will be detected automatically by looking for the magic two- byte gzip header. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). errno can be checked to determine if the reason gzopen failed was that the file could not be opened. */ ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode); /* Associate a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or fileno (if the file has been previously opened with fopen). The mode parameter is as in gzopen. The next call of gzclose on the returned gzFile will also close the file descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, mode);. The duplicated descriptor should be saved to avoid a leak, since gzdopen does not close fd if it fails. If you are using fileno() to get the file descriptor from a FILE *, then you will have to use dup() to avoid double-close()ing the file descriptor. Both gzclose() and fclose() will close the associated file descriptor, so they need to have different file descriptors. gzdopen returns NULL if there was insufficient memory to allocate the gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided), or if fd is -1. The file descriptor is not used until the next gz* read, write, seek, or close operation, so gzdopen will not detect if fd is invalid (unless fd is -1). */ ZEXTERN int ZEXPORT gzbuffer(gzFile file, unsigned size); /* Set the internal buffer size used by this library's functions for file to size. The default buffer size is 8192 bytes. This function must be called after gzopen() or gzdopen(), and before any other calls that read or write the file. The buffer memory allocation is always deferred to the first read or write. Three times that size in buffer space is allocated. A larger buffer size of, for example, 64K or 128K bytes will noticeably increase the speed of decompression (reading). The new buffer size also affects the maximum length for gzprintf(). gzbuffer() returns 0 on success, or -1 on failure, such as being called too late. */ ZEXTERN int ZEXPORT gzsetparams(gzFile file, int level, int strategy); /* Dynamically update the compression level and strategy for file. See the description of deflateInit2 for the meaning of these parameters. Previously provided data is flushed before applying the parameter changes. gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not opened for writing, Z_ERRNO if there is an error writing the flushed data, or Z_MEM_ERROR if there is a memory allocation error. */ ZEXTERN int ZEXPORT gzread(gzFile file, voidp buf, unsigned len); /* Read and decompress up to len uncompressed bytes from file into buf. If the input file is not in gzip format, gzread copies the given number of bytes into the buffer directly from the file. After reaching the end of a gzip stream in the input, gzread will continue to read, looking for another gzip stream. Any number of gzip streams may be concatenated in the input file, and will all be decompressed by gzread(). If something other than a gzip stream is encountered after a gzip stream, that remaining trailing garbage is ignored (and no error is returned). gzread can be used to read a gzip file that is being concurrently written. Upon reaching the end of the input, gzread will return with the available data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then gzclearerr can be used to clear the end of file indicator in order to permit gzread to be tried again. Z_OK indicates that a gzip stream was completed on the last gzread. Z_BUF_ERROR indicates that the input file ended in the middle of a gzip stream. Note that gzread does not return -1 in the event of an incomplete gzip stream. This error is deferred until gzclose(), which will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip stream. Alternatively, gzerror can be used before gzclose to detect this case. gzread returns the number of uncompressed bytes actually read, less than len for end of file, or -1 for error. If len is too large to fit in an int, then nothing is read, -1 is returned, and the error state is set to Z_STREAM_ERROR. */ ZEXTERN z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, gzFile file); /* Read and decompress up to nitems items of size size from file into buf, otherwise operating as gzread() does. This duplicates the interface of stdio's fread(), with size_t request and return types. If the library defines size_t, then z_size_t is identical to size_t. If not, then z_size_t is an unsigned integer type that can contain a pointer. gzfread() returns the number of full items read of size size, or zero if the end of the file was reached and a full item could not be read, or if there was an error. gzerror() must be consulted if zero is returned in order to determine if there was an error. If the multiplication of size and nitems overflows, i.e. the product does not fit in a z_size_t, then nothing is read, zero is returned, and the error state is set to Z_STREAM_ERROR. In the event that the end of file is reached and only a partial item is available at the end, i.e. the remaining uncompressed data length is not a multiple of size, then the final partial item is nevertheless read into buf and the end-of-file flag is set. The length of the partial item read is not provided, but could be inferred from the result of gztell(). This behavior is the same as the behavior of fread() implementations in common libraries, but it prevents the direct use of gzfread() to read a concurrently written file, resetting and retrying on end-of-file, when size is not 1. */ ZEXTERN int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len); /* Compress and write the len uncompressed bytes at buf to file. gzwrite returns the number of uncompressed bytes written or 0 in case of error. */ ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, z_size_t nitems, gzFile file); /* Compress and write nitems items of size size from buf to file, duplicating the interface of stdio's fwrite(), with size_t request and return types. If the library defines size_t, then z_size_t is identical to size_t. If not, then z_size_t is an unsigned integer type that can contain a pointer. gzfwrite() returns the number of full items written of size size, or zero if there was an error. If the multiplication of size and nitems overflows, i.e. the product does not fit in a z_size_t, then nothing is written, zero is returned, and the error state is set to Z_STREAM_ERROR. */ ZEXTERN int ZEXPORTVA gzprintf(gzFile file, const char *format, ...); /* Convert, format, compress, and write the arguments (...) to file under control of the string format, as in fprintf. gzprintf returns the number of uncompressed bytes actually written, or a negative zlib error code in case of error. The number of uncompressed bytes written is limited to 8191, or one less than the buffer size given to gzbuffer(). The caller should assure that this limit is not exceeded. If it is exceeded, then gzprintf() will return an error (0) with nothing written. In this case, there may also be a buffer overflow with unpredictable consequences, which is possible only if zlib was compiled with the insecure functions sprintf() or vsprintf(), because the secure snprintf() or vsnprintf() functions were not available. This can be determined using zlibCompileFlags(). */ ZEXTERN int ZEXPORT gzputs(gzFile file, const char *s); /* Compress and write the given null-terminated string s to file, excluding the terminating null character. gzputs returns the number of characters written, or -1 in case of error. */ ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len); /* Read and decompress bytes from file into buf, until len-1 characters are read, or until a newline character is read and transferred to buf, or an end-of-file condition is encountered. If any characters are read or if len is one, the string is terminated with a null character. If no characters are read due to an end-of-file or len is less than one, then the buffer is left untouched. gzgets returns buf which is a null-terminated string, or it returns NULL for end-of-file or in case of error. If there was an error, the contents at buf are indeterminate. */ ZEXTERN int ZEXPORT gzputc(gzFile file, int c); /* Compress and write c, converted to an unsigned char, into file. gzputc returns the value that was written, or -1 in case of error. */ ZEXTERN int ZEXPORT gzgetc(gzFile file); /* Read and decompress one byte from file. gzgetc returns this byte or -1 in case of end of file or error. This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file is NULL, nor whether the structure file points to has been clobbered or not. */ ZEXTERN int ZEXPORT gzungetc(int c, gzFile file); /* Push c back onto the stream for file to be read as the first character on the next read. At least one character of push-back is always allowed. gzungetc() returns the character pushed, or -1 on failure. gzungetc() will fail if c is -1, and may fail if a character has been pushed but not read yet. If gzungetc is used immediately after gzopen or gzdopen, at least the output buffer size of pushed characters is allowed. (See gzbuffer above.) The pushed character will be discarded if the stream is repositioned with gzseek() or gzrewind(). */ ZEXTERN int ZEXPORT gzflush(gzFile file, int flush); /* Flush all pending output to file. The parameter flush is as in the deflate() function. The return value is the zlib error number (see function gzerror below). gzflush is only permitted when writing. If the flush parameter is Z_FINISH, the remaining data is written and the gzip stream is completed in the output. If gzwrite() is called again, a new gzip stream will be started in the output. gzread() is able to read such concatenated gzip streams. gzflush should be called only when strictly necessary because it will degrade compression if called too often. */ /* ZEXTERN z_off_t ZEXPORT gzseek(gzFile file, z_off_t offset, int whence); Set the starting position to offset relative to whence for the next gzread or gzwrite on file. The offset represents a number of bytes in the uncompressed data stream. The whence parameter is defined as in lseek(2); the value SEEK_END is not supported. If the file is opened for reading, this function is emulated but can be extremely slow. If the file is opened for writing, only forward seeks are supported; gzseek then compresses a sequence of zeroes up to the new starting position. gzseek returns the resulting offset location as measured in bytes from the beginning of the uncompressed stream, or -1 in case of error, in particular if the file is opened for writing and the new starting position would be before the current position. */ ZEXTERN int ZEXPORT gzrewind(gzFile file); /* Rewind file. This function is supported only for reading. gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET). */ /* ZEXTERN z_off_t ZEXPORT gztell(gzFile file); Return the starting position for the next gzread or gzwrite on file. This position represents a number of bytes in the uncompressed data stream, and is zero when starting, even if appending or reading a gzip stream from the middle of a file using gzdopen(). gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) */ /* ZEXTERN z_off_t ZEXPORT gzoffset(gzFile file); Return the current compressed (actual) read or write offset of file. This offset includes the count of bytes that precede the gzip stream, for example when appending or when using gzdopen() for reading. When reading, the offset does not include as yet unused buffered input. This information can be used for a progress indicator. On error, gzoffset() returns -1. */ ZEXTERN int ZEXPORT gzeof(gzFile file); /* Return true (1) if the end-of-file indicator for file has been set while reading, false (0) otherwise. Note that the end-of-file indicator is set only if the read tried to go past the end of the input, but came up short. Therefore, just like feof(), gzeof() may return false even if there is no more data to read, in the event that the last read request was for the exact number of bytes remaining in the input file. This will happen if the input file size is an exact multiple of the buffer size. If gzeof() returns true, then the read functions will return no more data, unless the end-of-file indicator is reset by gzclearerr() and the input file has grown since the previous end of file was detected. */ ZEXTERN int ZEXPORT gzdirect(gzFile file); /* Return true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. If the input file is empty, gzdirect() will return true, since the input does not contain a gzip stream. If gzdirect() is used immediately after gzopen() or gzdopen() it will cause buffers to be allocated to allow reading the file to determine if it is a gzip file. Therefore if gzbuffer() is used, it should be called before gzdirect(). When writing, gzdirect() returns true (1) if transparent writing was requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: gzdirect() is not needed when writing. Transparent writing must be explicitly requested, so the application already knows the answer. When linking statically, using gzdirect() will include all of the zlib code for gzip file reading and decompression, which may not be desired.) */ ZEXTERN int ZEXPORT gzclose(gzFile file); /* Flush all pending output for file, if necessary, close file and deallocate the (de)compression state. Note that once file is closed, you cannot call gzerror with file, since its structures have been deallocated. gzclose must not be called more than once on the same file, just as free must not be called more than once on the same allocation. gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the last read ended in the middle of a gzip stream, or Z_OK on success. */ ZEXTERN int ZEXPORT gzclose_r(gzFile file); ZEXTERN int ZEXPORT gzclose_w(gzFile file); /* Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when writing or appending. The advantage to using these instead of gzclose() is that they avoid linking in zlib compression or decompression code that is not used when only reading or only writing respectively. If gzclose() is used, then both compression and decompression code will be included the application when linking to a static zlib library. */ ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum); /* Return the error message for the last error which occurred on file. errnum is set to zlib error number. If an error occurred in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. The application must not modify the returned string. Future calls to this function may invalidate the previously returned string. If file is closed, then the string previously returned by gzerror will no longer be available. gzerror() should be used to distinguish errors from end-of-file for those functions above that do not distinguish those cases in their return values. */ ZEXTERN void ZEXPORT gzclearerr(gzFile file); /* Clear the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip file that is being written concurrently. */ #endif /* !Z_SOLO */ /* checksum functions */ /* These functions are not related to compression but are exported anyway because they might be useful in applications using the compression library. */ ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. An Adler-32 value is in the range of a 32-bit unsigned integer. If buf is Z_NULL, this function returns the required initial value for the checksum. An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed much faster. Usage example: uLong adler = adler32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); } if (adler != original_adler) error(); */ ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len); /* Same as adler32(), but with a size_t length. */ /* ZEXTERN uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2); Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note that the z_off_t type (like off_t) is a signed integer. If len2 is negative, the result has no meaning or utility. */ ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. If buf is Z_NULL, this function returns the required initial value for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application. Usage example: uLong crc = crc32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { crc = crc32(crc, buffer, length); } if (crc != original_crc) error(); */ ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf, z_size_t len); /* Same as crc32(), but with a size_t length. */ /* ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2); Combine two CRC-32 check values into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and len2. len2 must be non-negative. */ /* ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with crc32_combine_op(). len2 must be non-negative. */ ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); /* Give the same result as crc32_combine(), using op in place of len2. op is is generated from len2 by crc32_combine_gen(). This will be faster than crc32_combine() if the generated op is used more than once. */ /* various hacks, don't look :) */ /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level, const char *version, int stream_size); ZEXTERN int ZEXPORT inflateInit_(z_streamp strm, const char *version, int stream_size); ZEXTERN int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size); ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, const char *version, int stream_size); ZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, unsigned char FAR *window, const char *version, int stream_size); #ifdef Z_PREFIX_SET # define z_deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) # define z_inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) # define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) # define z_inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ (int)sizeof(z_stream)) # define z_inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, (int)sizeof(z_stream)) #else # define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) # define inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) # define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) # define inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ (int)sizeof(z_stream)) # define inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, (int)sizeof(z_stream)) #endif #ifndef Z_SOLO /* gzgetc() macro and its supporting function and exposed data structure. Note * that the real internal state is much larger than the exposed structure. * This abbreviated structure exposes just enough for the gzgetc() macro. The * user should not mess with these exposed elements, since their names or * behavior could change in the future, perhaps even capriciously. They can * only be used by the gzgetc() macro. You have been warned. */ struct gzFile_s { unsigned have; unsigned char *next; z_off64_t pos; }; ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */ #ifdef Z_PREFIX_SET # undef z_gzgetc # define z_gzgetc(g) \ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #else # define gzgetc(g) \ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #endif /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if * both are true, the application gets the *64 functions, and the regular * functions are changed to 64 bits) -- in case these are set on systems * without large file support, _LFS64_LARGEFILE must also be true */ #ifdef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int); ZEXTERN z_off64_t ZEXPORT gztell64(gzFile); ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile); ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t); ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t); ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t); #endif #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) # ifdef Z_PREFIX_SET # define z_gzopen z_gzopen64 # define z_gzseek z_gzseek64 # define z_gztell z_gztell64 # define z_gzoffset z_gzoffset64 # define z_adler32_combine z_adler32_combine64 # define z_crc32_combine z_crc32_combine64 # define z_crc32_combine_gen z_crc32_combine_gen64 # else # define gzopen gzopen64 # define gzseek gzseek64 # define gztell gztell64 # define gzoffset gzoffset64 # define adler32_combine adler32_combine64 # define crc32_combine crc32_combine64 # define crc32_combine_gen crc32_combine_gen64 # endif # ifndef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int); ZEXTERN z_off_t ZEXPORT gztell64(gzFile); ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile); ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t); ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t); ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t); # endif #else ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *); ZEXTERN z_off_t ZEXPORT gzseek(gzFile, z_off_t, int); ZEXTERN z_off_t ZEXPORT gztell(gzFile); ZEXTERN z_off_t ZEXPORT gzoffset(gzFile); ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); #endif #else /* Z_SOLO */ ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); #endif /* !Z_SOLO */ /* undocumented functions */ ZEXTERN const char * ZEXPORT zError(int); ZEXTERN int ZEXPORT inflateSyncPoint(z_streamp); ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void); ZEXTERN int ZEXPORT inflateUndermine(z_streamp, int); ZEXTERN int ZEXPORT inflateValidate(z_streamp, int); ZEXTERN unsigned long ZEXPORT inflateCodesUsed(z_streamp); ZEXTERN int ZEXPORT inflateResetKeep(z_streamp); ZEXTERN int ZEXPORT deflateResetKeep(z_streamp); #if defined(_WIN32) && !defined(Z_SOLO) ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path, const char *mode); #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO ZEXTERN int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va); # endif #endif #ifdef __cplusplus } #endif #endif /* ZLIB_H */chibicc-1.0.24/test/zutil.h000077500000000000000000000161041517770275000155010ustar00rootroot00000000000000/* zutil.h -- internal interface and configuration of the compression library * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ /* @(#) $Id$ */ #ifndef ZUTIL_H #define ZUTIL_H #ifdef HAVE_HIDDEN # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) #else # define ZLIB_INTERNAL #endif #include "zlib.h" #if defined(STDC) && !defined(Z_SOLO) # if !(defined(_WIN32_WCE) && defined(_MSC_VER)) # include # endif # include # include #endif #ifndef local # define local static #endif /* since "static" is used to mean two completely different things in C, we define "local" for the non-static meaning of "static", for readability (compile with -Dlocal if your debugger can't find static symbols) */ typedef unsigned char uch; typedef uch FAR uchf; typedef unsigned short ush; typedef ush FAR ushf; typedef unsigned long ulg; #if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC) # include # if (ULONG_MAX == 0xffffffffffffffff) # define Z_U8 unsigned long # elif (ULLONG_MAX == 0xffffffffffffffff) # define Z_U8 unsigned long long # elif (UINT_MAX == 0xffffffffffffffff) # define Z_U8 unsigned # endif #endif extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] #define ERR_RETURN(strm,err) \ return (strm->msg = ERR_MSG(err), (err)) /* To be used only when the state is known to be valid */ /* common constants */ #ifndef DEF_WBITS # define DEF_WBITS MAX_WBITS #endif /* default windowBits for decompression. MAX_WBITS is for compression only */ #if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 #else # define DEF_MEM_LEVEL MAX_MEM_LEVEL #endif /* default memLevel */ #define STORED_BLOCK 0 #define STATIC_TREES 1 #define DYN_TREES 2 /* The three kinds of block type */ #define MIN_MATCH 3 #define MAX_MATCH 258 /* The minimum and maximum match lengths */ #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ /* target dependencies */ #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) # define OS_CODE 0x00 # ifndef Z_SOLO # if defined(__TURBOC__) || defined(__BORLANDC__) # if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) /* Allow compilation with ANSI keywords only enabled */ void _Cdecl farfree( void *block ); void *_Cdecl farmalloc( unsigned long nbytes ); # else # include # endif # else /* MSC or DJGPP */ # include # endif # endif #endif #ifdef AMIGA # define OS_CODE 1 #endif #if defined(VAXC) || defined(VMS) # define OS_CODE 2 # define F_OPEN(name, mode) \ fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") #endif #ifdef __370__ # if __TARGET_LIB__ < 0x20000000 # define OS_CODE 4 # elif __TARGET_LIB__ < 0x40000000 # define OS_CODE 11 # else # define OS_CODE 8 # endif #endif #if defined(ATARI) || defined(atarist) # define OS_CODE 5 #endif #ifdef OS2 # define OS_CODE 6 # if defined(M_I86) && !defined(Z_SOLO) # include # endif #endif #if defined(MACOS) || defined(TARGET_OS_MAC) # define OS_CODE 7 # ifndef Z_SOLO # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include /* for fdopen */ # else # ifndef fdopen # define fdopen(fd,mode) NULL /* No fdopen() */ # endif # endif # endif #endif #ifdef __acorn # define OS_CODE 13 #endif #if defined(WIN32) && !defined(__CYGWIN__) # define OS_CODE 10 #endif #ifdef _BEOS_ # define OS_CODE 16 #endif #ifdef __TOS_OS400__ # define OS_CODE 18 #endif #ifdef __APPLE__ # define OS_CODE 19 #endif #if defined(_BEOS_) || defined(RISCOS) # define fdopen(fd,mode) NULL /* No fdopen() */ #endif #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX # if defined(_WIN32_WCE) # define fdopen(fd,mode) NULL /* No fdopen() */ # else # define fdopen(fd,type) _fdopen(fd,type) # endif #endif #if defined(__BORLANDC__) && !defined(MSDOS) #pragma warn -8004 #pragma warn -8008 #pragma warn -8066 #endif /* provide prototypes for these when building zlib without LFS */ #if !defined(_WIN32) && \ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); #endif /* common defaults */ #ifndef OS_CODE # define OS_CODE 3 /* assume Unix */ #endif #ifndef F_OPEN # define F_OPEN(name, mode) fopen((name), (mode)) #endif /* functions */ #if defined(pyr) || defined(Z_SOLO) # define NO_MEMCPY #endif #if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) /* Use our own functions for small and medium model with MSC <= 5.0. * You may have to use the same strategy for Borland C (untested). * The __SC__ check is for Symantec. */ # define NO_MEMCPY #endif #if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) # define HAVE_MEMCPY #endif #ifdef HAVE_MEMCPY # ifdef SMALL_MEDIUM /* MSDOS small or medium model */ # define zmemcpy _fmemcpy # define zmemcmp _fmemcmp # define zmemzero(dest, len) _fmemset(dest, 0, len) # else # define zmemcpy memcpy # define zmemcmp memcmp # define zmemzero(dest, len) memset(dest, 0, len) # endif #else void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); #endif /* Diagnostic functions */ #ifdef ZLIB_DEBUG # include extern int ZLIB_INTERNAL z_verbose; extern void ZLIB_INTERNAL z_error OF((char *m)); # define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Trace(x) {if (z_verbose>=0) fprintf x ;} # define Tracev(x) {if (z_verbose>0) fprintf x ;} # define Tracevv(x) {if (z_verbose>1) fprintf x ;} # define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} # define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} #else # define Assert(cond,msg) # define Trace(x) # define Tracev(x) # define Tracevv(x) # define Tracec(c,x) # define Tracecv(c,x) #endif #ifndef Z_SOLO voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, unsigned size)); void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); #endif #define ZALLOC(strm, items, size) \ (*((strm)->zalloc))((strm)->opaque, (items), (size)) #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) #define TRY_FREE(s, p) {if (p) ZFREE(s, p);} /* Reverse the bytes in a 32-bit value */ #define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) #endif /* ZUTIL_H */ chibicc-1.0.24/tokenize.c000077500000000000000000000575111517770275000152050ustar00rootroot00000000000000#include "chibicc.h" // Define the ANSI color codes #define RED "\033[31m" #define RESET "\033[0m" // Length of the color codes #define PURPLE "\033[0;35m" #define RED_LEN 5 // \033[31m #define RESET_LEN 4 // \033[0m #define PURPLE_LEN 7 // Input file static File *current_file; // A list of all input files. static File **input_files; // True if the current position is at the beginning of a line static bool at_bol; // True if the current position follows a space character static bool has_space; // True if we are inside a preprocessor directive line static bool in_pp_line; //static Token *read_pragma(Token *cur, char **rest, char *start); // Reports an error and exit. void error(char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); va_end(ap); exit(1); } // Reports an error message in the following format. // // foo.c:10: x = y + 1; // ^ static void verror_at(char *filename, char *input, unsigned int line_no, char *loc, char *fmt, va_list ap) { // Find a line containing `loc`. char *line = loc; while (input < line && line[-1] != '\n') line--; char *end = loc; while (*end && *end != '\n') end++; // Print out the line. int indent = fprintf(stderr, "%s:%u: " RED "error:" RESET " ", filename, line_no); fprintf(stderr, "%.*s\n", (int)(end - line), line); // Show the error message. int pos = display_width(line, loc - line) + indent; fprintf(stderr, "%*s", pos - (RED_LEN + RESET_LEN), ""); // print pos spaces, adjusting for color codes fprintf(stderr, RED "^" RESET " "); // Print caret in red vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); } void error_at(char *loc, char *fmt, ...) { unsigned int line_no = 1; for (char *p = current_file->contents; p < loc; p++) if (*p == '\n') line_no++; va_list ap; va_start(ap, fmt); verror_at(current_file->name, current_file->contents, line_no, loc, fmt, ap); va_end(ap); exit(1); } void error_tok(Token *tok, char *fmt, ...) { va_list ap; va_start(ap, fmt); verror_at(tok->file->name, tok->file->contents, tok->line_no, tok->loc, fmt, ap); va_end(ap); exit(1); } //to print warning message in purple color static void vwarning_at(char *filename, char *input, unsigned int line_no, char *loc, char *fmt, va_list ap) { // Find a line containing `loc`. char *line = loc; while (input < line && line[-1] != '\n') line--; char *end = loc; while (*end && *end != '\n') end++; // Print out the line. int indent = 0; if (!opt_werror) indent = fprintf(stderr, "%s:%u: " PURPLE "warning:" RESET " ", filename, line_no); else indent = fprintf(stderr, "%s:%u: " RED "warning:" RESET " ", filename, line_no); fprintf(stderr, "%.*s\n", (int)(end - line), line); // Show the error message. int pos = display_width(line, loc - line) + indent; fprintf(stderr, "%*s", pos - (PURPLE_LEN + RESET_LEN), ""); if (!opt_werror) fprintf(stderr, PURPLE "^" RESET " "); else fprintf(stderr, RED "^" RESET " "); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); } void warning_at(char *loc, char *fmt, ...) { unsigned int line_no = 1; for (char *p = current_file->contents; p < loc; p++) if (*p == '\n') line_no++; va_list ap; va_start(ap, fmt); vwarning_at(current_file->name, current_file->contents, line_no, loc, fmt, ap); va_end(ap); } void warn_tok(Token *tok, char *fmt, ...) { va_list ap; va_start(ap, fmt); vwarning_at(tok->file->name, tok->file->contents, tok->line_no, tok->loc, fmt, ap); va_end(ap); if (opt_werror) exit(1); } // Consumes the current token if it matches `op`. bool equal(Token *tok, const char *op) { //return strncmp(tok->loc, op, tok->len) == 0 && op[tok->len] == '\0'; return tok->len == strlen(op) && strncmp(tok->loc, op, tok->len) == 0 && op[tok->len] == '\0'; } // Ensure that the current token is `op`. Token *skip(Token *tok, char *op, Context *ctx) { if (!equal(tok, op)) error_tok(tok, "%s %s %s %u: in skip : expected '%s'", __FILE__, ctx->filename, ctx->funcname, ctx->line_no, op ); return tok->next; } bool consume(Token **rest, Token *tok, char *str) { if (equal(tok, str)) { *rest = tok->next; return true; } *rest = tok; return false; } // Create a new token. static Token *new_token(TokenKind kind, char *start, char *end) { Token *tok = calloc(1, sizeof(Token)); if (tok == NULL) error("%s:%d in new_token tok is null!", __FILE__, __LINE__); tok->kind = kind; tok->loc = start; tok->len = end - start; tok->file = current_file; tok->filename = current_file->display_name; tok->at_bol = at_bol; tok->has_space = has_space; at_bol = has_space = false; return tok; } bool startswith(char *p, char *q) { return strncmp(p, q, strlen(q)) == 0; } // Read an identifier and returns the length of it. // If p does not point to a valid identifier, 0 is returned. static int read_ident(char *start) { char *p = start; uint32_t c = decode_utf8(&p, p); if (!is_ident1(c)) return 0; for (;;) { char *q; c = decode_utf8(&q, p); if (!is_ident2(c)) return p - start; p = q; } } static int from_hex(char c) { if ('0' <= c && c <= '9') return c - '0'; if ('a' <= c && c <= 'f') return c - 'a' + 10; return c - 'A' + 10; } static uint32_t read_universal_char(char *p, int len) { uint32_t c = 0; for (int i = 0; i < len; i++) { if (!isxdigit(p[i])) return (uint32_t)-1; c = (c << 4) | from_hex(p[i]); } return c; } // Read a punctuator token from p and returns its length. static int read_punct(char *p) { static char *kw[] = { "<<=", ">>=", "...", "==", "!=", "<=", ">=", "->", "+=", "-=", "*=", "/=", "++", "--", "%=", "&=", "|=", "^=", "&&", "||", "<<", ">>", "##", }; for (int i = 0; i < sizeof(kw) / sizeof(*kw); i++) if (startswith(p, kw[i])) return strlen(kw[i]); return ispunct(*p) ? 1 : 0; } static bool is_keyword(Token *tok) { static HashMap map; if (map.capacity == 0) { static char *kw[] = { "return", "if", "else", "for", "while", "int", "sizeof", "char", "struct", "union", "short", "long", "void", "typedef", "_Bool", "enum", "static", "goto", "break", "continue", "switch", "case", "default", "extern", "_Alignof", "_Alignas", "do", "signed", "unsigned", "const", "volatile", "auto", "register", "restrict", "__restrict", "__restrict__", "_Noreturn", "float", "double", "typeof", "asm", "_Thread_local", "__thread", "_Atomic", "__attribute__", "__label__", "inline", "__int128", }; for (int i = 0; i < sizeof(kw) / sizeof(*kw); i++) hashmap_put(&map, kw[i], (void *)1); } return hashmap_get2(&map, tok->loc, tok->len); } static int read_escaped_char(char **new_pos, char *p) { if ('0' <= *p && *p <= '7') { // Read an octal number. int c = *p++ - '0'; if ('0' <= *p && *p <= '7') { c = (c << 3) + (*p++ - '0'); if ('0' <= *p && *p <= '7') c = (c << 3) + (*p++ - '0'); } *new_pos = p; return c; } if (*p == 'x') { // Read a hexadecimal number. p++; if (!isxdigit(*p)) error_at(p, "%s:%d: in read_escaped_char : invalid hex escape sequence", __FILE__, __LINE__); int c = 0; for (; isxdigit(*p); p++) c = (c << 4) + from_hex(*p); *new_pos = p; return c; } if (*p == 'u' || *p == 'U') { int len = (*p == 'u' ? 4 : 8); uint32_t c = read_universal_char(p + 1, len); if (c == (uint32_t)-1) error_at(p, "%s:%d: in read_escaped_char : invalid universal character name", __FILE__, __LINE__); *new_pos = p + 1 + len; return c; } *new_pos = p + 1; switch (*p) { case 'a': return '\a'; case 'b': return '\b'; case 't': return '\t'; case 'n': return '\n'; case 'v': return '\v'; case 'f': return '\f'; case 'r': return '\r'; // [GNU] \e for the ASCII escape character is a GNU C extension. case 'e': return 27; default: return *p; } } // Find a closing double-quote. static char *string_literal_end(char *p) { char *start = p; for (; *p != '"'; p++) { if (*p == '\n' || *p == '\0') error_at(start, "%s:%d: in string_literal_end : unclosed string literal", __FILE__, __LINE__); if (*p == '\\') p++; } return p; } static Token *read_string_literal(char *start, char *quote) { char *end = string_literal_end(quote + 1); char *buf = calloc(1, end - quote); if (buf == NULL) error("%s:%d: error: in read_string_literal buf is null!", __FILE__, __LINE__); int len = 0; for (char *p = quote + 1; p < end;) { if (*p == '\\' && (p[1] == 'u' || p[1] == 'U')) len += encode_utf8(buf + len, read_escaped_char(&p, p + 1)); else if (*p == '\\') buf[len++] = read_escaped_char(&p, p + 1); else buf[len++] = *p++; } Token *tok = new_token(TK_STR, start, end + 1); tok->ty = array_of(ty_char, len + 1); tok->str = buf; return tok; } // Read a UTF-8-encoded string literal and transcode it in UTF-16. // // UTF-16 is yet another variable-width encoding for Unicode. Code // points smaller than U+10000 are encoded in 2 bytes. Code points // equal to or larger than that are encoded in 4 bytes. Each 2 bytes // in the 4 byte sequence is called "surrogate", and a 4 byte sequence // is called a "surrogate pair". static Token *read_utf16_string_literal(char *start, char *quote) { char *end = string_literal_end(quote + 1); uint16_t *buf = calloc(2, end - start); if (buf == NULL) error("%s:%d: error: in read_utf16_string_literal buf is null!", __FILE__, __LINE__); int len = 0; for (char *p = quote + 1; p < end;) { uint32_t c; if (*p == '\\') c = read_escaped_char(&p, p + 1); else c = decode_utf8(&p, p); if (c < 0x10000) { // Encode a code point in 2 bytes. buf[len++] = c; } else { // Encode a code point in 4 bytes. c -= 0x10000; buf[len++] = 0xd800 + ((c >> 10) & 0x3ff); buf[len++] = 0xdc00 + (c & 0x3ff); } } Token *tok = new_token(TK_STR, start, end + 1); tok->ty = array_of(ty_ushort, len + 1); tok->str = (char *)buf; return tok; } // Read a UTF-8-encoded string literal and transcode it in UTF-32. // // UTF-32 is a fixed-width encoding for Unicode. Each code point is // encoded in 4 bytes. static Token *read_utf32_string_literal(char *start, char *quote, Type *ty) { char *end = string_literal_end(quote + 1); uint32_t *buf = calloc(4, end - quote); if (buf == NULL) error("%s:%d: error: in read_utf32_string_literal buf is null!", __FILE__, __LINE__); int len = 0; for (char *p = quote + 1; p < end;) { if (*p == '\\') buf[len++] = read_escaped_char(&p, p + 1); else buf[len++] = decode_utf8(&p, p); } Token *tok = new_token(TK_STR, start, end + 1); tok->ty = array_of(ty, len + 1); tok->str = (char *)buf; return tok; } static Token *read_char_literal(char *start, char *quote, Type *ty) { char *p = quote + 1; if (*p == '\0') error_at(start, "%s:%d: in read_char_literal : unclosed char literal", __FILE__, __LINE__); int64_t c = 0; int n = 0; while (*p != '\'') { if (*p == '\0' || *p == '\n') error_at(start, "unclosed char literal"); if (n > 0) c <<= 8; if (*p == '\\') c |= read_escaped_char(&p, p + 1); else c |= decode_utf8(&p, p); n++; } if (n > 4 && ty->kind == TY_INT && !in_pp_line) warning_at(start, "character constant too long for its type"); // For a single-byte character literal, the value should be sign-extended // as if it were a char. if (n == 1 && (quote - start) == 0) c = (char)c; Token *tok = new_token(TK_NUM, start, p + 1); tok->val = c; tok->ty = ty; return tok; } static bool convert_pp_int(Token *tok) { char *p = tok->loc; // Read a binary, octal, decimal or hexadecimal number. int base = 10; if (!strncasecmp(p, "0x", 2) && isxdigit(p[2])) { p += 2; base = 16; } else if (!strncasecmp(p, "0b", 2) && (p[2] == '0' || p[2] == '1')) { p += 2; base = 2; } else if (*p == '0') { base = 8; } int64_t val = strtoul(p, &p, base); // Read U, L or LL suffixes. bool ll = false; bool l = false; bool u = false; if (startswith(p, "LLU") || startswith(p, "LLu") || startswith(p, "llU") || startswith(p, "llu") || startswith(p, "ULL") || startswith(p, "Ull") || startswith(p, "uLL") || startswith(p, "ull")) { p += 3; ll = u = true; } else if (!strncasecmp(p, "lu", 2) || !strncasecmp(p, "ul", 2)) { p += 2; l = u = true; } else if (startswith(p, "LL") || startswith(p, "ll")) { p += 2; ll = true; } else if (*p == 'L' || *p == 'l') { p++; l = true; } else if (*p == 'U' || *p == 'u') { p++; u = true; } if (p != tok->loc + tok->len) return false; // Infer a type. Type *ty; if (base == 10) { if (ll && u) ty = ty_ullong; else if (l && u) ty = ty_ulong; else if (ll) ty = ty_llong; else if (l) ty = ty_long; else if (u) ty = (val >> 32) ? ty_ulong : ty_uint; else ty = (val >> 31) ? ty_long : ty_int; } else { if (ll && u) ty = ty_ullong; else if (l && u) ty = ty_ulong; else if (ll) ty = (val >> 63) ? ty_ullong : ty_llong; else if (l) ty = (val >> 63) ? ty_ulong : ty_long; else if (u) ty = (val >> 32) ? ty_ulong : ty_uint; else if (val >> 63) ty = ty_ulong; else if (val >> 32) ty = ty_long; else if (val >> 31) ty = ty_uint; else ty = ty_int; } tok->kind = TK_NUM; tok->val = val; tok->ty = ty; return true; } // The definition of the numeric literal at the preprocessing stage // is more relaxed than the definition of that at the later stages. // In order to handle that, a numeric literal is tokenized as a // "pp-number" token first and then converted to a regular number // token after preprocessing. // // This function converts a pp-number token to a regular number token. static void convert_pp_number(Token *tok) { // Try to parse as an integer constant. if (convert_pp_int(tok)) return; // If it's not an integer, it must be a floating point constant. char *end; long double val = strtold(tok->loc, &end); Type *ty; if (*end == 'f' || *end == 'F') { ty = ty_float; val = (float)val; end++; } else if (*end == 'l' || *end == 'L') { ty = ty_ldouble; end++; } else { ty = ty_double; val = (double)val; } if (tok->loc + tok->len != end) error_tok(tok, "%s:%d: in convert_pp_number : invalid numeric constant", __FILE__, __LINE__); tok->kind = TK_NUM; tok->fval = val; tok->ty = ty; } void convert_pp_tokens(Token *tok) { for (Token *t = tok; t->kind != TK_EOF; t = t->next) { if (is_keyword(t)) t->kind = TK_KEYWORD; else if (t->kind == TK_PP_NUM) convert_pp_number(t); } } // Initialize line info for all tokens. static void add_line_numbers(Token *tok) { char *p = current_file->contents; unsigned int n = 1; do { if (p == tok->loc) { tok->line_no = n; tok = tok->next; } if (*p == '\n') n++; } while (*p++); } Token *tokenize_string_literal(Token *tok, Type *basety) { Token *t; if (basety->size == 2) t = read_utf16_string_literal(tok->loc, tok->loc); else t = read_utf32_string_literal(tok->loc, tok->loc, basety); t->next = tok->next; return t; } // Tokenize a given string and returns new tokens. Token *tokenize(File *file) { current_file = file; char *p = file->contents; Token head = {}; Token *cur = &head; at_bol = true; in_pp_line = false; has_space = false; while (*p) { // Skip line comments. if (startswith(p, "//")) { p += 2; //while (*p != '\n') while (*p && *p != '\n') p++; has_space = true; continue; } // Skip block comments. if (startswith(p, "/*")) { char *q = strstr(p + 2, "*/"); if (!q) error_at(p, "%s:%d: in tokenize : unclosed block comment", __FILE__, __LINE__); p = q + 2; has_space = true; continue; } // Skip newline. if (*p == '\n') { p++; at_bol = true; in_pp_line = false; has_space = true; continue; } // Skip whitespace characters. if (isspace(*p)) { p++; has_space = true; continue; } // Numeric literal if (isdigit(*p) || (*p == '.' && isdigit(p[1]))) { char *q = p; for (;;) { if (p[0] && p[1] && strchr("eEpP", p[0]) && strchr("+-", p[1])) { p += 2; continue; } char *p2; uint32_t c = decode_utf8(&p2, p); if (c == '.' || is_ident2(c)) p = p2; else break; } cur = cur->next = new_token(TK_PP_NUM, q, p); continue; } // String literal if (*p == '"') { cur = cur->next = read_string_literal(p, p); p += cur->len; continue; } // UTF-8 string literal if (startswith(p, "u8\"")) { cur = cur->next = read_string_literal(p, p + 2); p += cur->len; continue; } // UTF-16 string literal if (startswith(p, "u\"")) { cur = cur->next = read_utf16_string_literal(p, p + 1); p += cur->len; continue; } // Wide string literal if (startswith(p, "L\"")) { cur = cur->next = read_utf32_string_literal(p, p + 1, ty_int); p += cur->len; continue; } // UTF-32 string literal if (startswith(p, "U\"")) { cur = cur->next = read_utf32_string_literal(p, p + 1, ty_uint); p += cur->len; continue; } // Character literal if (*p == '\'') { cur = cur->next = read_char_literal(p, p, ty_int); //cur->val = (char)cur->val; p += cur->len; continue; } // UTF-8 character literal if (startswith(p, "u8'")) { cur = cur->next = read_char_literal(p, p + 2, ty_char); p += cur->len; continue; } // UTF-16 character literal if (startswith(p, "u'")) { cur = cur->next = read_char_literal(p, p + 1, ty_ushort); cur->val &= 0xffff; p += cur->len; continue; } // Wide character literal if (startswith(p, "L'")) { cur = cur->next = read_char_literal(p, p + 1, ty_int); p += cur->len; continue; } // UTF-32 character literal if (startswith(p, "U'")) { cur = cur->next = read_char_literal(p, p + 1, ty_uint); p += cur->len; continue; } // Identifier or keyword int ident_len = read_ident(p); if (ident_len) { cur = cur->next = new_token(TK_IDENT, p, p + ident_len); p += cur->len; continue; } // Punctuators int punct_len = read_punct(p); if (punct_len) { if (at_bol && *p == '#') in_pp_line = true; cur = cur->next = new_token(TK_PUNCT, p, p + punct_len); p += cur->len; continue; } error_at(p, "%s:%d: in tokenize : invalid token", __FILE__, __LINE__); } cur = cur->next = new_token(TK_EOF, p, p); add_line_numbers(head.next); // for debug needs print all the tokens with values if (printTokens && f != NULL) print_debug_tokens(__FILE__, "tokenize", head.next); return head.next; } // Returns the contents of a given file. static char *read_file(char *path) { FILE *fp; if (strcmp(path, "-") == 0) { // By convention, read from stdin if a given filename is "-". fp = stdin; } else { fp = fopen(path, "r"); if (!fp) return NULL; } char *buf; size_t buflen; FILE *out = open_memstream(&buf, &buflen); // Read the entire file. for (;;) { char buf2[4096]; int n = fread(buf2, 1, sizeof(buf2), fp); if (n == 0) break; fwrite(buf2, 1, n, out); } if (fp != stdin) fclose(fp); // Make sure that the last line is properly terminated with '\n'. fflush(out); if (buflen == 0 || buf[buflen - 1] != '\n') fputc('\n', out); fputc('\0', out); fclose(out); return buf; } File **get_input_files(void) { return input_files; } File *new_file(char *name, unsigned int file_no, char *contents) { File *file = calloc(1, sizeof(File)); if (file == NULL) error("%s:%d: error: in new_file file is null!", __FILE__, __LINE__); file->name = name; file->display_name = name; file->file_no = file_no; file->contents = contents; return file; } // Replaces \r or \r\n with \n. static void canonicalize_newline(char *p) { int i = 0, j = 0; while (p[i]) { if (p[i] == '\r' && p[i + 1] == '\n') { i += 2; p[j++] = '\n'; } else if (p[i] == '\r') { i++; p[j++] = '\n'; } else { p[j++] = p[i++]; } } p[j] = '\0'; } // Removes backslashes followed by a newline. static void remove_backslash_newline(char *p) { int i = 0, j = 0; // We want to keep the number of newline characters so that // the logical line number matches the physical one. // This counter maintain the number of newlines we have removed. int n = 0; while (p[i]) { if (p[i] == '\\' && p[i + 1] == '\n') { i += 2; n++; } else if (p[i] == '\n') { p[j++] = p[i++]; for (; n > 0; n--) p[j++] = '\n'; } else { p[j++] = p[i++]; } } for (; n > 0; n--) p[j++] = '\n'; p[j] = '\0'; } // Replace \u or \U escape sequences with corresponding UTF-8 bytes. void convert_universal_chars(char *p) { char *q = p; while (*p) { if (*p == '"' || *p == '\'') { char quote = *p; *q++ = *p++; while (*p && *p != quote) { if (*p == '\\') { *q++ = *p++; if (*p) *q++ = *p++; } else { *q++ = *p++; } } if (*p) *q++ = *p++; continue; } if (startswith(p, "\\u")) { uint32_t c = read_universal_char(p + 2, 4); if (c != (uint32_t)-1 && c != 0) { p += 6; q += encode_utf8(q, c); } else { *q++ = *p++; } } else if (startswith(p, "\\U")) { uint32_t c = read_universal_char(p + 2, 8); if (c != (uint32_t)-1 && c != 0) { p += 10; q += encode_utf8(q, c); } else { *q++ = *p++; } } else if (p[0] == '\\') { *q++ = *p++; *q++ = *p++; } else { *q++ = *p++; } } *q = '\0'; } Token *tokenize_file(char *path) { char *p = read_file(path); if (!p) return NULL; // UTF-8 texts may start with a 3-byte "BOM" marker sequence. // If exists, just skip them because they are useless bytes. // (It is actually not recommended to add BOM markers to UTF-8 // texts, but it's not uncommon particularly on Windows.) if (!memcmp(p, "\xef\xbb\xbf", 3)) p += 3; canonicalize_newline(p); remove_backslash_newline(p); convert_universal_chars(p); // Save the filename for assembler .file directive. static unsigned int file_no; File *file = new_file(path, file_no + 1, p); // Save the filename for assembler .file directive. input_files = realloc(input_files, sizeof(char *) * (file_no + 2)); if (input_files == NULL) error("%s:%d: error: in tokenize_file input_files is null!", __FILE__, __LINE__); input_files[file_no] = file; input_files[file_no + 1] = NULL; file_no++; return tokenize(file); } chibicc-1.0.24/type.c000077500000000000000000000735761517770275000143470ustar00rootroot00000000000000#include "chibicc.h" Type *ty_void = &(Type){TY_VOID, 1, 1}; Type *ty_bool = &(Type){TY_BOOL, 1, 1, true}; Type *ty_char = &(Type){TY_CHAR, 1, 1}; Type *ty_short = &(Type){TY_SHORT, 2, 2}; Type *ty_int = &(Type){TY_INT, 4, 4}; Type *ty_long = &(Type){TY_LONG, 8, 8}; Type *ty_uchar = &(Type){TY_CHAR, 1, 1, true}; Type *ty_ushort = &(Type){TY_SHORT, 2, 2, true}; Type *ty_uint = &(Type){TY_INT, 4, 4, true}; Type *ty_ulong = &(Type){TY_LONG, 8, 8, true}; Type *ty_llong = &(Type){TY_LLONG, 8, 8}; Type *ty_ullong = &(Type){TY_LLONG, 8, 8, true}; Type *ty_float = &(Type){TY_FLOAT, 4, 4}; Type *ty_double = &(Type){TY_DOUBLE, 8, 8}; Type *ty_ldouble = &(Type){TY_LDOUBLE, 16, 16}; Type *ty_void_ptr = &(Type){TY_PTR, 8, 8, true, .is_pointer = true, .pointertype = &(Type){TY_VOID, 1, 1}, .base = &(Type){TY_VOID, 1, 1}}; Type *ty_int128 = &(Type){TY_INT128, 16, 16}; Type *ty_uint128 = &(Type){TY_INT128, 16, 16, true}; static Type *new_type(TypeKind kind, int64_t size, int align) { Type *ty = calloc(1, sizeof(Type)); if (ty == NULL) error("%s:%d: error: in new_type ty is null!", __FILE__, __LINE__); ty->kind = kind; ty->size = size; ty->align = align; if (ty->kind == TY_INT128) ty->is_aligned = true; return ty; } Type *new_qualified_type(Type *ty) { if (ty->origin) ty = ty->origin; Type *ret = calloc(1, sizeof(Type)); *ret = *ty; ret->origin = ty; if (ty->size < 0) { ret->decl_next = ty->decl_next; ty->decl_next = ret; } return ret; } Type *unqual(Type *ty) { if (!ty) return NULL; if (ty->origin) ty = ty->origin; if (ty->is_atomic || ty->is_const || ty->is_volatile || ty->is_restrict) { ty = copy_type(ty); ty->is_atomic = false; ty->is_const = false; ty->is_volatile = false; ty->is_restrict = false; } return ty; } bool is_integer(Type *ty) { TypeKind k = ty->kind; return k == TY_BOOL || k == TY_CHAR || k == TY_SHORT || k == TY_INT128 || k == TY_INT || k == TY_LONG || k == TY_LLONG || k == TY_ENUM; } bool is_flonum(Type *ty) { return ty->kind == TY_FLOAT || ty->kind == TY_DOUBLE || ty->kind == TY_LDOUBLE; } bool is_array(Type *ty) { return ty && (ty->kind == TY_ARRAY || ty->kind == TY_VLA); } bool is_bitfield(Node *node) { return node->kind == ND_MEMBER && node->member->is_bitfield; } static bool is_bitfield2(Node *node, int *width) { switch (node->kind) { case ND_ASSIGN: return is_bitfield2(node->lhs, width); case ND_COMMA: return is_bitfield2(node->rhs, width); case ND_STMT_EXPR: { Node *stmt = node->body; while (stmt->next) stmt = stmt->next; if (stmt->kind == ND_EXPR_STMT) return is_bitfield2(stmt->lhs, width); } case ND_MEMBER: if (!node->member->is_bitfield) return false; *width = node->member->bit_width; return true; } return false; } int int_rank(Type *t) { switch (t->kind) { case TY_VECTOR: return 4; case TY_ENUM: case TY_BOOL: case TY_CHAR: case TY_SHORT: return 0; case TY_INT: return 1; case TY_LONG: return 2; case TY_LLONG: return 3; } printf("======%d\n", t->kind); unreachable(); } static void int_promotion(Node **node) { Type *ty = (*node)->ty; int bit_width; if (is_bitfield2(*node, &bit_width)) { int int_width = ty_int->size * 8; //int bit_width = (*node)->member->bit_width; if (bit_width == int_width && ty->is_unsigned) { *node = new_cast(*node, ty_uint); } else if (bit_width <= int_width) { *node = new_cast(*node, ty_int); } else { *node = new_cast(*node, ty); } return; } if (ty->size < ty_int->size) { *node = new_cast(*node, ty_int); return; } if (ty->size == ty_int->size && int_rank(ty) < int_rank(ty_int)) { if (ty->is_unsigned) *node = new_cast(*node, ty_uint); else *node = new_cast(*node, ty_int); return; } } bool is_numeric(Type *ty) { return is_integer(ty) || is_flonum(ty); } static bool is_tag_compat(Type *t1, Type *t2) { return t1->tag && t2->tag && equal_tok(t1->tag, t2->tag); } static bool is_qual_compat(Type *t1, Type *t2) { return t1->is_atomic == t2->is_atomic && t1->is_const == t2->is_const && t1->is_volatile == t2->is_volatile && t1->is_restrict == t2->is_restrict; } bool is_compatible2(Type *t1, Type *t2) { return is_qual_compat(t1, t2) && is_compatible(t1, t2); } static bool is_record_compat(Type *t1, Type *t2) { if (t1->align != t2->align || t1->is_flexible != t2->is_flexible) return false; Member *mem1 = t1->members; Member *mem2 = t2->members; while (mem1 && mem2) { if (mem1->offset != mem2->offset || mem1->align != mem2->align || mem1->is_bitfield != mem2->is_bitfield || mem1->bit_offset != mem2->bit_offset || mem1->bit_width != mem2->bit_width) return false; if ((!mem1->name != !mem2->name) || (mem1->name && !equal_tok(mem1->name, mem2->name))) return false; Type *t1 = mem1->ty; Type *t2 = mem2->ty; if (t1->kind != t2->kind) return false; if (t1->kind == TY_STRUCT || t1->kind == TY_UNION) { if (!mem1->name != !t1->tag || !mem2->name != !t2->tag || (t1->tag && !equal_tok(t1->tag, t2->tag))) return false; if (!is_qual_compat(t1, t2) || !is_record_compat(t1, t2)) return false; } else { if (!is_compatible2(t1, t2)) return false; } mem1 = mem1->next; mem2 = mem2->next; } return !mem1 == !mem2; } bool is_compatible(Type *t1, Type *t2) { if (t1 == t2) return true; if (t1->origin) return is_compatible(t1->origin, t2); if (t2->origin) return is_compatible(t1, t2->origin); if (t1->kind != t2->kind) return false; if ((t1->kind == TY_VLA && t2->kind == TY_VLA) || (t1->kind == TY_VLA && t2->kind == TY_ARRAY) || (t1->kind == TY_ARRAY && t2->kind == TY_VLA)) return is_compatible(t1->base, t2->base); if(is_vector(t1) && is_vector(t2)) return is_compatible(t1->base, t2->base); switch (t1->kind) { case TY_CHAR: case TY_SHORT: case TY_INT: case TY_LONG: case TY_LLONG: return t1->is_unsigned == t2->is_unsigned; case TY_FLOAT: case TY_DOUBLE: case TY_LDOUBLE: return true; case TY_INT128: return t1->is_unsigned == t2->is_unsigned; case TY_PTR: return is_compatible2(t1->base, t2->base); case TY_FUNC: { if (!is_compatible(t1->return_ty, t2->return_ty)) return false; if (t1->is_variadic != t2->is_variadic) { if (t1->is_oldstyle && !t2->is_variadic && !t2->params && !t2->is_oldstyle) { } else if (t2->is_oldstyle && !t1->is_variadic && !t1->params && !t1->is_oldstyle) { } else { return false; } } else if (t1->is_variadic && t1->is_oldstyle != t2->is_oldstyle) { return false; } Type *p1 = t1->params; Type *p2 = t2->params; for (; p1 && p2; p1 = p1->next, p2 = p2->next) if (!is_compatible(p1, p2)) return false; return p1 == NULL && p2 == NULL; } case TY_ARRAY: if (!is_compatible(t1->base, t2->base)) return false; return t1->array_len < 0 || t2->array_len < 0 || t1->array_len == t2->array_len; case TY_VECTOR: if (!is_compatible(t1->base, t2->base)) return false; return t1->array_len < 0 || t2->array_len < 0 || t1->array_len == t2->array_len; case TY_STRUCT: case TY_UNION: return is_tag_compat(t1, t2) && is_record_compat(t1, t2); } return false; } Type *copy_type(Type *ty) { Type *ret = calloc(1, sizeof(Type)); if (ret == NULL) error("%s:%d: error: in copy_type ret is null!", __FILE__, __LINE__); Type *root = ty && ty->origin ? ty->origin : ty; if (root && root->size < 0) { ty->decl_next = root->decl_next; root->decl_next = ty; } *ret = *ty; ret->origin = ty; return ret; } Type *pointer_to(Type *base) { Type *ty = new_type(TY_PTR, 8, 8); ty->base = base; ty->is_pointer = true; ty->pointertype = base; ty->is_unsigned = true; return ty; } Type *func_type(Type *return_ty) { // The C spec disallows sizeof(), but // GCC allows that and the expression is evaluated to 1. Type *ty = new_type(TY_FUNC, 1, 1); ty->return_ty = return_ty; ty->is_constructor = false; ty->is_destructor = false; ty->destructor_priority = 0; ty->constructor_priority = 0; return ty; } Type *array_of(Type *base, int64_t len) { if (!base) error("%s:%d: in array_of : base is null", __FILE__, __LINE__); Type *ty = new_type(TY_ARRAY, base->size * len, base->align); ty->base = base; ty->array_len = len; ty->has_vla = base->has_vla; return ty; } Type *vector_of(Type *base, int64_t len) { if (!base) error("%s:%d: in vector_of : base is null", __FILE__, __LINE__); Type *ty = new_type(TY_VECTOR, base->size * len, base->align); int total_size = base->size * len; ty->size = total_size; ty->base = base; ty->array_len = len; ty->has_vla = base->has_vla; ty->is_vector = true; return ty; } Type *vla_of(Type *base, Node *len) { Type *ty = new_type(TY_VLA, 8, base->align); ty->base = base; ty->vla_len = len; ty->has_vla = true; return ty; } Type *enum_type(void) { return new_type(TY_ENUM, 4, 4); } Type *struct_type(void) { return new_type(TY_STRUCT, 0, 1); } Type *array_to_pointer(Type *ty) { if (ty->base && ty->kind != TY_PTR) return pointer_to(ty->base); return ty; } bool is_nullptr(Node *n) { return n->kind == ND_NUM && n->val == 0; } static Type *get_common_type(Node **lhs, Node **rhs) { Type *ty1 = (*lhs)->ty; Type *ty2 = (*rhs)->ty; //======ISS-158 trying to fix issue with "parse.c: in struct_ref : not a struct nor a union" when in a macro definition we have (size_t)-1 ? NULL : (n) - 1 //assuming that if one is void it returns the second type that could be void also or different type. if (!ty2) { return ty1; } if (ty1->base) { if (ty1->base->kind == TY_VOID) if (ty2->base) return pointer_to(ty2->base); return pointer_to(ty1->base); } if (ty1->base && is_nullptr(*rhs)) return array_to_pointer(ty1); if (ty2->base && is_nullptr(*lhs)) return array_to_pointer(ty2); if (ty1->kind == TY_FUNC) return pointer_to(ty1); if (ty2->kind == TY_FUNC) return pointer_to(ty2); if (ty1->kind == TY_LDOUBLE || ty2->kind == TY_LDOUBLE) return ty_ldouble; if (ty1->kind == TY_DOUBLE || ty2->kind == TY_DOUBLE) return ty_double; if (ty1->kind == TY_FLOAT || ty2->kind == TY_FLOAT) return ty_float; if (ty1->kind == TY_INT128 || ty2->kind == TY_INT128) { if( ty1->is_unsigned || ty2->is_unsigned) return ty_uint128; else return ty_int128; } if (ty1->kind == TY_STRUCT || ty1->kind == TY_UNION) { if (is_compatible(ty1, ty2)) return ty1; } if (ty2->kind == TY_STRUCT || ty2->kind == TY_UNION) { if (is_compatible(ty1, ty2)) return ty2; } if (ty1->kind == TY_PTR) return ty1; if (ty2->kind == TY_PTR) return ty2; int_promotion(lhs); int_promotion(rhs); ty1 = (*lhs)->ty; ty2 = (*rhs)->ty; if (ty1->size != ty2->size) return (ty1->size < ty2->size) ? ty2 : ty1; Type *ranked_ty = int_rank(ty1) > int_rank(ty2) ? ty1 : ty2; if (ty1->is_unsigned == ty2->is_unsigned) return ranked_ty; // If same size but different sign, the common type is unsigned // variant of the highest-ranked type between the two. switch (ranked_ty->kind) { case TY_INT: return ty_uint; case TY_LONG: return ty_ulong; case TY_LLONG: return ty_ullong; } unreachable(); } // For many binary operators, we implicitly promote operands so that // both operands have the same type. Any integral type smaller than // int is always promoted to int. If the type of one operand is larger // than the other's (e.g. "long" vs. "int"), the smaller operand will // be promoted to match with the other. // // This operation is called the "usual arithmetic conversion". static void usual_arith_conv(Node **lhs, Node **rhs) { Type *ty = get_common_type(lhs, rhs); *lhs = new_cast(*lhs, ty); *rhs = new_cast(*rhs, ty); } bool is_vector(Type *ty) { return ty && ty->kind == TY_VECTOR; } bool is_int128(Type *ty) { return ty && ty->kind == TY_INT128; } bool is_pointer(Type *ty) { return ty && ty->kind == TY_PTR; } void add_type(Node *node) { if (!node || node->ty) return; add_type(node->lhs); add_type(node->rhs); add_type(node->cond); add_type(node->then); add_type(node->els); add_type(node->init); add_type(node->inc); for (Node *n = node->body; n; n = n->next) add_type(n); for (Node *n = node->args; n; n = n->next) add_type(n); switch (node->kind) { case ND_NUM: node->ty = ty_int; return; case ND_ADD: case ND_SUB: case ND_MUL: case ND_DIV: case ND_MOD: case ND_BITAND: case ND_BITOR: case ND_BITXOR: if (is_vector(node->lhs->ty) && is_vector(node->rhs->ty)) { node->ty = node->lhs->ty; } else { usual_arith_conv(&node->lhs, &node->rhs); node->ty = node->lhs->ty; } return; case ND_POS: case ND_NEG: if (!is_numeric(node->lhs->ty) && !is_vector(node->lhs->ty)) error_tok(node->lhs->tok, "%s:%d: in add_type: invalid operand", __FILE__, __LINE__); if (is_integer(node->lhs->ty)) int_promotion(&node->lhs); node->ty = node->lhs->ty; return; case ND_ASSIGN: if (node->lhs->ty->kind == TY_ARRAY) error_tok(node->lhs->tok, "%s:%d: not an lvalue", __FILE__, __LINE__); if (node->lhs->ty->kind != TY_STRUCT && node->lhs->ty->kind != TY_UNION) node->rhs = new_cast(node->rhs, node->lhs->ty); node->ty = node->lhs->ty; return; case ND_EQ: case ND_NE: case ND_LT: case ND_LE: if (is_vector(node->lhs->ty) && is_vector(node->rhs->ty)) { node->ty = node->lhs->ty; } else { usual_arith_conv(&node->lhs, &node->rhs); node->ty = ty_int; } return; case ND_ALLOC: add_type(node->lhs); case ND_FUNCALL: node->ty = node->func_ty->return_ty; return; case ND_NOT: case ND_LOGOR: case ND_LOGAND: node->ty = ty_int; return; case ND_BITNOT: case ND_SHL: case ND_SHR: //node->ty = node->lhs->ty; if (!is_integer(node->lhs->ty) && !is_vector(node->lhs->ty)) error_tok(node->tok, "%s:%d %d invalid operand ", __FILE__, __LINE__, node->kind); if (is_integer(node->lhs->ty)) int_promotion(&node->lhs); node->ty = node->lhs->ty; return; case ND_VAR: if (!node->var) { error_tok(node->tok, "%s:%d %d variable undefined ", __FILE__, __LINE__, node->kind); } case ND_VLA_PTR: node->ty = node->var->ty; return; case ND_COND: { Type *lt = node->then->ty; Type *rt = node->els->ty; if (lt->kind == TY_VOID && rt->kind == TY_VOID) { node->ty = ty_void; } else if (!is_numeric(node->then->ty) && is_compatible(node->then->ty, node->els->ty)) { node->ty = array_to_pointer(node->then->ty); } else { usual_arith_conv(&node->then, &node->els); node->ty = node->then->ty; } return; } case ND_COMMA: node->ty = node->rhs->ty; return; case ND_MEMBER: node->ty = node->member->ty; return; case ND_ADDR: { Type *ty = node->lhs->ty; //from @fuhsnn add_type():Remove overaggressive array decaying node->ty = pointer_to(ty); return; } case ND_DEREF: if (!node->lhs->ty->base) { //ISS-163 trying to fix issue with pointer dereference if (node->lhs->ty) node->lhs->ty->base = node->lhs->ty; else error_tok(node->tok, "%s:%d: invalid pointer dereference", __FILE__, __LINE__); } //======ISS-154 trying to fix deferencing pointer issue when we have a macro that can return a pointer or null (self) ? NULL //printf("======%d %d %s\n", node->lhs->ty->base->kind, node->lhs->ty->kind, node->lhs->tok->loc); if (node->lhs->ty->base->kind == TY_VOID && node->lhs->ty->kind == TY_VOID) error_tok(node->tok, "%s:%d : dereferencing a void pointer", __FILE__, __LINE__); if (node->lhs->ty->base->kind == TY_VOID) node->lhs->ty->base = node->lhs->ty; node->ty = node->lhs->ty->base; return; case ND_STMT_EXPR: if (node->body) { Node *stmt = node->body; while (stmt->next) { stmt = stmt->next; add_type(stmt); } while (stmt->kind == ND_LABEL) { stmt = stmt->lhs; add_type(stmt); } if (stmt->kind == ND_EXPR_STMT) { node->ty = stmt->lhs->ty; return; } } //trying to fix =====ISS-144 compiling util-linux failed with expression returning void is not supported //error_tok(node->tok, "%s statement expression returning void is not supported", __FILE__); return; case ND_LABEL_VAL: node->ty = pointer_to(ty_void); return; case ND_CAS: add_type(node->cas_addr); add_type(node->cas_old); add_type(node->cas_new); node->ty = ty_bool; return; case ND_CAS_N: node->ty = ty_bool; return; case ND_ATOMIC_IS_LOCK_FREE: add_type(node->lhs); add_type(node->rhs); node->ty = ty_bool; return; case ND_BUILTIN_MEMSET: case ND_BUILTIN_MEMCPY: node->ty = ty_void_ptr; return; case ND_PSADBW: case ND_PMULUDQ: node->ty = vector_of(ty_ulong, 1); return; case ND_PMULUDQ128: node->ty = vector_of(ty_ulong, 2); return; case ND_PXOR: case ND_POR: case ND_PAND: case ND_PANDN: case ND_PSRLQ: case ND_PSRLQI: case ND_PSLLQI: case ND_PSLLQ: case ND_PSUBQ: case ND_PADDQ: case ND_MOVQ128: node->ty = vector_of(ty_long, 1); return; case ND_PCMPGTD: case ND_PCMPEQD: case ND_PSRADI: case ND_PSRAD: case ND_PSLLDI: case ND_PSLLD: case ND_PSUBD: case ND_PADDD: case ND_PUNPCKLDQ: case ND_PUNPCKHDQ: case ND_VECINITV2SI: case ND_CVTPS2PI: case ND_CVTTPS2PI: case ND_CVTPD2PI: case ND_CVTTPD2PI: node->ty = vector_of(ty_int, 2); return; case ND_LDDQU: node->ty = vector_of(ty_int, 16); return; case ND_CVTPD2DQ: case ND_CVTTPD2DQ: case ND_CVTPS2DQ: case ND_CVTTPS2DQ: case ND_PSIGND128: case ND_PABSD128: case ND_PMINSD128: case ND_PMAXSD128: case ND_PMINUD128: case ND_PMAXUD128: node->ty = vector_of(ty_int, 4); return; case ND_CMPUNORDPS: case ND_CMPORDPS: case ND_CMPNGEPS: case ND_CMPNGTPS: case ND_CMPNLEPS: case ND_CMPNLTPS: case ND_CMPNEQPS: case ND_CMPGEPS: case ND_CMPGTPS: case ND_CMPLEPS: case ND_CMPLTPS: case ND_CMPEQPS: case ND_CMPUNORDSS: case ND_CMPORDSS: case ND_CMPNLESS: case ND_CMPNLTSS: case ND_CMPNEQSS: case ND_MOVSS: case ND_CMPLESS: case ND_CMPLTSS: case ND_CMPEQSS: case ND_XORPS: case ND_ORPS: case ND_ANDNPS: case ND_ANDPS: case ND_MAXPS: case ND_MINPS: case ND_RSQRTPS: case ND_RCPPS: case ND_SQRTPS: case ND_MAXSS: case ND_MINSS: case ND_RSQRTSS: case ND_RCPSS: case ND_SQRTSS: case ND_DIVSS: case ND_MULSS: case ND_SUBSS: case ND_ADDSS: case ND_CVTPI2PS: case ND_CVTSI2SS: case ND_CVTSI642SS: case ND_MOVLHPS: case ND_MOVHLPS: case ND_UNPCKHPS: case ND_UNPCKLPS: case ND_LOADHPS: case ND_LOADLPS: case ND_SHUFPS: case ND_SHUFFLE: case ND_PMAXSW: case ND_PMINSW: case ND_SHUFPD: case ND_CVTDQ2PS: case ND_CVTPD2PS: case ND_CVTSD2SS: case ND_ADDSUBPS: case ND_HADDPS: case ND_HSUBPS: case ND_MOVSHDUP: case ND_MOVSLDUP: case ND_BLENDVPS: node->ty = vector_of(ty_float, 4); return; case ND_EXPECT: add_type(node->rhs); add_type(node->lhs); node->ty = node->lhs->ty; return; case ND_ABORT: return; case ND_STORELPS: case ND_STOREHPS: case ND_LDMXCSR: case ND_STMXCSR: case ND_MASKMOVQ: case ND_MOVNTQ: case ND_MOVNTPS: case ND_MASKMOVDQU: case ND_MOVNTI: case ND_MOVNTI64: case ND_MOVNTDQ: case ND_SLWPCB: node->ty = ty_void_ptr; return; case ND_CLFLUSH: case ND_BUILTIN_FRAME_ADDRESS: case ND_RETURN_ADDR: add_type(node->lhs); node->ty = ty_void_ptr; return; case ND_BUILTIN_SUB_OVERFLOW: case ND_BUILTIN_MUL_OVERFLOW: case ND_BUILTIN_ADD_OVERFLOW: case ND_UMULLL_OVERFLOW: case ND_UMULL_OVERFLOW: case ND_UMUL_OVERFLOW: case ND_UADDLL_OVERFLOW: case ND_UADDL_OVERFLOW: case ND_UADD_OVERFLOW: add_type(node->lhs); add_type(node->rhs); add_type(node->builtin_dest); if (node->builtin_dest->kind == ND_NUM && node->builtin_dest->val == 0) { node->builtin_dest->ty = pointer_to(ty_void); } node->ty = ty_bool; return; case ND_BUILTIN_ISNAN: add_type(node->builtin_val); node->ty = ty_int; return; case ND_BUILTIN_CTZ: case ND_BUILTIN_CTZL: case ND_BUILTIN_CTZLL: case ND_BUILTIN_CLZ: case ND_BUILTIN_CLZL: case ND_BUILTIN_CLZLL: case ND_POPCOUNT: add_type(node->builtin_val); node->ty = ty_int; return; case ND_BUILTIN_BSWAP32: add_type(node->builtin_val); node->ty = ty_uint; return; case ND_POPCOUNTL: add_type(node->builtin_val); node->ty = ty_int; return; case ND_POPCOUNTLL: add_type(node->builtin_val); node->ty = ty_int; return; case ND_BUILTIN_BSWAP16: add_type(node->builtin_val); node->ty = ty_ushort; return; case ND_BUILTIN_BSWAP64: add_type(node->builtin_val); node->ty = ty_ulong; return; case ND_CMPEXCH: case ND_CMPEXCH_N: node->ty = ty_bool; return; case ND_SIGNBIT: case ND_SIGNBITF: case ND_SIGNBITL: case ND_ISUNORDERED: node->ty = ty_int; return; case ND_EXCH_N: case ND_ADDFETCH: case ND_FETCHADD: case ND_FETCHSUB: case ND_FETCHXOR: case ND_FETCHAND: case ND_FETCHOR: case ND_ORFETCH: case ND_ANDFETCH: case ND_XORFETCH: case ND_NANDFETCH: case ND_FETCHNAND: case ND_SUBFETCH: if (node->lhs->ty->kind != TY_PTR) error_tok(node->lhs->tok, "%s:%d: in add_type: pointer expected", __FILE__, __LINE__); node->rhs = new_cast(node->rhs, node->lhs->ty->base); node->ty = node->lhs->ty->base; return; case ND_SYNC: case ND_MEMBARRIER: node->ty = ty_void; return; case ND_MWAIT: case ND_MONITOR: case ND_EMMS: case ND_SFENCE: case ND_LFENCE: case ND_MFENCE: case ND_PAUSE: case ND_PREFETCH: case ND_SETSSBSY: case ND_SAVEPREVSSP: case ND_XEND: case ND_SERIALIZE: case ND_XSUSLDTRK: case ND_XRESLDTRK: case ND_CLUI: case ND_STUI: case ND_WBNOINVD: case ND_WBINVD: case ND_VZEROALL: case ND_VZEROUPPER: case ND_FEMMS: case ND_WRITEEFLAGS_U64: case ND_INCSSPQ: case ND_RSTORSSP: case ND_WRSSD: case ND_WRSSQ: case ND_WRUSSD: case ND_WRUSSQ: case ND_CLRSSBSY: case ND_UNREACHABLE: node->ty = ty_void; return; case ND_EXCH: if (node->lhs->ty->kind != TY_PTR) error_tok(node->cas_addr->tok, "%s:%d: pointer expected", __FILE__, __LINE__); node->ty = node->lhs->ty->base; return; case ND_BUILTIN_NANF: case ND_BUILTIN_INFF: case ND_BUILTIN_HUGE_VALF: node->ty = ty_float; return; case ND_BUILTIN_NAN: case ND_BUILTIN_INF: case ND_BUILTIN_HUGE_VAL: node->ty = ty_double; return; case ND_BUILTIN_NANL: case ND_BUILTIN_HUGE_VALL: node->ty = ty_ldouble; return; case ND_CVTTSS2SI: case ND_CVTTSD2SI: case ND_VECEXTV2SI: case ND_VECEXTV16QI: case ND_VECEXTV8HI: case ND_VECEXTV4SI: node->ty = ty_int; return; case ND_CVTTSD2SI64: case ND_CVTSD2SI64: case ND_CVTSS2SI64: case ND_CVTTSS2SI64: case ND_VECEXTV2DI: node->ty = ty_long; return; case ND_VECINITV4HI: case ND_PCMPGTW: case ND_PCMPEQW: case ND_PSRLDI: case ND_PSRLD: case ND_PSRLWI: case ND_PSRLW: case ND_PSRAWI: case ND_PSRAW: case ND_PSLLWI: case ND_PSLLW: case ND_PMULLW: case ND_PMULHW: case ND_PMADDWD: case ND_PSUBSW: case ND_PSUBW: case ND_PADDW: case ND_PADDSW: case ND_PADDUSW: case ND_PUNPCKLWD: case ND_PUNPCKHWD: case ND_PACKSSDW: case ND_PAVGW: case ND_PACKSSDW128: case ND_PHADDW: case ND_PHADDSW: case ND_PMADDUBSW: case ND_PMULHRSW: case ND_PSIGNW: case ND_PABSW: node->ty = vector_of(ty_short, 4); return; case ND_PCMPEQB: case ND_PSUBUSB: case ND_PACKUSWB: case ND_PADDUSB: case ND_PMAXUB: case ND_PMINUB: case ND_PAVGB: node->ty = vector_of(ty_uchar, 8); return; case ND_VECINITV8QI: case ND_PCMPGTB: case ND_PSUBSB: case ND_PSUBB: case ND_PADDB: case ND_PADDSB: case ND_PUNPCKLBW: case ND_PUNPCKHBW: case ND_PACKSSWB: case ND_PSHUFB: case ND_PSIGNB: case ND_PABSB: node->ty = vector_of(ty_char, 8); return; case ND_PSUBUSW: case ND_PMULHUW: case ND_PHSUBW: case ND_PHSUBSW: node->ty = vector_of(ty_ushort, 4); return; case ND_PSUBUSW128: case ND_PMULHUW128: case ND_PAVGW128: case ND_PMAXUW128: case ND_PMINUW128: case ND_PHMINPOSUW128: node->ty = vector_of(ty_ushort, 8); return; case ND_PUNPCKHWD128: case ND_PUNPCKLWD128: case ND_PADDSW128: case ND_PADDUSW128: case ND_PSUBSW128: case ND_PSLLWI128: case ND_PSRAWI128: case ND_PSRLWI128: case ND_PSLLW128: case ND_PSRAW128: case ND_PSRLW128: case ND_PHADDW128: case ND_PMAXSW128: case ND_PMINSW128: case ND_PHADDSW128: case ND_PHSUBW128: case ND_PHSUBSW128: case ND_PMADDUBSW128: case ND_PMULHRSW128: case ND_PSIGNW128: case ND_PABSW128: case ND_PMOVSXBW128: case ND_PMOVZXBW128: case ND_PACKUSDW128: node->ty = vector_of(ty_short, 8); return; case ND_PUNPCKHDQ128: case ND_PUNPCKHQDQ128: case ND_PUNPCKLDQ128: case ND_PMADDWD128: case ND_PMULHW128: case ND_PSLLDI128: case ND_PSRADI128: case ND_PSRLDI128: case ND_PSLLD128: case ND_PSRAD128: case ND_PSRLD128: case ND_PANDN128: case ND_PHADDD128: case ND_PHSUBD128: case ND_PMOVSXBD128: case ND_PMOVSXWD128: case ND_PMOVZXBD128: case ND_PMOVZXWD128: case ND_PSHUFD: node->ty = vector_of(ty_int, 4); return; case ND_PUNPCKLQDQ128: case ND_PSLLQI128: case ND_PSRLQI128: case ND_PSLLQ128: case ND_PSRLQ128: case ND_PSADBW128: case ND_PMOVSXBQ128: node->ty = vector_of(ty_long, 2); return; case ND_ADDSD: case ND_SUBSD: case ND_MULSD: case ND_DIVSD: case ND_SQRTPD: case ND_MOVSD: case ND_SQRTSD: case ND_MINPD: case ND_MINSD: case ND_MAXPD: case ND_MAXSD: case ND_ANDPD: case ND_ANDNPD: case ND_ORPD: case ND_XORPD: case ND_CMPEQPD: case ND_CMPLTPD: case ND_CMPLEPD: case ND_CMPGTPD: case ND_CMPGEPD: case ND_CMPNEQPD: case ND_CMPNLTPD: case ND_CMPNLEPD: case ND_CMPNGTPD: case ND_CMPNGEPD: case ND_CMPORDPD: case ND_CMPUNORDPD: case ND_CMPEQSD: case ND_CMPLTSD: case ND_CMPLESD: case ND_CMPNEQSD: case ND_CMPNLTSD: case ND_CMPNLESD: case ND_CMPORDSD: case ND_CMPUNORDSD: case ND_CVTDQ2PD: case ND_CVTPI2PD: case ND_CVTPS2PD: case ND_CVTSI2SD: case ND_CVTSI642SD: case ND_CVTSS2SD: case ND_UNPCKHPD: case ND_UNPCKLPD: case ND_LOADHPD: case ND_LOADLPD: case ND_MOVMSKPD: case ND_MOVNTPD: case ND_ADDSUBPD: case ND_HADDPD: case ND_HSUBPD: case ND_BLENDVPD: node->ty = vector_of(ty_double, 2); return; case ND_PACKUSWB128: case ND_PUNPCKHBW128: case ND_PUNPCKLBW128: case ND_PADDUSB128: case ND_PSUBUSB128: case ND_PMAXUB128: case ND_PMINUB128: case ND_PAVGB128: case ND_PMINSB128: case ND_PMAXSB128: node->ty = vector_of(ty_uchar, 16); return; case ND_PACKSSWB128: case ND_PADDSB128: case ND_PSUBSB128: case ND_PSHUFB128: case ND_PSIGNB128: case ND_PABSB128: case ND_PBLENDVB128: node->ty = vector_of(ty_char, 16); return; case ND_CVTSS2SI: case ND_UCOMINEQ: case ND_UCOMIGE: case ND_UCOMIGT: case ND_UCOMILE: case ND_UCOMILT: case ND_UCOMIEQ: case ND_COMINEQ: case ND_COMIGE: case ND_COMIGT: case ND_COMILE: case ND_COMILT: case ND_COMIEQ: case ND_MOVMSKPS: case ND_PMOVMSKB: case ND_COMISDEQ: case ND_COMISDLT: case ND_COMISDLE: case ND_COMISDGT: case ND_COMISDGE: case ND_COMISDNEQ: case ND_UCOMISDEQ: case ND_UCOMISDLT: case ND_UCOMISDLE: case ND_UCOMISDGT: case ND_UCOMISDGE: case ND_UCOMISDNEQ: case ND_CVTSD2SI: case ND_PMOVMSKB128: case ND_PARITYL: case ND_PARITYLL: case ND_PARITY: case ND_PTESTZ128: case ND_PTESTC128: case ND_PTESTNZC128: case ND_RDPKRU: case ND_CRC32QI: case ND_CRC32HI: case ND_XTEST: case ND_BSRSI: case ND_CRC32SI: node->ty = ty_int; return; case ND_XBEGIN: case ND_RDPID: case ND_RDFSBASE32: case ND_RDGSBASE32: case ND_RDTSCP: case ND_RDPMC: case ND_SBB_U32: case ND_BEXTR_U32: case ND_PCMPGTB256_MASK: node->ty = ty_uint; return; case ND_BSRDI: case ND_CRC32DI: node->ty = ty_long; return; case ND_PHADDD: case ND_PHSUBD: case ND_PSIGND: case ND_PABSD: node->ty = vector_of(ty_int, 2); return; case ND_PMULDQ128: case ND_PMOVSXWQ128: case ND_PMOVSXDQ128: case ND_PMOVZXBQ128: case ND_PMOVZXDQ128: case ND_PMOVZXWQ128: case ND_MOVNTDQA: node->ty = vector_of(ty_llong, 2); return; case ND_READEFLAGS_U64: case ND_RDSSPQ: case ND_RDFSBASE64: case ND_RDGSBASE64: case ND_RDTSC: node->ty = ty_ullong; return; case ND_ROLQI: case ND_RORQI: case ND_TESTUI: case ND_ADDCARRYX_U32: case ND_SBB_U64: node->ty = ty_uchar; return; case ND_RORHI: case ND_ROLHI: case ND_TZCNT_U16: node->ty = ty_ushort; return; case ND_PSUBUSB256: case ND_PSHUFB256: case ND_PBLENDVB256: case ND_PSRLDQI256: case ND_PSLLDQI256: case ND_PALIGNR256: case ND_VPERM2I128_SI256: case ND_VINSERTF128_SI256: case ND_PBLENDD256: case ND_ANDNOTSI256: case ND_PMULHUW256: case ND_SI_SI256: case ND_PSRLQI256: case ND_PSLLQI256: case ND_PERMDI256: node->ty = vector_of(ty_uchar, 32); return; case ND_SI256_SI: case ND_VEXTRACTF128_SI256: case ND_PD256_PD: case ND_PS256_PS: node->ty = vector_of(ty_uchar, 16); return; case ND_PSLLDI256: case ND_PSRLDI256: case ND_PSRADI256: node->ty = vector_of(ty_int, 8); return; default: node->ty = ty_void_ptr; } } chibicc-1.0.24/unicode.c000077500000000000000000000231371517770275000150000ustar00rootroot00000000000000#include "chibicc.h" // Encode a given character in UTF-8. int encode_utf8(char *buf, uint32_t c) { if (c <= 0x7F) { buf[0] = c; return 1; } if (c <= 0x7FF) { buf[0] = 0b11000000 | (c >> 6); buf[1] = 0b10000000 | (c & 0b00111111); return 2; } if (c <= 0xFFFF) { buf[0] = 0b11100000 | (c >> 12); buf[1] = 0b10000000 | ((c >> 6) & 0b00111111); buf[2] = 0b10000000 | (c & 0b00111111); return 3; } buf[0] = 0b11110000 | (c >> 18); buf[1] = 0b10000000 | ((c >> 12) & 0b00111111); buf[2] = 0b10000000 | ((c >> 6) & 0b00111111); buf[3] = 0b10000000 | (c & 0b00111111); return 4; } // Read a UTF-8-encoded Unicode code point from a source file. // We assume that source files are always in UTF-8. // // UTF-8 is a variable-width encoding in which one code point is // encoded in one to four bytes. One byte UTF-8 code points are // identical to ASCII. Non-ASCII characters are encoded using more // than one byte. uint32_t decode_utf8(char **new_pos, char *p) { if ((unsigned char)*p < 128) { *new_pos = p + 1; return *p; } char *start = p; int len; uint32_t c; if ((unsigned char)*p >= 0b11110000) { len = 4; c = *p & 0b111; } else if ((unsigned char)*p >= 0b11100000) { len = 3; c = *p & 0b1111; } else if ((unsigned char)*p >= 0b11000000) { len = 2; c = *p & 0b11111; } else { error_at(start, "%s invalid UTF-8 sequence", __FILE__); } for (int i = 1; i < len; i++) { if ((unsigned char)p[i] >> 6 != 0b10) error_at(start, "%s invalid UTF-8 sequence", __FILE__); c = (c << 6) | (p[i] & 0b111111); } *new_pos = p + len; return c; } static bool in_range(uint32_t *range, uint32_t c) { for (int i = 0; range[i] != -1; i += 2) if (range[i] <= c && c <= range[i + 1]) return true; return false; } // [https://www.sigbus.info/n1570#D] C11 allows not only ASCII but // some multibyte characters in certan Unicode ranges to be used in an // identifier. // // This function returns true if a given character is acceptable as // the first character of an identifier. // // For example, ¾ (U+00BE) is a valid identifier because characters in // 0x00BE-0x00C0 are allowed, while neither ⟘ (U+27D8) nor ' ' // (U+3000, full-width space) are allowed because they are out of range. // to solve issue #117 I had to add 0--9 range to be allowed because some generics parameters // are defined after ## (double hashtag). Exemple in openssl ...(void))fromtype##2obj_decode}, // In this case chibicc manages 2 as a number because identifier should not start by a numeric value! // creating is_ident3 to manage it bool is_ident1(uint32_t c) { static uint32_t range[] = { '_', '_', 'a', 'z', 'A', 'Z', '$', '$', 0x00A8, 0x00A8, 0x00AA, 0x00AA, 0x00AD, 0x00AD, 0x00AF, 0x00AF, 0x00B2, 0x00B5, 0x00B7, 0x00BA, 0x00BC, 0x00BE, 0x00C0, 0x00D6, 0x00D8, 0x00F6, 0x00F8, 0x00FF, 0x0100, 0x02FF, 0x0370, 0x167F, 0x1681, 0x180D, 0x180F, 0x1DBF, 0x1E00, 0x1FFF, 0x200B, 0x200D, 0x202A, 0x202E, 0x203F, 0x2040, 0x2054, 0x2054, 0x2060, 0x206F, 0x2070, 0x20CF, 0x2100, 0x218F, 0x2460, 0x24FF, 0x2776, 0x2793, 0x2C00, 0x2DFF, 0x2E80, 0x2FFF, 0x3004, 0x3007, 0x3021, 0x302F, 0x3031, 0x303F, 0x3040, 0xD7FF, 0xF900, 0xFD3D, 0xFD40, 0xFDCF, 0xFDF0, 0xFE1F, 0xFE30, 0xFE44, 0xFE47, 0xFFFD, 0x10000, 0x1FFFD, 0x20000, 0x2FFFD, 0x30000, 0x3FFFD, 0x40000, 0x4FFFD, 0x50000, 0x5FFFD, 0x60000, 0x6FFFD, 0x70000, 0x7FFFD, 0x80000, 0x8FFFD, 0x90000, 0x9FFFD, 0xA0000, 0xAFFFD, 0xB0000, 0xBFFFD, 0xC0000, 0xCFFFD, 0xD0000, 0xDFFFD, 0xE0000, 0xEFFFD, -1, }; return in_range(range, c); } // Returns true if a given character is acceptable as a non-first // character of an identifier. bool is_ident2(uint32_t c) { static uint32_t range[] = { '_', '_', 'a', 'z', 'A', 'Z', '0', '9', '$', '$', 0x0300, 0x036F, 0x1DC0, 0x1DFF, 0x20D0, 0x20FF, 0xFE20, 0xFE2F, -1, }; return is_ident1(c) || in_range(range, c); } // Returns the number of columns needed to display a given // character in a fixed-width font. // // Based on https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c static int char_width(uint32_t c) { static uint32_t range1[] = { 0x0000, 0x001F, 0x007f, 0x00a0, 0x0300, 0x036F, 0x0483, 0x0486, 0x0488, 0x0489, 0x0591, 0x05BD, 0x05BF, 0x05BF, 0x05C1, 0x05C2, 0x05C4, 0x05C5, 0x05C7, 0x05C7, 0x0600, 0x0603, 0x0610, 0x0615, 0x064B, 0x065E, 0x0670, 0x0670, 0x06D6, 0x06E4, 0x06E7, 0x06E8, 0x06EA, 0x06ED, 0x070F, 0x070F, 0x0711, 0x0711, 0x0730, 0x074A, 0x07A6, 0x07B0, 0x07EB, 0x07F3, 0x0901, 0x0902, 0x093C, 0x093C, 0x0941, 0x0948, 0x094D, 0x094D, 0x0951, 0x0954, 0x0962, 0x0963, 0x0981, 0x0981, 0x09BC, 0x09BC, 0x09C1, 0x09C4, 0x09CD, 0x09CD, 0x09E2, 0x09E3, 0x0A01, 0x0A02, 0x0A3C, 0x0A3C, 0x0A41, 0x0A42, 0x0A47, 0x0A48, 0x0A4B, 0x0A4D, 0x0A70, 0x0A71, 0x0A81, 0x0A82, 0x0ABC, 0x0ABC, 0x0AC1, 0x0AC5, 0x0AC7, 0x0AC8, 0x0ACD, 0x0ACD, 0x0AE2, 0x0AE3, 0x0B01, 0x0B01, 0x0B3C, 0x0B3C, 0x0B3F, 0x0B3F, 0x0B41, 0x0B43, 0x0B4D, 0x0B4D, 0x0B56, 0x0B56, 0x0B82, 0x0B82, 0x0BC0, 0x0BC0, 0x0BCD, 0x0BCD, 0x0C3E, 0x0C40, 0x0C46, 0x0C48, 0x0C4A, 0x0C4D, 0x0C55, 0x0C56, 0x0CBC, 0x0CBC, 0x0CBF, 0x0CBF, 0x0CC6, 0x0CC6, 0x0CCC, 0x0CCD, 0x0CE2, 0x0CE3, 0x0D41, 0x0D43, 0x0D4D, 0x0D4D, 0x0DCA, 0x0DCA, 0x0DD2, 0x0DD4, 0x0DD6, 0x0DD6, 0x0E31, 0x0E31, 0x0E34, 0x0E3A, 0x0E47, 0x0E4E, 0x0EB1, 0x0EB1, 0x0EB4, 0x0EB9, 0x0EBB, 0x0EBC, 0x0EC8, 0x0ECD, 0x0F18, 0x0F19, 0x0F35, 0x0F35, 0x0F37, 0x0F37, 0x0F39, 0x0F39, 0x0F71, 0x0F7E, 0x0F80, 0x0F84, 0x0F86, 0x0F87, 0x0F90, 0x0F97, 0x0F99, 0x0FBC, 0x0FC6, 0x0FC6, 0x102D, 0x1030, 0x1032, 0x1032, 0x1036, 0x1037, 0x1039, 0x1039, 0x1058, 0x1059, 0x1160, 0x11FF, 0x135F, 0x135F, 0x1712, 0x1714, 0x1732, 0x1734, 0x1752, 0x1753, 0x1772, 0x1773, 0x17B4, 0x17B5, 0x17B7, 0x17BD, 0x17C6, 0x17C6, 0x17C9, 0x17D3, 0x17DD, 0x17DD, 0x180B, 0x180D, 0x18A9, 0x18A9, 0x1920, 0x1922, 0x1927, 0x1928, 0x1932, 0x1932, 0x1939, 0x193B, 0x1A17, 0x1A18, 0x1B00, 0x1B03, 0x1B34, 0x1B34, 0x1B36, 0x1B3A, 0x1B3C, 0x1B3C, 0x1B42, 0x1B42, 0x1B6B, 0x1B73, 0x1DC0, 0x1DCA, 0x1DFE, 0x1DFF, 0x200B, 0x200F, 0x202A, 0x202E, 0x2060, 0x2063, 0x206A, 0x206F, 0x20D0, 0x20EF, 0x302A, 0x302F, 0x3099, 0x309A, 0xA806, 0xA806, 0xA80B, 0xA80B, 0xA825, 0xA826, 0xFB1E, 0xFB1E, 0xFE00, 0xFE0F, 0xFE20, 0xFE23, 0xFEFF, 0xFEFF, 0xFFF9, 0xFFFB, 0x10A01, 0x10A03, 0x10A05, 0x10A06, 0x10A0C, 0x10A0F, 0x10A38, 0x10A3A, 0x10A3F, 0x10A3F, 0x1D167, 0x1D169, 0x1D173, 0x1D182, 0x1D185, 0x1D18B, 0x1D1AA, 0x1D1AD, 0x1D242, 0x1D244, 0xE0001, 0xE0001, 0xE0020, 0xE007F, 0xE0100, 0xE01EF, -1, }; if (in_range(range1, c)) return 0; static uint32_t range2[] = { 0x1100, 0x115F, 0x2329, 0x2329, 0x232A, 0x232A, 0x2E80, 0x303E, 0x3040, 0xA4CF, 0xAC00, 0xD7A3, 0xF900, 0xFAFF, 0xFE10, 0xFE19, 0xFE30, 0xFE6F, 0xFF00, 0xFF60, 0xFFE0, 0xFFE6, 0x1F000, 0x1F644, 0x20000, 0x2FFFD, 0x30000, 0x3FFFD, -1, }; if (in_range(range2, c)) return 2; return 1; } // Returns the number of columns needed to display a given // string in a fixed-width font. int display_width(char *p, int len) { char *start = p; int w = 0; while (p - start < len) { uint32_t c = decode_utf8(&p, p); w += char_width(c); } return w; }