Better HN
topnewbestaskshowjobs
Log inSign up

mmozeiko

698 karma · joined Jul 27, 2011 (15y ago) · 150 submissions

https://github.com/mmozeiko/
Submissions

comment 3w ago · link · parent

Another small standalone single-binary rss reader is https://nkanaev.github.io/yarr/en/

It also supports fever api so you can use all kinds of mobile clients. The binary is smaller, and I prefer three column layout for reading on web.

comment 1mo ago · link · parent

> Inverses exist for each operation, which makes decryption possible.

It is worth mentioning that in modern AES usage this feature does not really matter, because block cipher is used in CTR mode. In CTR block cipher is used to create long keystream bytes (pretty much one-time-pad key). This keystream gets xor'ed with plaintext to get ciphertext. Then getting from ciphertext back to plaintext is exactly the same xor operation with same keystream, no inverse AES operations needed.

3.

Bringing Correctly Rounded Math to Production with LLVM-Libc(devblogs.microsoft.com ↗)

3 points · by mmozeiko · 2mo ago · discuss

4.

Shared Memory Consistency from Scratch Part 1: Causality(allthoughts.me ↗)

2 points · by mmozeiko · 2mo ago · discuss

comment 3mo ago · link · parent

See the following pdf for example on how to do this with SSSE3 (pages 104-133) or even SSE2 (pages 151-173)

https://deplinenoise.files.wordpress.com/2015/03/gdc2015_afr...

comment 7mo ago · link · parent

sub is also recognized as zeroing idiom for register file. Intel documents these in "3.5.1.7 Clearing Registers and Dependency Breaking Idioms" from Optimization Reference Manual: https://www.intel.com/content/www/us/en/developer/articles/t...

Here's html version: https://zzqcn.github.io/perf/intel_opt_manual/3.html#clearin...

AMD has similar list in "2.9.2 Idioms for Dependency removal" from "Software Optimization Guide for the AMD Zen5 Microarchitecture" document: https://docs.amd.com/v/u/en-US/58455_1.00

comment 7mo ago · link · parent

xor swap trick was useful in older simd (sse1/sse2) when based on some condition you want to swap values or not:

  tmp = (a ^ b) & mask
  a ^= tmp
  b ^= tmp
If mask = 0xfff...fff then a/b will be swapped, otherwise if mask = 0 then they'll remain the same.

comment 8mo ago · link · parent

How does it compare to rendering SVG by Direct2D itself? When using ID2D1DeviceContext5::DrawSvgDocument method, and ID2D1SvgDocument can be loaded from file with ID2D1DeviceContext5::CreateSvgDocument + SHCreateStreamOnFileW.

9.

An Innocuous Blog Post about vPMU in QEMU(vulpinecitrus.info ↗)

3 points · by mmozeiko · 9mo ago · discuss

comment 1y ago · link · parent

Ah, I see. Yeah, then the current approach is fine.

comment 1y ago · link · parent

From what I understand from code those unwarps are just doing matrix multiply to get unwraped pixel location? In this case doing these operations directly in fragment shader instead of texture lookup will be faster. Memory bandwidth is not free. But simple ALU like this (just couple FMA's) can easily hide in shadow of texture sampling that happens afterwards. So simply upload those undistortion matrices (mat1 & mat2) as uniforms and do matrix multiply in shader for adjusting texcoords.

comment 1y ago · link · parent

There's also Windows.Graphics.Capture. It allows to get texture not only for whole desktop, but just individual windows.

comment 1y ago · link · parent

I don't know why Signal calls it "DRM" because the do not use DRM for this. Typically DRM means encryption & keys are involved (which is what Netflix & others are doing with Widevine or PlayReady).

All Signal does is just a simple Windows API call to exclude window from screen capture. SetWindowDisplayAffinity function with WDA_EXCLUDEFROMCAPTURE argument: https://learn.microsoft.com/en-us/windows/win32/api/winuser/...

comment 1y ago · link · parent

If you change logic and/or to bitwise and/or then it'll be branchless.

comment 1y ago · link · parent

https://github.com/veluca93/fpnge is a very fast png encoder. A bit lower compression ratio, but runs significantly faster than alternatives. Here is a presentation with benchmarks:

https://www.lucaversari.it/FJXL_and_FPNGE.pdf

comment 2y ago · link · parent

There is a simple way to get that immediate from expression you want to calculate. For example, if you want to calculate following expression:

    (NOT A) OR ((NOT B) XOR (C AND A))
then you simply write

    ~_MM_TERNLOG_A | (~_MM_TERNLOG_B ^ (_MM_TERNLOG_C & _MM_TERNLOG_A))
Literally the expression you want to calculate. It evaluates to immediate from _MM_TERNLOG_A/B/C constants defined in intrinsic headers, at least for gcc & clang:

    typedef enum {
      _MM_TERNLOG_A = 0xF0,
      _MM_TERNLOG_B = 0xCC,
      _MM_TERNLOG_C = 0xAA
    } _MM_TERNLOG_ENUM;
For MSVC you define them yourself.

comment 2y ago · link · parent

Unfortunately not everything. For example, no xbox 360 controller support: https://github.com/microsoft/GDK/issues/39

comment 2y ago · link · parent

It is called far2l: https://packages.debian.org/search?keywords=far2l&searchon=n...

comment 3y ago · link · parent

Alt + start typing jumps to file/folder with this name.

Ctrl + enter puts currently selected file/folder name into command-line.

Ctrl + O hides panels and shows you "background" with all the previous command outputs.

Custom editor can be set in F9 -> Options -> Editor settings.

comment 3y ago · link · parent

I recommend Polygon as virtual filesystem for SQLite database files: https://plugring.farmanager.com/plugin.php?l=en&pid=973

PortaDev for accessing MTP mounts (like Android): https://plugring.farmanager.com/plugin.php?l=en&pid=933

DiskMenu for adding custom locations in Alt+F1/F2 menus: https://sourceforge.net/projects/farplugs/files/DiskMenu/

And if you're running Far under ConEmu, copy ConEmu\Plugins\ConEmu folder into Far's Plugins folder. It will do better integration with ConEmu (there will be bunch of new ConEmu related features under F11 menu in Far).

comment 3y ago · link · parent

On Ubuntu this seems to be official (?) ppa: https://launchpad.net/~far2l-team/+archive/ubuntu/ppa Make sure "far2l-gui" is installed.

On ArchLinux there's package in AUR: https://aur.archlinux.org/packages/far2l-git (I maintain it).

Don't know details for other distros.

comment 3y ago · link · parent

Make sure you run wxgtk build, not the terminal one. Terminal is limited on what shortcuts it can do. But wxgtk build runs exactly as windows counterpart - Alt+F1/F2 and many other shortcuts work fine.

comment 3y ago · link · parent

Here's a fancy trick from LLVM source: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Targ...

  #define A 0xf0
  #define B 0xcc
  #define C 0xaa
And then you can build immediate for VPTERNLOG operation by writing bitwise expression with A/B/C values in source code.

For example, A^B^C=150. A^(~B&C)=210. And so on...

Also mentioned by Fabian here: https://twitter.com/rygorous/status/1187032693944410114

comment 3y ago · link · parent

There's also dxwrapper that implements old DirectDraw/3D interfaces with newer D3D9 api for better compatibility with newer Windows versions:

https://github.com/elishacloud/dxwrapper

comment 3y ago · link · parent

I'm pretty sure such thing is implemented by hooking OS functions that are dealing with directory enumeration, create/open file, etc - and then redirecting to custom code that provides virtual files & their contents. There's no standard Windows API for that, aside writing custom driver. But hooking such functions is relatively straight forward process because they are imported from well known shared libraries - you just need to make sure you hook all the functions that are relevant to filesystem operations.

comment 3y ago · link · parent

Not fully open-sourced. There are bunch of pieces that are available only in compiled form - .obj/lib files. Like math.h functions.

comment 4y ago · link · parent

You can use it for any workload that can use D3D12 buffers or textures as input. All the API does for you is transfer data from disk to ID3D12Resource object. After that it is up to you to do whatever you want - use it for fragment shader or compute shader input, etc.. If you use other api's like cuda or vulkan, then you'll need to use interop to create their resources using D3D12 backed resource (or do a copy, whatever is possible there).

comment 4y ago · link · parent

It is there to process last <32 elements. The vectorized loop processes up to 32 elements per iteration. The iteration does not happen if there are less than 32 elements left, because it wants to load 32 bytes as input. This is very typical in vectorized loops - process N elements per iteration and second loop that does tail of <N elements.

comment 4y ago · link · parent

Btw there are alternative flac encoders, like FLACCL using GPU: http://cue.tools/wiki/FLACCL It compresses much faster than software libflac and gives smaller output files.
12345