jamesbowman / swapforth

Swapforth is a cross-platform ANS Forth
BSD 3-Clause "New" or "Revised" License
275 stars 56 forks source link

AVX instructions for x64 #33

Open postspectacular opened 8 years ago

postspectacular commented 8 years ago

Hi James, I've been studying and successfully building the x64 version on OSX, but then realised that the code contains a few AVX instruction not supported on slightly older machines (e.g. my 2010 MBP i7 lacks AVX). Are these really needed or could they be conditionally be rewritten using only SSE2/3/4? I'll do some digging what these instruction exactly achieve and might create a PR (if I'm successful), but any guidance would be appreciated. Thanks!

jamesbowman commented 8 years ago

Aha, yes. If you do create a pull request would be appreciated. These instructions are all doing word matching in the dictionary inner loop. There is also some AVX instructions to do case-folding, so that the comparison is case-insentive.

Multiple SSE4 instructions could do that same work, I think.

Thanks! J.