Add an Intel-specific x86_cvtt2si instruction.

This is used to represent the non-trapping semantics of the cvttss2si and
cvttsd2si instructions (and their vectorized counterparts).

The overflow behavior of this instruction is specific to the Intel ISAs.

There is no float-to-i64 instruction on the 32-bit Intel ISA.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-26 15:35:32 -07:00
parent d13f29cfe4
commit ac69f3bfdf
5 changed files with 77 additions and 0 deletions

View File

@@ -87,6 +87,13 @@ ebb0:
; asm: xorps %xmm5, %xmm2
[-,%xmm2] v37 = bxor v11, v10 ; bin: 0f 57 d5
; Convert float to int. (No i64 dest on i386).
; asm: cvttss2si %xmm5, %ecx
[-,%rcx] v40 = x86_cvtt2si.i32 v10 ; bin: f3 0f 2c cd
; asm: cvttss2si %xmm2, %esi
[-,%rsi] v41 = x86_cvtt2si.i32 v11 ; bin: f3 0f 2c f2
; Unary arithmetic.
; asm: sqrtss %xmm5, %xmm2
@@ -267,6 +274,13 @@ ebb0:
; asm: xorps %xmm5, %xmm2
[-,%xmm2] v37 = bxor v11, v10 ; bin: 0f 57 d5
; Convert float to int. (No i64 dest on i386).
; asm: cvttsd2si %xmm5, %ecx
[-,%rcx] v40 = x86_cvtt2si.i32 v10 ; bin: f2 0f 2c cd
; asm: cvttsd2si %xmm2, %esi
[-,%rsi] v41 = x86_cvtt2si.i32 v11 ; bin: f2 0f 2c f2
; Unary arithmetic.
; asm: sqrtsd %xmm5, %xmm2