Skip to content

Instantly share code, notes, and snippets.

invalid_mask = _mm256_cmp_ps(x, _mm256_setzero_ps(), _CMP_NGE_UQ); // not greater equal is true if x is NaN
iszero_mask = _mm256_cmp_ps(x, _mm256_setzero_ps(), _CMP_EQ_OQ);
return _mm256_or_ps(
_mm256_andnot_ps(iszero_mask, _mm256_or_ps(x, invalid_mask)),
_mm256_and_ps(iszero_mask, *(v8sf *)_ps256_minus_inf));
/* Compare */
#define _CMP_EQ_OQ 0x00 /* Equal (ordered, non-signaling) */
@clyang
clyang / backup_venv.sh
Created May 15, 2023 16:02 — forked from ashwinvis/backup_venv.sh
Backup virtualenv before a Python 3.x upgrade and restore / recreate after the upgrade
#!/bin/bash
cd ~
pip freeze --user --exclude-editable > REQUIREMENTS.txt
cd $WORKON_HOME # or wherever you store your virtualenvs
for activate in ./*/bin/activate
do
source $activate
echo $VIRTUAL_ENV