load_complex and store_complex instructions (#309)
* Start adding the load_complex and store_complex instructions. N.b.: The text format is not correct yet. Requires changes to the lexer and parser. I'm not sure why I needed to change the RuntimeError to Exception yet. Will fix. * Get first few encodings of load_complex working. Still needs var args type checking. * Clean up ModRM helper functions in binemit. * Implement 32-bit displace for load_complex * Use encoding helpers instead of doing them all by hand * Initial implementation of store_complex * Parse value list for load/store_complex with + as delimiter. Looks nice. * Add sign/zero-extension and size variants for load_complex. * Add size variants of store_complex. * Add asm helper lines to load/store complex bin tests. * Example of length-checking the instruction ValueList for an encoding. Extremely questionable implementation. * Fix Python linting issues * First draft of postopt pass to fold adds and loads into load_complex. Just simple loads for now. * Optimization pass now works with all types of loads. * Add store+add -> store_complex to postopt pass * Put complex address optimization behind ISA flag. * Add load/store complex for f32 and f64 * Fixes changes to lexer that broke NaN parsing. Abstracts away the repeated checks for whether or not the characters following a + or - are going to be parsed as a number or not. * Fix formatting issues * Fix register restrictions for complex addresses. * Encoding tests for x86-32. * Add documentation for newly added instructions, recipes, and cdsl changes. * Fix python formatting again * Apply value-list length predicates to all LoadComplex and StoreComplex instructions. * Add predicate types to new encoding helpers for mypy. * Import FieldPredicate to satisfy mypy. * Add and fix some "asm" strings in the encoding tests. * Line-up 'bin' comments in x86/binary64 test * Test parsing of offset-less store_complex instruction. * 'sNaN' not 'sNan' * Bounds check the lookup for polymorphic typevar operand. * Fix encodings for istore16_complex.
This commit is contained in:
committed by
Dan Gohman
parent
5aa84a744b
commit
f636d795c5
@@ -227,6 +227,32 @@ ebb0:
|
||||
; asm: ucomiss %xmm5, %xmm5
|
||||
[-,%rflags] v312 = ffcmp v10, v10 ; bin: 0f 2e ed
|
||||
|
||||
; Load/Store Complex
|
||||
|
||||
[-,%rax] v350 = iconst.i32 1
|
||||
[-,%rbx] v351 = iconst.i32 2
|
||||
|
||||
; asm: movss (%rax,%rbx,1),%xmm5
|
||||
[-,%xmm5] v352 = load_complex.f32 v350+v351 ; bin: heap_oob f3 0f 10 2c 18
|
||||
; asm: movss 0x32(%rax,%rbx,1),%xmm5
|
||||
[-,%xmm5] v353 = load_complex.f32 v350+v351+50 ; bin: heap_oob f3 0f 10 6c 18 32
|
||||
; asm: movss -0x32(%rax,%rbx,1),%xmm5
|
||||
[-,%xmm5] v354 = load_complex.f32 v350+v351-50 ; bin: heap_oob f3 0f 10 6c 18 ce
|
||||
; asm: movss 0x2710(%rax,%rbx,1),%xmm5
|
||||
[-,%xmm5] v355 = load_complex.f32 v350+v351+10000 ; bin: heap_oob f3 0f 10 ac 18 00002710
|
||||
; asm: movss -0x2710(%rax,%rbx,1),%xmm5
|
||||
[-,%xmm5] v356 = load_complex.f32 v350+v351-10000 ; bin: heap_oob f3 0f 10 ac 18 ffffd8f0
|
||||
; asm: movss %xmm5,(%rax,%rbx,1)
|
||||
[-] store_complex.f32 v100, v350+v351 ; bin: heap_oob f3 0f 11 2c 18
|
||||
; asm: movss %xmm5,0x32(%rax,%rbx,1)
|
||||
[-] store_complex.f32 v100, v350+v351+50 ; bin: heap_oob f3 0f 11 6c 18 32
|
||||
; asm: movss %xmm2,-0x32(%rax,%rbx,1)
|
||||
[-] store_complex.f32 v101, v350+v351-50 ; bin: heap_oob f3 0f 11 54 18 ce
|
||||
; asm: movss %xmm5,0x2710(%rax,%rbx,1)
|
||||
[-] store_complex.f32 v100, v350+v351+10000 ; bin: heap_oob f3 0f 11 ac 18 00002710
|
||||
; asm: movss %xmm2,-0x2710(%rax,%rbx,1)
|
||||
[-] store_complex.f32 v101, v350+v351-10000 ; bin: heap_oob f3 0f 11 94 18 ffffd8f0
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user