<commit_before>/* Copyright (c) 2001, Stanford University
 * All rights reserved.
 *
 * See the file LICENSE.txt for information on redistributing this software.
 */

#ifndef CR_PACK_BBOX_H
#define CR_PACK_BBOX_H

#include "cr_pack.h"

#define UPDATE_1D_BBOX() \
if (pc->bounds_min.x > fx)    pc->bounds_min.x = fx;\
if (pc->bounds_min.y > 0.0f)  pc->bounds_min.y = 0.0f;\
if (pc->bounds_min.z > 0.0f)  pc->bounds_min.z = 0.0f;\
if (pc->bounds_max.x < fx)    pc->bounds_max.x = fx;\
if (pc->bounds_max.y < 0.0f)  pc->bounds_max.y = 0.0f;\
if (pc->bounds_max.z < 0.0f)  pc->bounds_max.z = 0.0f

#if defined(WINDOWS) && !defined(CHROMIUM_THREADSAFE)
#define UPDATE_2D_BBOX() \
__asm {\
	__asm fld fx\
	__asm fld pc->bounds_min.x\
	__asm fcomi st, st(1)\
	__asm fcmovnb st(0), st(1)\
	__asm fstp pc->bounds_min.x\
	__asm fld pc->bounds_max.x\
	__asm fcomi st, st(1)\
	__asm fcmovb st(0), st(1)\
	__asm fstp pc->bounds_max.x\
	__asm fstp fx\
	\
	__asm fld fy\
	__asm fld pc->bounds_min.y\
	__asm fcomi st, st(1)\
	__asm fcmovnb st(0), st(1)\
	__asm fstp pc->bounds_min.y\
	__asm fld pc->bounds_max.y\
	__asm fcomi st, st(1)\
	__asm fcmovb st(0), st(1)\
	__asm fstp pc->bounds_max.y\
	__asm fstp fy\
} \
	if (pc->bounds_min.z > 0.0f)  pc->bounds_min.z = 0.0f;\
	if (pc->bounds_max.z < 0.0f)  pc->bounds_max.z = 0.0f
#else
#define UPDATE_2D_BBOX() \
if (pc->bounds_min.x > fx)    pc->bounds_min.x = fx;\
if (pc->bounds_min.y > fy)    pc->bounds_min.y = fy;\
if (pc->bounds_min.z > 0.0f)  pc->bounds_min.z = 0.0f;\
if (pc->bounds_max.x < fx)    pc->bounds_max.x = fx;\
if (pc->bounds_max.y < fy)    pc->bounds_max.y = fy;\
if (pc->bounds_max.z < 0.0f)  pc->bounds_max.z = 0.0f
#endif

#if defined(WINDOWS) && !defined(CHROMIUM_THREADSAFE)
#define UPDATE_3D_BBOX() \
__asm {\
	__asm fld fx\
	__asm fld pc->bounds_min.x\
	__asm fcomi st, st(1)\
	__asm fcmovnb st(0), st(1)\
	__asm fstp pc->bounds_min.x\
	__asm fld pc->bounds_max.x\
	__asm fcomi st, st(1)\
	__asm fcmovb st(0), st(1)\
	__asm fstp pc->bounds_max.x\
	__asm fstp fx\
	\
	__asm fld fy\
	__asm fld pc->bounds_min.y\
	__asm fcomi st, st(1)\
	__asm fcmovnb st(0), st(1)\
	__asm fstp pc->bounds_min.y\
	__asm fld pc->bounds_max.y\
	__asm fcomi st, st(1)\
	__asm fcmovb st(0), st(1)\
	__asm fstp pc->bounds_max.y\
	__asm fstp fy\
	\
	__asm fld fz\
	__asm fld pc->bounds_min.z\
	__asm fcomi st, st(1)\
	__asm fcmovnb st(0), st(1)\
	__asm fstp pc->bounds_min.z\
	__asm fld pc->bounds_max.z\
	__asm fcomi st, st(1)\
	__asm fcmovb st(0), st(1)\
	__asm fstp pc->bounds_max.z\
	__asm fstp fz\
	\
}
#else
#define UPDATE_3D_BBOX() \
if (pc->bounds_min.x > fx)    pc->bounds_min.x = fx; \
if (pc->bounds_min.y > fy)    pc->bounds_min.y = fy; \
if (pc->bounds_min.z > fz)    pc->bounds_min.z = fz; \
if (pc->bounds_max.x < fx)    pc->bounds_max.x = fx; \
if (pc->bounds_max.y < fy)    pc->bounds_max.y = fy; \
if (pc->bounds_max.z < fz)    pc->bounds_max.z = fz
#endif

#ifdef SIMD
#define UPDATE_3D_BBOX_SIMD() \
__asm {\
	__asm movups xmm0, fx\
	__asm movaps xmm1, pc->bounds_min.x\
	__asm movaps xmm2, pc->bounds_max.x\
	__asm minps xmm1, xmm0\
	__asm maxps xmm2, xmm0\
	__asm movaps pc->bounds_min.x, xmm1\
	__asm movaps pc->bounds_max.x, xmm2\
}
#define UPDATE_3D_BBOX_SIMD_PACK() \
__asm {\
	__asm mov ecx, [data_ptr]\
	__asm movups xmm0, fx\
	__asm movaps xmm1, pc->bounds_min.x\<commit_msg>Yack inline asm code.  I'm not sure why this started breaking now...<commit_after>/* Copyright (c) 2001, Stanford University
 * All rights reserved.
 *
 * See the file LICENSE.txt for information on redistributing this software.
 */

#ifndef CR_PACK_BBOX_H
#define CR_PACK_BBOX_H

#include "cr_pack.h"

#define UPDATE_1D_BBOX() \
if (pc->bounds_min.x > fx)    pc->bounds_min.x = fx;\
if (pc->bounds_min.y > 0.0f)  pc->bounds_min.y = 0.0f;\
if (pc->bounds_min.z > 0.0f)  pc->bounds_min.z = 0.0f;\
if (pc->bounds_max.x < fx)    pc->bounds_max.x = fx;\
if (pc->bounds_max.y < 0.0f)  pc->bounds_max.y = 0.0f;\
if (pc->bounds_max.z < 0.0f)  pc->bounds_max.z = 0.0f

#define UPDATE_2D_BBOX() \
if (pc->bounds_min.x > fx)    pc->bounds_min.x = fx;\
if (pc->bounds_min.y > fy)    pc->bounds_min.y = fy;\
if (pc->bounds_min.z > 0.0f)  pc->bounds_min.z = 0.0f;\
if (pc->bounds_max.x < fx)    pc->bounds_max.x = fx;\
if (pc->bounds_max.y < fy)    pc->bounds_max.y = fy;\
if (pc->bounds_max.z < 0.0f)  pc->bounds_max.z = 0.0f

#define UPDATE_3D_BBOX() \
if (pc->bounds_min.x > fx)    pc->bounds_min.x = fx; \
if (pc->bounds_min.y > fy)    pc->bounds_min.y = fy; \
if (pc->bounds_min.z > fz)    pc->bounds_min.z = fz; \
if (pc->bounds_max.x < fx)    pc->bounds_max.x = fx; \
if (pc->bounds_max.y < fy)    pc->bounds_max.y = fy; \
if (pc->bounds_max.z < fz)    pc->bounds_max.z = fz

#ifdef SIMD
#define UPDATE_3D_BBOX_SIMD() \
__asm {\
	__asm movups xmm0, fx\
	__asm movaps xmm1, pc->bounds_min.x\
	__asm movaps xmm2, pc->bounds_max.x\
	__asm minps xmm1, xmm0\
	__asm maxps xmm2, xmm0\
	__asm movaps pc->bounds_min.x, xmm1\
	__asm movaps pc->bounds_max.x, xmm2\
}
#define UPDATE_3D_BBOX_SIMD_PACK() \
__asm {\
	__asm mov ecx, [data_ptr]\
	__asm movups xmm0, fx\
	__asm movaps xmm1, pc->bounds_min.x\
{'fraction_non_alphanumeric': 0.17060316220964278, 'fraction_numerical': 0.024985360140542652, 'mean_word_length': 3.1658536585365855, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 128, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3697300', 'n_tokens_mistral': 2552, 'n_tokens_neox': 2487, 'n_words': 544}