TT: add SSE2 support for x86 targets

VERIFIED FIXED

Status

Tamarin
Virtual Machine
VERIFIED FIXED
11 years ago
9 years ago

People

(Reporter: Edwin Smith, Assigned: Edwin Smith)

Tracking

Details

Attachments

(2 attachments)

(Assignee)

Description

11 years ago
tamarin-central has SSE2 support but tamarin-tracing doesn't. for direct performance comparisons we should add SSE2 support.

* use SSE2 registers to hold floating point values or quadword sized values (Box)
* use SSE2 operations when we can fit operands into SSE2 registers (any int operation, or *SD for scalar double ops)
* handle FPU->SSE moves when necessary (fmod, etc return result in FPU ST(0)) - does MOVQ do this?

SSE code is conditional on whether the cpu has SSE2 support (flag is already there).
(Assignee)

Updated

11 years ago
Assignee: nobody → edwsmith
(Assignee)

Comment 1

11 years ago
Created attachment 296629 [details] [diff] [review]
basic SSE2 support for floating point operations

TODO:
* add LIR_u2d
* heuristic for using x87 anyway since X87->XMM moves are expensive

preliminary results

                                X87     SSE
prime4                          125     94
boidsHeadless                   3031    3062
boidshackHeadless               1344    1312
DrawGridHeadless                2047    2063
access-binary-trees             1123    1124
access-fannkuch                 546     562
access-nbody                    234     219
access-nsieve                   765     764
bitops-3bit-bits-in-byte        31      31
bitops-bits-in-byte             93      94
bitops-bitwise-and              405     405
bitops-nsieve-bits              188     187
crypto-md5                      4104    4103
crypto-sha1                     1419    1420
math-cordic                     125     125
math-partial-sums               327     327
math-spectral-norm              157     109
s3d-cube                        1248    1264
s3d-morph                       125     125
s3d-raytrace                    1529    1529
string-fasta                    406     406
controlflow-recursive           1186    1185
Attachment #296629 - Flags: review?
(Assignee)

Updated

11 years ago
Attachment #296629 - Flags: review? → review?(rreitmai)
(Assignee)

Updated

11 years ago
Blocks: 412016
(Assignee)

Updated

11 years ago
No longer blocks: 412016
(Assignee)

Comment 2

11 years ago
adding u2d is no longer in scope of this bug, created 412299 for LIR_u2d
(Assignee)

Comment 3

11 years ago
Created attachment 297009 [details]
hg bundle of change merged with tip (not yet sanitized)
Attachment #297009 - Flags: review?
(Assignee)

Updated

11 years ago
Attachment #297009 - Flags: review? → review?(rreitmai)

Comment 4

11 years ago
Comment on attachment 296629 [details] [diff] [review]
basic SSE2 support for floating point operations

Assembler.cpp:588 did you mean '&' not '&&' 
Assembler.cpp:797 ucomisd(r,r) doesn't appear to set the flags, is this ok.
Attachment #296629 - Flags: review?(rreitmai) → review+

Comment 5

11 years ago
Comment on attachment 297009 [details]
hg bundle of change merged with tip (not yet sanitized)

good
Attachment #297009 - Flags: review+

Updated

11 years ago
Attachment #297009 - Flags: review?(rreitmai)
(Assignee)

Comment 6

11 years ago
(In reply to comment #4)
> (From update of attachment 296629 [details] [diff] [review])
> Assembler.cpp:588 did you mean '&' not '&&' 

yes i did, will fix.  (although both cases will assert anyway)

> Assembler.cpp:797 ucomisd(r,r) doesn't appear to set the flags, is this ok.

ucomisd() sets the condition codes.  callers of asm_fcmp() test for P or NP (parity bit only).  ucomisd only sets P when x != x, ie x is NaN, which is what we want.
(Assignee)

Comment 7

11 years ago
pushed
http://hg.mozilla.org/tamarin-tracing/?rev/f8d0a6a31700
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED

Updated

9 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.