Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compiler] In-progress support for vector float (AVX) #171

Merged
merged 7 commits into from
Dec 30, 2020
Merged

Conversation

water111
Copy link
Collaborator

@water111 water111 commented Dec 29, 2020

Add basic support for vector floats.

  • Add support in IGen for register->register moves
  • Add support in IGen for usual GOAL loads and stores
  • Add support in IGen for vmulps. This is a common format of instruction.
  • Add support in IGen for vshufps.
  • Add support in IGen for RIP-relative loads and stores
  • Ability to load constant values (from a constant pool?)
  • Clean up the two different RegKinds. Maybe a RegClass and a RegKind?
  • Add support in rlet for creating a vf register
  • Add support for load and store assembly operations in the front-end and IR
  • Add support for basic 3-op assembly operations in the front-end and IR
  • Add support for blend operations in the front-end
  • Make sure coloring system is aware of vf registers. (Doesn't have to color them, just not clobber them)
  • Implement a few functions in vector or vector-h as an example (may have to add more operations).
  • Documentation for new asm forms.

@coveralls
Copy link

coveralls commented Dec 29, 2020

Pull Request Test Coverage Report for Build 453320586

  • 778 of 871 (89.32%) changed or added relevant lines in 19 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.3%) to 81.141%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/type_system/TypeSystem.cpp 6 7 85.71%
goalc/compiler/Env.cpp 8 9 88.89%
goalc/regalloc/Allocator.cpp 7 10 70.0%
goalc/regalloc/IRegister.cpp 7 11 63.64%
goalc/compiler/IR.cpp 108 114 94.74%
goalc/compiler/Util.cpp 0 6 0.0%
goalc/emitter/Register.cpp 6 12 50.0%
common/type_system/Type.cpp 5 13 38.46%
goalc/emitter/IGen.h 139 147 94.56%
goalc/emitter/Instruction.h 204 228 89.47%
Files with Coverage Reduction New Missed Lines %
game/overlord/iso.cpp 1 77.86%
goalc/emitter/Register.cpp 3 82.61%
Totals Coverage Status
Change from base Build 449727383: 0.3%
Covered Lines: 18914
Relevant Lines: 23310

💛 - Coveralls

@water111
Copy link
Collaborator Author

Getting close. The generated code for loading a constant vector is really bad:

(rlet ((vf1 :class vf :reset-here #t))
      (.lvf vf1 (new 'static 'vector :x 1.0 :y 1.2 :z 1.4 :w 1.6))
      )

becomes

- [0x10000] lea rax, [0x0000000000010007]          mov-sva igpr-1, static-structure
  [0x10007] sub rax, r15
  [0x1000a] vmovaps xmm0, [r15+rax*1]              mov ivf-0, [igpr-1 + 0]

it seems like we should support directly loading a static with .lvf.

@water111
Copy link
Collaborator Author

Now it is a single instruction (not linked, so the offset is wrong):

[0x10000] vmovaps xmm0, [0x0000000000010008]     mov-svl ivf-0, [static-structure]

@water111 water111 marked this pull request as ready for review December 30, 2020 20:27
@water111 water111 merged commit a80b331 into master Dec 30, 2020
@water111 water111 deleted the w/avx-support branch December 30, 2020 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants