newhoggy (John Ky)
User

Projects

User does not belong to any projects.

User Details

User Since
Oct 3 2017, 4:22 PM (58 w, 5 d)

Recent Activity

Mon, Oct 29

newhoggy added a comment to D4849: Add cmpeq pack int instructions.

Thanks for the update @Abhiroop!

Mon, Oct 29, 3:30 PM

Sun, Oct 28

newhoggy added a comment to D4849: Add cmpeq pack int instructions.

I'm not currently working on this.

Sun, Oct 28, 8:07 PM

Jun 27 2018

newhoggy updated the diff for D4882: WIP Add support for SIMD integer instructions.
  • Add more tracing
Jun 27 2018, 6:58 AM
newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

I can continue the investigation to find out where the call to cmmMachOpFold comes from, but if any of this rings a bell and the behaviour can be explained, please let me know.

Jun 27 2018, 6:58 AM
newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

I added some tracing and have pushed the code so that I can better illustrate the problem.

Jun 27 2018, 5:57 AM
newhoggy updated the diff for D4882: WIP Add support for SIMD integer instructions.
  • Add tracing
Jun 27 2018, 5:57 AM

Jun 26 2018

newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

I traced the problem code through these functions that seem have something to do with constant folding.

Jun 26 2018, 11:52 PM
newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

I've found there were three call sites at which the MO_V_Insert constructor was called.

Jun 26 2018, 9:09 AM

Jun 25 2018

newhoggy updated the diff for D4882: WIP Add support for SIMD integer instructions.

Rebase on https://github.com/Abhiroop/ghc-1/tree/wip/simd-ncg-support

Jun 25 2018, 6:37 PM

Jun 22 2018

newhoggy added a comment to D4813: [WIP] Add support for SIMD operations in the NCG.

I put a test PR up to see if I can make a PR. Looks like the base is different to that in D4813:

Jun 22 2018, 6:09 PM
newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

I just had a thought. Perhaps the problem might be my use of the https URL instead of a git url.

Jun 22 2018, 6:58 AM
newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

Thanks for your help.

Jun 22 2018, 6:54 AM
newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

Unfortunately, I've not been able to clone from https://github.com/Abhiroop/ghc and do a build there.

Jun 22 2018, 5:01 AM

Jun 21 2018

newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

I figured I'm going to need to figure out how gcc compiles code into assembly to inform me of the kind of assembly I should be generating, so I put together a small Github project where I can drop C files and have then compiled into assembly:

Jun 21 2018, 8:27 AM
newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

The problem I have trouble understanding is why there is an additional two uses of the vmovdqu64 instruction preceding the vmovdqu32 %xmm0,%rax that I generate:

Jun 21 2018, 7:42 AM
newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

I've also pasting here the problematic generated assembly:

Jun 21 2018, 7:39 AM
newhoggy added a comment to D4882: WIP Add support for SIMD integer instructions.

I've pushed the code changes I have so far. It is compiling, but not working in the sense that the generated assembly code does not compile.

Jun 21 2018, 7:37 AM
newhoggy created D4882: WIP Add support for SIMD integer instructions.
Jun 21 2018, 7:33 AM

Jun 20 2018

newhoggy added a comment to D4813: [WIP] Add support for SIMD operations in the NCG.

I've been playing around with code on this branch. If I want to merge code into it, how might I go about it?

Jun 20 2018, 6:08 PM

Jun 19 2018

newhoggy added a comment to D4849: Add cmpeq pack int instructions.

Thanks for your advice.

Jun 19 2018, 5:37 PM
newhoggy added a comment to D4849: Add cmpeq pack int instructions.

Thanks for your advice.

Jun 19 2018, 5:34 PM
newhoggy added a comment to D4849: Add cmpeq pack int instructions.

Maybe I can managed to get this to work without rebasing on D4813, but I will need to be able to move the data to and from an MMX register.

Jun 19 2018, 1:03 PM
newhoggy updated the diff for D4849: Add cmpeq pack int instructions.

Add cmpeq pack int instructions

Jun 19 2018, 1:03 PM

Jun 17 2018

newhoggy added a comment to D4849: Add cmpeq pack int instructions.

I'd like to rebase on D4813 to get access to some of that code. What's the best way to go about this?

Jun 17 2018, 7:11 PM

Jun 16 2018

newhoggy added a comment to D4849: Add cmpeq pack int instructions.

It turns out that GHC will append a q to the name of my instruction, which in the case of the instructions I want to support is incorrect:

Jun 16 2018, 10:33 AM
Herald added a reviewer for D4236: Add new mbmi and mbmi2 compiler flags: jrtc27.
Jun 16 2018, 10:33 AM
newhoggy updated the diff for D4849: Add cmpeq pack int instructions.
  • Fix instruction mnemonic name
Jun 16 2018, 10:33 AM

Jun 15 2018

newhoggy added a comment to D4849: Add cmpeq pack int instructions.

I just added the -mmmx compiler flag. Only problem is it seems to be on permanently. I'm expecting that if I don't specify it that it should fall back to the functions in cmpeqpi.c and cmpgtpi.c.

Jun 15 2018, 9:50 PM
newhoggy updated the diff for D4849: Add cmpeq pack int instructions.
  • Add -mmmx flag
Jun 15 2018, 9:50 PM
newhoggy updated the diff for D4849: Add cmpeq pack int instructions.
  • Add -mmmx flag
Jun 15 2018, 9:29 PM
newhoggy updated the diff for D4849: Add cmpeq pack int instructions.
  • Add -mmmx flag
Jun 15 2018, 9:00 PM
newhoggy updated the diff for D4849: Add cmpeq pack int instructions.
  • Add cmpgt packed int instructions
Jun 15 2018, 8:59 AM
newhoggy added a comment to D4849: Add cmpeq pack int instructions.

cmpeq* instructions are working both natively and with llvm.

Jun 15 2018, 7:06 AM
newhoggy updated the diff for D4849: Add cmpeq pack int instructions.
  • Fix test and emulated primops. Add llvm support.
Jun 15 2018, 7:06 AM
newhoggy added a comment to D4849: Add cmpeq pack int instructions.

Work In Progress.

Jun 15 2018, 12:09 AM
newhoggy created D4849: Add cmpeq pack int instructions.
Jun 15 2018, 12:09 AM

Feb 5 2018

newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

Thanks Ben!

Feb 5 2018, 9:36 PM

Jan 19 2018

newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

Tests now also passing for llvm

Jan 19 2018, 8:31 AM
newhoggy updated the diff for D4236: Add new mbmi and mbmi2 compiler flags.
  • Use zero extension rather than sign extension for pdep and pext intrinsics
  • Remove unused code
Jan 19 2018, 5:58 AM

Jan 9 2018

newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

I've reproduced the problem with the following snippet of llvm code:

Jan 9 2018, 3:52 AM

Jan 7 2018

newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

I struggled a bit with the diff due to the generated bytecode being very different as a result of generated variable names, but I managed to pin it down with some editing.

Jan 7 2018, 5:18 PM
newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

I made the following changes to truncate the word to the correct word size and the tests pass.

Jan 7 2018, 12:42 AM

Jan 5 2018

newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

I've reproduced the problem. Looks like for whatever reason, I need to use WAY=llvm instead of WAY=optllvm.

Jan 5 2018, 4:49 PM
newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

Sorry for the delay, @newhoggy; the holidays ended up being a bit more busy than I expected. Unfortunately this still doesn't pass the testsuite with the LLVM way. In particular, cgrun075 fails with (using LLVM 5.0),

=====> cgrun075(optllvm) 1 of 1 [0, 0, 0]
cd "./codeGen/should_run/cgrun075.run" &&  "/mnt/work/ghc/ghc-testing/inplace/test   spaces/ghc-stage2" -o cgrun075 cgrun075.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output  -O -fllvm 
cd "./codeGen/should_run/cgrun075.run" && ./cgrun075  
Actual stdout output differs from expected:
diff -uw "./codeGen/should_run/cgrun075.run/cgrun075.stdout.normalised" "./codeGen/should_run/cgrun075.run/cgrun075.run.stdout.normalised"
--- ./codeGen/should_run/cgrun075.run/cgrun075.stdout.normalised	2018-01-02 18:53:28.847209031 -0500
+++ ./codeGen/should_run/cgrun075.run/cgrun075.run.stdout.normalised	2018-01-02 18:53:28.847209031 -0500
@@ -1,5 +1,14 @@
 OK
-OK
-OK
-OK
+FAIL
+   Input: (40,150)
+Expected: 128
+  Actual: -128
+FAIL
+   Input: (48250,63528)
+Expected: 61472
+  Actual: -4064
+FAIL
+   Input: (824360058,3457084310)
+Expected: 2316176260
+  Actual: -1978791036
 OK
*** unexpected failure for cgrun075(optllvm)

Did this work for your under LLVM?

Jan 5 2018, 4:29 PM

Dec 26 2017

newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

How's it looking. 😄

Dec 26 2017, 2:57 AM

Dec 5 2017

newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

I think I've incorporated all the changes requested. Let me know if I've missed everything. Thanks!

Dec 5 2017, 10:40 AM
newhoggy updated the diff for D4236: Add new mbmi and mbmi2 compiler flags.
  • Remove unused C functions
Dec 5 2017, 10:32 AM
newhoggy updated the diff for D4236: Add new mbmi and mbmi2 compiler flags.
  • Fallback to C functions when BMI2 is unavailable
Dec 5 2017, 10:23 AM

Dec 3 2017

newhoggy updated the diff for D4236: Add new mbmi and mbmi2 compiler flags.
  • Add size suffix
  • Support more than two arguments
Dec 3 2017, 4:38 AM
newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

Seems like make test TEST="cgrun075 cgrun076" WAY=optllvm is insufficient to test the llvm backend.

Dec 3 2017, 4:36 AM

Nov 28 2017

newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

I'm still missing the guards that fallback to hs_pdep

Nov 28 2017, 6:23 AM
newhoggy updated the diff for D4236: Add new mbmi and mbmi2 compiler flags.
  • Fix number of arguments in pdep and pext calls
Nov 28 2017, 6:18 AM
newhoggy updated the diff for D4236: Add new mbmi and mbmi2 compiler flags.
  • Fix number of arguments in pdep and pext calls
Nov 28 2017, 6:14 AM
newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

I performed an llvm dump like so:

Nov 28 2017, 1:46 AM

Nov 27 2017

newhoggy added inline comments to D4236: Add new mbmi and mbmi2 compiler flags.
Nov 27 2017, 6:53 PM
newhoggy updated the diff for D4236: Add new mbmi and mbmi2 compiler flags.
  • Use 32/64 suffix instead of i32/i64 suffix
Nov 27 2017, 6:53 PM
newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

Cloning from scratch seems to help. I'm letting this compile overnight.

Nov 27 2017, 6:42 AM
newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

I also seem to have broken something. I can't run make anymore:

Nov 27 2017, 6:25 AM
newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

I also tried this in case it made a difference:

Nov 27 2017, 6:11 AM
newhoggy added a comment to D4236: Add new mbmi and mbmi2 compiler flags.

I've installed llvm on my macos and updated the GHC code to use llvm.x86.bmi.pext and llvm.x86.bmi.pdep, but have been unable to get the compile to work. I may need a bit of hand-holding here since I've not had any llvm experience before.

Nov 27 2017, 6:09 AM
newhoggy updated the diff for D4236: Add new mbmi and mbmi2 compiler flags.
  • Add llvm options for bmi & bmi2
  • Use llvm.x86.bmi.pdep and llvm.x86.bmi.pext instead
Nov 27 2017, 6:01 AM

Nov 25 2017

newhoggy updated the diff for D4236: Add new mbmi and mbmi2 compiler flags.

Add new mbmi and mbmi2 compiler flags

Nov 25 2017, 5:18 PM
newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

Cool. Thanks! I've created a new revision: https://phabricator.haskell.org/D4236

Nov 25 2017, 8:21 AM
newhoggy created D4236: Add new mbmi and mbmi2 compiler flags.
Nov 25 2017, 8:20 AM
newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

Looks like I'm unable to push to this revision anymore because it's closed?

Nov 25 2017, 2:31 AM

Nov 24 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

I set up another 32-bit environment, which seems to work better and have reproduced the build problem for 32-bit systems:

Nov 24 2017, 1:27 AM

Nov 23 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

I have the following problem when attempting to build on 32-bit Ubuntu Linux:

Nov 23 2017, 3:20 PM

Nov 22 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

Thanks Ben,

Nov 22 2017, 6:55 PM

Nov 13 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

This is exciting. Thank Ben for all your help!

Nov 13 2017, 3:11 PM
newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

I only just noticed after running my tests, the following output:

Nov 13 2017, 2:16 AM
newhoggy updated the diff for D4063: Add new mbmi and mbmi2 compiler flags.
  • Fix pattern match for pdep and pext instructions
Nov 13 2017, 2:11 AM

Nov 12 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

If it turns out that the cases callishPrimOpSupported for pdep and pext aren't necessary then I can remove them.

Nov 12 2017, 3:13 PM

Nov 9 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

Thanks Ben, I'll try to fill in the missing generic bits. Will appreciate any help on how to test it.

Nov 9 2017, 4:12 PM

Nov 2 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

So looks like the CPU native x86 instruction implementation and the C-function emulation works now.

Nov 2 2017, 6:39 AM
newhoggy updated the diff for D4063: Add new mbmi and mbmi2 compiler flags.
  • pdep and pext test cases
Nov 2 2017, 6:20 AM
newhoggy updated the diff for D4063: Add new mbmi and mbmi2 compiler flags.

pdep and pext test cases

Nov 2 2017, 5:57 AM

Oct 28 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

Thanks! That helps a lot.

Oct 28 2017, 1:49 AM

Oct 26 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

I'm creating a new test case cgrun075. I'm presuming the number I choose is no significant.

Oct 26 2017, 4:47 PM

Oct 24 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

Thanks for the help.

Oct 24 2017, 5:10 PM
newhoggy updated the diff for D4063: Add new mbmi and mbmi2 compiler flags.

Working pdep code for x86:

  • Properly initialise bmiVersion field
  • Implement x86 code generator for pdep and pext
Oct 24 2017, 4:20 PM

Oct 23 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

I did some more testing and found that the arguments are actually swapped around.

Oct 23 2017, 4:28 PM

Oct 17 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

Looks like it works now on my Macbook:

Oct 17 2017, 5:49 PM

Oct 16 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

I tried the following:

Oct 16 2017, 6:31 AM

Oct 15 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

I've found the problem.

Oct 15 2017, 7:52 AM
newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

You are right. I must use ghc rather than ghci. It seems I must also use at least -0.

Oct 15 2017, 2:56 AM

Oct 12 2017

newhoggy added a comment to D4063: Add new mbmi and mbmi2 compiler flags.

Does Debug.Trace work in the GHC source? It's possible my isBmi2Enabled function is never called and I'm trying to figure out why.

Oct 12 2017, 5:17 PM

Oct 3 2017

newhoggy commandeered D4063: Add new mbmi and mbmi2 compiler flags.

Outstanding issues:

Oct 3 2017, 5:20 PM