There is a method listed in both datasheets (S29GL064S datasheet, SST39V6401B datasheet).
From Table 6 for the SST part, we can get the device ID from this sequence:
This is the same as the sequence (named Autoselect) for the Spansion part:
The SST datasheet also helpfully includes a timing diagram:
So:
Write: Address 0x555, data 0xXXAA (note that XX may be 00 or FF)
Write: Address 0x2AA, data 0xXX55
Write: Address 0x555, data 0xXX90
Read: Address 0x0000, data <MFR ID>
Read: Address 0x0001, data <Device ID>
Then issue an exit code (write 0xF0 to any address for both parts).
That should work consistently for both devices assuming the timing is solid.
Regards